Logminer

使用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博客 ” ,链接:http://blog.itpub.net/45259/viewspace-134893/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/45259/viewspace-134893/

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2021 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值