ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 总结logminer使用及各种问题处理

总结logminer使用及各种问题处理

原创 Linux操作系统 作者:kvsion 时间:2009-09-02 21:48:01 0 删除 编辑
 在前人的工作基础上,结合自己使用过程中出现的问题及解决方法给个一个新版的<<理解和使用Oracle 8i分析工具LogMiner>>ITPUB个人空间X@^)X vysD&~x8K
ITPUB个人空间i BW N0~sZ/F)f9B
理解和使用Oracle 8i分析工具LogMinerITPUB个人空间x'aA(s![w#D
ITPUB个人空间7AS/dG;X^
Oracle LogMiner
Oracle公司从产品8i以后提供的一个实际非常有用的分析工具,使用该工具可以轻松获得Oracle重作日志文件(归档日志文件)中的具体内容,特别是,该工具可以分析出所有对于数据库操作的DMLinsertupdatedelete等)语句,另外还可分析得到一些必要的回滚SQL语句。该工具特别适用于调试、审计或者回退某个特定的事务。ITPUB个人空间d J6M?/~
LogMiner
分析工具实际上是由一组PL/SQL包和一些动态视图(Oracle8i内置包的一部分)组成,它作为Oracle数据库的一部分来发布,是8i产品提供的一个完全免费的工具。但该工具和其他Oracle内建工具相比使用起来显得有些复杂,主要原因是该工具没有提供任何的图形用户界面(GUI)。本文将详细介绍如何安装以及使用该工具。
N!a[0y4g5iS:Y11269677
一、LogMiner的用途
y6IpV1T[3I3_11269677
日志文件中存放着所有进行数据库恢复的数据,记录了针对数据库结构的每一个变化,也就是对数据库操作的所有DML语句。ITPUB个人空间&t c3vb:XQe
Oracle 8i之前,Oracle没有提供任何协助数据库管理员来读取和解释重作日志文件内容的工具。系统出现问题,对于一个普通的数据管理员来讲,唯一可以作的工作就是将所有的log文件打包,然后发给Oracle公司的技术支持,然后静静地等待Oracle公司技术支持给我们最后的答案。然而从8i以后,Oracle提供了这样一个强有力的工具-LogMinerITPUB个人空间 C7yPnVo3z
LogMiner
工具即可以用来分析在线,也可以用来分析离线日志文件,即可以分析本身自己数据库的重作日志文件,也可以用来分析其他数据库的重作日志文件。ITPUB个人空间f-F-~8xkTO{d
总的说来,LogMiner工具的主要用途有:ITPUB个人空间 T1?Y D%{a8Yp
1
跟踪数据库的变化:可以离线的跟踪数据库的变化,而不会影响在线系统的性能。
;^T(o3p)W8s11269677
  2回退数据库的变化:回退特定的变化数据,减少point-in-time recovery的执行。ITPUB个人空间!H(O'zx[ xZ
  3优化和扩容计划:可通过分析日志文件中的数据以分析数据增长模式。ITPUB个人空间4X5p7r0q6u#E
二、安装LogMiner
1Z,^6B)b-he"d11269677
要安装LogMiner工具,必须首先要运行下面这样两个脚本:ITPUB个人空间(FHHCN5{%QI
l $ORACLE_HOME/rdbms/admin/dbmslm.sqlITPUB个人空间6P9s*`;fm2V1A4|`
  2 $ORACLE_HOME/rdbms/admin/dbmslmd.sql.
3a8H r)].s@7[,i11269677
这两个脚本必须均以SYS用户身份运行。其中第一个脚本用来创建DBMS_LOGMNR包,该包用来分析日志文件。第二个脚本用来创建DBMS_LOGMNR_D包,该包用来创建数据字典文件。
n#~Ia&x,Nd11269677
windows平台的安装示例:
)r)IE:~l-R3Wwl B/Y#s11269677SQL> @c:\oracle\ora81\rdbms\admin\dbmslm.sql
b%{r4i#L4V_ G11269677
程序包已创建。
;YH~7}1m11269677
授权成功。
nd4mj![$up7r11269677SQL> @c:\oracle\ora81\rdbms\admin\dbmslmd.sqlITPUB个人空间3Q+A sv%Ch-m&b
程序包已创建。
^{5EO|:bJ11269677
程序包主体已创建。
EDu?!Z |R5c u11269677
没有错误。
rZL)N'Tq b0`11269677
授权成功。
8Vz&k,@WD:ka]11269677ITPUB个人空间C1n5|H{3Dglb
三、使用LogMiner工具ITPUB个人空间3D:VC&~ xmeZ;T;`
下面将详细介绍如何使用LogMiner工具。ITPUB个人空间\P0p(l/Zwk
1
、创建数据字典文件(data-dictionaryITPUB个人空间c2gYJ9_4i,Q
前面已经谈到,LogMiner工具实际上是由两个新的PL/SQL内建包((DBMS_LOGMNRDBMS_ LOGMNR_D)和四个V$动态性能视图(视图是在利用过程DBMS_LOGMNR.START_LOGMNR启动LogMiner时创建)组成:
6q+c"MrQ;}lU}0O112696771
v$logmnr_contents      它给出日志分析的结果信息。ITPUB个人空间J9y s5q&T%pHo#N
2
v$logmnr_dictionarylogmnr可以有多个字典文件,该视图用于显示这方面信息。
8u8a#kN@ c4U112696773
v$logmnr_parameters它用于显示logmnr的参数。ITPUB个人空间6[RA6@i(K
4
v$logmnr_logs      它用于显示用于分析的日志列表信息。
8u:|b N {(FY4KP4p8d11269677
在使用LogMiner工具分析redo log文件之前,可以使用DBMS_LOGMNR_D包将数据字典导出为一个文本文件。该字典文件是可选的,但是如果没有它,LogMiner解释出来的语句中关于数据字典中的部分(如表名、列名等)和数值都将是16进制的形式,我们是无法直接理解的。例如,下面的sql语句:
)me{y)oaX*V11269677INSERT INTO dm_dj_swry (rydm, rymc) VALUES (00005, '
张三');ITPUB个人空间.a h?#DYQ|Oul
LogMiner
解释出来的结果将是下面这个样子,
7q&i3xw]&L3N'O!^ p(I11269677insert into Object#308(col#1, col#2) values (hextoraw('c30rte567e436'),
  hextoraw('4a6f686e20446f65'));ITPUB个人空间(un-e9{z Jc7b1j
创建数据字典的目的就是让LogMiner引用涉及到内部数据字典中的部分时为他们实际的名字,而不是系统内部的16进制。数据字典文件是一个文本文件,使用包DBMS_LOGMNR_D来创建。如果我们要分析的数据库中的表有变化,影响到库的数据字典也发生变化,这时就需要重新创建该字典文件。另外一种情况是在分析另外一个数据库文件的重作日志时,也必须要重新生成一遍被分析数据库的数据字典文件。
#L2r(v2Hz-D)?3B11269677
字典文件用于存放表及对象ID号之间的对应关系。当使用字典文件时,它会在表名和对象ID号之间建立一一对应的关系。因此需要注意,如果用户建立了新表之后,并且将来可能会对该表进行日志分析,那么就需要重新建立字典文件,以将其对象名及对象ID号存放到字典文件.ITPUB个人空间S5h3fB#}AW
首先在init.ora初始化参数文件中,指定数据字典文件的位置,也就是添加一个参数UTL_FILE_DIR,该参数值为服务器中放置数据字典文件的目录。如:ITPUB个人空间 Im"V k*q2~^ @a
UTL_FILE_DIR = (e:\Oracle\logs)ITPUB个人空间5Bo(NY5T
重新启动数据库,使新加的参数生效,然后创建数据字典文件:ITPUB个人空间'r?hZt;H/S$L
SQL> CONNECT SYS
N;o`!G$r5o)F)i&f11269677
  SQL> EXECUTE dbms_logmnr_d.build(ITPUB个人空间y;[3K-^8dgDsx
  dictionary_filename => ' v816dict.ora',ITPUB个人空间7mt HB6vZu1i
dictionary_location => 'e:\oracle\logs');ITPUB个人空间;`$F-F'Hq/p6p7X
注意:参数dictionary_filename用以指定字典文件的文件名;参数dictionary_location用于指定存放字典文件所在的目录,该目录必须与初始化参数UTL_FILE_DIR的值一致。ITPUB个人空间3s(M!~]EFw
另外注意,生成字典文件的步骤可能会出现下标超出限制问题:
:G~]-I-v:J11269677SQL> EXECUTE dbms_logmnr_d.build(dictionary_filename => 'v817dict.ora',dictionary_location => 'd:\oradict');ITPUB个人空间 ar#N4oA_ m
ITPUB个人空间.ieIFWH/p
BEGIN dbms_logmnr_d.build(dictionary_filename => 'v817dict.ora',dictionary_location => 'd:\oradict')
fIf.B `jS;b11269677*
-oH%ww1JF11269677ERROR
位于第1:
p1`Oy I11269677ORA-06532:
下标超出限制
3c9c|C+E9X0s11269677ORA-06512:
"SYS.DBMS_LOGMNR_D", line 793
)]h0w3^SA~11269677ORA-06512:
line 1
l-@,~8bc}5d11269677
解决方法:
)J*dcgh1g11269677
TYPE col_desc_array IS VARRAY(513) OF col_description;
`ux;A$m6n11269677
改成:
D,JI:BWpe$p11269677TYPE col_desc_array IS VARRAY(713) OF col_description;
[ q Yg)^d FV4g%o11269677
保存文件,然后执行一遍脚本:
%XBtgt/V,[11269677SQL> @c:\oracle\ora81\rdbms\admin\dbmslmd.sql
l&[.{/XLb+oQ11269677
程序包已创建。
Qo$A#L,dZBo RS LE11269677
程序包主体已创建。
.|-f0V N C[RR11269677
没有错误。ITPUB个人空间U`?'UI VG8U[W ^
授权成功。
.{`_%XcA#F-A6De11269677
bOCW]u11269677
再重新编译DBMS_LOGMNR_D包:
:Kno yk;J^|2ai11269677SQL> alter package DBMS_LOGMNR_D compile body;ITPUB个人空间4o^ nH%J
程序包主体已变更。ITPUB个人空间v&}9F4f:N!Z4a;L(E\h
ITPUB个人空间 LU7wf&u"d W
最后重新执行dbms_logmnr_d.buildITPUB个人空间7r9i3[1Fh~
SQL> EXECUTE dbms_logmnr_d.build(dictionary_filename => 'v817dict.ora',dictionary_location =>'d:\ora
)v'q1V A7VB Z |11269677dict');ITPUB个人空间P ss!HYaH
PL/SQL
过程已成功完成。
7\-o-G-a"H G11269677
字典文件正常生成,生成的字典文件和提示下标超出限制的情况下生成的字典文件大小一样。ITPUB个人空间3Il xK3{ O1w*X'[*|
另请注意有的文档中说:
H4~TAY [W;B11269677
如果指定的字典文件名dict.ora已经存在,则应在执行此操作前将其彻底删除(从垃圾箱中删除),否则执行该过程将失败。
X{r"ym11269677
实践证明这要说法是没有根据的,在实际操作前并没有将原来生成的字典文件删除掉,但字典文件是正常生成了。ITPUB个人空间]b8U o!u W"T G
ITPUB个人空间F?&L9Bap$k
2
、创建要分析的日志文件列表ITPUB个人空间`(E&mYZ2F_6a
Oracle
的重作日志分为两种,在线(online)和离线(offline)归档日志文件,下面就分别来讨论这两种不同日志文件的列表创建。
NQ(Q bY px7E B7^z V11269677
1)分析在线重作日志文件ITPUB个人空间 i.rk J Je4|
A.
创建列表
W4\:r+}E!N8F/i11269677SQL> EXECUTE dbms_logmnr.add_logfile(
+m*R$dD7Lm11269677
  LogFileName=>' e:\Oracle\oradata\sxf\redo01.log',ITPUB个人空间#Q.NW/rt p
  Options=>dbms_logmnr.new);ITPUB个人空间t8I!N'P2a%M
B.
添加其他日志文件到列表
QR-ru_11269677SQL> EXECUTE dbms_logmnr.add_logfile(
-T0J*hW] [8{ dH11269677
  LogFileName=>' e:\Oracle\oradata\sxf\redo02.log',
|"D2c1h9g11269677
  Options=>dbms_logmnr.addfile);ITPUB个人空间1w*U;^6oUJ+l
2)分析离线日志文件
H1J5wv#\(u _D}11269677A.
创建列表
GX ?"f2]11269677SQL> EXECUTE dbms_logmnr.add_logfile(ITPUB个人空间/{9gk&[2\q
  LogFileName=>' E:\Oracle\oradata\sxf\archive\ARCARC09108.001',
)m5LSh^$y \7ly11269677
  Options=>dbms_logmnr.new);ITPUB个人空间Gy:t8dDE4ca
B.
添加另外的日志文件到列表
-NH\3\V {:Q;{8}11269677SQL> EXECUTE dbms_logmnr.add_logfile(
#Pt,I)P&z11269677
  LogFileName=>' E:\Oracle\oradata\sxf\archive\ARCARC09109.001',
w:w2J:iV&@"g;u)N11269677
  Options=>dbms_logmnr.addfile);
$z@ACY11269677
关于这个日志文件列表中需要分析日志文件的个数完全由你自己决定,但这里建议最好是每次只添加一个需要分析的日志文件,在对该文件分析完毕后,再添加另外的文件。
,K.ba3fb$[ g`0y11269677
和添加日志分析列表相对应,使用过程'dbms_logmnr.removefile'也可以从列表中移去一个日志文件。下面的例子移去上面添加的日志文件e:\Oracle\oradata\sxf\redo02.log
W&@r%fg#q11269677SQL> EXECUTE dbms_logmnr.add_logfile(
ts;U G6sKM11269677
  LogFileName=>' e:\Oracle\oradata\sxf\redo02.log',
%@6}3D m,s+P11269677Options=>dbms_logmnr. REMOVEFILE);
Co K3RcR U11269677
可以通过动态性能视图v$logmnr_logs查看日志分析列表中有哪些待分析的日志文件。
*`h'\u|O4N*W11269677
创建了要分析的日志文件列表,下面就可以对其进行分析了。ITPUB个人空间&y _gE c(Y{!y-s/I
3
、使用LogMiner进行日志分析
1X%B6Be^w?5C ^11269677
1)无限制条件ITPUB个人空间u"N2m-jy-I}9r!@
SQL> EXECUTE dbms_logmnr.start_logmnr(ITPUB个人空间H b/XDh4W#nd
  DictFileName=>' e:\oracle\logs\ v816dict.ora ');ITPUB个人空间J,A^5e)^0W#n
2)有限制条件ITPUB个人空间~k-p U~:g
通过对过程DBMS_ LOGMNR.START_LOGMNR中几个不同参数的设置(参数含义见表1),可以缩小要分析日志文件的范围。通过设置起始时间和终止时间参数我们可以限制只分析某一时间范围的日志。如下面的例子,我们仅仅分析2001918日的日志:
NsU}Wnj5_3G#p11269677SQL> EXECUTE dbms_logmnr.start_logmnr(ITPUB个人空间,]3x(RQo)T
  DictFileName => ' e:\oracle\logs\ v816dict.ora ',ITPUB个人空间u'b k)_k{E q
  StartTime => to_date('2001-9-18 00:00:00','YYYY-MM-DD HH24:MI:SS')ITPUB个人空间&X]Y5R&H? O3k]5lP
EndTime => to_date(''2001-9-18 23:59:59','YYYY-MM-DD HH24:MI:SS '));
$X*WEsH9Hj11269677
IWPg Vm9x11269677
注意:此过程能否执行成功的关键是给出的starttime(起始时间)和endtime(终止时
$nZI z'xP11269677
间)应在一个有效的范围内。特别是终止时间,应小于或等于归档日志的建立时间;如果大于ITPUB个人空间 ~? N0l(T9iGHM
归档日志的建立时间,则不能执行分析过程。分析多个归档日志时,这些归档日志最好是连续ITPUB个人空间:rwxAZ'r|q:X

*]'j,M6LwZ11269677
也可以通过设置起始SCN和截至SCN来限制要分析日志的范围:
4~]6Gi xv|.P11269677SQL> EXECUTE dbms_logmnr.start_logmnr(ITPUB个人空间)P3c?I Bo/c
  DictFileName => ' e:\oracle\logs\ v816dict.ora ',ITPUB个人空间-R$Ni"AZ^Zc { T
  StartScn => 20,
:q0l"K a(C3s4twy'~11269677
  EndScn => 50);ITPUB个人空间;iVmeL)`Z
1 DBMS_LOGMNR.START__LOGMNR过程参数含义
;jyRyB11269677
参数参数类型默认值含义
Z4\MLE|u11269677StartScn
数字型(Number0分析重作日志中SCN≥StartScn日志文件部分
VD!w"A)`n*`+{%`]11269677EndScn
数字型(Number0分析重作日志中SCN≤EndScn日志文件部分ITPUB个人空间ir/XlO|
StartTime
日期型(Date) 1998-01-01分析重作日志中时间戳≥StartTime的日志文件部分ITPUB个人空间H'bab/u V
EndTime
日期型(Date) 2988-01-01分析重作日志中时间戳≤EndTime的日志文件部分
qfS_n%NY$w Fi)Z11269677DictFileName
字符型(VARCHAR2)字典文件,该文件包含一个数据库目录的快照。使用该文件可以使得到的分析结果是可以理解的文本形式,而非系统内部的16进制ITPUB个人空间+ym-U,P7Na
Options BINARY_INTEGER 0
系统调试参数,实际很少使用
&W*SAjh&lk xv11269677
]!pq^HqaW[11269677
在执行分析的时候如果提示无效的月份,可以按照下面的步骤去尝试:
Hh`.X"???11269677alter session set nls_date_language='AMERICAN';ITPUB个人空间2n*VVx6hX|9?h
alter session set nls_date_format='DD-MON-YYYY HH:MI:SS';ITPUB个人空间zi$ka [6f{ g2^
执行包(exec dbms_logmnr.start_logmnr(dictfilename=>'');
NK1b&^7OL9Fo8Bi11269677
一定要指名参数dictfilename,因为这个包有五个默认的参数,不指名会默认为第一个。
"xV8@ g9D ^:M112696774
、观察分析结果(v$logmnr_contentsITPUB个人空间i8M jtA,g|&d,G
到现在为止,我们已经分析得到了重作日志文件中的内容。动态性能视图v$logmnr_contents包含LogMiner分析得到的所有的信息。ITPUB个人空间n&{L.r R
SELECT sql_redo FROM v$logmnr_contents;
|/k6L a ab11269677
如果我们仅仅想知道某个用户对于某张表的操作,可以通过下面的SQL查询得到,该查询可以得到用户DB_ZGXT对表SB_DJJL所作的一切工作。ITPUB个人空间$DF8J"i4tA J N
SQL> SELECT sql_redo FROM v$logmnr_contents WHERE username='DB_ZGXT' AND seg_name='SB_DJJL';
7@P3gjR2Y7K11269677
需要强调一点的是,视图v$logmnr_contents中的分析结果仅在我们运行过程'dbms_logmrn.start_logmnr'这个会话的生命期中存在。这是因为所有的LogMiner存储都在PGA内存中,所有其他的进程是看不到它的,同时随着进程的结束,分析结果也随之消失。
? umEgj%n bf9^11269677
最后,使用过程DBMS_LOGMNR.END_LOGMNR终止日志分析事务,此时PGA内存区域被清除,分析结果也随之不再存在
+v#o'sKC112696775
、结束分析:使用EXCUTE DBMS_LOGMNR.END_LOGMNR
6YqI+b+Vc s;?S NO11269677
四、其他注意事项
,[Y [1kXZ-Q/~11269677
们可以利用LogMiner日志分析工具来分析其他数据库实例产生的重作日志文件,而不仅仅用来分析本身安装LogMiner的数据库实例的redo logs文件。使用LogMiner分析其他数据库实例时,有几点需要注意:
"ov4{"v5`8K B&Q112696771. LogMiner
必须使用被分析数据库实例产生的字典文件,而不是安装LogMiner的数据库产生的字典文件,另外必须保证安装LogMiner数据库的字符集和被分析数据库的字符集相同。ITPUB个人空间:zLy+nZ2}-{[5a
2.
被分析数据库平台必须和当前LogMiner所在数据库平台一样,也就是说如果我们要分析的文件是由运行在UNIX平台上的Oracle 8i产生的,那么也必须在一个运行在UNIX平台上的Oracle实例上运行LogMiner,而不能在其他如Microsoft NT上运行LogMiner。当然两者的硬件条件不一定要求完全一样。
%F*pS f|K qh112696773. LogMiner
日志分析工具仅能够分析Oracle 8以后的产品,不过它可以分析Oracle8的日志。对于8以前的产品,该工具也无能为力。另外, Oracle8i只能对DML操作进行分析,从Oracle9i开始不仅可以分析DML操作,而且也可以分析DDL操作。在Oracle9i中可使用如下语句查询DDL操作及具体的操作时间:ITPUB个人空间x H5Rv] L;zwe8zSN
SQL>select sql_redo
|(zG1r KJl(L112696772 from v$logmnr_contentsITPUB个人空间8uR9Qa\){ {
  3 where sql_redo like '%create%' or sql_redo like '%CREATE%';ITPUB个人空间LPL~{)H7s$| W
LogMiner
不支持索引组织表、LongLOB及集合类型。ITPUB个人空间!F`d3`K!Qc _#q
MTS
的环境也不能使用LogMiner.ITPUB个人空间iA9BBi%}(C |n

r&beXDBO!z11269677
五、结语ITPUB个人空间4h`e/Z!z/H
LogMiner
对于数据库管理员(DBA)来讲是个功能非常强大的工具,也是在日常工作中经常要用到的一个工具,借助于该工具,可以得到大量的关于数据库活动的信息。其中一个最重要的用途就是不用全部恢复数据库就可以恢复数据库的某个变化。另外,该工具还可用来监视或者审计用户的活动,如你可以利用LogMiner工具察看谁曾经修改了那些数据以及这些数据在修改前的状态。我们也可以借助于该工具分析任何Oracle 8及其以后版本产生的重作日志文件。另外该工具还有一个非常重要的特点就是可以分析其他数据库的日志文件。总之,该工具对于数据库管理员来讲,是一个非常有效的工具,深刻理解及熟练掌握该工具,对于每一个数据库管理员的实际工作是非常有帮助的。ITPUB个人空间 c `5g5Z*e)O

^ q(Dr^11269677
参考文档:
U3g3l |!c%B [3HA2Rc11269677The Oracle8i LogMiner Utility
0Y+R&DNZ'vD~4n0tD11269677PURPOSE
7Du-F`T8r7O11269677This paper details the mechanics of what LogMiner does, as well as detailing
+~Q2D f$f5T Z(@11269677the commands and environment it uses.
3e2s7M!JVUrl u1n11269677
6an-YPVB&Nd11269677SCOPE & APPLICATIONITPUB个人空间3? S&E2kl0s g~Fv
For DBAs requiring further information about LogMiner.
*GbK*mLT xC11269677ITPUB个人空间 f2eE)x+L~8q?
The ability to provide a readable interface to the redo logs has been askedITPUB个人空间3S:l2S ~8J A0I
for by customers for a long time. The ALTER SYTSTEM DUMP LOGFILE interface
d0N [6Vg/Ue nz11269677has been around for a long time, though its usefulness outside Support isITPUB个人空间t{v A u`*u d
limited. There have been a number of third party products, e.g. BMC's PATROLITPUB个人空间J.g!]T&nr4`,h `]
DB-Logmaster (SQL*Trax as was), which provide some functionality in thisITPUB个人空间 Nv+IyF F I2{X3V
area. With Oracle release 8.1 there is a facility in the Oracle kernel to do
)X1}wS{ d11269677the same. LogMiner allows the DBA to audit changes to data and performsITPUB个人空间%W4HK|/a0mRW:c
analysis on the redo to determine trends, aid in capacity planning,ITPUB个人空间g^m$M6g
Point-in-time Recovery etc.ITPUB个人空间 [d { Q J"Uq'T
ITPUB个人空间f8s,N(IV(J:l,]c k"V
RELATED DOCUMENTS
:?.{r_LD!L/}11269677[NOTE:117580.1] ORA-356, ORA-353, & ORA-334 Errors When Mining Logs with
[R.O PT!N~11269677Different DB_BLOCK_SIZE
H$I5h\&DzV P11269677Oracle8i - 8.1 LogMiner:ITPUB个人空间 }ED8Ks&Ij2}*T*EWK{
=========================
/OtK$lMc w*O6jE11269677ITPUB个人空间;@C+Y-JnGmt
1. WHAT DOES LOGMINER DO?
d9qv V)Cx"y11269677=========================
C.mx{+EZ11269677
jc]t6y3G1i5~2F11269677LogMiner can be used against online or archived logs from either the
P[1T%V3H11269677'current' database or a 'foreign' database. The reason for this is that it
2k\5p'{~H%SV3iSks11269677uses an external dictionary file to access meta-data, rather than the
S:c|.xC:x\ F:o11269677'current' data dictionary.ITPUB个人空间/q6~&Ls&E(sB2i6P$@

Y)a DIHG11269677It is important that this dictionary file is kept in step with the databaseITPUB个人空间"e3cm4f-[]$g
which is being analyzed. If the dictionary used is out of step from the redoITPUB个人空间'h;F,B9W9]PRj Q#_
then analysis will be considerably more difficult. Building the externalITPUB个人空间"{@0A B8k*Yw@%`
dictionary will be discussed in detail in section 3.
0t j;W)r-xT11269677ITPUB个人空间I3Wzp:_7m`'uD
LogMiner scans the log/logs it is interested in, and generates, using the
#Y+Cq9hM11269677dictionary file meta-data, a set of SQL statements which would have the same
'd _+V:A6I9D11269677effect on the database as applying the corresponding redo record.ITPUB个人空间d)`w'[f$RDx)S&IS[

y bg-@eC11269677LogMiner prints out the 'Final' SQL that would have gone against the
H8_7Tr+C#E4FSd f9q11269677database. For example:
:Td'lup7h!L N P11269677ITPUB个人空间c#t&z^9xz+L
Insert into Table x Values ( 5 );ITPUB个人空间;M.O!g.F[~o%uQ\
Update Table x set COLUMN=newvalue WHERE ROWID='<>'
~xE!S0PQ@m11269677Delete from Table x WHERE ROWID='<>' AND COLUMN=value AND COLUMN=VALUE
;w[ @;] n3K ?-H"} v11269677
PsZ%~C11269677We do not actually see the SQL that was issued, rather an executable SQL
:vG"h6a#eH["F11269677statement that would have the same EFFECT. Since it is also stored in theITPUB个人空间-?'K P$gL5M D3c
same redo record, we also generate the undo column which would be necessaryITPUB个人空间-f]4Q}[J}
to roll this change out.ITPUB个人空间7Q,?H3i/x4}ID Q
ITPUB个人空间 E3f4_ ^bvF
For SQL which rolls back, no undo SQL is generated, and the rollback flag isITPUB个人空间 v!c!j.]7Hw
set. An insert followed by a rollback therefore looks like:
PU2C/f*V_pO`11269677ITPUB个人空间C3x0Kg r hj&c$R
REDO UNDO ROLLBACKITPUB个人空间X['Ww`C4Y+_Z(zF
ITPUB个人空间`b.x P f3s[g
insert sql Delete sql 0ITPUB个人空间Q+bh5e5n
delete sql 1ITPUB个人空间#xwiV6j m

,}Y7PFPG;cjc~y"B11269677Because it operates against the physical redo records, multirow operationsITPUB个人空间1h!rck:P
are not recorded in the same manner e.g. DELETE FROM EMP WHERE DEPTNO=30ITPUB个人空间Y?-k'K5{%X e `
might delete 100 rows in the SALES department in a single statement, the
/smYu#AA#]X11269677corresponding LogMiner output would show one row of output per row in the
5h8? xi{;O PA'~11269677database.
4pq~.G1Z;XZqw11269677ITPUB个人空间Y6b/`1JC

T0Nk!pU:ZUuT112696772. WHAT IT DOES NOT DOITPUB个人空间7Ri&w;Le4Z8J
======================
"H1F&U2K n#Xv6H w11269677
C Y OHQk a8T y)?112696771. 'Trace' Application SQL - use SQL_Trace/10046
zj2N g%\*me.G11269677
/i'z3q} j!J11269677Since LogMiner only generates low-level SQL, not what was issued, youITPUB个人空间m1UF)R!I+b
cannot use LogMiner to see exactly what was being done based on the SQL.ITPUB个人空间,m:k|&d2x M.k
What you can see, is what user changed what data at what time.
ar3@+A)aE5pMZ11269677
`2eJli~112696772. 'Replicate' an application
h{L#LxB:O11269677ITPUB个人空间0m(w8{X.k/mF]6\
LogMiner does not cover everything. Also, since DDL is not supportedITPUB个人空间QEo-fQN
(the insert into the tab$ etc. is, however the create table is not).ITPUB个人空间d H\"{So/}F

O~ V'vm$C112696773. Access data dictionary SQL In a visible form.ITPUB个人空间\.B.o+C)oOwTZ
ITPUB个人空间K\+F%^$ZE/MF
Especially UPDATE USER$ SET PASSWORD=.
,[R1U9ip+G&P11269677
,K#S/B2qb0Uz[)e1I"U11269677
4]dRH*BI.]11269677Other Known Current LimitationsITPUB个人空间D+lbK iN(q)b
===============================
9y)t)?*t0N,u9`#G e11269677ITPUB个人空间 D\!F%E Y
LogMiner cannot cope with Objects.ITPUB个人空间T1v(]d&} uh^l
LogMiner cannot cope with Chained/Migrated Rows.ITPUB个人空间n*g[%T!}
LogMiner produces fairly unreadable output if there is no record of theITPUB个人空间 v4D7Pi4T{~
table in the dictionary file. See below for output.ITPUB个人空间}0_mSH7X x
ITPUB个人空间m5Qg.H#K/N^|J BX
The database where the analysis is being performed must have a block sizeITPUB个人空间AAwo*`VA,u&D
of at least equal to that of the originating database. See [NOTE:117580.1].ITPUB个人空间3N:?,zP$j!X7`^
ITPUB个人空间-\5iQy+a-Q4qK

1a#Q+TIu_9Z(NF11269677ITPUB个人空间 d5Y F4p CF3K7SH
3. FUNCTIONALITYITPUB个人空间5J*aI~e(@I/u
================
URdc@11269677
-}/X"m F&t7V nO11269677The LogMiner feature is made up of three procedures in the LogMiner
!u:R u3q/VpG(}j(Md11269677(dbms_logmnr) package, and one in the Dictionary (dbms_logmnr_d).
R&TIiq*a2Y3fl11269677ITPUB个人空间 g?5aY8J)t3k/l1k.R;Z Z)J
These are built by the following scripts: (Run by catproc)
3bX dRL9C11269677
S cvo\"JO11269677$ORACLE_HOME/rdbms/admin/dbmslogmnrd.sql
'WeQ~W*l11269677$ORACLE_HOME/rdbms/admin/dbmslogmnr.sql
5Cw2R;A*},[11269677$ORACLE_HOME/rdbms/admin/prvtlogmnr.plbITPUB个人空间N1e]xb#U+G!B G;x
ITPUB个人空间(P f Z-Av%cht
since 8.1.6:ITPUB个人空间 UFv4tMXJ#u
ITPUB个人空间0A}2z9Bo-g+Y
$ORACLE_HOME/rdbms/admin/dbmslmd.sql
-meCG5LT%a5M11269677$ORACLE_HOME/rdbms/admin/dbmslm.sql
yQa YPq X(?11269677$ORACLE_HOME/rdbms/admin/prvtlm.plbITPUB个人空间&ogyDK

jvRJwl _'U11269677
%Z5?,B7iR:AI112696771. dbms_logmnr_d.buildITPUB个人空间Ik [Vz*f
ITPUB个人空间YI yy!r
This procedure builds the dictionary file used by the main LogMinerITPUB个人空间;UU%`2b U h!gM
package to resolve object names, and column datatypes. It should beITPUB个人空间k,J!n-L/i ?*e+J
generated relatively frequently, since otherwise newer objects will notITPUB个人空间h6b5a4Gj.m'a
be recorded.ITPUB个人空间Gv-QEN
ITPUB个人空间i/E&h:\3Q@"Y3B
It is possible to generate a Dictionary file from an 8.0.database and
Yp$P3R5@WV.W11269677use it to Analyze Oracle 8.0 redo logs. In order to do this runITPUB个人空间2Fr Dy8O4{!y u7qfR
"dbmslogmnrd.sql" against the 8.0 database, then follow the procedure as
?h"r+u|,g$b-Ah\11269677below. All analysis of the logfiles will have to take place whileITPUB个人空间"j)BdAZ"L
connected to an 8.1 database since dbms_logmnr cannot operate against
]+X1M9Ey)u9^11269677Oracle 8.0 because it uses trusted callouts.ITPUB个人空间%F9p~5b9p,I KG

og.FU)W-Z%u11269677Any redo relating to tables which are not included in the dictionaryITPUB个人空间v m(lE2O7t)Ov
file are dumped RAW. Example: If LogMiner cannot resolve the Table and
_/^&J0Q Yg u11269677column references, then the following is output: (insert statement)ITPUB个人空间R%W`4X XxS

1U5Q.p&f!a)x"o11269677insert into UNKNOWN.objn:XXXX(Col[x],....) VALUES
J[#oF"r6\@W11269677( HEXTORAW('xxxxxx'), HEXTORAW('xxxxx')......)ITPUB个人空间,d ZuQy"MR(t

jcB+fR#W~11269677PARAMETERS
c2~;A){f(]d;N11269677==========
}/a%I!?:jg9B11269677
oT ?/k6},]'t112696771. The name of the dictionary file you want to produce.ITPUB个人空间r$S {@)K"N
2. The name of the directory where you want the file produced.ITPUB个人空间A rY4k#eK9};\

Ssu&l"T,q+HW;Y7J11269677The Directory must be writeable by the server i.e. included inITPUB个人空间 ~ a-@6@%Y LS2Nr
UTL_FILE_DIR path.ITPUB个人空间?RJS0FO)x4O

4en(U$f#K S(y11269677EXAMPLEITPUB个人空间~E5BD)s.I1d$oA
=======ITPUB个人空间-\(uh2]JC]Ta

$R-e'~0u[#X11269677BEGINITPUB个人空间R8[ b@O8Y^
dbms_logmnr_d.build(
Y!XC~ a_F H_11269677dictionary_filename=> 'miner_dictionary.dic',ITPUB个人空间;W~d)E!m
dictionary_location => '/export/home/sme81/aholland/testcasesITPUB个人空间 E/p%_g.ht4g
/logminer'
b)W b*nK!ly11269677);
+]7Q)|*p)@D$T11269677END;ITPUB个人空间e2h[;aPhvc5M
/
y2xI.n%f/wel11269677
\@1G2V._11269677The dbms_logmnr package actually performs the redo analysis.
S u0Q[#O9^\11269677ITPUB个人空间X Od|+w4n?!_1w
2. dbms_logmnr.add_logfileITPUB个人空间!IO-} rh { cOf0z&y
ITPUB个人空间R"Pw|5iWh@-f
This procedure registers the logfiles to be analyzed in this session. It
.|_ R`-`_1jU11269677must be called once for each logfile. This populates the fixed tableITPUB个人空间y"Aa'L7Hd6S ` v}j
X$logmnr_logs (v$logmnr_logs) with a row corresponding to the logfile.
5k^l~d$Wje11269677ITPUB个人空间3e+P[;?6[
ParametersITPUB个人空间Q-P Q8Pi1V
===========ITPUB个人空间[ W5]@kr
ITPUB个人空间ks?Q8R TEA:h
1. The logfile to be analyzed.ITPUB个人空间K6N$Cjp)E;~
2. OptionITPUB个人空间X4Zt!`&N]brh
DBMS_LOGMNR.NEW (SESSION) First file to be put into PGA memory.
EodX P9S|11269677This initialises the V$logmnr_logs table.
@%n4}[b7j11269677and
N0{ }W5I e11269677DBMS_LOGMNR.ADDFILE
n;eCn vh-P11269677adds another logfile to the v$logmnr_logs PGA memory.
*MLq?UytK(j11269677Has the same effect as NEW if there are no rows thereITPUB个人空间tD*d pzO/di
presently.
xW Qi V H r{11269677
9w vAa9u"i&_11269677DBMS_LOGMNR.REMOVEFILE
?tbJ:Ee11269677removes a row from v$logmnr_logs.
F5? I5a9Pmll'u3|11269677ITPUB个人空间Q yJU E([S
ExampleITPUB个人空间c-vkd |
=======ITPUB个人空间)i+~*J{.B"Kn4]/V
ITPUB个人空间9|A m.T!a"o|N7de
Include all my online logs for analysis.........ITPUB个人空间'l-bxU;f5a

#{,H&QH;j v5}i11269677BEGINITPUB个人空间E(v&FA.}!{cD
dbms_logmnr.add_logfile(ITPUB个人空间A-l|b|S2q%x`e*y
'/export/home/sme81/aholland/database/files/redo03.log',ITPUB个人空间(UPIu~
DBMS_LOGMNR.NEW );ITPUB个人空间3Xq-g3MR7H\.N-\;Pd*T'm
dbms_logmnr.add_logfile(ITPUB个人空间Dfk1}Z
'/export/home/sme81/aholland/database/files/redo02.log',
KR@w)y&o11269677DBMS_LOGMNR.ADDFILE );ITPUB个人空间2mc;Hyk6EJx\
dbms_logmnr.add_logfile(ITPUB个人空间MroyT6?
'/export/home/sme81/aholland/database/files/redo01.log',ITPUB个人空间0j9D6Zicjl$m
DBMS_LOGMNR.ADDFILE );ITPUB个人空间"l~O)@uL-}X
END;ITPUB个人空间Mc;{+{1Th t Hk*d
/
*|U3AZa`([11269677
7Q?q1t9`H{*UC1aa11269677Full Path should be required, though an environment variableITPUB个人空间8T*l3PY7G's
is accepted. This is NOT expanded in V$LOGMNR_LOGS.ITPUB个人空间8x,Ht|x*Z
ITPUB个人空间1l+_%aW8h{ q@

:Ao9yaDHr+lr112696773. dbms_logmnr.start_logmnr;ITPUB个人空间;Ik6J.x4y%DpZ

9FDC"aX9m/K11269677This package populates V$logmnr_dictionary, v$logmnr_parameters,
;Fo9`Pwc{U11269677and v$logmnr_contents.
Ca~NJE1g11269677
uX6~#~svl"{P0g11269677Parameters
c1{oKd w7W _11269677==========ITPUB个人空间2Jn Y/M&c P;M
ITPUB个人空间 a:ZX%P7o"{b X*h
1. StartScn Default 0ITPUB个人空间d3{3l f9\6K.W
2. EndScn Default 0,
[0V#e_$og#[N112696773. StartTime Default '01-jan-1988'
:s2l*k![3\ V1q112696774. EndTime Default '01-jan-2988'ITPUB个人空间 J'L P~.w[d
5. DictFileName Default '',ITPUB个人空间6K(m(|'Q*|Hu
6. Options Default 0 Debug flag - uninvestigated as yetITPUB个人空间Y\Gj|e
ITPUB个人空间2L.[IOG#|(n5e O:N
A Point to note here is that there are comparisions made between the
V9Ky.s$v%KxcC11269677SCNs, the times entered, and the range of values in the file. If the SCN
A|J }+H)o _q2s:@11269677range OR the start/end range are not wholly contained in this log, then
h1ETv[^ d11269677the start_logmnr command will fail with the general error:ITPUB个人空间*r8\.mf$E7E
ORA-01280 Fatal LogMiner Error.
K-padfd%hY11269677ITPUB个人空间3c l?/}]4n)CaN
4. dbms_logmnr.end_logmnr;
q@.x dTG+ZLd11269677ITPUB个人空间2}B)E}3Uv
This is called with no parameters.ITPUB个人空间,sg~FuqE5pp(V6F

!G V*l/U:f7V4X;a&wn11269677/* THIS IS VERY IMPORTANT FOR SUPPORT */
m l'];kG11269677ITPUB个人空间L Xd&\*i9x
This procedure MUST be called prior to exiting the session that wasITPUB个人空间0R,G,m2in3U7gb
performing the analysis. This is because of the way the PGA is used to
-lXo"c7q11269677store the dictionary definitions from the dictionary file, and the
,rlvP,rVq i"Q%P*y11269677V$LOGMNR_CONTENTS output.
a\T9K4e'`11269677If you do not call end_logmnr, you will silently get ORA-00600 [723] ...
5y;kb/U#BWb11269677on logoff. This OERI is triggered because the PGA is bigger at logoffITPUB个人空间 I2f6YCA.S3P'\8[5t
than it was at logon, which is considered a space leak. The main problem
XSQ6V+I+A-~11269677from a support perspective is that it is silent, i.e. not signalled back
iEDW.^-K2dT11269677to the user screen, because by then they have logged off.ITPUB个人空间J-KHa h3w^

o%]-EaSS$BS11269677The way to spot LogMiner leaks is that the trace file produced by the
6hC }!Lc(s,E11269677OERI 723 will have A PGA heap dumped with many Chunks of type 'Freeable'
b/],|$u:PQ)D]O11269677With a description of "KRVD:alh"
$DnV1K.bg7m ~g11269677
%P#gIAa c?112696774. OUTPUT
#X/E5NUS"p11269677=========ITPUB个人空间vvi.cmW Z&P2l-?+X
ITPUB个人空间:g,E{c+\"]B#h
Effectively, the output from LogMiner is the contents of V$logmnr_contents.
'l(x ]/`b,h-Q11269677The output is only visible during the life of the session which runs
8EHkl!a(Y5J11269677start_logmnr. This is because all the LogMiner memory is PGA memory, so it
_ w[6v{c A*J'u11269677is neither visible to other sessions, nor is it persistent. As the session
/k5Ji0{i:j.U R11269677logs off, either dbms_logmnr.end_logmnr is run to clear out the PGA, or an
)ZdcL^C S11269677OERI 723 is signalled as described above.ITPUB个人空间+h-By9cC.b6CF0r9Y~

[.AN} {11269677Typically users are going to want to output sql_redo based on queries by
T!P!G5w f`%N11269677timestamp, segment_name or rowid.ITPUB个人空间@t_#peUo

9`2u_T s+Q11269677
0`wBx"pO11269677v$logmnr_contents
f[ q? N_11269677Name Null? TypeITPUB个人空间[ UI*r3W$E o)X@
------------------------------- -------- ----ITPUB个人空间K_!K,jHU1W+B$L2t
SCN NUMBERITPUB个人空间[ @qTS
TIMESTAMP DATE
8CLM{[;CE11269677THREAD# NUMBER
4[A2l^%Q5y9r4n11269677LOG_ID NUMBERITPUB个人空间(u#\ c6_r4rd%{H
XIDUSN NUMBER
jK~ E#c/Fj8X11269677XIDSLT NUMBERITPUB个人空间)k#Rp"u;ni`c
XIDSQN NUMBER
pE#PI;YA;X11269677RBASQN NUMBERITPUB个人空间s9U:w h(ir(QA)zc
RBABLK NUMBER
5dncJ@7i;U11269677RBABYTE NUMBERITPUB个人空间 lC|/ndT7PS
UBAFIL NUMBER
3}V+t\\7c!~11269677UBABLK NUMBER
tl%X8U:PH6\O%c11269677UBAREC NUMBER
$b)z]6U z%I%iVEGa11269677UBASQN NUMBERITPUB个人空间Cu)L(wtu6?.q J5?
ABS_FILE# NUMBER
$AzC!t y]V E11269677REL_FILE# NUMBER
;ui'y _1}~1f%ao(y11269677DATA_BLK# NUMBERITPUB个人空间3ic Z'["S
DATA_OBJ# NUMBERITPUB个人空间3KC-?s(S)DP
DATA_OBJD# NUMBER
nL6G/Wa-l%dlO11269677SEG_OWNER VARCHAR2(32)ITPUB个人空间J:qj.M!F.~E%U0HU
SEG_NAME VARCHAR2(32)
/}q'p;Y eCWX11269677SEG_TYPE VARCHAR2(32)ITPUB个人空间at h(^VF\%X
TABLE_SPACE VARCHAR2(32)ITPUB个人空间A e"P6zYC
ROW_ID VARCHAR2(19)
{(S,O)z;y11269677SESSION# NUMBERITPUB个人空间\6BxG/[0c(T c
SERIAL# NUMBERITPUB个人空间@6kY6KV%g)cT&z
USERNAME VARCHAR2(32)
K AA)N z.K]D w`11269677ROLLBACK NUMBER
V_$feD T_,J*F11269677OPERATION VARCHAR2(32)ITPUB个人空间N*R;f9]%u;u
SQL_REDO VARCHAR2(4000)ITPUB个人空间m7msR%~)c
SQL_UNDO VARCHAR2(4000)
"A'Pa4\O:gl11269677RS_ID VARCHAR2(32)ITPUB个人空间!y)s&D(E#^ Yw4C
SSN NUMBER
g| I_"J5S]11269677CSF NUMBERITPUB个人空间1X#yn9\"u
INFO VARCHAR2(32)
(Wg B+{@$TlST(?11269677STATUS NUMBERITPUB个人空间$kf @%Y`8z9^ F
PH1_NAME VARCHAR2(32)ITPUB个人空间Y|Q0Y2H:KrQ!Q
PH1_REDO VARCHAR2(4000)ITPUB个人空间$t)KFW4T }!@[
PH1_UNDO VARCHAR2(4000)ITPUB个人空间bU,Q,g!E
PH2_NAME VARCHAR2(32)
i"GQv.| F pi11269677PH2_REDO VARCHAR2(4000)ITPUB个人空间5A0P[T6p;n_
PH2_UNDO VARCHAR2(4000)
{$k6U:vG"I3^H+H11269677PH3_NAME VARCHAR2(32)
)q5{%H)nd0fr11269677PH3_REDO VARCHAR2(4000)
R#F-fCQ11269677PH3_UNDO VARCHAR2(4000)
7t)y4X2g DV U11269677PH4_NAME VARCHAR2(32)ITPUB个人空间`*Vz_[F
PH4_REDO VARCHAR2(4000)ITPUB个人空间)MF"L2]$t+uD R$C?5f
PH4_UNDO VARCHAR2(4000)ITPUB个人空间d)L9m8U3? `lEM
PH5_NAME VARCHAR2(32)
"r~9a2S#m{)X w9E t11269677PH5_REDO VARCHAR2(4000)
cpq3E(e0bU3vE11269677PH5_UNDO VARCHAR2(4000)ITPUB个人空间E4s4N1O9r2C i

be\[$Wb4b P;Y11269677SQL> set heading off
#q{"|S,Y`*U11269677SQL> select scn, username, sql_undo from v$logmnr_contents
*zPY;Q(j^\[#`11269677where segment_name = 'emp';
]Ev-V/gZ?11269677ITPUB个人空间I5i:v8G[&Y%hZ#yE-@
12134756 scott insert (...) into emp;
)cs3AEv8]s1126967712156488 scott delete from emp where empno = ...
Hy7T s'ca{"E1126967712849455 scott update emp set mgr =ITPUB个人空间 A[c X6|6y,R

:nt9H+oE [e k4sQ11269677This will return the results of an SQL statement without the columnITPUB个人空间#q9mD b{eh9|
headings. The columns that you are really going to want to query are the
K:S1r3ocB)du e-F$a/}i11269677"sql_undo" and "sql_redo" values because they give the transaction details
F"PFv%Uw/C:X$y11269677and syntax.
+CHSf4w11269677
H!@~&}.EX8P n%}11269677
/j fnd7G2Y ^,Z z112696775. PLACEHOLDERSITPUB个人空间 DW8l/r^n j
===============ITPUB个人空间8fP2SnTl-B3x[Z

g)`&j ?5ak11269677In order to allow users to be able to query directly on specific data
,N7r R%}~$l.?%v5g&I:F+Z11269677values, there are up to five PLACEHOLDERs included at the end of
b"?f_(m*X:f11269677v$logmnr_contents. When enabled, a user can query on the specific BEFORE andITPUB个人空间i7yW'h)V'A5yC
AFTER values of a specific field, rather than a %LIKE% query against theITPUB个人空间*F/@(L+_$|C{K5mj
SQL_UNDO/REDO fields. This is implemented via an external file calledITPUB个人空间 wGmS M
"logmnr.opt". (See the Supplied Packages manual entry on dbms_logmnr forITPUB个人空间1A\.OQ!^:j
further details.) The file must exist in the same directory as the
Zc q(E;aqi|11269677dictionary file used, and contains the prototype mappings of the PHx fieldsITPUB个人空间#]"X^2[*P7S
to the fields in the table being analyzed.
\&k)zAC%J D11269677ITPUB个人空间&y$tPqv4s&H[
Example entry
w B"t,c-r z11269677=============ITPUB个人空间Fs~Ct/B
colmap = SCOTT EMP ( EMPNO, 1, ENAME, 2, SAL, 3 );
}wN'B3s7g'h11269677ITPUB个人空间/iZJ|;v M j
In the above example, when a redo record is encountered for the SCOTT.EMPITPUB个人空间b[r%ZXV
table, the full Statement redo and undo information populates the SQL_REDOITPUB个人空间C[`I }
and SQL_UNDO columns respectively, however the PH3_NAME, PH3_REDO andITPUB个人空间9QG:IMyeKCQ+K.Q`
PH3_UNDO columns will also be populated with 'SAL' , ,
7g!K:["L o0c P$s$jo11269677respectively,which means that the analyst can query in the form.
_gcIs9}1K11269677
#U+FAT9qlI6{11269677SELECT * FROM V$LOGMNR_CONTENTS
,k0]ilXq e ]d11269677WHERE SEG_NAME ='EMP'
-^$M7_'YPw4E11269677AND PH3_NAME='SAL'ITPUB个人空间+d5I5z(Ya,j y F
AND PH3_REDO=1000000;
MqLl_ W-a11269677
m6rn ~Nv!OT11269677The returned PH3_UNDO column would return the value prior to the update.
Le zzj'~)T-Z11269677This enables much more efficient queries to be run against V$LOGMNR_CONTENTS
0{]Sh M*bS C11269677view, and if, for instance, a CTAS was issued to store a physical copy, theITPUB个人空间9u5SF;`|/m n
column can be indexed.ITPUB个人空间3C\1d iT2k,h

_ KTIp7ZY11269677ITPUB个人空间1uG$k9pE.Z!j-aQ
Search Words:ITPUB个人空间m$EL@AK A
=============ITPUB个人空间vv}4d h5Z!hp
ITPUB个人空间icF;v P5]7]e9i
Log Miner

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11269677/viewspace-613825/,如需转载,请注明出处,否则将追究法律责任。

上一篇: DBA笔试题目
请登录后发表评论 登录
全部评论

注册时间:2008-09-20

  • 博文量
    17
  • 访问量
    23017