Preparing PostgreSQL DB System for Disaster Recovery
Perform the following prerequisites before adding a PostgreSQL DB System to a disaster recovery (DR) protection group.
Ensure that you have access to the OCI Console and meet the requirements to create a DR protection group.
IAM Setup and Permissions:
Ensure that the user configuring PostgreSQL replication has the required IAM permissions to manage PostgreSQL DB Systems and create replication relationships.
Allow group <group_name> to manage postgres-db-systems in compartment <compartment_name>Database Systems:
- Create the primary PostgreSQL DB System in the source region using the OCI Console, REST API, CLI, or SDK.
- Ensure that the primary DB System is in the Active lifecycle state.
- Ensure that both the primary and standby DB Systems use PostgreSQL version 14 or later.
Configure Replication with Warm Standby:
- In the OCI Console, select the secondary region where you want to create the standby DB System.
- Navigate to Databases, select PostgreSQL, and then select DB Systems.
- Click Create PostgreSQL Database system.
- Select Create Replica Database System as the creation type.
- Select the source region and primary PostgreSQL DB System.
- Configure the standby DB System and complete the creation process.
- Wait until the standby DB System reaches the Active lifecycle state.
Network Connectivity:
- Ensure that the primary and standby DB Systems are configured in the appropriate VCNs and subnets.
- Configure security lists or Network Security Groups (NSGs) to allow the required database and application connectivity.
- Ensure that the application can connect to the PostgreSQL DB System in the standby region after a DR operation.
Configuration Consistency:
- Ensure that the PostgreSQL configurations on the primary and standby DB Systems are compatible.
- Verify that extensions installed on the primary DB System are also available on the standby DB System.
- Configure any required PostgreSQL settings on the standby DB System because database configurations aren't automatically replicated.
Verify Replication:
- Navigate to the primary PostgreSQL DB System details page and verify that the DB system role is Primary.
- Select Replica DB systems and open the standby DB System.
- Verify that the standby DB system role is Warm Standby.
- Verify that replication is configured and monitor replication lag.
Note:
- The warm standby PostgreSQL DB System operates in read-only mode. No manual database mode change is required.
- PostgreSQL replication with warm standby uses asynchronous replication.
- Oracle recommends configuring the primary and standby DB Systems with similar shapes and performance characteristics to maintain comparable performance after a role transition.
- PostgreSQL DB System configurations aren't automatically replicated between the primary and standby DB Systems.
Related Topics