在linux下使用dbstart和dbshut啟動和關閉db!
版本10.2
在9i下dbstart存在一bug:dbstart啟動時在$ORACLE_HOME/dbs下尋找initSID.ora,事實上在該目錄下不存在這個pfile,在9i 已經使用了spfile,所以要想正常透過dbstart啟動db,需要在目錄$ORACLE_HOME/dbs下建立一個initSID.ORA檔案,10g中我發現修正了這一問題。不過10g中dbstart在自動啟動listener時存在一問題:dbstart指令碼中存在下面一行:#ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
致使啟動是出現錯誤:
[oracle@xys bin]$ dbstart
Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr
Processing Database instance "TEST": log file /opt/app/oracle/product/10.2.0/db_1/startup.log
該錯誤顯示listener不能正常啟動,但是instance可以正常啟動,原因就是ORACLE_HOME_LISTNER設定的不對,我們修正一下,註釋下面一行,增加:
#ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
ORACLE_HOME_LISTNER=$ORACLE_HOME即可
[@more@]修正之後啟動和停止測試如下:
[oracle@xys bin]$ dbstart
Processing Database instance "TEST": log file /opt/app/oracle/product/10.2.0/db_1/startup.log
[oracle@xys bin]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 07-AUG-2008 12:17:51
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xys)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 07-AUG-2008 12:17:27
Uptime 0 days 0 hr. 0 min. 23 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /opt/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xys)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
Service "TEST" has 2 instance(s).
Instance "TEST", status UNKNOWN, has 1 handler(s) for this service...
Instance "TEST", status READY, has 1 handler(s) for this service...
Service "test_XPT" has 1 instance(s).
Instance "TEST", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@xys bin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 7 12:17:55 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@xys bin]$ dbshut
shutdown之後發現listener並沒有stop,檢視dbshut指令碼發現該指令碼中沒有lsnrctl stop命令,也就是說dbshut只是停止instance而並不會停止listener,如果想讓dbshut在停止instance的同時也停止listener,可以簡單的在dbshut的結尾加上lsnrctl stop.
[oracle@xys bin]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 07-AUG-2008 12:18:48
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xys)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 07-AUG-2008 12:17:27
Uptime 0 days 0 hr. 1 min. 20 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /opt/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xys)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
Service "TEST" has 1 instance(s).
Instance "TEST", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@xys bin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Aug 7 12:19:11 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> exit
Disconnected
[oracle@xys bin]$ echo $ORACLE_SID
TEST
[oracle@xys bin]$
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1008653/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- linux下開機使用dbstart和dbshut自動啟動和關閉db!Linux
- LINUX下開機使用dbstart和dbshut自動啟動和關閉dbLinux
- linux下dbstart,dbshut無法執行和自動啟動Oracle的辦法LinuxOracle
- 手寫linux下oracle的dbstart和dbshut指令碼LinuxOracle指令碼
- 利用dbstart和dbshut指令碼自動啟動和停止資料庫的問題指令碼資料庫
- 在Linux平臺下啟動和關閉MySQL服務LinuxMySql
- linux svn啟動和關閉Linux
- MySQL Windows下關閉和啟動MySqlWindows
- 如何讓oracle DB、監聽和oem開機啟動(dbstart)Oracle
- Linux 下 Oracle隨系統自動啟動和關閉LinuxOracle
- db2資料庫的啟動和關閉DB2資料庫
- 配置solaris 10_oracle10g_dbstart_dbshut自動啟停庫Oracle
- Linux下關閉和開啟防火牆Linux防火牆
- oracle啟動和關閉指令碼for LinuxOracle指令碼Linux
- mysql的啟動和關閉MySql
- 資料庫啟動和關閉資料庫
- dbstart&dbshut指令碼中的錯誤指令碼
- 2 Day DBA-管理Oracle例項-關閉和啟動Oracle例項-使用OEMDC關閉和啟動Oracle例項Oracle
- Linux 啟動過程, 初始化和關閉(轉)Linux
- oracle自動啟動和關閉的方法Oracle
- Linux下鍵盤燈開啟和關閉的指令碼Linux指令碼
- MySQL啟動和關閉命令總結MySql
- ASM CRS 例項啟動和關閉ASM
- AIX上關閉和啟動X serverAIServer
- Oracle例項的啟動和關閉Oracle
- LInux下檢視和關閉程式Linux
- Linux下的MongoDB安裝&啟動&關閉LinuxMongoDB
- Linux防火牆的關閉和開啟Linux防火牆
- linux關閉防火牆命令 linux防火牆關閉和開啟命令Linux防火牆
- Oracle自動啟動和關閉的方法 (轉)Oracle
- rhel as3下自動啟動和關閉oracle的指令碼S3Oracle指令碼
- linux下如何自動啟動db!Linux
- Oracle DG主備啟動和關閉流程Oracle
- oracle 例項啟動和關閉解讀Oracle
- MySQL 多例項啟動和關閉指令碼MySql指令碼
- Oracle資料庫的啟動和關閉Oracle資料庫
- ORACLE RAC 的啟動和關閉順序Oracle
- centos下nginx啟動、重啟、關閉CentOSNginx