2、转换成root 用户来编辑启动脚本。 #su root #cd /etc/init.d #vi oracle 编辑内容如下: #!/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=/data/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/dbstart & su – $ORA_OWNER –c “lsnrctl start &” ;; ’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 & su – $ORA_OWNER –c “lsnrctl stop &” ;; esac -------------------------脚本到此结束。 连接到启动目录: