Skip to main content

maintenance_runs

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

Overview​

Namemaintenance_runs
TypeResource
Idoci.database.maintenance_runs

Fields​

The following fields are returned by SELECT queries:

Information about the specified maintenance run.

NameDatatypeDescription
idstringThe OCID of the maintenance run.
compartmentIdstringThe OCID of the compartment.
currentCustomActionTimeoutInMinsintegerExtend current custom action timeout between the current database servers during waiting state, from 0 (zero) to 30 minutes.
currentPatchingComponentstringThe name of the current infrastruture component that is getting patched.
customActionTimeoutInMinsintegerDetermines the amount of time the system will wait before the start of each database server patching operation. Specify a number of minutes, from 15 to 120.
descriptionstringDescription of the maintenance run.
displayNamestringThe user-friendly name for the maintenance run.
estimatedComponentPatchingStartTimestring (date-time)The estimated start time of the next infrastruture component patching operation.
estimatedPatchingTimeobjectThe estimated total time required in minutes for all patching operations (database server, storage server, and network switch patching).
isCustomActionTimeoutEnabledbooleanIf true, enables the configuration of a custom action timeout (waiting period) between database servers patching operations.
isDstFileUpdateEnabledbooleanIndicates if an automatic DST Time Zone file update is enabled for the Autonomous Container Database. If enabled along with Release Update, patching will be done in a Non-Rolling manner.
lifecycleDetailsstringAdditional information about the current lifecycle state.
lifecycleStatestringThe current state of the maintenance run. For Autonomous AI Database Serverless instances, valid states are IN_PROGRESS, SUCCEEDED, and FAILED. (SCHEDULED, IN_PROGRESS, SUCCEEDED, SKIPPED, FAILED, UPDATING, DELETING, DELETED, CANCELED)
maintenanceSubtypestringMaintenance sub-type. (QUARTERLY, HARDWARE, CRITICAL, INFRASTRUCTURE, DATABASE, ONEOFF, SECURITY_MONTHLY, TIMEZONE)
maintenanceTypestringMaintenance type. (PLANNED, UNPLANNED)
patchFailureCountintegerContain the patch failure count.
patchIdstringThe unique identifier of the patch. The identifier string includes the patch type, the Oracle AI Database version, and the patch creation date (using the format YYMMDD). For example, the identifier ru_patch_19.9.0.0_201030 is used for an RU patch for Oracle AI Database 19.9.0.0 that was released October 30, 2020.
patchingEndTimestring (date-time)The time when the patching operation ended.
patchingModestringCloud Exadata infrastructure node patching method, either "ROLLING" or "NONROLLING". Default value is ROLLING. IMPORTANT: Non-rolling infrastructure patching involves system down time. See [Oracle-Managed Infrastructure Maintenance Updates](/iaas/Content/Database/Concepts/examaintenance.htm#Oracle) for more information. (ROLLING, NONROLLING)
patchingStartTimestring (date-time)The time when the patching operation started.
patchingStatusstringThe status of the patching operation. (PATCHING, WAITING, SCHEDULED)
peerMaintenanceRunIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the maintenance run for the Autonomous Data Guard association's peer container database.
peerMaintenanceRunIdsarrayThe list of OCIDs for the maintenance runs associated with their Autonomous Data Guard peer container databases.
referenceResourceIdForImageUpdatesstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the resource the maintenance run will refer to when trying to fetch target versions. This field is set during maintenance run creation based on infrastructure's maintenance run version preferences. Currently this is only be supported for monthly maintenance runs created via scheduling plans.
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).
targetDbServerVersionstringThe target software version for the database server patching operation.
targetResourceIdstringThe ID of the target resource on which the maintenance run occurs.
targetResourceTypestringThe type of the target resource on which the maintenance run occurs. (AUTONOMOUS_EXADATA_INFRASTRUCTURE, AUTONOMOUS_CONTAINER_DATABASE, EXADATA_DB_SYSTEM, CLOUD_EXADATA_INFRASTRUCTURE, EXACC_INFRASTRUCTURE, AUTONOMOUS_VM_CLUSTER, AUTONOMOUS_DATABASE, CLOUD_AUTONOMOUS_VM_CLUSTER)
targetStorageServerVersionstringThe target Cell version that is to be patched to.
timeEndedstring (date-time)The date and time the maintenance run was completed.
timeScheduledstring (date-time)The date and time the maintenance run is scheduled to occur.
timeStartedstring (date-time)The date and time the maintenance run starts.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectmaintenanceRunId, regionGets information about the specified maintenance run.
listselectcompartmentId, regiontargetResourceId, targetResourceType, maintenanceType, limit, page, isLocalAdg, sortBy, sortOrder, lifecycleState, availabilityDomain, maintenanceSubtypeGets a list of the maintenance runs in the specified compartment.<br />
createinsertregion, targetResourceId, timeScheduled, patchTypeopc-request-id, opc-retry-tokenCreates a maintenance run with one of the following:<br />1. The latest available release update patch (RUP) for the Autonomous Container Database.<br />2. The latest available RUP and DST time-zone (TZ) file updates for the Autonomous Container Database.<br />3. The DST TZ file updates for the Autonomous Container Database.<br />
updateupdatemaintenanceRunId, regionif-matchUpdates the properties of a maintenance run, such as the state of a maintenance run.

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).
maintenanceRunIdstringThe maintenance run OCID.
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)
availabilityDomainstringA filter to return only resources that match the given availability domain exactly.
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.
isLocalAdgbooleanA filter to return the maintenance history results for the local standby Autonomous AI Database Serverless only.
lifecycleStatestringA filter to return only resources that match the given lifecycle state exactly.
limitintegerThe maximum number of items to return per page.
maintenanceSubtypestringThe sub-type of the maintenance run.
maintenanceTypestringThe maintenance type.
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.
sortBystringThe field to sort by. You can provide one sort order (sortOrder). Default order for TIME_SCHEDULED and TIME_ENDED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME sort order is case sensitive. Note: If you do not include the availability domain filter, the resources are grouped by availability domain, then sorted.
sortOrderstringThe sort order to use, either ascending (ASC) or descending (DESC).
targetResourceIdstringThe target resource ID.
targetResourceTypestringThe type of the target resource.

