10500事件跟踪SMON进程
SMON进程是ORACLE的一个关键进程,负责INSTANCE RECOVERY,清理临
时段,合并空闲空间,收缩回滚段,维护SMON_SCN_TIME表等。
我们可以通过10500事件来跟踪上述行为:
www.2cto.com
Level: <=5 trace instance recovery
> 5 trace posting of SMON
首先开启一个SESSION 删掉一些数据
SQL> delete test;
已删除48875行。 www.2cto.com
SQL>
C:>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 1月 21 18:00:40 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> alter system set event='10500 trace name context forever,level 10' scope=spfile;
系统已更改。 www.2cto.com
ORACLE 例程已经启动。
Total System Global Area 176160768 bytes
Fixed Size 1247900 bytes
Variable Size 104858980 bytes
Database Buffers 58720256 bytes
Redo Buffers 11333632 bytes
数据库装载完毕。
数据库已经打开。
www.2cto.com
从SMON的TRACE文件可以看到SMON的行为:
Dump file c:oracleproduct10.2.0adminplsqldbbdumpplsqldb_smon_5604.trc
Mon Jan 21 19:25:36 2013
ORACLE V10.2.0.1.0 - Production vsnsta=0
vsnsql=14 vsnxtr=3
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Windows XP Version V5.1 Service Pack 3
CPU : 4 - type 586, 2 Physical Cores
Process Affinity : 0x00000000
Memory (Avail/Total): Ph:1777M/3240M, Ph+PgF:3242M/5125M, VA:1729M/2047M
Instance name: plsqldb
Redo thread mounted by this instance: 0
Oracle process number: 8
Windows thread id: 5604, image: ORACLE.EXE (SMON)
*** SERVICE NAME:() 2013-01-21 19:25:36.437
*** SESSION ID:(120.1) 2013-01-21 19:25:36.437
*** 2013-01-21 19:25:36.437
SMON: system monitor started
*** 2013-01-21 19:25:36.718
SMON: system monitor process posted
*** 2013-01-21 19:25:54.593
SMON: system monitor process posted
*** 2013-01-21 19:25:54.812
SMON: system monitor process posted
*** 2013-01-21 19:25:57.765
SMON: system monitor process posted
Dead transaction 0x0009.01f.000002e5 recovered by 8 server(s) <----SMON开启了8个PROCESS进行事务的恢复。
*** 2013-01-21 19:26:06.078
SMON: Parallel transaction recovery tried
*** 2013-01-21 19:26:12.546
Shrinking rbseg #0 <--收缩临时段 www.2cto.com
*** 2013-01-21 19:26:12.546
Shrinking rbseg #1
*** 2013-01-21 19:26:12.562
Shrinking rbseg #2
*** 2013-01-21 19:26:12.562
Shrinking rbseg #3
*** 2013-01-21 19:26:12.578
Shrinking rbseg #4
*** 2013-01-21 19:26:12.578
Shrinking rbseg #5
*** 2013-01-21 19:26:12.593
Shrinking rbseg #6
*** 2013-01-21 19:26:12.609
Shrinking rbseg #7
*** 2013-01-21 19:26:12.625
Shrinking rbseg #8
*** 2013-01-21 19:26:12.625
Shrinking rbseg #9
*** 2013-01-21 19:26:12.625
Shrinking rbseg #10
*** 2013-01-21 19:26:12.640
SMON: system monitor process posted
*** 2013-01-21 19:26:12.640
SMON: Posted too frequently, trans recovery disabled.