Oracle Database does not provide any supplemental logging, which means that by default LogMiner is not usable
2014-10-11 17:45
591 查看
写在前面,在研究Oracle logmnr 的时候看到 http://www.askmaclean.com/archives/dbms_logmnr-unsupported-sqlredo.html 的文章,其中有一句
View Code
同样 对于david 的文章貌似也存在描述的不妥的情况
http://blog.csdn.net/tianlesoftware/article/details/6554674
不知道是不是也是测试的环境不同。
还是说我的测试具有偶然性。
经过测试至少可以证明几件事情:(基于当前测试环境 Oracle 11.2)
1.必须要创建utl_file_dir,创建之后必须重启数据库。
2.即便是没有启用supplemental log,在没有其他更好的办法的时候还是可以尝试logmnr恢复特定表的特定数据。
SQL> begin 2 dbms_logmnr.add_logfile(logfilename=>'/u01/app/flash_recovery_area/ORCL/archivelog/2014_10_11/o1_mf_1_12_b3kwq3qz_.arc',options=>dbms_logmnr.NEW); 3 dbms_logmnr.add_logfile(logfilename=>'/u01/app/flash_recovery_area/ORCL/archivelog/2014_10_11/o1_mf_1_11_b3kv67v1_.arc',options=>dbms_logmnr.ADDFILE); 4 end; 5 / PL/SQL procedure successfully completed. SQL> select sql_redo from v$logmnr_contents t where t.seg_name ='EMP2'; select sql_redo from v$logmnr_contents t where t.seg_name ='EMP2' * ERROR at line 1: ORA-01306: dbms_logmnr.start_logmnr() must be invoked before selecting from v$logmnr_contents SQL> execute 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 from v$logmnr_contents t where t.seg_name ='EMP2'; SQL_REDO ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ create table emp2 as select * from emp where 1 =2; insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7369','SMITH','CLERK','7902',TO_DATE('17-DEC-80', 'DD-MON-RR'),'800',NULL,'20'); insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7499','ALLEN','SALESMAN','7698',TO_DATE('20-FEB-81', 'DD-MON-RR'),'1600','300','30 '); insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7521','WARD','SALESMAN','7698',TO_DATE('22-FEB-81', 'DD-MON-RR'),'1250','500','30' ); insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7566','JONES','MANAGER','7839',TO_DATE('02-APR-81', 'DD-MON-RR'),'2975',NULL,'20') ; SQL_REDO ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7654','MARTIN','SALESMAN','7698',TO_DATE('28-SEP-81', 'DD-MON-RR'),'1250','1400',' 30'); insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7698','BLAKE','MANAGER','7839',TO_DATE('01-MAY-81', 'DD-MON-RR'),'2850',NULL,'30') ; insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7782','CLARK','MANAGER','7839',TO_DATE('09-JUN-81', 'DD-MON-RR'),'2450',NULL,'10') ; insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7788','SCOTT','ANALYST','7566',TO_DATE('19-APR-87', 'DD-MON-RR'),'3000',NULL,'20') ; SQL_REDO ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7839','KING','PRESIDENT',NULL,TO_DATE('17-NOV-81', 'DD-MON-RR'),'5000',NULL,'10'); insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7844','TURNER','SALESMAN','7698',TO_DATE('08-SEP-81', 'DD-MON-RR'),'1500','0','30' ); insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7876','ADAMS','CLERK','7788',TO_DATE('23-MAY-87', 'DD-MON-RR'),'1100',NULL,'20'); insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7900','JAMES','CLERK','7698',TO_DATE('03-DEC-81', 'DD-MON-RR'),'950',NULL,'30'); insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7902','FORD','ANALYST','7566',TO_DATE('03-DEC-81', 'DD-MON-RR'),'3000',NULL,'20'); insert into "SCOTT"."EMP2"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","DEPTNO") values ('7934','MILLER','CLERK','7782',TO_DATE('23-JAN-82', 'DD-MON-RR'),'1300',NULL,'10'); 15 rows selected.
View Code
同样 对于david 的文章貌似也存在描述的不妥的情况
http://blog.csdn.net/tianlesoftware/article/details/6554674
不知道是不是也是测试的环境不同。
还是说我的测试具有偶然性。
经过测试至少可以证明几件事情:(基于当前测试环境 Oracle 11.2)
1.必须要创建utl_file_dir,创建之后必须重启数据库。
2.即便是没有启用supplemental log,在没有其他更好的办法的时候还是可以尝试logmnr恢复特定表的特定数据。
相关文章推荐
- Myeclipse报错:The project: XXXX which is referenced by the classpath, does not exist.
- Eclipse. The archive which is referenced by the classpath, does not exist
- Eclipse下启动Tomcat报错: The archive: F:/JSPDev/apache-tomcat-8.0.32/bin/bootstrap.jar which is referenced by the classpath, does not exist.
- The project: radio which is referenced by the classpath, does not exist.
- Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist.
- Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist.
- Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist.
- Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."
- The archive: /jdk1.7.0_79/lib/tools.jar which is referenced by the classpath, does not exist.
- Given any integer 0 <= n <= 10000 not divisible by 2 or 5, some multiple of n is a number which in d
- A 2007 Office system application does not load an add-in that is developed by using VSTO
- The archive :xxx.jar which is referenced by the classpath, does not exist
- Oracle Data Guard ORA-16086: standby database does not contain available standby 处理方法
- Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist.
- The project: sgcc which is referenced by the classpath, does not exist.
- 【转】Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist.
- The project: xxxxx which is referenced by the classpath, does not exist
- The project: ems which is referenced by the classpath, does not exist.
- Tomcat配置: The archive: /bin/bootstrap.jar which is referenced by the classpath, does not exist.
- Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist.