- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
2#
发表于 2012-4-16 21:40:56
ODM TEST:
alter system set events '10046 trace name context forever,level 1';
rman target /
RMAN> list archivelog all;
List of Archived Log Copies
Key Thrd Seq S Low Time Name
select nvl(max(al.recid), 0)
into :b1
from v$archived_log al
where ((al.status in ('X', 'A') and al.is_recovery_dest_file = 'YES') and
al.creator = 'RMAN')
declare
thread number;
sequence number;
recid number;
alRec dbms_rcvman . alRec_t;
begin
dbms_rcvman . getArchivedLog(alRec => alRec);
if (:rlscn = alRec . rlgSCN and :stopthr = alRec .
thread and ((alRec . sequence >= to_number(:stopseq) and :toclause = 0) or
(alRec . sequence > to_number(:stopseq) and :toclause = 1))) then
:flag := 1;
else
:flag := 0;
:al_key :al_key_i := alRec . key;
:recid :recid_i := alRec . recid;
:stamp :stamp_i := alRec . stamp;
:thread := alRec . thread;
:sequence := alRec . sequence;
:fileName :fileName_i := alRec . fileName;
:lowSCN := alRec . lowSCN;
:lowTime := alRec . lowTime;
:nextSCN := alRec . nextSCN;
:nextTime := nvl(alRec . nextTime, to_date('12/31/9999', 'MM/DD/YYYY'));
:rlgSCN := alRec . rlgSCN;
:rlgTime := alRec . rlgTime;
:blocks := alRec . blocks;
:blockSize := alRec . blockSize;
:status := alRec . status;
:compTime :compTime_i := alRec . compTime;
:duplicate := alRec . duplicate;
:compressed :compress
begin
dbms_rcvman . listTranslateArchivedLogCopy(thread# => NULL,
sequence# => NULL,
first_change# => NULL,
file_name_pattern => :like
:like_i,
completedAfter => :after
:after_i,
completedBefore => :before
:before_i,
statusMask => :availableMask,
needstby => :getstby);
end;
SELECT RECID,
RECID,
STAMP,
THREAD#,
SEQUENCE#,
NAME,
FIRST_CHANGE#,
FIRST_TIME,
NEXT_CHANGE#,
NEXT_TIME,
RESETLOGS_CHANGE#,
RESETLOGS_TIME,
BLOCKS,
BLOCK_SIZE,
STATUS,
COMPLETION_TIME,
0,
IS_RECOVERY_DEST_FILE,
COMPRESSED,
DECODE(REGISTRAR, 'RFS', 'Y', 'SRMN', 'Y', 'RMAN', 'N', 'N') STBY
FROM V$ARCHIVED_LOG
WHERE (:B16 IS NULL OR THREAD# = :B16)
AND ((:B15 = :B4 AND (:B14 IS NULL OR (:B14 = RESETLOGS_CHANGE# AND
:B13 = RESETLOGS_TIME))) OR
(RESETLOGS_CHANGE# = :B3 AND RESETLOGS_TIME = :B2))
AND NEXT_CHANGE# > NVL(:B12, 0)
AND FIRST_CHANGE# < NVL(:B11, :B10)
AND (:B9 IS NULL OR NAME LIKE :B9)
AND DECODE(:B6,
:B8,
DECODE(STATUS, 'A', :B4, :B7),
DBMS_RCVMAN.ISSTATUSMATCH(STATUS, :B6)) = :B4
AND (ARCHIVED = 'YES' OR
(:B5 = :B4 AND ARCHIVED = 'NO' AND NAME IS NOT NULL AND
RESETLOGS_CHANGE# = :B3 AND RESETLOGS_TIME = :B2))
AND STANDBY_DEST = 'NO'
AND (:B1 = 0 OR IS_RECOVERY_DEST_FILE = 'YES')
ORDER BY RESETLOGS_CHANGE#,
RESETLOGS_TIME,
THREAD#,
FIRST_CHANGE#,
SEQUENCE#,
IS_RECOV |
|