Oracle – Flashback – set off and on to purge standby database flashback log files

1. Stop redo to standby
2. Set flashback off on standby
3. Set flashback on on standby
4. Start redo apply to standby

On standby

idle>select * from v$flash_recovery_area_usage;

FILE_TYPE               PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES     CON_ID
----------------------- ------------------ ------------------------- --------------- ----------
CONTROL FILE                             0                         0               0          0
REDO LOG                                 0                         0               0          0
ARCHIVED LOG                           .16                         0               4          0
BACKUP PIECE                           .01                         0               1          0
IMAGE COPY                               0                         0               0          0
FLASHBACK LOG                        46.95                         0              64          0
FOREIGN ARCHIVED LOG                     0                         0               0          0
AUXILIARY DATAFILE COPY                  0                         0               0          0

On Primary:
Use dgmgrl:
DGMGRL> connect sys@ORCL
Password:
Connected as SYSDBA.
DGMGRL> edit database orclstby set state='apply-off';
Succeeded.

On standby:
idle>ALTER DATABASE FLASHBACK OFF;

Database altered.

idle>alter database flashback on;

Database altered.

idle>select * from v$flash_recovery_area_usage;

FILE_TYPE               PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES     CON_ID
----------------------- ------------------ ------------------------- --------------- ----------
CONTROL FILE                             0                         0               0          0
REDO LOG                                 0                         0               0          0
ARCHIVED LOG                           .22                         0               7          0
BACKUP PIECE                           .01                         0               1          0
IMAGE COPY                               0                         0               0          0
FLASHBACK LOG                          1.5                         0               2          0
FOREIGN ARCHIVED LOG                     0                         0               0          0
AUXILIARY DATAFILE COPY                  0                         0               0          0

On Primary:

DGMGRL> edit database orclstby set state='apply-on';
Succeeded.

Leave a Reply

Your email address will not be published. Required fields are marked *