[@more@]
Purpose:
========
The purpose of this article is to clarify the RMAN statement:
"backup archivelog until time 'XXXX'.
Scope & Application:
====================
This note is applicable to all users who use RMAN to perform backups.
The Meaning of RMAN "Backup Archivelog Until Time 'XXXX'":
==========================================================
Setup:
------
sqlplus
> connect / as sysdba
> alter system archive log stop;
> alter system switch logfile;
> select to_char(sysdate,'HH24:MI:SS') from dual;
> exec dbms_lock.sleep(120);
> alter system switch logfile;
> select to_char(sysdate,'HH24:MI:SS') from dual;
> exec dbms_lock.sleep(120);
> alter system archive log start;
> select to_char(first_time,'HH24:MI:SS'),
to_char(next_time,'HH24:MI:SS'),
to_char(completion_time,'HH24:MI:SS')
from v$archived_log;
Times of logswitches : 17:03:21 and 17:05:24
first next completion
17:02:05 17:03:21 17:08:14 <-- sequence number 782
17:03:21 17:05:24 17:08:14 <-- sequence number 783
RMAN> run {
RMAN> allocate channel c1 type disk format '/home/ldens/tmp/ap';
RMAN> backup archivelog until time '20-10-2000 17:03' skip inaccessible;
RMAN> }
==> RMAN takes all archives with a sequence number smaller or equal to 782.
Conclusion:
-----------
RMAN "backup archivelog until time 'XXXX' " means that RMAN backs up all
archives which it needs to recover until time 'XXXX'. In this case, this
means that it backs up all archives it can find until archive 782, this one
included.
The exact time, when the archive is created on disk or on tape (the
completion time), does not really play a role.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25274175/viewspace-1046411/ ,如需转载,请注明出处,否则将追究法律责任。