程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle數據庫基礎 >> RAC+ASM在單機上恢復的過程

RAC+ASM在單機上恢復的過程

編輯:Oracle數據庫基礎
 網上也有類似的例子,但不盡詳細,也沒多花心思解釋流程及原因,可能對初試者不太解惑。有感於此,故認真整理了恢復步驟即操作流程,望有助於同行朋友。 

環境:正式環境是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>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved