Skip to main content

data_guard_associations

Creates, updates, deletes, gets or lists a data_guard_associations resource.

Overview​

Namedata_guard_associations
TypeResource
Idoci.database.data_guard_associations

Fields​

The following fields are returned by SELECT queries:

The configuration information is being retrieved.

NameDatatypeDescription
idstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the Data Guard association.
applyLagstringThe lag time between updates to the primary database and application of the redo data on the standby database, as computed by the reporting database. Example: 9 seconds
applyRatestringThe rate at which redo logs are synced between the associated databases. Example: 180 Mb per second
databaseIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the reporting database.
isActiveDataGuardEnabledbooleanTrue if active Data Guard is enabled.
lifecycleDetailsstringAdditional information about the current lifecycleState, if available.
lifecycleStatestringThe current state of the Data Guard association. (PROVISIONING, AVAILABLE, UPDATING, TERMINATING, TERMINATED, FAILED, UPGRADING)
peerDataGuardAssociationIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the peer database's Data Guard association.
peerDatabaseIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the associated peer database.
peerDbHomeIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the Database Home containing the associated peer database.
peerDbSystemIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the DB system containing the associated peer database.
peerRolestringThe role of the peer database in this Data Guard association. (PRIMARY, STANDBY, DISABLED_STANDBY)
protectionModestringThe protection mode of this Data Guard association. For more information, see [Oracle Data Guard Protection Modes](http:​//docs.oracle.com/database/122/SBYDB/oracle-data-guard-protection-modes.htm#SBYDB02000) in the Oracle Data Guard documentation. (MAXIMUM_AVAILABILITY, MAXIMUM_PERFORMANCE, MAXIMUM_PROTECTION)
rolestringThe role of the reporting database in this Data Guard association. (PRIMARY, STANDBY, DISABLED_STANDBY)
timeCreatedstring (date-time)The date and time the Data Guard association was created.
transportTypestringThe redo transport type used by this Data Guard association. For more information, see [Redo Transport Services](http:​//docs.oracle.com/database/122/SBYDB/oracle-data-guard-redo-transport-services.htm#SBYDB00400) in the Oracle Data Guard documentation. (SYNC, ASYNC, FASTSYNC)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdatabaseId, dataGuardAssociationId, regionGets the specified Data Guard association's configuration information.<br />
listselectdatabaseId, regionlimit, pageLists all Data Guard associations for the specified database.<br />
createinsertdatabaseId, region, databaseAdminPassword, protectionMode, transportType, creationTypeopc-retry-tokenCreates a new Data Guard association. A Data Guard association represents the replication relationship between the<br />specified database and a peer database. For more information, see [Using Oracle Data Guard](/Content/Database/Tasks/usingdataguard.htm).<br /><br />All Oracle Cloud Infrastructure resources, including Data Guard associations, get an Oracle-assigned, unique ID<br />called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response.<br />You can also retrieve a resource's OCID by using a List API operation on that resource type, or by viewing the<br />resource in the Console. For more information, see<br />[Resource Identifiers](/Content/General/Concepts/identifiers.htm).<br />
updateupdatedatabaseId, dataGuardAssociationId, regionif-match, opc-request-idUpdates the Data Guard association the specified database. This API can be used to change the protectionMode and transportType of the Data Guard association.<br />
failover_data_guard_associationexecdatabaseId, dataGuardAssociationId, region, databaseAdminPasswordif-matchPerforms a failover to transition the standby database identified by the databaseId parameter into the<br />specified Data Guard association's primary role after the existing primary database fails or becomes unreachable.<br /><br />A failover might result in data loss depending on the protection mode in effect at the time of the primary<br />database failure.<br />
migrate_data_guard_association_to_multi_data_guardsexecdatabaseId, dataGuardAssociationId, regionopc-retry-token, opc-request-id, if-matchMigrates the existing Data Guard association to new Data Guard model to support multiple standby databases functionality. <br /><br />This operation should always be performed on primary.<br />
reinstate_data_guard_associationexecdatabaseId, dataGuardAssociationId, region, databaseAdminPasswordif-matchReinstates the database identified by the databaseId parameter into the standby role in a Data Guard association.<br />
switchover_data_guard_associationexecdatabaseId, dataGuardAssociationId, region, databaseAdminPasswordif-matchPerforms a switchover to transition the primary database of a Data Guard association into a standby role. The<br />standby database associated with the dataGuardAssociationId assumes the primary database role.<br /><br />A switchover guarantees no data loss.<br />

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
dataGuardAssociationIdstringThe Data Guard association's [OCID](/Content/General/Concepts/identifiers.htm).
databaseIdstringThe database [OCID](/Content/General/Concepts/identifiers.htm).
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
if-matchstringFor optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
limitintegerThe maximum number of items to return per page.
opc-request-idstringUnique identifier for the request.
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
pagestringThe pagination token to continue listing from.

SELECT examples​

Gets the specified Data Guard association's configuration information.<br />

SELECT
id,
applyLag,
applyRate,
databaseId,
isActiveDataGuardEnabled,
lifecycleDetails,
lifecycleState,
peerDataGuardAssociationId,
peerDatabaseId,
peerDbHomeId,
peerDbSystemId,
peerRole,
protectionMode,
role,
timeCreated,
transportType
FROM oci.database.data_guard_associations
WHERE databaseId = '{{ databaseId }}' -- required
AND dataGuardAssociationId = '{{ dataGuardAssociationId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Creates a new Data Guard association. A Data Guard association represents the replication relationship between the<br />specified database and a peer database. For more information, see [Using Oracle Data Guard](/Content/Database/Tasks/usingdataguard.htm).<br /><br />All Oracle Cloud Infrastructure resources, including Data Guard associations, get an Oracle-assigned, unique ID<br />called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response.<br />You can also retrieve a resource's OCID by using a List API operation on that resource type, or by viewing the<br />resource in the Console. For more information, see<br />[Resource Identifiers](/Content/General/Concepts/identifiers.htm).<br />

INSERT INTO oci.database.data_guard_associations (
creationType,
databaseAdminPassword,
databaseSoftwareImageId,
isActiveDataGuardEnabled,
peerDbUniqueName,
peerSidPrefix,
protectionMode,
sourceEncryptionKeyLocationDetails,
transportType,
databaseId,
region,
opc-retry-token
)
SELECT
'{{ creationType }}' /* required */,
'{{ databaseAdminPassword }}' /* required */,
'{{ databaseSoftwareImageId }}',
{{ isActiveDataGuardEnabled }},
'{{ peerDbUniqueName }}',
'{{ peerSidPrefix }}',
'{{ protectionMode }}' /* required */,
'{{ sourceEncryptionKeyLocationDetails }}',
'{{ transportType }}' /* required */,
'{{ databaseId }}',
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
applyLag,
applyRate,
databaseId,
isActiveDataGuardEnabled,
lifecycleDetails,
lifecycleState,
peerDataGuardAssociationId,
peerDatabaseId,
peerDbHomeId,
peerDbSystemId,
peerRole,
protectionMode,
role,
timeCreated,
transportType
;

UPDATE examples​

Updates the Data Guard association the specified database. This API can be used to change the protectionMode and transportType of the Data Guard association.<br />

UPDATE oci.database.data_guard_associations
SET
databaseAdminPassword = '{{ databaseAdminPassword }}',
isActiveDataGuardEnabled = {{ isActiveDataGuardEnabled }},
protectionMode = '{{ protectionMode }}',
transportType = '{{ transportType }}'
WHERE
databaseId = '{{ databaseId }}' --required
AND dataGuardAssociationId = '{{ dataGuardAssociationId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
AND opc-request-id = '{{ opc-request-id}}'
RETURNING
id,
applyLag,
applyRate,
databaseId,
isActiveDataGuardEnabled,
lifecycleDetails,
lifecycleState,
peerDataGuardAssociationId,
peerDatabaseId,
peerDbHomeId,
peerDbSystemId,
peerRole,
protectionMode,
role,
timeCreated,
transportType;

Lifecycle Methods​

Performs a failover to transition the standby database identified by the databaseId parameter into the<br />specified Data Guard association's primary role after the existing primary database fails or becomes unreachable.<br /><br />A failover might result in data loss depending on the protection mode in effect at the time of the primary<br />database failure.<br />

EXEC oci.database.data_guard_associations.failover_data_guard_association
@databaseId='{{ databaseId }}' --required,
@dataGuardAssociationId='{{ dataGuardAssociationId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}'
@@json=
'{
"databaseAdminPassword": "{{ databaseAdminPassword }}"
}'
;