oracle.oci.oci_database_management_tablespace_actions – Perform actions on a Tablespace 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_management_tablespace_actions.

New in version 2.9.0: of oracle.oci

Synopsis

  • Perform actions on a Tablespace resource in Oracle Cloud Infrastructure

  • For action=add_data_files, adds data files or temp files to the tablespace.

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

  • For action=remove_data_file, removes a data file or temp file from the tablespace.

  • For action=resize_data_file, resizes a data file or temp file within the tablespace.

Requirements

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

Parameters

Parameter Choices/Defaults Comments
action
string / required
    Choices:
  • add_data_files
  • drop
  • remove_data_file
  • resize_data_file
The action to perform on the Tablespace.
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.
auto_extend_max_size
dictionary
The maximum disk space allowed for automatic extension of the data files or temp files.
Applicable only for action=add_data_filesaction=resize_data_file.
size
float / required
Storage size number in bytes, kilobytes, megabytes, gigabytes, or terabytes.
unit
string
    Choices:
  • BYTES
  • KILOBYTES
  • MEGABYTES
  • GIGABYTES
  • TERABYTES
Storage size unit: bytes, kilobytes, megabytes, gigabytes, or terabytes.
auto_extend_next_size
dictionary
The size of the next increment of disk space to be allocated automatically when more extents are required.
Applicable only for action=add_data_filesaction=resize_data_file.
size
float / required
Storage size number in bytes, kilobytes, megabytes, gigabytes, or terabytes.
unit
string
    Choices:
  • BYTES
  • KILOBYTES
  • MEGABYTES
  • GIGABYTES
  • TERABYTES
Storage size unit: bytes, kilobytes, megabytes, gigabytes, or terabytes.
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.
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.
credential_details
dictionary / required
password
string
The database user's password encoded using BASE64 scheme.
Required when tablespace_admin_credential_type is 'PASSWORD'
password_secret_id
string
The OCID of the Secret where the database password is stored.
Required when tablespace_admin_credential_type is 'SECRET'
role
string / required
    Choices:
  • NORMAL
  • SYSDBA
The role of the database user.
tablespace_admin_credential_type
string / required
    Choices:
  • PASSWORD
  • SECRET
The type of the credential for tablespace administration tasks.
username
string / required
The user to connect to the database.
data_file
string
Name of the data file or temp file to be removed from the tablespace.
Required for action=remove_data_file, action=resize_data_file.
data_files
list / elements=string
The list of data files or temp files added to the tablespace.
Applicable only for action=add_data_files.
file_count
integer
The number of data files or temp files to be added for the tablespace. This is for Oracle Managed Files only.
Applicable only for action=add_data_files.
file_size
dictionary
The size of each data file or temp file.
Applicable only for action=add_data_filesaction=resize_data_file.
size
float / required
Storage size number in bytes, kilobytes, megabytes, gigabytes, or terabytes.
unit
string
    Choices:
  • BYTES
  • KILOBYTES
  • MEGABYTES
  • GIGABYTES
  • TERABYTES
Storage size unit: bytes, kilobytes, megabytes, gigabytes, or terabytes.
file_type
string
    Choices:
  • DATAFILE
  • TEMPFILE
Specifies whether the file is a data file or temp file.
Required for action=add_data_files, action=remove_data_file, action=resize_data_file.
is_auto_extensible
boolean
    Choices:
  • no
  • yes
Specifies whether the data file or temp file can be extended automatically.
Applicable only for action=add_data_filesaction=resize_data_file.
is_cascade_constraints
boolean
    Choices:
  • no
  • yes
Specifies whether all the constraints on the tablespace being dropped should be dropped.
Applicable only for action=drop.
is_dropping_data_files
boolean
    Choices:
  • no
  • yes
Specifies whether all the associated data files of the tablespace being dropped should be dropped.
Applicable only for action=drop.
is_including_contents
boolean
    Choices:
  • no
  • yes
Specifies whether all the contents of the tablespace being dropped should be dropped.
Applicable only for action=drop.
is_max_size_unlimited
boolean
    Choices:
  • no
  • yes
Specifies whether the disk space of the data file or temp file can be limited.
Applicable only for action=add_data_filesaction=resize_data_file.
is_reusable
boolean
    Choices:
  • no
  • yes
Specifies whether Oracle can reuse the data file or temp file. Reuse is only allowed when the file name is provided.
Applicable only for action=add_data_files.
managed_database_id
string / required
The OCID of the Managed Database.
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.
tablespace_name
string / required
The name of the tablespace.
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

Examples

- 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

- 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

- 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

- 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

Return Values

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

Key Returned Description
tablespace_admin_status
complex
on success
Details of the Tablespace resource acted upon by the current operation

Sample:
{'error_code': 56, 'error_message': 'error_message_example', 'status': 'SUCCEEDED'}
 
error_code
integer
on success
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.

Sample:
56
 
error_message
string
on success
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.

Sample:
error_message_example
 
status
string
on success
The status of a tablespace admin action.

Sample:
SUCCEEDED


Authors

  • Oracle (@oracle)