Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Private synonym <unknown obj type>

915879May 21 2012 — edited May 21 2012
Hi,

I'm making a script, that makes private synonyms for the new database schema "ABC", for our existing schemas.

part of the script is:

SELECT * FROM (
SELECT owner, object_name FROM all_objects WHERE owner IN ('ETL') AND object_type IN ('TABLE', 'VIEW') AND object_name NOT LIKE '%$%' MINUS(
SELECT table_owner, table_name FROM all_synonyms WHERE UPPER(owner) IN ('PUBLIC', 'ABC')
AND UPPER(table_owner) IN ('ETL'))

r_synonym sys.all_objects%ROWTYPE;

--
FOR r_synonym IN table_synonyms
LOOP
EXECUTE IMMEDIATE 'CREATE OR REPLACE SYNONYM ABC.'||r_synonym.object_name ||' FOR '||r_synonym.owner||'.'||r_synonym.object_name;
END LOOP;

Now, the synonym gets created, but the info shows me "<unknown obj type>" and as you can expect, the synonym doesn't work (even though it's created).

Any ideas?
Thx
This post has been answered by Marwim on May 21 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2012
Added on May 21 2012
2 comments
846 views