Skip to main content

Enabling and Disabling Flashback in 19c Database

Enabling and Disabling Flashback in 19c Database


Flashback in Oracle 19c is a feature that allows you to view and recover data at a specific point in time, providing a way to undo changes made to the database. It enables you to perform various operations such as querying historical data, recovering dropped tables, and reverting database changes.

To enable Flashback in an Oracle 19c database, you need to ensure the following pre-requisites

  • Database is running in ARCHIVELOG mode. Flashback requires the database to be in ARCHIVELOG mode to store and retrieve archived redo logs.

Error which we will get when enabling in non-archive mode.

ALTER DATABASE FLASHBACK ON
*
ERROR at line 1:
ORA-38706: Cannot turn on FLASHBACK DATABASE logging.
ORA-38707: Media recovery is not enabled.

  • Also sufficient undo tablespace should be available to support Flashback operations. Make sure that the undo tablespace has enough free space.
  • Set DB parameters

Set the db_recovery_file_dest_size parameter

alter system set db_recovery_file_dest_size=20G scope=both sid='*';


Set db_recovery_file_dest parameter.

alter system set db_recovery_file_dest='+RECO' scope=both sid='*';

Once the prerequisites are met, We can enable Flashback by following these steps:

In 19c we don't need to bring down database to enable or disable

Enable Flashback

1) Connect to the Oracle database using SQL*Plus with a user with SYSDBA privileges.


2) Check the current Flashback status by running the following query:


SELECT flashback_on FROM v$database;

This will indicate whether Flashback is currently enabled or disabled.

3) To enable Flashback, execute the following command:



ALTER DATABASE FLASHBACK ON;


Enabling Flashback allows you to use Flashback features for data recovery and querying historical data.

To verify that Flashback is enabled, you can run the same query as in step 2 to check the updated status.

Disable Flashback

Execute Below command

ALTER DATABASE FLASHBACK OFF;

Flashback on a running transaction has the following implications:


  • Any ongoing transaction will not be affected by enabling Flashback. The transaction will continue to execute normally. But make sure that the transaction is completed while doing flashback else command will be stuck.
  • Flashback operates on committed data, so the ongoing transaction will not be rolled back or affected by Flashback queries or operations.

To enable Flashback in a Data Guard environment:


  • Follow the same steps mentioned above on both the primary and standby databases. Ensure that both databases meet the prerequisites for Flashback.
  • Doing Flashback on the primary database will automatically do it on the standby database.

To enable Flashback in a RAC (Real Application Clusters) environment:


  • Connect to any one node of the RAC cluster and execute the same steps mentioned above to enable Flashback.
  • Flashback operations can be performed on individual nodes using Flashback Query, Flashback Table, etc.
  • Flashback Database can be performed on the entire RAC cluster to restore the entire cluster to a previous point in time.
  • It's important to note that enabling Flashback consumes some disk space for storing flashback logs and requires proper management of undo tablespaces to ensure sufficient space availability.





If you like please follow and comment

Comments

Popular posts from this blog

WebLogic migration to OCI using WDT tool

WebLogic migration to OCI using WDT tool Oracle WebLogic Deploy Tool (WDT) is an open-source project designed to simplify and streamline the management of Oracle WebLogic Server domains. With WDT, you can export configuration and application files from one WebLogic Server domain and import them into another, making it a highly effective tool for tasks like migrating on-premises WebLogic configurations to Oracle Cloud. This blog outlines a detailed step-by-step process for using WDT to migrate WebLogic resources and configurations. Supported WLS versions Why Use WDT for Migration? When moving Oracle WebLogic resources from an on-premises environment to Oracle Cloud (or another WebLogic Server), WDT provides an efficient and reliable approach to: Discover and export domain configurations and application binaries. Create reusable models and archives for deployment in a target domain. Key Pre-Requisites Source System: An Oracle WebLogic Server with pre-configured resources such as: Applica...

How to Validate TDE Wallet Password in Oracle Database

How to Validate TDE Wallet Password in Oracle Database Validating the Transparent Data Encryption (TDE) wallet password is crucial, especially when ensuring that the password is correct without using the OPEN or CLOSE commands in the database. This blog post explains a straightforward method to validate the TDE password using the mkstore utility. Steps to Validate TDE Wallet Password Follow these steps to validate the TDE wallet password: Step 1: Copy the Keystore/Wallet File Navigate to your existing TDE wallet directory. Copy only the ewallet.p12 file to a new directory. If a cwallet.sso file exists, do not copy it . The absence of cwallet.sso ensures that the wallet does not use auto-login, forcing the utility to prompt for the password. Step 2: Validate Using mkstore Use the mkstore utility to check the contents of the wallet file. The mkstore utility will prompt you for the TDE wallet password, allowing you to validate its correctness. Command Syntax To display the conten...

How to Create macOS Catalina ISO File

  How to Create macOS Catalina ISO File Please note these steps need to be performed on a Apple Mac System to generate an iso. Steps: 1) Download macOS Catalina From App Store or Apple download 2) Please note once you download it will be in dmg format. 3) Open Terminal in MAC.  from the top-right corner open up Spotlight.  Type in Terminal and hit Enter. 4)  Mount it to your macOS hdiutil attach /tmp/Catalina.dmg -noverify -mountpoint /Volumes/Catalina 5) Create macOS Catalina Installer sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/Catalina --nointeraction 6) Unmount Catalina Disk hdiutil detach /volumes/Install\ macOS\ Catalina 7) Convert the DMG file to an ISO file hdiutil convert /tmp/Catalina.dmg -format UDTO -o ~/Desktop/Catalina.cdr 8) Rename and Move to Desktop mv ~/Desktop/Catalina.cdr ~/Desktop/Catalina.iso Now we can use this iso on any system and install on virtual machines.