DBCA: Software + DB Creation
Tags: oracle, database, dbca, tutorial
Published: 2020-06-21 13:46:52

Hi Arthur, welcome to the guide "DBCA: Software + DB Creation"  
With this guide, you will be able to teach Marvin how to get Oracle Databases on your RAC cluster

We are assuming you already have your Software downloaded and ready in node1 of your cluster.
  

If that is not the case, please go to [Oracle Database Software Downloads](https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html)

or to [Oracle Software Delivery](https://edelivery.oracle.com/osdc/faces/Home.jspx)
 

> On these cases, we are creating the DB assuming not only some of the
> default configuration settings, but also assuming the "oracle_home"
> software has not "SQL patches" or "Bundle Patches" on them.
> 
> A good practice is always to check the system for invalid objects
> after its creation and in some cases, execute "datapatch" (for 12c+
> systems) and scripts like "utlrp.sql" or "catbundle.sql" to make sure
> the DB has all its objects valid and all patches actives.
> 
> Have a look to these articles for more info on this:
> 
> [Do you have to execute catbundle.sql when you create a new 11g
> database?](https://mikedietrichde.com/2018/04/25/do-you-have-to-execute-catbundle-sql-when-you-create-a-new-11g-database/)
> 
> [Do you have to execute “datapatch” when you create a new
> database?](https://mikedietrichde.com/2018/04/19/do-you-have-to-execute-datapatch-when-you-create-a-new-database/)
> [DBCA 12c and "datapatch.pl" - things to
> know](https://blogs.oracle.com/upgrade/dbca-12c-and-datapatchpl-things-to-know)

 

  
## Oracle 11.2.0.4 Silent Installation

  

> Get 11.2.0.4 files from MOS, since OTN files are 11.2.0.1  
> [https://updates.oracle.com/Orion/AdvancedSearch/process_form?search_style=9&language=0&patch_type=patchset&incl_prod=&incl_prod_checked=yes&release=80112040&plat_lang=226P&product=9480#query_link](https://updates.oracle.com/Orion/AdvancedSearch/process_form?search_style=9&language=0&patch_type=patchset&incl_prod=&incl_prod_checked=yes&release=80112040&plat_lang=226P&product=9480#query_link)
> 
> Files:
> 
> p13390677_112040_Linux-x86-64_1of7.zip  
> p13390677_112040_Linux-x86-64_2of7.zip      Unless you want to install
> 11.2.0.1 and then upgrade to 11.2.0.4... Im sure that is also fun!!

  
In order to be able to install 11g Software as RAC we will need to make sure CRS flag is present in the Inventory.xml.  
Is possible you wont need to change anything, but on some cases you will be prompted with some errors if this is not set explicitly since DBCA wont "see" the cluster
```  
[oracle@rac1-node1 ~]$ cp -p /u01/app/oraInventory/ContentsXML/inventory.xml /u01/app/oraInventory/ContentsXML/inventory.xml.bk
 
 
[oracle@rac1-node1 ~]$ . oraenv
ORACLE_SID = [+ASM1] ? +ASM1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@rac1-node1 ~]$ echo $ORACLE_HOME
/u01/app/18.0.0/grid
 
[oracle@rac1-node1 ~]$ $ORACLE_HOME/oui/bin/runInstaller -updateNodeList ORACLE_HOME="/u01/app/18.0.0/grid" CRS=true
Starting Oracle Universal Installer...
 
Checking swap space: must be greater than 500 MB.   Actual 2047 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
'UpdateNodeList' was successful.
[oracle@rac1-node1 ~]$
 
 
[oracle@rac1-node1 ContentsXML]$ diff /u01/app/oraInventory/ContentsXML/inventory.xml /u01/app/oraInventory/ContentsXML/inventory.xml.bk
11c11
< <HOME NAME="OraGI18Home1" LOC="/u01/app/18.0.0/grid" TYPE="O" IDX="1"/>
---
> <HOME NAME="OraGI18Home1" LOC="/u01/app/18.0.0/grid" TYPE="O" IDX="1" CRS="true"/>
```
What we are going to do first, is just install Oracle DB Software.

Let's create a response file for "Software only" making sure we have correct "oracle.install.responseFileVersion" and "oracle.install.db.CLUSTER_NODES" is listing all RAC cluster nodes:
```
[oracle@rac1-node1 database_11.2]$ cat db_swonly.rsp
## db_swonly.rsp ##
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
SELECTED_LANGUAGES=en,en_GB
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.DBA_GROUP=oinstall
oracle.install.db.isRACOneInstall=false
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.memoryOption=false
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.CLUSTER_NODES=rac1-node1,rac1-node2
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
oracle.installer.autoupdates.option=SKIP_UPDATES
```


Now, we just need to execute DBCA in silent mode with the response file created and the system will make sure DB software is installed in both RAC cluster nodes:
```
[oracle@rac1-node1 database_11.2]$ ./runInstaller -silent -responseFile /u01/Installers/database_11.2/db_swonly.rsp -showProgress -ignorePrereq
Starting Oracle Universal Installer...
 
Checking Temp space: must be greater than 120 MB.   Actual 77259 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 6846 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-12-14_09-18-49PM. Please wait ...[oracle@rac1-node1 database_11.2]$ You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2018-12-14_09-18-49PM.log
 
Prepare in progress.
..................................................   9% Done.
 
Prepare successful.
 
[......]
 
Execute Root Scripts in progress.
 
As a root user, execute the following script(s):
    1. /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
 
Execute /u01/app/oracle/product/11.2.0/dbhome_1/root.sh on the following nodes:
[rac1-node1, rac1-node2]
 
..................................................   100% Done.
 
Execute Root Scripts successful.
Successfully Setup Software.
```

Remember to read the output in your screen (I know.. is not always the most exciting part, isn't it..?) and execute the root script as root in all of the RAC cluster nodes:
```
[root@rac1-node1 ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Check /u01/app/oracle/product/11.2.0/dbhome_1/install/root_rac1-node1.raclab.local_2018-12-14_21-31-46.log for the output of root script
 
 
[root@rac1-node2 ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Check /u01/app/oracle/product/11.2.0/dbhome_1/install/root_rac1-node2.raclab.local_2018-12-14_21-31-59.log for the output of root script
[root@rac1-node2 ~]#
```



Since we have now the Software in place, we will be able to create a DB on that.

For this part of the journey, we are just creating a DB with most of its default option.

We will explore DB templates personification under DBCA: Modify Templates and clone Database
```
## Command Example ##
 
/u01/app/oracle/product/11.2.0/dbhome_1/bin/dbca
-silent \
-createDatabase \
-templateName General_Purpose.dbc \
-gdbName db112  \
-sid db112  \
-SysPassword Welcome1 \
-SystemPassword Welcome1 \
-emConfiguration NONE \
-storageType ASM \
-redoLogFileSize 50  \
-recoveryAreaDestination RECO \
-diskGroupName DATA1 \
-characterSet AL32UTF8 \
-nationalCharacterSet AL32UTF8 \
-automaticMemoryManagement true \
-memoryPercentage 20 \
-databaseType MULTIPURPOSE \
-nodelist rac1-node1,rac1-node2
 
 
## Output ##
 
[oracle@rac1-node1 bin]$ /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbca -silent \
> -createDatabase \
> -templateName General_Purpose.dbc \
> -gdbName db112  \
> -sid db112  \
> -SysPassword Welcome1 \
> -SystemPassword Welcome1 \
> -emConfiguration NONE \
> -storageType ASM \
> -redoLogFileSize 50  \
> -recoveryAreaDestination RECO \
> -diskGroupName DATA1 \
> -characterSet AL32UTF8 \
> -nationalCharacterSet AL32UTF8 \
> -automaticMemoryManagement true \
> -memoryPercentage 20 \
> -databaseType MULTIPURPOSE \
> -nodelist rac1-node1,rac1-node2
Copying database files
1% complete
 
[...]
 
Completing Database Creation
73% complete
76% complete
85% complete
94% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/db112/db112.log" for further details.
[oracle@rac1-node1 bin]$
```

If all completed as it should (of course it did right? why wont the universe just follow our desires...) you should be able to see the DB integrated in Clusterware and the DB name (no the intances) int your oratab files ("/etc/oratab" by default in Linux)
```
[oracle@rac1-node1 bin]$ srvctl status database -d db112 -v
Instance db1121 is running on node rac1-node1. Instance status: Open,HOME=/u01/app/oracle/product/11.2.0/dbhome_1.
Instance db1122 is running on node rac1-node2. Instance status: Open,HOME=/u01/app/oracle/product/11.2.0/dbhome_1.
 
 
[oracle@rac1-node1 bin]$ cat /etc/oratab
[...]
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
-MGMTDB:/u01/app/18.0.0/grid:N
rac1cdb11:/u01/app/oracle/product/18.0.0/db1:N
rac1cdb1:/u01/app/oracle/product/18.0.0/db1:N
+ASM1:/u01/app/18.0.0/grid:N
db112:/u01/app/oracle/product/11.2.0/dbhome_1:N        # line added by Agent


You can now add the instances entries in oratab:


Oratab file
[oracle@rac1-node1 bin]$ cat /etc/oratab
[...]
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
-MGMTDB:/u01/app/18.0.0/grid:N
rac1cdb11:/u01/app/oracle/product/18.0.0/db1:N
rac1cdb1:/u01/app/oracle/product/18.0.0/db1:N
+ASM1:/u01/app/18.0.0/grid:N
db112:/u01/app/oracle/product/11.2.0/dbhome_1:N        # line added by Agent
db1121:/u01/app/oracle/product/11.2.0/dbhome_1:N
 
 
 
[oracle@rac1-node2 bin]$ cat /etc/oratab
[...]
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
-MGMTDB:/u01/app/18.0.0/grid:N
rac1cdb12:/u01/app/oracle/product/18.0.0/db1:N
rac1cdb1:/u01/app/oracle/product/18.0.0/db1:N
+ASM1:/u01/app/18.0.0/grid:N
db112:/u01/app/oracle/product/11.2.0/dbhome_1:N        # line added by Agent
db1122:/u01/app/oracle/product/11.2.0/dbhome_1:N
```




## Oracle 12.1 Silent Installation


Let's create a response file for "Software only" making sure we have correct "oracle.install.responseFileVersion" and "oracle.install.db.CLUSTER_NODES" is listing all RAC cluster nodes:
```
[oracle@rac1-node1 database_12.1]$ cat db_swonly.rsp
## db_swonly.rsp ##
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.1.0
oracle.install.option=INSTALL_DB_SWONLY
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=oinstall
oracle.install.db.BACKUPDBA_GROUP=oinstall
oracle.install.db.DGDBA_GROUP=oinstall
oracle.install.db.KMDBA_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=rac1-node1,rac1-node2
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
oracle.installer.autoupdates.option=SKIP_UPDATES
```

Now, we just need to execute DBCA in silent mode with the response file created and the system will make sure DB software is installed in both RAC cluster nodes:
```
[oracle@rac1-node1 database_12.1]$ ./runInstaller -silent -responseFile /u01/Installers/database_12.1/db_swonly.rsp -showProgress -ignorePrereq
Starting Oracle Universal Installer...
 
Checking Temp space: must be greater than 500 MB.   Actual 90389 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 6939 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-12-14_06-43-19PM. Please wait ...[oracle@rac1-node1 database_12.1]$ You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2018-12-14_06-43-19PM.log
 
Prepare in progress.
..................................................   8% Done.
 
Prepare successful.
 
[.......]
 
Execute /u01/app/oracle/product/12.1.0/dbhome_1/root.sh on the following nodes:
[rac1-node1, rac1-node2]
 
 
..................................................   100% Done.
Successfully Setup Software.
```

Make sure you execute root script on all nodes as per Installation logs
```
[root@rac1-node1 ~]# /u01/app/oracle/product/12.1.0/dbhome_1/root.sh
Check /u01/app/oracle/product/12.1.0/dbhome_1/install/root_rac1-node1.raclab.local_2018-12-14_19-31-26.log for the output of root script
 
[root@rac1-node2 ~]# /u01/app/oracle/product/12.1.0/dbhome_1/root.sh
Check /u01/app/oracle/product/12.1.0/dbhome_1/install/root_rac1-node2.raclab.local_2018-12-14_19-31-41.log for the output of root script
```

Lets create our first Database now that we have the software ready.


> Warning If you want to use DB password file in ASM (recommended for
> 12c), the COMPATIBLE.ASM disk group attribute must be set to at least
> 12.1 Visit the following doc for more info [Shared Password File in a Disk
> Group](https://docs.oracle.com/database/121/OSTMG/GUID-6165EC00-C329-4140-A007-2FE18D6DEC51.htm)


Lets use the "General Purpose" template for now and we will explore more about Templates in DBCA: Modify Templates and clone Database
```
## Command Example ##
 
/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbca \
-silent \
-createDatabase \
-templateName General_Purpose.dbc \
-gdbName db121  \
-sid db121  \
-SysPassword Welcome1 \
-SystemPassword Welcome1 \
-emConfiguration NONE \
-storageType ASM \
-redoLogFileSize 50  \
-diskGroupName DATA2 \
-characterSet AL32UTF8 \
-nationalCharacterSet AL32UTF8 \
-automaticMemoryManagement true \
-memoryPercentage 20 \
-databaseType MULTIPURPOSE \
-sampleschema true \
-nodelist rac1-node1,rac1-node2
 
 
## Output ##
 
[oracle@rac1-node1 bin]$ /u01/app/oracle/product/12.1.0/dbhome_1/bin/dbca -silent \
> -createDatabase \
> -templateName General_Purpose.dbc \
> -gdbName db121  \
> -sid db121  \
> -SysPassword Welcome1 \
> -SystemPassword Welcome1 \
> -emConfiguration NONE \
> -storageType ASM \
> -redoLogFileSize 50  \
> -diskGroupName DATA2 \
> -characterSet AL32UTF8 \
> -nationalCharacterSet AL32UTF8 \
> -automaticMemoryManagement true \
> -memoryPercentage 20 \
> -databaseType MULTIPURPOSE \
> -sampleschema true \
> -nodelist rac1-node1,rac1-node2
Copying database files
1% complete
 
[.....]
 
 
87% complete
96% complete
100% complete
Look at the log file "/u01/app/grid/cfgtoollogs/dbca/db121/db121.log" for further details.
[oracle@rac1-node1 bin]$
```

Now, you can confirm that the DB is running in all cluster nodes and add the Intances entries to oratab:
```

Oratab file
[oracle@rac1-node1 bin]$ srvctl status database -d db121 -v
Instance db1211 is running on node rac1-node1. Instance status: Open,HOME=/u01/app/oracle/product/12.1.0/dbhome_1.
Instance db1212 is running on node rac1-node2. Instance status: Open,HOME=/u01/app/oracle/product/12.1.0/dbhome_1.
[oracle@rac1-node1 bin]$
 
 
[oracle@rac1-node1 bin]$ cat /etc/oratab
[...]
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
-MGMTDB:/u01/app/18.0.0/grid:N
rac1cdb11:/u01/app/oracle/product/18.0.0/db1:N
rac1cdb1:/u01/app/oracle/product/18.0.0/db1:N
+ASM1:/u01/app/18.0.0/grid:N
db112:/u01/app/oracle/product/11.2.0/dbhome_1:N        # line added by Agent
db1121:/u01/app/oracle/product/11.2.0/dbhome_1:N
db121:/u01/app/oracle/product/12.1.0/dbhome_1:N     # line added by Agent
db1211:/u01/app/oracle/product/12.1.0/dbhome_1:N
 
 
 
[oracle@rac1-node2 bin]$ cat /etc/oratab
[...]
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
-MGMTDB:/u01/app/18.0.0/grid:N
rac1cdb12:/u01/app/oracle/product/18.0.0/db1:N
rac1cdb1:/u01/app/oracle/product/18.0.0/db1:N
+ASM1:/u01/app/18.0.0/grid:N
db112:/u01/app/oracle/product/11.2.0/dbhome_1:N        # line added by Agent
db1122:/u01/app/oracle/product/11.2.0/dbhome_1:N
db121:/u01/app/oracle/product/12.1.0/dbhome_1:N     # line added by Agent
db1212:/u01/app/oracle/product/12.1.0/dbhome_1:N
```


Since we are talking about 12c database, shouldn't we try to create the Database as container and add a couple of PDBs?... yeah.. lets do it.

On this case, the system will create 2 pdbs (PDB1 and PDB2 since) adding the the following:


> [...]
> -createAsContainerDatabase true \
> -numberOfPdbs 2 \
> -pdbName pdb \
> -pdbAdminPassword Welcome1 \ [...]

```
## Command Example ##
 
/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbca \
-silent \
-createDatabase \
-templateName General_Purpose.dbc \
-gdbName cdb121  \
-sid cdb121  \
-createAsContainerDatabase true \
-numberOfPdbs 2 \
-pdbName pdb \
-pdbAdminPassword Welcome1 \
-SysPassword Welcome1 \
-SystemPassword Welcome1 \
-emConfiguration NONE \
-storageType ASM \
-redoLogFileSize 50  \
-diskGroupName DATA2 \
-characterSet AL32UTF8 \
-nationalCharacterSet AL32UTF8 \
-automaticMemoryManagement true \
-memoryPercentage 20 \
-databaseType MULTIPURPOSE \
-sampleschema true \
-nodelist rac1-node1,rac1-node2
 
 
 
 
 
## Output ##
 
[oracle@rac1-node1 bin]$ /u01/app/oracle/product/12.1.0/dbhome_1/bin/dbca \
> -silent \
> -createDatabase \
> -templateName General_Purpose.dbc \
> -gdbName cdb121  \
> -sid cdb121  \
> -createAsContainerDatabase true \
> -numberOfPdbs 2 \
> -pdbName pdb \
> -pdbAdminPassword Welcome1 \
> -SysPassword Welcome1 \
> -SystemPassword Welcome1 \
> -emConfiguration NONE \
> -storageType ASM \
> -redoLogFileSize 50  \
> -diskGroupName DATA2 \
> -characterSet AL32UTF8 \
> -nationalCharacterSet AL32UTF8 \
> -automaticMemoryManagement true \
> -memoryPercentage 20 \
> -databaseType MULTIPURPOSE \
> -sampleschema true \
> -nodelist rac1-node1,rac1-node2
Copying database files
1% complete
[....]
 
 
Creating Pluggable Databases
81% complete
86% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb121/cdb1210.log" for further details.
[oracle@rac1-node1 bin]$
```

You can check PDBs in the system checking in the CDB$ROOT container and also checking if their services are active in the listener:
```
SQL> show pdbs;
 
    CON_ID CON_NAME           OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
     2 PDB$SEED           READ ONLY  NO
     3 PDB1               READ WRITE NO
     4 PDB2               READ WRITE NO
 
 
 
[oracle@rac1-node1 bin]$ lsnrctl status listener
 
LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 15-DEC-2018 14:50:37
 
[.....]
 
Service "cdb121" has 1 instance(s).
  Instance "cdb1211", status READY, has 1 handler(s) for this service...
Service "cdb121XDB" has 1 instance(s).
  Instance "cdb1211", status READY, has 1 handler(s) for this service...
Service "pdb1" has 1 instance(s).
  Instance "cdb1211", status READY, has 1 handler(s) for this service...
Service "pdb2" has 1 instance(s).
  Instance "cdb1211", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@rac1-node1 bin]$
```


Ok.. but what about creating PDBs using DBCA?
```
## Command Example ##
 
/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbca \
-silent \
-createPluggableDatabase \
-sourceDB cdb121 \
-pdbName pdb3 \
-pdbAdminPassword Welcome1
 
 
 
 
 
 
## Output ##
 
[oracle@rac1-node1 bin]$ dbca -silent -createPluggableDatabase -sourceDB cdb121 -pdbName pdb3 -pdbAdminPassword Welcome1
Creating Pluggable Database
4% complete
12% complete
21% complete
38% complete
85% complete
Completing Pluggable Database Creation
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb121/pdb3/cdb121.log" for further details.
[oracle@rac1-node1 bin]$
 
SQL> show pdbs
 
    CON_ID CON_NAME           OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
     2 PDB$SEED           READ ONLY  NO
     3 PDB1               READ WRITE NO
     4 PDB2               READ WRITE NO
     5 PDB3               READ WRITE NO

```


## Oracle 12.2 Silent Installation


Let's create a response file for "Software only" making sure we have correct "oracle.install.responseFileVersion" and "oracle.install.db.CLUSTER_NODES" is listing all RAC cluster nodes:
```
[oracle@rac1-node1 database_12.2]$ cat db_swonly.rsp
## db_swonly.rsp ##
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=oinstall
oracle.install.db.OSOPER_GROUP=oinstall
oracle.install.db.OSBACKUPDBA_GROUP=oinstall
oracle.install.db.OSDGDBA_GROUP=oinstall
oracle.install.db.OSKMDBA_GROUP=oinstall
oracle.install.db.OSRACDBA_GROUP=oinstall
oracle.install.db.OSRACDBA_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=rac1-node1,rac1-node2
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
```

Now, we just need to execute DBCA in silent mode with the response file created and the system will make sure DB software is installed in both RAC cluster nodes:
```
[oracle@rac1-node1 database_12.2]$ ./runInstaller -silent -responseFile /u01/Installers/database_12.2/db_swonly.rsp -showProgress -ignorePrereq
Starting Oracle Universal Installer...
 
Checking Temp space: must be greater than 500 MB.   Actual 85030 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 6926 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-12-14_07-11-34[oracle@ra[oracle@rac1-node1 database_12.2]$ You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2018-12-14_07-11-34PM.log
 
Prepare in progress.
..................................................   7% Done.
 
Execute /u01/app/oracle/product/12.2.0/dbhome_1/root.sh on the following nodes:
[rac1-node1, rac1-node2]
 
 
..................................................   100% Done.
Successfully Setup Software.
```

Make sure you execute root script on all nodes as per Installation logs
```
[root@rac1-node1 ~]# /u01/app/oracle/product/12.2.0/dbhome_1/root.sh
Check /u01/app/oracle/product/12.2.0/dbhome_1/install/root_rac1-node1.raclab.local_2018-12-14_19-32-40-024024481.log for the output of root script
 
 
[root@rac1-node2 ~]# /u01/app/oracle/product/12.2.0/dbhome_1/root.sh
Check /u01/app/oracle/product/12.2.0/dbhome_1/install/root_rac1-node2.raclab.local_2018-12-14_19-32-49-503525536.log for the output of root script
```

Lets create our first Database now that we have the software ready.



> Warning If you want to use DB password file in ASM (recommended for
> 12c), the COMPATIBLE.ASM disk group attribute must be set to at least
> 12.1 Visit the following doc for more info [Shared Password File in a Disk
> Group](https://docs.oracle.com/database/121/OSTMG/GUID-6165EC00-C329-4140-A007-2FE18D6DEC51.htm)


Lets use the "General Purpose" template for now and we will explore more about Templates in DBCA: Modify Templates and clone Database
```
## Command Example ##
 
/u01/app/oracle/product/12.2.0/dbhome_1/bin/dbca \
-silent \
-createDatabase \
-templateName General_Purpose.dbc \
-gdbName db122  \
-sid db122  \
-SysPassword Welcome1 \
-SystemPassword Welcome1 \
-emConfiguration NONE \
-storageType ASM \
-redoLogFileSize 50  \
-diskGroupName DATA2 \
-characterSet AL32UTF8 \
-nationalCharacterSet AL16UTF16 \
-totalMemory 1024 \
-databaseType MULTIPURPOSE \
-sampleschema true \
-ignorePreReqs \
-nodelist rac1-node1,rac1-node2
 
 
## Output ##
[oracle@rac1-node1 bin]$ /u01/app/oracle/product/12.2.0/dbhome_1/bin/dbca -silent \
> -createDatabase \
> -templateName General_Purpose.dbc \
> -gdbName db122  \
> -sid db122  \
> -SysPassword Welcome1 \
> -SystemPassword Welcome1 \
> -emConfiguration NONE \
> -storageType ASM \
> -redoLogFileSize 50  \
> -diskGroupName DATA2 \
> -characterSet AL32UTF8 \
> -nationalCharacterSet AL16UTF16 \
> -totalMemory 1024 \
> -databaseType MULTIPURPOSE \
> -sampleschema true \
> -ignorePreReqs \
> -nodelist rac1-node1,rac1-node2
 
Copying database files
1% complete
2% complete
 
[.....]
 
 
74% complete
Executing Post Configuration Actions
100% complete
Look at the log file "/u01/app/grid/cfgtoollogs/dbca/db122/db122.log" for further details.
[oracle@rac1-node1 bin]$
```

Now, you can confirm that the DB is running in all cluster nodes and add the Instances entries to oratab:
```
[oracle@rac1-node2 ~]$ srvctl status database -d db122 -v
Instance db1221 is running on node rac1-node1. Instance status: Open.
Instance db1222 is running on node rac1-node2. Instance status: Open.
 
 
[oracle@rac1-node1 bin]$ cat /etc/oratab
[...]
 
#
-MGMTDB:/u01/app/18.0.0/grid:N
rac1cdb11:/u01/app/oracle/product/18.0.0/db1:N
rac1cdb1:/u01/app/oracle/product/18.0.0/db1:N
+ASM1:/u01/app/18.0.0/grid:N
db1121:/u01/app/oracle/product/11.2.0/dbhome_1:N
db112:/u01/app/oracle/product/11.2.0/dbhome_1:N     # line added by Agent
db121:/u01/app/oracle/product/12.1.0/dbhome_1:N     # line added by Agent
db1211:/u01/app/oracle/product/12.1.0/dbhome_1:N
cdb121:/u01/app/oracle/product/12.1.0/dbhome_1:N        # line added by Agent
cdb1211:/u01/app/oracle/product/12.1.0/dbhome_1:N
db122:/u01/app/oracle/product/12.2.0/dbhome_1:N
db1221:/u01/app/oracle/product/12.2.0/dbhome_1:N
[oracle@rac1-node1 bin]$
 
 
 
[oracle@rac1-node2 ~]$ cat /etc/oratab
[...]
 
#
-MGMTDB:/u01/app/18.0.0/grid:N
rac1cdb12:/u01/app/oracle/product/18.0.0/db1:N
rac1cdb1:/u01/app/oracle/product/18.0.0/db1:N
+ASM2:/u01/app/18.0.0/grid:N
db1122:/u01/app/oracle/product/11.2.0/dbhome_1:N
db112:/u01/app/oracle/product/11.2.0/dbhome_1:N     # line added by Agent
db121:/u01/app/oracle/product/12.1.0/dbhome_1:N     # line added by Agent
db1212:/u01/app/oracle/product/12.1.0/dbhome_1:N
cdb121:/u01/app/oracle/product/12.1.0/dbhome_1:N        # line added by Agent
cdb1212:/u01/app/oracle/product/12.1.0/dbhome_1:N
db122:/u01/app/oracle/product/12.2.0/dbhome_1:N
db1222:/u01/app/oracle/product/12.2.0/dbhome_1:N
[oracle@rac1-node2 ~]$
```

Like we did in 12.1, we can create a container DB with couple of PDBs


> PDBs Services Conflict
> 
> To avoid PDBs automatic service conflicts, avoid creating the PDBs
> with same name as they have in other Container even if they are
> different versions. The system will prompt to an error if it tries to
> create "PDB1" in more than one container since the "listener service"
> will be called the same

```
## Command Example ##
 
/u01/app/oracle/product/12.2.0/dbhome_1/bin/dbca \
-silent \
-createDatabase \
-templateName General_Purpose.dbc \
-gdbName cdb122  \
-sid cdb122  \
-createAsContainerDatabase true \
-numberOfPdbs 2 \
-pdbName pdb2 \
-pdbAdminPassword Welcome1 \
-SysPassword Welcome1 \
-SystemPassword Welcome1 \
-emConfiguration NONE \
-storageType ASM \
-redoLogFileSize 50  \
-diskGroupName DATA2 \
-characterSet AL32UTF8 \
-nationalCharacterSet AL16UTF16 \
-databaseType MULTIPURPOSE \
-sampleschema false \
-ignorePreReqs \
-nodelist rac1-node1,rac1-node2
 
 
## Output ##
 
[oracle@rac1-node1 bin]$ /u01/app/oracle/product/12.2.0/dbhome_1/bin/dbca -silent \
> -createDatabase \
> -templateName General_Purpose.dbc \
> -gdbName cdb122  \
> -sid cdb122  \
> -createAsContainerDatabase true \
> -numberOfPdbs 2 \
> -pdbName pdb2 \
> -pdbAdminPassword Welcome1 \
> -SysPassword Welcome1 \
> -SystemPassword Welcome1 \
> -emConfiguration NONE \
> -storageType ASM \
> -redoLogFileSize 50  \
> -diskGroupName DATA2 \
> -characterSet AL32UTF8 \
> -nationalCharacterSet AL16UTF16 \
> -databaseType MULTIPURPOSE \
> -sampleschema false \
> -ignorePreReqs \
> -nodelist rac1-node1,rac1-node2
[WARNING] [DBT-10331] Specified SID Prefix (cdb122) may have a potential conflict with an already existing database on the system.
   CAUSE: The specified SID Prefix without the trailing numeric characters (cdb) may have a potential conflict with an already existing database on the system.
   ACTION: Specify a different SID Prefix that does not conflict with existing databases on the system.
Copying database files
1% complete
 
[.....]
 
78% complete
Executing Post Configuration Actions
100% complete
Look at the log file "/u01/app/grid/cfgtoollogs/dbca/cdb122/cdb122.log" for further details.
[oracle@rac1-node1 bin]$
```

Lets check the PDBs:
```
SQL> show pdbs;
 
    CON_ID CON_NAME           OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
     2 PDB$SEED           READ ONLY  NO
     3 PDB21              READ WRITE NO
     4 PDB22              READ WRITE NO
```

And now, you can see how to create the PDB using DBCA once you have the container ready:
```
## Command Example ##
 
/u01/app/oracle/product/12.2.0/dbhome_1/bin/dbca \
-silent \
-createPluggableDatabase \
-sourceDB cdb122 \
-pdbName pdb23 \
-pdbAdminPassword Welcome1
 
 
 
## Output ##
 
[oracle@rac1-node1 bin]$ /u01/app/oracle/product/12.2.0/dbhome_1/bin/dbca -silent -createPluggableDatabase -sourceDB cdb122 -pdbName pdb23 -pdbAdminPassword Welcome1
Creating Pluggable Database
2% complete
6% complete
[...]
Executing Post Configuration Actions
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb122/pdb23/cdb122.log" for further details.
[oracle@rac1-node1 bin]$
 
SQL> show pdbs
 
    CON_ID CON_NAME           OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
     2 PDB$SEED           READ ONLY  NO
     3 PDB21              READ WRITE NO
     4 PDB22              READ WRITE NO
     5 PDB23              READ WRITE NO

```


I think is enough DBCA exploration for now.
Don't get to frustrated after the first initial errors or mistakes... they are just part of the fun (or that is what Trillian keeps telling me..)

Remember add this Page to your Watching list to receive notifications in case the guide is updated and to comment if you are missing any step or if you find any typo.
Here, at Megadodo Publications,  we are always trying to improve our guides and making sure our explorers do their best on their travels.
Or comment if you like it.. we all know Marvin wont get too excited about it.. but I will!!