Chinaunix首页 | 论坛 | 博客
  • 博客访问: 231934
  • 博文数量: 36
  • 博客积分: 1137
  • 博客等级: 少尉
  • 技术积分: 305
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-06 09:58
文章分类

全部博文(36)

文章存档

2012年(1)

2011年(31)

2010年(3)

2007年(1)

分类: Oracle

2011-11-10 17:05:20

        使用RMAN恢復9IRAC到單機

目標:
恢復表空間D_AITSFIS1_DATA_01,因為表空間中有數據文件處於非online狀態,備份的時候也沒有進行備份,不能直接使用restore tablespace xxxxx,只能通過restore datafile x進行還原,
在restore過程中,system表空間和undo表空間必須也還原,不然會有問題,其他的表空間可以不還原;
表空間              數據文件         數據文件ID
SYSTEM             /dev/raw/raw1         1
UNDOTBS1            /dev/raw/raw10        2
UNDOTBS2           /dev/raw/raw17     5
UNDOTBS3           /dev/raw/raw24        53
D_AITSFIS1_DATA_01    /dev/raw/raw40        7
            /dev/raw/raw41        8
            /dev/raw/raw77        44  (有問題的數據文件,沒有進行備份)
            /dev/raw/raw91        52

==================================================================================
創建需要的目錄
[root@dbatest /]# mkdir /RmanBack  --> fullbak目錄
[root@dbatest /]# mkdir -p /Data/arch1    --> 歸檔目錄


1、創建PFILE
啟動到nomount狀態需要pfile,可以從原來的RAC中使用create pfile命令創建pfile,刪除其中關於rac的信息,只保留基本參數;
*.archive_lag_target=1800
*.background_dump_dest='/oracle/admin/adb/bdump'
*.compatible='9.2.0.0.0'
*.control_files='/oracle/oradata/adb/control01.ctl','/oracle/oradata/adb/control02.ctl','/oracle/oradata/adb/control03.ctl'
*.core_dump_dest='/oracle/admin/adb/cdump'
*.cursor_sharing='FORCE'
*.db_block_size=8192
*.db_cache_size=2147483648
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='adb'
*.fast_start_mttr_target=300
*.hash_join_enabled=TRUE
*.java_pool_size=16777216
*.job_queue_processes=6
*.large_pool_size=16777216
*.log_archive_dest_1='LOCATION=/Data/arch1'
*.log_archive_format='%t_%s.dbf'
*.log_archive_start=true
*.open_cursors=300
*.optimizer_mode='RULE'
*.pga_aggregate_target=3221225472
*.processes=1000
*.query_rewrite_enabled='FALSE'
*.remote_login_passwordfile='exclusive'
*.resource_limit=TRUE
*.sga_max_size=6442450944
*.shared_pool_size=559939584
*.sort_area_size=1048576
*.star_transformation_enabled='FALSE'
*.timed_statistics=TRUE
*.user_dump_dest='/oracle/admin/adb/udump'
*.utl_file_dir='/oracle/logdict'


2、創建密碼文件
$orapwd file=/oracle/9208/dbs/orapwadb password=change_on_install

3、恢復控制文件
先使用pfile恢復到nomount狀態,然後用RMAN恢復控制文件
adb$sqlplus '/as sysdba'

SQL*Plus: Release 9.2.0.4.0 - Production on ?

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

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 2805961720 bytes
Fixed Size             746488 bytes
Variable Size         1811939328 bytes
Database Buffers      989855744 bytes
Redo Buffers            3420160 bytes

adb$rman target /

Recovery Manager: Release 9.2.0.4.0 - 64bit Production

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

connected to target database: adb (not mounted)

RMAN> restore controlfile from '/RmanBack/ctl_c-1503043681-20111106-00.bak' ;

Starting restore at 08-11?

using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=11 devtype=DISK
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename=/oracle/oradata/adb/control01.ctl
output filename=/oracle/oradata/adb/control02.ctl
output filename=/oracle/oradata/adb/control03.ctl
Finished restore at 08-11?

RMAN> sql 'alter database mount';

sql statement: alter database mount

RMAN> exit

Recovery Manager complete.
adb$rman target /

Recovery Manager: Release 9.2.0.4.0 - 64bit Production

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

connected to target database: ADB (DBID=1503043681)

因為開始滅有設置DBID,因此mount后需要exit,然後再rman target 一次。不然後面會提示RMAN-06181: multiple channels require Enterprise Edition

