pmon

1. Clean resource of process disconnection

Pfile中增加如下event
event='10246 trace name context forever, level 10'

SQL> show parameter event

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
event                  string  10246 trace name context forev                                                 er, level 10
xml_db_events                        string      enable

C:\Users\blue>sqlplus system/oracle@BLUE1_11GRAC

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Feb 2 14:15:38 2015

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management,
OLAP,
Data Mining and Real Application Testing options

SQL> select sysdate from dual;

SYSDATE
------------
02-FEB-15

当前会话的pid如下
SQL> select p.spid from v$process p, v$session s where p.addr=s.paddr and s.sid=
(select sid from v$mystat where rownum=1);

SPID
------------------------
27847

服务器端杀掉连接的session会话的pid
[oracle@oel11g1 ~]$ ps -ef | grep 27847
oracle   27847     1  0 14:15 ?        00:00:00 oracleblue1 (LOCAL=NO)
oracle   28599 26886  0 14:20 pts/2    00:00:00 grep 27847
[oracle@oel11g1 ~]$ kill -9 27847

查看pmon的trace file
[oracle@oel11g1 ~]$ ps -ef | grep pmon
grid      3694     1  0 11:33 ?        00:00:01 asm_pmon_+ASM1
oracle   26443     1  0 14:07 ?        00:00:00 ora_pmon_blue1



*** 2015-02-02 14:18:35.765
PMON woken up to process network events

*** 2015-02-02 14:22:20.977
marked process 0x804c6eb0 pid=33 serial=4 ospid = 27847 dead
User session information :
  sid: 45 ser: 9
  client details:
    O/S info: user: blue, term: BLUE-PC, ospid: 5128:6336
    machine: WORKGROUP\BLUE-PC program: sqlplus.exe
    application name: SQL*Plus, hash value=3669949024

*** 2015-02-02 14:22:20.978
deleting process 0x804c6eb0 pid=33 serial=4 priority=0
deleting session 0x807c9488 sid=45 serial=9
[claim lock for dead process][lp 0x7f294ba0][p 0x7fb53928.27847][hist x4a1224a1], conv_ast_kjl ((nil))
[claim lock for dead process][lp 0x7f28ff08][p 0x7fb53928.27847][hist x4a1224a1], conv_ast_kjl ((nil))
deletion of process 804c6eb0 pid=33 seq=4 successful
PMON woken up to process network events

2.Monitor background process

C:\Users\blue>sqlplus system/oracle@BLUE1_11GRAC

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Feb 2 14:38:54 2015

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management,
OLAP,
Data Mining and Real Application Testing options

SQL> select p.spid from v$process p, v$session s where p.addr=s.paddr and s.sid=
(select sid from v$mystat where rownum=1);

SPID
------------------------
31092

------Kill lgwr---------
[oracle@oel11g1 ~]$ ps -ef | grep lgwr
grid      3759     1  0 11:33 ?        00:00:00 asm_lgwr_+ASM1
oracle   26515     1  0 14:07 ?        00:00:00 ora_lgwr_blue1
oracle   31240 26886  0 14:39 pts/2    00:00:00 grep lgwr
[oracle@oel11g1 ~]$ kill -9 26515  --kill掉26515进程lgwr

查看trace文件
*** 2015-02-02 14:41:10.271
Background process LGWR found dead
Oracle pid = 18
OS pid (from detached process) = 26515 
OS pid (from process state) = 26515
dtp = 0x60023dd0, proc = 0x804b73e8
Dump of memory from 0x0000000060023DD0 to 0x0000000060023E30
060023DD0 000000C2 00000000 804B73E8 00000000  [.........sK.....]
060023DE0 00000000 00000000 00000000 5257474C  [............LGWR]
060023DF0 00000200 00000000 00006793 00000000  [.........g......]
060023E00 000E53FA 00000000 3CB046E0 00007F1C  [.S.......F.<....]
060023E10 00006793 00000000 000E53FA 00000000  [.g.......S......]
060023E20 00000001 19A678D5 00040001 00000000  [.....x..........]
Dump of memory from 0x00000000804B73E8 to 0x00000000804B84A0
0804B73E0                   00000301 00000000          [........]
0804B73F0 00000302 00000000 00000000 00000000  [................]
0804B7400 804B73E8 00000000 804B7408 00000000  [.sK......tK.....]
0804B7410 804B7408 00000000 00000000 00000000  [.tK.............]
0804B7420 00000000 00000000 00000000 00000000  [................]
     ......
