Private synonym <unknown obj type>
915879May 21 2012 — edited May 21 2012Hi,
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