恢復RAC資料庫到單例項(ASM)
源端為10.2.0.4的RAC+ASM,現透過熱備並應用歸檔日誌的方式將資料庫恢復到相同版本的單例項上,單機也同樣採用ASM方式。
單機環境為:ORACLE 10.2.0.4 , ASM
1、 將從生產機上ftp過來的pfile.ora檔案進行修改,主要去掉和叢集相關的一些引數:
引數檔案修改後如下:
#racdb2.__db_cache_size=13287555072
#racdb1.__db_cache_size=5033164800
#racdb2.__java_pool_size=16777216
#racdb1.__java_pool_size=16777216
#racdb2.__large_pool_size=33554432
#racdb1.__large_pool_size=83886080
#racdb2.__shared_pool_size=1325400064
#racdb1.__shared_pool_size=3439329280
#racdb2.__streams_pool_size=0
#racdb1.__streams_pool_size=0
#*.cluster_database_instances=2
#*.cluster_database=true
#racdb2.cursor_sharing='FORCE'
#racdb1.instance_number=1
#racdb2.instance_number=2
#racdb2.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.11.53 ) ( port
=1521 ))'
#racdb2.sga_max_size=16777216000#internally adjusted
#racdb2.sga_target=14680064000
#racdb2.thread=2
#racdb1.thread=1
#racdb2.undo_tablespace='UNDOTBS2'
#*.remote_listener='LISTENERS_RACDB'
#*.lock_sga=TRUE
*.audit_file_dest='/oranm01/app/oracle/admin/racdb/adump'
*.background_dump_dest='/oranm01/app/oracle/admin/racdb/bdump'
*.compatible='10.2.0.3.0'
*.control_files='+DATA/racdb/controlfile/current.290.692567429','+FLASH/racdb/controlfile/current.718.692567431'
*.core_dump_dest='/oranm01/app/oracle/admin/racdb/cdump'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_flashback_retention_target=120
*.db_name='racdb'
*.db_recovery_file_dest='+FLASH'
*.db_recovery_file_dest_size=375809638400
*.dispatchers='(PROTOCOL=TCP) (SERVICE=racdbXDB)'
*.job_queue_processes=10
racdb.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.11.83 ) ( port =
1521))'
*.nls_territory='CHINA'
*.open_cursors=600
*.pga_aggregate_target=4847566848
*.processes=1000
*.remote_login_passwordfile='exclusive'
racdb.sga_max_size=12884901888#internally adjusted
*.sga_target=1610612736
racdb.sga_target=8589934592
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/oranm01/app/oracle/admin/racdb/udump'
#racdb2.__db_cache_size=13287555072
#racdb1.__db_cache_size=5033164800
#racdb2.__java_pool_size=16777216
#racdb1.__java_pool_size=16777216
#racdb2.__large_pool_size=33554432
#racdb1.__large_pool_size=83886080
#racdb2.__shared_pool_size=1325400064
#racdb1.__shared_pool_size=3439329280
#racdb2.__streams_pool_size=0
#racdb1.__streams_pool_size=0
#*.cluster_database_instances=2
#*.cluster_database=true
#racdb2.cursor_sharing='FORCE'
#racdb1.instance_number=1
#racdb2.instance_number=2
#racdb2.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.11.53 ) ( port
=1521 ))'
#racdb2.sga_max_size=16777216000#internally adjusted
#racdb2.sga_target=14680064000
#racdb2.thread=2
#racdb1.thread=1
#racdb2.undo_tablespace='UNDOTBS2'
#*.remote_listener='LISTENERS_RACDB'
#*.lock_sga=TRUE
*.audit_file_dest='/oranm01/app/oracle/admin/racdb/adump'
*.background_dump_dest='/oranm01/app/oracle/admin/racdb/bdump'
*.compatible='10.2.0.3.0'
*.control_files='+DATA/racdb/controlfile/current.290.692567429','+FLASH/racdb/controlfile/current.718.692567431'
*.core_dump_dest='/oranm01/app/oracle/admin/racdb/cdump'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_flashback_retention_target=120
*.db_name='racdb'
*.db_recovery_file_dest='+FLASH'
*.db_recovery_file_dest_size=375809638400
*.dispatchers='(PROTOCOL=TCP) (SERVICE=racdbXDB)'
*.job_queue_processes=10
racdb.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.11.83 ) ( port =
1521))'
*.nls_territory='CHINA'
*.open_cursors=600
*.pga_aggregate_target=4847566848
*.processes=1000
*.remote_login_passwordfile='exclusive'
racdb.sga_max_size=12884901888#internally adjusted
*.sga_target=1610612736
racdb.sga_target=8589934592
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/oranm01/app/oracle/admin/racdb/udump'
2、 將pfile檔案轉換成spfile
P750_25:oracle:/home/oracle>sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.4.0 - Production on Wed Sep 14
13:25:45 2011
Copyright (c) 1982, 2007, Oracle. All
Rights Reserved.
Connected to an idle instance.
SQL> create spfile from pfile='/home/oracle/pfile.ora';
File created.
3、 NOMOUNT資料庫
SQL> alter database nomount;
4、 恢復控制檔案
RMAN> restore controlfile from '/cb_backup/ctl_201109131913.ctl';
5、 MOUNT資料庫
RMAN> sql 'alter database mount';
6、 重新指定線上聯機日誌檔案(SQLPLUS下執行)
alter database rename file '+DATA/racdb/onlinelog/group_1.259.727912683'
to '+DATA';
alter database rename file '+FLASH/racdb/onlinelog/group_1.720.727912685' to
'+FLASH';
alter database rename file '+DATA/racdb/onlinelog/group_2.261.727912333' to
'+DATA';
alter database rename file '+FLASH/racdb/onlinelog/group_2.719.727912335' to
'+FLASH';
alter database rename file '+DATA/racdb/onlinelog/group_3.289.727912713' to
'+DATA';
alter database rename file '+FLASH/racdb/onlinelog/group_3.722.727912713' to
'+FLASH';
alter database rename file '+DATA/racdb/onlinelog/group_4.292.727912375' to
'+DATA';
alter database rename file '+FLASH/racdb/onlinelog/group_4.721.727912377' to
'+FLASH';
alter database rename file '+DATA/racdb/onlinelog/group_5.309.727911829' to
'+DATA';
alter database rename file '+FLASH/racdb/onlinelog/group_5.2794.727911827' to
'+FLASH';
alter database rename file '+DATA/racdb/onlinelog/group_6.310.727912035' to
'+DATA';
alter database rename file '+FLASH/racdb/onlinelog/group_6.2515.727912037' to
'+FLASH';
alter database rename file '+DATA/racdb/onlinelog/group_7.311.727912117' to
'+DATA';
alter database rename file '+FLASH/racdb/onlinelog/group_7.1112.727912117' to
'+FLASH';
alter database rename file '+DATA/racdb/onlinelog/group_8.312.727912163' to
'+DATA';
alter database rename file '+FLASH/racdb/onlinelog/group_8.2592.727912165' to
'+FLASH';
7、 在待恢復資料庫上對從源庫FTP過來的備份集進行註冊(RMAN下執行)
catalog backuppiece '/cb_backup/rvmmfdj2_1_1_7039.bak';
catalog backuppiece '/cb_backup/s0mmfdj2_1_1_7040.bak';
catalog backuppiece '/cb_backup/s1mmfdm3_1_1_7041.bak';
catalog backuppiece '/cb_backup/s2mmfdml_10_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_11_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_12_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_13_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_14_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_1_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_2_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_3_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_4_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_5_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_6_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_7_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_8_1_7042.bak';
catalog backuppiece '/cb_backup/s2mmfdml_9_1_7042.bak';
catalog backuppiece '/cb_backup/s3mmfdml_10_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_11_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_12_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_13_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_14_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_15_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_16_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_17_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_1_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_2_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_3_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_4_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_5_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_6_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_7_1_7043.bak';
atalog backuppiece '/cb_backup/s3mmfdml_8_1_7043.bak';
catalog backuppiece '/cb_backup/s3mmfdml_9_1_7043.bak';
catalog backuppiece '/cb_backup/s4mmfkbu_1_1_7044.bak';
catalog backuppiece '/cb_backup/s5mmfkbu_1_1_7045.bak';
8、 修復資料庫
RMAN> run {
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
restore database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}
9、 FTP源庫上的歸檔檔案至目標主機上
a)
在源庫上,歸檔檔案存放在ASM上,因此首先需要將歸檔檔案複製到本地檔案系統上:
SQL> create or replace directory
ARCH_DIR as '+flash/racdb/archivelog/2011_09_13';
b) SQL> create or replace directory ARCL_DEST as '/xdbackup/cityb';
c)
SQL>
BEGIN
SQL> dbms_file_transfer.copy_file(
SQL> source_directory_object =>'ARCH_DIR',
SQL> source_file_name => 'thread_2_seq_38337.1435.761786245',
SQL> destination_directory_object => 'ARCL_DEST',
SQL> destination_file_name => 'thread_2_seq_38337.1435.761786245');
SQL> END;
SQL> /
d) 把需要的歸檔檔案都copy下來後,FTP到目標主機
10、 註冊歸檔檔案
SQL> catalog archivelog '/cb_backup/arch/thread_1_seq_68228.2464.761783913';
SQL> catalog archivelog '/cb_backup/arch/thread_1_seq_68229.976.761783957';
SQL> catalog archivelog '/cb_backup/arch/thread_1_seq_68230.1125.761784003';
SQL> catalog archivelog '/cb_backup/arch/thread_1_seq_68231.2838.761784049';
SQL> catalog archivelog '/cb_backup/arch/thread_1_seq_68232.2717.761784099';
………………………………………
11、 恢復資料庫
RMAN> recover database;
12、 開啟資料庫
SQL> alter database open resetlogs;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25834554/viewspace-707616/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rac恢復到單例項單例
- 將RAC備份集恢復為單例項資料庫單例資料庫
- 【資料庫資料恢復】ASM例項不能掛載的Oracle資料庫資料恢復案例資料庫資料恢復ASMOracle
- 【資料庫資料恢復】Oracle ASM例項無法掛載的資料恢復案例資料庫資料恢復OracleASM
- RAC+DG(asm單例項)ASM單例
- oracle資料庫跨平臺(AIX)從RAC恢復至(linux)下的單例項Oracle資料庫AILinux單例
- 記錄一次Oracle 11.2.0.4 RAC異地恢復到單例項Oracle單例
- 從nub備份恢復(同平臺)恢復RAC至單例項單例
- RAC恢復到單機
- DM7 RAC資料庫恢復成單機資料庫資料庫
- 【資料庫資料恢復】Oracle資料庫ASM磁碟組掉線如何恢復資料?資料庫資料恢復OracleASM
- 【資料庫資料恢復】ASM磁碟組掉線的Oracle資料庫資料恢復案例資料庫資料恢復ASMOracle
- Networker恢復oracle rac到單機Oracle
- 【ASK_ORACLE】Relink ASM單例項資料庫詳細步驟OracleASM單例資料庫
- mysql資料庫恢復一例MySql資料庫
- Oracle 資料庫巡檢指令碼 單例項 RAC 輸出HTML格式Oracle資料庫指令碼單例HTML
- mysqldump 恢復單個資料庫MySql資料庫
- Oracle 11g RAC到單例項OGG同步Oracle單例
- oracle asm 資料塊重構恢復OracleASM
- 【資料庫資料恢復】SAP資料庫資料恢復案例資料庫資料恢復
- DM7使用DMRMAN執行RAC資料庫恢復資料庫
- 寶塔資料庫恢復 mysql資料庫丟失恢復 mysql資料庫刪除庫恢復 寶塔mysql資料庫恢復資料庫MySql
- 【資料庫資料恢復】Sql Server資料庫資料恢復案例資料庫資料恢復SQLServer
- Oracle ASM故障資料恢復解決方案OracleASM資料恢復
- 【資料庫資料恢復】透過恢復NDF檔案修復資料庫的資料恢復過程資料庫資料恢復
- 資料庫修復資料恢復資料庫資料恢復
- 【資料庫資料恢復】如何恢復Oracle資料庫truncate表的資料資料庫資料恢復Oracle
- 【資料庫資料恢復】windows server下SqlServer資料庫的資料恢復資料庫資料恢復WindowsServerSQL
- 記一次刪庫到資料恢復資料恢復
- 3.1.5.7 啟動例項、掛載資料庫並啟動完整的媒體恢復資料庫
- 資料庫startup啟動時前滾回滾進行例項恢復的理解資料庫
- 【資料庫資料恢復】誤truncate table的Oracle資料庫資料恢復方案資料庫資料恢復Oracle
- 【資料庫資料恢復】oracle資料庫誤truncate table怎麼恢復資料?資料庫資料恢復Oracle
- 【資料庫資料恢復】linux系統下MYSQL資料庫資料恢復案例資料庫資料恢復LinuxMySql
- 【資料庫資料恢復】Oracle資料庫誤truncate table的資料恢復案例資料庫資料恢復Oracle
- 伺服器資料恢復—透過拼接資料庫碎片恢復SqlServer資料庫資料的資料恢復案例伺服器資料恢復資料庫SQLServer
- ORACLE11GR2 RAC解除安裝ASM例項步驟OracleASM
- 【資料庫資料恢復】MS SQL資料庫附加資料庫出錯怎麼恢復資料?資料庫資料恢復SQL
- sybase資料庫恢復資料庫