oracle.oci.oci_database_db_home (5.0.0) — module

Manage a DbHome resource in Oracle Cloud Infrastructure

| "added in version" 2.9.0 of oracle.oci"

Authors: Oracle (@oracle)

preview | supported by community

Install collection

Install with ansible-galaxy collection install oracle.oci:==5.0.0


Add to requirements.yml

  collections:
    - name: oracle.oci
      version: 5.0.0

Description

This module allows the user to create, update and delete a DbHome resource in Oracle Cloud Infrastructure

For I(state=present), 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.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create db_home with source = DATABASE
  oci_database_db_home:
    # required
    db_system_id: "ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx"
    source: DATABASE
    database:
      # required
      admin_password: example-password

      # optional
      database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx"
      time_stamp_for_point_in_time_recovery: time_stamp_for_point_in_time_recovery_example
      backup_id: "ocid1.backup.oc1..xxxxxxEXAMPLExxxxxx"
      backup_tde_password: example-password
      pluggable_databases: [ "pluggable_databases_example" ]
      db_name: db_name_example
      db_unique_name: db_unique_name_example
      database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
      pdb_name: pdb_name_example
      tde_wallet_password: example-password
      character_set: character_set_example
      ncharacter_set: ncharacter_set_example
      db_workload: OLTP
      db_backup_config:
        # optional
        auto_backup_enabled: true
        recovery_window_in_days: 56
        auto_backup_window: SLOT_ONE
        auto_full_backup_window: SLOT_ONE
        auto_full_backup_day: SUNDAY
        run_immediate_full_backup: true
        backup_destination_details:
        - # required
          type: NFS

          # optional
          id: "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx"
          vpc_user: vpc_user_example
          vpc_password: example-password
          internet_proxy: internet_proxy_example
          dbrs_policy_id: "ocid1.dbrspolicy.oc1..xxxxxxEXAMPLExxxxxx"
        backup_deletion_policy: DELETE_IMMEDIATELY
      freeform_tags: {'Department': 'Finance'}
      defined_tags: {'Operations': {'CostCenter': 'US'}}
      kms_key_id: "ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx"
      kms_key_version_id: "ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx"
      vault_id: "ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx"
      sid_prefix: sid_prefix_example

    # optional
    display_name: display_name_example
    kms_key_id: "ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx"
    kms_key_version_id: "ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx"
    database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
    is_desupported_version: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create db_home with source = DB_BACKUP
  oci_database_db_home:
    # required
    db_system_id: "ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx"
    source: DB_BACKUP
    database:
      # required
      admin_password: example-password

      # optional
      database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx"
      time_stamp_for_point_in_time_recovery: time_stamp_for_point_in_time_recovery_example
      backup_id: "ocid1.backup.oc1..xxxxxxEXAMPLExxxxxx"
      backup_tde_password: example-password
      pluggable_databases: [ "pluggable_databases_example" ]
      db_name: db_name_example
      db_unique_name: db_unique_name_example
      database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
      pdb_name: pdb_name_example
      tde_wallet_password: example-password
      character_set: character_set_example
      ncharacter_set: ncharacter_set_example
      db_workload: OLTP
      db_backup_config:
        # optional
        auto_backup_enabled: true
        recovery_window_in_days: 56
        auto_backup_window: SLOT_ONE
        auto_full_backup_window: SLOT_ONE
        auto_full_backup_day: SUNDAY
        run_immediate_full_backup: true
        backup_destination_details:
        - # required
          type: NFS

          # optional
          id: "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx"
          vpc_user: vpc_user_example
          vpc_password: example-password
          internet_proxy: internet_proxy_example
          dbrs_policy_id: "ocid1.dbrspolicy.oc1..xxxxxxEXAMPLExxxxxx"
        backup_deletion_policy: DELETE_IMMEDIATELY
      freeform_tags: {'Department': 'Finance'}
      defined_tags: {'Operations': {'CostCenter': 'US'}}
      kms_key_id: "ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx"
      kms_key_version_id: "ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx"
      vault_id: "ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx"
      sid_prefix: sid_prefix_example

    # optional
    display_name: display_name_example
    kms_key_id: "ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx"
    kms_key_version_id: "ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx"
    database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
    is_desupported_version: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create db_home with source = VM_CLUSTER_BACKUP
  oci_database_db_home:
    # required
    source: VM_CLUSTER_BACKUP
    vm_cluster_id: "ocid1.vmcluster.oc1..xxxxxxEXAMPLExxxxxx"
    database:
      # required
      admin_password: example-password

      # optional
      database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx"
      time_stamp_for_point_in_time_recovery: time_stamp_for_point_in_time_recovery_example
      backup_id: "ocid1.backup.oc1..xxxxxxEXAMPLExxxxxx"
      backup_tde_password: example-password
      pluggable_databases: [ "pluggable_databases_example" ]
      db_name: db_name_example
      db_unique_name: db_unique_name_example
      database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
      pdb_name: pdb_name_example
      tde_wallet_password: example-password
      character_set: character_set_example
      ncharacter_set: ncharacter_set_example
      db_workload: OLTP
      db_backup_config:
        # optional
        auto_backup_enabled: true
        recovery_window_in_days: 56
        auto_backup_window: SLOT_ONE
        auto_full_backup_window: SLOT_ONE
        auto_full_backup_day: SUNDAY
        run_immediate_full_backup: true
        backup_destination_details:
        - # required
          type: NFS

          # optional
          id: "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx"
          vpc_user: vpc_user_example
          vpc_password: example-password
          internet_proxy: internet_proxy_example
          dbrs_policy_id: "ocid1.dbrspolicy.oc1..xxxxxxEXAMPLExxxxxx"
        backup_deletion_policy: DELETE_IMMEDIATELY
      freeform_tags: {'Department': 'Finance'}
      defined_tags: {'Operations': {'CostCenter': 'US'}}
      kms_key_id: "ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx"
      kms_key_version_id: "ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx"
      vault_id: "ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx"
      sid_prefix: sid_prefix_example

    # optional
    display_name: display_name_example
    kms_key_id: "ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx"
    kms_key_version_id: "ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx"
    database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
    is_desupported_version: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create db_home with source = NONE
  oci_database_db_home:
    # required
    db_system_id: "ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    display_name: display_name_example
    kms_key_id: "ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx"
    kms_key_version_id: "ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx"
    database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
    source: NONE
    is_desupported_version: true
    db_version: db_version_example
    database:
      # required
      admin_password: example-password

      # optional
      database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx"
      time_stamp_for_point_in_time_recovery: time_stamp_for_point_in_time_recovery_example
      backup_id: "ocid1.backup.oc1..xxxxxxEXAMPLExxxxxx"
      backup_tde_password: example-password
      pluggable_databases: [ "pluggable_databases_example" ]
      db_name: db_name_example
      db_unique_name: db_unique_name_example
      database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
      pdb_name: pdb_name_example
      tde_wallet_password: example-password
      character_set: character_set_example
      ncharacter_set: ncharacter_set_example
      db_workload: OLTP
      db_backup_config:
        # optional
        auto_backup_enabled: true
        recovery_window_in_days: 56
        auto_backup_window: SLOT_ONE
        auto_full_backup_window: SLOT_ONE
        auto_full_backup_day: SUNDAY
        run_immediate_full_backup: true
        backup_destination_details:
        - # required
          type: NFS

          # optional
          id: "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx"
          vpc_user: vpc_user_example
          vpc_password: example-password
          internet_proxy: internet_proxy_example
          dbrs_policy_id: "ocid1.dbrspolicy.oc1..xxxxxxEXAMPLExxxxxx"
        backup_deletion_policy: DELETE_IMMEDIATELY
      freeform_tags: {'Department': 'Finance'}
      defined_tags: {'Operations': {'CostCenter': 'US'}}
      kms_key_id: "ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx"
      kms_key_version_id: "ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx"
      vault_id: "ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx"
      sid_prefix: sid_prefix_example
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create db_home with source = VM_CLUSTER_NEW
  oci_database_db_home:
    # required
    source: VM_CLUSTER_NEW
    vm_cluster_id: "ocid1.vmcluster.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    display_name: display_name_example
    kms_key_id: "ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx"
    kms_key_version_id: "ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx"
    database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
    is_desupported_version: true
    db_version: db_version_example
    database:
      # required
      admin_password: example-password

      # optional
      database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx"
      time_stamp_for_point_in_time_recovery: time_stamp_for_point_in_time_recovery_example
      backup_id: "ocid1.backup.oc1..xxxxxxEXAMPLExxxxxx"
      backup_tde_password: example-password
      pluggable_databases: [ "pluggable_databases_example" ]
      db_name: db_name_example
      db_unique_name: db_unique_name_example
      database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
      pdb_name: pdb_name_example
      tde_wallet_password: example-password
      character_set: character_set_example
      ncharacter_set: ncharacter_set_example
      db_workload: OLTP
      db_backup_config:
        # optional
        auto_backup_enabled: true
        recovery_window_in_days: 56
        auto_backup_window: SLOT_ONE
        auto_full_backup_window: SLOT_ONE
        auto_full_backup_day: SUNDAY
        run_immediate_full_backup: true
        backup_destination_details:
        - # required
          type: NFS

          # optional
          id: "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx"
          vpc_user: vpc_user_example
          vpc_password: example-password
          internet_proxy: internet_proxy_example
          dbrs_policy_id: "ocid1.dbrspolicy.oc1..xxxxxxEXAMPLExxxxxx"
        backup_deletion_policy: DELETE_IMMEDIATELY
      freeform_tags: {'Department': 'Finance'}
      defined_tags: {'Operations': {'CostCenter': 'US'}}
      kms_key_id: "ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx"
      kms_key_version_id: "ocid1.kmskeyversion.oc1..xxxxxxEXAMPLExxxxxx"
      vault_id: "ocid1.vault.oc1..xxxxxxEXAMPLExxxxxx"
      sid_prefix: sid_prefix_example
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update db_home
  oci_database_db_home:
    # required
    db_home_id: "ocid1.dbhome.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    patch_details:
      # optional
      patch_id: "ocid1.patch.oc1..xxxxxxEXAMPLExxxxxx"
      database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
      action: APPLY
    one_off_patches: [ "one_off_patches_example" ]
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update db_home using name (when environment variable OCI_USE_NAME_AS_IDENTIFIER is set)
  oci_database_db_home:
    # required
    display_name: display_name_example
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    patch_details:
      # optional
      patch_id: "ocid1.patch.oc1..xxxxxxEXAMPLExxxxxx"
      database_software_image_id: "ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx"
      action: APPLY
    one_off_patches: [ "one_off_patches_example" ]
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete db_home
  oci_database_db_home:
    # required
    db_home_id: "ocid1.dbhome.oc1..xxxxxxEXAMPLExxxxxx"
    state: absent

    # optional
    perform_final_backup: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete db_home using name (when environment variable OCI_USE_NAME_AS_IDENTIFIER is set)
  oci_database_db_home:
    # required
    display_name: display_name_example
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
    state: absent

