[Logmnr]對重做日誌進行資料探勘
1、建立演示資料
2、查詢重做日誌相關資訊
3、新增需要進行解析的日誌檔案
4、使用線上字典進行解析+只查詢commit的資料
5、查詢解析結果
6、結束整個Logminer
-
SQL> conn scott/tiger@neal_192.168.8.205;
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.4.0
Connected as scott@neal_192.168.8.205
SQL> create table t(id number);
Table created
SQL> insert into t values(1);
1 row inserted
SQL> insert into t values(2);
1 row inserted
SQL> commit;
Commit complete
SQL> update emp set sal=sal+1 where deptno=10;
3 rows updated
SQL> commit;
Commit complete
-
SQL> conn sys/oracle@neal_192.168.8.205 as sysdba
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.4.0
Connected as sys@neAL_192.168.8.205 AS SYSDBA
SQL> select group#,sequence#,archived,status,first_change# from v$log;
GROUP# SEQUENCE# ARCHIVED STATUS FIRST_CHANGE#
---------- ---------- -------- ---------------- -------------
1 34 YES INACTIVE 1368330
2 35 NO CURRENT 1368340
3 33 YES INACTIVE 1368318
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/u01/oracle/oradata/neal/redo03.log
/u01/oracle/oradata/neal/redo02.log
/u01/oracle/oradata/neal/redo01.log
-
SQL> exec dbms_logmnr.add_logfile('/u01/oracle/oradata/neal/redo01.log',dbms_logmnr.new);
-
PL/SQL procedure successfully completed
-
-
SQL> exec dbms_logmnr.add_logfile('/u01/oracle/oradata/neal/redo02.log',dbms_logmnr.addfile);
-
PL/SQL procedure successfully completed
-
-
SQL> exec dbms_logmnr.add_logfile('/u01/oracle/oradata/neal/redo03.log',dbms_logmnr.addfile);
- PL/SQL procedure successfully completed
-
SQL> exec dbms_logmnr.start_logmnr(options=>dbms_logmnr.dict_from_online_catalog+dbms_logmnr.committed_data_only);
- PL/SQL procedure successfully completed
-
SQL> select sql_redo,sql_undo from v$logmnr_contents where table_name='T' and operation='INSERT';
SQL_REDO SQL_UNDO
------------------------------------------- ------------------------------------------------------------
insert into "SCOTT"."T"("ID") values ('1'); delete from "SCOTT"."T" where "ID" = '1' and ROWID = 'AAAVeY
insert into "SCOTT"."T"("ID") values ('2'); delete from "SCOTT"."T" where "ID" = '2' and ROWID = 'AAAVeY
SQL> select sql_redo,sql_undo from v$logmnr_contents where table_name='EMP';
SQL_REDO SQL_UNDO
------------------------------------------------------------ ------------------------------------------------------------
update "SCOTT"."EMP" set "SAL" = '2472' where "SAL" = '2462' update "SCOTT"."EMP" set "SAL" = '2462' where "SAL" = '2472'
update "SCOTT"."EMP" set "SAL" = '5022' where "SAL" = '5012' update "SCOTT"."EMP" set "SAL" = '5012' where "SAL" = '5022'
update "SCOTT"."EMP" set "SAL" = '1322' where "SAL" = '1312' update "SCOTT"."EMP" set "SAL" = '1312' where "SAL" = '1322'
-
SQL> exec dbms_logmnr.end_logmnr();
- PL/SQL procedure successfully completed
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29812844/viewspace-1988825/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [Logmnr]對歸檔日誌進行資料探勘
- logmnr分析線上重做日誌
- logmnr分析歸檔重做日誌
- 在oracle中Logmnr進行日誌挖掘Oracle
- 在ORACLE中對線上重做日誌檔案進行調整Oracle
- LogMnr-誤DML後使用logmnr對資料進行恢復
- 使用LOGMNR檢視資料庫日誌資料庫
- 達夢資料庫使用DBMS_LOGMNR進行日誌挖掘詳細步驟資料庫
- 重做日誌
- 聯機重做日誌、歸檔日誌、備用重做日誌
- MySQL重做日誌恢復資料的流程MySql
- logmnr 日誌挖掘
- 重做日誌管理
- 日誌和告警資料探勘經驗談
- 為oracle新增重做日誌組及重做日誌成員Oracle
- ORACLE LOGMNR 日誌挖掘Oracle
- Oracle資料庫重做日誌及歸檔日誌的工作原理說明Oracle資料庫
- redo重做日誌管理
- Oracle的重做日誌Oracle
- 恢復重做日誌
- MySQL重做日誌(redo log)MySql
- 重做日誌的恢復
- 重做日誌基礎操作
- oracle 恢復重做日誌Oracle
- dml操作重做日誌分析
- data guard中增加與刪除主備資料庫中的聯機重做日誌與備重做日誌檔案資料庫
- 教你如何用R進行資料探勘
- Oracle 使用logmnr檢視日誌Oracle
- oracle線上調整重做日誌Oracle
- 手工建立多路重做日誌組
- 重做日誌大小的設定
- Oracle重做日誌調整技巧Oracle
- logminer進行資料探勘分析測試
- Oracle11g redo log 建立、新增、刪除(重做日誌組,重做日誌檔案)Oracle
- 16、重做日誌檔案的狀態及重做日誌組的狀態說明
- 查詢SQL Server 2005資料庫重做日誌的資訊SQLServer資料庫
- 使用shell指令碼對Nginx日誌進行切分指令碼Nginx
- cronolog 對 tomcat 7 進行日誌切割Tomcat