技术开发 频道

关于Oracle RMAN进行的一次有益测试

3 数据库备份
3.1 备份脚本
CONFIGURE CONTROLFILE AUTOBACKUP ON;
run
{
Crosscheck backup;
Crosscheck archivelog all;
delete NOPROMPT expired backup;
delete NOPROMPT OBSOLETE;
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup full database tag 'FullBackup' format '/racbackup/bak/db_full_%T_%d_%t_%s_%p_bak0' ;
sql 'alter system archive log current';
backup format '/racbackup/bak/arch_%T_%d_%t_%s_%p_bak0' archivelog all delete input;
backup spfile include current controlfile format '/racbackup/bak/spfile_controlfile_%T_%d_%t_%s_%p_bak0';
release channel c1;
release channel c2;
release channel c3;
}

3.2 备份执行结果
[oracle@test01 bin]$ ./rman nocatalog target /

Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jul 24 13:29:18 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: BLUESKY (DBID=1554831300)
using target database control file instead of recovery catalog

RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/app/oracle/product/10.2.0/db_1/dbs/snapcf_bluesky.f'; # default

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

run
{
Crosscheck backup;
Crosscheck archivelog all;
delete NOPROMPT expired backup;
delete NOPROMPT OBSOLETE;
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup full database tag 'FullBackup' format '/racbackup/bak/db_full_%T_%d_%t_%s_%p_bak0' ;
sql 'alter system archive log current';
backup format '/racbackup/bak/arch_%T_%d_%t_%s_%p_bak0' archivelog all delete input;
backup spfile include current controlfile format '/racbackup/bak/spfile_controlfile_%T_%d_%t_%s_%p_bak0';
release channel c1;
release channel c2;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
release channel c3;
}

RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17>
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
validation succeeded for archived log
archive log filename=+DG01/bluesky/1_1_693060487.dbf recid=2 stamp=693062811
validation succeeded for archived log
archive log filename=+DG01/bluesky/1_2_693060487.dbf recid=1 stamp=693062808
validation succeeded for archived log
archive log filename=+DG01/bluesky/1_3_693060487.dbf recid=3 stamp=693062813
validation succeeded for archived log
archive log filename=+DG01/bluesky/1_4_693060487.dbf recid=4 stamp=693062815
validation succeeded for archived log
archive log filename=+DG01/bluesky/1_5_693060487.dbf recid=5 stamp=693062815
validation succeeded for archived log
archive log filename=+DG01/bluesky/1_6_693060487.dbf recid=6 stamp=693062816
validation succeeded for archived log
archive log filename=+DG01/bluesky/1_7_693060487.dbf recid=7 stamp=693062822
Crosschecked 7 objects


using channel ORA_DISK_1

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
no obsolete backups found

released channel: ORA_DISK_1
allocated channel: c1
channel c1: sid=155 devtype=DISK

allocated channel: c2
channel c2: sid=138 devtype=DISK

allocated channel: c3
channel c3: sid=154 devtype=DISK

Starting backup at 24-JUL-09
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=+DG01/bluesky/datafile/system.265.693060399
input datafile fno=00004 name=+DG01/bluesky/datafile/users.268.693060403
channel c1: starting piece 1 at 24-JUL-09
channel c2: starting full datafile backupset
channel c2: specifying datafile(s) in backupset
input datafile fno=00003 name=+DG01/bluesky/datafile/sysaux.266.693060401
input datafile fno=00002 name=+DG01/bluesky/datafile/undotbs1.267.693060403
channel c2: starting piece 1 at 24-JUL-09
channel c2: finished piece 1 at 24-JUL-09
piece handle=/racbackup/bak/db_full_20090724_BLUESKY_693062990_2_1_bak0 tag=FULLBACKUP comment=NONE
channel c2: backup set complete, elapsed time: 00:00:56
channel c1: finished piece 1 at 24-JUL-09
piece handle=/racbackup/bak/db_full_20090724_BLUESKY_693062990_1_1_bak0 tag=FULLBACKUP comment=NONE
channel c1: backup set complete, elapsed time: 00:01:17
Finished backup at 24-JUL-09

Starting Control File and SPFILE Autobackup at 24-JUL-09
piece handle=/opt/app/oracle/product/10.2.0/db_1/dbs/c-1554831300-20090724-00 comment=NONE
Finished Control File and SPFILE Autobackup at 24-JUL-09