Repeat 113 times
0804B8450 804B8450 00000000 804B8450 00000000  [P.K.....P.K.....]
0804B8460 00000000 00000000 804B8468 00000000  [........h.K.....]
0804B8470 804B8468 00000000 00000000 00000000  [h.K.............]
0804B8480 00000000 00000000 00000000 00000000  [................]
  Repeat 1 times
kjzduptcctx: Notifying DIAG for crash event
----- Abridged Call Stack Trace -----
ksedsts()+465<-kjzdssdmp()+267<-kjzduptcctx()+232<-kjzdicrshnfy()+63<-ksuitm()+5570<-ksulhdcb()+489<-ksucln()+7265<-ksbrdp()+1045<-opirip()+623<-opidrv()+603<-sou2o()+103<-opimai_real()+250<-ssthrdmain()+265<-main()+201<-__libc_start_main()+244 
----- End of Abridged Call Stack Trace -----

*** 2015-02-02 14:41:10.831
PMON (ospid: 26443): terminating the instance due to error 470
ksuitm: waiting up to [5] seconds before killing DIAG(26461)


----kill dbw0-----
oracle    6020  5250  0 11:33 pts/2    00:00:00 grep oracle
[oracle@oel11g1 ~]$ ps -ef | grep ora_dbw*
oracle    6243     1  0 11:35 ?        00:00:00 ora_dbrm_blue1
oracle    6290     1  0 11:35 ?        00:00:00 ora_dbw0_blue1
oracle    6604  5250  0 11:36 pts/2    00:00:00 grep ora_dbw*
[oracle@oel11g1 ~]$ kill -9 6290

