ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Logminer

Logminer

原创 Linux操作系统 作者:dragondb 时间:2019-04-30 19:48:06 0 删除 编辑
使用Logminer来分析重作日志......

1. 设立UTL_FILE_DIR参数用来存放数据字典文件;

2. 如果系统没有package:dbms_logmnr and dbms_logmnr_d,

那么以sys用户来执行dbmslmd.sql文件;

3. 执行procedure DBMS_LOGMNR_D.BUILD来创建数据字典文件;

exec dbms_logmnr_d.build('loganalyze.ora','/oracle/database/',
dbms_logmnr_d.STORE_IN_FLAT_FILE);

4. 创建日志分析列表

exec dbms_logmnr.add_logfile(/oracle/database/redo01.log',dbms_logmnr.NEW);

5. 使用Logminer进行日志分析

exec dbms_logmnr.start_logmnr(startTime => to_date('2005-09-12 09:30','yyyy-mm-dd hh24:mi'),
endTime =>to_date('2005-09-12 10:30','yyyy-mm-dd hh24:mi'));

6. 提取分析结果

v$logmnr_contents(内容因会话存在而存在);

LogMiner Recommendations and Restrictions

Recommendations
Oracle Corporation recommends that you take the following into consideration when you are using LogMiner:

All databases should employ an alternate tablespace for LogMiner tables.
By default all LogMiner tables are created to use the SYSTEM tablespace.
Use the DBMS_LOGMNR_D.SET_TABLESPACE routine to re-create all LogMiner tables in an alternate tablespace.
For example, the following statement will re-create all LogMiner tables to use the logmnrts$ tablespace:
SQL> EXECUTE DBMS_LOGMNR_D.SET_TABLESPACE('logmnrts$');

See Also:
Oracle9i Supplied PL/SQL Packages and Types Reference for
a full description of the DBMS_LOGMNR_D.SET_TABLESPACE routine

Restrictions
The following restrictions apply when you are using LogMiner:

The following are not supported:
Simple and nested abstract datatypes (ADTs)
Collections (nested tables and VARRAYs)
Object Refs
Index organized tables (IOTs)
CREATE TABLE AS SELECT of a table with a clustered key
LogMiner runs only on databases of release 8.1 or higher,
but you can use it to analyze redo logs from release 8.0 databases.
However, the information that LogMiner is able to retrieve from a redo log depends on
the version of the log, not the version of the database in use. For example,
redo logs for Oracle9i can be augmented to capture additional information when
supplemental logging is enabled. This allows LogMiner functionality to be used to its fullest advantage.
Redo logs created with older releases of Oracle will not have that additional data
and may therefore have limitations on the operations and datatypes supported by LogMiner.

For example, the following features require that supplemental logging be turned on.
(Note that in Oracle9i release 9.0.1, supplemental logging was always on
(it was not available at all in releases prior to 9.0.1). But in release 9.2,
you must specifically turn on supplemental logging; otherwise it will not be enabled.)

Support for index clusters, chained rows, and migrated rows (for chained rows, supplemental
logging is required, regardless of the compatibility level to which the database is set).
Support for direct-path inserts (also requires that ARCHIVELOG mode be enabled).
Extracting the data dictionary into the redo logs.
DDL tracking.
Generating SQL_REDO and SQL_UNDO with primary key information for updates.
LONG and LOB datatypes are supported only if supplemental logging is enabled.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/45259/viewspace-134893/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: Redo file
请登录后发表评论 登录
全部评论

注册时间:2003-05-05

  • 博文量
    98
  • 访问量
    94093