重庆思庄Oracle、KingBase、PostgreSQL、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 476|回复: 0
打印 上一主题 下一主题

[Oracle] Compiling a Public Synonym in a Pluggable Database (PDB) fails with ORA-65047...

[复制链接]
跳转到指定楼层
楼主
发表于 2025-8-24 18:36:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
现象:
Trying to compile a public synonym in pluggable database (PDB):

alter public synonym <PACKAGE_NAME> compile;
fails in SQL*Plus with:

ORA-65047: Object PUBLIC.<PACKAGE_NAME> is invalid or compiled with errors
And the following error occurs in the alert log:

ORA-07445: exception encountered: core dump [csyalt()+608] [SIGSEGV] [ADDR:0x0] [PC:0x41BCC70] [Address not mapped to object] []


The Call Stack Trace in the associated incident trace file shows:

csyalt <- opiexe <- opiosq0 <- kpooprx <- kpoal8 <- opiodr <- ttcpip <- opitsk <- opiino <- opiodr
<- opidrv <- sou2o <- opimai_real <- ssthrdmain <- main


This can also occur when applying a datapatch.

Datapatch fails with error:
Patch XXX apply (pdb PDBWITH ERRORS
logfile: <log file locatoin>/<patch>_apply_<DB>_<PDB>_<timestamp>.log (errors)
Error at line 24145: ORA-65047: Object PUBLIC.APEX_PKG_APP_INSTALL_LOG is invalid or compiled with errors in root.
ORA-06512: at "SYS.DBMS_UTILITY", line 1314
ORA-06512: at line 8
ORA-06512: at line 8


原因:
The normal:

     ALTER <OBJECT_TYPE> <OBJECT_NAME> COMPILE;

command will not work on a PDB.

This issue is not caused by a product defect.



处理方法:
Use the DBMS_PDB.EXEC_AS_ORACLE_SCRIPT API to resolve this issue.  This procedure enables execution of certain restricted statements (most DDLs) on metadata-linked objects from within a PDB.

For example:

SQL> exec dbms_pdb.exec_as_oracle_script('CREATE OR REPLACE PUBLIC SYNONYM <PACKAGE_NAME> FOR SYS.<PACKAGE_NAME>');
PL/SQL procedure successfully completed.

SQL> select owner, object_name, object_type, status from dba_objects where object_name = '<PACKAGE_NAME>';

OWNER           OBJECT_NAME                           OBJECT_TYPE    STATUS
--------------- ------------------------------------- -------------- ----------
PUBLIC          <PACKAGE_NAME>                        SYNONYM        VALID
<OWNER>         <PACKAGE_NAME>                        VIEW           VALID

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2026-4-17 21:21 , Processed in 0.244860 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表