主要有三個步驟:
1. 將 /var/opt/oracle/oratab 檔案內的 DBNAME:/oracle/product/9.2.0:N 改成 DBNAME:/oracle/product/9.2.0:Y
2. 在 /etc/init.d/ 建立一個為 dbora 的檔案,權限為 744,OWNER 為 root,GROUP 為 sys。檔案內容如下:
=======================================================
#!/bin/sh
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/oracle/product/9.2.0
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:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start" &
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart &
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop" &
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut &
;;
esac
=======================================================
3. 在 /etc/rc3.d 目錄下建立一個 S99dbora 的 soft link 至 /etc/init.d/dbora
指令為: ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
重新開機測試資料庫是否能被自動帶起。
沒有留言:
張貼留言