Liquibase Enterprise was formerly known as Datical DB.

Configure Deployment Packager to Use the Oracle Flashback for Backup and Restore

This feature is available in v8.2 and later.

The default backup and restore method used during packaging requires you to download the Oracle client tools (expdp/impdp) and call them through the Oracle Full Client.

Alternatively, you can configure Deployment Packager to use the Oracle Flashback feature, eliminating the need to install the client and expdp/impdp.

Pre-requisites

  • Use Liquibase Enterprise 8.2 and higher

  • Flashback should be enabled and configured in Oracle Database instance

  • DATICAL_USER database connection user should have SYSBACKUP privileges

  • Ensure pluggable database will be restarted after a restart of the server or CDB

    alter pluggable database <pdb_name> open read write; -- configure the PDB to open automatically when the container is restarted alter pluggable database <pdb_name> save state;

Limitations

  • Flashback feature works ONLY for PDB database

    • You cannot perform Flashback against CDB database

  • Flashback feature works ONLY for Oracle 12.2, 18c, 19c

  • Flashback feature does not work for Oracle RDS

Enabling Flashback Database

First of all, you need to create folder, where flashback restore points will be stored.
For example:

mkdir <your_location_for_DB_RECOVERY_FILE_DEST>

** Better to create the folder somewhere in Oracle installation directory, we will sure that Oracle Database has read/write access to the folder in this case

Next step is to connect to Oracle Database using SQLPLUS and connection user with SYSDBA privileges.
After we successfully connected to Oracle Database, we need to perform the following SQL commands:

-- specify path where to store flashback restore points -- 'your_location_for_DB_RECOVERY_FILE_DEST' is absolute path to folder which we created in 1st step ALTER SYSTEM SET db_recovery_file_dest='your_location_for_DB_RECOVERY_FILE_DEST' scope=spfile; -- Depending on size of your PDB which will be backed up using flashback, -- you can increase size of restore point file ALTER SYSTEM SET db_recovery_file_dest_size=10g scope=spfile; -- Optionally, specify the length of the desired flashback window (in minutes) -- by setting the DB_FLASHBACK_RETENTION_TARGET initialization parameter. -- The default value for this parameter is 1440 minutes, -- which is one day. The following command specifies that the flashback window must be 3 days. ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320; SHUTDOWN IMMEDIATE; STARTUP MOUNT; ALTER DATABSAE ARCHIVELOG; ALTER DATABASE FLASHBACK ON;

Use the following command to check if Flashback Database is enabled for your target database:

 

Enable Flashback for Backup and Restore in datical project

To use the Oracle Flashback for Backup and Restore, set the databaseBackupRestoreMethod option in deployPackager.properties file:
databaseBackupRestoreMethod=BackupRestoreOracleFlashback

See: Use the Required deployPackager.properties File

 

Copyright © Liquibase 2012-2022 - Proprietary and Confidential