oracle rman开始备份归档日志的时候,是不是会自动切换redo?

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:570

oracle rman开始备份归档日志的时候,是不是会自动切换redo? 下面我们做个测试:

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.

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】