Using Oracle's Flashback Technology

Sometimes generating and using a baseline script is problematic for the following reasons.

  1. It might take a long time to execute due to a large number of schema objects, or a large number of migration scripts.
  2. It might be a legacy database that has invalid objects that can't be rebuilt from scratch. 

In these scenarios, using Oracle's Flashback technology to go back to a known good state is a good option. Only one person needs to configure this for your project.

Set up

  1. Make sure you can use the Flashback Technology on your shadow databases.  This may require different permissions.  

  2. Create the afterClean.sql callback.
    In your Flyway Project's migrations folder, create a new file called afterClean__Clone-using-Flashback.sql. (CallBack scripts are feature of Flyway which give you a lot of additional control when migrating changes. Write the code to restore your clone the following as an example.  This script should contain an Oracle script to reset the shadow to the Flashback point.   You can learn more about this on the Oracle docs.    

  3. Share the callback script with your team
    Save this file.  After testing, you'll want to commit/push this to your repository, so your team members can also use this clone as baseline feature.  


Get in touch with Redgate to learn more about this option.


Didn't find what you were looking for?