dbms_logmnr 之二 LogMiner Dictionary Options

版权声明:本文为博主原创文章,转载请标明出处。 https://blog.csdn.net/ctypyb2002/article/details/89452425

os: centos 7.4
db: oracle 12.1.0.2

版本

# lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 7.4.1708 (Core) 
Release:	7.4.1708
Codename:	Core

# su - oracle
$ sqlplus / as sydba;
SQL> set lines 500;
SQL> set pages 500;
SQL> 
SQL> 
SQL> select ins."INSTANCE_NUMBER",ins."INSTANCE_NAME",ins."HOST_NAME",ins."VERSION"
from v$instance ins
;   

INSTANCE_NUMBER INSTANCE_NAME	 HOST_NAME							  VERSION
--------------- ---------------- ---------------------------------------------------------------- -----------------
	      1 orcl		 oradb								  12.1.0.2.0

SQL> select *
from v$version v
where 1=1
;

BANNER										     CON_ID
-------------------------------------------------------------------------------- ----------
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production		  0
PL/SQL Release 12.1.0.2.0 - Production							  0
CORE	12.1.0.2.0	Production								  0
TNS for Linux: Version 12.1.0.2.0 - Production						  0
NLSRTL Version 12.1.0.2.0 - Production							  0

简述

LogMiner requires a dictionary to translate object IDs into object names when it returns redo data to you. LogMiner gives you three options for supplying the dictionary:

1.Using the Online Catalog

Oracle recommends that you use this option when you will have access to the source database from which the redo log files were created and when no changes to the column definitions in the tables of interest are anticipated. This is the most efficient and easy-to-use option.

EXECUTE DBMS_LOGMNR.START_LOGMNR(-
   OPTIONS => dbms_logmnr.dict_from_online_catalog);

2.Extracting a LogMiner Dictionary to the Redo Log Files

Oracle recommends that you use this option when you do not expect to have access to the source database from which the redo log files were created, or if you anticipate that changes will be made to the column definitions in the tables of interest.

EXECUTE DBMS_LOGMNR_D.BUILD( -
   OPTIONS=> dbms_logmnr_d.store_in_redo_logs);
   

3.Extracting the LogMiner Dictionary to a Flat File

This option is maintained for backward compatibility with previous releases. This option does not guarantee transactional consistency. Oracle recommends that you use either the online catalog or extract the dictionary from redo log files instead.


alter system set utl_file_dir='/tmp' scope=spfile;

startup force;

EXECUTE DBMS_LOGMNR_D.BUILD(
   dictionary_filename => 'dictionary.ora',
   dictionary_location => '/tmp',
   options => DBMS_LOGMNR_D.store_in_flat_file
   );
	

The following list is a summary of LogMiner settings that you can specify with the OPTIONS parameter to DBMS_LOGMNR.START_LOGMNR and where to find more information about them.

DICT_FROM_ONLINE_CATALOG — See “Using the Online Catalog”

DICT_FROM_REDO_LOGS — See “Start LogMiner”

CONTINUOUS_MINE — See “Redo Log File Options”

COMMITTED_DATA_ONLY — See “Showing Only Committed Transactions”

SKIP_CORRUPTION — See “Skipping Redo Corruptions”

NO_SQL_DELIMITER — See “Formatting Reconstructed SQL Statements for Re-execution”

PRINT_PRETTY_SQL — See “Formatting the Appearance of Returned Data for Readability”

NO_ROWID_IN_STMT — See “Formatting Reconstructed SQL Statements for Re-execution”

DDL_DICT_TRACKING — See “Tracking DDL Statements in the LogMiner Dictionary”

参考:
https://docs.oracle.com/database/121/SUTIL/GUID-A69748AD-B53D-42D9-9B54-C8132D8E4C1C.htm#SUTIL1559
https://docs.oracle.com/database/121/SUTIL/GUID-A5A1E94C-45AA-4B6A-B7B3-E1AD2F8675B5.htm#SUTIL1564

猜你喜欢

转载自blog.csdn.net/ctypyb2002/article/details/89452425