- 论坛徽章:
- 0
|
Solaris下的oracle 817,怎么在系统启动时自动启动oracle呀
To make the database and Net8 listener start up automatically when the server reboots and shut down automatically when the server shuts down, you’ll need to create a dbora file in /etc/init.d and link it to /etc/rc2.d and /etc/rc0.d. You’ll need to do this as the root user. First create a file called dbora in /etc/init.d as follows:
#!/bin/sh
ORA_HOME=/u01/app/oracle/product/8.1.7
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start') # Start the Oracle databases and Net8 listener
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart" &
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start" &
# Next line for Oracle 8.1.7 only
su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl start"
;;
'stop') # Stop the Oracle databases and Net8 listener
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop" &
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut" &
# Next line for Oracle 8.1.7 only
su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl stop"
;;
esac
After creating the dbora file, you need to link it to /etc/rc2.d and /etc/rc0.d:
ln -s /etc/init.d/dbora /etc/rc2.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora |
|