SAL
----------
800
1600
1250
2975
0
0
2450
3000
5000
1500
1100
SAL
----------
950
3000
1300
14 rows selected.
SQL>
七、结束logminer
exec dbms_logmnr.end_logmnr();
如:
SQL> exec dbms_logmnr.end_logmnr();
PL/SQL procedure successfully completed.
SQL>
***************************************************************************************************************************
***************************************************************************************************************************
八、使用logminer分析归档日志
8.1、数据库运行在归档模式
8.2、数据库已开启补全日志(附加日志)
8.3、查看字典文件生成目录
SQL> show parameter utl_file_dir
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
utl_file_dir string /u03
SQL>
8.4、为了方便实验,授予Scott用户dba权限
SQL> grant dba to scott;
Grant succeeded.
SQL>
SQL> conn scott/oracle
Connected.
SQL>
8.5、查看数据库当前日志文件及归档信息
SQL> set linesize 120
SQL>
SQL> select GROUP#,THREAD#,SEQUENCE#,ARCHIVED,MEMBERS,status from v$log;
GROUP# THREAD# SEQUENCE# ARC MEMBERS STATUS
---------- ---------- ---------- --- ---------- ----------------
1 1 154 YES 1 INACTIVE
2 1 153 YES 1 INACTIVE
3 1 155 NO 1 CURRENT
SQL>
8.6、创建数据字典文件目录
SQL> begin
dbms_logmnr_d.build('007dict.data','/u03');
end;
/ 2 3 4
PL/SQL procedure successfully completed.
SQL>
8.7、创建实验表
SQL> create table xxx as select * from emp;
Table created.
SQL> select * from xxx;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
7369 SMITH CLERK 7902 1980-12-17 00:00:00 0 20
7499 ALLEN SALESMAN 7698 1981-02-20 00:00:00 0 300 30
7521 WARD SALESMAN 7698 1981-02-22 00:00:00 0 500 30
7566 JONES MANAGER 7839 1981-04-02 00:00:00 0 20
7654 MARTIN SALESMAN 7698 1981-09-28 00:00:00 0 1400 30
7698 BLAKE MANAGER 7839 1981-05-01 00:00:00 0 30
7782 CLARK MANAGER 7839 1981-06-09 00:00:00 0 10
7788 SCOTT ANALYST 7566 1987-04-19 00:00:00 0 20
7839 KING PRESIDENT 1981-11-17 00:00:00 0 10
7844 TURNER SALESMAN 7698 1981-09-08 00:00:00 0 0 30
7876 ADAMS CLERK 7788 1987-05-23 00:00:00 0 20