Email: service@parnassusdata.com 7 x 24 online support!
ORACLE 在DG环境下的PDB Clone
如果自己搞不定可以找诗檀软件专业ORACLE数据库修复团队成员帮您恢复!
诗檀软件专业数据库修复团队
服务热线 : 13764045638 QQ号:47079569 邮箱:service@parnassusdata.com
适用于
Oracle数据库 – 企业版 - 12.1.0.1到12.1.0.2 版本
本文档适用于任何平台
目标
本文档介绍预防措施和PDB在主库端关闭的故障排除方法。
解决方案
CASE- I : Primary and Standby have same directory structure
(主机和备机有相同的目录结构)
创建在PDB克隆命令中file_name_convert提到的目录。
例如,
CREATE PLUGGABLE DATABASE pdbboston
ADMIN USER pdb1 IDENTIFIED BY pdb1
FILE_NAME_CONVERT = ('/oradata/boston/pdbseed/','/oradata/pdbboston/pdbseed/');
确保目录‘/oradata/pdbboston/pdbseed/' 在主库端和备库端都存在。
CASE - II : Primary and Standby have different file directory
(主机和备机的目录结构不一样)
1.创建新的目录
Ex,
On Standby if new PDB restored to /oradata/pdbchicago/pdbseed/
2. 在db_file_name_convert添加新的目录改变.
db_file_name_convert='<other directory changes>','<pdb directory changes>'
例如,
db_file_name_convert='boston','chicago','pdbboston','pdbchicago'
CASE - III
如果使用ASMCMD拷贝数据文件,数据文件用ASM存储。
复制目录应该是:
<db_create_file_dest>/<db_unique_name>/<GUID>/datafile
查找使用的conid,
select con_id,pdb,name from cdb_services;
查找使用的 GUID,
SQL>SELECT guid FROM V$CONTAINERS WHERE con_id=3;
CASE - IV
在备库如果文件目录结构不存在或者db_file_name_convert没有定义产生MRP崩溃与ORA-01111错误。
-----Standby Alert log "/alert_chicago.log"-------------
MRP0: Background Media Recovery terminated with error 1111
Errors in file /u01/app/oracle/diag/rdbms/chicago/chicago/trace/chicago_mrp0_12200.trc:
ORA-01111: name for data file 13 is unknown - rename to correct file
ORA-01110: data file 13: '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/UNNAMED00013'
ORA-01157: cannot identify/lock data file 13 - see DBWR trace file
ORA-01111: name for data file 13 is unknown - rename to correct file
ORA-01110: data file 13: '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/UNNAMED00013'
Managed Standby Recovery not using Real Time Apply
解决
----------------
在主库核实数据文件名。
select file#,name from v$datafile; <------------both primary and standby
在备库重新命名数据文件:
SQL>alter database rename file '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/UNNAMED00012' to '/oradata/pdbchicago/pdbseed/system01.dbf';
SQL>alter database rename file '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/UNNAMED00013' to '/oradata/pdbchicago/pdbseed/sysaux01.dbf';
or else do RMAN restore.
RMAN>run
{
set newname for datafile 13 to '/oradata/pdbchicago/pdbseed/sysaux01.dbf';
restore datafile 13;
}
启动MRP,
SQL>alter database recover managed standby database disconnect;