oracle.oci.oci_database_management_tablespace_actions (5.0.0) — module

Perform actions on a Tablespace 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

Perform actions on a Tablespace resource in Oracle Cloud Infrastructure

For I(action=add_data_files), adds data files or temp files to the tablespace.

For I(action=drop), drops the tablespace specified by tablespaceName within the Managed Database specified by managedDatabaseId.

For I(action=remove_data_file), removes a data file or temp file from the tablespace.

For I(action=resize_data_file), resizes a data file or temp file within the tablespace.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Perform action add_data_files on tablespace
  oci_database_management_tablespace_actions:
    # required
    managed_database_id: "ocid1.manageddatabase.oc1..xxxxxxEXAMPLExxxxxx"
    tablespace_name: tablespace_name_example
    credential_details:
      # required
      password: example-password
      tablespace_admin_credential_type: PASSWORD
      username: username_example
      role: NORMAL
    file_type: DATAFILE
    action: add_data_files

    # optional
    data_files: [ "data_files_example" ]
    file_count: 56
    is_reusable: true
    file_size:
      # required
      size: 3.4

      # optional
      unit: BYTES
    is_auto_extensible: true
    auto_extend_next_size:
      # required
      size: 3.4

      # optional
      unit: BYTES
    auto_extend_max_size:
      # required
      size: 3.4

      # optional
      unit: BYTES
    is_max_size_unlimited: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Perform action drop on tablespace
  oci_database_management_tablespace_actions:
    # required
    managed_database_id: "ocid1.manageddatabase.oc1..xxxxxxEXAMPLExxxxxx"
    tablespace_name: tablespace_name_example
    credential_details:
      # required
      password: example-password
      tablespace_admin_credential_type: PASSWORD
      username: username_example
      role: NORMAL
    action: drop

    # optional
    is_including_contents: true
    is_dropping_data_files: true
    is_cascade_constraints: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Perform action remove_data_file on tablespace
  oci_database_management_tablespace_actions:
    # required
    managed_database_id: "ocid1.manageddatabase.oc1..xxxxxxEXAMPLExxxxxx"
    tablespace_name: tablespace_name_example
    credential_details:
      # required
      password: example-password
      tablespace_admin_credential_type: PASSWORD
      username: username_example
      role: NORMAL
    file_type: DATAFILE
    data_file: data_file_example
    action: remove_data_file
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Perform action resize_data_file on tablespace
  oci_database_management_tablespace_actions:
    # required
    managed_database_id: "ocid1.manageddatabase.oc1..xxxxxxEXAMPLExxxxxx"
    tablespace_name: tablespace_name_example
    credential_details:
      # required
      password: example-password
      tablespace_admin_credential_type: PASSWORD
      username: username_example
      role: NORMAL
    file_type: DATAFILE
    data_file: data_file_example
    action: resize_data_file

    # optional
    file_size:
      # required
      size: 3.4

      # optional
      unit: BYTES
    is_auto_extensible: true
    auto_extend_next_size:
      # required
      size: 3.4

      # optional
      unit: BYTES
    auto_extend_max_size:
      # required
      size: 3.4

      # optional
      unit: BYTES
    is_max_size_unlimited: true

Inputs

    
action:
    choices:
    - add_data_files
    - drop
    - remove_data_file
    - resize_data_file
    description:
    - The action to perform on the Tablespace.
    required: true
    type: str

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

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

data_file:
    description:
    - Name of the data file or temp file to be removed from the tablespace.
    - Required for I(action=remove_data_file), I(action=resize_data_file).
    type: str

file_size:
    description:
    - The size of each data file or temp file.
    - Applicable only for I(action=add_data_files)I(action=resize_data_file).
    suboptions:
      size:
        description:
        - Storage size number in bytes, kilobytes, megabytes, gigabytes, or terabytes.
        required: true
        type: float
      unit:
        choices:
        - BYTES
        - KILOBYTES
        - MEGABYTES
        - GIGABYTES
        - TERABYTES
        description:
        - 'Storage size unit: bytes, kilobytes, megabytes, gigabytes, or terabytes.'
        type: str
    type: dict

file_type:
    choices:
    - DATAFILE
    - TEMPFILE
    description:
    - Specifies whether the file is a data file or temp file.
    - Required for I(action=add_data_files), I(action=remove_data_file), I(action=resize_data_file).
    type: str

