Wednesday, October 27, 2021

Backup Configuraiton in DBCS VM DB With Data Guard

There is an earlier post on how to setup data guard association on DBCS VM DB.
This post looks at the backup configuraiton of such a setup.
Primary has automatic backup enabled.

The new data guard configuration is created for database between two regions.
DGMGRL> show configuration

Configuration - londb_lhr1cq_londb_cwl1zf

  Protection Mode: MaxPerformance
  Members:
  londb_lhr1cq - Primary database
    londb_cwl1zf - Physical standby database

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS   (status updated 48 seconds ago)
Once the DG association is created the archive log deletion policy on primary gets changed from
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO 'SBT_TAPE';
to
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO 'SBT_TAPE' SHIPPED TO ALL STANDBY;
Even though backed up time appears before the shipped clause this has not prevented archvie logs getting deleted.
On the standby the archive log deletion policy is
CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO ALL STANDBY;
Even though primary had automatic backup enabled, the standby is created with automatic backup disabled.

There is no simple way to enable automatic backups on standby. There's no "configure automatic backup" button on the standby database detail page. Even with terraform there's no way to enable automatic backup on the standby database (this could change in the future).




Only way to enable automatic backup on the standby is to make a switchover to the standby. After the switchover the "configure automatic backup" button will appear on the new primary (old standby) database detail page. However, automatic backup will still be disabled.

Enable automatic backup on the new primary (old standby).

Afterwards automatic backup enabled on the new primary (old standby).

The archive log deletion policy on the new primary (old standby) gets changed from
CONFIGURE ARCHIVELOG DELETION POLICY TO SHIPPED TO ALL STANDBY;
to
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO 'SBT_TAPE' SHIPPED TO ALL STANDBY;
after the first automatic backup has taken place.
The old primary (new standby) will have automatic backup enabled status.

However, it doesn't take full or incremental backups. Only the hourly archive log backups run with automatic backup enabled on the standby.
Furthermore with standby in mount no manual backups are not allowed using dbcli.
dbcli create-backup -bt ArchiveLog -i dd2a13fb-46cf-4a51-9cce-485b7ff4ace1
DCS-10089:Database londb is in an invalid state '{ nwpdbvm: Mounted (Closed) }'.
There's also no way to disable automatic backup on a standby that already has it enabled. Same as enabling, DB must be made a primary DB to disable the automatic backups.

Related Posts
Data Guard on OCI PaaS DB
Data Guard With OCI PaaS DB (DBaaS) Primary and Standby on IaaS