Linux下啟動Oracle 11g資料庫監聽問題的解決

來源:互聯網
上載者:User

安裝環境:

Oracle_HOME = /home/oracle/oracle/product/11.2.0/db_1

ORACLE_HOME/network/admin/listener.ora檔案如下:

  1. # listener.ora Network Configuration File: /home/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora  
  2. # Generated by Oracle configuration tools.  
  3.   
  4. SID_LIST_LISTENER =  
  5.   (SID_LIST =  
  6.     (SID_DESC =  
  7.       (GLOBAL_DBNAME = sqtest)  
  8.       (ORACLE_HOME = /home/oracle/oracle/product/11.2.0/db_1)  
  9.       (SID_NAME = sqtest)  
  10.     )  
  11.   )  
  12.   
  13.   
  14. LISTENER =  
  15.   (DESCRIPTION =  
  16.     (ADDRESS = (PROTOCOL = TCP)(HOST = drum)(PORT = 1521))  
  17.   )  
  18.   
  19. ADR_BASE_LISTENER = /home/oracle/oracle  

ORACLE_HOME/network/admin/tnsnames.ora檔案如下:

  1. # tnsnames.ora Network Configuration File: /home/oracle/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora  
  2. # Generated by Oracle configuration tools.  
  3.   
  4. sqltest =  
  5.   (DESCRIPTION =  
  6.     (ADDRESS_LIST =  
  7.       (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))  
  8.     )  
  9.     (CONNECT_DATA =  
  10.       (SID = sqtest)  
  11.     )  
  12.   )  

執行lsnrctl start,結果如下:

  1. TNSLSNR for Linux: Version 11.2.0.1.0 - Production  
  2. System parameter file is /home/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora  
  3. Log messages written to /home/oracle/oracle/diag/tnslsnr/drum/listener/alert/log.xml  
  4. Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=drum.smartquick.com.cn)(PORT=1521)))  
  5.   
  6. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=drum)(PORT=1521)))  
  7. STATUS of the LISTENER  
  8. ------------------------  
  9. Alias                     LISTENER  
  10. Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production  
  11. Start Date                27-JUL-2012 14:48:11  
  12. Uptime                    0 days 0 hr. 0 min. 0 sec  
  13. Trace Level               off  
  14. Security                  ON: Local OS Authentication  
  15. SNMP                      OFF  
  16. Listener Parameter File   /home/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora  
  17. Listener Log File         /home/oracle/oracle/diag/tnslsnr/drum/listener/alert/log.xml  
  18. Listening Endpoints Summary...  
  19.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=drum.smartquick.com.cn)(PORT=1521)))  
  20. Services Summary...  
  21. Service "sqtest" has 1 instance(s).  
  22.   Instance "sqtest", status UNKNOWN, has 1 handler(s) for this service...  
  23. The command completed successfully  

在sqlplus下執行以下命令修複註冊執行個體,

sqlplus / as sysdba

startup

alter system register;

再執行lsnrctl status命令,顯示如下資訊

  1. LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 27-JUL-2012 14:53:28  
  2.   
  3. Copyright (c) 1991, 2009, Oracle.  All rights reserved.  
  4.   
  5. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=drum)(PORT=1521)))  
  6. STATUS of the LISTENER  
  7. ------------------------  
  8. Alias                     LISTENER  
  9. Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production  
  10. Start Date                27-JUL-2012 14:48:11  
  11. Uptime                    0 days 0 hr. 5 min. 17 sec  
  12. Trace Level               off  
  13. Security                  ON: Local OS Authentication  
  14. SNMP                      OFF  
  15. Listener Parameter File   /home/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora  
  16. Listener Log File         /home/oracle/oracle/diag/tnslsnr/drum/listener/alert/log.xml  
  17. Listening Endpoints Summary...  
  18.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=drum.smartquick.com.cn)(PORT=1521)))  
  19. Services Summary...  
  20. Service "sqtest" has 2 instance(s).  
  21.   Instance "sqtest", status UNKNOWN, has 1 handler(s) for this service...  
  22.   Instance "sqtest", status READY, has 1 handler(s) for this service...  
  23. Service "sqtestXDB" has 1 instance(s).  
  24.   Instance "sqtest", status READY, has 1 handler(s) for this service...  
  25. The command completed successfully  

探索資料庫執行個體已經註冊監聽成功。

關閉的步驟如下:

sqlplus下執行

shutdown

exit

在系統命令列執行

lsnrctl stop

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.