oracle.oci.oci_database_db_system_actions – Perform actions on a DbSystem resource in Oracle Cloud Infrastructure

Note

This plugin is part of the oracle.oci collection (version 4.11.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install oracle.oci.

To use it in a playbook, specify: oracle.oci.oci_database_db_system_actions.

New in version 2.9.0: of oracle.oci

Synopsis

  • Perform actions on a DbSystem resource in Oracle Cloud Infrastructure

  • For action=change_compartment, moves the DB system and its dependent resources to the specified compartment. For more information about moving DB systems, see Moving Database Resources to a Different Compartment.

  • For action=migrate_exadata_db_system_resource_model, migrates the Exadata DB system to the new Exadata resource model. All related resources will be migrated.

  • For action=upgrade, upgrades the operating system and grid infrastructure of the DB system.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
action
string / required
    Choices:
  • change_compartment
  • migrate_exadata_db_system_resource_model
  • precheck
  • rollback
  • update_snapshot_retention_days
  • upgrade
The action to perform on the DbSystem.
api_user
string
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
string
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
string
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
string
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_purpose
string
    Choices:
  • service_principal
The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None.
auth_type
string
    Choices:
  • api_key ←
  • instance_principal
  • instance_obo_user
  • resource_principal
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
cert_bundle
string
The full path to a CA certificate bundle to be used for SSL verification. This will override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE variable, if any, is used.
compartment_id
string
The OCID of the compartment to move the resource to.
Required for action=change_compartment.
config_file_location
string
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
string
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
db_system_id
string / required
The DB system OCID.

aliases: id
is_snapshot_retention_days_force_updated
boolean
    Choices:
  • no
  • yes
If true, rollback time is updated even if operating system upgrade history contains errors.
Applicable only for action=upgrade.
new_gi_version
string
A valid Oracle Grid Infrastructure (GI) software version.
Applicable only for action=upgrade.
region
string
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
snapshot_retention_period_in_days
integer
The retention period, in days, for the snapshot that allows you to perform a rollback of the upgrade operation. After this number of days passes, you cannot roll back the upgrade.
Applicable only for action=upgrade.
tenancy
string
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm
wait
boolean
    Choices:
  • no
  • yes ←
Whether to wait for create or delete operation to complete.
wait_timeout
integer
Time, in seconds, to wait when wait=yes. Defaults to 1200 for most of the services but some services might have a longer wait timeout.

Examples

- name: Perform action change_compartment on db_system
  oci_database_db_system_actions:
    # required
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
    db_system_id: "ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx"
    action: change_compartment

- name: Perform action migrate_exadata_db_system_resource_model on db_system
  oci_database_db_system_actions:
    # required
    db_system_id: "ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx"
    action: migrate_exadata_db_system_resource_model

- name: Perform action precheck on db_system
  oci_database_db_system_actions:
    # required
    db_system_id: "ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx"
    action: PRECHECK

    # optional
    snapshot_retention_period_in_days: 56
    new_gi_version: new_gi_version_example
    is_snapshot_retention_days_force_updated: true

- name: Perform action rollback on db_system
  oci_database_db_system_actions:
    # required
    db_system_id: "ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx"
    action: PRECHECK

    # optional
    snapshot_retention_period_in_days: 56
    new_gi_version: new_gi_version_example
    is_snapshot_retention_days_force_updated: true

- name: Perform action update_snapshot_retention_days on db_system
  oci_database_db_system_actions:
    # required
    db_system_id: "ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx"
    action: PRECHECK

    # optional
    snapshot_retention_period_in_days: 56
    new_gi_version: new_gi_version_example
    is_snapshot_retention_days_force_updated: true

- name: Perform action upgrade on db_system
  oci_database_db_system_actions:
    # required
    db_system_id: "ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx"
    action: PRECHECK

    # optional
    snapshot_retention_period_in_days: 56
    new_gi_version: new_gi_version_example
    is_snapshot_retention_days_force_updated: true

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
db_system
complex
on success
Details of the DbSystem resource acted upon by the current operation

Sample:
{'availability_domain': 'Uocm:PHX-AD-1', 'backup_network_nsg_ids': [], 'backup_subnet_id': 'ocid1.backupsubnet.oc1..xxxxxxEXAMPLExxxxxx', 'cluster_name': 'cluster_name_example', 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'cpu_core_count': 56, 'data_collection_options': {'is_diagnostics_events_enabled': True, 'is_health_monitoring_enabled': True, 'is_incident_logs_enabled': True}, 'data_storage_percentage': 56, 'data_storage_size_in_gbs': 56, 'database_edition': 'STANDARD_EDITION', 'db_system_options': {'storage_management': 'ASM'}, 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'disk_redundancy': 'HIGH', 'display_name': 'display_name_example', 'domain': 'domain_example', 'fault_domains': [], 'freeform_tags': {'Department': 'Finance'}, 'hostname': 'hostname_example', 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'iorm_config_cache': {'db_plans': [{'db_name': 'db_name_example', 'flash_cache_limit': 'flash_cache_limit_example', 'share': 56}], 'lifecycle_details': 'lifecycle_details_example', 'lifecycle_state': 'BOOTSTRAPPING', 'objective': 'LOW_LATENCY'}, 'kms_key_id': 'ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx', 'last_maintenance_run_id': 'ocid1.lastmaintenancerun.oc1..xxxxxxEXAMPLExxxxxx', 'last_patch_history_entry_id': 'ocid1.lastpatchhistoryentry.oc1..xxxxxxEXAMPLExxxxxx', 'license_model': 'LICENSE_INCLUDED', 'lifecycle_details': 'lifecycle_details_example', 'lifecycle_state': 'PROVISIONING', 'listener_port': 56, 'maintenance_window': {'custom_action_timeout_in_mins': 56, 'days_of_week': [{'name': 'MONDAY'}], 'hours_of_day': [], 'is_custom_action_timeout_enabled': True, 'is_monthly_patching_enabled': True, 'lead_time_in_weeks': 56, 'months': [{'name': 'JANUARY'}], 'patching_mode': 'ROLLING', 'preference': 'NO_PREFERENCE', 'weeks_of_month': []}, 'memory_size_in_gbs': 56, 'next_maintenance_run_id': 'ocid1.nextmaintenancerun.oc1..xxxxxxEXAMPLExxxxxx', 'node_count': 56, 'nsg_ids': [], 'point_in_time_data_disk_clone_timestamp': '2013-10-20T19:20:30+01:00', 'reco_storage_size_in_gb': 56, 'scan_dns_name': 'scan_dns_name_example', 'scan_dns_record_id': 'ocid1.scandnsrecord.oc1..xxxxxxEXAMPLExxxxxx', 'scan_ip_ids': [], 'shape': 'shape_example', 'source_db_system_id': 'ocid1.sourcedbsystem.oc1..xxxxxxEXAMPLExxxxxx', 'sparse_diskgroup': True, 'ssh_public_keys': ['ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAz...'], 'storage_volume_performance_mode': 'BALANCED', 'subnet_id': 'ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx', 'time_created': '2013-10-20T19:20:30+01:00', 'time_zone': 'time_zone_example', 'version': 'version_example', 'vip_ids': [], 'zone_id': 'ocid1.zone.oc1..xxxxxxEXAMPLExxxxxx'}
 
availability_domain
string
on success
The name of the availability domain that the DB system is located in.

Sample:
Uocm:PHX-AD-1
 
backup_network_nsg_ids
list / elements=string
on success
A list of the OCIDs of the network security groups (NSGs) that the backup network of this DB system belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see Security Rules. Applicable only to Exadata systems.

 
backup_subnet_id
string
on success
The OCID of the backup network subnet the DB system is associated with. Applicable only to Exadata DB systems.
**Subnet Restriction:** See the subnet restrictions information for **subnetId**.

Sample:
ocid1.backupsubnet.oc1..xxxxxxEXAMPLExxxxxx
 
cluster_name
string
on success
The cluster name for Exadata and 2-node RAC virtual machine DB systems. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive.

Sample:
cluster_name_example
 
compartment_id
string
on success
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
 
cpu_core_count
integer
on success
The number of CPU cores enabled on the DB system.

Sample:
56
 
data_collection_options
complex
on success

   
is_diagnostics_events_enabled
boolean
on success
Indicates whether diagnostic collection is enabled for the VM cluster/Cloud VM cluster/VMBM DBCS. Enabling diagnostic collection allows you to receive Events service notifications for guest VM issues. Diagnostic collection also allows Oracle to provide enhanced service and proactive support for your Exadata system. You can enable diagnostic collection during VM cluster/Cloud VM cluster provisioning. You can also disable or enable it at any time using the `UpdateVmCluster` or `updateCloudVmCluster` API.

Sample:
True
   
is_health_monitoring_enabled
boolean
on success
Indicates whether health monitoring is enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. Enabling health monitoring allows Oracle to collect diagnostic data and share it with its operations and support personnel. You may also receive notifications for some events. Collecting health diagnostics enables Oracle to provide proactive support and enhanced service for your system. Optionally enable health monitoring while provisioning a system. You can also disable or enable health monitoring anytime using the `UpdateVmCluster`, `UpdateCloudVmCluster` or `updateDbsystem` API.

Sample:
True
   
is_incident_logs_enabled
boolean
on success
Indicates whether incident logs and trace collection are enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. Enabling incident logs collection allows Oracle to receive Events service notifications for guest VM issues, collect incident logs and traces, and use them to diagnose issues and resolve them. Optionally enable incident logs collection while provisioning a system. You can also disable or enable incident logs collection anytime using the `UpdateVmCluster`, `updateCloudVmCluster` or `updateDbsystem` API.

Sample:
True
 
data_storage_percentage
integer
on success
The percentage assigned to DATA storage (user data and database files). The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). Accepted values are 40 and 80. The default is 80 percent assigned to DATA storage. Not applicable for virtual machine DB systems.