Inputs

    
wait:
    default: true
    description: Whether to wait for create or delete operation to complete.
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description:
    - The state of the DbHome.
    - Use I(state=present) to create or update a DbHome.
    - Use I(state=absent) to delete a DbHome.
    required: false
    type: str

key_by:
    description: The list of attributes of this resource which should be used to uniquely
      identify an instance of the resource. By default, all the attributes of a resource
      are used to uniquely identify a resource.
    elements: str
    type: list

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

source:
    choices:
    - DATABASE
    - DB_BACKUP
    - VM_CLUSTER_BACKUP
    - NONE
    - VM_CLUSTER_NEW
    default: NONE
    description:
    - 'The source of database: NONE for creating a new database. DB_BACKUP for creating
      a new database by restoring from a database backup.'
    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

database:
    description:
    - ''
    - Required when source is one of ['VM_CLUSTER_BACKUP', 'DATABASE', 'DB_BACKUP']
    suboptions:
      admin_password:
        description:
        - 'A strong password for SYS, SYSTEM, PDB Admin and TDE Wallet. The password must
          be at least nine characters and contain at least two uppercase, two lowercase,
          two numbers, and two special characters. The special characters must be _, #,
          or -.'
        required: true
        type: str
      backup_id:
        description:
        - The backup L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm).
        - Required when source is one of ['VM_CLUSTER_BACKUP', 'DB_BACKUP']
        type: str
      backup_tde_password:
        description:
        - The password to open the TDE wallet.
        - Applicable when source is one of ['VM_CLUSTER_BACKUP', 'DATABASE', 'DB_BACKUP']
        type: str
      character_set:
        description:
        - 'The character set for the database.  The default is AL32UTF8. Allowed values
          are:'
        - AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6,
          AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707,
          AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257,
          BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R,
          CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS,
          EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S,
          EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8,
          IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,
          JA16VMS, KO16KSC5601, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921,
          LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10,
          NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII,
          TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258,
          VN8VN3, WE8DEC, WE8DG, WE8ISO8859P1, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S,
          WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8,
          ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950,
          ZHT32EUC, ZHT32SOPS, ZHT32TRIS
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        type: str
      database_id:
        description:
        - The database L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm).
        - Required when source is 'DATABASE'
        type: str
      database_software_image_id:
        description:
        - The database software image L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        type: str
      db_backup_config:
        description:
        - ''
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        suboptions:
          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.
            - Applicable when source is 'NONE'
            type: bool
          auto_backup_window:
            choices:
            - SLOT_ONE
            - SLOT_TWO
            - SLOT_THREE
            - SLOT_FOUR
            - SLOT_FIVE
            - SLOT_SIX
            - SLOT_SEVEN
            - SLOT_EIGHT
            - SLOT_NINE
            - SLOT_TEN
            - SLOT_ELEVEN
            - SLOT_TWELVE
            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`'
            - Applicable when source is 'NONE'
            type: str
          auto_full_backup_day:
            choices:
            - SUNDAY
            - MONDAY
            - TUESDAY
            - WEDNESDAY
            - THURSDAY
            - FRIDAY
            - SATURDAY
            description:
            - Day of the week the full backup should be applied on the database system.
              If no option is selected, the value is null and we will default to Sunday.
            - Applicable when source is 'NONE'
            type: str
          auto_full_backup_window:
            choices:
            - SLOT_ONE
            - SLOT_TWO
            - SLOT_THREE
            - SLOT_FOUR
            - SLOT_FIVE
            - SLOT_SIX
            - SLOT_SEVEN
            - SLOT_EIGHT
            - SLOT_NINE
            - SLOT_TEN
            - SLOT_ELEVEN
            - SLOT_TWELVE
            description:
            - Time window selected for initiating full backup for the database system.
              There are twelve available two-hour time windows. If no option is selected,
              the value is null and 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`'
            - Applicable when source is 'NONE'
            type: str
          backup_deletion_policy:
            choices:
            - DELETE_IMMEDIATELY
            - DELETE_AFTER_RETENTION_PERIOD
            description:
            - This defines when the backups will be deleted. - IMMEDIATE option keep the
              backup for predefined time i.e 72 hours and then delete permanently... -
              RETAIN will keep the backups as per the policy defined for database backups.
            - Applicable when source is 'NONE'
            type: str
          backup_destination_details:
            description:
            - Backup destination details.
            - Applicable when source is 'NONE'
            elements: dict
            suboptions:
              dbrs_policy_id:
                description:
                - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
                  of the DBRS policy used for backup.
                - Applicable when source is 'NONE'
                type: str
              id:
                description:
                - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
                  of the backup destination.
                - Applicable when source is 'NONE'
                type: str
              internet_proxy:
                description:
                - Proxy URL to connect to object store.
                - Applicable when source is 'NONE'
                type: str
              type:
                choices:
                - NFS
                - RECOVERY_APPLIANCE
                - OBJECT_STORE
                - LOCAL
                - DBRS
                description:
                - Type of the database backup destination.
                - Required when source is 'NONE'
                required: true
                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.
                - Applicable when source is 'NONE'
                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.
                - Applicable when source is 'NONE'
                type: str
            type: list
          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.
            - Applicable when source is 'NONE'
            type: int
          run_immediate_full_backup:
            description:
            - If set to true, configures automatic full backups in the local region (the
              region of the DB system) for the first backup run immediately.
            - Applicable when source is 'NONE'
            type: bool
        type: dict
      db_name:
        description:
        - The display name of the database to be created from the backup. It must begin
          with an alphabetic character and can contain a maximum of eight alphanumeric
          characters. Special characters are not permitted.
        - Required when source is one of ['VM_CLUSTER_NEW', 'NONE']
        type: str
      db_unique_name:
        description:
        - The `DB_UNIQUE_NAME` of the Oracle Database being backed up.
        type: str
      db_workload:
        choices:
        - OLTP
        - DSS
        description:
        - '**Deprecated.** The dbWorkload field has been deprecated for Exadata Database
          Service on Dedicated Infrastructure, Exadata Database Service on Cloud@Customer,
          and Base Database Service. Support for this attribute will end in November 2023.
          You may choose to update your custom scripts to exclude the dbWorkload attribute.
          After November 2023 if you pass a value to the dbWorkload attribute, it will
          be ignored.'
        - The database workload type.
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        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).
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        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"}`'
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        type: dict
      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.
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        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. Autonomous Database Serverless does not use key versions, hence is
          not applicable for Autonomous Database Serverless instances.
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        type: str
      ncharacter_set:
        description:
        - 'The national character set for the database.  The default is AL16UTF16. Allowed
          values are: AL16UTF16 or UTF8.'
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        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.
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        type: str
      pluggable_databases:
        description:
        - The list of pluggable databases that needs to be restored into new database.
        - Applicable when source is one of ['VM_CLUSTER_BACKUP', 'DATABASE', 'DB_BACKUP']
        elements: str
        type: list
      sid_prefix:
        description:
        - Specifies a prefix for the `Oracle SID` of the database to be created.
        - Applicable when source is one of ['VM_CLUSTER_BACKUP', 'VM_CLUSTER_NEW', 'NONE',
          'DB_BACKUP']
        type: str
      tde_wallet_password:
        description:
        - 'The optional password to open the TDE wallet. The password must be at least
          nine characters and contain at least two uppercase, two lowercase, two numeric,
          and two special characters. The special characters must be _, #, or -.'
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        type: str
      time_stamp_for_point_in_time_recovery:
        description:
        - The point in time of the original database from which the new database is created.
          If not specifed, the latest backup is used to create the database.
        - Applicable when source is 'DATABASE'
        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).
          This parameter and `secretId` are required for Customer Managed Keys.
        - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
        type: str
    type: dict

