首页 » ORACLE, ORACLE [C]系列 » Oracle 12c New Feature: Listener注册进程LREG

Oracle 12c New Feature: Listener注册进程LREG

Oracle 12c引入了一些大量的新特性,数据库隐藏参数12.2比11.2就多了2000多个, 同时对之前版本的结构也发生了一些变化,虽然不如有些特性像temporary undo\immemory\多租户那么受人重视.如DB_WRITER_PROCESSES DBWR最大进程数从10GR2的20到11gr2的36再到12C R2的100,Archiver Process进程数也从10增加到了30, 还有本篇要讲的Listenr的注册进程的改变. 在12c以前的版本中服务注册一直都是PMON进程负责,从12c起引入了LREG (listener registration)后台进程接管了这部分工作减轻PMON的工作,同样如果LREG 进程死了实例也会crash.

As with PMON in pre-12c versions, LREG (during registration) process provides the listener with information about the following:
* Names of the database services provided by the database
* Name of the database instance associated with the services and its current and maximum load
* Service handlers (dispatchers and dedicated servers) available for the instance, including their type, protocol addresses, and current and maximum load (for LBA)

listener没有启动LREG进程不能注册服务,LREG但是会每60秒尝试注册,如果local_listener没有配置,LREG会尝试连接默认的1521端口,直到监听进程启动, 如果Listener启动后LREG周期注册前,同样也可以使用”alter system register”立即注册服务.litener的注册信息可以使用listener_registration event dump在lreg trace中.

测试版本 oracle 12.2 EE on OEL6

alter system set events = 'immediate trace name listener_registration level 3';

查看lreg trace文件.
— 未启动listener时 —

*** 2017-02-22T15:58:04.665213+08:00 (CDB$ROOT(1))
kmlwait: status: succ=0, wait=0, fail=1
kmmlrl: listener failure retry: 6002
kmmlrl: 48 processes
kmmlrl: instance load 1
kmmlrl_network_hdlr_state: update
kmmlrl_network_hdlr_state: update for network '-oracledefault-'
kmmlrl_network_hdlr_state: beq handler: load=48, max=299, flag=0x80002002, upd=0x2
kmmlrl: nsgr update returned 0
kmmlrl: nsgr register returned 0
kmlwait: LREG woken up to process network events after 0 cs
kmlwait: status: succ=0, wait=0, fail=1

*** 2017-02-22T15:58:07.666581+08:00 (CDB$ROOT(1))
kmlwait: status: succ=0, wait=0, fail=1
...
kmlwait: status: succ=0, wait=0, fail=1

*** 2017-02-22T15:58:58.683514+08:00 (CDB$ROOT(1))
kmlwait: status: succ=0, wait=0, fail=1

*** 2017-02-22T15:59:01.683720+08:00 (CDB$ROOT(1))
kmlwait: status: succ=0, wait=0, fail=1

*** 2017-02-22T15:59:04.684796+08:00 (CDB$ROOT(1))
kmlwait: status: succ=0, wait=0, fail=1
kmmlrl: listener failure retry: 6001
kmmlrl: 48 processes
kmmlrl: instance load 1
kmmlrl_network_hdlr_state: update
kmmlrl_network_hdlr_state: update for network '-oracledefault-'
kmmlrl_network_hdlr_state: beq handler: load=48, max=299, flag=0x80002002, upd=0x2
kmmlrl: nsgr update returned 0
kmmlrl: nsgr register returned 0
kmlwait: LREG woken up to process network events after 0 cs
kmlwait: status: succ=0, wait=0, fail=1

# 启动了LISTENRE后

*** 2017-02-22T16:00:04.699377+08:00 (CDB$ROOT(1))
kmlwait: status: succ=0, wait=0, fail=1
kmmlrl: listener failure retry: 6002
kmmlrl: 46 processes
kmmlrl: instance load 0
kmmlrl_network_hdlr_state: update
kmmlrl_network_hdlr_state: update for network '-oracledefault-'
kmmlrl_network_hdlr_state: beq handler: load=46, max=299, flag=0x80002002, upd=0x2
kmmlrl: nsgr update returned 0
kmmlrl: nsgr register returned 0
kmlwait: LREG woken up to process network events after 8 cs
kmlwait: status: succ=0, wait=1, fail=0
kmlwait: LREG woken up to process network events after 11 cs
kmlwait: status: succ=0, wait=1, fail=0
kmlwait: LREG woken up to process network events after 11 cs
kmlwait: status: succ=0, wait=1, fail=0
kmlwait: LREG woken up to process network events after 18 cs
kmlwait: status: succ=1, wait=0, fail=0

