Skip to content

Commit

Permalink
It is now possible to have custom diskgroups/filesystems per database.
Browse files Browse the repository at this point in the history
Previously it was only possible to have one set of ASM diskgroups or filesystem
paths for DB storage/recovery area.
- default paths: /u01/oradata, u01/fra for FS storage & +DATA, +FRA for ASM storage
- datafile_dest/recoveryfile_dest variables overrides the defaults
- At the moment the variables for the default paths are called:
oracle_dbf_dir_fs
oracle_reco_dir_fs
oracle_dbf_dir_asm
oracle_reco_dir_asm
These variables will be changed/removed at a later stage.

Example (abbreviated) config with custom dbstorage paths (ASM & FS)
- home: db1
  oracle_edition: EE
  oracle_db_name: asmdb
  storage_type: ASM
  datafile_dest: MYDATA    <-- ASM Diskgroup
  recoveryfile_dest: MYFRA <-- ASM Diskgroup
- home: db2
  oracle_version_db: 12.1.0.2
  oracle_edition: EE
  oracle_db_name: fsdb
  oracle_db_passwd: Oracle123
  storage_type: FS
  datafile_dest: /u02/oradata <-- Filesystem path
  recoveryfile_dest: /u02/fra <-- Filesystem path
  • Loading branch information
oravirt committed Jul 22, 2016
1 parent f2a693f commit 9b357ca
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 10 deletions.
20 changes: 17 additions & 3 deletions roles/oradb-create/templates/dbca-create-db.rsp.11.2.0.3.j2
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,11 @@ DBSNMPPASSWORD = "{{ item.0.oracle_db_passwd }}"
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'FS' %}
DATAFILEDESTINATION = {{ oracle_dbf_dir_fs }}
{% if item.0.datafile_dest is defined %}
DATAFILEDESTINATION={{ item.0.datafile_dest }}
{% else %}
DATAFILEDESTINATION={{ oracle_dbf_dir_fs }}
{% endif %}
{% else %}
#DATAFILEDESTINATION=
{% endif %}
Expand All @@ -384,7 +388,11 @@ DATAFILEDESTINATION = {{ oracle_dbf_dir_fs }}
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'FS' %}
{% if item.0.recoveryfile_dest is defined %}
RECOVERYAREADESTINATION={{ item.0.recoveryfile_dest }}
{% else %}
RECOVERYAREADESTINATION={{ oracle_reco_dir_fs }}
{% endif %}
{% else %}
#RECOVERYAREADESTINATION=
{% endif %}
Expand All @@ -406,7 +414,11 @@ STORAGETYPE="{{ item.0.storage_type }}"
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'ASM' %}
{% if item.0.datafile_dest is defined %}
DISKGROUPNAME={{ item.0.datafile_dest }}
{% else %}
DISKGROUPNAME={{ oracle_dbf_dir_asm }}
{% endif %}
{% else %}
#DISKGROUPNAME=
{% endif %}
Expand All @@ -428,12 +440,14 @@ ASMSNMP_PASSWORD="{{ item.0.oracle_db_passwd }}"
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'ASM' %}
{% if item.0.recoveryfile_dest is defined %}
RECOVERYGROUPNAME={{ item.0.recoveryfile_dest }}
{% else %}
RECOVERYGROUPNAME={{ oracle_reco_dir_asm }}
{% endif %}
{% else %}
#RECOVERYGROUPNAME=
{% endif %}


#-----------------------------------------------------------------------------
# Name : CHARACTERSET
# Datatype : String
Expand Down
20 changes: 18 additions & 2 deletions roles/oradb-create/templates/dbca-create-db.rsp.11.2.0.4.j2
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,11 @@ DBSNMPPASSWORD = "{{ item.0.oracle_db_passwd }}"
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'FS' %}
DATAFILEDESTINATION = {{ oracle_dbf_dir_fs }}
{% if item.0.datafile_dest is defined %}
DATAFILEDESTINATION={{ item.0.datafile_dest }}
{% else %}
DATAFILEDESTINATION={{ oracle_dbf_dir_fs }}
{% endif %}
{% else %}
#DATAFILEDESTINATION=
{% endif %}
Expand All @@ -389,10 +393,15 @@ DATAFILEDESTINATION = {{ oracle_dbf_dir_fs }}
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'FS' %}
{% if item.0.recoveryfile_dest is defined %}
RECOVERYAREADESTINATION={{ item.0.recoveryfile_dest }}
{% else %}
RECOVERYAREADESTINATION={{ oracle_reco_dir_fs }}
{% endif %}
{% else %}
#RECOVERYAREADESTINATION=
{% endif %}

#-----------------------------------------------------------------------------
# Name : STORAGETYPE
# Datatype : String
Expand All @@ -411,7 +420,11 @@ STORAGETYPE="{{ item.0.storage_type }}"
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'ASM' %}
{% if item.0.datafile_dest is defined %}
DISKGROUPNAME={{ item.0.datafile_dest }}
{% else %}
DISKGROUPNAME={{ oracle_dbf_dir_asm }}
{% endif %}
{% else %}
#DISKGROUPNAME=
{% endif %}
Expand All @@ -433,12 +446,15 @@ ASMSNMP_PASSWORD="{{ item.0.oracle_db_passwd }}"
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'ASM' %}
{% if item.0.recoveryfile_dest is defined %}
RECOVERYGROUPNAME={{ item.0.recoveryfile_dest }}
{% else %}
RECOVERYGROUPNAME={{ oracle_reco_dir_asm }}
{% endif %}
{% else %}
#RECOVERYGROUPNAME=
{% endif %}


#-----------------------------------------------------------------------------
# Name : CHARACTERSET
# Datatype : String
Expand Down
35 changes: 33 additions & 2 deletions roles/oradb-create/templates/dbca-create-db.rsp.12.1.0.1.j2
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,15 @@ DBSNMPPASSWORD = "{{ item.0.oracle_db_passwd }}"
# Default value : $ORACLE_BASE/oradata
# Mandatory : No
#-----------------------------------------------------------------------------
DATAFILEDESTINATION = {{ oracle_dbf_dir_fs }}

{% if item.0.storage_type|upper == 'FS' %}
{% if item.0.datafile_dest is defined %}
DATAFILEDESTINATION={{ item.0.datafile_dest }}
{% else %}
DATAFILEDESTINATION={{ oracle_dbf_dir_fs }}
{% endif %}
{% else %}
#DATAFILEDESTINATION=
{% endif %}
#-----------------------------------------------------------------------------
# Name : RECOVERYAREADESTINATION
# Datatype : String
Expand All @@ -481,7 +488,15 @@ DATAFILEDESTINATION = {{ oracle_dbf_dir_fs }}
# Default value : $ORACLE_BASE/flash_recovery_area
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'FS' %}
{% if item.0.recoveryfile_dest is defined %}
RECOVERYAREADESTINATION={{ item.0.recoveryfile_dest }}
{% else %}
RECOVERYAREADESTINATION={{ oracle_reco_dir_fs }}
{% endif %}
{% else %}
#RECOVERYAREADESTINATION=
{% endif %}

#-----------------------------------------------------------------------------
# Name : STORAGETYPE
Expand All @@ -500,7 +515,15 @@ STORAGETYPE="{{ item.0.storage_type }}"
# Default value : DATA
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'ASM' %}
{% if item.0.datafile_dest is defined %}
DISKGROUPNAME={{ item.0.datafile_dest }}
{% else %}
DISKGROUPNAME={{ oracle_dbf_dir_asm }}
{% endif %}
{% else %}
#DISKGROUPNAME=
{% endif %}

#-----------------------------------------------------------------------------
# Name : ASMSNMP_PASSWORD
Expand All @@ -518,7 +541,15 @@ ASMSNMP_PASSWORD="{{ item.0.oracle_db_passwd }}"
# Default value : RECOVERY
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'ASM' %}
{% if item.0.recoveryfile_dest is defined %}
RECOVERYGROUPNAME={{ item.0.recoveryfile_dest }}
{% else %}
RECOVERYGROUPNAME={{ oracle_reco_dir_asm }}
{% endif %}
{% else %}
#RECOVERYGROUPNAME=
{% endif %}


#-----------------------------------------------------------------------------
Expand Down
20 changes: 17 additions & 3 deletions roles/oradb-create/templates/dbca-create-db.rsp.12.1.0.2.j2
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,14 @@ DBSNMPPASSWORD = "{{ item.0.oracle_db_passwd }}"
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'FS' %}
DATAFILEDESTINATION = {{ oracle_dbf_dir_fs }}
{% if item.0.datafile_dest is defined %}
DATAFILEDESTINATION={{ item.0.datafile_dest }}
{% else %}
DATAFILEDESTINATION={{ oracle_dbf_dir_fs }}
{% endif %}
{% else %}
#DATAFILEDESTINATION=
{% endif %}

#-----------------------------------------------------------------------------
# Name : RECOVERYAREADESTINATION
# Datatype : String
Expand All @@ -490,7 +493,11 @@ DATAFILEDESTINATION = {{ oracle_dbf_dir_fs }}
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'FS' %}
{% if item.0.recoveryfile_dest is defined %}
RECOVERYAREADESTINATION={{ item.0.recoveryfile_dest }}
{% else %}
RECOVERYAREADESTINATION={{ oracle_reco_dir_fs }}
{% endif %}
{% else %}
#RECOVERYAREADESTINATION=
{% endif %}
Expand All @@ -513,7 +520,11 @@ STORAGETYPE="{{ item.0.storage_type }}"
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'ASM' %}
{% if item.0.datafile_dest is defined %}
DISKGROUPNAME={{ item.0.datafile_dest }}
{% else %}
DISKGROUPNAME={{ oracle_dbf_dir_asm }}
{% endif %}
{% else %}
#DISKGROUPNAME=
{% endif %}
Expand All @@ -535,12 +546,15 @@ ASMSNMP_PASSWORD="{{ item.0.oracle_db_passwd }}"
# Mandatory : No
#-----------------------------------------------------------------------------
{% if item.0.storage_type|upper == 'ASM' %}
{% if item.0.recoveryfile_dest is defined %}
RECOVERYGROUPNAME={{ item.0.recoveryfile_dest }}
{% else %}
RECOVERYGROUPNAME={{ oracle_reco_dir_asm }}
{% endif %}
{% else %}
#RECOVERYGROUPNAME=
{% endif %}


#-----------------------------------------------------------------------------
# Name : CHARACTERSET
# Datatype : String
Expand Down

0 comments on commit 9b357ca

Please sign in to comment.