前提:用SYS用户做了日志分析的操作。
打开另一个会话同样用SYS用户进行一些操作:
$ sqlplus /nolog
SQL*Plus: Release 9.2.0.6.0 - Production on Tue Oct 9 10:53:56 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> select sql_redo from v$logmnr_contents where sql_redo like '%delete%';
select sql_redo from v$logmnr_contents where sql_redo like '%delete%'
*
ERROR at line 1:
ORA-01306: dbms_logmnr.start_logmnr() must be invoked before selecting from
v$logmnr_contents //不同用前一个SESSION分析出的结果进行查询
SQL> EXECUTE dbms_logmnr.start_logmnr(DictFileName=>'/usr/tmp/v9600dic.ora');
BEGIN dbms_logmnr.start_logmnr(DictFileName=>'/usr/tmp/v9600dic.ora'); END;
*
ERROR at line 1:
ORA-01292: no log file has been specified for the current LogMiner session
ORA-06512: at "SYS.DBMS_LOGMNR", line 53
ORA-06512: at line 1 //需要重新加入日志列表
SQL> EXECUTE dbms_logmnr.add_logfile(LogFileName=>'/u01/oravis/visdata/log2.dbf',Options=>dbms_logmnr.new);
PL/SQL procedure successfully completed.
SQL> EXECUTE dbms_logmnr.start_logmnr(DictFileName=>'/usr/tmp/v9600dic.ora');
PL/SQL procedure successfully completed.
SQL> spool /usr/tmp/oraclelog1.txt
SQL> select sql_redo from v$logmnr_contents where sql_redo like '%delete%';
总结:数据字典文件可以不用重新创建了。
--转自