Click to See Complete Forum and Search --> : automating a database startup


hm3aq
10-30-2000, 01:45 PM
I have automated the dbstart and dbstop but I need help in automating the actual initdatabase.ora file please help if you can

mark

mhaller
10-30-2000, 01:50 PM
What do mean automate the init.ora?

sambavan
10-30-2000, 03:20 PM
If you have put the dbstart and dbshut scripts in the /etc/init.d/dbora file then make sure that your oratab files under /var/opt/oracle/oratab have the instances set to Y. this would enable the instances to start at the time of system boot and shutdown at the time of syste shutdown. On the other hand if your want your instances to be started and shutdown at perticular times, then you could creat a shell script and put it in the cron tab. I hope that this would answer your question. In the future, pl. don't forget to include the oracle version and platform in your postings, such that it would help folks to better trouble shoot the issue.

Good luck,
Sam

hm3aq
10-31-2000, 05:23 AM
Hi I'm sorry about forgetting that information I'm working on linux platform with red hat 6.2 and oracle 8i. I have done as you say, I have set the instance to Y but I still have to do this command to get the initSID.ora to start:

I login as sys/oracle as sysdba

CONNECT INTERNAL

mark = database

STARTUP PFILE=u01/app/oracle/admin/mark/pfile/initmark.ora;


after this the database is working

I want to automate it so that it does on system boot up!!

hm3aq
10-31-2000, 05:25 AM
Yes I wish to automate the init.ora file so that it loads straight from a system boot rather than doing the startup command in an oracle instance!

mhaller
11-01-2000, 11:37 AM
You need to create a link for the init.ora.

cd $ORACLE_HOME/dbs
ln -s /u01/app/oracle/admin/mark/pfile/initmark.ora initmark.ora

hm3aq
12-04-2000, 05:44 AM
#!/bin/bash
#
#
#
#
#Setup environment for script execution
. /home/oracle/.bash_profile

#determine and execute action based on command line parameter

case "$1" in
start)
echo "Starting Oracle database(s) listed in etc/oratab ..."
sleep 2
su - oracle -c "$ORACLE_HOME/bin/dbstart"
echo "starting TNS listener ..."
sleep 2
su - oracle -c "$ORACLE_HOME/bin/lsnrctl start"
touch /var/lock/subsys/dbora
;;
stop)
echo "Shutting down TNS listener ..."
sleep 2
su - oracle -c "$ORACLE_HOME/bin/lsnrctl stop"
echo "Shutting down Oracle database(s) listed in /etc/oratab ..."
sleep 2
su - oracle -c "$ORACLE_HOME/bin/dbshut"
rm -f /var/lock/subsys/dbora
;;
status)
ps -ax | grep -e ora_ -e tnslsnr
;;
*)
echo "Usage:dbora {start|stop|status}"
exit 1
esac

exit 0

Have a look and try and help

Mark

mhaller
12-04-2000, 12:42 PM
When the system boots, dbstart and dbshut are called from /sbin/init.d/oracle. Take a look at this file.