Oracle DG備庫手動管理新增資料檔案
Purpose
Describe how the standby_file_management parameter can be used with raw devices. In addition, describe how to recover from errors after they have occurred.
Using standby_file_management with Raw Devices
By setting the standby_file_management parameter to auto whenever new data files are added or dropped on the primary database the standby database will take the corresponding action. This is true as long as the standby is utilizing a file system. If the standby is utilizing raw devices for datafiles then the standby file management parameter will continue to work but manual intervention is needed. This manual intervention involves assuring that the raw devices exist prior to the standby performing recovery of the redo that will create the new datafile. Considering the example given below:
On the primary create a new tablespace where the datafile reside in a raw device. At the same time create the same raw device on the standby database:
SQL> create tablespace mts2 datafile '/dev/raw/raw100' size 1m;
Tablespace created.
SQL> alter system switch logfile;
System altered.
The standby is able to automatically add the datafile as the raw devices exist. The standby alert log shows:
Fri Apr 8 09:49:31 2005
Media Recovery Log /u01/MILLER/flash_recovery_area/MTS_STBY/archivelog/2005_04_08/o1_mf_1_7_15ffgt0z_.arc
Recovery created file /dev/raw/raw100
Successfully added datafile 6 to media recovery
Datafile #6: '/dev/raw/raw100'
Media Recovery Waiting for thread 1 sequence 8 (in transit)
However, if the raw device has been created on the primary but not on the standby then the MRP process will shutdown due to file creation errors. Consider the following:
On the primary:
SQL> create tablespace mts3 datafile '/dev/raw/raw101' size 1m;
Tablespace created.
SQL> alter system switch logfile;
System altered.
The standby host does not have the /dev/raw/raw101 raw device created. The standby alert log shows the following when recovering the archive:
Fri Apr 8 10:00:22 2005
Media Recovery Log /u01/MILLER/flash_recovery_area/MTS_STBY/archivelog/2005_04_08/o1_mf_1_8_15ffjrov_.arc
File #7 added to control file as 'UNNAMED00007'.
Originally created as:
'/dev/raw/raw101'
Recovery was unable to create the file as:
'/dev/raw/raw101'
MRP0: Background Media Recovery terminated with error 1274
Fri Apr 8 10:00:22 2005
Errors in file /u01/MILLER/MTS/dump/mts_mrp0_21851.trc:
ORA-01274: cannot add datafile '/dev/raw/raw101' - file could not be created
ORA-01119: error in creating database fi le '/dev/raw/raw101'
ORA-27041: unable to open file
Linux Error: 13: Permission denied
Additional information: 1
Some recovered datafiles maybe left media fuzzy
Media recovery may continue but open resetlogs may fail
Fri Apr 8 10:00:22 2005
Errors in file /u01/MILLER/MTS/dump/mts_mrp0_21851.trc:
ORA-01274: cannot add datafile '/dev/raw/raw101' - file could not be created
ORA-01119: error in creating database file '/dev/raw/raw101'
ORA-27041: unable to open file
Linux Error: 13: Permission denied
Additional information: 1
Fri Apr 8 10:00:22 2005
MTS; MRP0: Background Media Recovery process shutdown
ARCH: Connecting to console port...
Recovering From Errors
To correct the above issue you must first create the raw slice on the standby and assign permissions to the Oracle user. Then perform the following steps:
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/MILLER/MTS/system01.dbf
/u01/MILLER/MTS/undotbs01.dbf
/u01/MILLER/MTS/sysaux01.dbf
/u01/MILLER/MTS/users01.dbf
/u01/MILLER/MTS/mts.dbf
/dev/raw/raw100
/u01/app/oracle/product/10.1.0/dbs/UNNAMED00007
SQL> alter system set standby_file_management=manual;
SQL> alter database create datafile
2 '/u01/app/oracle/product/10.1.0/dbs/UNNAMED00007'
3 as
4 '/dev/raw/raw101';
Within the standby alert log you should see the following:
Fri Apr 8 10:09:30 2005
alter database create datafile
'/dev/raw/raw101' as '/dev/raw/raw101'
Fri Apr 8 10:09:30 2005
Completed: alter database create datafile
'/dev/raw/raw101' a
On the standby set standby_file_management to auto and restart managed recovery:
SQL> alter system set standby_file_management=auto;
SQL> recover managed standby database disconnect;
At this point recovery will correctly use the new raw device datafile and recovery will continue.
Considerations
- If raw device path names are not the same on the standby host as they are on the primary host you must use db_file_name_convert to convert the path names.
- The above steps only work with a database that is not making use of Oracle Managed Files.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31547506/viewspace-2926344/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DG備庫手動管理 新增資料檔案
- Oracle資料庫新增和移動控制檔案Oracle資料庫
- oracle dg庫資料檔案空間不足Oracle
- Oracle DG管理資料庫屬性Oracle資料庫
- oracle10g data guard(dg)__主庫重新命名資料檔案_在備庫上同步重新命名資料檔案Oracle
- DG備援資料檔案重新命名
- Oracle自動新增資料檔案過程Oracle
- oracle uncatalog資料庫備份檔案Oracle資料庫
- 在ORACLE移動資料庫檔案Oracle資料庫
- ORACLE 資料庫 ASM磁碟組上新增控制檔案Oracle資料庫ASM
- oracle資料庫移動資料檔案、日誌檔案和控制檔案Oracle資料庫
- rename備庫資料檔案
- 為資料庫新增控制檔案資料庫
- 如何恢復在全備後新增了資料檔案的資料庫資料庫
- ORACLE DG之備庫角色Oracle
- 在ORACLE中移動資料庫檔案Oracle資料庫
- ORACLE資料庫Dataguard dg brokerOracle資料庫
- dataguard之邏輯備庫移動資料檔案
- dg主庫建立檔案備庫未同步解決方法
- 叢集資料庫新增控制檔案資料庫
- 手動建立oracle資料庫Oracle資料庫
- Oracle 手動建立資料庫Oracle資料庫
- 【DG】備庫斷檔問題
- 無處不在的Oracle資料庫控制檔案備份Oracle資料庫
- 在ORACLE中移動資料庫檔案(轉)Oracle資料庫
- 自動備份Oracle資料庫Oracle資料庫
- 手動配置OEM管理資料庫資料庫
- MySQL8.0.18資料庫新增資料檔案MySql資料庫
- asm管理的dg資料檔案缺失的處理方法ASM
- 使用DG庫資料檔案建開發測試庫步驟
- oracle dg庫資料檔案建立失敗ORA-01111Oracle
- oracle手動刪除資料庫Oracle資料庫
- 手動刪除oracle資料庫Oracle資料庫
- 非OMF管理 自動新增資料檔案add_datafiles.sh
- Oracle ADG 備庫新增備庫Oracle
- ORACLE移動資料檔案Oracle
- 在ORACLE中移動資料庫檔案在(轉)Oracle資料庫
- 每天自動備份Oracle資料庫Oracle資料庫