auth_type:
    choices:
    - api_key
    - instance_principal
    - instance_obo_user
    - resource_principal
    - security_token
    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

db_home_id:
    aliases:
    - id
    description:
    - The Database Home L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm).
    - Required for update using I(state=present) when environment variable C(OCI_USE_NAME_AS_IDENTIFIER)
      is not set.
    - Required for delete using I(state=absent) when environment variable C(OCI_USE_NAME_AS_IDENTIFIER)
      is not set.
    type: str

db_version:
    description:
    - A valid Oracle Database version. For a list of supported versions, use the ListDbVersions
      operation.
    - 'This cannot be updated in parallel with any of the following: licenseModel, dbEdition,
      cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired,
      openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, isRefreshable,
      dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.'
    - Applicable when source is one of ['VM_CLUSTER_NEW', 'NONE']
    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.
    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

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

db_system_id:
    description:
    - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
      of the DB system.
    - Required when source is one of ['DATABASE', 'NONE', 'DB_BACKUP']
    type: str

display_name:
    aliases:
    - name
    description:
    - The user-provided name of the Database Home.
    - Required for create, update, delete when environment variable C(OCI_USE_NAME_AS_IDENTIFIER)
      is set.
    type: str

force_create:
    default: false
    description: Whether to attempt non-idempotent creation of a resource. By default,
      create resource is an idempotent operation, and doesn't create the resource if it
      already exists. Setting this option to true, forcefully creates a copy of the resource,
      even if it already exists.This option is mutually exclusive with I(key_by).
    type: bool

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