*** 2015-02-04 11:36:07.530
Background process DBW0 found dead
Oracle pid = 17
OS pid (from detached process) = 6290 
OS pid (from process state) = 6290
dtp = 0x6001bc70, proc = 0x804b6330
Dump of memory from 0x000000006001BC70 to 0x000000006001BCD0
06001BC70 00000041 00000000 804B6330 00000000  [A.......0cK.....]
06001BC80 00000000 00000000 00000000 30574244  [............DBW0]
06001BC90 00000200 00000000 00001892 00000000  [................]
06001BCA0 0000FFFB 00000000 82CFD6E0 00007F15  [................]
06001BCB0 00001892 00000000 0000FFFB 00000000  [................]
06001BCC0 00000001 1999255B 00010000 00000000  [....[%..........]
Dump of memory from 0x00000000804B6330 to 0x00000000804B73E8
0804B6330 00000301 00000000 00000302 00000000  [................]
0804B6340 00000000 00000000 804B6330 00000000  [........0cK.....]
0804B6350 804B6350 00000000 804B6350 00000000  [PcK.....PcK.....]
0804B6360 00000000 00000000 00000000 00000000  [................]
        Repeat 1 times
0804B6380 00000000 00000000 0000001F 00000000  [................]
0804B6390 7FD8F188 00000000 79715DC8 00000000  [.........]qy....]
0804B63A0 800CB758 00000000 79714E50 00000000  [X.......PNqy....]
0804B63B0 00000000 00000000 79714EE8 00000000  [.........Nqy....]
0804B63C0 79714EE8 00000000 79715DA8 00000000  [.Nqy.....]qy....]
0804B63D0 00000601 00000010 800528E0 00000000  [.........(......]
0804B63E0 800CB758 00000000 00000011 00000000  [X...............]
0804B63F0 00000000 00000011 00000001 FFFB758E  [.............u..]
0804B6400 7AB3CC18 00000000 00000000 00000000  [...z............]
0804B6410 00000000 00000000 00000000 00000000  [................]
        Repeat 113 times
0804B7390 00000000 00000000 804B7398 00000000  [.........sK.....]
0804B73A0 804B7398 00000000 00000000 00000000  [.sK.............]
0804B73B0 804B73B0 00000000 804B73B0 00000000  [.sK......sK.....]
0804B73C0 00000000 00000000 00000000 00000000  [................]
        Repeat 1 times
0804B73E0 00000000 00000000                    [........]        
kjzduptcctx: Notifying DIAG for crash event
----- Abridged Call Stack Trace -----
ksedsts()+465<-kjzdssdmp()+267<-kjzduptcctx()+232<-kjzdicrshnfy()+63<-ksuitm()+5570<-ksulhdcb()+489<-ksucln()+7265<-ksbrdp()+1045<-opirip()+623<-opidrv()+603<-sou2o()+103<-opimai_real()+250<-ssthrdmain()+265<-main()+201<-__libc_start_main()+244 
----- End of Abridged Call Stack Trace -----

*** 2015-02-04 11:36:07.556
PMON (ospid: 6210): terminating the instance due to error 471
ksuitm: waiting up to [5] seconds before killing DIAG(6234)

3.Register Instance to Listener

SQL> select SPID,PROGRAM from v$process where PROGRAM like '%PMON%';

SPID                     PROGRAM
------------------------ ------------------------------------------------
16782                    oracle@oel11g1 (PMON)
SQL> oradebug setospid 16782     
Oracle pid: 2, Unix process pid: 16782, image: oracle@oel11g1 (PMON)
SQL> oradebug Event 10257 trace name context forever, level 16
Statement processed.
SQL> oradebug tracefile_name
/oracle/app/oracle/diag/rdbms/blue/blue1/trace/blue1_pmon_16782.trc
SQL> oradebug Event 10257 trace name context OFF;
Statement processed.


[grid@oel11g1 ~]$ lsnrctl 

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 04-FEB-2015 13:06:24

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

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
The command completed successfully
LSNRCTL> 
LSNRCTL> 
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 2: No such file or directory
LSNRCTL> start
Starting /oracle/app/grid/11.2.0/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /oracle/app/grid/11.2.0/network/admin/listener.ora
Log messages written to /oracle/app/oracle/diag/tnslsnr/oel11g1/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                04-FEB-2015 13:07:17
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/grid/11.2.0/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/oel11g1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
The listener supports no services
The command completed successfully
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                04-FEB-2015 13:07:17
Uptime                    0 days 0 hr. 1 min. 10 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/grid/11.2.0/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/oel11g1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.137.17)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "blue" has 1 instance(s).
  Instance "blue1", status READY, has 1 handler(s) for this service...
Service "blueXDB" has 1 instance(s).
  Instance "blue1", status READY, has 1 handler(s) for this service...
The command completed successfully

Trace信息

*** 2015-02-04 13:09:10.295
err=-301 lbflgs=0x0 tbtime=0 tntime=0 etime=301 srvs=1 nreqs=0 sreqs=0 asrvs=1
error=-301 etime=301 control=0 integral=0 lasterr=-300 lastetm=300
kmmlrl: status: succ=2, wait=0, fail=0
kmmlrl: update for process drop delta: 68 68 41 43 149
kmmgdnu: blueXDB
         goodness=0, delta=1,
         flags=0x5:unblocked/not overloaded, update=0x6:G/D/-
kmmgdnu: blue
         goodness=0, delta=1,
         flags=0x4:unblocked/not overloaded, update=0x6:G/D/-