*** 2017-02-22T16:00:07.701048+08:00 (CDB$ROOT(1))
kmlwait: status: succ=1, wait=0, fail=0

*** 2017-02-22T16:00:10.703823+08:00 (CDB$ROOT(1))
kmlwait: status: succ=1, wait=0, fail=0

*** 2017-02-22T16:00:13.704938+08:00 (CDB$ROOT(1))
kmlwait: status: succ=1, wait=0, fail=0

...

*** 2017-02-22T16:01:10.723033+08:00 (CDB$ROOT(1))
kmlwait: status: succ=1, wait=0, fail=0

*** 2017-02-22T16:01:13.724132+08:00 (CDB$ROOT(1))
kmlwait: status: succ=1, wait=0, fail=0

*** 2017-02-22T16:01:16.725179+08:00 (CDB$ROOT(1))
kmlwait: status: succ=1, wait=0, fail=0
kmmlrl_disp_check: update for time delta: 60025
kmmlrl: 49 processes
kmmlrl: node load 10
kmmlrl_network_hdlr_state: update for network '-oracledefault-'
kmmlrl_network_hdlr_state: beq handler: load=49, max=299, flag=0x80002002, upd=0x2
kmmlrl_disp_update_hdlr: D000 load 0
kmmlrl: nsgr update returned 0
kmlwait: LREG woken up to process network events after 0 cs
kmlwait: status: succ=1, wait=0, fail=0

*** 2017-02-22T16:01:19.727075+08:00 (CDB$ROOT(1))
kmlwait: status: succ=1, wait=0, fail=0

*** 2017-02-22T16:01:22.727602+08:00 (CDB$ROOT(1))
kmlwait: status: succ=1, wait=0, fail=0
Last update: 318704 (14 seconds ago)
Flag: 0x4, 0x0
State: succ=1, wait=0, fail=0

CDB: root pdb 1 last pdb 4098 open max pdb 2

Dispatcher configuration index: cur 1 max 1

Network '-oracledefault-' pdb 1 :

  Local listeners:
  0 - (ADDRESS=(PROTOCOL=TCP)(HOST=anbob.com)(PORT=1521)) pdb 1 dci 0
       state=1, err=0
       nse[0]=0, nse[1]=0, nte[0]=0, nte[1]=0, nte[2]=0
       ncre=0
       endp=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=anbob.com)(PORT=1521)))
         flg=0x80000000 nse=0 pri=0x7f4d5ed876f0
         hdlr flg=0x4 hdlr map count=0 eflg=0x4 pri=0x7f4d5ed88d98

  Remote listeners:

  Handlers:
    Dedicated
       flg=0x80002002, upd=0x2, srvl=3
       services=anbob.com,
                pdbanbob.com,
                465fa0ab8243396ae0530338a8c0fc9e.com
       hdlr load=49, max=299
       nam=DEDICATED
       inf=LOCAL SERVER
       pri=0x7f4d5ed87208
    Local listener 0 pdb 1
       flg=0x2, upd=0x8, srvl=3
       services=anbob.com,
                pdbanbob.com,
                465fa0ab8243396ae0530338a8c0fc9e.com
       hdlr load=0, max=0
       nam=DEDICATED
       adr=(ADDRESS=(PROTOCOL=TCP)(HOST=anbob.com)(PORT=1521))
       inf=REMOTE SERVER
       pri=0x7f4d5ed87808
    chidx=3 flg=0x1 ccflag=0x0
    chidx=2 flg=0x1 ccflag=0x0
    chidx=1 flg=0x1 ccflag=0x0
    chidx=0 flg=0x1 ccflag=0x0

Listeners:

Instance: anbob (PDB 1 flag 0x1 state 1)
  flg=0x0, upd=0xa
  info=(INF=(HOST=anbob)(REGION=)(DB_NAME=anbob)(VINST_NAME=))
  node load=10, max=5120
  inst load=1, max=472
  pri=0x7f4d5ed87028