patch_details:
    description:
    - ''
    - This parameter is updatable.
    suboptions:
      action:
        choices:
        - APPLY
        - PRECHECK
        description:
        - The action to perform on the patch.
        - This parameter is updatable.
        type: str
      database_software_image_id:
        description:
        - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
          of the database software image.
        - This parameter is updatable.
        type: str
      patch_id:
        description:
        - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
          of the patch.
        - This parameter is updatable.
        type: str
    type: dict

vm_cluster_id:
    description:
    - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
      of the VM cluster.
    - Required when source is one of ['VM_CLUSTER_BACKUP', 'VM_CLUSTER_NEW']
    type: str

compartment_id:
    description:
    - The compartment L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm).
    - Required for create using I(state=present).
    - Required for update when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is set.
    - Required for delete when environment variable C(OCI_USE_NAME_AS_IDENTIFIER) is set.
    type: str

one_off_patches:
    description:
    - List of one-off patches for Database Homes.
    - This parameter is updatable.
    elements: str
    type: list

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

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. Autonomous
      Database Serverless does not use key versions, hence is not applicable for Autonomous
      Database Serverless instances.
    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

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

perform_final_backup:
    description:
    - Whether 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.
    type: bool

is_desupported_version:
    description:
    - If true, the customer acknowledges that the specified Oracle Database software is
      an older release that is not currently supported by OCI.
    type: bool

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_software_image_id:
    description:
    - The database software image L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
    type: str