sql statement: alter system archive log current

Starting backup at 24-JUL-09
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=1 recid=2 stamp=693062811
channel c1: starting piece 1 at 24-JUL-09
channel c2: starting archive log backupset
channel c2: specifying archive log(s) in backup set
input archive log thread=1 sequence=8 recid=8 stamp=693063079
input archive log thread=1 sequence=9 recid=9 stamp=693063079
channel c2: starting piece 1 at 24-JUL-09
channel c3: starting archive log backupset
channel c3: specifying archive log(s) in backup set
input archive log thread=1 sequence=2 recid=1 stamp=693062808
input archive log thread=1 sequence=3 recid=3 stamp=693062813
input archive log thread=1 sequence=4 recid=4 stamp=693062815
channel c3: starting piece 1 at 24-JUL-09
channel c2: finished piece 1 at 24-JUL-09
piece handle=/racbackup/bak/arch_20090724_BLUESKY_693063080_5_1_bak0 tag=TAG20090724T133119 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
channel c2: deleting archive log(s)
archive log filename=+DG01/bluesky/1_8_693060487.dbf recid=8 stamp=693063079
archive log filename=+DG01/bluesky/1_9_693060487.dbf recid=9 stamp=693063079
channel c3: finished piece 1 at 24-JUL-09
piece handle=/racbackup/bak/arch_20090724_BLUESKY_693063080_6_1_bak0 tag=TAG20090724T133119 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:03
channel c3: deleting archive log(s)
archive log filename=+DG01/bluesky/1_2_693060487.dbf recid=1 stamp=693062808
archive log filename=+DG01/bluesky/1_3_693060487.dbf recid=3 stamp=693062813
archive log filename=+DG01/bluesky/1_4_693060487.dbf recid=4 stamp=693062815
channel c1: finished piece 1 at 24-JUL-09
piece handle=/racbackup/bak/arch_20090724_BLUESKY_693063080_4_1_bak0 tag=TAG20090724T133119 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:04
channel c1: deleting archive log(s)
archive log filename=+DG01/bluesky/1_1_693060487.dbf recid=2 stamp=693062811
channel c2: starting archive log backupset
channel c2: specifying archive log(s) in backup set
input archive log thread=1 sequence=5 recid=5 stamp=693062815
input archive log thread=1 sequence=6 recid=6 stamp=693062816
input archive log thread=1 sequence=7 recid=7 stamp=693062822
channel c2: starting piece 1 at 24-JUL-09
channel c2: finished piece 1 at 24-JUL-09
piece handle=/racbackup/bak/arch_20090724_BLUESKY_693063083_7_1_bak0 tag=TAG20090724T133119 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:03
channel c2: deleting archive log(s)
archive log filename=+DG01/bluesky/1_5_693060487.dbf recid=5 stamp=693062815
archive log filename=+DG01/bluesky/1_6_693060487.dbf recid=6 stamp=693062816
archive log filename=+DG01/bluesky/1_7_693060487.dbf recid=7 stamp=693062822
Finished backup at 24-JUL-09

Starting backup at 24-JUL-09
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
channel c1: starting piece 1 at 24-JUL-09
channel c2: starting full datafile backupset
channel c2: specifying datafile(s) in backupset
channel c1: finished piece 1 at 24-JUL-09
piece handle=/racbackup/bak/spfile_controlfile_20090724_BLUESKY_693063086_8_1_bak0 tag=TAG20090724T133126 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
including current SPFILE in backupset
channel c2: starting piece 1 at 24-JUL-09
channel c2: finished piece 1 at 24-JUL-09
piece handle=/racbackup/bak/spfile_controlfile_20090724_BLUESKY_693063088_9_1_bak0 tag=TAG20090724T133126 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:02
Finished backup at 24-JUL-09

Starting Control File and SPFILE Autobackup at 24-JUL-09
piece handle=/opt/app/oracle/product/10.2.0/db_1/dbs/c-1554831300-20090724-01 comment=NONE
Finished Control File and SPFILE Autobackup at 24-JUL-09

released channel: c1

released channel: c2

released channel: c3

RMAN>

 

0
相关文章