【實驗】從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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 12 使用RMAN備份和恢復檔案
- ORACLE DG從庫 Rman備份恢復Oracle
- rman 增量備份恢復
- RMAN備份恢復技巧
- 如何從Active Backup for Business備份中恢復檔案
- RMAN備份恢復典型案例——資料檔案存在壞快
- RMAN備份異機恢復
- RMAN備份恢復典型案例——RMAN備份&系統變慢
- RMAN備份恢復效能優化優化
- RMAN備份與恢復測試
- dg丟失歸檔,使用rman增量備份恢復
- Oracle 備份恢復篇之RMAN catalogOracle
- rman備份異機恢復(原創)
- RMAN備份恢復典型案例——異機恢復未知DBID
- 【rman備份策略】實驗
- 透過搭建恢復目錄實現RMAN異地備份和恢復
- Linux中XFS檔案系統的備份,恢復,修復Linux
- RMAN備份恢復典型案例——ORA-00245
- 【備份】RMAN中對控制檔案的幾種備份方法
- 實戰:xfs檔案系統的備份和恢復
- XFS檔案系統的備份、恢復、修復
- 備份恢復Lesson 04.Using the RMAN Recovery Catalog
- 2.7.9 備份伺服器引數檔案(SPFILE)伺服器
- 從備份片中恢復某個指定得歸檔或者資料檔案
- 【RMAN】Oracle12c以後rman 備份恢復命令參考Oracle
- 【RMAN】在多租戶環境下的RMAN備份及恢復
- 【RMAN】Oracle中如何備份控制檔案?備份控制檔案的方式有哪幾種?Oracle
- 透過RMAN備份standby database成功恢復還原Database
- RMAN備份恢復典型案例——資料庫卡頓資料庫
- Oracle使用備份檔案集恢復歸檔日誌Oracle
- oracle 增量備份恢復驗證Oracle
- 檔案的基本管理和XFS檔案系統備份恢復
- 如何備份及恢復Linux檔案許可權Linux
- RMAN備份恢復典型案例——跨平臺遷移pdb
- RAC備份恢復之Voting備份與恢復
- RMAN恢復實踐
- 從dataguard備份的恢復機制
- Oracle9i RMAN 的優缺點及RMAN 備份及恢復步驟Oracle
- Windows oracle 11g rman備份恢復到linux系統WindowsOracleLinux