>>> 此贴的回复 >> 这个是对于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) ,现在系统就可以启动和关闭数据库
[ 关闭窗口 ]