Skip to main content

Creating Synonyms of Tables For Another Schema

Following command can be used for generating “create synonym” queries. schema2 is the newly added schema that needs to use synomym. schema1 is the old schema that holds tables.

select 'create synonym <schema2>.' || TABLE_NAME || ' for <schema1>.' || TABLE_NAME || ';' from dba_tables where owner='<schema1>'

Comments

Popular posts from this blog

Find and replace with sed command in Linux

Find and replace feature is always handy. It can turn into a torture when it comes to change or delete a simple constant string in a text file. There is a handy tool in linux for doing these kind of tihngs. Actually sed is not a text editor but it is used outside of the text file to make changes.