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/23732248/viewspace-2757978/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle DG備庫手動管理新增資料檔案Oracle
- oracle dg庫資料檔案空間不足Oracle
- [20180718]拷貝資料檔案從dg庫.txt
- dg主庫建立檔案備庫未同步解決方法
- 如何恢復在全備後新增了資料檔案的資料庫資料庫
- MySQL8.0.18資料庫新增資料檔案MySql資料庫
- Oracle DG管理資料庫屬性Oracle資料庫
- oracle dg庫資料檔案建立失敗ORA-01111Oracle
- 非OMF管理 自動新增資料檔案add_datafiles.sh
- oracle uncatalog資料庫備份檔案Oracle資料庫
- [20190410]dg建立臨時表檔案資料檔案.txt
- OMF管理自動新增資料檔案指令碼add_datafile.sh指令碼
- Dedecms備份的資料檔案位置及備份資料庫的方法資料庫
- SQL SERVER備份資料庫檔案(使用SSMS)SQLServer資料庫SSM
- Laravel 資料庫及專案檔案自動備份指北 (spatie/Laravel-backup)Laravel資料庫
- 遠端備份資料庫和檔案的方法資料庫
- SQL資料庫備份管理SQL資料庫
- ORACLE DG之備庫角色Oracle
- 達夢資料庫手動管理統計資訊方法資料庫
- 8種手動和自動備份MySQL資料庫的方法MySql資料庫
- [重慶思莊每日技術分享]-ORACLE DG物理備庫使用別名資料檔案改變路徑到OMF路徑Oracle
- 織夢資料庫配置檔案-DedeCMS織夢資料庫檔案在哪裡資料庫
- Oracle ADG 備庫新增備庫Oracle
- 在DG備庫備份資料庫並恢復到一個主機上,報錯RMAN-06820資料庫
- 【DG】備庫RMAN還原方式搭建DG(不使用duplicate命令)
- win10系統怎麼在資源管理器中新增庫檔案Win10
- Mysql資料庫自動備份MySql資料庫
- 雲備份和同步檔案資料
- oracle 新增儲存自動擴充套件資料檔案流程(auto)Oracle套件
- Oracle資料檔案和臨時檔案的管理Oracle
- Oracle DG資料庫狀態轉換Oracle資料庫
- dg_閃回資料庫實驗資料庫
- Sqlserver資料庫使用 .bak 檔案還原資料庫SQLServer資料庫
- DG備庫未啟動SCN 新特性引起ORA-600 2252
- IndexedDB 資料庫新增資料Index資料庫
- 【DG】Data Guard主備庫Failove切換AI
- 【DG】Data Guard主備庫Switchover切換
- ORACLE DG從庫 Rman備份恢復Oracle