OracleLogminer说明

Oracle LogMiner是一个用于分析重做日志和归档日志的工具,支持从8i开始的版本。它可以用于确定数据库的逻辑损坏时间、执行精细的事务级恢复操作和后续审计。LogMiner需要与源数据库运行在同一硬件平台,并使用相同或更高版本的Oracle数据库软件。分析重做日志前需启用补充日志,以便记录更多有用信息。分析过程包括启用补充日志、提取或使用在线数据字典、指定要分析的重做日志文件、启动LogMiner、查询V$LOGMNR_CONTENTS和结束LogMiner会话。
摘要由CSDN通过智能技术生成

原 Oracle Logminer 说明https://blog.csdn.net/tianlesoftware/article/details/5604497版权声明: https://blog.csdn.net/tianlesoftware/article/details/5604497
  一.  Logminer 说明
  Oracle LogMiner 的官网说明:
      Using LogMiner to Analyze Redo Log Files
       http://download.oracle.com/docs/cd/E11882_01/server.112/e16536/logminer.htm#SUTIL019
           Logminer是oracle从8i开始提供的用于分析重做日志信息的工具,它包括DBMS_LOGMNR和DBMS_LOGMNR_D两个package,后边的D是字典的意思。它既能分析redo log file,也能分析归档后的archive log file。在分析日志的过程中需要使用数据字典,一般先生成数据字典文件后使用,10g版本还可以使用在线数据字典。
         Logminer也可以分析其它数据库的重做日志文件,但是必须使用重做日志所在数据库的数据字典,否则会出现无法识别的乱码。另外被分析数据库的操作系统平台最好和当前Logminer所在数据库的运行平台一样,且block size相同。
         LogMiner是Oracle数据库提供的一个工具,它用于分析重做日志和归档日志所记载的事务操作。
       (1)确定数据库的逻辑损坏时间。假定某个用户执行drop table误删除了重要表sales,通过LogMiner可以准确定位该误操作的执行时间和SCN值,然后通过基于时间恢复或者基于SCN恢复可以完全恢复该表数据。
       (2)确定事务级要执行的精细逻辑恢复操作。假定某些用户在某表上执行了一系列DML操作并提交了事务,并且其中某个用户的DML操作存在错误。通过LogMiner可以取得任何用户的DML操作及相应的UNDO操作,通过执行UNDO操作可以取消用户的错误操作。
       (3)执行后续审计。通过LogMiner可以跟踪Oracle数据库的所有DML、DDL和DCL操作,从而取得执行这些操作的时间顺序、执行这些操作的用户等信息。
  LogMiner 由如下2个脚本来安装:
(1)创建DBMS_LOGMNR:$ORACLE_HOME/rdbms/admin/dbmslm.sql
SQL> @dbmslm.sql
程序包已创建。
授权成功。
(2)创建DBMS_LOGMNR_D:$ORACLE_HOME/rdbms/admin/dbmslmd.sql.
SQL> @dbmslmd.sql
过程已创建。
没有错误。
授权成功。
PL/SQL 过程已成功完成。
程序包已创建。
    1.1 Logminer 支持的数据类型和表的存储属性
LogMiner supports the following datatypes and table storage attributes:
(1).      CHAR
(2).      NCHAR
(3).      VARCHAR2 and VARCHAR
(4).      NVARCHAR2
(5).      NUMBER
(6).      DATE
(7).      TIMESTAMP
(8).      TIMESTAMP WITH TIME ZONE
(9).      TIMESTAMP WITH LOCAL TIME ZONE
(10).  INTERVAL YEAR TO MONTH
(11).  INTERVAL DAY TO SECOND
(12).  RAW
(13).  CLOB
(14).  NCLOB
(15).  BLOB
(16).  LONG
(17).  LONG RAW
(18).  BINARY_FLOAT
(19).  BINARY_DOUBLE
(20).  Index-organized tables (IOTs), including those with overflows or LOB columns
(21).  Function-based indexes
(22).  XMLTYPE data when it is stored in CLOB format
(23).  Tables using basic table compression and OLTP table compression
         Support for multibyte CLOBs is available only for redo logs generated by a database with compatibility set to a value of 10.1 or higher.
       Support for LOB and LONG datatypes is available only for redo logs generated by a database with compatibility set to a value of 9.2.0.0 or higher.
       Support for index-organized tables without overflow segment or with no LOB columns in them is available only for redo logs generated by a database with compatibility set to 10.0.0.0 or higher.
       Support for index-organized tables with overflow segment or with LOB columns is available only for redo logs generated by a database with compatibility set to 10.2.0.0 or higher.
  1.2  Logminer 不支持的数据类型和表存储属性
