1、主库采用热克隆的方式创建orclpdb2
SQL> create pluggable database orclpdb2 from orclpdb;
Pluggable database created.
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB2 MOUNTED
4 ORCLPDB READ WRITE NO
SQL> alter pluggable database orclpdb2 open;
Pluggable database altered.
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB2 READ WRITE NO
4 ORCLPDB READ WRITE NO
SQL> alter system switch logfile;
2、查看备库:
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB2 MOUNTED
4 ORCLPDB MOUNTED
备库打开orclpdb2
SQL> alter pluggable database orclpdb2 open;
alter pluggable database orclpdb2 open
*
ERROR at line 1:
ORA-65011: Pluggable database ORCLPDB2 does not exist.
SQL>
此时alter日志报错:
2017-08-28T18:25:25.750191+08:00
Errors in file /u01/app/oracle/diag/rdbms/dg_standby/sztech/trace/sztech_mrp0_66563.trc:
ORA-01274: cannot add data file that was originally created as '+DGDATA/SZTECH/57CE1CD8388BB670E05384E5A8C0D4DD/DATAFILE/system.264.953230989'
ORA-01565: error in identifying file '/u01/app/oracle/oradata/DG_STANDBY/57ce1cd8388bb670e05384e5a8c0d4dd/datafile/system.264.953230989'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2017-08-28T18:25:25.750353+08:00
MRP0: Background Media Recovery process shutdown (sztech)
启动备库的日志恢复进程,发现无法启动:
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY
SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ ONLY
SQL>
出现这种错误是由于在主库创建orclpdb2的时候,采用的是热克隆的方式。语句如下:
SQL> create pluggable database orclpdb2 from orclpdb;
Pluggable database created.
这种方式创建的pdb共享一个数据文件存放目录。数据文件位置如下:
SQL> select con_id,name from v$datafile;