Logminer under Oracle9i

zhaozj2021-02-16  111

Note that you don't need to run the script for creating the logminer again in 9i, and the logminer has been created.

Here's the common field meaning of the view v $ logmnr_contents: Name meaning ---------------------------- --- ---------------------------------------- SCN-specific data change system change number TIMESTAMP Data Change Effective Time COMMIT_TIMESTAMP Data Change Submitted Time SEG_OWNER Data Change Segment Name Seg_Name Segment Owner Name Seg_Type Data Change Segment Type Seg_Type_Name Data Change Segment Class Table_Space Change Segment Table Space Row_ID Specific Data Change Row The idsession_info data change time user process information Operation Operation (such as INSERT) SQL_REDO can change the SQL statement SQL_UNDO that changes to the redo record to rewind or resume the registered SQL change Statement

First add a initialization parameter UTL_FILE_DIR to the init file to represent the location of the data dictionary file

UTL_FILE_DIR = (E: / Oracle / Logminer)

Since I use SPFILE, start the database first, start the database, use the Create SPFile from Pfile = 'E: / Oracle / Admin / ORACLE / Admin / Nbxtdb / pfile / init.ora '; generate spfile files

Turn off the database and restart the Startup and run the show parameter UTL to view the settings that correctly sql> show parameter UTL;

Name Type Value --------------------------------- ----------------------------- UTL_FILE_DIR STRING E: / ORACLE / LOGMINER

Correct, insert the data INSERT INTO JQG_TEST VALUS ('logminer') in the table JQG_TEST;

SQL> ALTER SYSTEM SWITCH LOGFILE; switch log generation archive

2. Create a dictionary SQL> EXECUTE DBMS_LOGMNR_D.BUILD ('Dictionary.ora', - 'E: / ORACLE / LOGMINER', - Options => DBMS_LOGMNR_D.STORE_IN_FLAT_FILE);

3. Add an archive exec dbms_logmnr.add_logfile (logfilename => 'e: /oracle/oradata/nbxtdb/archive/1_114.dbf', options => dbms_logmnr.new);

4. Initialize view EXECUTE DBMS_LOGMNR.Start_logmnr (DictFileName => 'E: / ORACLE/Logminer/Dictionary.Start_Logminer/Dictionary.Start_Logminer/Dictionary.ra', StartTime => To_date ('2004-06-25 23:12:00', 'YYYY-mm -DD ​​HH24: MI: SS '), EndTime => to_date (' 2004-06-25 23:20:00 ',' YYYY-MM-DD HH24: MI: SS ')); 5. Query View V $ logmnr_contents

SQL> SELECT SQL_REDO, SQL_UNDO from V $ logmnr_contents where seg_name = 'jqg_test' 2 and seg_owner = 'test' and seg_type_name = 'Table';

SQL_REDO ------------------------------------------------- -------------------------------

SQL_UNDO ------------------------------------------------- -------------------------------

INSERT INTO "TEST". "jqg_test" ("name") Values ​​('logminer'); delete from "test". "jqg_test" where "name" = 'logminer' and rowid = 'Aaahgpaahaaaaagae';

转载请注明原文地址:https://www.9cbs.com/read-19417.html

New Post(0)