How to Automate the restart of Oracle EBS WebLogic Managed OAcore & OAfm servers using Shell Script

How to Automate the restart of Oracle EBS WebLogic Managed OAcore & OAfm servers using Shell Script

Below shell script  is used for restarting the Oracle EBS WebLogic Managed OAcore & OAfm servers. You can run shell script or you can scheduled in CRONTAB to restart the servers on every night


#! /bin/ksh

. /erp_apps/oracle/app/EBSapps.env RUN

#This script is used for restarting the Oracle EBS Weblogic Managed OAcore & OAfm servers.You can run shell script using CRONTAB

#-------------------------------------------------------------------

# Mail list is used to email the list of users once the restart is done

#Maillist="sender_emailid receipt_email_id"

# Mail file is the file which will get emailed to the mail list users

#Mailfile= "Daily_OACore_OAfm_Stop_Start.log"

#This is the temporary log file where daily restart result will be stored

> $HOME/dba/log/Daily_OACore_OAfm_Stop_Start.log

# Stopping the OAcore & OAfm Servers

echo "Stopping Oracle EBS Weblogic Managed OAcore & OAfm on $HOSTNAME Servers"

#{ echo $APPSUSER ; echo $APPSPASS ; echo $WLSADMIN ; }| adstrtal.sh @-nopromptmsg

WLSADMIN=**********(password of WebLogic console)

echo $WLSADMIN|$ADMIN_SCRIPTS_HOME/admanagedsrvctl.sh stopall oacore -nopromptmsg >> $HOME/dba/log/Daily_OACore_OAfm_Stop_Start.log 2>& 1

echo $WLSADMIN|$ADMIN_SCRIPTS_HOME/admanagedsrvctl.sh stopall oafm -nopromptmsg >> $HOME/dba/log/Daily_OACore_OAfm_Stop_Start.log 2>& 1

sleep 90

echo "Oracle EBS Weblogic Managed OAcore & OAfm on $HOSTNAME servers are stopped successfully"

# Starting the Server

echo "Trying to start Oracle EBS Weblogic managed OAcore & OAfm on $HOSTNAME servers"

echo $WLSADMIN|$ADMIN_SCRIPTS_HOME/admanagedsrvctl.sh startall oacore -nopromptmsg >> $HOME/dba/log/Daily_OACore_OAfm_Stop_Start.log 2>& 1

echo $WLSADMIN|$ADMIN_SCRIPTS_HOME/admanagedsrvctl.sh startall oafm -nopromptmsg >> $HOME/dba/log/Daily_OACore_OAfm_Stop_Start.log 2>& 1

sleep 90

echo "Oracle EBS Weblogic managed OAcore & OAfm on $HOSTNAME servers are started successfully"

/usr/bin/mailx -s "Oracle EBS OAcore & OAfm Daily Restart-$HOSTNAME"  -r sender_emailid@nizamappsdba.blogspot.com receipt_email_id@nizamappsdba.blogspot.com < $HOME/dba/log/Daily_OACore_OAfm_Stop_Start.log

echo "Checking the port blocking 12353"

# Checking the Port Blocking for 12353 for all OAcore and OAfm managed servers, listing here the servers logs out file if any port block with 12353

x=$(find $EBS_DOMAIN_HOME  -name *server*.out -type f -exec grep -l "The Distributed Caching System failed to initialize on port: 12353" {} +)

echo $x > $HOME/dba/log/Port_Block_12353.log

if [[ -n "$x" ]]

then

/usr/bin/mailx -s "The Distributed Caching System failed to initialize on port: 12353 - Please check servers"  -r sender_emailid@nizamappsdba.blogspot.com receipt_email_id@nizamappsdba.blogspot.com < $HOME/dba/log/Port_Block_12353.log

fi

echo "Completed the script"

exit


appsdbahelp

17+ years of experience in Oracle Database, Oracle Cloud Infrastructure(OCI), Oracle EBS on Cloud, Oracle E-Business Suite, DevOps tools, Oracle WebLogic, Oracle Application Server, Oracle Access Manager and various Operating System flavors including Redhat Linux, UNIX (Solaris, HP-UX) and Windows. Expert in Oracle9i/10g/11g/12c/19c database administration, upgrade, configuration and tuning. Experience in Oracle E-Business Suite technological stack, including architecture, installation, configuration, maintenance, tuning, cloning and patching procedures. Expert in Oracle Cloud Infrastructure(OCI), Oracle EBS On Cloud and Oracle EBS Cloud Manager Experience with Oracle Cloud Solution and Expert of Oracle ERP/Oracle HCM Cloud deployment Experience in Terraform, JSON and chef cloud infrastructure automation framework Knowledge of ASM, Data Guard, Real Application Cluster, Exadata and Exalogic Knowledge of Oracle Enterprise Manager(OEM) Grid Control, Oracle WebLogic, Oracle Internet Directory, Oracle Access Manager and Apache Ability to analyze problem, develops solutions and bring program/project execution to completion.

Post a Comment

Previous Post Next Post