ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle 监听问题

oracle 监听问题

原创 Linux操作系统 作者:hu121bei 时间:2013-04-26 16:41:41 0 删除 编辑
在学习数据库的过程中,经常遇到数据库监听程序起不来,导致em连不上等各种问题,作为一个初学者,今天将学到的关于监听问题的知识,总结一下,希望与大家一起学习。
 
第一步,要通过netca 配置我们的监听,
 
[root@redhat4 ~]# su - oracle
[oracle@redhat4 ~]$ netca
----键入命令之后会弹出图形化界面,我们根据提示进行即可。
 
 
Oracle Net Services 配置:
正在配置监听程序:LISTENER
监听程序配置完成。
Oracle Net 监听程序启动:
正在运行监听程序控制:
      /u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl start LISTENER
   监听程序控制完成。
监听程序已成功启动。
默认本地命名配置完成。
已创建的 Net 服务名: jiagulun
成功完成 Oracle Net Services 配置。退出代码是0
第二,查看监听的状态
 
[oracle@redhat4 ~]$ lsnrctl status
 
结果如下:LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 25-APR-2013 23:06:41
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=redhat4)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                25-APR-2013 23:04:37
Uptime                    0 days 0 hr. 2 min. 4 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat4)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@redhat4 ~]$ lsnrtcl stop
-bash: lsnrtcl: command not found
[oracle@redhat4 ~]$ lsnrctl stop
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 25-APR-2013 23:09:11
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=redhat4)(PORT=1521)))
The command completed successfully
[oracle@redhat4 ~]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 25-APR-2013 23:09:31
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat4)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=redhat4)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                25-APR-2013 23:09:31
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat4)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
 
出现UNKNOWN 字样,说明监听程序没有监听到当前的数据库。我们需要解决这个问题。
 
具体步骤如下:
  1. 登入sqlplus 

[oracle@redhat4 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Apr 25 23:10:20 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size                  2020192 bytes
Variable Size              88083616 bytes
Database Buffers          188743680 bytes
Redo Buffers                6365184 bytes
Database mounted.
Database opened.

  1. 执行alter system register;命令

SQL> alter system register;

System altered.

  1. 退出 exit sqlplus

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

  1. 停止监听

lsnrctl stop

  1. 启动监听

lsnrctl start

 

  1. 查看监听状态

[oracle@redhat4 ~]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 25-APR-2013 23:12:36

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=redhat4)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                25-APR-2013 23:09:31
Uptime                    0 days 0 hr. 3 min. 4 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat4)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "jiagulun" has 1 instance(s).
  Instance "jiagulun", status READY, has 1 handler(s) for this service...
Service "jiagulunXDB" has 1 instance(s).
  Instance "jiagulun", status READY, has 1 handler(s) for this service...
Service "jiagulun_XPT" has 1 instance(s).
  Instance "jiagulun", status READY, has 1 handler(s) for this service...
The command completed successfully

监听信息出现我们数据库的名字  ,而且有READY字样  ,说明监听正常启动了


 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28811724/viewspace-759381/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-04-16

  • 博文量
    15
  • 访问量
    21824