I have automated the dbstart and dbstop but I need help in automating the actual initdatabase.ora file please help if you can
mark
Printable View
I have automated the dbstart and dbstop but I need help in automating the actual initdatabase.ora file please help if you can
mark
What do mean automate the init.ora?
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
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!!
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!
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
#!/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
When the system boots, dbstart and dbshut are called from /sbin/init.d/oracle. Take a look at this file.