這篇文章解釋了如何在聯(lián)機(jī)或歸檔重做日志文件中獲取轉(zhuǎn)儲(chǔ)。
創(chuàng)新互聯(lián)公司基于成都重慶香港及美國等地區(qū)分布式IDC機(jī)房數(shù)據(jù)中心構(gòu)建的電信大帶寬,聯(lián)通大帶寬,移動(dòng)大帶寬,多線BGP大帶寬租用,是為眾多客戶提供專業(yè)服務(wù)器托管報(bào)價(jià),主機(jī)托管價(jià)格性價(jià)比高,為金融證券行業(yè)服務(wù)器機(jī)柜租賃,ai人工智能服務(wù)器托管提供bgp線路100M獨(dú)享,G口帶寬及機(jī)柜租用的專業(yè)成都idc公司。
約束和限制:
1。數(shù)據(jù)庫必須安裝(或打開)。
更改系統(tǒng)轉(zhuǎn)儲(chǔ)日志文件與任何實(shí)例無關(guān),因此不需要為其操作安裝數(shù)據(jù)庫。
但是,在ALTER SYSTEM DUMP REDO的情況下,系統(tǒng)需要知道實(shí)例是什么,以及其他日志文件在哪里。
此查找需要控制文件,因此必須安裝或打開數(shù)據(jù)庫。
2。DUMP REDO限制在控制文件中識(shí)別的日志文件集。
因?yàn)槲覀冊(cè)诳刂莆募胁檎胰罩疚募蛯?shí)例,如果在控制文件中有未引用的重做日志,那么這些重做日志將不會(huì)在轉(zhuǎn)儲(chǔ)文件中被考慮。
這樣做的一個(gè)例子是,如果將日志文件刪除,手動(dòng)或?qū)嵗龔腞AC集群中刪除。
3。所有的日志文件都必須從調(diào)用實(shí)例中訪問,盡管所有的聯(lián)機(jī)重做日志都存儲(chǔ)在共享磁盤上,但是每個(gè)實(shí)例的歸檔日志不需要。
下面介紹了轉(zhuǎn)儲(chǔ)重做日志文件的方法:
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;
這將導(dǎo)致對(duì)指定范圍的數(shù)據(jù)塊進(jìn)行所有更改。
轉(zhuǎn)儲(chǔ)到跟蹤文件。在給定的示例中,所有重做文件#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';
補(bǔ)充:
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)