|
使用duplicate复制主库到备库,以read only模式打开备库的pdb提示如下:
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
4 ORCLPDB MOUNTED
SQL> alter pluggable database orclpdb open read only;
alter pluggable database orclpdb open read only
*
ERROR at line 1:
ORA-65085: cannot open pluggable database in read-only mode
进一步查看orclpdb的状态
SQL> select pdb_name,status from dba_pdbs;
PDB_NAME STATUS
-------------------------------------------------------------------------------------------------------------------------------- ----------
PDB$SEED NORMAL
ORCLPDB NEW
关于pdb状态为new的说明:
NEW - The PDB has never been opened since it was created.
It must be opened in READ WRITE mode for Oracle to perform processing needed to complete the integration of the PDB into the CDB and mark it NORMAL.
An error will be thrown if an attempt is made to open the PDB read only.
原因分析:
主库的orclpdb为手工新建的,创建后一直没open过,导致复制到备库无法open.
解决办法:在主库打开该pdb,然后关闭。之后重新duplicate到备库。
再次在备库open,成功,如下:
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
4 ORCLPDB MOUNTED
SQL> alter pluggable database orclpdb open;
Pluggable database altered.
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
4 ORCLPDB READ ONLY NO
SQL>
如果主库的pdb为read write模式,duplicate到备库后,open数据库会提示错误,如下:
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MOUNTED
4 ORCLPDB MOUNTED
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-10458: standby database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1:
'/u01/app/oracle/oradata/DG_STANDBY/datafile/o1_mf_system_dt7l4dx3_.dbf'
|
|