Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1097175
  • 博文数量: 276
  • 博客积分: 10077
  • 博客等级: 上将
  • 技术积分: 2513
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-24 20:31
文章分类

全部博文(276)

文章存档

2020年(1)

2015年(5)

2012年(2)

2011年(6)

2010年(7)

2009年(224)

2008年(31)

我的朋友

分类: Oracle

2010-11-20 20:30:54

Listener的动态注册与service_name
动态注册是由数据库的pmon进程完成的,如果实例启动时,没有启动listener,那么pmon就无法立即进行service的注册,而是在一定的时间间隔后再次进行注册。

重启监听后要重新register:
alter system register;

修改service_names:
alter system set service_name='TESTDB,LGX' scope=both;

静态注册的监听的状态是UNKNOWN,动态注册的监听服务中READY

[oracle@node1 ~]$ cat /opt/ora10g/product/10.2.0/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /opt/ora10g/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
 
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /opt/ora10g/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
  )
 
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = node1)(PORT = 1521))
    )
  )
 
[oracle@node1 ~]$
+++启动监听(没有监听SID)
[oracle@node1 ~]$ lsnrctl start
 
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 29-AUG-2010 06:42:00
 
Copyright (c) 1991, 2007, Oracle.  All rights reserved.
 
Starting /opt/ora10g/product/10.2.0/db_1/bin/tnslsnr: please wait...
 
TNSLSNR for Linux: Version 10.2.0.4.0 - Production
System parameter file is /opt/ora10g/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /opt/ora10g/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1)(PORT=1521)))
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date                29-AUG-2010 06:42:00
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/ora10g/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /opt/ora10g/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1)(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

+++启动监听后,对service_names进行注册
[oracle@node1 ~]$ sqlplus /nolog
 
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Aug 29 06:42:04 2010
 
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
 
SQL> conn /as sysdba
Connected.
SQL> show parameter names
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
global_names                         boolean     TRUE
service_names                        string      TESTDB
SQL> alter system register;
 
System altered.
 
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@node1 ~]$ lsnrctl status
 
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 29-AUG-2010 06:42:17
 
Copyright (c) 1991, 2007, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date                29-AUG-2010 06:42:00
Uptime                    0 days 0 hr. 0 min. 16 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/ora10g/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /opt/ora10g/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=node1)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "TESTDB" has 1 instance(s).
  Instance "TESTDB", status READY, has 1 handler(s) for this service...
Service "TESTDB_XPT" has 1 instance(s).
  Instance "TESTDB", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@node1 ~]$ 
阅读(1461) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~