环境:正式环境是IBM4+IBM5(RAC),测试环境是IBM1,两环境的OS,ORACLE等软件一样。
都是 ORACLE10203, AIX(5300-07), 备份操作放在IBM4上执行。
一 背景介绍:
1 RAC环境的备份策略
每天作两次备份,0点和12点,备份脚本一样,只是中午12点的备份,输出的msglog=backup_ccdb_inc_0_12_$today.log,以别于0点的操作。
IBM4 ->crontab -l
0 0 * * * /orabak/script/rmandbbackup.sh>/dev/null 2>&1
0 12 * * * /orabak/script/rmandbbackup_12.sh>/dev/null 2>&1
IBM4 ->more /orabak/script/rmandbbackup.sh
export ORACLE_HOME=/oracle/product/10.2.0/db_1
export ORACLE_SID=ccdb1
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
today=`date +%Y%m%d`
weekday=`date +%w`
backuppath=/orabak
$ORACLE_HOME/bin/rman cmdfile=$backuppath/script/backup_ccdb_inc_0.script. msglog=$backuppath/rmanbacktrace/backup_ccdb_inc_0_$today.log
if test $? -ne 0; then
touch $backuppath/rmanbacktrace/"ccdb incremental level 0 backup failed! Date: $today"
$ORACLE_HOME/bin/sqlplus -S "/ as sysdba" @$backuppath/script/insertsms.sql
fi;
IBM4 ->more $backuppath/script/backup_ccdb_inc_0.script
/script/backup_ccdb_inc_0.script. No such file or directory
IBM4 ->more /orabak/script/backup_ccdb_inc_0.script
connect target /
connect catalog rman/xxxxxxxx@bi
run
{
allocate channel d1 type disk maxpiecesize 4000m ;
backup as compressed backupset incremental level = 0 database
format '/orabak/databackup/db_%d_%s_%p_%T'
plus archivelog skip inaccessible delete all input
format '/orabak/logbackup/log_%d_%s_%p_%T';
sql 'alter system archive log current';
release channel d1;
}
run
{ crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete recovery window of 7 days;
}
exit;
IBM4 ->
2 恢复前,需要将在IBM4上的备份拷贝到IBM1。由于IBM4的上备份集的保存路径为/ORABAK,而IBM1上只有/ORADATA,
拷贝过来的备份集将存在此目录下,故,恢复数据库前,需要告诉RMAN备份集的路径(步骤6)。
二 准备工作,把备份集拷贝到IBM1下
如下:备份集已经拷贝到IBM1的/oradata目录下
ibm1 ->pwd
/oradata
ibm1 ->cd orabak
ibm1 ->ls -lrt
total 0
drwxr-xr-x 2 oracle oinstall 256 Jun 20 15:12 logbackup
drwxr-xr-x 2 oracle oinstall 256 Jun 20 15:13 rmanspctlback
drwxr-xr-x 2 oracle oinstall 256 Jun 20 16:37 databackup
ibm1 ->cd rman*
ibm1 ->pwd
/oradata/orabak/rmanspctlback
ibm1 ->ls -lrt
total 23104
-rw-r----- 1 oracle oinstall 11829248 Jun 20 15:12 c-3276392049-20080620-01 -- 参数文件,控制文件的备份集
ibm1 ->cd ../databackup
ibm1 ->pwd
/oradata/orabak/databackup
ibm1 ->ls -lrt
total 769264
-rw-r----- 1 oracle oinstall 393863168 Jun 20 16:38 db_CCDB_900_1_20080620 -- 数据文件的备份集
ibm1 ->cd ../logbackup
ibm1 ->pwd
/oradata/orabak/logbackup
ibm1 ->ls -lrt
total 3320
-rw-r----- 1 oracle oinstall 1699328 Jun 20 15:12 log_CCDB_901_1_20080620 -- 备份完数据库后,备份归档日志的备份集
三 操作步骤
1 修改IBM1上的ORACLE的配置文件,只需要修改ORACLE_SID即可。
vi /oracle/.profile oracle_sid=ccdb1
2 进入RMAN,强行启动数据库(会报没有参数文件)后,恢复参数文件。
rman target /
startup nomount
restore spfile from '/oradata/orabak/rmanspctlback/c-3276392049-20080620-01';
3 根据spfile, 恢复出pfile, 编辑pfile, 去掉与rac设置相关的参数, 再将pfile转换成spfile
create pfile from spfile;
shutdown abort;
vi initccdb1.ora -- 去掉与rac设置相关的参数,同时注意参数里指定的各目录是否存在。
create spfile from pfile;
4 使用新创建的spfile 启动数据库,恢复出控制文件。
startup nomount;
restore controlfile from '/oradata/orabak/rmanspctlback/c-3276392049-20080620-01';
alter database mount;
5 由于正式环境使用了ASM,数据文件,在线日志都存在ASM里,而测试环境没有ASM,故需要将文件转换,存放到文件系统下,
进入SQLPLUS, 找出该库的归档日志,重新指定在线日志的路径。
sqlplus / as sysdba
select * from v$logfile;
alter database rename file '+ASMDISK/ccdb/onlinelog/group_3.267.648572919' to '/oradata/ccdb/redo0302.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_2.264.648572917' to '/oradata/ccdb/redo0201.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_2.265.648572919' to '/oradata/ccdb/redo0202.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_1.262.648572915' to '/oradata/ccdb/redo0101.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_1.263.648572917' to '/oradata/ccdb/redo0102.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_4.270.648573025' to '/oradata/ccdb/redo0401.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_4.271.648573025' to '/oradata/ccdb/redo0402.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_5.272.648573025' to '/oradata/ccdb/redo0501.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_5.273.648573027' to '/oradata/ccdb/redo0502.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_6.274.648573027' to '/oradata/ccdb/redo0601.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_6.275.648573027' to '/oradata/ccdb/redo0602.log';
6 由于在IBM4上记录的数据库,归档日志的备份集的存放路径与IBM1上的不一样,故,需要说明在IBM1上这些备份集的路径,以便RMAN知晓。
catalog backuppiece '/oradata/orabak/databackup/db_CCDB_900_1_20080620';
catalog backuppiece '/oradata/orabak/logbackup/log_CCDB_901_1_20080620';
7 检查备份集的存在状况,删除多余的备份集信息
crosscheck backup;
delete noprompt expired backup;
8 检查全库恢复时的,需要哪些数据文件备份集,归档日志文件的备份集。
restore database preview summary;
9 找出库的数据文件。
RMAN> report schema;
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 0 SYSTEM *** +ASMDISK/ccdb/datafile/system.256.648572847
2 0 UNDOTBS1 *** +ASMDISK/ccdb/datafile/undotbs1.258.648572847
3 0 SYSAUX *** +ASMDISK/ccdb/datafile/sysaux.257.648572847
4 0 USERS *** +ASMDISK/ccdb/datafile/users.259.648572847
5 0 UNDOTBS2 *** +ASMDISK/ccdb/datafile/undotbs2.269.648572973
6 0 UNICALL2X *** +ASMDISK/ccdb/datafile/unicall2x.279.648578659
7 0 UNICALL2X_IDX *** +ASMDISK/ccdb/datafile/unicall2x_idx.280.648578725
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 0 TEMP 32767 +ASMDISK/ccdb/tempfile/temp.268.648572939
10 写恢复脚本来恢复库,其中重新指定恢复时,数据文件的存放路径,由ASM到文件系统。
run
{allocate channel d1 type disk;
set newname for datafile 1 to '/oradata/ccdb/system.dbf';
set newname for datafile 2 to '/oradata/ccdb/undotbs1.dbf';
set newname for datafile 3 to '/oradata/ccdb/sysaux.dbf';
set newname for datafile 4 to '/oradata/ccdb/users.dbf';
set newname for datafile 5 to '/oradata/ccdb/undotbs2.dbf';
set newname for datafile 6 to '/oradata/ccdb/unicall2x.dbf';
set newname for datafile 7 to '/oradata/ccdb/unicall2x_idx.dbf';
restore database;
switch datafile all;
release channel d1;
}
13 recover database,注意恢复完成后,系统提示需要的日志文件及SCN好。
recover database;
14 罗列出归档日志的备份集,和上面的RECOVER DATABASE 信息作比较,以确定是否已经用完备份集里的归档日志。
list backup of archivelog all;
15 alter database open resetlogs;
四 下面是恢复操作过程,其中,"辅助窗口" 执行恢复过程中起辅助作用的操作, "RMAN窗口" 执行正式操作,绝大部分操作都在此窗口完成。
--辅助窗口
--由于之前曾成功恢复了数据库,现需要删除之。
ibm1 ->sqlplus
SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jun 26 14:49:39 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter user-name: / as sysdba
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> show parameter instance;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
active_instance_count integer
cluster_database_instances integer 1
instance_groups string
instance_name string ccdb1
instance_number integer 0
instance_type string RDBMS
open_links_per_instance integer 4
parallel_instance_group string
parallel_server_instances integer 1
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount restrict;
ORACLE instance started.
Total System Global Area 3221225472 bytes
Fixed Size 2076312 bytes
Variable Size 1996489064 bytes
Database Buffers 1207959552 bytes
Redo Buffers 14700544 bytes
Database mounted.
SQL> drop database;
Database dropped.
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> exit
-- 删除参数文件
ibm1 ->cd /oracle/product/10.2/dbs
ibm1 ->ls -lrt
total 58552
-rw-rw---- 1 oracle oinstall 24 Jun 5 21:54 lkMARKET
-rw-r----- 1 oracle oinstall 12697600 Jun 8 10:08 snapcf_market.f
-rw-r----- 1 oracle oinstall 4608 Jun 11 16:40 spfilemarket.ora.bak
-rw-rw---- 1 oracle oinstall 24 Jun 20 16:23 lkCCDB
-rw-rw---- 1 oracle oinstall 24 Jun 24 11:10 lkTESTDB
-rw-r----- 1 oracle oinstall 1536 Jun 24 11:10 orapwtestdb
-rw-rw---- 1 oracle oinstall 1552 Jun 24 15:54 hc_market.dat
-rw-r----- 1 oracle oinstall 2560 Jun 25 10:22 spfiletestdb.ora
-rw-r----- 1 oracle oinstall 5488640 Jun 25 10:24 snapcf_testdb.f
-rw-rw---- 1 oracle oinstall 1552 Jun 25 23:36 hc_testdb.dat
-rw-r--r-- 1 oracle oinstall 796 Jun 26 10:25 initccdb1.ora
-rw-r----- 1 oracle oinstall 11747328 Jun 26 11:13 snapcf_ccdb1.f
-rw-rw---- 1 oracle oinstall 1552 Jun 26 14:51 hc_ccdb1.dat
ibm1 ->rm hc_ccdb1.dat initccdb1.ora snapcf_ccdb1.f
ibm1 ->ls -lrt
total 35592
-rw-rw---- 1 oracle oinstall 24 Jun 5 21:54 lkMARKET
-rw-r----- 1 oracle oinstall 12697600 Jun 8 10:08 snapcf_market.f
-rw-r----- 1 oracle oinstall 4608 Jun 11 16:40 spfilemarket.ora.bak
-rw-rw---- 1 oracle oinstall 24 Jun 20 16:23 lkCCDB
-rw-rw---- 1 oracle oinstall 24 Jun 24 11:10 lkTESTDB
-rw-r----- 1 oracle oinstall 1536 Jun 24 11:10 orapwtestdb
-rw-rw---- 1 oracle oinstall 1552 Jun 24 15:54 hc_market.dat
-rw-r----- 1 oracle oinstall 2560 Jun 25 10:22 spfiletestdb.ora
-rw-r----- 1 oracle oinstall 5488640 Jun 25 10:24 snapcf_testdb.f
-rw-rw---- 1 oracle oinstall 1552 Jun 25 23:36 hc_testdb.dat
ibm1 ->
--RMAN窗口
--强行启动数据库,使用指定的备份集,恢复参数文件,并创建参数文件的pfile。
ibm1 ->rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Thu Jun 26 15:04:52 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/oracle/product/10.2/dbs/initccdb1.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 2071296 bytes
Variable Size 67110144 bytes
Database Buffers 83886080 bytes
Redo Buffers 6316032 bytes
RMAN> restore spfile from '/oradata/orabak/rmanspctlback/c-3276392049-20080620-01';
Starting restore at 2008-06-26 15:05:05
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK
channel ORA_DISK_1: autobackup found: /oradata/orabak/rmanspctlback/c-3276392049-20080620-01
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 2008-06-26 15:05:07
RMAN> host;
ibm1 ->sqlplus
SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jun 26 15:05:17 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter user-name: / as sysdba
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> create pfile from spfile;
File created.
SQL> shutdown abort;
ORACLE instance shut down.
SQL>
-- 辅助窗口
-- 删除pfile 文件中与RAC相关的参数
-- 原始参数
ibm1 ->cat initccdb1.ora
ccdb2.__db_cache_size=503316480
ccdb1.__db_cache_size=1140850688
ccdb2.__java_pool_size=16777216
ccdb1.__java_pool_size=16777216
ccdb2.__large_pool_size=16777216
ccdb1.__large_pool_size=16777216
ccdb2.__shared_pool_size=1056964608
ccdb1.__shared_pool_size=1996488704
ccdb2.__streams_pool_size=0
ccdb1.__streams_pool_size=33554432
*.audit_file_dest='/oracle/admin/ccdb/adump'
*.background_dump_dest='/oracle/admin/ccdb/bdump'
*.cluster_database_instances=2
*.cluster_database=true
*.compatible='10.2.0.3.0'
*.control_files='+ASMDISK/ccdb/controlfile/current.261.648572913','+ASMDISK/ccdb/controlfile/current.260.648572913'
*.core_dump_dest='/oracle/admin/ccdb/cdump'
*.db_block_size=8192
*.db_create_file_dest='+ASMDISK'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ccdb'
*.db_recovery_file_dest='+ASMDISK'
*.db_recovery_file_dest_size=10737418240
*.dispatchers=''
ccdb1.instance_number=1
ccdb2.instance_number=2
*.job_queue_processes=10
ccdb2.local_listener='LISTENERS_CCDB2'
ccdb1.local_listener='LISTENERS_CCDB1'
*.log_archive_dest_1='LOCATION=+ASMDISK/ccdb/'
*.log_archive_dest_2='LOCATION=/oralog/ccdb/'
ccdb2.log_archive_dest_2='LOCATION=/oralog/ccdb2/'
ccdb1.log_archive_dest_2='LOCATION=/oralog/ccdb1/'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_local_first=TRUE
*.log_archive_min_succeed_dest=2
*.open_cursors=300
*.pga_aggregate_target=1029701632
*.processes=1000
*.recyclebin='OFF'
*.remote_listener='LISTENERS_CCDB'
*.remote_login_passwordfile='exclusive'
*.sessions=1105
*.sga_max_size=3221225472
*.sga_target=1610612736
ccdb1.sga_target=3221225472
ccdb2.thread=2
ccdb1.thread=1
*.undo_management='AUTO'
ccdb2.undo_tablespace='UNDOTBS2'
ccdb1.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/oracle/admin/ccdb/udump'
ibm1 ->
-- 修改后的参数
ibm1 ->cat initccdb1.ora
*.audit_file_dest='/oracle/admin/ccdb/adump'
*.background_dump_dest='/oracle/admin/ccdb/bdump'
*.compatible='10.2.0.3.0'
*.control_files='/oradata/ccdb/control01.dbf'
*.core_dump_dest='/oracle/admin/ccdb/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ccdb'
*.db_recovery_file_dest_size=10737418240
*.dispatchers=''
*.job_queue_processes=10
*.log_archive_dest_2='LOCATION=/oralog/ccdb/'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_local_first=TRUE
*.open_cursors=300
*.pga_aggregate_target=1029701632
*.processes=1000
*.recyclebin='OFF'
*.remote_login_passwordfile='exclusive'
*.sessions=1105
*.sga_max_size=3221225472
*.sga_target=1610612736
*.undo_management='AUTO'
*.user_dump_dest='/oracle/admin/ccdb/udump'
-- 根据pfile 创建spfile, 并 startup nomount.
ibm1 ->sqlplus
SQL*Plus: Release 10.2.0.3.0 - Production on Thu Jun 26 15:13:43 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Enter user-name: / as sysdba
Connected to an idle instance.
SQL> create spfile from pfile;
File created.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 3221225472 bytes
Fixed Size 2076312 bytes
Variable Size 1996489064 bytes
Database Buffers 1207959552 bytes
Redo Buffers 14700544 bytes
SQL>
-- RMAN窗口
-- 使用指定的备份集,恢复控制文件。
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ibm1 ->rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Thu Jun 26 15:14:26 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ccdb (not mounted)
RMAN> restore controlfile from '/oradata/orabak/rmanspctlback/c-3276392049-20080620-01';
Starting restore at 2008-06-26 15:14:45
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1090 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output filename=/oradata/ccdb/control01.dbf
Finished restore at 2008-06-26 15:14:48
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN>
-- 辅助窗口
-- 由于正式环境使用了ASM, 测试环境没有,因此需要找出该库的归档日志,重新指定在线日志的路径。
SQL> col member for a60;
SQL> set line 999;
SQL> set pagesize 203
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------------------------------------ ---
3 ONLINE +ASMDISK/ccdb/onlinelog/group_3.266.648572919 NO
3 ONLINE +ASMDISK/ccdb/onlinelog/group_3.267.648572919 YES
2 ONLINE +ASMDISK/ccdb/onlinelog/group_2.264.648572917 NO
2 ONLINE +ASMDISK/ccdb/onlinelog/group_2.265.648572919 YES
1 ONLINE +ASMDISK/ccdb/onlinelog/group_1.262.648572915 NO
1 ONLINE +ASMDISK/ccdb/onlinelog/group_1.263.648572917 YES
4 ONLINE +ASMDISK/ccdb/onlinelog/group_4.270.648573025 NO
4 ONLINE +ASMDISK/ccdb/onlinelog/group_4.271.648573025 YES
5 ONLINE +ASMDISK/ccdb/onlinelog/group_5.272.648573025 NO
5 ONLINE +ASMDISK/ccdb/onlinelog/group_5.273.648573027 YES
6 ONLINE +ASMDISK/ccdb/onlinelog/group_6.274.648573027 NO
6 ONLINE +ASMDISK/ccdb/onlinelog/group_6.275.648573027 YES
12 rows selected.
SQL> alter database rename file '+ASMDISK/ccdb/onlinelog/group_3.266.648572919' to '/oradata/ccdb/redo0301.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_3.267.648572919' to '/oradata/ccdb/redo0302.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_2.264.648572917' to '/oradata/ccdb/redo0201.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_2.265.648572919' to '/oradata/ccdb/redo0202.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_1.262.648572915' to '/oradata/ccdb/redo0101.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_1.263.648572917' to '/oradata/ccdb/redo0102.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_4.270.648573025' to '/oradata/ccdb/redo0401.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_4.271.648573025' to '/oradata/ccdb/redo0402.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_5.272.648573025' to '/oradata/ccdb/redo0501.log';
alter database rename file '+ASMDISK/ccdb/onlinelog/group_5.273.648573027' to '/oradata/ccdb/redo0502.log';
alter database renam
Database altered.
eSQL> file '+ASMDI
Database altered.
SQL>
Database altered.
SQL>
Database altered.
SQL> SK/ccdb/onlinelo
Database altered.
SQL>
Database altered.
SQL>
Database altered.
SQL>
Database altered.
SQL>
Database altered.
SQL>
Database altered.
SQL> g/group_6.274.648573027' to '/oradata/ccdb/redo0601.log';
alter data
Database altered.
SQL> base rename file '+ASMDISK/ccdb/onlinelog/group_6.275.648573027' to '/oradata/ccdb/redo0602.log';
Database altered.
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------------------------------------ ---
3 ONLINE /oradata/ccdb/redo0301.log NO
3 ONLINE /oradata/ccdb/redo0302.log NO
2 ONLINE /oradata/ccdb/redo0201.log NO
2 ONLINE /oradata/ccdb/redo0202.log NO
1 ONLINE /oradata/ccdb/redo0101.log NO
1 ONLINE /oradata/ccdb/redo0102.log NO
4 ONLINE /oradata/ccdb/redo0401.log NO
4 ONLINE /oradata/ccdb/redo0402.log NO
5 ONLINE /oradata/ccdb/redo0501.log NO
5 ONLINE /oradata/ccdb/redo0502.log NO
6 ONLINE /oradata/ccdb/redo0601.log NO
6 ONLINE /oradata/ccdb/redo0602.log NO
12 rows selected.
SQL>
-- RMAN窗口
-- IBM4上数据库,归档日志的备份集的存放路径与IBM1上的不一样,需要在RMAN里说明在IBM1上这些备份集的路径,以便RMAN知晓。
RMAN> catalog backuppiece '/oradata/orabak/databackup/db_CCDB_900_1_20080620';
catalog backuppiece '/oradata/orabak/logbackup/
log_CCDB_901_1_20080620';
cataloged backuppiece
backup piece handle=/oradata/orabak/databackup/db_CCDB_900_1_20080620 recid=900 stamp=658423188
RMAN>
cataloged backuppiece
backup piece handle=/oradata/orabak/logbackup/log_CCDB_901_1_20080620 recid=901 stamp=658423189
-- 检查备份集。
RMAN> crosscheck backup;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1090 devtype=DISK
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_840_1_20080613 recid=838 stamp=657244831
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_841_1_20080613 recid=839 stamp=657244954
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080613-00 recid=840 stamp=657244957
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_843_1_20080613 recid=841 stamp=657288012
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_844_1_20080613 recid=842 stamp=657288028
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_845_1_20080613 recid=843 stamp=657288153
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080613-01 recid=844 stamp=657288156
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_847_1_20080614 recid=845 stamp=657331217
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_848_1_20080614 recid=846 stamp=657331233
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_849_1_20080614 recid=847 stamp=657331373
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080614-00 recid=848 stamp=657331377
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_851_1_20080614 recid=849 stamp=657374419
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_852_1_20080614 recid=850 stamp=657374441
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_853_1_20080614 recid=851 stamp=657374578
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080614-01 recid=852 stamp=657374581
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_855_1_20080615 recid=853 stamp=657417634
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_856_1_20080615 recid=854 stamp=657417650
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_857_1_20080615 recid=855 stamp=657417775
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080615-00 recid=856 stamp=657417778
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_859_1_20080615 recid=857 stamp=657460812
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_860_1_20080615 recid=858 stamp=657460828
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_861_1_20080615 recid=859 stamp=657460963
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080615-01 recid=860 stamp=657460966
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_863_1_20080616 recid=861 stamp=657504024
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_864_1_20080616 recid=862 stamp=657504032
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_865_1_20080616 recid=863 stamp=657504154
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080616-00 recid=864 stamp=657504157
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_867_1_20080616 recid=865 stamp=657547221
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_868_1_20080616 recid=866 stamp=657547237
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_869_1_20080616 recid=867 stamp=657547384
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080616-01 recid=868 stamp=657547387
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_871_1_20080617 recid=869 stamp=657590420
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_872_1_20080617 recid=870 stamp=657590436
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_873_1_20080617 recid=871 stamp=657590569
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080617-00 recid=872 stamp=657590572
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_875_1_20080617 recid=873 stamp=657633618
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_876_1_20080617 recid=874 stamp=657633634
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_877_1_20080617 recid=875 stamp=657633767
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080617-01 recid=876 stamp=657633770
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_879_1_20080618 recid=877 stamp=657676819
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_880_1_20080618 recid=878 stamp=657676835
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_881_1_20080618 recid=879 stamp=657676969
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080618-00 recid=880 stamp=657676972
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_883_1_20080618 recid=881 stamp=657720016
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_884_1_20080618 recid=882 stamp=657720032
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_885_1_20080618 recid=883 stamp=657720166
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080618-01 recid=884 stamp=657720169
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_887_1_20080619 recid=885 stamp=657763217
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_888_1_20080619 recid=886 stamp=657763245
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_889_1_20080619 recid=887 stamp=657763385
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080619-00 recid=888 stamp=657763388
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_891_1_20080619 recid=889 stamp=657806417
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_892_1_20080619 recid=890 stamp=657806433
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_893_1_20080619 recid=891 stamp=657806567
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080619-01 recid=892 stamp=657806570
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_895_1_20080620 recid=893 stamp=657849624
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_896_1_20080620 recid=894 stamp=657849650
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_897_1_20080620 recid=895 stamp=657849783
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080620-00 recid=896 stamp=657849786
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_899_1_20080620 recid=897 stamp=657892819
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/databackup/db_CCDB_900_1_20080620 recid=898 stamp=657892837
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/oradata/orabak/databackup/db_CCDB_900_1_20080620 recid=900 stamp=658423188
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/orabak/logbackup/log_CCDB_901_1_20080620 recid=899 stamp=657892970
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/oradata/orabak/logbackup/log_CCDB_901_1_20080620 recid=901 stamp=658423189
Crosschecked 64 objects
-- 删除不存在的备份集(其实这一步可要可不要,看个人习惯)
RMAN> delete noprompt expired backup;
using channel ORA_DISK_1
List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
838 838 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_840_1_20080613
839 839 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_841_1_20080613
840 840 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080613-00
841 841 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_843_1_20080613
842 842 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_844_1_20080613
843 843 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_845_1_20080613
844 844 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080613-01
845 845 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_847_1_20080614
846 846 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_848_1_20080614
847 847 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_849_1_20080614
848 848 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080614-00
849 849 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_851_1_20080614
850 850 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_852_1_20080614
851 851 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_853_1_20080614
852 852 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080614-01
853 853 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_855_1_20080615
854 854 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_856_1_20080615
855 855 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_857_1_20080615
856 856 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080615-00
857 857 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_859_1_20080615
858 858 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_860_1_20080615
859 859 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_861_1_20080615
860 860 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080615-01
861 861 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_863_1_20080616
862 862 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_864_1_20080616
863 863 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_865_1_20080616
864 864 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080616-00
865 865 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_867_1_20080616
866 866 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_868_1_20080616
867 867 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_869_1_20080616
868 868 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080616-01
869 869 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_871_1_20080617
870 870 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_872_1_20080617
871 871 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_873_1_20080617
872 872 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080617-00
873 873 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_875_1_20080617
874 874 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_876_1_20080617
875 875 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_877_1_20080617
876 876 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080617-01
877 877 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_879_1_20080618
878 878 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_880_1_20080618
879 879 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_881_1_20080618
880 880 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080618-00
881 881 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_883_1_20080618
882 882 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_884_1_20080618
883 883 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_885_1_20080618
884 884 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080618-01
885 885 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_887_1_20080619
886 886 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_888_1_20080619
887 887 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_889_1_20080619
888 888 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080619-00
889 889 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_891_1_20080619
890 890 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_892_1_20080619
891 891 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_893_1_20080619
892 892 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080619-01
893 893 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_895_1_20080620
894 894 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_896_1_20080620
895 895 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_897_1_20080620
896 896 1 1 EXPIRED DISK /orabak/rmanspctlback/c-3276392049-20080620-00
897 897 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_899_1_20080620
898 898 1 1 EXPIRED DISK /orabak/databackup/db_CCDB_900_1_20080620
899 899 1 1 EXPIRED DISK /orabak/logbackup/log_CCDB_901_1_20080620
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_840_1_20080613 recid=838 stamp=657244831
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_841_1_20080613 recid=839 stamp=657244954
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080613-00 recid=840 stamp=657244957
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_843_1_20080613 recid=841 stamp=657288012
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_844_1_20080613 recid=842 stamp=657288028
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_845_1_20080613 recid=843 stamp=657288153
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080613-01 recid=844 stamp=657288156
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_847_1_20080614 recid=845 stamp=657331217
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_848_1_20080614 recid=846 stamp=657331233
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_849_1_20080614 recid=847 stamp=657331373
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080614-00 recid=848 stamp=657331377
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_851_1_20080614 recid=849 stamp=657374419
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_852_1_20080614 recid=850 stamp=657374441
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_853_1_20080614 recid=851 stamp=657374578
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080614-01 recid=852 stamp=657374581
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_855_1_20080615 recid=853 stamp=657417634
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_856_1_20080615 recid=854 stamp=657417650
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_857_1_20080615 recid=855 stamp=657417775
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080615-00 recid=856 stamp=657417778
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_859_1_20080615 recid=857 stamp=657460812
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_860_1_20080615 recid=858 stamp=657460828
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_861_1_20080615 recid=859 stamp=657460963
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080615-01 recid=860 stamp=657460966
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_863_1_20080616 recid=861 stamp=657504024
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_864_1_20080616 recid=862 stamp=657504032
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_865_1_20080616 recid=863 stamp=657504154
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080616-00 recid=864 stamp=657504157
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_867_1_20080616 recid=865 stamp=657547221
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_868_1_20080616 recid=866 stamp=657547237
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_869_1_20080616 recid=867 stamp=657547384
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080616-01 recid=868 stamp=657547387
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_871_1_20080617 recid=869 stamp=657590420
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_872_1_20080617 recid=870 stamp=657590436
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_873_1_20080617 recid=871 stamp=657590569
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080617-00 recid=872 stamp=657590572
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_875_1_20080617 recid=873 stamp=657633618
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_876_1_20080617 recid=874 stamp=657633634
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_877_1_20080617 recid=875 stamp=657633767
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080617-01 recid=876 stamp=657633770
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_879_1_20080618 recid=877 stamp=657676819
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_880_1_20080618 recid=878 stamp=657676835
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_881_1_20080618 recid=879 stamp=657676969
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080618-00 recid=880 stamp=657676972
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_883_1_20080618 recid=881 stamp=657720016
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_884_1_20080618 recid=882 stamp=657720032
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_885_1_20080618 recid=883 stamp=657720166
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080618-01 recid=884 stamp=657720169
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_887_1_20080619 recid=885 stamp=657763217
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_888_1_20080619 recid=886 stamp=657763245
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_889_1_20080619 recid=887 stamp=657763385
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080619-00 recid=888 stamp=657763388
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_891_1_20080619 recid=889 stamp=657806417
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_892_1_20080619 recid=890 stamp=657806433
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_893_1_20080619 recid=891 stamp=657806567
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080619-01 recid=892 stamp=657806570
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_895_1_20080620 recid=893 stamp=657849624
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_896_1_20080620 recid=894 stamp=657849650
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_897_1_20080620 recid=895 stamp=657849783
deleted backup piece
backup piece handle=/orabak/rmanspctlback/c-3276392049-20080620-00 recid=896 stamp=657849786
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_899_1_20080620 recid=897 stamp=657892819
deleted backup piece
backup piece handle=/orabak/databackup/db_CCDB_900_1_20080620 recid=898 stamp=657892837
deleted backup piece
backup piece handle=/orabak/logbackup/log_CCDB_901_1_20080620 recid=899 stamp=657892970
Deleted 62 EXPIRED objects
-- 查看恢复数据库需要的备份集,日志信息
RMAN> restore database preview summary;
Starting restore at 2008-06-26 15:21:43
using channel ORA_DISK_1
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
898 B 0 A DISK 2008-06-20 12:02:12 1 1 YES TAG20080620T120035
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
899 B A A DISK 2008-06-20 12:02:50 1 1 YES TAG20080620T120249
Media recovery start SCN is 26818078494
Recovery must be done beyond SCN 26818078494 to clear data files fuzziness
Finished restore at 2008-06-26 15:21:45
-- 查看库的数据文件的路径。
RMAN> report schema;
RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 0 SYSTEM *** +ASMDISK/ccdb/datafile/system.256.648572847
2 0 UNDOTBS1 *** +ASMDISK/ccdb/datafile/undotbs1.258.648572847
3 0 SYSAUX *** +ASMDISK/ccdb/datafile/sysaux.257.648572847
4 0 USERS *** +ASMDISK/ccdb/datafile/users.259.648572847
5 0 UNDOTBS2 *** +ASMDISK/ccdb/datafile/undotbs2.269.648572973
6 0 UNICALL2X *** +ASMDISK/ccdb/datafile/unicall2x.279.648578659
7 0 UNICALL2X_IDX *** +ASMDISK/ccdb/datafile/unicall2x_idx.280.648578725
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 0 TEMP 32767 +ASMDISK/ccdb/tempfile/temp.268.648572939
-- 恢复数据库,其中需要重新指定恢复时,数据文件的存放路径,由ASM到文件系统。
RMAN> run
{allocate2> channel d1 type disk;
set newname for datafile 1 to '/oradata/ccdb/system.dbf';
set newname for datafile 2 to '/oradata/ccdb/undotbs1.dbf';
set newname for 3> datafile 3 to '/oradata/ccdb/sysaux.dbf';
set newname for da4> 5> 6> tafile 4 to '/oradata/ccdb/users.dbf';
set newname for data7> file 5 to '/oradata/ccdb/undotbs2.dbf';
set newname for datafile 6 to '/orada8> ta/ccdb/unicall2x.dbf';
set newname for datafile 7 to9> '/oradata/ccdb/unicall2x_idx.dbf';
restore database;
switch d10> atafile 11> all;
release c12> hannel d1;
}13>
released channel: ORA_DISK_1
allocated channel: d1
channel d1: sid=1090 devtype=DISK
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 2008-06-26 15:29:49
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oradata/ccdb/system.dbf
restoring datafile 00002 to /oradata/ccdb/undotbs1.dbf
restoring datafile 00003 to /oradata/ccdb/sysaux.dbf
restoring datafile 00004 to /oradata/ccdb/users.dbf
restoring datafile 00005 to /oradata/ccdb/undotbs2.dbf
restoring datafile 00006 to /oradata/ccdb/unicall2x.dbf
restoring datafile 00007 to /oradata/ccdb/unicall2x_idx.dbf
channel d1: reading from backup piece /oradata/orabak/databackup/db_CCDB_900_1_20080620
channel d1: restored backup piece 1
piece handle=/oradata/orabak/databackup/db_CCDB_900_1_20080620 tag=TAG20080620T120035
channel d1: restore complete, elapsed time: 00:04:33
Finished restore at 2008-06-26 15:34:23
datafile 1 switched to datafile copy
input datafile copy recid=8 stamp=658424064 filename=/oradata/ccdb/system.dbf
datafile 2 switched to datafile copy
input datafile copy recid=9 stamp=658424064 filename=/oradata/ccdb/undotbs1.dbf
datafile 3 switched to datafile copy
input datafile copy recid=10 stamp=658424064 filename=/oradata/ccdb/sysaux.dbf
datafile 4 switched to datafile copy
input datafile copy recid=11 stamp=658424064 filename=/oradata/ccdb/users.dbf
datafile 5 switched to datafile copy
input datafile copy recid=12 stamp=658424064 filename=/oradata/ccdb/undotbs2.dbf
datafile 6 switched to datafile copy
input datafile copy recid=13 stamp=658424064 filename=/oradata/ccdb/unicall2x.dbf
datafile 7 switched to datafile copy
input datafile copy recid=14 stamp=658424064 filename=/oradata/ccdb/unicall2x_idx.dbf
released channel: d1
-- 作介质恢复,注意RMAN最后的提示信息,thread 2 seq 688 lowscn 26818080041。
RMAN> recover database;
Starting recover at 2008-06-26 15:38:07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1090 devtype=DISK
starting media recovery
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=2 sequence=687
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=695
channel ORA_DISK_1: reading from backup piece /oradata/orabak/logbackup/log_CCDB_901_1_20080620
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/orabak/logbackup/log_CCDB_901_1_20080620 tag=TAG20080620T120249
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
archive log filename=/oralog/ccdb/1_695_648572915.dbf thread=1 sequence=695
archive log filename=/oralog/ccdb/2_687_648572915.dbf thread=2 sequence=687
unable to find archive log
archive log thread=2 sequence=688
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/26/2008 15:38:21
RMAN-06054: media recovery requesting unknown log: thread 2 seq 688 lowscn 26818080041
-- 而从库中归档日志的日志号,scn 号的情况,可以看出,归档日志只有thread 2 日志号为 687,该日志的最高scn 小于 26818080041
-- 故,可以断定,上面的介质恢复错误,是因为缺少归档日志的原因,由于上上步的restore database preview summary 已经说明:
-- 介质恢复需要超过 SCN 26818078494, 才能清除库的模糊信息,而上面的步骤要求的SCN 26818080041,已经超过26818078494,故:
RMAN> list backup of archivelog all;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
899 1.62M DISK 00:00:01 2008-06-20 12:02:50
BP Key: 901 Status: AVAILABLE Compressed: YES Tag: TAG20080620T120249
Piece Name: /oradata/orabak/logbackup/log_CCDB_901_1_20080620
List of Archived Logs in backup set 899
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- ------------------- ---------- ---------
1 695 26818077573 2008-06-20 12:00:05 26818080043 2008-06-20 12:02:40
2 687 26818077558 2008-06-20 11:59:51 26818080041 2008-06-20 12:02:27
-- 故:open resetlogs 操作肯定成功。
RMAN> alter database open resetlogs;
database opened
RMAN>
附,上面例子里,步骤5和步骤10分开执行,实际上步骤5可以放到步骤10中一块作恢复操作。
RMAN> run
2> {allocate channel d1 type disk;
set newname for datafile 1 to '/oradata/ccdb/system.dbf';
set newname for datafile 2 to '/oradata/ccdb/undotbs1.dbf';
set newname for datafile 3 to '/oradata/ccdb/sysaux.dbf';
set newna3> 4> 5> 6> me for datafile 4 to '/oradata/ccdb/users.dbf';
set newname for datafile 5 to '/oradata/ccdb/undotbs2.dbf';
set newname for datafile 6 to '/oradata/ccdb/unicall2x.dbf';
set newname for datafile 7 to '/oradata/ccdb/unicall2x_idx.dbf';
sql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_3.266.648572919'' to ''/oradata/ccdb/redo0301.log''";
sql "alter da7> 8> 9> 10> 11> tabase rename file ''+ASMDISK/ccdb/onlinelog/group_3.267.648572919'' to ''/oradata/ccdb/redo0302.log''";
sql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_2.264.64812> 572917'' to ''/oradata/ccdb/redo0201.log''";
sql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_2.265.648572919'' to ''/oradata/ccdb/redo0202.log''";
sql13> 14> "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_1.262.648572915'' to ''/oradata/ccdb/redo0101.log''";
sql15> "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_1.263.648572917'' to ''/oradata/ccdb/redo0102.log''";
s16> ql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_4.270.648573025'' to ''/oradata/ccdb/redo0401.log''";
17> sql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_4.271.648573025'' to ''/oradata/ccdb/redo0402.log''";
sql 18> "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_5.272.648573025'' to ''/oradata/ccdb/redo0501.log''";
sql19> "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_5.273.648573027'' to ''/oradata/ccdb/redo0502.log''";
20> sql "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_6.274.648573027'' to ''/oradata/ccdb/redo0601.log''";
sq21> l "alter database rename file ''+ASMDISK/ccdb/onlinelog/group_6.275.648573027'' to ''/oradata/ccdb/redo0602.log''";
res22> tore database;
23> switch datafile all;
24> release channel d1;
}25>
released channel: ORA_DISK_1
allocated channel: d1
channel d1: sid=1091 devtype=DISK
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_3.266.648572919'' to ''/oradata/ccdb/redo0301.log''
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_3.267.648572919'' to ''/oradata/ccdb/redo0302.log''
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_2.264.648572917'' to ''/oradata/ccdb/redo0201.log''
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_2.265.648572919'' to ''/oradata/ccdb/redo0202.log''
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_1.262.648572915'' to ''/oradata/ccdb/redo0101.log''
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_1.263.648572917'' to ''/oradata/ccdb/redo0102.log''
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_4.270.648573025'' to ''/oradata/ccdb/redo0401.log''
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_4.271.648573025'' to ''/oradata/ccdb/redo0402.log''
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_5.272.648573025'' to ''/oradata/ccdb/redo0501.log''
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_5.273.648573027'' to ''/oradata/ccdb/redo0502.log''
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_6.274.648573027'' to ''/oradata/ccdb/redo0601.log''
sql statement: alter database rename file ''+ASMDISK/ccdb/onlinelog/group_6.275.648573027'' to ''/oradata/ccdb/redo0602.log''
Starting restore at 2008-06-27 16:22:24
channel d1: starting datafile backupset restore
channel d1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oradata/ccdb/system.dbf
restoring datafile 00002 to /oradata/ccdb/undotbs1.dbf
restoring datafile 00003 to /oradata/ccdb/sysaux.dbf
restoring datafile 00004 to /oradata/ccdb/users.dbf
restoring datafile 00005 to /oradata/ccdb/undotbs2.dbf
restoring datafile 00006 to /oradata/ccdb/unicall2x.dbf
restoring datafile 00007 to /oradata/ccdb/unicall2x_idx.dbf
channel d1: reading from backup piece /oradata/orabak/databackup/db_CCDB_900_1_20080620
channel d1: restored backup piece 1
piece handle=/oradata/orabak/databackup/db_CCDB_900_1_20080620 tag=TAG20080620T120035
channel d1: restore complete, elapsed time: 00:04:53
Finished restore at 2008-06-27 16:27:19
datafile 1 switched to datafile copy
input datafile copy recid=8 stamp=658513641 filename=/oradata/ccdb/system.dbf
datafile 2 switched to datafile copy
input datafile copy recid=9 stamp=658513641 filename=/oradata/ccdb/undotbs1.dbf
datafile 3 switched to datafile copy
input datafile copy recid=10 stamp=658513641 filename=/oradata/ccdb/sysaux.dbf
datafile 4 switched to datafile copy
input datafile copy recid=11 stamp=658513641 filename=/oradata/ccdb/users.dbf
datafile 5 switched to datafile copy
input datafile copy recid=12 stamp=658513641 filename=/oradata/ccdb/undotbs2.dbf
datafile 6 switched to datafile copy
input datafile copy recid=13 stamp=658513641 filename=/oradata/ccdb/unicall2x.dbf
datafile 7 switched to datafile copy
input datafile copy recid=14 stamp=658513641 filename=/oradata/ccdb/unicall2x_idx.dbf
released channel: d1
RMAN> recover database;
Starting recover at 2008-06-27 16:31:50
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1091 devtype=DISK
starting media recovery
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=2 sequence=687
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=695
channel ORA_DISK_1: reading from backup piece /oradata/orabak/logbackup/log_CCDB_901_1_20080620
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata/orabak/logbackup/log_CCDB_901_1_20080620 tag=TAG20080620T120249
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=/oralog/ccdb/1_695_648572915.dbf thread=1 sequence=695
archive log filename=/oralog/ccdb/2_687_648572915.dbf thread=2 sequence=687
unable to find archive log
archive log thread=2 sequence=688
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/27/2008 16:32:07
RMAN-06054: media recovery requesting unknown log: thread 2 seq 688 lowscn 26818080041
RMAN> alter database open resetlogs;
database opened
RMAN> list incarnation of database;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 CCDB 3276392049 PARENT 1 2006-11-20 20:22:09
2 2 CCDB 3276392049 PARENT 561064 2008-03-05 15:08:35
3 3 CCDB 3276392049 CURRENT 26818080042 2008-06-27 16:32:25
RMAN>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21806941/viewspace-662936/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21806941/viewspace-662936/