realm_specific_endpoint_template_enabled:
    description:
    - Enable/Disable realm specific endpoint template for service client. By Default,
      realm specific endpoint template is disabled. If not set, then the value of the
      OCI_REALM_SPECIFIC_SERVICE_ENDPOINT_TEMPLATE_ENABLED variable, if any, is used.
    type: bool

Outputs

db_home:
  contains:
    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
    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_home_location:
      description:
      - The location of the Oracle Database Home.
      returned: on success
      sample: db_home_location_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_version:
      description:
      - The Oracle Database version.
      returned: on success
      sample: db_version_example
      type: str
    display_name:
      description:
      - The user-provided name for the Database Home. The name does not need to be
        unique.
      returned: on success
      sample: display_name_example
      type: str
    id:
      description:
      - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        of the Database Home.
      returned: on success
      sample: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
      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.
      returned: on success
      sample: ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx
      type: str
    last_patch_history_entry_id:
      description:
      - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
        of the last patch history. This value is updated as soon as a patch operation
        is started.
      returned: on success
      sample: ocid1.lastpatchhistoryentry.oc1..xxxxxxEXAMPLExxxxxx
      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 Home.
      returned: on success
      sample: PROVISIONING
      type: str
    one_off_patches:
      description:
      - List of one-off patches for Database Homes.
      returned: on success
      sample: []
      type: list
    time_created:
      description:
      - The date and time the Database Home was created.
      returned: on success
      sample: '2013-10-20T19:20:30+01:00'
      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 DbHome resource acted upon by the current operation
  returned: on success
  sample:
    compartment_id: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
    database_software_image_id: ocid1.databasesoftwareimage.oc1..xxxxxxEXAMPLExxxxxx
    db_home_location: db_home_location_example
    db_system_id: ocid1.dbsystem.oc1..xxxxxxEXAMPLExxxxxx
    db_version: db_version_example
    display_name: display_name_example
    id: ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
    kms_key_id: ocid1.kmskey.oc1..xxxxxxEXAMPLExxxxxx
    last_patch_history_entry_id: ocid1.lastpatchhistoryentry.oc1..xxxxxxEXAMPLExxxxxx
    lifecycle_details: lifecycle_details_example
    lifecycle_state: PROVISIONING
    one_off_patches: []
    time_created: '2013-10-20T19:20:30+01:00'
    vm_cluster_id: ocid1.vmcluster.oc1..xxxxxxEXAMPLExxxxxx
  type: complex