Oracle8i Supplied PL/SQL Packages Reference Release 2 (8.1.6) Part Number A76936-01 |
|
DBMS_LOGMNR
supplies the log analyzer tool with the list of filenames and SCNs required to initialize the tool. After this procedure completes, the server is ready to process SELECT
s against the V$LOGMNR_CONTENTS
view.
Redo log data is especially important for recovery, because you can use it to pinpoint when a database became corrupted.You can then use this information to recover the database to the state just prior to corruption.
After you have created a dictionary file with DBMS_LOGMNR_D
, you can begin analyzing archived redo logs.
DBMS_LOGMNR
.ADD_LOGFILE
procedure. You can view information about specified log files with V$LOGMNR_LOGS
.
DBMS_LOGMNR
.START_LOGMNR
procedure. You can set the start and end SCN and time parameters in the START_LOGMNR
command to filter the redo records you will analyze. You can query the V$LOGMNR_PARAMETERS
view to view the parameters.
V$LOGMNR_CONTENTS
table. LogMiner returns all rows in SCN order, which is the same order applied in media recovery.
The V$LOGMNR_CONTENTS
table includes multiple sets of place holder columns. Each place holder column set contains a name column, a redo value column, and an undo value column. Each place holder column set can be assigned to a table and column via an optional LogMiner assignment file (logmnr
.opt
). After a place holder column is assigned, it can be used to select changes to the assigned column and table from the redo log stream.
For example, the assignment "colmap
=
SCOTT
EMP
(1
, EMPNO);
" assigns the PH1
place holder column set to the table; SCOTT
.EMP
, column EMPNO
. After being assigned, it is possible to select changes from the redo stream for the EMPNO
column of the EMP
table;
SELECT scn FROM V$LOGMNR_CONTENTS WHERE ph1_name=`EMPNO` AND ph1_redo=`12345`;
The redo stream is processed, and any changes setting the EMPNO
column of the EMP
table to the value 12345 are returned.
It is possible to have multiple assignments for each place holder column set. For example:
colmap = SCOTT EMP (1, EMPNO);
followed by
colmap = ACCOUNTING CUSTOMER (1, CUSTID);
In this case, the PH1
place holder column set has two assignments. In this case, the PH1 place holder column set has two assignments. Now the user can use the place holder column to select changes either to the EMP table or the CUSTOMER table as the following queries illustrate:
SELECT scn FROM V$LOGMNR_CONTENTS WHERE seg_name = `EMP` AND ph1_name=`EMPNO` AND ph1_redo=`12345`;
or
SELECT scn FROM V$LOGMNR_CONTENTS WHERE seg_name = `CUSTOMER` AND ph1_name=`CUSTID` AND ph1_redo=`12345`;
The logmnr
.opt
file is processed when the DBMS_LOGMNR
.START_LOGMNR
procedure is performed and Options
is set to USE_COLMAP
(Options
= USE_COLMAP
). Setting USE_COLMAP
in Options
instructs the LogMiner to read and process the logmnr
.opt
file. The logmnr
.opt
file should be located in the same directory as the LogMiner dictionary file.
After the place holder column assignment file (logmnr
.opt
) is processed, all subsequent selects from the V$LOGMNR_CONTENTS
table can use the assigned place holder columns. To change the assignments, update the logmnr
.opt
file, and re-start the LogMiner.
As the logmnr
.opt
file is processed the assigned columns are verified against the current LogMiner dictionary. If they do not exist, then the start fails.
line = 'colmap' <sp> '=' <sp> <schema> <sp> <table> <sp> '(' map ')' ';' map = <num> ',' <colname> [ ',' <num> ',' <colname>]
<sp> |
Space |
Words in quotes are fixed symbols:
|
Any number (limited to the number of place holder column sets) |
|
Name of the table |
|
Schema name |
|
Column name in the specified <schema>.<table> |
You can repeat <num
> ',' <colname
> inside the parentheses up to the number of place holder columns in V$LOGMNR_CONTENTS
table.
<table
>, <schema
> and <colname
> must be in all uppercase.
colmap = SCOTT EMP (1, EMPNO, 2 SAL, 3 JOB, 4 MGR, 5 COMM); colmap = SCOTT DEPT (1, DEPTNO);
ph1_redo
, ph1_undo
and ph4_redo
, ph4_undo
get filled.
colmap = SCOTT EMP (1, EMPNO, 2, EMPNO, 3, EMPNO, 4, MGR);
colmap
" and "=
":
colmap= SCOTT EMP (1, EMPNO, 2, SAL);
colmap = SCOTT EMP (1, EMPNO, 2);
colmap = SCOTT EMP (1, EMPNO)
colmap = scott EMP (1, EMPNO, 2 SAL);
colmap = SCOTT emp (1, EMPNO, 2 SAL);
colmap = SCOTT EMP (1, EMPNO, 2 SAL, 3 JOB, 4 MGR, 5 COMM, 6 ENAME);
REGION
is not part of the table:
colmap = SCOTT EMP (1, EMPNO, 2 SAL, 3 JOB, 4 REGION);
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|