1 person found this helpful
Is it possible to export public synonym with the help of expdp utility?
If not, what is the reason behind this?
PUBLIC is a weird critter inside Oracle.
PUBLIC is not a USER.
PUBLIC is not an object.
PUBLIC is not a ROLE.
PUBLIC can not be exported.
all application SQL, including DDL, should reside within source code repository.
extract desired DDL for PUBLIC from it.
public synonyms can be extracted on their own by using :
expdp / full=y include=PUBLIC_SYNONYM/SYNONYM
Full database exports include then by default
No it is not possible. You can run the following scriptm spool it and run it on a desired database
select 'create public synonym ' || synonym_name ||
' for ' || table_owner || '.' || table_name || ';'
where owner = 'PUBLIC'
and table_owner = 'THAT USER'
Also, if you want to export using expdp, you can read the following link
I am confused ,there are both responses yes and no.
Aman/Hemant sir please put your valuable comments here.
You could have just tried the code i sent to prove that it indeed does work..... I've done that for you in a blog post - see this link for a worked example:
Why are you confused? Did you see the link I mentioned above or Richard gave you. The synatx to export public objects right in there. What else you need? Have you tried? Stop getting confused and ust try the method given in the link. We told you couple of ways to do that.
INCLUDE=PUBLIC_SYNONYM/SYNONYM:"IN(SELECT synonym_name FROM dba_synonyms WHERE table_owner='TEST')"