1.root 用户下修改ORATAB(将N该为Y):
[[email protected] ~]# vim /etc/oratab mytest:/oracle/product/11.2.0/db_1:Y
2.oracle 用户下修改:
[[email protected] ~]$cd $ORACLE_HOME/bin [[email protected] bin]$ vim dbstart
找到 ORACLE_HOME_LISTNER=$1 这行, 修改成: ORACLE_HOME_LISTNER=/oracle/product/11.2.0/ 或者直接修改成: ORACLE_HOME_LISTNER=$ORACLE_HOME 同样道理修改 dbshut
测试运行 dbshut, dbstart 看能否启动oracle 服务及listener服务
3.root 用户下修改:
[[email protected] ~]# cd /etc/rc.d/init.d/[[email protected] init.d]# vi oracle
#!/bin/bash # chkconfig: 345 99 10 # description: Startup Script for Oracle Databases # /etc/init.d/oracle export ORACLE_SID=oracle # export ORACLE_HOME_LISTNER=/oracle/product/11.2.0/bin/ export ORACLE_BASE=/apps/oracle export ORACLE_HOME=/oracle/product/11.2.0 export PATH=$PATH:$ORACLE_HOME/bin case "$1" in start) su oracle -c $ORACLE_HOME/bin/dbstart touch /var/lock/oracle echo "OK" ;; stop) echo -n "Shutdown Oracle: " su oracle -c $ORACLE_HOME/bin/dbshut rm -f /var/lock/oracle echo "OK" ;; *) echo "Usage: ‘basename $0‘ start|stop" exit 1 esac exit 0
保存!修改文件权限
chmod 755 /etc/rc.d/init.d/oracle
[[email protected] ~]# chkconfig --add oracle11g [[email protected] ~]# chkconfig oracle11g on
时间: 2024-11-06 10:54:27