How to exclude public synonyms from an Oracle DB Import
Hello,
I am trying to import a database excluding public synonyms using impdp. A colleague gave me the following line to add to my impdp command, but it results in a syntax error:
Code:
INCLUDE=SYNONYM:"IN(SELECT synonym_name FROM dba_synonyms WHERE 1=0)"
LRM-00116: syntax error at ')' following '0'
So EXCLUDE=dba_synonyms is what I am looking to add?
Sorry for my lack of knowledge, the DBA is gone for 3 weeks on vacation (will be back in early Jan.). He taught me the basics on how to import data with impdp, so Ive been fine untill now. But now this user is asking for something specific and I cannot deliver, and it seems it will be easy enough to add and not make them wait.
No, it should just be "synonym" (metadata, not data). You're not excluding the dba_synonyms data dictionary view, but (private) synonyms as a whole. Public synonyms should still be accessible.
Code:
1 SELECT OBJECT_PATH, COMMENTS FROM SCHEMA_EXPORT_OBJECTS
2* WHERE OBJECT_PATH LIKE '%SYN%' AND OBJECT_PATH NOT LIKE '%/%'
SQL> /
OBJECT_PATH
------------------------------------------------------------------
COMMENTS
------------------------------------------------------------------
SYNONYM
Private synonyms in the selected schemas
If you are doing a full database import you should NOT exclude public synonyms, otherwise if you are just importing one or more schema(s), then no public synonyms should be created.
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
If you are doing a full database import you should NOT exclude public synonyms, otherwise if you are just importing one or more schema(s), then no public synonyms should be created.
Generally I just import one schema, and one tablespace, and remap them. So I guess I should be good.
Bookmarks