oracle / oracle.oci / 3.5.0 / module / oci_database_database_actions Perform actions on a Database resource in Oracle Cloud Infrastructure | "added in version" 2.9.0 of oracle.oci" Authors: Oracle (@oracle) preview | supported by communityoracle.oci.oci_database_database_actions (3.5.0) — module
Install with ansible-galaxy collection install oracle.oci:==3.5.0
collections: - name: oracle.oci version: 3.5.0
Perform actions on a Database resource in Oracle Cloud Infrastructure
Disables the Database Management service for the database.
Enables the Database Management service for an Oracle Database located in Oracle Cloud Infrastructure. This service allows the database to access tools including Metrics and Performance hub. Database Management is enabled at the container database (CDB) level.
Changes encryption key management from customer-managed, using the L(Vault service,https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm), to Oracle-managed.
Updates one or more attributes of the Database Management service for the database.
Restore a Database based on the request parameters you provide.
Creates a new version of an existing L(Vault service,https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm) key.
Upgrades the specified Oracle Database instance.
- name: Perform action disable_database_management on database oci_database_database_actions: # required database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" action: disable_database_management
- name: Perform action enable_database_management on database oci_database_database_actions: # required credential_details: # required user_name: user_name_example password_secret_id: "ocid1.passwordsecret.oc1..xxxxxxEXAMPLExxxxxx" private_end_point_id: "ocid1.privateendpoint.oc1..xxxxxxEXAMPLExxxxxx" service_name: service_name_example database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" action: enable_database_management # optional management_type: BASIC protocol: TCP port: 56 ssl_secret_id: "ocid1.sslsecret.oc1..xxxxxxEXAMPLExxxxxx" role: SYSDBA
- name: Perform action migrate_vault_key on database oci_database_database_actions: # required kms_key_id: "ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx" database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" action: migrate_vault_key # optional kms_key_version_id: "ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx" vault_id: "ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx" tde_wallet_password: example-password admin_password: example-password
- name: Perform action modify_database_management on database oci_database_database_actions: # required database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" action: modify_database_management # optional credential_details: # required user_name: user_name_example password_secret_id: "ocid1.passwordsecret.oc1..xxxxxxEXAMPLExxxxxx" private_end_point_id: "ocid1.privateendpoint.oc1..xxxxxxEXAMPLExxxxxx" management_type: BASIC service_name: service_name_example protocol: TCP port: 56 ssl_secret_id: "ocid1.sslsecret.oc1..xxxxxxEXAMPLExxxxxx" role: SYSDBA
- name: Perform action restore on database oci_database_database_actions: # required database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" action: restore # optional database_scn: database_scn_example timestamp: timestamp_example latest: true
- name: Perform action rotate_vault_key on database oci_database_database_actions: # required database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" action: rotate_vault_key
- name: Perform action precheck on database oci_database_database_actions: # required database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" action: PRECHECK # optional database_upgrade_source_details: # required db_home_id: "ocid1.dbhome.oc1..xxxxxxEXAMPLExxxxxx" source: DB_HOME # optional options: options_example
- name: Perform action upgrade on database oci_database_database_actions: # required database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" action: PRECHECK # optional database_upgrade_source_details: # required db_home_id: "ocid1.dbhome.oc1..xxxxxxEXAMPLExxxxxx" source: DB_HOME # optional options: options_example
- name: Perform action rollback on database oci_database_database_actions: # required database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx" action: PRECHECK # optional database_upgrade_source_details: # required db_home_id: "ocid1.dbhome.oc1..xxxxxxEXAMPLExxxxxx" source: DB_HOME # optional options: options_example
port: description: - The port used to connect to the database. - Applicable only for I(action=enable_database_management)I(action=modify_database_management). type: int role: choices: - SYSDBA - NORMAL description: - The role of the user that will be connecting to the database. - Applicable only for I(action=enable_database_management)I(action=modify_database_management). type: str wait: default: true description: Whether to wait for create or delete operation to complete. type: bool action: choices: - disable_database_management - enable_database_management - migrate_vault_key - modify_database_management - restore - rotate_vault_key - precheck - upgrade - rollback description: - The action to perform on the Database. required: true type: str latest: description: - Restores to the last known good state with the least possible data loss. - Applicable only for I(action=restore). type: bool region: description: - 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 C(config_file_location)). Please refer to U(https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm) for more information on OCI regions. type: str tenancy: description: - 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 C(config_file_location)). To get the tenancy OCID, please refer U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm) type: str api_user: description: - 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 C(config_file_location)). To get the user's OCID, please refer U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm). type: str protocol: choices: - TCP - TCPS description: - Protocol used by the database connection. - Applicable only for I(action=enable_database_management)I(action=modify_database_management). type: str vault_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure L(vault,https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyoverview.htm#concepts). - Applicable only for I(action=migrate_vault_key). type: str auth_type: choices: - api_key - instance_principal - instance_obo_user - resource_principal default: api_key description: - The type of authentication to use for making API requests. By default C(auth_type="api_key") based authentication is performed and the API key (see I(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 C(auth_type="instance_principal") to use instance principal based authentication when running ansible playbooks within an OCI compute instance. type: str timestamp: description: - Restores to the timestamp specified. - Applicable only for I(action=restore). type: str kms_key_id: description: - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. - Required for I(action=migrate_vault_key). type: str cert_bundle: description: - 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. type: str database_id: aliases: - id description: - The database L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). required: true type: str auth_purpose: choices: - service_principal description: - The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None. type: str database_scn: description: - Restores using the backup with the System Change Number (SCN) specified. - Applicable only for I(action=restore). type: str service_name: description: - The name of the Oracle Database service that will be used to connect to the database. - Required for I(action=enable_database_management). type: str wait_timeout: description: Time, in seconds, to wait when I(wait=yes). Defaults to 1200 for most of the services but some services might have a longer wait timeout. type: int ssl_secret_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure L(secret,https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyoverview.htm#concepts). - Applicable only for I(action=enable_database_management)I(action=modify_database_management). type: str admin_password: description: - The existing admin password of the database. - Applicable only for I(action=migrate_vault_key). type: str management_type: choices: - BASIC - ADVANCED description: - The Database Management type. - Applicable only for I(action=enable_database_management)I(action=modify_database_management). type: str api_user_key_file: description: - 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 C(config_file_location)). If the key is encrypted with a pass-phrase, the C(api_user_key_pass_phrase) option must also be provided. type: str credential_details: description: - '' - Required for I(action=enable_database_management). suboptions: password_secret_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure L(secret,https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyoverview.htm#concepts). required: true type: str user_name: description: - The name of the Oracle Database user that will be used to connect to the database. required: true type: str type: dict kms_key_version_id: description: - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. - Applicable only for I(action=migrate_vault_key). type: str config_profile_name: description: - The profile to load from the config file referenced by C(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 C(config_file_location). type: str tde_wallet_password: description: - The existing TDE wallet password of the database. - Applicable only for I(action=migrate_vault_key). type: str api_user_fingerprint: description: - 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 C(config_file_location)). To get the key pair's fingerprint value please refer U(https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm). type: str config_file_location: description: - 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. type: str private_end_point_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the private endpoint. - Required for I(action=enable_database_management). type: str api_user_key_pass_phrase: description: - Passphrase used by the key referenced in C(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 C(config_file_location)). type: str database_upgrade_source_details: description: - '' - Applicable only for I(action=upgrade). suboptions: database_software_image_id: description: - The database software image L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the image to be used to upgrade a database. - Required when source is 'DB_SOFTWARE_IMAGE' type: str db_home_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Database Home. - Required when source is 'DB_HOME' type: str db_version: description: - A valid Oracle Database version. To get a list of supported versions, use the L(ListDbVersions,https://docs.cloud.oracle.com/en- us/iaas/api/#/en/database/latest/DbVersionSummary/ListDbVersions) operation. - Required when source is 'DB_VERSION' type: str options: description: - 'Additional upgrade options supported by DBUA(Database Upgrade Assistant). Example: "-upgradeTimezone false -keepEvents"' type: str source: choices: - DB_HOME - DB_SOFTWARE_IMAGE - DB_VERSION description: - The source of the Oracle Database software to be used for the upgrade. - Use `DB_HOME` to specify an existing Database Home to upgrade the database. The database is moved to the target Database Home and makes use of the Oracle Database software version of the target Database Home. - Use `DB_VERSION` to specify a generally-available Oracle Database software version to upgrade the database. - Use `DB_SOFTWARE_IMAGE` to specify a L(database software image,https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/databasesoftwareimage.htm) to upgrade the database. required: true type: str type: dict
database: contains: character_set: description: - The character set for the database. returned: on success sample: character_set_example type: str compartment_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. returned: on success sample: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx type: str connection_strings: contains: all_connection_strings: description: - All connection strings to use to connect to the Database. returned: on success sample: {} type: dict cdb_default: description: - Host name based CDB Connection String. returned: on success sample: cdb_default_example type: str cdb_ip_default: description: - IP based CDB Connection String. returned: on success sample: cdb_ip_default_example type: str description: - The Connection strings used to connect to the Oracle Database. returned: on success type: complex database_management_config: contains: management_status: description: - The status of the Database Management service. returned: on success sample: ENABLING type: str management_type: description: - The Database Management type. returned: on success sample: BASIC type: str description: - '' returned: on success type: complex database_software_image_id: description: - The database software image L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) returned: on success sample: ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx type: str db_backup_config: contains: auto_backup_enabled: description: - If set to true, configures automatic backups. 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. returned: on success sample: true type: bool auto_backup_window: description: - Time window selected for initiating automatic backup for the database system. There are twelve available two-hour time windows. If no option is selected, a start time between 12:00 AM to 7:00 AM in the region of the database is automatically chosen. For example, if the user selects SLOT_TWO from the enum list, the automatic backup job will start in between 2:00 AM (inclusive) to 4:00 AM (exclusive). - 'Example: `SLOT_TWO`' returned: on success sample: SLOT_ONE type: str backup_destination_details: contains: id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the backup destination. returned: on success sample: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx type: str internet_proxy: description: - Proxy URL to connect to object store. returned: on success sample: internet_proxy_example type: str type: description: - Type of the database backup destination. returned: on success sample: NFS type: str vpc_password: description: - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. returned: on success sample: example-password type: str vpc_user: description: - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. returned: on success sample: vpc_user_example type: str description: - Backup destination details. returned: on success type: complex recovery_window_in_days: description: - Number of days between the current and the earliest point of recoverability covered by automatic backups. This value applies to automatic backups only. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. When the value is updated, it is applied to all existing automatic backups. returned: on success sample: 56 type: int description: - '' returned: on success type: complex db_home_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Database Home. returned: on success sample: ocid1.dbhome.oc1..xxxxxxEXAMPLExxxxxx type: str db_name: description: - The database name. returned: on success sample: db_name_example type: str db_system_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the DB system. returned: on success sample: ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx type: str db_unique_name: description: - A system-generated name for the database to ensure uniqueness within an Oracle Data Guard group (a primary database and its standby databases). The unique name cannot be changed. returned: on success sample: db_unique_name_example type: str db_workload: description: - The database workload type. returned: on success sample: db_workload_example type: str defined_tags: description: - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see L(Resource Tags,https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). returned: on success sample: Operations: CostCenter: US type: dict freeform_tags: description: - 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 L(Resource Tags,https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). - 'Example: `{"Department": "Finance"}`' returned: on success sample: Department: Finance type: dict id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the database. returned: on success sample: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx type: str is_cdb: description: - True if the database is a container database. returned: on success sample: true type: bool kms_key_id: description: - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. returned: on success sample: ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx type: str kms_key_version_id: description: - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. returned: on success sample: ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx type: str last_backup_timestamp: description: - The date and time when the latest database backup was created. returned: on success sample: '2013-10-20T19:20:30+01:00' type: str lifecycle_details: description: - Additional information about the current lifecycle state. returned: on success sample: lifecycle_details_example type: str lifecycle_state: description: - The current state of the database. returned: on success sample: PROVISIONING type: str ncharacter_set: description: - The national character set for the database. returned: on success sample: ncharacter_set_example type: str pdb_name: description: - The name of the pluggable database. The name must begin with an alphabetic character and can contain a maximum of thirty alphanumeric characters. Special characters are not permitted. Pluggable database should not be same as database name. returned: on success sample: pdb_name_example type: str sid_prefix: description: - Specifies a prefix for the `Oracle SID` of the database to be created. returned: on success sample: sid_prefix_example type: str source_database_point_in_time_recovery_timestamp: description: - Point in time recovery timeStamp of the source database at which cloned database system is cloned from the source database system, as described in L(RFC 3339,https://tools.ietf.org/rfc/rfc3339) returned: on success sample: '2013-10-20T19:20:30+01:00' type: str time_created: description: - The date and time the database was created. returned: on success sample: '2013-10-20T19:20:30+01:00' type: str vault_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure L(vault,https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyoverview.htm#concepts). returned: on success sample: ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx type: str vm_cluster_id: description: - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VM cluster. returned: on success sample: ocid1.vmcluster.oc1..xxxxxxEXAMPLExxxxxx type: str description: - Details of the Database resource acted upon by the current operation returned: on success sample: character_set: character_set_example compartment_id: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx connection_strings: all_connection_strings: {} cdb_default: cdb_default_example cdb_ip_default: cdb_ip_default_example database_management_config: management_status: ENABLING management_type: BASIC database_software_image_id: ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx db_backup_config: auto_backup_enabled: true auto_backup_window: SLOT_ONE backup_destination_details: - id: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx internet_proxy: internet_proxy_example type: NFS vpc_password: example-password vpc_user: vpc_user_example recovery_window_in_days: 56 db_home_id: ocid1.dbhome.oc1..xxxxxxEXAMPLExxxxxx db_name: db_name_example db_system_id: ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx db_unique_name: db_unique_name_example db_workload: db_workload_example defined_tags: Operations: CostCenter: US freeform_tags: Department: Finance id: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx is_cdb: true kms_key_id: ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx kms_key_version_id: ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx last_backup_timestamp: '2013-10-20T19:20:30+01:00' lifecycle_details: lifecycle_details_example lifecycle_state: PROVISIONING ncharacter_set: ncharacter_set_example pdb_name: pdb_name_example sid_prefix: sid_prefix_example source_database_point_in_time_recovery_timestamp: '2013-10-20T19:20:30+01:00' time_created: '2013-10-20T19:20:30+01:00' vault_id: ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx vm_cluster_id: ocid1.vmcluster.oc1..xxxxxxEXAMPLExxxxxx type: complex