Sample:
56
 
data_storage_size_in_gbs
integer
on success
The data storage size, in gigabytes, that is currently available to the DB system. Applies only for virtual machine DB systems.

Sample:
56
 
database_edition
string
on success
The Oracle Database edition that applies to all the databases on the DB system.

Sample:
STANDARD_EDITION
 
db_system_options
complex
on success

   
storage_management
string
on success
The storage option used in DB system. ASM - Automatic storage management LVM - Logical Volume management

Sample:
ASM
 
defined_tags
dictionary
on success
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.

Sample:
{'Operations': {'CostCenter': 'US'}}
 
disk_redundancy
string
on success
The type of redundancy configured for the DB system. NORMAL is 2-way redundancy. HIGH is 3-way redundancy.

Sample:
HIGH
 
display_name
string
on success
The user-friendly name for the DB system. The name does not have to be unique.

Sample:
display_name_example
 
domain
string
on success
The domain name for the DB system.

Sample:
domain_example
 
fault_domains
list / elements=string
on success
List of the Fault Domains in which this DB system is provisioned.

 
freeform_tags
dictionary
on success
Free-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.
Example: `{"Department": "Finance"}`

Sample:
{'Department': 'Finance'}
 
hostname
string
on success
The hostname for the DB system.

Sample:
hostname_example
 
