Skip to main content

autonomous_databases

Creates, updates, deletes, gets or lists an autonomous_databases resource.

Overview​

Nameautonomous_databases
TypeResource
Idgoogle.oracledatabase.autonomous_databases

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringIdentifier. The name of the Autonomous Database resource in the following format: projects/{project}/locations/{region}/autonomousDatabases/{autonomous_database}
adminPasswordstringOptional. Immutable. The password for the default ADMIN user. Note: Only one of admin_password_secret_version or admin_password can be populated.
adminPasswordSecretVersionstringOptional. Immutable. The resource name of a secret version in Secret Manager which contains the database admin user's password. Format: projects/{project}/secrets/{secret}/versions/{version}. Note: Only one of admin_password_secret_version or admin_password can be populated.
cidrstringOptional. Immutable. The subnet CIDR range for the Autonomous Database.
createTimestring (google-datetime)Output only. The date and time that the Autonomous Database was created.
databasestringOptional. Immutable. The name of the Autonomous Database. The database name must be unique in the project. The name must begin with a letter and can contain a maximum of 30 alphanumeric characters.
disasterRecoverySupportedLocationsarrayOutput only. List of supported GCP region to clone the Autonomous Database for disaster recovery. Format: project/{project}/locations/{location}.
displayNamestringOptional. Immutable. The display name for the Autonomous Database. The name does not have to be unique within your project.
entitlementIdstringOutput only. The ID of the subscription entitlement associated with the Autonomous Database.
labelsobjectOptional. The labels or tags associated with the Autonomous Database.
networkstringOptional. Immutable. The name of the VPC network used by the Autonomous Database in the following format: projects/{project}/global/networks/{network}
odbNetworkstringOptional. Immutable. The name of the OdbNetwork associated with the Autonomous Database. Format: projects/{project}/locations/{location}/odbNetworks/{odb_network} It is optional but if specified, this should match the parent ODBNetwork of the OdbSubnet.
odbSubnetstringOptional. Immutable. The name of the OdbSubnet associated with the Autonomous Database. Format: projects/{project}/locations/{location}/odbNetworks/{odb_network}/odbSubnets/{odb_subnet}
peerAutonomousDatabasesarrayOutput only. The peer Autonomous Database names of the given Autonomous Database.
propertiesobjectOptional. The properties of the Autonomous Database. (id: AutonomousDatabaseProperties)
sourceConfigobjectOptional. Immutable. The source Autonomous Database configuration for the standby Autonomous Database. The source Autonomous Database is configured while creating the Peer Autonomous Database and can't be updated after creation. (id: SourceConfig)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, autonomousDatabasesIdGets the details of a single Autonomous Database.
listselectprojectsId, locationsIdfilter, orderBy, pageSize, pageTokenLists the Autonomous Databases in a given project and location.
createinsertprojectsId, locationsIdautonomousDatabaseId, requestIdCreates a new Autonomous Database in a given project and location.
patchupdateprojectsId, locationsId, autonomousDatabasesIdrequestId, updateMaskUpdates the parameters of a single Autonomous Database.
deletedeleteprojectsId, locationsId, autonomousDatabasesIdrequestIdDeletes a single Autonomous Database.
failoverexecprojectsId, locationsId, autonomousDatabasesIdInitiates a failover to target autonomous database from the associated primary database.
generate_walletexecprojectsId, locationsId, autonomousDatabasesIdGenerates a wallet for an Autonomous Database.
refreshexecprojectsId, locationsId, autonomousDatabasesIdRefreshes the refreshable clone of an Autonomous Database.
restartexecprojectsId, locationsId, autonomousDatabasesIdRestarts an Autonomous Database.
restoreexecprojectsId, locationsId, autonomousDatabasesIdRestores a single Autonomous Database.
startexecprojectsId, locationsId, autonomousDatabasesIdStarts an Autonomous Database.
stopexecprojectsId, locationsId, autonomousDatabasesIdStops an Autonomous Database.
switchoverexecprojectsId, locationsId, autonomousDatabasesIdInitiates a switchover of specified autonomous database to the associated peer database.

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
autonomousDatabasesIdstring
locationsIdstring
projectsIdstring
autonomousDatabaseIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples​

Gets the details of a single Autonomous Database.

SELECT
name,
adminPassword,
adminPasswordSecretVersion,
cidr,
createTime,
database,
disasterRecoverySupportedLocations,
displayName,
entitlementId,
labels,
network,
odbNetwork,
odbSubnet,
peerAutonomousDatabases,
properties,
sourceConfig
FROM google.oracledatabase.autonomous_databases
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND autonomousDatabasesId = '{{ autonomousDatabasesId }}' -- required
;

INSERT examples​

Creates a new Autonomous Database in a given project and location.

INSERT INTO google.oracledatabase.autonomous_databases (
data__adminPassword,
data__adminPasswordSecretVersion,
data__cidr,
data__database,
data__displayName,
data__labels,
data__name,
data__network,
data__odbNetwork,
data__odbSubnet,
data__properties,
data__sourceConfig,
projectsId,
locationsId,
autonomousDatabaseId,
requestId
)
SELECT
'{{ adminPassword }}',
'{{ adminPasswordSecretVersion }}',
'{{ cidr }}',
'{{ database }}',
'{{ displayName }}',
'{{ labels }}',
'{{ name }}',
'{{ network }}',
'{{ odbNetwork }}',
'{{ odbSubnet }}',
'{{ properties }}',
'{{ sourceConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ autonomousDatabaseId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples​

Updates the parameters of a single Autonomous Database.

UPDATE google.oracledatabase.autonomous_databases
SET
data__adminPassword = '{{ adminPassword }}',
data__adminPasswordSecretVersion = '{{ adminPasswordSecretVersion }}',
data__cidr = '{{ cidr }}',
data__database = '{{ database }}',
data__displayName = '{{ displayName }}',
data__labels = '{{ labels }}',
data__name = '{{ name }}',
data__network = '{{ network }}',
data__odbNetwork = '{{ odbNetwork }}',
data__odbSubnet = '{{ odbSubnet }}',
data__properties = '{{ properties }}',
data__sourceConfig = '{{ sourceConfig }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND autonomousDatabasesId = '{{ autonomousDatabasesId }}' --required
AND requestId = '{{ requestId}}'
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples​

Deletes a single Autonomous Database.

DELETE FROM google.oracledatabase.autonomous_databases
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND autonomousDatabasesId = '{{ autonomousDatabasesId }}' --required
AND requestId = '{{ requestId }}'
;

Lifecycle Methods​

Initiates a failover to target autonomous database from the associated primary database.

EXEC google.oracledatabase.autonomous_databases.failover
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@autonomousDatabasesId='{{ autonomousDatabasesId }}' --required
@@json=
'{
"peerAutonomousDatabase": "{{ peerAutonomousDatabase }}"
}'
;