My Oracle Support Banner

Public Synonym Seems Not To Work (Doc ID 1359627.1)

Last updated on JANUARY 22, 2020

Applies to:

Oracle Database - Enterprise Edition - Version 9.0.1.0 to 11.2.0.2 [Release 9.0.1 to 11.2]
Information in this document applies to any platform.

Symptoms

After creating a Public synonym, the number of rows returned (for another user) is different than when selecting from the table itself.

Public synonym created as user XXX on table GENERIC_TEST

SQL> CREATE PUBLIC SYNONYM GENERIC_TEST FOR XXX.GENERIC_TEST;

SQL> select * from dba_synonyms where SYNONYM_NAME = 'GENERIC_TEST';

OWNER SYNONYM_NAME
------------------------------ ------------------------------
TABLE_OWNER TABLE_NAME
------------------------------ ------------------------------
DB_LINK
-------------------------------------------------------------
PUBLIC GENERIC_TEST
XXX GENERIC_TEST



Logon as user XXXDEV.

0 rows returned when using public synonym GENERIC_TEST

SQL> select count(*) from GENERIC_TEST;

COUNT(*)
----------
0



Many rows are returned when selecting from table XXX.GENERIC_TEST

SQL> select count(*) from XXX.GENERIC_TEST;

COUNT(*)
----------
4122689

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Changes
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.