id
string
on success
The OCID of the DB system.

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
iorm_config_cache
complex
on success

   
db_plans
complex
on success
An array of IORM settings for all the database in the Exadata DB system.

     
db_name
string
on success
The database name. For the default `DbPlan`, the `dbName` is `default`.

Sample:
db_name_example
     
flash_cache_limit
string
on success
The flash cache limit for this database. This value is internally configured based on the share value assigned to the database.

Sample:
flash_cache_limit_example
     
share
integer
on success
The relative priority of this database.

Sample:
56
   
lifecycle_details
string
on success
Additional information about the current `lifecycleState`.

Sample:
lifecycle_details_example
   
lifecycle_state
string
on success
The current state of IORM configuration for the Exadata DB system.

Sample:
BOOTSTRAPPING
   
objective
string
on success
The current value for the IORM objective. The default is `AUTO`.

Sample:
LOW_LATENCY
 
kms_key_id
string
on success
The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.

Sample:
ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx
 
last_maintenance_run_id
string
on success
The OCID of the last maintenance run.

Sample:
ocid1.lastmaintenancerun.oc1..xxxxxxEXAMPLExxxxxx
 
last_patch_history_entry_id
string
on success
The OCID of the last patch history. This value is updated as soon as a patch operation starts.

Sample:
ocid1.lastpatchhistoryentry.oc1..xxxxxxEXAMPLExxxxxx
 
license_model
string
on success
The Oracle license model that applies to all the databases on the DB system. The default is LICENSE_INCLUDED.

Sample:
LICENSE_INCLUDED
 
lifecycle_details
string
on success
Additional information about the current lifecycle state.

Sample:
lifecycle_details_example
 
lifecycle_state
string
on success
The current state of the DB system.

Sample:
PROVISIONING
 
listener_port
integer
on success
The port number configured for the listener on the DB system.

Sample:
56
 
maintenance_window
complex
on success

   
custom_action_timeout_in_mins
integer
on success
Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive).

Sample:
56
   
days_of_week
complex
on success
Days during the week when maintenance should be performed.

     
name
string
on success
Name of the day of the week.

