data_guard_associations
Creates, updates, deletes, gets or lists a data_guard_associations resource.
Overview​
| Name | data_guard_associations |
| Type | Resource |
| Id | oci.database.data_guard_associations |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The configuration information is being retrieved.
| Name | Datatype | Description |
|---|---|---|
id | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the Data Guard association. |
applyLag | string | The 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 |
applyRate | string | The rate at which redo logs are synced between the associated databases. Example: 180 Mb per second |
databaseId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the reporting database. |
isActiveDataGuardEnabled | boolean | True if active Data Guard is enabled. |
lifecycleDetails | string | Additional information about the current lifecycleState, if available. |
lifecycleState | string | The current state of the Data Guard association. (PROVISIONING, AVAILABLE, UPDATING, TERMINATING, TERMINATED, FAILED, UPGRADING) |
peerDataGuardAssociationId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the peer database's Data Guard association. |
peerDatabaseId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the associated peer database. |
peerDbHomeId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the Database Home containing the associated peer database. |
peerDbSystemId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the DB system containing the associated peer database. |
peerRole | string | The role of the peer database in this Data Guard association. (PRIMARY, STANDBY, DISABLED_STANDBY) |
protectionMode | string | The 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) |
role | string | The role of the reporting database in this Data Guard association. (PRIMARY, STANDBY, DISABLED_STANDBY) |
timeCreated | string (date-time) | The date and time the Data Guard association was created. |
transportType | string | The 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) |
The properties that define a Data Guard association.<br /><br />To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an<br />administrator. If you're an administrator who needs to write policies to give users access, see<br />[Getting Started with Policies](/Content/Identity/Concepts/policygetstarted.htm).<br /><br />For information about endpoints and signing API requests, see<br />[About the API](/Content/API/Concepts/usingapi.htm). For information about available SDKs and tools, see<br />[SDKS and Other Tools](/Content/API/Concepts/sdks.htm).<br />
| Name | Datatype | Description |
|---|---|---|
id | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the Data Guard association. |
applyLag | string | The 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 |
applyRate | string | The rate at which redo logs are synced between the associated databases. Example: 180 Mb per second |
databaseId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the reporting database. |
isActiveDataGuardEnabled | boolean | True if active Data Guard is enabled. |
lifecycleDetails | string | Additional information about the current lifecycleState, if available. |
lifecycleState | string | The current state of the Data Guard association. (PROVISIONING, AVAILABLE, UPDATING, TERMINATING, TERMINATED, FAILED, UPGRADING) |
peerDataGuardAssociationId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the peer database's Data Guard association. |
peerDatabaseId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the associated peer database. |
peerDbHomeId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the Database Home containing the associated peer database. |
peerDbSystemId | string | The [OCID](/Content/General/Concepts/identifiers.htm) of the DB system containing the associated peer database. |
peerRole | string | The role of the peer database in this Data Guard association. (PRIMARY, STANDBY, DISABLED_STANDBY) |
protectionMode | string | The 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) |
role | string | The role of the reporting database in this Data Guard association. (PRIMARY, STANDBY, DISABLED_STANDBY) |
timeCreated | string (date-time) | The date and time the Data Guard association was created. |
transportType | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | databaseId, dataGuardAssociationId, region | Gets the specified Data Guard association's configuration information.<br /> | |
list | select | databaseId, region | limit, page | Lists all Data Guard associations for the specified database.<br /> |
create | insert | databaseId, region, databaseAdminPassword, protectionMode, transportType, creationType | opc-retry-token | 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 /> |
update | update | databaseId, dataGuardAssociationId, region | if-match, opc-request-id | 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 /> |
failover_data_guard_association | exec | databaseId, dataGuardAssociationId, region, databaseAdminPassword | if-match | 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 /> |
migrate_data_guard_association_to_multi_data_guards | exec | databaseId, dataGuardAssociationId, region | opc-retry-token, opc-request-id, if-match | Migrates 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_association | exec | databaseId, dataGuardAssociationId, region, databaseAdminPassword | if-match | Reinstates the database identified by the databaseId parameter into the standby role in a Data Guard association.<br /> |
switchover_data_guard_association | exec | databaseId, dataGuardAssociationId, region, databaseAdminPassword | if-match | Performs 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.
| Name | Datatype | Description |
|---|---|---|
dataGuardAssociationId | string | The Data Guard association's [OCID](/Content/General/Concepts/identifiers.htm). |
databaseId | string | The database [OCID](/Content/General/Concepts/identifiers.htm). |
region | string | OCI 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-match | string | For 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. |
limit | integer | The maximum number of items to return per page. |
opc-request-id | string | Unique identifier for the request. |
opc-retry-token | string | A 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). |
page | string | The pagination token to continue listing from. |
SELECT examples​
- get
- list
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
;
Lists all Data Guard associations for the specified database.<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 region = '{{ region }}' -- required
AND limit = '{{ limit }}'
AND page = '{{ page }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: data_guard_associations
props:
- name: databaseId
value: "{{ databaseId }}"
description: Required parameter for the data_guard_associations resource.
- name: region
value: "{{ region }}"
description: Required parameter for the data_guard_associations resource.
- name: creationType
value: "{{ creationType }}"
description: |
Specifies whether to create the peer database in an existing DB system or in a new DB system.
- name: databaseAdminPassword
value: "{{ databaseAdminPassword }}"
description: |
A strong password for the `SYS`, `SYSTEM`, and `PDB Admin` users to apply during standby creation.
The password must contain no fewer than nine characters and include:
* At least two uppercase characters.
* At least two lowercase characters.
* At least two numeric characters.
* At least two special characters. Valid special characters include "_", "#", and "-" only.
**The password MUST be the same as the primary admin password.**
- name: databaseSoftwareImageId
value: "{{ databaseSoftwareImageId }}"
description: |
The database software image [OCID](/Content/General/Concepts/identifiers.htm)
- name: isActiveDataGuardEnabled
value: {{ isActiveDataGuardEnabled }}
description: |
True if active Data Guard is enabled.
- name: peerDbUniqueName
value: "{{ peerDbUniqueName }}"
description: |
Specifies the `DB_UNIQUE_NAME` of the peer database to be created.
- name: peerSidPrefix
value: "{{ peerSidPrefix }}"
description: |
Specifies a prefix for the `Oracle SID` of the database to be created.
- name: protectionMode
value: "{{ protectionMode }}"
description: |
The protection mode to set up between the primary and standby databases. 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.
**IMPORTANT** - The only protection mode currently supported by the Database service is MAXIMUM_PERFORMANCE.
valid_values: ['MAXIMUM_AVAILABILITY', 'MAXIMUM_PERFORMANCE', 'MAXIMUM_PROTECTION']
- name: sourceEncryptionKeyLocationDetails
description: |
Types of providers supported for managing database encryption keys
value:
providerType: "{{ providerType }}"
- name: transportType
value: "{{ transportType }}"
description: |
The redo transport type to use for this Data Guard association. Valid values depend on the specified `protectionMode`:
* MAXIMUM_AVAILABILITY - SYNC or FASTSYNC
* MAXIMUM_PERFORMANCE - ASYNC
* MAXIMUM_PROTECTION - SYNC
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.
**IMPORTANT** - The only transport type currently supported by the Database service is ASYNC.
valid_values: ['SYNC', 'ASYNC', 'FASTSYNC']
- name: opc-retry-token
value: "{{ opc-retry-token }}"
description: A 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).
description: A 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).
UPDATE examples​
- update
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​
- failover_data_guard_association
- migrate_data_guard_association_to_multi_data_guards
- reinstate_data_guard_association
- switchover_data_guard_association
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 }}"
}'
;
Migrates 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 />
EXEC oci.database.data_guard_associations.migrate_data_guard_association_to_multi_data_guards
@databaseId='{{ databaseId }}' --required,
@dataGuardAssociationId='{{ dataGuardAssociationId }}' --required,
@region='{{ region }}' --required,
@opc-retry-token='{{ opc-retry-token }}',
@opc-request-id='{{ opc-request-id }}',
@if-match='{{ if-match }}'
;
Reinstates the database identified by the databaseId parameter into the standby role in a Data Guard association.<br />
EXEC oci.database.data_guard_associations.reinstate_data_guard_association
@databaseId='{{ databaseId }}' --required,
@dataGuardAssociationId='{{ dataGuardAssociationId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}'
@@json=
'{
"databaseAdminPassword": "{{ databaseAdminPassword }}"
}'
;
Performs 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 />
EXEC oci.database.data_guard_associations.switchover_data_guard_association
@databaseId='{{ databaseId }}' --required,
@dataGuardAssociationId='{{ dataGuardAssociationId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}'
@@json=
'{
"databaseAdminPassword": "{{ databaseAdminPassword }}"
}'
;