Warning: PDB altered with errors pdb RESTRICTED

1. 环境  oracle linux 7.9, oracle 19c rac

打patch升级到19.14后打开pdb 报错,PDB状态受限

SQL> alter pluggable database pdb1 open;

Warning: PDB altered with errors.

SQL>
SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE YES

2 查看pdb log 

set lin 200 

col name for a10 

 col cause for a20 

 col message for a100 

 select name,cause,type,message,status from pdb_plug_in_violations order by name;



NAME CAUSE TYPE MESSAGE STATUS
---------- -------------------- --------- ---------------------------------------------------------------------------------------------------- ---------
PDB1 SQL Patch ERROR '19.14.0.0.0 Release_Update 2112251221' is installed in the CDB but '19.3.0.0.0 Release_Update 19041 PENDING
01227' is installed in the PDB

'19.3.0.0.0 Release_Update 1904101227' is installed in the CDB but no release updates are installed in the PDB
'19.14.0.0.0 Release_Update 2112251221' is installed in the CDB but '19.3.0.0.0 Release_Update 1904101227' is installed in the PDB

看log可以看出是因为cdb和pdb release不一致

这个是因为打完patch 后datapatch -verbose时 pdb没有open 导致pdb没有打上patch

3.解决方案

解决办法办法如下:

 确认两个节点的pdb都是open状态 然后重新datapatch -verbose

datapatch -verbose
SQL Patching tool version 19.14.0.0.0 Production on Mon Dec 12 10:14:39 2022
Copyright (c) 2012, 2021, Oracle. All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_27900_2022_12_12_10_14_39/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done

Note: Datapatch will only apply or rollback SQL fixes for PDBs
that are in an open state, no patches will be applied to closed PDBs.
Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
(Doc ID 1585822.1)

Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
No interim patches found

Current state of release update SQL patches:
Binary registry:
19.14.0.0.0 Release_Update 211225122123: Installed
PDB CDB$ROOT:
Applied 19.14.0.0.0 Release_Update 211225122123 successfully on 10-DEC-22 09.56.18.746359 PM
PDB PDB$SEED:
Applied 19.14.0.0.0 Release_Update 211225122123 successfully on 10-DEC-22 09.56.23.185256 PM
PDB PDB1:
Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 10-DEC-22 06.28.10.803500 PM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
For the following PDBs: CDB$ROOT PDB$SEED
No interim patches need to be rolled back
No release update patches need to be installed
No interim patches need to be applied
For the following PDBs: PDB1    ------这里就是升级pdb
No interim patches need to be rolled back
Patch 33515361 (Database Release Update : 19.14.0.0.220118 (33515361)):
Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.14.0.0.0 Release_Update 211225122123
No interim patches need to be applied

Installing patches...
Patch installation complete. Total patches installed: 1

Validating logfiles...done
Patch 33515361 apply (pdb PDB1): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33515361/24589353/33515361_apply_NOVOSIT_PDB1_2022Dec12_10_15_00.log (no errors)

Automatic recompilation incomplete; run utlrp.sql to revalidate.
PDBs: PDB1

SQL Patching tool complete on Mon Dec 12 10:19:37 2022
[oracle@hostname ~]$

完成后 关闭pdb 然后重新打开,pdb状态正常了

SQL> alter pluggable database pdb1 close immediate;

Pluggable database altered.

SQL>
SQL> alter pluggable database pdb1 open ;

Pluggable database altered.

SQL>
SQL> show pdbs;

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 PDB1 READ WRITE NO
SQL>
SQL>

后记 如果升级失败可以使用如下命令来强制更新pdb的ru

datapatch -verbose -apply  ru_id -force -pdbs PDB1

  • 8
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

潇湘秦

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值