SELECT examples​

Gets information about the specified maintenance run.

SELECT
id,
compartmentId,
currentCustomActionTimeoutInMins,
currentPatchingComponent,
customActionTimeoutInMins,
description,
displayName,
estimatedComponentPatchingStartTime,
estimatedPatchingTime,
isCustomActionTimeoutEnabled,
isDstFileUpdateEnabled,
lifecycleDetails,
lifecycleState,
maintenanceSubtype,
maintenanceType,
patchFailureCount,
patchId,
patchingEndTime,
patchingMode,
patchingStartTime,
patchingStatus,
peerMaintenanceRunId,
peerMaintenanceRunIds,
referenceResourceIdForImageUpdates,
systemTags,
targetDbServerVersion,
targetResourceId,
targetResourceType,
targetStorageServerVersion,
timeEnded,
timeScheduled,
timeStarted
FROM oci.database.maintenance_runs
WHERE maintenanceRunId = '{{ maintenanceRunId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Creates a maintenance run with one of the following:<br />1. The latest available release update patch (RUP) for the Autonomous Container Database.<br />2. The latest available RUP and DST time-zone (TZ) file updates for the Autonomous Container Database.<br />3. The DST TZ file updates for the Autonomous Container Database.<br />

INSERT INTO oci.database.maintenance_runs (
compartmentId,
isDstFileUpdateEnabled,
patchType,
patchingMode,
targetResourceId,
timeScheduled,
region,
opc-request-id,
opc-retry-token
)
SELECT
'{{ compartmentId }}',
{{ isDstFileUpdateEnabled }},
'{{ patchType }}' /* required */,
'{{ patchingMode }}',
'{{ targetResourceId }}' /* required */,
'{{ timeScheduled }}' /* required */,
'{{ region }}',
'{{ opc-request-id }}',
'{{ opc-retry-token }}'
RETURNING
id,
compartmentId,
currentCustomActionTimeoutInMins,
currentPatchingComponent,
customActionTimeoutInMins,
description,
displayName,
estimatedComponentPatchingStartTime,
estimatedPatchingTime,
isCustomActionTimeoutEnabled,
isDstFileUpdateEnabled,
lifecycleDetails,
lifecycleState,
maintenanceSubtype,
maintenanceType,
patchFailureCount,
patchId,
patchingEndTime,
patchingMode,
patchingStartTime,
patchingStatus,
peerMaintenanceRunId,
peerMaintenanceRunIds,
referenceResourceIdForImageUpdates,
systemTags,
targetDbServerVersion,
targetResourceId,
targetResourceType,
targetStorageServerVersion,
timeEnded,
timeScheduled,
timeStarted
;

UPDATE examples​

Updates the properties of a maintenance run, such as the state of a maintenance run.

UPDATE oci.database.maintenance_runs
SET
currentCustomActionTimeoutInMins = {{ currentCustomActionTimeoutInMins }},
customActionTimeoutInMins = {{ customActionTimeoutInMins }},
isCustomActionTimeoutEnabled = {{ isCustomActionTimeoutEnabled }},
isEnabled = {{ isEnabled }},
isPatchNowEnabled = {{ isPatchNowEnabled }},
isResumePatching = {{ isResumePatching }},
patchId = '{{ patchId }}',
patchingMode = '{{ patchingMode }}',
targetDbServerVersion = '{{ targetDbServerVersion }}',
targetStorageServerVersion = '{{ targetStorageServerVersion }}',
timeScheduled = '{{ timeScheduled }}'
WHERE
maintenanceRunId = '{{ maintenanceRunId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
RETURNING
id,
compartmentId,
currentCustomActionTimeoutInMins,
currentPatchingComponent,
customActionTimeoutInMins,
description,
displayName,
estimatedComponentPatchingStartTime,
estimatedPatchingTime,
isCustomActionTimeoutEnabled,
isDstFileUpdateEnabled,
lifecycleDetails,
lifecycleState,
maintenanceSubtype,
maintenanceType,
patchFailureCount,
patchId,
patchingEndTime,
patchingMode,
patchingStartTime,
patchingStatus,
peerMaintenanceRunId,
peerMaintenanceRunIds,
referenceResourceIdForImageUpdates,
systemTags,
targetDbServerVersion,
targetResourceId,
targetResourceType,
targetStorageServerVersion,
timeEnded,
timeScheduled,
timeStarted;