4、restore 數據文件
還原腳本
run{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
allocate channel ch3 device type disk;
allocate channel ch4 device type disk;
set newname for datafile '/dev/raw/raw1' to '/oracle/oradata/adb/system_01_3000m';
set newname for datafile '/dev/raw/raw10' to '/oracle/oradata/adb/rac1_undo_01_1600m';
set newname for datafile '/dev/raw/raw4' to '/oracle/oradata/adb/indx_01_200m';
set newname for datafile '/dev/raw/raw3' to '/oracle/oradata/adb/tools_01_200m';
set newname for datafile '/dev/raw/raw17' to '/oracle/oradata/adb/rac2_undo_01_1600m';
set newname for datafile '/dev/raw/raw2' to '/oracle/oradata/adb/user_01_200m';
set newname for datafile '/dev/raw/raw40' to '/oracle/oradata/adb/D_AITSFIS1_DATA_01_16G';
set newname for datafile '/dev/raw/raw41' to '/oracle/oradata/adb/D_AITSFIS1_DATA_02_16G';
set newname for datafile '/dev/raw/raw42' to '/oracle/oradata/adb/D_AITSFIS1_DATA_03_16G';
set newname for datafile '/dev/raw/raw43' to '/oracle/oradata/adb/D_AITSFIS1_DATA_04_16G';
set newname for datafile '/dev/raw/raw44' to '/oracle/oradata/adb/D_AITSFIS1_DATA_05_16G';
set newname for datafile '/dev/raw/raw45' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_01_16G';
set newname for datafile '/dev/raw/raw71' to '/oracle/oradata/adb/D_DATA_FILE_01_16G';
set newname for datafile '/dev/raw/raw47' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_03_16G';
set newname for datafile '/dev/raw/raw48' to '/oracle/oradata/adb/D_SFIS1_DATA_01_16G';
set newname for datafile '/dev/raw/raw49' to '/oracle/oradata/adb/D_SFIS1_DATA_02_16G';
set newname for datafile '/dev/raw/raw50' to '/oracle/oradata/adb/D_SFIS1_DATA_03_16G';
set newname for datafile '/dev/raw/raw51' to '/oracle/oradata/adb/D_SFIS1_DATA_04_16G';
set newname for datafile '/dev/raw/raw52' to '/oracle/oradata/adb/D_SFIS1_DATA_05_16G';
set newname for datafile '/dev/raw/raw53' to '/oracle/oradata/adb/I_SFIS1_INDEX_01_16G';
set newname for datafile '/dev/raw/raw54' to '/oracle/oradata/adb/I_SFIS1_INDEX_02_16G';
set newname for datafile '/dev/raw/raw55' to '/oracle/oradata/adb/I_SFIS1_INDEX_03_16G';
set newname for datafile '/dev/raw/raw56' to '/oracle/oradata/adb/D_RMA_DATA_01_16G';
set newname for datafile '/dev/raw/raw57' to '/oracle/oradata/adb/D_RMA_DATA_02_16G';
set newname for datafile '/dev/raw/raw58' to '/oracle/oradata/adb/I_RMA_INDEX_01_16G';
set newname for datafile '/dev/raw/raw59' to '/oracle/oradata/adb/D_L10_WEB_DATA_01_8G';
set newname for datafile '/dev/raw/raw60' to '/oracle/oradata/adb/I_L10_WEB_INDEX_01_8G';
set newname for datafile '/dev/raw/raw61' to '/oracle/oradata/adb/D_L6_WEB_DATA_01_8G';
set newname for datafile '/dev/raw/raw62' to '/oracle/oradata/adb/I_L6_WEB_INDEX_01_8G';
set newname for datafile '/dev/raw/raw63' to '/oracle/oradata/adb/D_SFIS1_DATA_06_16G';
set newname for datafile '/dev/raw/raw64' to '/oracle/oradata/adb/D_SFIS1_DATA_07_16G';
set newname for datafile '/dev/raw/raw65' to '/oracle/oradata/adb/I_SFIS1_INDEX_04_16G';
set newname for datafile '/dev/raw/raw46' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_02_16G';
set newname for datafile '/dev/raw/raw68' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_05_8005M';
set newname for datafile '/dev/raw/raw66' to '/oracle/oradata/adb/I_SFIS1_INDEX_05_16G';
set newname for datafile '/dev/raw/raw69' to '/oracle/oradata/adb/I_SFIS1_INDEX_06_16G';
set newname for datafile '/dev/raw/raw70' to '/oracle/oradata/adb/I_INDEX_FILE_01_16G';
set newname for datafile '/dev/raw/raw72' to '/oracle/oradata/adb/I_INDEX_FILE_02_8G';
set newname for datafile '/dev/raw/raw73' to '/oracle/oradata/adb/I_SFIS1_INDEX_01_16G_1';
set newname for datafile '/dev/raw/raw74' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_02_16G_1';
set newname for datafile '/dev/raw/raw75' to '/oracle/oradata/adb/I_SFIS1_INDEX_04_16_1';
set newname for datafile '/dev/raw/raw76' to '/oracle/oradata/adb/I_L10_WEB_INDEX_01_16G_1';
set newname for datafile '/dev/raw/raw77' to '/oracle/oradata/adb/D_AITSFIS1_DATA_01_16G_1';
set newname for datafile '/dev/raw/raw78' to '/oracle/oradata/adb/statspack';
set newname for datafile '/dev/raw/raw79' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_04_16G';
set newname for datafile '/dev/raw/raw80' to '/oracle/oradata/adb/I_SFIS1_INDEX_02_16G_1';
set newname for datafile '/dev/raw/raw81' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_02_16G_2';
set newname for datafile '/dev/raw/raw82' to '/oracle/oradata/adb/D_AITSFIS1_DATA_02_16G_1';
set newname for datafile '/dev/raw/raw83' to '/oracle/oradata/adb/I_SFIS1_INDEX_04_16G_1';
set newname for datafile '/dev/raw/raw90' to '/oracle/oradata/adb/D_AITSFIS1_DATA_01_16G_1';
set newname for datafile '/dev/raw/raw91' to '/oracle/oradata/adb/D_AITSFIS1_DATA_01_16G_2';
set newname for datafile '/dev/raw/raw24' to '/oracle/oradata/adb/rac3_undo_01_1600m';
set newname for datafile '/dev/raw/raw92' to '/oracle/oradata/adb/D_AITSFIS1_DATA_02_16_2';
set newname for datafile '/dev/raw/raw93' to '/oracle/oradata/adb/i_aitsfis1_index_02_16G_2';
set newname for datafile '/dev/raw/raw94' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_05_16G';
set newname for datafile '/dev/raw/raw95' to '/oracle/oradata/adb/D_AITSFIS1_DATA_06_16G';
set newname for datafile '/dev/raw/raw96' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_01_16G_4';
set newname for datafile '/dev/raw/raw97' to '/oracle/oradata/adb/D_AITSFIS1_TEST_LOG';
set newname for datafile '/dev/raw/raw98' to '/oracle/oradata/adb/I_AITSFIS1_TEST_LOG';
set newname for datafile '/dev/raw/raw99' to '/oracle/oradata/adb/D_SFIS1_TEST_LOG';
set newname for datafile '/dev/raw/raw100' to '/oracle/oradata/adb/I_SFIS1_TEST_LOG';
restore datafile 1,2,5,53,7,8,52;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
}


