Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Switch Synonyms between two tables- Help

800691Sep 26 2010 — edited Sep 27 2010
I have two tables, METADATA_A and METADATA_B. I need to switch loading these tables. If we load METADATA_A today, the following
week we would have to load METADATA_B.

There is a public synonym "METADATA" that sits on top of these two tables.

1) Find out which table is in use right now..

Code:
SELECT *
FROM ALL_SYNONYMS
WHERE SYNONYM_NAME = "METADATA"

2) Truncate opposite table

3) Load opposite table

4) Validate by doing a count * on the table to check the rows loaded.

5) Finally, switch synonym

Can this be achieved using procedure. Please advice.



Thanks in advance,
Todd
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 25 2010
Added on Sep 26 2010
5 comments
2,890 views