kmmlrl: 41 processes
kmmlrl: node load 92
kmmlrl: instance load 3
kmmlrl: nsgr update returned 0
PMON woken up to process network events

4. trace method

$ORACLE_HOME/network/admin/sqlnet.ora
TRACE_LEVEL_SERVER = 16
TRACE_FILE_SERVER = SERVER
TRACE_DIRECTORY_SERVER= /oracle/tracefile.name


alter system register;

Trace完disable trace
From 11.1.0.7 onwards, tracing can be enabled using the following syntax

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

System altered.


SQL> alter system set events='immediate trace name listener_registration off';

System altered.

跟踪的trace信息如下
*** 2015-02-05 14:50:19.948
PMON last posted from location=FILE:/ade/b/2960201551/oracle/rdbms/src/hdir/kmmcts.h LINE:2926 ID:kmmdmplrc(), process=32, post_num=7
------------------------------
Start Registration Information
------------------------------
 
Last update: 429697395 (39 seconds ago)
Flag: 0xc, 0x0
State: succ=1, wait=0, fail=1
 
Listeners:
  0 - (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.17)(PORT=1521))
       state=4, err=3
       nse[0]=12541, nse[1]=12541, nte[0]=0, nte[1]=0, nte[2]=0
       ncre=0
       endp=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.137.17)(PORT=1521)))
         flg=0x80000000 nse=0
  1 - (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.20)(PORT=1521)))
       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=192.168.137.20)(PORT=1521)))
         flg=0x80000000 nse=0
 
Instance: blue1
  flg=0x0, upd=0xa
  info=(HOST=oel11g1)
  node load=94, max=5120
  inst load=3, max=247
 
Services:
  0 - blue
       flg=0x4, upd=0x6
       goodnes=0, delta=1
  1 - blueXDB
       flg=0x5, upd=0x6
       goodnes=0, delta=1
 
Handlers: 
  0 - Dedicated
       flg=0x80002002, upd=0x0
       services=blue 
       hdlr load=41, max=149
  1 - (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.17)(PORT=1521))
       flg=0x3, upd=0x0
       services=blue 
       hdlr load=41, max=149
 
Dispatchers:
  0 - D000
       addr=(ADDRESS=(PROTOCOL=tcp)(HOST=oel11g1)(PORT=18253))
       inf=DISPATCHER 
       flg=0x1004, upd=0x0
       services=blueXDB 
       hdlr load=0, max=1022
 
CMON Handlers:
 
Listen Endpoints:
 
----------------------------
End Registration Information
----------------------------

*** 2015-02-05 14:50:39.612
PMON last posted from location=FILE:/ade/b/2960201551/oracle/rdbms/src/hdir/kmmcts.h LINE:2898 ID:kmmreg(), process=34, post_num=8
PMON woken up to process network events
PMON woken up to process network events
PMON woken up to process network events

*** 2015-02-05 14:50:42.619
PMON woken up to process network events

*** 2015-02-05 14:53:25.232
PMON last posted from location=FILE:/ade/b/2960201551/oracle/rdbms/src/hdir/kmmcts.h LINE:2926 ID:kmmdmplrc(), process=32, post_num=9
------------------------------
Start Registration Information
------------------------------
 
Last update: 429703594 (162 seconds ago)
Flag: 0x4, 0x0
State: succ=2, wait=0, fail=0
 
Listeners:
  0 - (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.17)(PORT=1521))
       state=1, err=0
       nse[0]=0, nse[1]=0, nte[0]=0, nte[1]=0, nte[2]=0
       ncre=0
  1 - (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.137.20)(PORT=1521)))
       state=1, err=0
       nse[0]=0, nse[1]=0, nte[0]=0, nte[1]=0, nte[2]=0
       ncre=0
 
----------------------------
End Registration Information
此条目发表在Infrastructure分类目录。将固定链接加入收藏夹。

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s