How to compile a PUBLIC SYNONYM and avoid ORA-00942 and ORA-00995 (Doc ID 759770.1)

Last updated on JANUARY 19, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.1 and later
Information in this document applies to any platform.
***Checked for relevance on 20-Sep-2016***

Goal

When you need to compile a synonym with the type PUBLIC SYNONYM and you use the common format for compiling the synonym, like the following examples, you will receive ORA-00942 or ORA-00995 errors :

SQL> alter SYNONYM "oracle/xml/xslt/XSLBuilder" compile;
alter SYNONYM "oracle/xml/xslt/XSLBuilder" compile
*
ERROR at line 1:
ORA-00942: table or view does not exist

-- OR

SQL> alter SYNONYM PUBLIC.oracle/xml/xslt/XSLBuilder compile
              *
ERROR at line 1:
ORA-00995: missing or invalid synonym identifier

 

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms