ibre5041.ansible_oracle_modules.oracle_tablespace (3.2.0) — module

Manage tablespaces in an Oracle database

| "added in version" 1.9.1 of ibre5041.ansible_oracle_modules"

Authors: Mikael Sandström, oravirt@gmail.com, @oravirt, Ivan Brezina

Install collection

Install with ansible-galaxy collection install ibre5041.ansible_oracle_modules:==3.2.0


Add to requirements.yml

  collections:
    - name: ibre5041.ansible_oracle_modules
      version: 3.2.0

Description

Manage tablespaces in an Oracle database (create, drop, put in read only/read write, offline/online)

Can be run locally on the controlmachine or on a remote host

See connection parameters for oracle_ping


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: USERS tablespace
  oracle_tablespace: 
    tablespace: test
    # use: db_create_file_dest parameter
    # datafile: '+DATA' 
    size: 100M
    state: present 
    bigfile: true 
    autoextend: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Drop a tablespace
  oracle_tablespace:
    mode: sysdba
    tablespace: test
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Make a tablespace read only
  oracle_tablespace:  
    mode: sysdba
    tablespace: test
    state: read_only
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Make a tablespace read write
  oracle_tablespace:
    mode: sysdba    
    tablespace: test
    state: read_write
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Make a tablespace offline
  oracle_tablespace:
    mode: sysdba
    tablespace: test
    state: offline
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Make a tablespace online
  oracle_tablespace:
    mode: sysdba    
    tablespace: test
    state: online
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create small file temp tablespace
  oracle_tablespace:
    mode: sysdba
    tablespace: "ts_temp"
    size: "2M"
    datafiles:
      - "/tmp/ts_temp1.dbf"
      - "/tmp/ts_temp2.dbf"
    state: "present"
    bigfile: no
    content: "temp"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: create tablespace
  oracle_tablespace:
    mode: sysdba
    tablespace: "ts"
    size: "1M"
    datafiles:
      - "/tmp/ts1.dbf"
    state: "present"
    bigfile: no
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
    
- name: add datafile
  oracle_tablespace:
    mode: sysdba    
    tablespace: "ts"
    size: "2M"
    datafiles:
      - "/tmp/ts2.dbf"
      - "/tmp/ts3.dbf"
    state: "present"
    bigfile: no
    autoextend: yes
    nextsize: "1M"
    maxsize: "10M"

Inputs

    
size:
    description: The size of the datafile (10M, 10G, 150G etc)
    required: false

state:
    choices:
    - present
    - absent
    - online
    - offline
    - read_only
    - read_write
    default: present
    description: The intended state of the tablespace

bigfile:
    choices:
    - 'True'
    - 'False'
    default: false
    description: Should the tablespace be created as a bigfile tablespace

content:
    choices:
    - permanent
    - temp
    - undo
    default: permanent
    description: The type of tablespace (permanent, temporary or undo)

maxsize:
    aliases:
    - max
    description: If autoextend, the maximum size of the datafile (1M, 50M, 1G etc). If
      empty, defaults to database limits

datafile:
    aliases:
    - df
    - path
    description:
    - Where to put the datafile. Can be an ASM diskgroup or a filesystem datafile (i.e
      '+DATA', '/u01/oradata/testdb/test01.dbf')
    - mutually_exclusive with numfiles
    required: false

nextsize:
    aliases:
    - next
    description: If autoextend, the size of the next extent allocated (1M, 50M, 1G etc)

numfiles:
    description:
    - If OMF (db_create_file_dest) is set, you can just specify the number of datafiles
      you want attached to the tablespace
    - mutually_exclusive with datafile
    required: false

autoextend:
    choices:
    - 'true'
    - 'false'
    default: false
    description: Should the datafile be autoextended

tablespace:
    description: The tablespace that should be managed
    required: true