【1】在root账号下
使用命令vi /etc/oratab编辑文件/etc/oratab,把N修改成Y
- DB1:/u01/app/oracle/product/OraDb11g_home1:Y
-
主机名 oracle_home
【2】在oracle账号下,cd $ORACLE_HOME/bin,把ORACLE_HOME_LISTNER=$1,修改成ORACLE_HOME_LISTNER=$ORACLE_HOME
- [oracle@db01 ~]$ cd $ORACLE_HOME/bin
- [oracle@db01 bin]$ vi dbstart
- # First argument is used to bring up Oracle Net Listener
- ORACLE_HOME_LISTNER=$ORACLE_HOME
- if [ ! $ORACLE_HOME_LISTNER ] ; then
- echo "ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener"
-
echo "Usage: $0 ORACLE_HOME"
【3】在oracle账号下 cd $ORACLE_HOME/bin,编辑dbshut文件,找到 ORACLE_HOME_LISTNER=$1,修改成ORACLE_HOME_LISTNER=$ORACLE_HOME
- # The this to bring down Oracle Net Listener
-
ORACLE_HOME_LISTNER=$ORACLE_HOME
【4】切换到root账号下vi /etc/rc.d/rc.local
- [root@db01 ~]# vi /etc/rc.d/rc.local
- #!/bin/sh
- #
- # This script will be executed *after* all the other init scripts.
- # You can put your own initialization stuff in here if you don't
- # want to do the full Sys V style init stuff.
- touch /var/lock/subsys/local
- su oracle -lc "/u01/app/oracle/product/OraDb11g_home1/bin/lsnrctl start"
- su oracle -lc /u01/app/oracle/product/OraDb11g_home1/bin/dbstart