【實驗】從RMAN備份中恢復spfile檔案
1.使用自動備份恢復spfile
ora10g@linux5 /home/oracle$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Mar 14 03:00:39 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORA10G (DBID=3998073128)
RMAN> list backup summary;
using target database control file instead of recovery catalog
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
1 B F A DISK 13-MAR-09 1 1 NO TAG20090313T082236
2 B F A DISK 13-MAR-09 1 1 NO TAG20090313T082344
RMAN> restore spfile to '/home/oracle/spfileora10g.ora' from autobackup;
Starting restore at 14-MAR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=527 devtype=DISK
recovery area destination: /oracle/u01/app/oracle/flash_recovery_area
database name (or database unique name) used for search: ORA10G
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: /oracle/u01/app/oracle/flash_recovery_area/ORA10G/autobackup/2009_03_13/o1_mf_s_681380624_4vm9wko2_.bkp
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 14-MAR-09
RMAN> exit
Recovery Manager complete.
ora10g@linux5 /home/oracle$ ls -l spfile*
-rw-r----- 1 oracle oinstall 3584 Mar 14 03:01 spfileora10g.ora
ora10g@linux5 /home/oracle$ strings spfileora10g.ora
ora10g.__db_cache_size=58720256
ora10g.__java_pool_size=4194304
ora10g.__large_pool_size=4194304
ora10g.__shared_pool_size=92274688
ora10g.__streams_pool_size=4194304
*.audit_file_dest='/oracle/u01/app/oracle/admin/ora10g/adump'
*.background_dump_dest='/oracle/u01/app/oracle/admin/ora10g/bdump'
*.compatible='10.2.0.3.0'
*.control_files='/oracle/u02/oradata/ORA10G/controlfile/o1_mf_4srph8fv_.ctl','/oracle/u01/app/oracle/flash_recovery_area/ORA10G/controlfile/o1_mf_4srph96b_.ctl'
*.core_dump_dest='/oracle/u01/app/oracle/admin/ora10g/cdump'
*.cursor_sharing='EXACT'
*.db_block_size=8192
*.db_create_file_dest='/oracle/u02/oradata'
*.db_create_online_log_dest_1='/oracle/u01'
*.db_create_online_log_dest_2='/oracle/u02'
*.db_create_online_log_dest_3='/oracle/u02'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ora10g'
*.db_recovery_file_dest='/oracle/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4294967296
*.job_queue_processes=10
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=500
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/oracle/u01/app/oracle/admin/ora10g/udump'
2.透過指定備份檔案的方法進行恢復
RMAN> restore spfile to '/home/oracle/spfileora10g.ora' from '/oracle/u01/app/oracle/flash_recovery_area/ORA10G/autobackup/2009_03_13/o1_mf_s_681380624_4vm9wko2_.bkp';
3.資料庫無法啟動,恢復spfile的第一種方法:透過建立一個臨時的pfile啟動資料庫到nomount,然後使用上述方法透過RMAN恢復spfile
4.資料庫無法啟動,恢復spfile的第二種方法:使用RMAN啟動預設例項(DUMMY),進行spfile的恢復
ora10g@linux5 /home/oracle$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Mar 14 08:34:08 2009
Copyright (c) 1982, 2007, 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/u01/app/oracle/product/10.2.0/db_1/dbs/initora10g.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 1266344 bytes
Variable Size 54529368 bytes
Database Buffers 100663296 bytes
Redo Buffers 2924544 bytes
RMAN> exit
Recovery Manager complete.
ora10g@linux5 /home/oracle$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Mar 14 08:35:28 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: DUMMY (not mounted)
RMAN> restore spfile to '/home/oracle/spfileora10g.ora' from autobackup;
Starting restore at 14-MAR-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/14/2009 08:35:50
RMAN-06495: must explicitly specify DBID with SET DBID command
RMAN>
RMAN> restore spfile to '/home/oracle/spfileora10g.ora' from '/oracle/u01/app/oracle/flash_recovery_area/ORA10G/autobackup/2009_03_13/o1_mf_s_681380624_4vm9wko2_.bkp';
Starting restore at 14-MAR-09
using channel ORA_DISK_1
channel ORA_DISK_1: autobackup found: /oracle/u01/app/oracle/flash_recovery_area/ORA10G/autobackup/2009_03_13/o1_mf_s_681380624_4vm9wko2_.bkp
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 14-MAR-09
RMAN> exit
5.小結
建議定期對spfile進行備份,如果使用RMAN作為日常的備份方法,需要將控制檔案自動備份功能開啟。
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
-- The End --
ora10g@linux5 /home/oracle$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Mar 14 03:00:39 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: ORA10G (DBID=3998073128)
RMAN> list backup summary;
using target database control file instead of recovery catalog
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
1 B F A DISK 13-MAR-09 1 1 NO TAG20090313T082236
2 B F A DISK 13-MAR-09 1 1 NO TAG20090313T082344
RMAN> restore spfile to '/home/oracle/spfileora10g.ora' from autobackup;
Starting restore at 14-MAR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=527 devtype=DISK
recovery area destination: /oracle/u01/app/oracle/flash_recovery_area
database name (or database unique name) used for search: ORA10G
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: /oracle/u01/app/oracle/flash_recovery_area/ORA10G/autobackup/2009_03_13/o1_mf_s_681380624_4vm9wko2_.bkp
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 14-MAR-09
RMAN> exit
Recovery Manager complete.
ora10g@linux5 /home/oracle$ ls -l spfile*
-rw-r----- 1 oracle oinstall 3584 Mar 14 03:01 spfileora10g.ora
ora10g@linux5 /home/oracle$ strings spfileora10g.ora
ora10g.__db_cache_size=58720256
ora10g.__java_pool_size=4194304
ora10g.__large_pool_size=4194304
ora10g.__shared_pool_size=92274688
ora10g.__streams_pool_size=4194304
*.audit_file_dest='/oracle/u01/app/oracle/admin/ora10g/adump'
*.background_dump_dest='/oracle/u01/app/oracle/admin/ora10g/bdump'
*.compatible='10.2.0.3.0'
*.control_files='/oracle/u02/oradata/ORA10G/controlfile/o1_mf_4srph8fv_.ctl','/oracle/u01/app/oracle/flash_recovery_area/ORA10G/controlfile/o1_mf_4srph96b_.ctl'
*.core_dump_dest='/oracle/u01/app/oracle/admin/ora10g/cdump'
*.cursor_sharing='EXACT'
*.db_block_size=8192
*.db_create_file_dest='/oracle/u02/oradata'
*.db_create_online_log_dest_1='/oracle/u01'
*.db_create_online_log_dest_2='/oracle/u02'
*.db_create_online_log_dest_3='/oracle/u02'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ora10g'
*.db_recovery_file_dest='/oracle/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4294967296
*.job_queue_processes=10
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=500
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/oracle/u01/app/oracle/admin/ora10g/udump'
2.透過指定備份檔案的方法進行恢復
RMAN> restore spfile to '/home/oracle/spfileora10g.ora' from '/oracle/u01/app/oracle/flash_recovery_area/ORA10G/autobackup/2009_03_13/o1_mf_s_681380624_4vm9wko2_.bkp';
3.資料庫無法啟動,恢復spfile的第一種方法:透過建立一個臨時的pfile啟動資料庫到nomount,然後使用上述方法透過RMAN恢復spfile
4.資料庫無法啟動,恢復spfile的第二種方法:使用RMAN啟動預設例項(DUMMY),進行spfile的恢復
ora10g@linux5 /home/oracle$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Mar 14 08:34:08 2009
Copyright (c) 1982, 2007, 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/u01/app/oracle/product/10.2.0/db_1/dbs/initora10g.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 1266344 bytes
Variable Size 54529368 bytes
Database Buffers 100663296 bytes
Redo Buffers 2924544 bytes
RMAN> exit
Recovery Manager complete.
ora10g@linux5 /home/oracle$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Mar 14 08:35:28 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: DUMMY (not mounted)
RMAN> restore spfile to '/home/oracle/spfileora10g.ora' from autobackup;
Starting restore at 14-MAR-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/14/2009 08:35:50
RMAN-06495: must explicitly specify DBID with SET DBID command
RMAN>
RMAN> restore spfile to '/home/oracle/spfileora10g.ora' from '/oracle/u01/app/oracle/flash_recovery_area/ORA10G/autobackup/2009_03_13/o1_mf_s_681380624_4vm9wko2_.bkp';
Starting restore at 14-MAR-09
using channel ORA_DISK_1
channel ORA_DISK_1: autobackup found: /oracle/u01/app/oracle/flash_recovery_area/ORA10G/autobackup/2009_03_13/o1_mf_s_681380624_4vm9wko2_.bkp
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 14-MAR-09
RMAN> exit
5.小結
建議定期對spfile進行備份,如果使用RMAN作為日常的備份方法,需要將控制檔案自動備份功能開啟。
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-567145/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【實驗】從RMAN備份中恢復controlfile控制檔案
- 備份與恢復系列 十 引數檔案spfile的備份與恢復
- RMAN備份、恢復實驗室 之 備份篇 【歸檔模式】模式
- rman備份恢復-rman恢復資料檔案測試
- RMAN備份恢復之控制檔案的恢復(三)
- RMAN備份恢復之控制檔案的恢復(二)
- RMAN備份恢復之控制檔案的恢復(一)
- 12 使用RMAN備份和恢復檔案
- rman備份丟失控制檔案恢復
- RMAN備份、恢復實驗室 之 備份篇 【rman: can't open target】
- oracle實驗記錄 (恢復-rman增量備份)Oracle
- 如何從Active Backup for Business備份中恢復檔案
- 丟失全部控制檔案後從RMAN備份集中恢復示例
- 恢復SPFILE檔案
- rman備份-(1) 利用備份級恢復資料檔案和控制檔案
- 【rman 備份與恢復】恢復丟失所有的控制檔案
- 【管理篇備份恢復】rman恢復測試(二) 控制檔案恢復(三)
- 【管理篇備份恢復】rman恢復測試(二) 控制檔案恢復(二)
- 【管理篇備份恢復】rman恢復測試(二) 控制檔案恢復(一)
- ORACLE DG從庫 Rman備份恢復Oracle
- RMAN基於備份控制檔案恢復失敗
- 備份恢復實驗(1)丟失部分控制檔案
- oracle實驗記錄 (恢復-恢復未備份的資料檔案)Oracle
- 備份與恢復--從備份的歸檔日誌中恢復資料
- 使用logmnr,在RMAN備份檔案中恢復備份的歸檔日誌檔案進行分析
- rman恢復--歸檔模式有備份,丟失資料檔案的恢復模式
- rman恢復--歸檔模式無備份,丟失資料檔案的恢復模式
- 備份與恢復--利用備份的控制檔案恢復
- 控制檔案恢復—從自動或二進位制備份中恢復
- 【備份恢復】歸檔模式下丟失系統關鍵資料檔案 利用RMAN備份恢復模式
- oracle實驗記錄 (恢復-rman操作(設定&備份))Oracle
- RMAN備份恢復原理
- 【備份恢復】丟失所有控制檔案,利用RMAN進行恢復操作
- rman恢復資料庫--用備份的控制檔案資料庫
- standby全庫rman備份檔案恢復到異機
- 只有rman備份集,控制檔案丟失的恢復
- 控制檔案備份增加、破壞恢復系列實驗(上)
- 控制檔案備份增加、破壞恢復系列實驗(下)