data_files:
    description:
    - The list of data files or temp files added to the tablespace.
    - Applicable only for I(action=add_data_files).
    elements: str
    type: list

file_count:
    description:
    - The number of data files or temp files to be added for the tablespace. This is for
      Oracle Managed Files only.
    - Applicable only for I(action=add_data_files).
    type: int

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

is_reusable:
    description:
    - Specifies whether Oracle can reuse the data file or temp file. Reuse is only allowed
      when the file name is provided.
    - Applicable only for I(action=add_data_files).
    type: bool

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

tablespace_name:
    description:
    - The name of the tablespace.
    required: true
    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: true
    suboptions:
      password:
        description:
        - The database user's password encoded using BASE64 scheme.
        - Required when tablespace_admin_credential_type is 'PASSWORD'
        type: str
      password_secret_id:
        description:
        - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
          of the Secret where the database password is stored.
        - Required when tablespace_admin_credential_type is 'SECRET'
        type: str
      role:
        choices:
        - NORMAL
        - SYSDBA
        description:
        - The role of the database user.
        required: true
        type: str
      tablespace_admin_credential_type:
        choices:
        - PASSWORD
        - SECRET
        description:
        - The type of the credential for tablespace administration tasks.
        required: true
        type: str
      username:
        description:
        - The user to connect to the database.
        required: true
        type: str
    type: dict

is_auto_extensible:
    description:
    - Specifies whether the data file or temp file can be extended automatically.
    - Applicable only for I(action=add_data_files)I(action=resize_data_file).
    type: bool

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

managed_database_id:
    description:
    - The L(OCID,https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
      of the Managed Database.
    required: true
    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

auto_extend_max_size:
    description:
    - The maximum disk space allowed for automatic extension of the data files or temp
      files.
    - Applicable only for I(action=add_data_files)I(action=resize_data_file).
    suboptions:
      size:
        description:
        - Storage size number in bytes, kilobytes, megabytes, gigabytes, or terabytes.
        required: true
        type: float
      unit:
        choices:
        - BYTES
        - KILOBYTES
        - MEGABYTES
        - GIGABYTES
        - TERABYTES
        description:
        - 'Storage size unit: bytes, kilobytes, megabytes, gigabytes, or terabytes.'
        type: str
    type: dict

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

auto_extend_next_size:
    description:
    - The size of the next increment of disk space to be allocated automatically when
      more extents are required.
    - Applicable only for I(action=add_data_files)I(action=resize_data_file).
    suboptions:
      size:
        description:
        - Storage size number in bytes, kilobytes, megabytes, gigabytes, or terabytes.
        required: true
        type: float
      unit:
        choices:
        - BYTES
        - KILOBYTES
        - MEGABYTES
        - GIGABYTES
        - TERABYTES
        description:
        - 'Storage size unit: bytes, kilobytes, megabytes, gigabytes, or terabytes.'
        type: str
    type: dict

is_including_contents:
    description:
    - Specifies whether all the contents of the tablespace being dropped should be dropped.
    - Applicable only for I(action=drop).
    type: bool

is_max_size_unlimited:
    description:
    - Specifies whether the disk space of the data file or temp file can be limited.
    - Applicable only for I(action=add_data_files)I(action=resize_data_file).
    type: bool

is_cascade_constraints:
    description:
    - Specifies whether all the constraints on the tablespace being dropped should be
      dropped.
    - Applicable only for I(action=drop).
    type: bool

is_dropping_data_files:
    description:
    - Specifies whether all the associated data files of the tablespace being dropped
      should be dropped.
    - Applicable only for I(action=drop).
    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

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

tablespace_admin_status:
  contains:
    error_code:
      description:
      - The error code that denotes failure if the tablespace admin action is not
        successful. The error code is "null" if the admin action is successful.
      returned: on success
      sample: 56
      type: int
    error_message:
      description:
      - The error message that indicates the reason for failure if the tablespace
        admin action is not successful. The error message is "null" if the admin action
        is successful.
      returned: on success
      sample: error_message_example
      type: str
    status:
      description:
      - The status of a tablespace admin action.
      returned: on success
      sample: SUCCEEDED
      type: str
  description:
  - Details of the Tablespace resource acted upon by the current operation
  returned: on success
  sample:
    error_code: 56
    error_message: error_message_example
    status: SUCCEEDED
  type: complex