ORACLE DG物理備庫(kù)使用別名數(shù)據(jù)文件改變路徑到OMF路徑
比如我的備庫(kù)大部分?jǐn)?shù)據(jù)文件在 +DATA/neworcl/datafile/,但有兩個(gè)數(shù)據(jù)文件在 +data/orcl/datafile/
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 27720 SYSTEM *** +
DATA/neworcl/datafile/system.302.1104437785
...
82 15360 TSP_ORDADM *** +
DATA/orcl/datafile/tsp_ordadm.01.dbf
83 15360 TSP_OUTPBILL *** +
DATA/orcl/datafile/tsp_outpbill
...
SQL> show parameter db_create_file_dest
NAME TYPE VALUE
------------------------------------ -----------?------------------------------
db_create_file_dest string +DATA
SQL> show parameter db_unique_name
NAME TYPE VALUE
------------------------------------ -----------?------------------------------
db_unique_name string neworcl
現(xiàn)在 想把這兩個(gè)文件放在統(tǒng)一的位置去,可以使用下面辦法:
1.修改standby_file_management參數(shù)
alter system set standby_file_management='manual';
2.備庫(kù)啟動(dòng)到mount狀態(tài)
shutdown immediate
startup mount
3.拷貝數(shù)據(jù)文件到目標(biāo)路徑下
backup as copy datafile 82 format ='+data';
backup as copy datafile 83 format ='+data';
4.切換到新路徑下
switch datafile 82,83 to copy;
5.遷移部分?jǐn)?shù)據(jù)文件后可打開(kāi)數(shù)據(jù)庫(kù)
alter database open;
recover managed standby database disconnect from session;
6.查看數(shù)據(jù)文件
report schema ;
...
82 15360 TSP_ORDADM *** +
DATA/neworcl/datafile/tsp_ordadm.377.1104445045
83 15360 TSP_OUTPBILL *** +
DATA/neworcl/datafile/tsp_outpbill.378.1104445095
...
7.修改standby_file_management參數(shù)
alter system set standby_file_management='AUTO';
