Skip to Content

How to export synonyms?

Hello forum,

for creating a test instance we want to export catalog data from selected users/schemas including their synonyms. With loadercli the commands "export user catalog ..." or "export schema <dbuser> ..." don't extract the synoyms. And "export table synonyms ..." doesn't works either.

How can we export synonyms without exporting the data? Our version is on linux (64bit).



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Apr 15, 2011 at 03:18 PM

    Hi Thomas,

    you can't export synonyms at the moment. This is most likely a bug and I have to check this. I'll get back to you as soon as I found the reason. Unfortunately I even do not have a workaround for you.

    Sorry for the inconvenience.



    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Lars,

      I think, that our solution is a little bit too simple for a HowTo, but here it is:

      1. Get values:

      select synonymname, tableschemaname, tablename from synonyms where owner = '<dbuser>'

      2. Run loop with sql commands generated from extracted values:

      create synonym <synonymname> for <tableschemaname>.<tablename>

      An shorter alternative will be:

      select 'create synonym ' & synonymname & ' for ' & tableschemaname & '.' & tablename from synonyms where owner = '<dbuser>'

      That's all.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.