ari_stark.ansible_oracle_modules.oracle_tablespace (1.2.1) — module

Manage Oracle tablespace objects

| "added in version" 0.8.0 of ari_stark.ansible_oracle_modules"

Authors: Mikael Sandström (@oravirt), Ari Stark (@ari-stark)

Install collection

Install with ansible-galaxy collection install ari_stark.ansible_oracle_modules:==1.2.1


Add to requirements.yml

  collections:
    - name: ari_stark.ansible_oracle_modules
      version: 1.2.1

Description

This module manage Oracle tablespace objects.

It can create, alter or drop tablespaces and datafiles.

It supports permanent, undo and temporary tablespaces.

It supports online/offline state and read only/read write state.

It doesn't support defining default tablespace and other more specific actions.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Set a new normal tablespace
- oracle_tablespace:
    hostname: db-server-scan
    service_name: orcl
    username: system
    password: manager
    tablespace: test
    datafile: '+DATA'
    size: 100M
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a new bigfile temporary tablespace with autoextend on and maxsize set
- oracle_tablespace:
    hostname: db-server
    service_name: orcl
    username: system
    password: manager
    tablespace: test
    datafile: '+DATA'
    content: temp
    size: 100M
    state: present
    bigfile: true
    autoextend: true
    next: 100M
    maxsize: 20G
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Drop a tablespace
- oracle_tablespace:
    hostname: localhost
    service_name: orcl
    username: system
    password: manager
    tablespace: test
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Make a tablespace read only
- oracle_tablespace:
    hostname: localhost
    service_name: orcl
    username: system
    password: manager
    tablespace: test
    datafile: '+DATA'
    size: 100M
    read_only: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Make a tablespace offline
- oracle_tablespace:
    hostname: localhost
    service_name: orcl
    username: system
    password: manager
    tablespace: test
    datafile: '+DATA'
    size: 100M
    state: offline

Inputs

    
mode:
    choices:
    - normal
    - sysdba
    default: normal
    description:
    - This option is the database administration privileges.
    type: str

port:
    default: 1521
    description:
    - Specify the listening port on the database server.
    type: int

size:
    description:
    - Specify the size of the datafile (10M, 10G, 150G, etc.).
    - This parameter is ignored when I(state=absent).
    - This parameter is required when I(state!=absent).
    type: str

state:
    choices:
    - present
    - online
    - offline
    - absent
    default: present
    description:
    - Specify the state of the tablespace/datafile.
    - I(state=present) and I(state=online) are synonymous.
    - If I(state=absent), the tablespace will be droped, including all datafiles.
    type: str

bigfile:
    default: false
    description:
    - This parameters indicates if the tablespace use one bigfile.
    - A tablespace can't be switch from smallfile to bigfile, and conversely.
    - This parameter is ignored when I(state=absent).
    type: bool

content:
    choices:
    - permanent
    - temp
    - undo
    default: permanent
    description:
    - The type of the tablespace to create/alter.
    - A tablespace's content can't be changed.
    - This parameter is ignored when I(state=absent).
    type: str

default:
    default: false
    description:
    - Define if this tablespace must be set as default database tablespace.
    - If I(default=True), the tablespace is set as the default tablespace.
    - If I(default=False), nothing is done, even if the tablespace is set as the default
      tablespace in database.
    - This option has no sense with an undo tablespace.
    type: bool

maxsize:
    aliases:
    - max
    description:
    - If I(autoextend=yes), the maximum size of the datafile (1M, 50M, 1G, etc.).
    - If not set, defaults to database limits.
    - This parameter is ignored when I(state=absent).
    type: str

hostname:
    default: localhost
    description:
    - Specify the host name or IP address of the database server computer.
    type: str

nextsize:
    aliases:
    - next
    description:
    - If I(autoextend=yes), the size of the next extent allocated (1M, 50M, 1G, etc.).
    - If not set, defaults to database limits.
    - This parameter is ignored when I(state=absent).
    type: str

password:
    description:
    - Set the password to use to connect the database server.
    - Must not be set if using Oracle wallet.
    type: str

username:
    aliases:
    - user
    description:
    - Set the login to use to connect the database server.
    - Must not be set if using Oracle wallet.
    type: str

datafiles:
    aliases:
    - datafile
    - df
    description:
    - List of the data files of the tablespace.
    - Element of the list can be a path (i.e '/u01/oradata/testdb/test01.dbf') or a ASM
      diskgroup (i.e '+DATA', not tested).
    - This parameter is mandatory when I(state!=absent).
    elements: str
    type: list

read_only:
    default: false
    description:
    - Specify the read status of the tablespace.
    - This parameter is ignored when I(state=absent).
    type: bool

autoextend:
    default: false
    description:
    - This parameter indicates if the tablespace/datafile is autoextend.
    - When I(autoextend=false), I(nextsize) and I(maxsize) are ignored.
    - This parameter is ignored when I(state=absent).
    type: bool

tablespace:
    aliases:
    - ts
    - name
    description:
    - The name of the tablespace to manage.
    required: true
    type: str

oracle_home:
    description:
    - Define the directory into which all Oracle software is installed.
    - Define ORACLE_HOME environment variable if set.
    type: str

service_name:
    description:
    - Specify the service name of the database you want to access.
    required: true
    type: str

Outputs

ddls:
  description: Ordered list of DDL requests executed during module execution.
  elements: str
  returned: always
  type: list