Sample:
MONDAY
   
hours_of_day
list / elements=string
on success
The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC

   
is_custom_action_timeout_enabled
boolean
on success
If true, enables the configuration of a custom action timeout (waiting period) between database server patching operations.

Sample:
True
   
is_monthly_patching_enabled
boolean
on success
If true, enables the monthly patching option.

Sample:
True
   
lead_time_in_weeks
integer
on success
Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4.

Sample:
56
   
months
complex
on success
Months during the year when maintenance should be performed.

     
name
string
on success
Name of the month of the year.

Sample:
JANUARY
   
patching_mode
string
on success
Cloud 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 for more information.

Sample:
ROLLING
   
preference
string
on success
The maintenance window scheduling preference.

Sample:
NO_PREFERENCE
   
weeks_of_month
list / elements=string
on success
Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed.

 
memory_size_in_gbs
integer
on success
Memory allocated to the DB system, in gigabytes.

Sample:
56
 
next_maintenance_run_id
string
on success
The OCID of the next maintenance run.

Sample:
ocid1.nextmaintenancerun.oc1..xxxxxxEXAMPLExxxxxx
 
node_count
integer
on success
The number of nodes in the DB system. For RAC DB systems, the value is greater than 1.

Sample:
56
 
nsg_ids
list / elements=string
on success
The list of OCIDs for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see Security Rules. **NsgIds restrictions:** - A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty.

 
point_in_time_data_disk_clone_timestamp
string
on success
The point in time for a cloned database system when the data disks were cloned from the source database system, as described in RFC 3339.

Sample:
2013-10-20T19:20:30+01:00
 
reco_storage_size_in_gb
integer
on success
The RECO/REDO storage size, in gigabytes, that is currently allocated to the DB system. Applies only for virtual machine DB systems.

Sample:
56
 
scan_dns_name
string
on success
The FQDN of the DNS record for the SCAN IP addresses that are associated with the DB system.

Sample:
scan_dns_name_example
 
scan_dns_record_id
string
on success
The OCID of the DNS record for the SCAN IP addresses that are associated with the DB system.

Sample:
ocid1.scandnsrecord.oc1..xxxxxxEXAMPLExxxxxx
 
scan_ip_ids
list / elements=string
on success
The OCID of the Single Client Access Name (SCAN) IP addresses associated with the DB system. SCAN IP addresses are typically used for load balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster.
**Note:** For a single-node DB system, this list is empty.

 
shape
string
on success
The shape of the DB system. The shape determines resources to allocate to the DB system. - For virtual machine shapes, the number of CPU cores and memory - For bare metal and Exadata shapes, the number of CPU cores, storage, and memory

Sample:
shape_example
 
source_db_system_id
string
on success
The OCID of the DB system.

Sample:
ocid1.sourcedbsystem.oc1..xxxxxxEXAMPLExxxxxx
 
sparse_diskgroup
boolean
on success
True, if Sparse Diskgroup is configured for Exadata dbsystem, False, if Sparse diskgroup was not configured.

Sample:
True
 
ssh_public_keys
list / elements=string
on success
The public key portion of one or more key pairs used for SSH access to the DB system.

Sample:
['ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAz...']
 
storage_volume_performance_mode
string
on success
The block storage volume performance level. Valid values are `BALANCED` and `HIGH_PERFORMANCE`. See Block Volume Performance for more information.

Sample:
BALANCED
 
subnet_id
string
on success
The OCID of the subnet the DB system is associated with.
**Subnet Restrictions:** - For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. - For Exadata and virtual machine 2-node RAC DB systems, do not use a subnet that overlaps with 192.168.128.0/20.
These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and backup subnet.

Sample:
ocid1.subnet.oc1..xxxxxxEXAMPLExxxxxx
 
time_created
string
on success
The date and time the DB system was created.

Sample:
2013-10-20T19:20:30+01:00
 
time_zone
string
on success
The time zone of the DB system. For details, see DB System Time Zones.

Sample:
time_zone_example
 
version
string
on success
The Oracle Database version of the DB system.

Sample:
version_example
 
vip_ids
list / elements=string
on success
The OCID of the virtual IP (VIP) addresses associated with the DB system. The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the DB system to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster.
**Note:** For a single-node DB system, this list is empty.

 
zone_id
string
on success
The OCID of the zone the DB system is associated with.

Sample:
ocid1.zone.oc1..xxxxxxEXAMPLExxxxxx


Authors

  • Oracle (@oracle)