5、對數據文件進行RENAME,修改控制文件中datafile的地址,如果數據文件不存在的話會報錯,不用理會:
登錄SQLPLUS,執行以下命令
select 'alter database rename file '''||name||''' to '||'''/oracle/oradata/adb/xxx '';' from v$datafile;
獲得rename命令,具體命令如下:
alter database rename file  '/dev/raw/raw1' to '/oracle/oradata/adb/system_01_3000m';
alter database rename file  '/dev/raw/raw10' to '/oracle/oradata/adb/rac1_undo_01_1600m';
alter database rename file  '/dev/raw/raw4' to '/oracle/oradata/adb/indx_01_200m';
alter database rename file  '/dev/raw/raw3' to '/oracle/oradata/adb/tools_01_200m';
alter database rename file  '/dev/raw/raw17' to '/oracle/oradata/adb/rac2_undo_01_1600m';
alter database rename file  '/dev/raw/raw2' to '/oracle/oradata/adb/user_01_200m';
alter database rename file  '/dev/raw/raw40' to '/oracle/oradata/adb/D_AITSFIS1_DATA_01_16G';
alter database rename file  '/dev/raw/raw41' to '/oracle/oradata/adb/D_AITSFIS1_DATA_02_16G';
alter database rename file  '/dev/raw/raw42' to '/oracle/oradata/adb/D_AITSFIS1_DATA_03_16G';
alter database rename file  '/dev/raw/raw43' to '/oracle/oradata/adb/D_AITSFIS1_DATA_04_16G';
alter database rename file  '/dev/raw/raw44' to '/oracle/oradata/adb/D_AITSFIS1_DATA_05_16G';
alter database rename file  '/dev/raw/raw45' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_01_16G';
alter database rename file  '/dev/raw/raw71' to '/oracle/oradata/adb/D_DATA_FILE_01_16G';
alter database rename file  '/dev/raw/raw47' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_03_16G';
alter database rename file  '/dev/raw/raw48' to '/oracle/oradata/adb/D_SFIS1_DATA_01_16G';
alter database rename file  '/dev/raw/raw49' to '/oracle/oradata/adb/D_SFIS1_DATA_02_16G';
alter database rename file '/dev/raw/raw50' to '/oracle/oradata/adb/D_SFIS1_DATA_03_16G';
alter database rename file '/dev/raw/raw51' to '/oracle/oradata/adb/D_SFIS1_DATA_04_16G';
alter database rename file  '/dev/raw/raw52' to '/oracle/oradata/adb/D_SFIS1_DATA_05_16G';
alter database rename file  '/dev/raw/raw53' to '/oracle/oradata/adb/I_SFIS1_INDEX_01_16G';
alter database rename file '/dev/raw/raw54' to '/oracle/oradata/adb/I_SFIS1_INDEX_02_16G';
alter database rename file '/dev/raw/raw55' to '/oracle/oradata/adb/I_SFIS1_INDEX_03_16G';
alter database rename file '/dev/raw/raw56' to '/oracle/oradata/adb/D_RMA_DATA_01_16G';
alter database rename file '/dev/raw/raw57' to '/oracle/oradata/adb/D_RMA_DATA_02_16G';
alter database rename file '/dev/raw/raw58' to '/oracle/oradata/adb/I_RMA_INDEX_01_16G';
alter database rename file '/dev/raw/raw59' to '/oracle/oradata/adb/D_L10_WEB_DATA_01_8G';
alter database rename file '/dev/raw/raw60' to '/oracle/oradata/adb/I_L10_WEB_INDEX_01_8G';
alter database rename file '/dev/raw/raw61' to '/oracle/oradata/adb/D_L6_WEB_DATA_01_8G';
alter database rename file '/dev/raw/raw62' to '/oracle/oradata/adb/I_L6_WEB_INDEX_01_8G';
alter database rename file '/dev/raw/raw63' to '/oracle/oradata/adb/D_SFIS1_DATA_06_16G';
alter database rename file '/dev/raw/raw64' to '/oracle/oradata/adb/D_SFIS1_DATA_07_16G';
alter database rename file '/dev/raw/raw65' to '/oracle/oradata/adb/I_SFIS1_INDEX_04_16G';
alter database rename file '/dev/raw/raw46' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_02_16G';
alter database rename file '/dev/raw/raw68' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_05_8005M';
alter database rename file '/dev/raw/raw66' to '/oracle/oradata/adb/I_SFIS1_INDEX_05_16G';
alter database rename file '/dev/raw/raw69' to '/oracle/oradata/adb/I_SFIS1_INDEX_06_16G';
alter database rename file '/dev/raw/raw70' to '/oracle/oradata/adb/I_INDEX_FILE_01_16G';
alter database rename file '/dev/raw/raw72' to '/oracle/oradata/adb/I_INDEX_FILE_02_8G';
alter database rename file '/dev/raw/raw73' to '/oracle/oradata/adb/I_SFIS1_INDEX_01_16G_1';
alter database rename file '/dev/raw/raw74' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_02_16G_1';
alter database rename file '/dev/raw/raw75' to '/oracle/oradata/adb/I_SFIS1_INDEX_04_16_1';
alter database rename file '/dev/raw/raw76' to '/oracle/oradata/adb/I_L10_WEB_INDEX_01_16G_1';
alter database rename file '/dev/raw/raw77' to '/oracle/oradata/adb/D_AITSFIS1_DATA_01_16G_1';
alter database rename file '/dev/raw/raw78' to '/oracle/oradata/adb/statspack';
alter database rename file '/dev/raw/raw79' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_04_16G';
alter database rename file '/dev/raw/raw80' to '/oracle/oradata/adb/I_SFIS1_INDEX_02_16G_1';
alter database rename file '/dev/raw/raw81' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_02_16G_2';
alter database rename file '/dev/raw/raw82' to '/oracle/oradata/adb/D_AITSFIS1_DATA_02_16G_1';
alter database rename file '/dev/raw/raw83' to '/oracle/oradata/adb/I_SFIS1_INDEX_04_16G_1';
alter database rename file '/dev/raw/raw90' to '/oracle/oradata/adb/D_AITSFIS1_DATA_01_16G_1';
alter database rename file '/dev/raw/raw91' to '/oracle/oradata/adb/D_AITSFIS1_DATA_01_16G_2';
alter database rename file '/dev/raw/raw24' to '/oracle/oradata/adb/rac3_undo_01_1600m';
alter database rename file '/dev/raw/raw92' to '/oracle/oradata/adb/D_AITSFIS1_DATA_02_16_2';
alter database rename file '/dev/raw/raw93' to '/oracle/oradata/adb/i_aitsfis1_index_02_16G_2';
alter database rename file '/dev/raw/raw94' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_05_16G';
alter database rename file '/dev/raw/raw95' to '/oracle/oradata/adb/D_AITSFIS1_DATA_06_16G';
alter database rename file '/dev/raw/raw96' to '/oracle/oradata/adb/I_AITSFIS1_INDEX_01_16G_4';
alter database rename file '/dev/raw/raw97' to '/oracle/oradata/adb/D_AITSFIS1_TEST_LOG';
alter database rename file '/dev/raw/raw98' to '/oracle/oradata/adb/I_AITSFIS1_TEST_LOG';
alter database rename file '/dev/raw/raw99' to '/oracle/oradata/adb/D_SFIS1_TEST_LOG';
alter database rename file '/dev/raw/raw100' to '/oracle/oradata/adb/I_SFIS1_TEST_LOG';

