******************************************************************
一、目录:/etc/init.d
******************************************************************
1、dbora_start.sh
#!/bin/sh
ORA_HOME=/export/home/oracle/product/9.2.0.4
ORA_OWNER=oracle
su - $ORA_OWNER -c "lsnrctl start"
su - $ORA_OWNER -c "sqlplus /nolog @$ORA_HOME/dbstart.sql"
2、dbora_shutdown.sh
#!/bin/sh
ORA_HOME=/export/home/oracle/product/9.2.0.4
ORA_OWNER=oracle
su - $ORA_OWNER -c "sqlplus /nolog @$ORA_HOME/dbshutdown.sql"
******************************************************************
二、目录:$ORA_HOME
******************************************************************
1、$ORA_HOME/dbstart.sql
conn / as sysdba
startup
exit
2、$ORA_HOME/dbshutdown.sql
conn / as sysdba
shutdown immediate
exit
******************************************************************
三、
******************************************************************
1、将dbora改成可执行
chmod 755 dbora_start.sh
chmod 755 dbora_shutdown.sh
2、将dbstart.sql改成oracle所有
chown oracle /export/home/oracle/product/9.2.0/dbstart.sql
chown oracle /export/home/oracle/product/9.2.0/dbshutdown.sql
3、然后作一个连接
ln -s /etc/init.d/dbora_start.sh /etc/rc2.d/S99dbora_start.sh
ln -s /etc/init.d/dbora_start.sh /etc/rc3.d/S99dbora_start.sh
ln -s /etc/init.d/dbora_start.sh /etc/rc5.d/S99dbora_start.sh
ln -s /etc/init.d/dbora_shutdown.sh /etc/rc0.d/K10dbora_shutdown.sh
ln -s /etc/init.d/dbora_shutdown.sh /etc/rc6.d/K10dbora_shutdown.sh