LogMiner does not support these datatypes and table storage attributes:
(1).      BFILE datatype
(2).      Simple and nested abstract datatypes (ADTs)
(3).      Collections (nested tables(嵌套表) and VARRAYs)
(4).      Object refs
(5).      SecureFiles (unless database compatibility is set to 11.2 or higher)
  1.3  LogMiner基本对象
       There are four basic objects in a LogMiner configuration that you should be familiar with: the source database, the mining database, the LogMiner dictionary, and the redo log files containing the data of interest:
       (1)The source database is the database that produces all the redo log files that you want LogMiner to analyze.
       (2)The mining database is the database that LogMiner uses when it performs the analysis.
       (3)The LogMiner dictionary allows LogMiner to provide table and column names, instead of internal object IDs, when it presents the redo log data that you request.
       LogMiner uses the dictionary to translate internal object identifiers and datatypes to object names and external data formats. Without a dictionary, LogMiner returns internal object IDs and presents data as binary data.
       -- LogMiner字典用于将内部对象ID号和数据类型转换为对象名和外部数据格式。使用LogMiner分析重做日志和归档日志时,应该生成LogMiner字典,否则将无法读懂分析结果。
  For example, consider the following the SQL statement:
       INSERT INTO HR.JOBS(JOB_ID, JOB_TITLE, MIN_SALARY, MAX_SALARY)  VALUES('IT_WT','Technical Writer', 4000, 11000);
  Without the dictionary, LogMiner will display:
insert into "UNKNOWN"."OBJ# 45522"("COL 1","COL 2","COL 3","COL 4") values (HEXTORAW('45465f4748'),HEXTORAW('546563686e6963616c20577269746572'),HEXTORAW('c229'),HEXTORAW('c3020b'));
              (4)The redo log files contain the changes made to the database or database dictionary.
  1.4  LogMiner配置要求
       The following are requirements for the source and mining database, the data dictionary, and the redo log files that LogMiner will mine:
  Source and mining database
       (1)Both the source database and the mining database must be running on the same hardware platform.
       -- 源数据库和分析数据库必须运行在相同硬件平台上;
       (2)The mining database can be the same as, or completely separate from, the source database.
       -- 分析数据库可以是独立数据库或源数据库;
       (3)The mining database must run the same release or a later release of the Oracle Database software as the source database.
       --分析数据库的版本不能低于源数据库的版本;
       (4)The mining database must use the same character set (or a superset of the character set) used by the source database.
       --分析数据库与源数据库必须具有相同的字符集。
  LogMiner dictionary
       (1)The dictionary must be produced by the same source database that generates the redo log files that LogMiner will analyze.    
       -- LogMiner字典必须在源数据库中生成。
  All redo log files:
       (1)Must be produced by the same source database.
       --当分析多个重做日志和归档日志时,它们必须是同一个源数据库的重做日志和归档日志;
       (2)Must be associated with the same database RESETLOGS SCN.
       --当分析多个重做日志和归档日志时,它们必须具有相同的resetlogs scn;
       (3)Must be from a release 8.0 or later Oracle Database. However, several of the LogMiner features introduced as of release 9.0.1 work only with redo log files produced on an Oracle9i or later database.
       --当分析的重做日志和归档日志必须在Oracle8.0版本以上。
         LogMiner does not allow you to mix redo log files from different databases or to use a dictionary from a different database than the one that generated the redo log files to be analyzed.
    1.5补充日志ÿ

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值