Skip to main content

db_homes

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

Overview​

Namedb_homes
TypeResource
Idoci.database.db_homes

Fields​

The following fields are returned by SELECT queries:

The Database Home.

NameDatatypeDescription
idstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the Database Home.
compartmentIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the compartment.
databaseSoftwareImageIdstringThe database software image [OCID](/Content/General/Concepts/identifiers.htm)
dbHomeLocationstringThe location of the Oracle Database Home.
dbSystemIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the DB system.
dbVersionstringThe Oracle Database version.
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).
displayNamestringThe user-provided name for the Database Home. The name does not need to be unique.
freeformTagsobjectFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"}
homeTypestringRepresents database home will be managed by oracle or customer (ORACLE_MANAGED, CUSTOMER_MANAGED)
kmsKeyIdstringThe OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
lastPatchHistoryEntryIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the last patch history. This value is updated as soon as a patch operation is started.
lifecycleDetailsstringAdditional information about the current lifecycle state.
lifecycleStatestringThe current state of the Database Home. (PROVISIONING, AVAILABLE, UPDATING, TERMINATING, TERMINATED, FAILED)
oneOffPatchesarrayList of one-off patches for Database Homes.
systemTagsobjectSystem tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm).
timeCreatedstring (date-time)The date and time the Database Home was created.
vmClusterIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the VM cluster.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdbHomeId, regionGets information about the specified Database Home.
listselectcompartmentId, regiondbSystemId, vmClusterId, backupId, dbVersion, limit, page, sortBy, sortOrder, lifecycleState, displayNameLists the Database Homes in the specified DB system and compartment. A Database Home is a directory where Oracle Database software is installed.<br />
createinsertregionopc-retry-tokenCreates a new Database Home in the specified database system based on the request parameters you provide. Applies to bare metal DB systems, Exadata systems, and Exadata Cloud@Customer systems.<br />
updateupdatedbHomeId, regionif-matchPatches the specified Database Home.
deletedeletedbHomeId, regionif-match, performFinalBackupDeletes a Database Home. Applies to bare metal DB systems, Exadata Cloud Service, and Exadata Cloud@Customer systems.<br /><br />Oracle recommends that you use the performFinalBackup parameter to back up any data on a bare metal DB system before you delete a Database Home. On an Exadata Cloud@Customer system or an Exadata Cloud Service system, you can delete a Database Home only when there are no databases in it and therefore you cannot use the performFinalBackup parameter to back up data.<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
compartmentIdstringThe compartment [OCID](/Content/General/Concepts/identifiers.htm).
dbHomeIdstringThe Database Home [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)
backupIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the backup. Specify a backupId to list only the DB systems or DB homes that support creating a database using this backup in this compartment.
dbSystemIdstringThe DB system [OCID](/Content/General/Concepts/identifiers.htm). If provided, filters the results to the set of database versions which are supported for the DB system.
dbVersionstringA filter to return only DB Homes that match the specified dbVersion.
displayNamestringA filter to return only resources that match the entire display name given. The match is not case sensitive.
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.
lifecycleStatestringA filter to return only resources that match the given lifecycle state exactly.
limitintegerThe maximum number of items to return per page.
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.
performFinalBackupbooleanWhether to perform a final backup of the database or not. Default is false. If you previously used RMAN or dbcli to configure backups and then you switch to using the Console or the API for backups, a new backup configuration is created and associated with your database. This means that you can no longer rely on your previously configured unmanaged backups to work. This parameter is used in multiple APIs. Refer to the API description for details on how the operation uses it.
sortBystringThe field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive.
sortOrderstringThe sort order to use, either ascending (ASC) or descending (DESC).
vmClusterIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the VM cluster.

SELECT examples​

Gets information about the specified Database Home.

SELECT
id,
compartmentId,
databaseSoftwareImageId,
dbHomeLocation,
dbSystemId,
dbVersion,
definedTags,
displayName,
freeformTags,
homeType,
kmsKeyId,
lastPatchHistoryEntryId,
lifecycleDetails,
lifecycleState,
oneOffPatches,
systemTags,
timeCreated,
vmClusterId
FROM oci.database.db_homes
WHERE dbHomeId = '{{ dbHomeId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Creates a new Database Home in the specified database system based on the request parameters you provide. Applies to bare metal DB systems, Exadata systems, and Exadata Cloud@Customer systems.<br />

INSERT INTO oci.database.db_homes (
databaseSoftwareImageId,
definedTags,
displayName,
freeformTags,
isDesupportedVersion,
kmsKeyId,
kmsKeyVersionId,
source,
region,
opc-retry-token
)
SELECT
'{{ databaseSoftwareImageId }}',
'{{ definedTags }}',
'{{ displayName }}',
'{{ freeformTags }}',
{{ isDesupportedVersion }},
'{{ kmsKeyId }}',
'{{ kmsKeyVersionId }}',
'{{ source }}',
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
compartmentId,
databaseSoftwareImageId,
dbHomeLocation,
dbSystemId,
dbVersion,
definedTags,
displayName,
freeformTags,
homeType,
kmsKeyId,
lastPatchHistoryEntryId,
lifecycleDetails,
lifecycleState,
oneOffPatches,
systemTags,
timeCreated,
vmClusterId
;

UPDATE examples​

Patches the specified Database Home.

UPDATE oci.database.db_homes
SET
dbVersion = '{{ dbVersion }}',
definedTags = '{{ definedTags }}',
freeformTags = '{{ freeformTags }}',
oneOffPatches = '{{ oneOffPatches }}'
WHERE
dbHomeId = '{{ dbHomeId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
RETURNING
id,
compartmentId,
databaseSoftwareImageId,
dbHomeLocation,
dbSystemId,
dbVersion,
definedTags,
displayName,
freeformTags,
homeType,
kmsKeyId,
lastPatchHistoryEntryId,
lifecycleDetails,
lifecycleState,
oneOffPatches,
systemTags,
timeCreated,
vmClusterId;

DELETE examples​

Deletes a Database Home. Applies to bare metal DB systems, Exadata Cloud Service, and Exadata Cloud@Customer systems.<br /><br />Oracle recommends that you use the performFinalBackup parameter to back up any data on a bare metal DB system before you delete a Database Home. On an Exadata Cloud@Customer system or an Exadata Cloud Service system, you can delete a Database Home only when there are no databases in it and therefore you cannot use the performFinalBackup parameter to back up data.<br />

DELETE FROM oci.database.db_homes
WHERE dbHomeId = '{{ dbHomeId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
AND performFinalBackup = '{{ performFinalBackup }}'
;