data_guards
Creates, updates, deletes, gets or lists a data_guards resource.
Overview​
| Name | data_guards |
| Type | Resource |
| Id | oci.database.data_guards |
Fields​
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
update | update | databaseId, region | opc-retry-token, opc-request-id, if-match | Update an existing Data Guard member. A Data Guard member represents the replication relationship between the<br />specified database and a standby database. For more information, see [Using Oracle Data Guard](/Content/Database/Tasks/usingdataguard.htm).<br /> |
convert_to_standalone | exec | databaseId, region, databaseAdminPassword | opc-retry-token, opc-request-id, if-match | Disassociate the standby database identified by the databaseId parameter from existing Data Guard group. <br /><br />Convert the standby to a standalone database. <br /><br />This operation should be performed on respective standby database.<br /> |
failover_data_guard | exec | databaseId, region, databaseAdminPassword | opc-retry-token, opc-request-id, if-match | Performs a failover to transition the standby database identified by the databaseId path parameter into the<br />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 /><br />This operation should be performed on respective standby database.<br /> |
reinstate_data_guard | exec | databaseId, region, databaseAdminPassword, sourceDatabaseId | opc-retry-token, opc-request-id, if-match | Reinstates the database identified by the databaseId parameter into the standby role in a Data Guard association. <br /><br />This operation should be performed on disabled standby database.<br /> |
switch_over_data_guard | exec | databaseId, region, databaseAdminPassword | opc-retry-token, opc-request-id, if-match | Performs a switchover to transition primary database of this 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 /><br />This operation should be performed on respective standby database.<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 |
|---|---|---|
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. |
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). |
UPDATE examples​
- update
Update an existing Data Guard member. A Data Guard member represents the replication relationship between the<br />specified database and a standby database. For more information, see [Using Oracle Data Guard](/Content/Database/Tasks/usingdataguard.htm).<br />
UPDATE oci.database.data_guards
SET
databaseAdminPassword = '{{ databaseAdminPassword }}',
isActiveDataGuardEnabled = {{ isActiveDataGuardEnabled }},
protectionMode = '{{ protectionMode }}',
transportType = '{{ transportType }}'
WHERE
databaseId = '{{ databaseId }}' --required
AND region = '{{ region }}' --required
AND opc-retry-token = '{{ opc-retry-token}}'
AND opc-request-id = '{{ opc-request-id}}'
AND if-match = '{{ if-match}}'
RETURNING
id,
characterSet,
compartmentId,
connectionStrings,
dataGuardGroup,
databaseManagementConfig,
databaseSoftwareImageId,
dbBackupConfig,
dbHomeId,
dbName,
dbSystemId,
dbUniqueName,
dbWorkload,
definedTags,
encryptionKeyLocationDetails,
freeformTags,
homeType,
isCdb,
kmsKeyId,
kmsKeyVersionId,
lastBackupDurationInSeconds,
lastBackupTimestamp,
lastFailedBackupTimestamp,
lifecycleDetails,
lifecycleState,
managedSoftwareUpdateDetails,
ncharacterSet,
pdbName,
sidPrefix,
sourceDatabasePointInTimeRecoveryTimestamp,
storageSizeDetails,
systemTags,
timeCreated,
vaultId,
vmClusterId;
Lifecycle Methods​
- convert_to_standalone
- failover_data_guard
- reinstate_data_guard
- switch_over_data_guard
Disassociate the standby database identified by the databaseId parameter from existing Data Guard group. <br /><br />Convert the standby to a standalone database. <br /><br />This operation should be performed on respective standby database.<br />
EXEC oci.database.data_guards.convert_to_standalone
@databaseId='{{ databaseId }}' --required,
@region='{{ region }}' --required,
@opc-retry-token='{{ opc-retry-token }}',
@opc-request-id='{{ opc-request-id }}',
@if-match='{{ if-match }}'
@@json=
'{
"databaseAdminPassword": "{{ databaseAdminPassword }}"
}'
;
Performs a failover to transition the standby database identified by the databaseId path parameter into the<br />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 /><br />This operation should be performed on respective standby database.<br />
EXEC oci.database.data_guards.failover_data_guard
@databaseId='{{ databaseId }}' --required,
@region='{{ region }}' --required,
@opc-retry-token='{{ opc-retry-token }}',
@opc-request-id='{{ opc-request-id }}',
@if-match='{{ if-match }}'
@@json=
'{
"databaseAdminPassword": "{{ databaseAdminPassword }}"
}'
;
Reinstates the database identified by the databaseId parameter into the standby role in a Data Guard association. <br /><br />This operation should be performed on disabled standby database.<br />
EXEC oci.database.data_guards.reinstate_data_guard
@databaseId='{{ databaseId }}' --required,
@region='{{ region }}' --required,
@opc-retry-token='{{ opc-retry-token }}',
@opc-request-id='{{ opc-request-id }}',
@if-match='{{ if-match }}'
@@json=
'{
"databaseAdminPassword": "{{ databaseAdminPassword }}",
"sourceDatabaseId": "{{ sourceDatabaseId }}"
}'
;
Performs a switchover to transition primary database of this 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 /><br />This operation should be performed on respective standby database.<br />
EXEC oci.database.data_guards.switch_over_data_guard
@databaseId='{{ databaseId }}' --required,
@region='{{ region }}' --required,
@opc-retry-token='{{ opc-retry-token }}',
@opc-request-id='{{ opc-request-id }}',
@if-match='{{ if-match }}'
@@json=
'{
"databaseAdminPassword": "{{ databaseAdminPassword }}"
}'
;