rman開始備份歸檔日誌的時候,是不是會自動切換redo?

paulyibinyi發表於2008-08-04

rman備份歸檔日誌一開始想應該不會切換redo,

除非是在rman 中指定 alter system archive log current

或者是backup database plus archivelog  這兩種情況下都會切換redo的

以下是測試過程  會切換redo:

C:\Documents and Settings\Paul Yi>sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.8.0 - Production on Mon Aug 4 12:28:21 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            d:\archpaul
Oldest online log sequence     4
Next log sequence to archive   6
Current log sequence           6    --可以看出當前日誌序列號是6
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production

C:\Documents and Settings\Paul Yi>rman target /

Recovery Manager: Release 9.2.0.8.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

connected to target database: PUBTEST (DBID=799229701)

RMAN> backup archivelog all delete input;

Starting backup at 04-AUG-08
current log archived
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=13 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=1 recid=279 stamp=657104122
input archive log thread=1 sequence=2 recid=280 stamp=657283300
input archive log thread=1 sequence=3 recid=281 stamp=659438570
input archive log thread=1 sequence=4 recid=282 stamp=661282078
input archive log thread=1 sequence=5 recid=283 stamp=661868887
input archive log thread=1 sequence=6 recid=284 stamp=661868945
channel ORA_DISK_1: starting piece 1 at 04-AUG-08
channel ORA_DISK_1: finished piece 1 at 04-AUG-08
piece handle=D:\BACKUP\4BJN6KCI_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_1: deleting archive log(s)
archive log filename=D:\ARCHPAUL\PUBTEST_1_1.DBF recid=279 stamp=657104122
archive log filename=D:\ARCHPAUL\PUBTEST_1_2.DBF recid=280 stamp=657283300
archive log filename=D:\ARCHPAUL\PUBTEST_1_3.DBF recid=281 stamp=659438570
archive log filename=D:\ARCHPAUL\PUBTEST_1_4.DBF recid=282 stamp=661282078
archive log filename=D:\ARCHPAUL\PUBTEST_1_5.DBF recid=283 stamp=661868887
archive log filename=D:\ARCHPAUL\PUBTEST_1_6.DBF recid=284 stamp=661868945
Finished backup at 04-AUG-08

RMAN> exit


Recovery Manager complete.

C:\Documents and Settings\Paul Yi>sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.8.0 - Production on Mon Aug 4 12:31:04 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            d:\archpaul
Oldest online log sequence     5
Next log sequence to archive   7
Current log sequence           7     --可以看到已經增進了一位
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production

檢視alert日誌

Thread 1 advanced to log sequence 7
  Current log# 3 seq# 7 mem# 0: D:\ORACLE\ORADATA\PUBTEST\REDO3_01.LOG
  Current log# 3 seq# 7 mem# 1: D:\ORACLE\ORADATA\PUBTEST\REDO3_02.LOG
Mon Aug 04 12:29:04 2008
ARCH: Evaluating archive   log 2 thread 1 sequence 6
ARCH: Beginning to archive log 2 thread 1 sequence 6
Creating archive destination LOG_ARCHIVE_DEST_1: 'D:\ARCHPAUL\PUBTEST_1_6.DBF'
Mon Aug 04 12:29:05 2008
ARC0: Evaluating archive   log 2 thread 1 sequence 6
ARC0: Unable to archive log 2 thread 1 sequence 6
      Log actively being archived by another process
Mon Aug 04 12:29:05 2008
ARCH: Completed archiving  log 2 thread 1 sequence 6

只有下面這種情況才不會切換redo

RMAN> backup archivelog until sequence 3;

Starting backup at 04-AUG-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=1 recid=285 stamp=661869167
input archive log thread=1 sequence=2 recid=286 stamp=661869167
input archive log thread=1 sequence=3 recid=290 stamp=661869169
channel ORA_DISK_1: starting piece 1 at 04-AUG-08
channel ORA_DISK_1: finished piece 1 at 04-AUG-08
piece handle=D:\BACKUP\4CJN6KK6_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 04-AUG-08

RMAN>

C:\Documents and Settings\Paul Yi>sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.8.0 - Production on Mon Aug 4 12:41:42 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            d:\archpaul
Oldest online log sequence     5
Next log sequence to archive   7
Current log sequence           7    --還是7無變化 日誌中無日誌切換變化內容

官方文件內容:

At the beginning of every BACKUP ... ARCHIVELOG command that does not
specify an UNTIL clause, RMAN attempts to automatically switch out of and
archive the current online redo log. In this way, RMAN can include the current redo
log in the backup set.
If the database is open, then at the start of an archived log backup RMAN tries to
switch out of and archive the current online log according to these rules:
n RMAN runs ALTER SYSTEM ARCHIVE LOG CURRENT.
n If the UNTIL clause or SEQUENCE parameter is specified, RMAN does not try to
switch or archive online logs. 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-417730/,如需轉載,請註明出處,否則將追究法律責任。

相關文章