Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

baan+oracle shutdown script help

Cem Tugrul
Esteemed Contributor

baan+oracle shutdown script help

Hello Forum,
i have Baan Erp package with oracle 9.2.0
on hp-ux 11i...Every Friday night i close
Baan erp application and then oracle db
below the steps;
1- cd baan/bse/etc
2- ./rc.stop
close Baan application
3-su - oracle
4-sqlplus /nolog
5-connect / as sysdba
6-shutdown immediate
7-exit
8-exit
9-lsnrctl
10-stop
11-exit

As you seen after 11 steps i go on for offline bck...Now i want to this from a script
and also want to write a start script after bck...but HOW?
Thank's so much for your kind concern&support
Best Regards,
Our greatest duty in this life is to help others. And please, if you can't
7 REPLIES
Mark Greene_1
Honored Contributor

Re: baan+oracle shutdown script help

I don't know about the Baan apps, but I do know that with 9.2 you can shutdown Oracle via script like this:

su - oracle -c "$ORACLE_HOME/bin/dbshut"; echo $?
wait
su - oracle -c "$ORACLE_HOME/bin/agentctl stop"; echo $?
wait
su - oracle -c "$ORACLE_HOME/bin/lsnrctl stop"; echo $?
wait
su - oracle -c "$ORACLE_HOME/bin/oemctl stop oms &"; echo $?
wait


If you are not running the oemctl process, you can skip that part.

mark
the future will be a lot like now, only later
Peter Leddy_1
Esteemed Contributor

Re: baan+oracle shutdown script help

Hi,

You could try a script like this, I'm not sure what the name of your baan startup script is but I just put in rc.start -

#!/sbin/sh
#
# change the value of ORACLE_HOME to be correct
# for your installation
#
ORACLE_HOME=/u01/app/oracle/product/9.2
PATH=${PATH}:$ORACLE_HOME/bin
#
# change the value of ORACLE to the login name of
# the oracle owner at your site
ORACLE_USER=oracle
export ORACLE_HOME PATH
#
LOG=$ORACLE_HOME/startup.log
touch $LOG
chmod a+r $LOG
#
case $1 in
'start')
echo "$0: starting up" >> $LOG
date >> $LOG

# Start SQL*NET V2
echo "starting V2 listener"
su - $ORACLE_USER -c "/usr/local/bin/listener_start" >> $LOG 2>&1

# Start Agent
echo "starting agent"
/baan/bse/etc/rc.start >>$LOG 2>&1

# Start the database(s)
echo "starting Oracle databases"
su - $ORACLE_USER -c "/usr/local/bin/dbstart" >> $LOG 2>&1
;;
'stop')
echo "$0: shutting down" >> $LOG
date >> $LOG

# Stop Agent
echo "stopping Baan"
/baan/bse/etc/rc.stop >> $LOG 2>&1

# Stop SQL*NET V2
echo "stopping V2 listener"
su - $ORACLE_USER -c "/usr/local/bin/listener_stop" >> $LOG 2>&1

# Stop the database(s)
echo "stopping Oracle databases"
su - $ORACLE_USER -c "/usr/local/bin/dbshut" >> $LOG 2>&1
;;
*)
echo "usage: $0 {start|stop}"
exit
esac
#
exit



HTH,

Peter
Peter Leddy_1
Esteemed Contributor

Re: baan+oracle shutdown script help

I should have mentioned that you should use the startup scripts that Mark gave, the scripts in my previous reply are customized.

Peter
Cem Tugrul
Esteemed Contributor

Re: baan+oracle shutdown script help

Thank's Mark & Peter,

According to Mark's answer;
su - oracle -c "$ORACLE_HOME/bin/dbshut"; echo $?
does it make DB shutdown normal or immediate
because i want to use shutdown immediate...
Best Regards,
Our greatest duty in this life is to help others. And please, if you can't
Peter Leddy_1
Esteemed Contributor

Re: baan+oracle shutdown script help

The version of the script I just checked uses immediate and I think they are all the same.

Peter
Ignacio Rodríguez Arrós
Frequent Advisor

Re: baan+oracle shutdown script help

I am also user of baan IVc4 with oracle 9 and hpux 11i, and i use the scripts attached to make a dayly backup stoping baan and oracle.
Cem Tugrul
Esteemed Contributor

Re: baan+oracle shutdown script help

i am using Ignacio's script...
Our greatest duty in this life is to help others. And please, if you can't