I need some help from Oracle and UNIX expertise point of view.
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..
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 shell script? Please advice.