千家信息网

oracle之 如何 dump logfile

发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,这篇文章解释了如何在联机或归档重做日志文件中获取转储。约束和限制:1。数据库必须安装(或打开)。更改系统转储日志文件与任何实例无关,因此不需要为其操作安装数据库。但是,在ALTER SYSTEM DU
千家信息网最后更新 2026年11月01日oracle之 如何 dump logfile

这篇文章解释了如何在联机或归档重做日志文件中获取转储。


约束和限制:
1。数据库必须安装(或打开)。
更改系统转储日志文件与任何实例无关,因此不需要为其操作安装数据库。
但是,在ALTER SYSTEM DUMP REDO的情况下,系统需要知道实例是什么,以及其他日志文件在哪里。
此查找需要控制文件,因此必须安装或打开数据库。

2。DUMP REDO限制在控制文件中识别的日志文件集。
因为我们在控制文件中查找日志文件和实例,如果在控制文件中有未引用的重做日志,那么这些重做日志将不会在转储文件中被考虑。
这样做的一个例子是,如果将日志文件删除,手动或实例从RAC集群中删除。

3。所有的日志文件都必须从调用实例中访问,尽管所有的联机重做日志都存储在共享磁盘上,但是每个实例的归档日志不需要。

下面介绍了转储重做日志文件的方法:

1. To dump records based in DBA (Data Block Address)
2. To dump records based on RBA (Redo Block Address)
3. To dump records based on SCN
4. To dump records based on time
5. To dump records based on layer and opcode
6. Dump the file header information
7. Dump an entire log file:

1. To dump records based on DBA (Data Block Address)
--------------------------------------------------

This will dump all redo records for the range of data
blocks specified for a given file # and block # range.

From sqlplus (sqldba or svrmgr for older versions), issue the following command:

ALTER SYSTEM DUMP LOGFILE 'filename'
DBA MIN fileno blockno
DBA MAX fileno blockno;

Example:
========
ALTER SYSTEM DUMP LOGFILE 'u01/oracle/V7323/dbs/arch2_76.dbf'
DBA MIN 5 31125
DBA MAX 5 31150;

这将导致对指定范围的数据块进行所有更改。
转储到跟踪文件。在给定的示例中,所有重做文件#5的记录,
第31125至31150条被dump

Note
====
For 10g:
ALTER SYSTEM DUMP LOGFILE 'u01/oracle/V7323/dbs/arch2_76.dbf'
DBA MIN 5 . 31125 DBA MAX 5 31150;

will raise:
ORA-01963: Must specify a block number

In 10g we need to skip the dot '.' while doing the redo dumps
ALTER SYSTEM DUMP LOGFILE 'u01/oracle/V7323/dbs/arch2_76.dbf'
DBA MIN 5 31125 DBA MAX 5 31150;


2. To dump records based on RBA (Redo Block Address)
-------------------------------------------------

This will dump all redo records for the range of redo
addresses specified for the given sequence number and block number.

Syntax:
ALTER SYSTEM DUMP LOGFILE 'filename'
RBA MIN seqno blockno
RBA MAX seqno blockno;

Example:
ALTER SYSTEM DUMP LOGFILE 'u01/oracle/V7323/dbs/arch2_76.dbf'
RBA MIN 2050 13255
RBA MAX 2255 15555;

3. To dump records based on SCN
----------------------------

Using this option will cause redo records owning changes within the SCN range
specified to be dumped to the trace file.

ALTER SYSTEM DUMP LOGFILE 'filename'
SCN MIN minscn
SCN MAX maxscn;

Example:
ALTER SYSTEM DUMP LOGFILE 'u01/oracle/V7323/dbs/arch2_76.dbf'
SCN MIN 103243
SCN MAX 103294;

If the purpose is to check the dumpfile you can rather do the following,
SQL> ALTER SYSTEM DUMP LOGFILE 'filename' SCN MIN 1 SCN MAX 1;

If the above completes sucessfully it ensures no issues with the archivelog.


4. To dump records based on time.
------------------------------

Using this option will cause redo records created within the time range
specified to be dumped to the trace file.

From sqlplus (sqldba or svrmgr for older versions), issue the following command:

ALTER SYSTEM DUMP LOGFILE 'filename'
TIME MIN value
TIME MAX value;

Example:
========
ALTER SYSTEM DUMP LOGFILE 'u01/oracle/V7323/dbs/arch2_76.dbf'
TIME MIN 299425687
TIME MAX 299458800;


Please Note: the time value is given in REDO DUMP TIME

5. To dump records based on layer and opcode.
------------------------------------------

LAYER and OPCODE are used to dump all log records for a particular type of
redo record, such as all dropped row pieces.

From sqlplus (sqldba or svrmgr for older versions), issue the following command:

ALTER SYSTEM DUMP LOGFILE 'filename'
LAYER value
OPCODE value;

Example:
========
ALTER SYSTEM DUMP LOGFILE 'u01/oracle/V7323/dbs/arch2_76.dbf'
LAYER 11
OPCODE 3;


6. Dump the file header information:
---------------------------------

This will dump file header information for every
online redo log file.

From sqlplus (sqldba or svrmgr for older versions), issue the following command:

alter session set events 'immediate trace name redohdr level 10';

For dumping archivelog header,issue the following command:

ALTER SYSTEM DUMP LOGFILE 'filename' RBA MIN 1 1 RBA MAX 1 1;

7. Dump an entire log file:
------------------------

From sqlplus (sqldba or svrmgr for older versions), issue the following command:

ALTER SYSTEM DUMP LOGFILE 'filename';

Please note:
Fully qualify the filename, and include the single quotes.

Example:
========
ALTER SYSTEM DUMP LOGFILE 'u01/oracle/V7323/dbs/arch2_76.dbf';


补充:
ALTER SYSTEM DUMP REDO [option] .... [option];

[options] -> scn min [scn] | scn max [scn] |
dba min [file#] [block#] | dba max [file#] [block#] |
time min [ub4] | time max [ub4] |
layer [word] |
opcode [word] |
objno [word] |
xid [undoseg#] [slot#] [wrap#] |
validate

参考:How to Dump Redo Log File Information (文档 ID 1031381.6)

文件 日志 实例 数据 控制 数据库 系统 限制 例子 及其他 情况 手动 文档 方法 磁盘 示例 篇文章 范围 集群 参考 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 广州万易互联网科技有限公司 上海卓越科技互联网 互联网科技工作委员会副主任毛军 互联网是不是新科技 广州互联网络科技有限公司 互联网金融监管科技 中国最先进互联网科技公司 汉立互联网科技有限公司联系电话 博兴的互联网电子科技公司 温州喔噻互联网科技有限公司 欧洲十大科技互联网公司 重庆威客帮互联网科技 贵州叶脉互联网科技有限公司所属行业 科技类公司包括互联网吗 互联网行业科技股 互联网金融科技元年 半导体行业属于互联网高科技类吗 科技互联网经济论坛 恒生互联网科技趋势 六子台科技互联网展会 工业互联网科技新基建 互联网科技集团 世界互联网领先科技成果 鑫亿盛互联网科技 广西互联网科技公司 现代科技和互联网有关系吗 互联网软件和科技 彤创互联网科技有限公司 和信科技工业互联网 消费医药和互联网科技
0