In this post; you will find start and stop scripts for EBS 12.2 .
This scripts are capable for starting and stopping Weblogic services as well.
Shutdown script kills the remaining application processes after it finish stopping apps services.
Scripts must be run using application owner OS user (for ex : applmgr).
Note that : This scripts are tested and verified in a Development envrionment. The risk is yours if you want to use them..
Also these scripts can be modified and make better ..
I will make some enhancements in a couple of days.. Enhancements like adding some lines for unlocking the domain , adding some exceptions and adding some echso for having a better output..
Example Run:
Note: Dont use the shutdown script on a single node environment which has a shared user as the owner of both database and application files. If you have such an environment (by the way; you shouldnt have such a confiuration ) and still if you want to use the shutdown script, comment the line with kill command in the shutdown script
This scripts are capable for starting and stopping Weblogic services as well.
Shutdown script kills the remaining application processes after it finish stopping apps services.
Scripts must be run using application owner OS user (for ex : applmgr).
Note that : This scripts are tested and verified in a Development envrionment. The risk is yours if you want to use them..
Also these scripts can be modified and make better ..
I will make some enhancements in a couple of days.. Enhancements like adding some lines for unlocking the domain , adding some exceptions and adding some echso for having a better output..
START SCRIPT:
### ERMAN ARSLAN EBS 12.2 APPS START automated
### 12/30/2013
## supply appspassword and weblogicpassword in sequence as command line arguments
### reviewed and tested 1/15/2015
if [ `whoami` == "root" ]
then
echo you can not run this script with root!
exiting
else
. /u01/apps/EBSapps.env run
{ echo apps; echo $1; echo $2; } | sh $ADMIN_SCRIPTS_HOME/adstrtal.sh -nopromptmsg
fi
### 12/30/2013
## supply appspassword and weblogicpassword in sequence as command line arguments
### reviewed and tested 1/15/2015
if [ `whoami` == "root" ]
then
echo you can not run this script with root!
exiting
else
. /u01/apps/EBSapps.env run
{ echo apps; echo $1; echo $2; } | sh $ADMIN_SCRIPTS_HOME/adstpall.sh -nopromptmsg
sleep 10
export APPLICATION_USER=`whoami`
kill -9 `ps -ef|grep appldev|grep -v grep |grep -v bash|grep -v sshd |grep -v "ps -ef"| grep -v shutdownapps | awk '{print $2}'`
fi
### 12/30/2013
## supply appspassword and weblogicpassword in sequence as command line arguments
### reviewed and tested 1/15/2015
if [ `whoami` == "root" ]
then
echo you can not run this script with root!
exiting
else
. /u01/apps/EBSapps.env run
{ echo apps; echo $1; echo $2; } | sh $ADMIN_SCRIPTS_HOME/adstrtal.sh -nopromptmsg
fi
SHUTDOWN SCRIPT:
### ERMAN ARSLAN EBS 12.2 APPS SHUTDOWN automated### 12/30/2013
## supply appspassword and weblogicpassword in sequence as command line arguments
### reviewed and tested 1/15/2015
if [ `whoami` == "root" ]
then
echo you can not run this script with root!
exiting
else
. /u01/apps/EBSapps.env run
{ echo apps; echo $1; echo $2; } | sh $ADMIN_SCRIPTS_HOME/adstpall.sh -nopromptmsg
sleep 10
export APPLICATION_USER=`whoami`
kill -9 `ps -ef|grep appldev|grep -v grep |grep -v bash|grep -v sshd |grep -v "ps -ef"| grep -v shutdownapps | awk '{print $2}'`
fi
FOR START using application owner user -> sh startupapps.sh apps welcome123
FOR STOP using application owner user -> sh shutdownapps.sh apps welcome123
Hi Erman,
ReplyDeleteThe script run excelently.
Thanks man.
Thanks for your feedback Ricardo.
ReplyDeleteHi Erman!
ReplyDeletein 12.1 shutdown takes 5 min.. In 12.2.6 shutdown takes 30 min... What a pain.. Any tricks to make it faster ? it the weblogic what makes it so slow i guess.
Thanks,Julian
Hi Julian,
ReplyDelete30 mins is not normal. Even 10 mins is not normal.
Did you do an analysis on that?
You need to check to log file and see where it is hanging...
Here is a similar approach for you ;
http://ermanarslan.blogspot.com.tr/2015/01/ebs-122-adstrtalsh-hangs-can-not-start.html
Hi Erman!
ReplyDeleteThanks for answering.. So how long your instance to take to shutdown and startup using adstrtal.sh and adstpall.sh scripts for reference on appstier ?
Br,Julian
Hi Julian,
ReplyDeleteadstpall.sh should complete in 1 min or 2 min. (unless you have lots of managed servers --i.e several oacore servers).
adstrtall.sh should complete max in 7-10 mins. (unless you have lots of managed servers --i.e several oacore servers).
This durations, ofcourse; may change according to your OS resources and machine.
Thanks Erman Arslan for your help. -Raju
ReplyDeleteIs the any -nopromptmsg for adpreclone.pl.
ReplyDeleteI am tying to automate the script. Could you please advise.
Hi Kishor ,
ReplyDeleteYou can do it . The same logic applies.
Here is an example. (I tested it)
apps_321 is the apps passwd and welcome1 is the weblogic admin passwd.(you can replace them with yours)
Wıth APPLMGR OS user ->
cd $ADMIN_SCRIPTS_HOME
{ echo apps_321; echo welcome1; } | perl adpreclone.pl appsTier
Hi Erman,
ReplyDeleteThanks for sharing the knowledge with us.
question: Do you also have anything that can help us to automate db bounce as well?
Thanks,
Mady
db bounce can be done with a simple bash script, Mady.
ReplyDeleteYou only need to write a simple bash script that executes the sqlplus.
For example this one:
export ORACLE_SID=
export ORACLE_HOME=
export PATH=$PATH:$ORACLE_HOME/bin
sqlplus "/as sysdba" 2>&1 >> somelogfilepath <<EOF
shutdown immediate;
EOF
#Likewise, for startup;
ReplyDeletesqlplus "/as sysdba" 2>&1 >> somelogfilepath <<EOF
startup;
EOF
Thanks Erman for your quick response and knowledge sharing...
ReplyDeleteThanks,
Mady
Thanks for Erman, have you able to use your script to setup autobounce using Crontab? I am having some issues with it in Solaris OS.
ReplyDeleteI didn't use it with crontab, but it can be used without any problems, as long as you configure the correct env on your crontab.
ReplyDeleteWhat issues do you have?
Hi,
ReplyDeleteHow to schedule adpreclone command in script
e.g:-
perl adpreclone.pl appsTier apps/apps
{ sleep 1s; echo welcome1; } |
Put it as a one-liner as follows;
ReplyDelete{ echo ; echo ; } | perl $ADMIN_SCRIPTS_HOME/adpreclone.pl appsTier
Or you may write it to a file(script file), and schedule that script in crontab.
Thank you!
ReplyDeleteHi Erman
ReplyDeleteI've used the shutdown script as follows, sh shutdownapps.sh but it's exiting with status 1. PFB
adstpall.sh: too few arguments specified.
USAGE: adstpall.sh [-skipNM] [-skipAdmin] [-nothreading]
adstpall.sh -secureapps [-skipNM] [-skipAdmin]
adstpall.sh -nodbchk [-skipNM] [-skipAdmin]
adstpall.sh -mode=allnodes
adstpall.sh: exiting with status 1
Hi Erman
ReplyDeleteI've used your script to stop application in EBS 12.2.5, but it existing with status 1.
adstpall.sh: too few arguments specified.
USAGE: adstpall.sh [-skipNM] [-skipAdmin] [-nothreading]
adstpall.sh -secureapps [-skipNM] [-skipAdmin]
adstpall.sh -nodbchk [-skipNM] [-skipAdmin]
adstpall.sh -mode=allnodes
adstpall.sh: exiting with status 1