將不進行恢復的數據文件offline,不然恢復數據庫的時候會報錯。
使用select 'alter database datafile '''||name||''' offline for drop;' from v$datafile where name like '%raw%';
獲得修改命令將沒有rename還是raw的數據文件offline,具體命令如下:

alter database datafile '/dev/raw/raw4' offline for drop;
alter database datafile '/dev/raw/raw3' offline for drop;
alter database datafile '/dev/raw/raw2' offline for drop;
alter database datafile '/dev/raw/raw42' offline for drop;
alter database datafile '/dev/raw/raw43' offline for drop;
alter database datafile '/dev/raw/raw44' offline for drop;
alter database datafile '/dev/raw/raw45' offline for drop;
alter database datafile '/dev/raw/raw71' offline for drop;
alter database datafile '/dev/raw/raw47' offline for drop;
alter database datafile '/dev/raw/raw48' offline for drop;
alter database datafile '/dev/raw/raw49' offline for drop;
alter database datafile '/dev/raw/raw50' offline for drop;
alter database datafile '/dev/raw/raw51' offline for drop;
alter database datafile '/dev/raw/raw52' offline for drop;
alter database datafile '/dev/raw/raw53' offline for drop;
alter database datafile '/dev/raw/raw54' offline for drop;
alter database datafile '/dev/raw/raw55' offline for drop;
alter database datafile '/dev/raw/raw56' offline for drop;
alter database datafile '/dev/raw/raw57' offline for drop;
alter database datafile '/dev/raw/raw58' offline for drop;
alter database datafile '/dev/raw/raw59' offline for drop;
alter database datafile '/dev/raw/raw60' offline for drop;
alter database datafile '/dev/raw/raw61' offline for drop;
alter database datafile '/dev/raw/raw62' offline for drop;
alter database datafile '/dev/raw/raw63' offline for drop;
alter database datafile '/dev/raw/raw64' offline for drop;
alter database datafile '/dev/raw/raw65' offline for drop;
alter database datafile '/dev/raw/raw46' offline for drop;
alter database datafile '/dev/raw/raw68' offline for drop;
alter database datafile '/dev/raw/raw66' offline for drop;
alter database datafile '/dev/raw/raw69' offline for drop;
alter database datafile '/dev/raw/raw70' offline for drop;
alter database datafile '/dev/raw/raw72' offline for drop;
alter database datafile '/Data/raw/raw78' offline for drop;
alter database datafile '/dev/raw/raw73' offline for drop;
alter database datafile '/dev/raw/raw74' offline for drop;
alter database datafile '/dev/raw/raw75' offline for drop;
alter database datafile '/dev/raw/raw76' offline for drop;
alter database datafile '/dev/raw/raw77' offline for drop;
alter database datafile '/dev/raw/raw78' offline for drop;
alter database datafile '/dev/raw/raw79' offline for drop;
alter database datafile '/dev/raw/raw80' offline for drop;
alter database datafile '/dev/raw/raw81' offline for drop;
alter database datafile '/dev/raw/raw82' offline for drop;
alter database datafile '/dev/raw/raw83' offline for drop;
alter database datafile '/dev/raw/raw90' offline for drop;
alter database datafile '/dev/raw/raw92' offline for drop;
alter database datafile '/dev/raw/raw93' offline for drop;
alter database datafile '/dev/raw/raw94' offline for drop;
alter database datafile '/dev/raw/raw95' offline for drop;
alter database datafile '/dev/raw/raw96' offline for drop;
alter database datafile '/dev/raw/raw97' offline for drop;
alter database datafile '/dev/raw/raw98' offline for drop;
alter database datafile '/dev/raw/raw99' offline for drop;
alter database datafile '/dev/raw/raw100' offline for drop;

因為原來的redolog是存放在raw設備上的,因此需要rename到本地磁盤,通過執行
select 'alter database rename file '''||member||''' to '||'''/oracle/oradata/adb/ '';' from v$logfile;
來獲得rename腳本,然後再修改,具體命令如下;

