I'm creating a new staging database, into which I intend to migrate several tables from the old database. These tables are referenced in functions and stored procedures. If I were doing things manually, I would just migrate the tables, and then modify the functions by replacing the old table name with the new table name. I'm thinking there must be a more automated way of doing this though.

Has anyone done something similar; what tools have you used to help refactor?


Replace the tables in the old database with synonyms that point to the location in the new database.

This not only minimizes the code change, it gives you a single place to manage the references to objects in other databases.

  • +1 for an elegant answer - we used to do something like this for customisations - we only wanted to pay for one Oracle (sorry :-) ) dev server licence so we used synonyms to point to different tables for different clients - all on the one server! I honestly don't know if it was worth it - a real PITA to administer! Time = money too! – Vérace Apr 5 '18 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.