Oracle 19c PDB克隆后出现Warning: PDB altered with errors受限模式处理
在进行一次19c PDB克隆过程中,发现克隆结束,在打开后出现了报错,PDB变成受限模式,以下是分析处理过程
09:25:48 SQL> alter pluggable database test1113 open instances=all;
Warning: PDB altered with errors.
Elapsed: 00:00:28.91
09:26:31 SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 MB_UTF MOUNTED
4 TEST1113 READ WRITE YES
报错处理:
源库组件安装信息:
NAME CAUSE TYPE MESSAGE STATUS
-------------------- ---------- ---------- -------------------------------------------------- ------------------
PDB$SEED SQL Patch ERROR '19.3.0.0.0 Release_Update 1904101227' is installe RESOLVED
d in the CDB but no release updates are installed
in the PDB
目标库组件报错信息:
NAME CAUSE TYPE MESSAGE STATUS
-------------------- ---------- ---------- -------------------------------------------------- ---------
TEST1113 OPTION ERROR Database option DV mismatch: PDB installed version PENDING
19.0.0.0.0. CDB installed version NULL.
TEST1113 OPTION ERROR Database option OLS mismatch: PDB installed versio PENDING
n 19.0.0.0.0. CDB installed version NULL.
TEST1113 Sync Failu WARNING Sync PDB failed with ORA-04068 while performing 'D PENDING
re ROP USER "C##CLONES_HLW"'
TEST1113 Parameter WARNING CDB parameter processes mismatch: Previous 10000 C RESOLVED
urrent 12800
TEST1113 Parameter WARNING CDB parameter sga_max_size mismatch: Previous 200G RESOLVED
Current 140G
TEST1113 Parameter WARNING CDB parameter pga_aggregate_target mismatch: Previ RESOLVED
ous 50G Current 80G
TEST1113 SQL Patch ERROR '19.15.0.0.0 Release_Update 2203311254' is install PENDING
ed in the CDB but '19.3.0.0.0 Release_Update 19041
01227' is installed in the PDB
TEST1113 Oracle Opa WARNING Oracle opatch mismatch: opatch 29517242 is missing RESOLVED
tch in the CDB.
查看补丁信息:
源库:
ACTION_TIME ACTION NAMESPACE VERSION ID COMMENTS BUNDLE_SER
------------------------------ -------------------- ---------- ---------- ---------- ---------------------------------------- ----------
BOOTSTRAP DATAPATCH 19 RDBMS_19.3.0.0.0DBRU_LINUX.X64_190417
15-JAN-21 02.36.47.217674 PM RU_APPLY SERVER 19.0.0.0.0 Patch applied on 19.3.0.0.0: Release_Upd
ate - 190410122720
目标库:
ACTION_TIME ACTION NAMESPACE VERSION ID COMMENTS BUNDLE_SER
------------------------------ -------------------- ---------- ---------- ---------- ---------------------------------------- ----------
BOOTSTRAP DATAPATCH 19 RDBMS_19.3.0.0.0DBRU_LINUX.X64_190417
15-JAN-21 02.47.36.759370 PM RU_APPLY SERVER 19.0.0.0.0 Patch applied on 19.3.0.0.0: Release_Upd
ate - 190410122720
原库组件:19.3版本
CDB:
COMP_ID COMP_NAME VERSION_FULL
------------------------------------------------------------ ---------------------------------------- ------------------------------------------------------------
CATALOG Oracle Database Catalog Views 19.3.0.0.0
CATPROC Oracle Database Packages and Types 19.3.0.0.0
RAC Oracle Real Application Clusters 19.3.0.0.0
JAVAVM JServer JAVA Virtual Machine 19.3.0.0.0
XML Oracle XDK 19.3.0.0.0
CATJAVA Oracle Database Java Packages 19.3.0.0.0
APS OLAP Analytic Workspace 19.3.0.0.0
XDB Oracle XML Database 19.3.0.0.0
OWM Oracle Workspace Manager 19.3.0.0.0
CONTEXT Oracle Text 19.3.0.0.0
ORDIM Oracle Multimedia 19.3.0.0.0
SDO Spatial 19.3.0.0.0
XOQ Oracle OLAP API 19.3.0.0.0
OLS Oracle Label Security 19.3.0.0.0
DV Oracle Database Vault 19.3.0.0.0
15 rows selected.
PDB:
COMP_ID COMP_NAME VERSION_FULL
------------------------------------------------------------ ---------------------------------------- ------------------------------------------------------------
CATALOG Oracle Database Catalog Views 19.3.0.0.0
CATPROC Oracle Database Packages and Types 19.3.0.0.0
RAC Oracle Real Application Clusters 19.3.0.0.0
JAVAVM JServer JAVA Virtual Machine 19.3.0.0.0
XML Oracle XDK 19.3.0.0.0
CATJAVA Oracle Database Java Packages 19.3.0.0.0
APS OLAP Analytic Workspace 19.3.0.0.0
XDB Oracle XML Database 19.3.0.0.0
OWM Oracle Workspace Manager 19.3.0.0.0
CONTEXT Oracle Text 19.3.0.0.0
ORDIM Oracle Multimedia 19.3.0.0.0
SDO Spatial 19.3.0.0.0
XOQ Oracle OLAP API 19.3.0.0.0
OLS Oracle Label Security 19.3.0.0.0
DV Oracle Database Vault 19.3.0.0.0
目标库组件:19.15版本
CDB:
COMP_ID COMP_NAME VERSION_FULL
------------------------------ ---------------------------------------- ------------------------------
CATALOG Oracle Database Catalog Views 19.15.0.0.0
CATPROC Oracle Database Packages and Types 19.15.0.0.0
RAC Oracle Real Application Clusters 19.15.0.0.0
JAVAVM JServer JAVA Virtual Machine 19.15.0.0.0
XML Oracle XDK 19.15.0.0.0
CATJAVA Oracle Database Java Packages 19.15.0.0.0
APS OLAP Analytic Workspace 19.15.0.0.0
XDB Oracle XML Database 19.15.0.0.0
OWM Oracle Workspace Manager 19.15.0.0.0
CONTEXT Oracle Text 19.15.0.0.0
ORDIM Oracle Multimedia 19.15.0.0.0
SDO Spatial 19.15.0.0.0
XOQ Oracle OLAP API 19.15.0.0.0
13 rows selected.
PDB:
COMP_ID COMP_NAME VERSION_FULL
------------------------------ ---------------------------------------- ------------------------------
CATALOG Oracle Database Catalog Views 19.3.0.0.0
CATPROC Oracle Database Packages and Types 19.3.0.0.0
RAC Oracle Real Application Clusters 19.3.0.0.0
JAVAVM JServer JAVA Virtual Machine 19.3.0.0.0
XML Oracle XDK 19.3.0.0.0
CATJAVA Oracle Database Java Packages 19.3.0.0.0
APS OLAP Analytic Workspace 19.3.0.0.0
XDB Oracle XML Database 19.3.0.0.0
OWM Oracle Workspace Manager 19.3.0.0.0
CONTEXT Oracle Text 19.3.0.0.0
ORDIM Oracle Multimedia 19.3.0.0.0
SDO Spatial 19.3.0.0.0
XOQ Oracle OLAP API 19.3.0.0.0
OLS Oracle Label Security 19.3.0.0.0
DV Oracle Database Vault 19.3.0.0.0
15 rows selected.
通过对比查看到,已经克隆的PDB组件要多余目标CDB的。而这些不存在的组件为无效组件。这种情况有一个简单有效的方法是,将无效的组件从PDB的注册中删除。具体方法如下:
delete from sys.registry$ where cid in ('OLS','DV');
commit;
对于版本PDB补丁不一致问题,针对于单个的PDB进程补丁安装:
datapatch -verbose -pdb TEST1113
处理后,重启PDB,变成正常非受限模式。