日期:2014-05-16  浏览次数:20457 次

Linux下启动Oracle11g数据库监听问题的解决

安装环境:

ORACLE_HOME = /home/oracle/oracle/product/11.2.0/db_1

ORACLE_HOME/network/admin/listener.ora文件如下:

# listener.ora Network Configuration File: /home/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = sqtest)
      (ORACLE_HOME = /home/oracle/oracle/product/11.2.0/db_1)
      (SID_NAME = sqtest)
    )
  )


LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = drum)(PORT = 1521))
  )

ADR_BASE_LISTENER = /home/oracle/oracle

ORACLE_HOME/network/admin/tnsnames.ora文件如下:

# tnsnames.ora Network Configuration File: /home/oracle/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

sqltest =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = sqtest)
    )
  )

执行lsnrctl start,结果如下:

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /home/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /home/oracle/oracle/diag/tnslsnr/drum/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=drum.smartquick.com.cn)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=drum)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                27-JUL-2012 14:48:11
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /home/oracle/oracle/diag/tnslsnr/drum/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=drum.smartquick.com.cn)(PORT=1521)))
Services Summary...
Service "sqtest" has 1 instance(s).
  Instance "sqtest", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

在sqlplus下执行以下命令修复注册实例,

sqlplus / as sysdba

startup

alter system register;


再执行lsnrctl status命令,显示如下信息

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 27-JUL-2012 14:53:28

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=drum)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                27-JUL-2012 14:48:11
Uptime                    0 days 0 hr. 5 min. 17 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/oracle/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /home/oracle/oracle/diag/tnslsnr/drum/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=drum.smartquick.com.cn)(PORT=1521)))
Services Summary...
Service "sqtest" has 2 instance(s).
  Instance "sqtest", status UNKNOWN, has 1 handler(s) for this service...
  Instance "sqtest", status READY, has 1 handler(s) for this service...
Service "sqtestXDB" has 1 instance(s).
  Instance "sqtest", status READY, has 1 handler(s) for this service...
The command completed successfully

发现数据库实例已经注册监听成功。


关闭的步骤如下:

sqlplus下执行

shutdown

exit


<