Warning: PDB altered with errors---将数据库从mount状态打开到open状态报错。
1.根据业务需求,创建一个新的pdb,并将这个pdb打开到open状态。创建语法如下:
CREATE PLUGGABLE DATABASE JYLS ADMIN USER JYLCUSER IDENTIFIED BY JYLCUSER FILE_NAME_CONVERT = ('+DATA/LCHXDB/69BE120D59281D72E0530120730AE779/', '+DATA'); STORAGE (MAXSIZE 2G);
2.常见pdb成功之后,在进行open操作时,提示错误
Warning: PDB altered with errors
3.查看新建pdb的状态
SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 LSZD READ WRITE NO 4 JYLS READ WRITE YES
在打开数据库的时候有警告提示,因此pdb只能以RESTRICTED模式打开pdb数据库
4.通过视图查看打开pdb发生警告的原因
SQL>select name,cause,type,message,status from PDB_PLUG_IN_VIOLATIONs order by name
Sync PDB failed with ORA-959 during 'alter user c##ogguser default tablespace ggstbs'
RESOLVED
JYLS OPTION WARNING
Database option ORDIM mismatch: PDB installed version NULL. CDB installed version 12.2.0.1.0.
PENDING
提示同步pdb失败,找不到全局使用使用的表空间ggstbs。
这里的c##ogguser用户是之前创建的一个ogg同步用户,将10GR2用户数据通过ogg进行抽取到12CR2
5.创建ggstbs表空间
alter tablespace ggstbs datafile '+DATA' size 200M autoextend on;
6.重新启动pdb,并查看状态。pdb数据库正常打开
alter pluggable database jyls close; alter pluggable database jyls open; SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 LSZD READ WRITE NO 4 JYLS READ WRITE NO