alter database rename file '/dev/raw/raw11' to '/oracle/oradata/adb/redo01a.log';
alter database rename file '/dev/raw/raw12' to '/oracle/oradata/adb/redo01b.log';
alter database rename file '/dev/raw/raw13' to '/oracle/oradata/adb/redo02a.log';
alter database rename file '/dev/raw/raw14' to '/oracle/oradata/adb/redo02b.log';
alter database rename file '/dev/raw/raw15' to '/oracle/oradata/adb/redo03a.log';
alter database rename file '/dev/raw/raw16' to '/oracle/oradata/adb/redo03b.log';
alter database rename file '/dev/raw/raw18' to '/oracle/oradata/adb/redo04a.log';
alter database rename file '/dev/raw/raw19' to '/oracle/oradata/adb/redo04b.log';
alter database rename file '/dev/raw/raw20' to '/oracle/oradata/adb/redo05a.log';
alter database rename file '/dev/raw/raw21' to '/oracle/oradata/adb/redo05b.log';
alter database rename file '/dev/raw/raw22' to '/oracle/oradata/adb/redo06a.log';
alter database rename file '/dev/raw/raw23' to '/oracle/oradata/adb/redo06b.log';

使用using backup選項來恢復數據庫
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 11827619261175 generated at 10/22/2011 20:52:26 needed for thread 2
ORA-00289: suggestion : /Data/arch1/2_36521.dbf
ORA-00280: change 11827619261175 for thread 2 is in sequence #36521


