分类: Oracle
2008-11-02 11:55:10
在/etc/init.d dbora_start.sh
#!/bin/sh
ORA_HOME=/export/home/oracle/product/9.2.0
ORA_OWNER=oracle
su - $ORA_OWNER -c "lsnrctl start"
su - $ORA_OWNER -c "sqlplus /nolog @$ORA_HOME/dbstart.sql"
dbora_shutdown.sh
#!/bin/sh
ORA_HOME=/export/home/oracle/product/9.2.0
ORA_OWNER=oracle
su - $ORA_OWNER -c "sqlplus /nolog @$ORA_HOME/dbshutdown.sql"
$ORA_HOME/dbstart.sql
conn / as sysdba
startup
exit
$ORA_HOME/dbshutdown.sql
conn / as sysdba
shutdown immediate
exit
将dbora改成可执行
chmod 755 dbora_start.sh
chmod 755 dbora_shutdown.sh
将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
然后作一个连接
ln -s /etc/init.d/dbora /etc/rc2.d/S99dbora_start.sh
ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora_shutdown.sh