Swapping synonyms between tow tables every week
Hi AIl,
I have two tables, A and B. I need to switch loading these tables. If we load A today, the following
week we would have to load B.
There is a public synonym "C" that sits on top of these two tables.
1) To Find out which table is in use right now..
SELECT *
FROM ALL_SYNONYMS
WHERE SYNONYM_NAME = "C"
2) Truncate opposite table/Drop opposite table
3) Load data into 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 shell script or PL/SQL?
Please advice.A little eheadstart would be great.
Message was edited by:
CrackerJack