Instance: anbob (PDB 2 flag 0x1 state 1)
  flg=0x0, upd=0xa
  info=(INF=(HOST=anbob)(REGION=)(DB_NAME=anbob)(VINST_NAME=))
  node load=10, max=5120
  inst load=1, max=472
  pri=0x7f4d5ed889f0
  0 - anbob.com
       flg=0x104, upd=0x2, pdb=1
       goodnes=0, delta=1, pri=0x7f4d5ed871a8
  1 - pdbanbob.com
       flg=0x104, upd=0x0, pdb=3
       goodnes=0, delta=0, pri=0x7f4d5ed88ab0
  2 - 465fa0ab8243396ae0530338a8c0fc9e.com
       flg=0x104, upd=0x0, pdb=3
       goodnes=0, delta=0, pri=0x7f4d5ed88a50
  3 - anbobXDB.com
       flg=0x105, upd=0x2, pdb=1
       goodnes=0, delta=1, pri=0x7f4d5ed87148
 Inactive Services:
 Deleted Services:
Service ACLs:
Dump ACLs:
Handlers:
  0 - Dedicated
       flg=0x2002, upd=0x2, srvl=4
       services=anbob.com,
                pdbanbob.com,
                465fa0ab8243396ae0530338a8c0fc9e.com
       hdlr load=49, max=299
       nam=DEDICATED
       adr=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=/u02/app/oracle/product/12.2.0/db_1/bin/oracle)(ARGV0='oracleanbob')(ARGS='(LOCAL=NO)'))
       inf=LOCAL SERVER
       pri=0x7f4d5ed870e8

Dispatcher Handlers:
  0 - D000(1)
       addr=(ADDRESS=(PROTOCOL=tcp)(HOST=anbob.com)(PORT=24297))
       inf=DISPATCHER 
       flg=0x1004, upd=0x2, srvl=1
       services=anbobXDB.com
       hdlr load=0, max=1022
       nam=D000
       adr=(ADDRESS=(PROTOCOL=tcp)(HOST=anbob.com)(PORT=24297))
       inf=DISPATCHER 
       pri=0x7f4d5ed87b58

CMON Handlers for Listener Networks:

Listen Endpoints:

       flg=0x80000000, nse=0
       lad=, lflg=0x73
       pre=HTTPS, sta=12541 mrg=(ADDRESS=(PROTOCOL=TCP)(HOST=anbob.com)(PORT=1521)) pri=0x7f4d5ed88c80

CONH Stats Current:
       chidx=0, num_conn=0, max_num_conn=0
       num_disc=0, num_acc=0, num_handlers=0

       chidx=1, num_conn=0, max_num_conn=0
       num_disc=0, num_acc=0, num_handlers=0

       chidx=2, num_conn=0, max_num_conn=0
       num_disc=0, num_acc=0, num_handlers=0

       chidx=3, num_conn=0, max_num_conn=0
       num_disc=0, num_acc=0, num_handlers=0


CONH Stats Global:
       chidx=0, num_conn=0, max_num_conn=0
       num_disc=0, num_acc=0, num_handlers=0

       chidx=1, num_conn=0, max_num_conn=0
       num_disc=0, num_acc=0, num_handlers=0

       chidx=2, num_conn=0, max_num_conn=0
       num_disc=0, num_acc=0, num_handlers=0

       chidx=3, num_conn=0, max_num_conn=0
       num_disc=0, num_acc=0, num_handlers=0


Per PDB State:
  pdb 1 state 1 sserv 1 rootparam 0 rootmap 0
  pdb 2 state 1 sserv 1 rootparam 1 rootmap 1
  pdb 3 state 0 sserv 1 rootparam 1 rootmap 1

----------------------------
End Registration Information
----------------------------

*** 2017-02-22T16:01:33.929347+08:00 (CDB$ROOT(1))

# 查看1521端口的进程信息

[oracle@anbob trace]$ lsof -iTCP:1521
COMMAND    PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
ora_lreg_ 4008 oracle   12u  IPv4  18960      0t0  TCP anbob.com:45857->anbob.com:ncube-lm (ESTABLISHED)
tnslsnr   5255 oracle    8u  IPv6  18775      0t0  TCP *:ncube-lm (LISTEN)
tnslsnr   5255 oracle   14u  IPv6  18961      0t0  TCP anbob.com:ncube-lm->anbob.com:45857 (ESTABLISHED)
打赏

,

对不起,这篇文章暂时关闭评论。