【正文】
CLE_HOME/bin下。用vi分別編輯dbstart和dbshut腳本。將dbstart 和dbshut腳本中的ORACLE_HOME_LISTNER=$1修改為ORACLE_HOME_LISTNER=$ORACLE_HOME命令如下:[oracle@dbcloud ~]$ vi $ORACLE_HOME/bin/dbstart[oracle@dbcloud ~]$ vi $ORACLE_HOME/bin/dbshut修改后保存退出,問題解決然后保存退出,此時再運行dbstart,已經(jīng)不報錯了,但是沒有任何反應,ps一下進程,沒有oracle的進程,說明oracle實例沒有正常啟動。此時的原因是在/etc/oratab的設(shè)置問題,我們cat一下,發(fā)現(xiàn) Multiple entries with the same $ORACLE_SID are not allowed.orcl:/opt/oracle/app/dbhome_1:N最后設(shè)置的是N(我的環(huán)境中只有一個實例,因此只有一行配置語句),我們需要把“N”修改為“Y”。以上的工作做好之后,dbstart就可以正常使用了.[oracle@dbcloud /]$ dbstartProcessing Database instance orcl: log file /opt/oracle/app/dbhome_1/[oracle@dbcloud /]$ dbshutProcessing Database instance orcl: log file /opt/oracle/app/dbhome_1/ [oracle@dbcloud /]$ lsnrctl stopLSNRCTL for Linux: Version Production on 21MAY2015 15:06:54Copyright (c) 1991, 2014, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521)))The mand pleted successfully[oracle@dbcloud bin]$Oracle在linux下不會自動啟動,若要實現(xiàn)自動啟動,還需要做一些腳本配置。 在 /etc/,內(nèi)容如下:!/bin/sh chkconfig: 35 80 10 description: Oracle auto startstop 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/app/dbhome_1ORA_OWNER=oracleLOGFILE=/var/log/if [ ! f $ORA_HOME/bin/dbstart ]then echo Oracle startup: cannot start exitficase $1 in39。start39。) Start the Oracle databases:echo Starting Oracle Databases ... echo /var/log/oracledate + %T %a %D : Starting Oracle Databases as part of system up. /var/log/oracleecho /var/log/oraclesu $ORA_OWNER c $ORA_HOME/bin/dbstart /var/log/oracleecho Done Start the Listener:echo Starting Oracle Listeners ... echo /var/log/oracledate + %T %a %D : Starting Oracle Listeners as part of system up. /var/log/oracleecho /var/log/oraclesu $ORA_OWNER c $ORA_HOME/bin/lsnrctl start /var/log/oracleecho Done.echo /var/log/oracledate + %T %a %D : Finished. /var/log/oracleecho /var/log/oracletouch /var/lock/subsys/oracle。39。stop39。) Stop the Oracle Listener:echo Stoping Oracle Listeners ... echo /var/log/oracledate + %T %a %D : Stoping Oracle Listener as part of system down. /var/log/oracleecho /var/log/oraclesu $ORA_OWNER c $ORA_HOME/bin/lsnrctl stop /var/log/oracleecho Done.rm f /var/lock/subsys/oracle Stop the Oracle Database:echo Stoping Oracle Databases ... echo /var/log/oracledate + %T %a %D : Stoping Oracle Databases as part of system down. /var/log/oracleecho /var/log/oraclesu $ORA_OWNER c $ORA_HOME/bin/dbshut /var/log/oracleecho Done.echo echo /var/log/oracledate + %T %a %D : Finished. /var/log/oracleecho /var/log/oracle。39。restart39。)$0 stop$0 start。esac3. 改變文件權(quán)限 chmod 755 /etc/4. 添加服務 chkconfig level 35 oracle on5. 需要在關(guān)機或重啟機器之前停止數(shù)據(jù)庫,做一下操作 ln s /etc/ ln s /etc/6. 使用方法 service oracle start //啟動oracle service oracle stop //關(guān)閉oracle service oracle restart //重啟oracle68 / 68