Oracle19c中环境变量ORACLE_PDB_SID对dbca和RU打补丁的影响

 

Oracle19c中环境变量ORACLE_PDB_SID对dbca和RU打补丁的影响

 

假设需要dbca创建一个cdb为oemdb,pdb为empdbrepos。

同时,环境变量已经设置了ORACLE_PDB_SID=empdbrepos的情况下进行dbca,会导致dbca报错如下:

ORA-65118: operation affecting a pluggable database cannot be performedfrom another pluggable database

防爬虫:https://www.cnblogs.com/PiscesCanon/p/17407747.html

因为设置ORACLE_PDB_SID=empdbrepos,同时empdbrepos这个pdb是存在的话,会导致通过OS认证直接登录数据库后身份就是empdbrepos。

dbca过程会对PDB$SEED做打开关闭操作,所以会报错ORA-65118

[oracle@oem13c ~]$ export ORACLE_PDB_SID=empdbrepos
[oracle@oem13c ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed May 17 09:30:18 2023
Version 19.19.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0

09:30:19 SYS@oemdb(39)> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 EMPDBREPOS                     READ WRITE NO


--设置一个不存在的pdb,OS认证登录则不成功,登录身份仍是CDB$ROOT
[oracle@oem13c ~]$ export ORACLE_PDB_SID=noexixtsPDB
[oracle@oem13c ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed May 17 09:31:00 2023
Version 19.19.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0

09:31:01 SYS@oemdb(277)> show pdbs;

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

 

 

在设置ORACLE_PDB_SID=empdbrepos,同时empdbrepos这个pdb存在的情况下,

应用RU补丁也会导致失败。

从日志/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_12062_2023_05_07_01_30_34/sqlpatch_invocation.log可以看到:

[2023-05-07 01:30:34] Connecting to database...[2023-05-07 01:30:34] OK
[2023-05-07 01:30:34] Gathering database info...catcon::set_log_file_base_path: ALL catcon-related output will be written to [/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_12062_2023_05_07_01_30_34/sqlpatch_catcon__catcon_12062.lst]

catcon::set_log_file_base_path: catcon: See [/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_12062_2023_05_07_01_30_34/sqlpatch_catcon_*.log] files for output generated by scripts

catcon::set_log_file_base_path: catcon: See [/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_12062_2023_05_07_01_30_34/sqlpatch_catcon__*.lst] files for spool files, if any

catcon::catconInit2: EZConnect string =  (Instance oemdb)
    points to a Container with CON_ID of 3 instead of the Root


[2023-05-07 01:30:34] Error: prereq checks failed!
[2023-05-07 01:30:34] catconInit failed with 1
[2023-05-07 01:30:34]
Please refer to MOS Note 1609718.1 and/or the invocation log
[2023-05-07 01:30:34] /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_12062_2023_05_07_01_30_34/sqlpatch_invocation.log[2023-05-07 01:30:34]
for information on how to resolve the above errors.

[2023-05-07 01:30:34] SQL Patching tool complete on Sun May  7 01:30:34 2023

 

从“points to a Container with CON_ID of 3 instead of the Root”可以大致也可以猜出。

mos文档也有关于这个错误的说明:

datapatch fails with " prereq checks failed " and " catconInit failed with 1 " error (文档 ID 2882243.1)

Datapatch failed with "catconInit failed with 1" (文档 ID 2879072.1)

posted @ 2023-05-17 10:24  PiscesCanon  阅读(297)  评论(0编辑  收藏  举报