Specify log: {=suggested | filename | AUTO | CANCEL}
auto



SQL> alter database open resetlogs;

Database altered.


驗證恢復結果,AITSFIS1.R_SSCC_DETAIL屬於表空間D_AITSFIS1_DATA_01:
在生產庫adb2上查詢:
SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

Session altered.

SQL> select sysdate,count(*) from AITSFIS1.R_SSCC_DETAIL;

SYSDATE           COUNT(*)
------------------- ----------
2011-11-10 11:36:28     14547

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
adb2

在恢復庫adb上查詢:
SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

Session altered.

SQL> select sysdate,count(*) from AITSFIS1.R_SSCC_DETAIL;

SYSDATE           COUNT(*)
------------------- ----------
2011-11-10 11:37:04     14547

SQL> select instance_name from v$instance;

INSTANCE_NAME
------------------------------------------------
adb

至此恢復成功。


阅读(1814) | 评论(3) | 转发(0) |
给主人留下些什么吧!~~

小小小毛驴2011-11-30 23:36:40

wgyzhechao: 輸入法是繁體的.....
台湾银民?

wgyzhechao2011-11-29 15:22:58

小小小毛驴: 恢复啊~为什么是繁体字呢?.....
輸入法是繁體的

小小小毛驴2011-11-11 09:51:25

恢复啊~为什么是繁体字呢?