Enable or disable flashback feature in oracle

shutdown database service

SQL>shutdown immediate;

start database to mount mode

SQL>startup mount;

If you haven’t opened archivelog feature, please execute “alter database arcivelog” to

enable archivelog(because flashback depend on archivelog)

SQL>alter database archivelog;

Enable flashback

SQL> alter database flashback on;

SQL> show parameter db_flashback_retention_target;

SQL> alter system set db_flashback_retention_target=28800 scope=both;

SQL> select log_mode,FLASHBACK_ON from v$database;
LOG_MODE FLASHBACK_ON
———— ——————
ARCHIVELOG YES

Disable flashback

SQL>shutdown immediate

start database to mount mode

SQL>startup mount;

disable flashback

SQL> alter database flashback off;

confirm whether archivelog and flashback had been opened or not.

SQL> select log_mode,FLASHBACK_ON from v$database;
LOG_MODE FLASHBACK_ON
———— ——————
ARCHIVELOG NO

There is no effective method to remove flashback log. but we can check the percentage of flash_recovery_area by following command.
SQL>select * from v$flash_recovery_area_usage;

Disable flashback to remove flashback log if you find that the log size is too large.
SQL>alter database flashback off;

Enable flashback again.
SQL>alter database flashback on;

Leave a Reply