>>> 此貼的回復 >> 這個是對於9i的:
編輯 /etc/oratab 文件 ,將重啟標志設為 'Y': BDQJDC:/u01/app/oracle/product/9.2.0.1.0:Y 創建文件 /etc/init.d/dbora ,輸入以下內容 #!/bin/sh # chkconfig: - 20 80 # description: Oracle auto start-stop script. # # 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=/opt/oracle/product/9.2.0.4 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/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/dbshut & ;; esac 保存該文件
chmod 750 /etc/init.d/dbora ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora 加上root用戶到dba 和 oinstall 組 (/etc/group) ,現在系統就可以啟動和關閉數據庫
[ 關閉窗口 ]