鸡肋,食之无味,弃之可惜 永远学习中

LOGMINER查找DDL操作

上一篇 / 下一篇  2008-08-15 10:28:53 / 个人分类:工具

查看( 38 ) / 评论( 7 )
SQL> SELECT SUPPLEMENTAL_LOG_DATA_MIN FROM V$DATABASE;

SUPPLEME                                                                        
--------                                                                        
NO                                                                              

SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

数据库已更改。

SQL> SELECT SUPPLEMENTAL_LOG_DATA_MIN FROM V$DATABASE;

SUPPLEME                                                                        
--------                                                                        
YES                                                                             

SQL> EXECUTE DBMS_LOGMNR.ADD_LOGFILE ('E:ARCHIVEARC00049_0658271597.001',DBMS_LOGMNR.NEW);

PL/SQL 过程已成功完成。


SQL> EXECUTE DBMS_LOGMNR.START_LOGMNR(-
>     OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG);

PL/SQL 过程已成功完成。

SQL> EXECUTE DBMS_LOGMNR.START_LOGMNR(-
>     options => dbms_logmnr.ddl_dict_tracking);

PL/SQL 过程已成功完成。


SQL> SELECT USERNAME,SQL_REDO,TIMESTAMP FROM V$LOGMNR_CONTENTS WHERE USERNAME =
'TEST' AND PERATION = 'DDL';

USERNAME
------------------------------
SQL_REDO
--------------------------------------------------------------------------------

TIMESTAMP
--------------
TEST
alter table a add  memo varchar2(10);
15-8月 -08

TAG:

一条横线 jusdoi 发布于2008-08-15 10:32:15
恭喜恭喜,很成功
zergduan的个人空间 zergduan 发布于2008-08-15 10:43:39
需要SUPPLEMENTAL  LOG么? 不是说这个需要使用在复合主键的update上么?
谢谢
howard_zhang的个人空间 howard_zhang 发布于2008-08-15 10:45:28
这里应该改可以不用
五“宅”一生发布于2008-08-15 13:37:34
不错不错,谢谢分享!
carcase发布于2008-08-15 13:48:19
EXECUTE DBMS_LOGMNR.START_LOGMNR(-
>     options => dbms_logmnr.ddl_dict_tracking);

是关键吧  options 这个很少看到 ,能指明出处吗??  给个原文的连接 谢谢
zergduan的个人空间 zergduan 发布于2008-08-15 13:53:08
DBMS_LOGMNR Constants
Table 25-1 describes the constants for the ADD_LOGFILE options flag in the DBMS_LOGMNR package.

Table 25-1  Constants for ADD_LOGFILE Options Flag
Constant Description
NEW
DBMS_LOGMNR.NEW purges the existing list of redo logs, if any. Places the specified redo log in the list of redo logs to be analyzed.

ADDFILE
DBMS_LOGMNR.ADDFILE adds the specified redo log to the list of redo logs to be analyzed. Any attempts to add a duplicate file raise an exception (ORA-1289).

REMOVEFILE
DBMS_LOGMNR.REMOVEFILE removes the redo log from the list of redo logs to be analyzed. Any attempts to remove a file that has not been previously added, raise an exception (ORA-1290).


Table 25-2 describes the constants for the START_LOGMNR options flag in the DBMS_LOGMNR package.

Table 25-2  Constants for START_LOGMNR Options Flag
Constant Description
COMMITTED_DATA_ONLY
If set, only DMLs corresponding to committed transactions are returned. DMLs corresponding to a committed transaction are grouped together. Transactions are returned in their commit order. If this option is not set, all rows for all transactions (committed, rolled back, and in-progress) are returned

SKIP_CORRUPTION
Directs a SELECT operation from V$LOGMNR_CONTENTS to skip any corruptions in the redo log being analyzed and continue processing. This option works only when a block in the redo log (and not the header of the redo log) has been corrupted. Caller should check the INFO column in the V$LOGMNR_CONTENTS view to determine the corrupt blocks skipped by LogMiner.

DDL_DICT_TRACKING
If the dictionary in use is a flat file or in the redo logs, LogMiner ensures that its internal dictionary is updated if a DDL event occurs. This ensures that correct SQL_REDO and SQL_UNDO information is maintained for objects that are modified after the LogMiner dictionary is built.

This option cannot be used in conjunction with the DICT_FROM_ONLINE_CATALOG option.

DICT_FROM_ONLINE_CATALOG
Directs LogMiner to use the current "live" database dictionary rather than a dictionary snapshot contained in a flat file or in a redo log.

This option cannot be used in conjunction with the DDL_DICT_TRACKING option.

DICT_FROM_REDO_LOGS
If set, LogMiner expects to find a dictionary in the redo logs that were specified with the DBMS_LOGMNR.ADD_LOGFILE procedure.

NO_SQL_DELIMITER
if set, the SQL delimiter (a semicolon) is not placed at the end of reconstructed SQL statements.

PRINT_PRETTY_SQL
If set, LogMiner formats the reconstructed SQL statements for ease of reading.

CONTINUOUS_MINE
If set, you only need to register one archived redo log. LogMiner automatically adds and mines any subsequent archived redo logs and also the online catalog. This is useful when you are mining in the same instance that is generating the redo logs.
season0891的个人空间 season0891 发布于2008-08-15 14:25:18
学习了
我来说两句

(可选)

日历

« 2009-01-09  
    123
45678910
11121314151617
18192021222324
25262728293031

数据统计

  • 访问量: 1944
  • 日志数: 24
  • 建立时间: 2008-01-22
  • 更新时间: 2008-11-17

RSS订阅

Open Toolbar