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)
— update 2023-9-22 —-
Trace Listener Dynamic Registration
11 to 18 option
From 11.1.0.7 to 18.0, tracing can be enabled using the following command:
alter system set events='immediate trace name listener_registration level 3';
When finished collecting pmon traces,turn this off using:
alter system set events='immediate trace name listener_registration level 0';
19 tracing option
alter system set events 'trace[LREG] disk highest'; alter system set events = 'immediate trace name LREG_STATE level 3';
fo oter releases plese read doc below.
How to Trace Dynamic Registration from PMON or LREG (12c) (Doc ID 787055.1)
for example
SQL> oradebug setmypid Statement processed. SQL> oradebug dump LREG_STATE 3 Statement processed. SQL> oradebug tracefile_name /u01/app/oracle/diag/rdbms/anbob19c/anbob19c/trace/anbob19c_ora_2486.trc SQL> ho vi /u01/app/oracle/diag/rdbms/anbob19c/anbob19c/trace/anbob19c_lreg_2107.trc LREG State Dump Start ------------------------------ Last update: 88307 centi seconds (85 seconds ago) Flag: 0x4, 0x0 State: succ=1, wait=0, fail=0 CDB: root pdb 1 last pdb 4098 open max pdb 3 Dispatcher configuration index: cur 1 max 1 Network '-oracledefault-' pdb 1 : Local listeners: 0 - (ADDRESS=(PROTOCOL=TCP)(HOST=oel7db1)(PORT=1521)) pdb 1 dci 0 flg 0xa3 firewall=0, publish_service_acl=1 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=oel7db1)(PORT=1521))) flg=0x80000000 nse=0 pri=0x7f62cffe3270 Remote listeners: Handlers: Dedicated flg=0x80002002, upd=0x2, srvl=4 services=anbob19c, 86b637b62fdf7a65e053f706e80a27ca, pdb1, a1478fd0fed91a9ee05536b79bc2729a hdlr load=74, max=199 nam=DEDICATED adr=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=/u01/app/oracle/product/19.2.0/db_1/bin/oracle)(ARGV0='oracleanbob19c')(ARGS='(LOCAL=NO)')(ENVS='XDG_SESSION_ID=1,HOSTNAME=oel7db1,SHELL=/bin/bash,TERM=xterm,HISTSIZE=1000,ORACLE_PATH=/home/oracle/tpt-oracle-master,TMPDIR=/tmp,USER=oracle,LD_LIBRARY_PATH=/u01/app/oracle/product/19.2.0/db_1/lib:/lib:/usr/lib,LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:,ORACLE_SID=anbob19c,ORACLE_BASE=/u01/app/oracle,MAIL=/var/spool/mail/oracle,PATH=,PWD=/home/oracle,JAVA_HOME=/u01/app/oracle/product/19.2.0/db_1/jdk,LANG=en_US.UTF-8,HISTCONTROL=ignoredups,SHLVL=1,HOME=/home/oracle,TMP=/tmp,LOGNAME=oracle,CLASSPATH=/home/oracle/javacode/opengauss-jdbc-5.0.0.jar:/u01/app/oracle/product/19.2.0/db_1/jlib:/u01/app/oracle/product/19.2.0/db_1/rdbms/jlib:/u01/app/oracle/product/19.2.0/db_1/jdbc/lib/ojdbc8.jar:/u01/app/oracle/product/19.2.0/db_1/jdk/lib:/u01/app/oracle/product/19.2.0/db_1/jdk/lib/tools.jar:.,LESSOPEN=||/usr/bin/lesspipe.sh %s,ORACLE_HOME=/u01/app/oracle/product/19.2.0/db_1,_=/usr/local/bin/rlwrap,ORA_NET2_DESC=9,12,SKGP_SPAWN_DIAG_POST_FORK_TS=,SKGP_HIDDEN_ARGS=,SKGP_SPAWN_DIAG_PRE_FORK_TS=,SKGP_SPAWN_DIAG_PRE_EXEC_TS=,ORACLE_SPAWNED_PROCESS=1,RDMAV_FORK_SAFE=1,RDMAV_HUGEPAGES_SAFE=1')(ENV_POLICY=NONE)) inf=LOCAL SERVER pri=0x7f62cffe2d80 Local listener 0 pdb 1 flg=0x2, upd=0x8, srvl=4 services=anbob19c, 86b637b62fdf7a65e053f706e80a27ca, pdb1, a1478fd0fed91a9ee05536b79bc2729a hdlr load=0, max=0 nam=DEDICATED adr=(ADDRESS=(PROTOCOL=TCP)(HOST=oel7db1)(PORT=1521)) inf=REMOTE SERVER pri=0x7f62cffe3390 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: anbob19c (PDB 1 flag 0x1 state 1) flg=0x0, upd=0xa info=(INF=(HOST=oel7db1)(REGION=)(DB_NAME=anbob19c)(VINST_NAME=)) node load=360, max=5120 inst load=1, max=322 pri=0x7f62cffe2bd0 Instance: anbob19c (PDB 2 flag 0x1 state 1) flg=0x0, upd=0xa info=(INF=(HOST=oel7db1)(REGION=)(DB_NAME=anbob19c)(VINST_NAME=)) node load=360, max=5120 inst load=1, max=322 pri=0x7f62cffe3a38 Instance: anbob19c (PDB 3 flag 0x1 state 1) flg=0x0, upd=0xa info=(INF=(HOST=oel7db1)(REGION=)(DB_NAME=anbob19c)(VINST_NAME=)) node load=360, max=5120 inst load=1, max=322 pri=0x7f62cffe3cd8 Active Services: 0 - anbob19cXDB rsptr=0x7f62cfdfb1b8, rsflg=0x1, rspdbid=1, cur_srv=0x7f62cfdfb1c8 srvflg=0x105, srvupd=0x0 goodnes=0, delta=1, pri=0x7f62cffe2cc0 1 - anbob19c rsptr=0x7f62d03ef4f8, rsflg=0x1, rspdbid=1, cur_srv=0x7f62d03ef508 srvflg=0x104, srvupd=0x0 goodnes=0, delta=1, pri=0x7f62cffe2d20 2 - 86b637b62fdf7a65e053f706e80a27ca rsptr=0x7f62d03ef210, rsflg=0x1, rspdbid=1, cur_srv=0x7f62d03ef220 srvflg=0x104, srvupd=0x0 goodnes=0, delta=0, pri=0x7f62cffe36f0 3 - pdb1 rsptr=0x7f62d039f4f8, rsflg=0x1, rspdbid=3, cur_srv=0x7f62d039f508 srvflg=0x104, srvupd=0x0 goodnes=0, delta=1, pri=0x7f62cffe3af8 4 - a1478fd0fed91a9ee05536b79bc2729a rsptr=0x7f62d03cf238, rsflg=0x1, rspdbid=3, cur_srv=0x7f62d03cf248 srvflg=0x104, srvupd=0x0 goodnes=0, delta=0, pri=0x7f62cffe3a98 Inactive Services: Deleted Services: Service ACLs: Dump ACLs: Handlers: 0 - Dedicated flg=0x2002, upd=0x2, srvl=5 services=anbob19c, 86b637b62fdf7a65e053f706e80a27ca, pdb1, a1478fd0fed91a9ee05536b79bc2729a hdlr load=74, max=199 nam=DEDICATED adr=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=/u01/app/oracle/product/19.2.0/db_1/bin/oracle)(ARGV0='oracleanbob19c')(ARGS='(LOCAL=NO)')) inf=LOCAL SERVER pri=0x7f62cffe2c60 Dispatcher Handlers: 0 - D000(1) addr=(ADDRESS=(PROTOCOL=tcp)(HOST=oel7db1)(PORT=21175)) inf=DISPATCHER flg=0x1004, upd=0x0, srvl=1 services=anbob19cXDB hdlr load=0, max=1022 nam=D000 adr=(ADDRESS=(PROTOCOL=tcp)(HOST=oel7db1)(PORT=21175)) inf=DISPATCHER pri=0x7f62cffe3750 CMON Handlers for Listener Networks: Listen Endpoints: 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 1 sserv 1 rootparam 1 rootmap 0 ---------------------------- LREG State Dump End ----------------------------
— over —
对不起,这篇文章暂时关闭评论。