您的位置:首页 > 数据库 > Oracle

oracle11g利用logminer查看归档信息

2016-01-21 16:26 489 查看
 logminer是oracle的一项对redo log发掘的技术,通过分析已归档的归档日志进行,也能帮助dba对于数据库业务状态进行详尽的分析。本次实验是为了初步探索logminer的用法。  

官方是这么说的:All changes made to user data or to the database dictionary are recorded in the Oracle redo log files so that database recovery operations can be performed.

Because LogMiner provides a well-defined, easy-to-use, and comprehensive relational interface to redo log files, it can be used as a powerful data auditing tool, and also as a sophisticated data analysis tool. The following list describes some key capabilities
of LogMiner:

先利用 select stamp,name,first_time,next_time,blocks from v$archived_log; 查出需要分析的归档日志名字



建立logminer数据字典存放在redolog file里

EXECUTE DBMS_LOGMNR_D.BUILD( -

   OPTIONS=> DBMS_LOGMNR_D.STORE_IN_REDO_LOGS);

然后再sqlplus中执行EXECUTE DBMS_LOGMNR.ADD_LOGFILE( -

   LOGFILENAME => E:\ARCHIVELOG\ARC0000000008_0899652482.0001');

然后就可以利用select xid,scn,timestamp,table_name,operation,sql_redo,sql_undo from V$LOGMNR_CONTENTS;



而这个是针对单次查询的,如果需要一段时间内分析结果,可以对利用官方推荐的方法去生成一个V$LOGMNR_CONTENTS在其他文件上。

详细可以参考http://docs.oracle.com/cd/E11882_01/server.112/e22490/logminer.htm#SUTIL1565

更多0
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: