User Tools

Site Tools


install_oracle_software_run_netca_and_dbca_without_gui_silent_option

Install Oracle 19c binaries and immediately patch to latest version

Install 19.3 and apply the 19.14 RU in one step as demonstrated by Mike Dietrich here.

  • Create the new home and unzip the base version
export ORACLE_BASE="/cln/exp/ora_bin/app/oracle"
export ORACLE_HOME="${ORACLE_BASE}/product/19.14/dbhome_1"
INVENTORY_LOCATION="${ORACLE_BASE}/oraInventory"
mkdir -p "${ORACLE_HOME}"
cd "${ORACLE_HOME}"
unzip -o /oracle/Patches/AIX.PPC64_193000_db_home.zip -d ./ >/dev/null
  • Downloand the RU patch and unzip it
mkdir -p ./patch/33515361
unzip -o /oracle/Patches/p33515361_19.14RU_AIX64-5L.zip -d ./patch/33515361/ >/dev/null
  • Replace the OPatch directory with the latest version
export PATH="$ORACLE_HOME/OPatch:$PATH"
opatch version
cd "${ORACLE_HOME}"
rm -rf OPatch
unzip -o /oracle/Patches/p6880880_OPatch_12.2.0.1.29_AIX64-5L.zip -d ./ >/dev/null
opatch version
  • Create a responsefile
cat <<EOCAT >"/tmp/dbca_install_binaries_19.rsp"
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=${INVENTORY_LOCATION}
ORACLE_BASE=${ORACLE_BASE}
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.rootconfig.executeRootScript=false
EOCAT
  • Run the installer the apply the RU and then the software
cd "${ORACLE_HOME}"
./runInstaller -applyRU patch/33515361/33515361

or silently…

cd "${ORACLE_HOME}"
./runInstaller -silent -applyRU patch/33515361/33515361 -ignorePrereqFailure -waitforcompletion -responsefile "/tmp/dbca_install_binaries_19.rsp"

And apply SQL patches to a database after starting it up in the new ORACLE_HOME

$ cd $ORACLE_HOME/OPatch
$ (0) cwmd oracle@hn5114:/cln/tst/ora_bin1/app/oracle/product/19.11/dbhome_1/OPatch> ./datapatch
SQL Patching tool version 19.11.0.0.0 Production on Tue Jun 22 10:53:11 2021
Copyright (c) 2012, 2021, Oracle.  All rights reserved.

Log file for this invocation: /cln/tst/ora_bin1/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_6424298_2021_06_22_10_53_11/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
  No interim patches found

Current state of release update SQL patches:
  Binary registry:
    19.11.0.0.0 Release_Update 210415114417: Installed
  SQL registry:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 11-MAY-20 14:08:09

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  No interim patches need to be rolled back
  Patch 32545013 (Database Release Update : 19.11.0.0.210420 (32545013)):
    Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.11.0.0.0 Release_Update 210415114417
  No interim patches need to be applied

Installing patches...
Patch installation complete.  Total patches installed: 1

Validating logfiles...done
Patch 32545013 apply: SUCCESS
  logfile: /cln/tst/ora_bin1/app/oracle/cfgtoollogs/sqlpatch/32545013/24213984/32545013_apply_CWMD_2021Jun22_10_53_51.log (no errors)
SQL Patching tool complete on Tue Jun 22 11:06:11 2021

Install the older way - separately

Download base release of 19c (19.3.0)

export ORACLE_HOME="/cln/exp/ora_bin1/app/oracle/product/19.9.0/dbhome_1"
mkdir -p "${ORACLE_HOME}"
cd "${ORACLE_HOME}"
unzip /oracle/Patches/AIX.PPC64_193000_db_home.zip -d ./

Install the base release

./runInstaller -silent -ignorePrereqFailure -waitforcompletion -responsefile "/tmp/dbca_install_binaries_19.rsp"

where the responsefile looks like this:

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/cln/tst/ora_bin1/app/oracle/oraInventory
ORACLE_BASE=/cln/tst/ora_bin1/app/oracle
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.rootconfig.executeRootScript=false

Download and install latest version of opatch

export PATH="$ORACLE_HOME/OPatch:$PATH"
opatch version
cd "${ORACLE_HOME}"
tar -cvf OPatch_$(date '+%Y%m%d').tar OPatch/.
gzip OPatch_$(date '+%Y%m%d').tar
rm -rf OPatch
unzip /oracle/Patches/p6880880_190000_AIX64-5L.zip -d ./
opatch version

Download latest Release Update (19.9.0)

cd "${ORACLE_HOME}"
mkdir -p patch/31771877
cd patch/31771877
unzip /oracle/Patches/p31771877_190000_AIX64-5L.zip -d ./

Install latest Release Update (19.9.0)

cd "${ORACLE_HOME}"/patch/31771877/31771877
opatch prereq CheckConflictAgainstOHWithDetail -ph ./
opatch apply

Then for each database (when it is time to move them to the patched home)…
Database goes down in the old home

sqlplus / as sysdba
create pfile from spfile;
shu immediate
exit

If this is the first db in new home, prepare TNS_ADMIN directory

cp $OHOME/network/admin/sqlnet.ora   $NHOME/network/admin/
echo "ifile=\"$OHOME/network/admin/tnsnames.ora\"" >$NHOME/network/admin/tnsnames.ora
cp $OHOME/dbs/init${ORACLE_SID}.ora $NHOME/dbs/

vi $NHOME/dbs/init${ORACLE_SID}.ora and check for old pathnames replacing them for the new ones

vi /etc/oratab and change the ORACLE_HOME to the new one for this database, then

Start the database in the new home

sqlplus / as sysdba
create spfile from pfile;
startup
exit

Patch the database

cd $NHOME/OPatch
./datapatch -verbose

Check the database

sqlplus / as sysdba
@utlrp
select*from dba_registry;
Launching Oracle Database Setup Wizard...

[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. /cln/exp/ora_bin1/oraInventory/logs/InstallActions2020-11-16_11-47-03PM/installActions2020-11-16_11-47-03PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /cln/exp/ora_bin1/oraInventory/logs/InstallActions2020-11-16_11-47-03PM/installActions2020-11-16_11-47-03PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /cln/exp/ora_bin1/app/oracle/product/19.9.0/dbhome_1/install/response/db_2020-11-16_11-47-03PM.rsp

You can find the log of this install session at:
 /cln/exp/ora_bin1/oraInventory/logs/InstallActions2020-11-16_11-47-03PM/installActions2020-11-16_11-47-03PM.log

As a root user, execute the following script(s):
        1. /cln/exp/ora_bin1/app/oracle/product/19.9.0/dbhome_1/root.sh

Execute /cln/exp/ora_bin1/app/oracle/product/19.9.0/dbhome_1/root.sh on the following nodes:
[hn1627]


Successfully Setup Software with warning(s).

Download latest Autoupgrade version

Clone an existing ORACLE_HOME for a quicker install

If the same version is needed that is already installed on another machine, it is far quicker to clone the home over rather than download the software, transfer it over and then run the installer.
Also convenient as I could no longer find 11.2.0.4 for AIX on Oracle's website!
Step 1. Zip up an existing home

cd /cln/acc/ora_bin2/app/oracle/product/11.2.0.4/dbhome_1
tar -cvf - . | gzip >11204_clone.gz

or make it a bit leaner and gzip in one step…

cd $ORACLE_HOME
find . -name "*aud"                 >/tmp/tarexcludes.lst
find . -name "*trc"                >>/tmp/tarexcludes.lst
find . -name "*trm"                >>/tmp/tarexcludes.lst
find . -name "*log"|grep '/trace/' >>/tmp/tarexcludes.lst
find . -name "*txt"|grep '/lsinv/' >>/tmp/tarexcludes.lst
find ./dbs -type f                 >>/tmp/tarexcludes.lst
find ./network/admin -type f       >>/tmp/tarexcludes.lst
tar -X /tmp/tarexcludes.lst -cvf - . 2>/tmp/tarerrors.lst|gzip > "/oracle/oracle_home_from_$(hostname).tar.gz"

Step 2. Copy the file to the destination server

scp 11204_clone.gz oracle@hn5308:/cln/acc/ora_bin1/app/oracle/product/11.2.0.4/dbhome_1

Step 3. On the destination server, unzip the file

cd /cln/acc/ora_bin1/app/oracle/product/11.2.0.4/dbhome_1
gunzip -c 11204_clone.gz | tar -xvf -

Step 4. Get rid of the old ORACLE_HOME entry if it existed

$ORACLE_HOME/oui/bin/runInstaller -detachHome ORACLE_HOME="/cln/kap/ora_bin1/app/oracle/product/11.2.0.4/dbhome_1"

Step 5. Make the new home feel at home!
Check in the inventory to see what ORACLE_HOME_NAME can be used

vi "$(awk -F'=' '/inventory_loc/ {print $NF "/ContentsXML/inventory.xml"}' /etc/oraInst.loc)"
export ORACLE_BASE="/cln/kap/ora_bin1/app/oracle"
export ORACLE_HOME="${ORACLE_BASE}/product/11.2.0.4/dbhome_1"
cd ${ORACLE_HOME}/clone/bin
perl clone.pl ORACLE_BASE="${ORACLE_BASE}" ORACLE_HOME="${ORACLE_HOME}" ORACLE_HOME_NAME="xxxxxx_home1"   # OSDBA_GROUP="dba" OSOPER_GROUP="dba"
********************************************************************************

Your platform requires the root user to perform certain pre-clone
OS preparation.  The root user should run the shell script 'rootpre.sh' before
you proceed with cloning.  rootpre.sh can be found at
/cln/kap/ora_bin1/app/oracle/product/11.2.0.4/dbhome_1/clone directory.
Answer 'y' if the root user has run 'rootpre.sh' script.

********************************************************************************

Has 'rootpre.sh' been run by the root user? [y/n] (n)
y
./runInstaller -clone -waitForCompletion  "ORACLE_HOME=/cln/kap/ora_bin1/app/oracle/product/11.2.0.4/dbhome_1" "ORACLE_BASE=/cln/kap/ora_bin1/app/oracle" "ORACLE_HOME_NAME=OraDb11g_home1" -silent -noConfig -nowait
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 65536 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-11-25_06-22-25PM. Please wait ...Oracle Universal Installer, Version 11.2.0.4.0 Production
Copyright (C) 1999, 2013, Oracle. All rights reserved.

You can find the log of this install session at:
 /cln/kap/ora_bin1/app/oracle/oraInventory/logs/cloneActions2019-11-25_06-22-25PM.log
.................................................................................................... 100% Done.



Installation in progress (Monday, November 25, 2019 6:22:39 PM CET)
..............................................................................                                                  78% Done.
Install successful

Linking in progress (Monday, November 25, 2019 6:22:46 PM CET)
Link successful

Setup in progress (Monday, November 25, 2019 6:24:18 PM CET)
Setup successful

End of install phases.(Monday, November 25, 2019 6:24:43 PM CET)
WARNING:
The following configuration scripts need to be executed as the "root" user.
/cln/kap/ora_bin1/app/oracle/product/11.2.0.4/dbhome_1/root.sh
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts

The cloning of OraDb11g_home1 was successful.

Step 5. Finish up

sudo /cln/kap/ora_bin1/app/oracle/product/11.2.0.4/dbhome_1/root.sh

All done

or do it the long way…

Install the software

Prerequisites

* create oraInst.loc file On Solaris, it should be created in /var/opt/oracle. On AIX, Linux, etc., it should be created in /etc
At this particular customer we are keeping one inventory per home…

vi /var/opt/oracle/oraInst.loc.TDPOTEST

inventory_loc=/oracle/product/11.2.0.1/oraInventory
inst_group=dba

cp /var/opt/oracle/oraInst.loc.TDPOTEST /var/opt/oracle/oraInst.loc

Another way is create the oraInst.loc inside the ORACLE_HOME

vi $ORACLE_HOME/oraInst.loc

inventory_loc=/oracle/product/11.2.0.4/oraInventory
inst_group=dba

Create a response file

Use one of the predefined .rsp files in /stage/database/response or copy, paste and modify this one for 11.2.0.1 (shared product code, Enterprise Edition)…

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=egnim
UNIX_GROUP_NAME=dba
INVENTORY_LOCATION=/oracle/product/11.2.0.1/
SELECTED_LANGUAGES=all_langs
ORACLE_HOME=/oracle/product/11.2.0.1
ORACLE_BASE=/oracle/product
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true

Here's one for 11.2.0.4 Enterprise Edition…

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=hn5123
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/cln/tst/ora_bin/app/oracle/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/cln/tst/ora_bin/app/oracle/product/11.2.0.4/dbhome_1
ORACLE_BASE=/cln/tst/ora_bin/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.
0,oracle.rdbms.rat:11.2.0.4.0
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

and here's a response file for 12.1.0.2

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.1.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/cln/tst/ora_bin/app/oracle/oraInventory
ORACLE_HOME=/cln/tst/ora_bin/app/oracle/product/12.1.0.2/dbhome_1
ORACLE_BASE=/cln/tst/ora_bin/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.BACKUPDBA_GROUP=dba
oracle.install.db.DGDBA_GROUP=dba
oracle.install.db.KMDBA_GROUP=dba
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true

Do the install (11.2.0.4 / 12.1.0.2)

cd <installation media>/database
TS="$(date '+%Y%m%d%H%M')"
TMP_DIR="/tmp"
BINARIES_RSP="dbca_install_binaries_12.rsp"
mkdir "${ORACLE_HOME}/log"
./runInstaller -silent -ignoreSysPrereqs -waitforcompletion -responsefile "${TMP_DIR}/${BINARIES_RSP}" | tee "${ORACLE_HOME}/log/runInstaller_${TS}.log"

Got these errors?

[[oracle@egnim database]]$ ./runInstaller -silent -ignoreSysPrereqs -responseFile /home/oracle/database/response/oracle_EE_SWONLY.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 33277 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 1983 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-06-22_02-07-54AM. Please wait ...[[oracle@egnim database]]$ No protocol specified
Exception in thread "main" java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at java.awt.Toolkit$2.run(Toolkit.java:821)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)
at javax.swing.UIManager.initialize(UIManager.java:1262)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1245)
at javax.swing.UIManager.getUI(UIManager.java:851)
at javax.swing.JPanel.updateUI(JPanel.java:104)
at javax.swing.JPanel.<init>(JPanel.java:64)
at javax.swing.JPanel.<init>(JPanel.java:87)
at javax.swing.JPanel.<init>(JPanel.java:95)
at oracle.sysman.oii.oiif.oiifo.OiifoOCMUI.<init>(OiifoOCMUI.java:125)
at oracle.sysman.oii.oiif.oiifo.OiifoOCMInterfaceManager.<init>(OiifoOCMInterfaceManager.java:79)
at oracle.sysman.oii.oiif.oiifo.OiifoOCMInterfaceManager.getInstance(OiifoOCMInterfaceManager.java:124)
at oracle.install.ivw.db.driver.DBInstaller.run(DBInstaller.java:123)
at oracle.install.commons.util.Application.startup(Application.java:869)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:164)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:181)
at oracle.install.commons.base.driver.common.Installer.startup(Installer.java:265)
at oracle.install.ivw.db.driver.DBInstaller.startup(DBInstaller.java:114)
at oracle.install.ivw.db.driver.DBInstaller.main(DBInstaller.java:132)

exit the oracle session and from the root session, type

xhost +

then su back in to oracle and try again…

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 180 MB.   Actual 4026 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 131098 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-08-11_09-28-18PM. Please wait ...
[[WARNING]] [[INS-32016]] The selected Oracle home contains directories or files.
   CAUSE: The selected Oracle home contained directories or files.
   ACTION: To start with an empty Oracle home, either remove its contents or choose another location.
You can find the log of this install session at:
 /oracle/product/11.2.0.1/logs/installActions2014-08-11_09-28-18PM.log
The following configuration scripts need to be executed as the "root" user.
 #!/bin/sh
 #Root scripts to run

/oracle/product/11.2.0.1/root.sh
To execute the configuration scripts:
         1. Open a terminal window
         2. Log in as "root"
         3. Run the scripts
         4. Return to this window and hit "Enter" key to continue

Successfully Setup Software.

Create the listener and tns entries (netca)

Create the listener and setup TNS using netca in silent mode with a response file Create netca_DEV1.rsp and put this in it

[[GENERAL]]
RESPONSEFILE_VERSION="11.2"
CREATE_TYPE="CUSTOM"

SHOW_GUI=false
LOG_FILE=""/oracle/DEV1/product/11.2.0.1/network/tools/log/netca.log""

[[oracle.net.ca]]
INSTALLED_COMPONENTS={"server","net8","javavm"}

INSTALL_TYPE=""custom""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER_DEV1"}
LISTENER_PROTOCOLS={"TCP;1522"}
LISTENER_START=""LISTENER_DEV1""

NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=2
NSN_NAMES={"EXTPROC_CONNECTION_DATA","DEV1"}
NSN_SERVICE={"PLSExtProc","DEV1"}
NSN_PROTOCOLS={"TCP;HOSTNAME;1521","TCP;egnim;1522"}

and run the command

export DISPLAY=localhost:0.0
ORACLE_BASE=/oracle/DEV1
ORACLE_HOME=$ORACLE_BASE/product/11.2.0.1
$ORACLE_HOME/bin/netca -silent -responseFile <path to above file>

Create a template from an existing database

It won't be perfect. The directory structures will need checking/modifying and the SID may be hardcoded in places when it's done.
This method creates a .dbt file ('t' for template). It will be slower to create a database using this template as it creates the database using scripts instead of a seeded clone.

dbca -silent -createtemplatefromdb -sourcedb KITRYVAL -sysdbausername sys -sysdbapassword change_on_install -templatename 11204_template

Create 11g database, shared binaries, custom sga, custom variables

This is built for a dev system as redo, controlfiles and datafiles are all in the same place. Modify as necessary.

$ORACLE_HOME/bin/dbca -silent                      \
                      -createdatabase              \
                      -templatename $ORACLE_HOME/assistants/dbca/templates/dbca_custom_no_options.dbt \
                      -gdbname appli2a             \
                      -sid appli2a                 \
                      -syspassword qwertyuiop      \
                      -systempassword asdfghjkl    \
                      -dbsnmppassword zxcvbnm      \
                      -sysmanpassword qazwsxedc

where dbca_custom_no_options.dbt looks like this

<?xml version = '1.0'?>
<DatabaseTemplate name="Custom build - all options removed" description="Check variables CLN_ORADATA and CLN_ORAARCH" version="11.2.0.0.0">
   <CommonAttributes>
      <option name="OMS" value="false"/>
      <option name="JSERVER" value="false"/>
      <option name="SPATIAL" value="false"/>
      <option name="IMEDIA" value="false"/>
      <option name="XDB_PROTOCOLS" value="false"/>
      <option name="ORACLE_TEXT" value="false"/>
      <option name="SAMPLE_SCHEMA" value="false"/>
      <option name="CWMLITE" value="false"/>
      <option name="EM_REPOSITORY" value="false"/>
      <option name="APEX" value="false"/>
      <option name="OWB" value="false"/>
      <option name="DV" value="false"/>
   </CommonAttributes>
   <Variables>
      <variable name="CLN_ORADATA" value="/cln/exp/ora_data4"/>
      <variable name="CLN_ORAARCH" value="/cln/exp/ora_data2/archivelog"/>
   </Variables>
   <CustomScripts Execute="false"/>
   <InitParamAttributes>
      <InitParams>
         <initParam name="db_name" value="{SID}"/>
         <initParam name="db_domain" value=""/>
         <initParam name="audit_file_dest" value="{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump"/>
         <initParam name="compatible" value="11.2.0.4.0"/>
         <initParam name="remote_login_passwordfile" value="EXCLUSIVE"/>
         <initParam name="log_archive_dest_1" value="'LOCATION={CLN_ORAARCH}/{SID}'"/>
         <initParam name="sga_target" value="3072" unit="MB"/>
         <initParam name="processes" value="300"/>
         <initParam name="local_listener" value="LISTENER_{SID}"/>
         <initParam name="undo_tablespace" value="UNDOTBS1"/>
         <initParam name="control_files" value="(&quot;{CLN_ORADATA}/{SID}/control01.ctl&quot;, &quot;{CLN_ORADATA}/{SID}/control02.ctl&quot;, &quot;{CLN_ORADATA}/{SID}/control03.ctl&quot;)"/>
         <initParam name="diagnostic_dest" value="{ORACLE_BASE}"/>
         <initParam name="audit_trail" value="db"/>
         <initParam name="log_archive_format" value="{SID}_%t_%s_%r.dbf"/>
         <initParam name="sessions" value="335"/>
         <initParam name="db_block_size" value="8" unit="KB"/>
         <initParam name="open_cursors" value="300"/>
         <initParam name="pga_aggregate_target" value="1200" unit="MB"/>
      </InitParams>
      <MiscParams>
         <databaseType>MULTIPURPOSE</databaseType>
         <maxUserConn>20</maxUserConn>
         <customSGA>true</customSGA>
         <characterSet>WE8MSWIN1252</characterSet>
         <nationalCharacterSet>AL16UTF16</nationalCharacterSet>
         <archiveLogMode>true</archiveLogMode>
         <initParamFileName>{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/pfile/init.ora</initParamFileName>
      </MiscParams>
      <SPfile useSPFile="true">{ORACLE_HOME}/dbs/spfile{SID}.ora</SPfile>
   </InitParamAttributes>
   <StorageAttributes>
      <ControlfileAttributes id="Controlfile">
         <maxDatafiles>300</maxDatafiles>
         <maxLogfiles>16</maxLogfiles>
         <maxLogMembers>3</maxLogMembers>
         <maxLogHistory>1</maxLogHistory>
         <maxInstances>8</maxInstances>
         <image name="control01.ctl" filepath="{CLN_ORADATA}/{SID}/"/>
         <image name="control02.ctl" filepath="{CLN_ORADATA}/{SID}/"/>
         <image name="control03.ctl" filepath="{CLN_ORADATA}/{SID}/"/>
      </ControlfileAttributes>
      <DatafileAttributes id="{CLN_ORADATA}/{SID}/sysaux01.dbf">
         <tablespace>SYSAUX</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">600</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">10240</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{CLN_ORADATA}/{SID}/system01.dbf">
         <tablespace>SYSTEM</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">700</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">10240</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{CLN_ORADATA}/{SID}/temp01.dbf">
         <tablespace>TEMP</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">20</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">640</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{CLN_ORADATA}/{SID}/undotbs01.dbf">
         <tablespace>UNDOTBS1</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">200</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">5120</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{CLN_ORADATA}/{SID}/users01.dbf">
         <tablespace>USERS</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">5</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">1280</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <TablespaceAttributes id="SYSAUX">
         <online>true</online>
         <offlineMode>1</offlineMode>
         <readOnly>false</readOnly>
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">64</initSize>
         <increment unit="KB">64</increment>
         <incrementPercent>50</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>4096</maxExtends>
         <minExtendsSize unit="KB">64</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <autoSegmentMgmt>true</autoSegmentMgmt>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{CLN_ORADATA}/{SID}/sysaux01.dbf">
               <id>-1</id>
            </TablespaceDatafileAttributes>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="SYSTEM">
         <online>true</online>
         <offlineMode>1</offlineMode>
         <readOnly>false</readOnly>
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>3</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">64</initSize>
         <increment unit="KB">64</increment>
         <incrementPercent>50</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>-1</maxExtends>
         <minExtendsSize unit="KB">64</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <autoSegmentMgmt>true</autoSegmentMgmt>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{CLN_ORADATA}/{SID}/system01.dbf">
               <id>-1</id>
            </TablespaceDatafileAttributes>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="TEMP">
         <online>true</online>
         <offlineMode>1</offlineMode>
         <readOnly>false</readOnly>
         <temporary>true</temporary>
         <defaultTemp>true</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">64</initSize>
         <increment unit="KB">64</increment>
         <incrementPercent>0</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>0</maxExtends>
         <minExtendsSize unit="KB">64</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <autoSegmentMgmt>true</autoSegmentMgmt>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{CLN_ORADATA}/{SID}/temp01.dbf">
               <id>-1</id>
            </TablespaceDatafileAttributes>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="UNDOTBS1">
         <online>true</online>
         <offlineMode>1</offlineMode>
         <readOnly>false</readOnly>
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>true</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">512</initSize>
         <increment unit="KB">512</increment>
         <incrementPercent>50</incrementPercent>
         <minExtends>8</minExtends>
         <maxExtends>4096</maxExtends>
         <minExtendsSize unit="KB">512</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <autoSegmentMgmt>true</autoSegmentMgmt>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{CLN_ORADATA}/{SID}/undotbs01.dbf">
               <id>-1</id>
            </TablespaceDatafileAttributes>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="USERS">
         <online>true</online>
         <offlineMode>1</offlineMode>
         <readOnly>false</readOnly>
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">128</initSize>
         <increment unit="KB">128</increment>
         <incrementPercent>0</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>4096</maxExtends>
         <minExtendsSize unit="KB">128</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <autoSegmentMgmt>true</autoSegmentMgmt>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{CLN_ORADATA}/{SID}/users01.dbf">
               <id>-1</id>
            </TablespaceDatafileAttributes>
         </datafilesList>
      </TablespaceAttributes>
      <RedoLogGroupAttributes id="1">
         <reuse>false</reuse>
         <fileSize unit="MB">500</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo01.log" filepath="{CLN_ORADATA}/{SID}/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="2">
         <reuse>false</reuse>
         <fileSize unit="MB">500</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo02.log" filepath="{CLN_ORADATA}/{SID}/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="3">
         <reuse>false</reuse>
         <fileSize unit="MB">500</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo03.log" filepath="{CLN_ORADATA}/{SID}/"/>
      </RedoLogGroupAttributes>
   </StorageAttributes>
</DatabaseTemplate>

Clone template with extra additions for our standards, setup just the way we like it!

Using a clone template (.dbc extension, 'c' for clone) allows for a quicker db creation as it uses RMAN to create the db from a seeded database and applies the alterations.
SHB - best one so far…

<?xml version = '1.0'?>
<DatabaseTemplate name="dedicated_home" description="oracle_home in /oracle/SID/product/11.2.0.4, archivelogs in /oracle/SID/arch, 4 redo log groups" version="11.1.0.0.0">
   <CommonAttributes>
      <option name="OMS" value="false"/>
      <option name="JSERVER" value="true"/>
      <option name="SPATIAL" value="true"/>
      <option name="IMEDIA" value="true"/>
      <option name="XDB_PROTOCOLS" value="true">
         <tablespace id="SYSAUX"/>
      </option>
      <option name="ORACLE_TEXT" value="true">
         <tablespace id="SYSAUX"/>
      </option>
      <option name="SAMPLE_SCHEMA" value="false"/>
      <option name="CWMLITE" value="true">
         <tablespace id="SYSAUX"/>
      </option>
      <option name="EM_REPOSITORY" value="true">
         <tablespace id="SYSAUX"/>
      </option>
      <option name="APEX" value="true"/>
      <option name="OWB" value="true"/>
      <option name="DV" value="false"/>
   </CommonAttributes>
   <Variables/>
   <CustomScripts Execute="false"/>
   <InitParamAttributes>
      <InitParams>
         <initParam name="large_pool_size" value="0"/>
         <initParam name="db_name" value="{SID}"/>
         <initParam name="db_domain" value=""/>
         <initParam name="dispatchers" value="(PROTOCOL=TCP) (SERVICE={SID}XDB)"/>
         <initParam name="memory_max_target" value="2147483648"/>
         <initParam name="audit_file_dest" value="{ORACLE_BASE}/admin/{SID}/adump"/>
         <initParam name="compatible" value="11.2.0.4.0"/>
         <initParam name="shared_pool_size" value="0"/>
         <initParam name="remote_login_passwordfile" value="EXCLUSIVE"/>
         <initParam name="log_archive_dest_1" value="'LOCATION={ORACLE_BASE}/arch/{SID}'"/>
         <initParam name="sga_target" value="0"/>
         <initParam name="processes" value="300"/>
         <initParam name="undo_tablespace" value="UNDOTBS1"/>
         <initParam name="control_files" value="('{ORACLE_BASE}/oradata1/control01.ctl', '{ORACLE_BASE}/oradata2/control02.ctl', '{ORACLE_BASE}/oradata3/control03.ctl')"/>
         <initParam name="diagnostic_dest" value="{ORACLE_BASE}"/>
         <initParam name="sec_max_failed_login_attempts" value="4"/>
         <initParam name="sec_protocol_error_trace_action" value="LOG"/>
         <initParam name="db_recovery_file_dest" value="{ORACLE_BASE}/fra"/>
         <initParam name="audit_trail" value="DB"/>
         <initParam name="audit_sys_operations" value="TRUE"/>
         <initParam name="log_archive_format" value="{SID}_t%t_s%s_r%r.dbf"/>
         <initParam name="memory_target" value="3276" unit="MB"/>
         <initParam name="sec_case_sensitive_logon" value="FALSE"/>
         <initParam name="sessions" value="472"/>
         <initParam name="streams_pool_size" value="32" unit="MB"/>
         <initParam name="db_block_size" value="8192"/>
         <initParam name="java_pool_size" value="0"/>
         <initParam name="open_cursors" value="300"/>
         <initParam name="db_recovery_file_dest_size" value="1400" unit="MB"/>
         <initParam name="db_flashback_retention_target" value="10800"/>
         <initParam name="pga_aggregate_target" value="0"/>
      </InitParams>
      <MiscParams>
         <databaseType>MULTIPURPOSE</databaseType>
         <maxUserConn>20</maxUserConn>
         <archiveLogMode>true</archiveLogMode>
         <initParamFileName>{ORACLE_BASE}/admin/{SID}/pfile/init.ora</initParamFileName>
      </MiscParams>
      <SPfile useSPFile="true">{ORACLE_HOME}/dbs/spfile{SID}.ora</SPfile>
   </InitParamAttributes>
   <StorageAttributes>
      <DataFiles>
         <Location>{ORACLE_HOME}/assistants/dbca/templates/Seed_Database.dfb</Location>
         <SourceDBName>seeddata</SourceDBName>
         <Name id="1" Tablespace="SYSTEM" Contents="PERMANENT" Size="700" autoextend="true" blocksize="8192">/{ORACLE_BASE}/oradata1/system01.dbf</Name>
         <Name id="2" Tablespace="SYSAUX" Contents="PERMANENT" Size="490" autoextend="true" blocksize="8192">/{ORACLE_BASE}/oradata1/sysaux01.dbf</Name>
         <Name id="3" Tablespace="UNDOTBS1" Contents="UNDO" Size="25" autoextend="true" blocksize="8192">/{ORACLE_BASE}/oradata3/undotbs01.dbf</Name>
         <Name id="4" Tablespace="USERS" Contents="PERMANENT" Size="5" autoextend="true" blocksize="8192">/{ORACLE_BASE}/oradata3/users01.dbf</Name>
      </DataFiles>
      <TempFiles>
         <Name id="1" Tablespace="TEMP" Contents="TEMPORARY" Size="20">/{ORACLE_BASE}/oradata2/temp01.dbf</Name>
      </TempFiles>
      <ControlfileAttributes id="Controlfile">
         <maxDatafiles>256</maxDatafiles>
         <maxLogfiles>16</maxLogfiles>
         <maxLogMembers>3</maxLogMembers>
         <maxLogHistory>1</maxLogHistory>
         <maxInstances>8</maxInstances>
         <image name="control01.ctl" filepath="/{ORACLE_BASE}/oradata1/"/>
         <image name="control02.ctl" filepath="/{ORACLE_BASE}/oradata2/"/>
         <image name="control03.ctl" filepath="/{ORACLE_BASE}/oradata3/"/>
      </ControlfileAttributes>
      <RedoLogGroupAttributes id="1">
         <reuse>false</reuse>
         <fileSize unit="MB">100</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo01.log" filepath="{ORACLE_BASE}/oradata1/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="2">
         <reuse>false</reuse>
         <fileSize unit="MB">100</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo02.log" filepath="{ORACLE_BASE}/oradata2/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="3">
         <reuse>false</reuse>
         <fileSize unit="MB">100</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo03.log" filepath="{ORACLE_BASE}/oradata3/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="4">
         <reuse>false</reuse>
         <fileSize unit="MB">100</fileSize>
         <Thread>1</Thread>
         <member ordinal="1" memberName="redo04.log" filepath="{ORACLE_BASE}/oradata4/"/>
      </RedoLogGroupAttributes>
   </StorageAttributes>
</DatabaseTemplate>

Create 12c database using .dbt template

$ORACLE_HOME/bin/dbca -silent   \
                      -createdatabase \
                      -createascontainerdatabase false \
                      -templatename /oracle/scripts/dbca_custom_amlk.dbt \
                      -gdbname amlk \
                      -sid amlk \
                      -syspassword qwertyuiop \
                      -systempassword asdfghjkl

where dbca_custom_amlk.dbt looks like this

<DatabaseTemplate name="dbca_amlk" description="" version="12.1.0.2.0">
   <CommonAttributes>
      <option name="OMS" value="false"/>
      <option name="JSERVER" value="false"/>
      <option name="SPATIAL" value="false"/>
      <option name="IMEDIA" value="false"/>
      <option name="ORACLE_TEXT" value="false"/>
      <option name="SAMPLE_SCHEMA" value="false"/>
      <option name="CWMLITE" value="false"/>
      <option name="APEX" value="false"/>
      <option name="DV" value="false"/>
   </CommonAttributes>
   <Variables>
      <variable name="ORA_ARCH" value="/cln/per/ora_data1/archivelog/{SID}"/>
      <variable name="ORA_DATA" value="/cln/acc/ora_data3/{SID}"/>
   </Variables>
   <CustomScripts Execute="false"/>
   <InitParamAttributes>
      <InitParams>
         <initParam name="db_name" value="{SID}"/>
         <initParam name="dispatchers" value="(PROTOCOL=TCP) (SERVICE={SID}XDB)"/>
         <initParam name="audit_file_dest" value="{ORACLE_BASE}/admin/{SID}/adump"/>
         <initParam name="compatible" value="12.1.0.2"/>
         <initParam name="remote_login_passwordfile" value="EXCLUSIVE"/>
         <initParam name="log_archive_dest_1" value="'LOCATION={ORA_ARCH}'"/>
         <initParam name="sga_target" value="5200" unit="MB"/>
         <initParam name="processes" value="1000"/>
         <initParam name="undo_tablespace" value="UNDOTBS1"/>
         <initParam name="control_files" value="(&quot;{ORA_DATA}/control01.ctl&quot;, &quot;{ORA_DATA}/control02.ctl&quot;, &quot;{ORA_DATA}/control03.ctl&quot;)"/>
         <initParam name="diagnostic_dest" value="{ORACLE_BASE}"/>
         <initParam name="audit_trail" value="db"/>
         <initParam name="log_archive_format" value="log%t_%s_%r.arc"/>
         <initParam name="nls_territory" value="AMERICA"/>
         <initParam name="db_block_size" value="8192"/>
         <initParam name="open_cursors" value="300"/>
         <initParam name="nls_language" value="AMERICAN"/>
         <initParam name="pga_aggregate_target" value="1500" unit="MB"/>
      </InitParams>
      <MiscParams>
         <databaseType>MULTIPURPOSE</databaseType>
         <maxUserConn>20</maxUserConn>
         <percentageMemTOSGA>40</percentageMemTOSGA>
         <customSGA>false</customSGA>
         <characterSet>AL32UTF8</characterSet>
         <nationalCharacterSet>AL16UTF16</nationalCharacterSet>
         <archiveLogMode>false</archiveLogMode>
         <initParamFileName>{ORACLE_BASE}/admin/{SID}/pfile/init.ora</initParamFileName>
      </MiscParams>
      <SPfile useSPFile="true">{ORACLE_HOME}/dbs/spfile{SID}.ora</SPfile>
   </InitParamAttributes>
   <StorageAttributes>
      <ControlfileAttributes id="Controlfile">
         <maxDatafiles>100</maxDatafiles>
         <maxLogfiles>16</maxLogfiles>
         <maxLogMembers>3</maxLogMembers>
         <maxLogHistory>1</maxLogHistory>
         <maxInstances>8</maxInstances>
         <image name="control01.ctl" filepath="{ORA_DATA}/"/>
         <image name="control02.ctl" filepath="{ORA_DATA}/"/>
         <image name="control03.ctl" filepath="{ORA_DATA}/"/>
      </ControlfileAttributes>
      <DatafileAttributes id="{ORA_DATA}/sysaux01.dbf" con_id="1">
         <tablespace>SYSAUX</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">550</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">10240</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{ORA_DATA}/system01.dbf" con_id="1">
         <tablespace>SYSTEM</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">700</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">10240</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{ORA_DATA}/temp01.dbf" con_id="1">
         <tablespace>TEMP</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">20</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">640</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{ORA_DATA}/undotbs01.dbf" con_id="1">
         <tablespace>UNDOTBS1</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">200</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">5120</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <DatafileAttributes id="{ORA_DATA}/users01.dbf" con_id="1">
         <tablespace>USERS</tablespace>
         <temporary>false</temporary>
         <online>true</online>
         <status>0</status>
         <size unit="MB">5</size>
         <reuse>true</reuse>
         <autoExtend>true</autoExtend>
         <increment unit="KB">1280</increment>
         <maxSize unit="MB">-1</maxSize>
      </DatafileAttributes>
      <TablespaceAttributes id="SYSAUX" con_id="1">
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">64</initSize>
         <increment unit="KB">64</increment>
         <incrementPercent>50</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>4096</maxExtends>
         <minExtendsSize unit="KB">64</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <autoSegmentMgmt>true</autoSegmentMgmt>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{ORA_DATA}/sysaux01.dbf"/>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="SYSTEM" con_id="1">
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>3</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">64</initSize>
         <increment unit="KB">64</increment>
         <incrementPercent>50</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>-1</maxExtends>
         <minExtendsSize unit="KB">64</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <autoSegmentMgmt>true</autoSegmentMgmt>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{ORA_DATA}/system01.dbf"/>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="TEMP" con_id="1">
         <temporary>true</temporary>
         <defaultTemp>true</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="MB">1</uniAllocSize>
         <initSize unit="KB">64</initSize>
         <increment unit="KB">64</increment>
         <incrementPercent>0</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>0</maxExtends>
         <minExtendsSize unit="KB">64</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <autoSegmentMgmt>true</autoSegmentMgmt>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{ORA_DATA}/temp01.dbf"/>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="UNDOTBS1" con_id="1">
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>true</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">512</initSize>
         <increment unit="KB">512</increment>
         <incrementPercent>50</incrementPercent>
         <minExtends>8</minExtends>
         <maxExtends>4096</maxExtends>
         <minExtendsSize unit="KB">512</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <autoSegmentMgmt>true</autoSegmentMgmt>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{ORA_DATA}/undotbs01.dbf"/>
         </datafilesList>
      </TablespaceAttributes>
      <TablespaceAttributes id="USERS" con_id="1">
         <temporary>false</temporary>
         <defaultTemp>false</defaultTemp>
         <undo>false</undo>
         <local>true</local>
         <blockSize>-1</blockSize>
         <allocation>1</allocation>
         <uniAllocSize unit="KB">-1</uniAllocSize>
         <initSize unit="KB">128</initSize>
         <increment unit="KB">128</increment>
         <incrementPercent>0</incrementPercent>
         <minExtends>1</minExtends>
         <maxExtends>4096</maxExtends>
         <minExtendsSize unit="KB">128</minExtendsSize>
         <logging>true</logging>
         <recoverable>false</recoverable>
         <maxFreeSpace>0</maxFreeSpace>
         <autoSegmentMgmt>true</autoSegmentMgmt>
         <bigfile>false</bigfile>
         <datafilesList>
            <TablespaceDatafileAttributes id="{ORA_DATA}/users01.dbf"/>
         </datafilesList>
      </TablespaceAttributes>
      <RedoLogGroupAttributes id="1">
         <reuse>false</reuse>
         <fileSize unit="MB">500</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo01.log" filepath="{ORA_DATA}/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="2">
         <reuse>false</reuse>
         <fileSize unit="MB">500</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo02.log" filepath="{ORA_DATA}/"/>
      </RedoLogGroupAttributes>
      <RedoLogGroupAttributes id="3">
         <reuse>false</reuse>
         <fileSize unit="MB">500</fileSize>
         <Thread>1</Thread>
         <member ordinal="0" memberName="redo03.log" filepath="{ORA_DATA}/"/>
      </RedoLogGroupAttributes>
   </StorageAttributes>
</DatabaseTemplate>

Create RAC database on ASM for Enterprise Manager Repository (OMR) using silent option

  - !/bin/sh
WHOAMI=`/usr/bin/whoami`
ID=/usr/bin/id
USER=`/usr/bin/id -u oracle`
CURRID=`/usr/bin/id -u`

if [[ "X$USER" != "X$CURRID" ]]; then
  echo "This should be run as oracle ($USER) but is being run by $WHOAMI - $CURRID"
  exit 1
fi
ORACLE_SID=OEMREP;export ORACLE_SID
ORACLE_BASE=/u01/app/oracle;export ORACLE_BASE
ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1;export ORACLE_HOME
PATH=/u01/app/11.2.0.4/grid/tfa/sdtcsynoda01-rac/tfa_home/bin:/opt/oracle/oak/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/oracle/oak/lib/oaklib:/opt/oracle/oak/lib/oaklib:$ORACLE_HOME/bin;export PATH
/u01/app/oracle/product/11.2.0.4/dbhome_1/bin/dbca -createDatabase -silent   \
                    -gdbname                   OEMREP                  \
                    -sid                       OEMREP                  \
                    -syspassword               g43u5fwf                \
                    -systempassword            wer4fr4c                \
                    -emconfiguration           LOCAL                   \
                    -dbsnmppassword            vgwreybv                \
                    -sysmanpassword            aw3vrv44                \
                    -diskgroupname             'DATA'                  \
                    -recoverygroupname         'RECO'                  \
                    -storagetype               ASM                     \
                    -asmsyspassword            bwr6yb65                \
                    -nodelist 'sdtcsynoda01-rac,sdtcsynoda02-rac'      \
                    -characterset              AL32UTF8                \
                    -nationalcharacterset      AL16UTF16               \
                    -databasetype              MULTIPURPOSE            \
                    -responsefile              NO_VALUE                \
                    -templatename              odadbtmp_32625.dbt

Release 12, shared binaries

The following template is for databases that will have a shared shared set of oracle product binaries (version 12)
There could be many databases using the same ORACLE_HOME

export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0.2
export PATH=$ORACLE_HOME/bin:$PATH
$ORACLE_HOME/bin/dbca -silent   \
                      -createdatabase \
                      -createAsContainerDatabase false \
                      -templatename ${ORACLE_HOME}/assistants/dbca/templates/shared_code.dbc \
                      -gdbname RMANV12 \
                      -sid RMANV12 \
                      -syspassword qwertyuiop \
                      -systempassword asdfghjkl \
                      -characterset AL32UTF8 \
                      -nationalcharacterset AL16UTF16 \
                      -automaticMemoryManagement true \
                      -totalMemory 3000000000 \
                      -initparams processes=400 \
                      -initparams enable_pluggable_database=false

Postrequisites

  • run root.sh
  • add a line to /etc/oratab

Fully automated version

su ${ORACLE_USER} -c "umask ${APPS_UMASK}; \
                        unset ORACLE_SID; unset ORACLE_HOME; unset TNS_ADMIN; \
                        ${MOUNT_POINT}/runInstaller \
                        -waitforcompletion \
                        -silent \
                        -noconfig \
                        -ignoreSysPrereqs \
                        -responseFile ${oracle_response_file_dir}/ora11203.rsp \
                        "FROM_LOCATION=${MOUNT_POINT}/stage/products.xml" \
                        "ORACLE_HOME=${OHOME}" \
                        "ORACLE_BASE=${OBASE}" \
                        "ORACLE_HOSTNAME=${OHOST}" \
                        "ORACLE_HOME_NAME=${ORACLE_HOME_NAME}"" \
                    >> ${INSTALL_LOG} 2>&1

Create database and add it directly to the Cloud Control

${ORACLE_HOME}/bin/dbca                \
    -silent                            \
    -createDatabase                    \
    -gdbName test                      \
    -templateName /oracle/scripts/.shb/dbca_cln_19.dbt    \
    -sid test                          \
    -createAsContainerDatabase false   \
    -sysPassword xxxxxxx#              \
    -systemPassword xxxxxxx#           \
    -emConfiguration CENTRAL           \
    -dbsnmpPassword xxxxxxx#           \
    -omsHost hn1627.cln.be             \
    -omsPort 4903                      \
    -emUser sysman                     \
    -emPassword xxxxxxx                \
    -redoLogFileSize 500               \
    -recoveryAreaDestination NONE      \
    -enableArchive true                \
    -archiveLogMode AUTO               \
    -archiveLogDest /cln/dev/ora_data/test/archivelog    \
    -memoryMgmtType AUTO_SGA           \
    -characterSet AL32UTF8             \
    -nationalCharacterSet AL16UTF16    \
    -sampleSchema false                \
    -listeners LSNR_HN5224_1962        \
    -variables ORACLE_BASE_HOME=/cln/dev/ora_bin/app/oracle/product/19.16/dbhome_1,ORADATA=/cln/dev/ora_data/test/data,SID=test,DB_UNIQUE_NAME=test,ORACLE_BASE=/cln/dev/ora_bin/app/oracle,ORACLE_HOME=/cln/dev/ora_bin/app/oracle/product/19.16/dbhome_1    \
    -initParams processes=1000,sga_target=2000M,pga_aggregate_target=800M

When it gives a FATAL error and complains it cannot connect, are you on AIX? Then you need to follow this document to restrict TLS to version 1.2 only!

Install server software without response file

Example: Oracle Database 11.2 on Unix/Linux silent installation (Enterprise Edition, Software Only)

cd /nas/software/oracle/stage/11.2.0.4/database
./runInstaller -silent -ignoreSysPrereqs                                       \
FROM_LOCATION=/nas/software/oracle/stage/11.2.0.4/database/stage/products.xml  \
oracle.install.option=INSTALL_DB_SWONLY                                        \
UNIX_GROUP_NAME=oinstall                                                       \
INVENTORY_LOCATION=/cln/dev/ora_bin/app/oracle/oraInventory                    \
ORACLE_HOME=/cln/dev/ora_bin/app/oracle/product/11.2.0.4/dbhome_1              \
ORACLE_BASE=/cln/dev/ora_bin/app/oracle                                        \
oracle.install.db.InstallEdition=EE                                            \
oracle.install.db.DBA_GROUP=dba                                                \
oracle.install.db.OPER_GROUP=dba                                               \
DECLINE_SECURITY_UPDATES=true

Example: Oracle Database 12.1 on Unix/Linux silent installation - Software Only

cd /oracle/Patches/stage/12.1.0.2/database
./runInstaller -silent                                                    \
FROM_LOCATION=/oracle/Patches/stage/12.1.0.2/database/stage/products.xml  \
oracle.install.option=INSTALL_DB_SWONLY                                   \
UNIX_GROUP_NAME=oinstall                                                  \
INVENTORY_LOCATION=/cln/dev/ora_bin/app/oracle/oraInventory               \
ORACLE_HOME=/cln/dev/ora_bin/app/oracle/product/12.1.0.2/dbhome_1         \
ORACLE_BASE=/cln/dev/ora_bin/app/oracle                                   \
oracle.install.db.InstallEdition=EE                                       \
oracle.install.db.DBA_GROUP=dba                                           \
oracle.install.db.OPER_GROUP=dba                                          \
oracle.install.db.BACKUPDBA_GROUP=dba                                     \
oracle.install.db.DGDBA_GROUP=dba                                         \
oracle.install.db.KMDBA_GROUP=dba                                         \
DECLINE_SECURITY_UPDATES=true

Install client software without response file

Download Oracle software from edelivery.oracle.com

Example: Oracle Client 12.1 on Linux silent installation (Install Type: Administrator)

cd temp
unzip V46097-01.zip
cd client
./runInstaller -silent -showProgress -waitforcompletion      \
     oracle.install.client.installType='Administrator'       \
     INVENTORY_LOCATION=/ora01/app/oracle/oraInventory       \
     ORACLE_HOME='/ora01/app/oracle/product/12.1.0/client_1' \
     ORACLE_BASE='/ora01/app/oracle'                         \
     UNIX_GROUP_NAME=dba

This produces something like this

You can find the log of this install session at:
 /ora01/app/oracle/oraInventory/logs/installActions2021-04-12_01-57-43PM.log

Prepare in progress.
..................................................   6% Done.

Prepare successful.

Copy files in progress.
..................................................   12% Done.
..................................................   17% Done.
..................................................   22% Done.
..................................................   27% Done.
..................................................   32% Done.
..................................................   37% Done.
..................................................   42% Done.
..................................................   47% Done.
..................................................   52% Done.
..................................................   57% Done.
..........
Copy files successful.

Link binaries in progress.
....................
Link binaries successful.

Setup files in progress.
..............................
Setup files successful.
..........
Setup Inventory in progress.

Setup Inventory successful.
..........
Finish Setup in progress.
..................................................   64% Done.

Finish Setup successful.
The installation of Oracle Client 12c was successful.
Please check '/ora01/app/oracle/oraInventory/logs/silentInstall2021-04-12_01-57-43PM.log' for more details.

Prepare for configuration steps in progress.

Prepare for configuration steps successful.
..................................................   80% Done.

Oracle Client Configuration in progress.

Oracle Client Configuration successful.
..................................................   96% Done.

As a root user, execute the following script(s):
        1. /ora01/app/oracle/oraInventory/orainstRoot.sh



..................................................   100% Done.
sudo /ora01/app/oracle/oraInventory/orainstRoot.sh

Tip: Check the logfile mentioned at the end of the installation as errors happen despite the installation appearing to be successful!

grep ERROR /ora01/app/oracle/oraInventory/logs/silentInstall2021-04-12_01-57-43PM.log
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7573 : Sufficient swap size is not available on node "hn5504" [Required = 7.6734GB (8046108.0KB) ; Found = 2GB (2097148.0KB)]
INFO:           ERRORMSG(hn5504): PRVF-7573 : Sufficient swap size is not available on node "hn5504" [Required = 7.6734GB (8046108.0KB) ; Found = 2GB (2097148.0KB)]
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7532 : Package "libstdc++-devel(x86_64)" is missing on node "hn5504"
INFO:           ERRORMSG(hn5504): PRVF-7532 : Package "libstdc++-devel(x86_64)" is missing on node "hn5504"
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7532 : Package "gcc" is missing on node "hn5504"
INFO:           ERRORMSG(hn5504): PRVF-7532 : Package "gcc" is missing on node "hn5504"
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7532 : Package "gcc-c++" is missing on node "hn5504"
INFO:           ERRORMSG(hn5504): PRVF-7532 : Package "gcc-c++" is missing on node "hn5504"
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7532 : Package "ksh" is missing on node "hn5504"
INFO:           ERRORMSG(hn5504): PRVF-7532 : Package "ksh" is missing on node "hn5504"
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7532 : Package "libaio-devel(x86_64)" is missing on node "hn5504"
INFO:           ERRORMSG(hn5504): PRVF-7532 : Package "libaio-devel(x86_64)" is missing on node "hn5504"
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7573 : Sufficient swap size is not available on node "hn5504" [Required = 7.6734GB (8046108.0KB) ; Found = 2GB (2097148.0KB)]
INFO:           ERRORMSG(hn5504): PRVF-7573 : Sufficient swap size is not available on node "hn5504" [Required = 7.6734GB (8046108.0KB) ; Found = 2GB (2097148.0KB)]
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7532 : Package "libstdc++-devel(x86_64)" is missing on node "hn5504"
INFO:           ERRORMSG(hn5504): PRVF-7532 : Package "libstdc++-devel(x86_64)" is missing on node "hn5504"
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7532 : Package "gcc" is missing on node "hn5504"
INFO:           ERRORMSG(hn5504): PRVF-7532 : Package "gcc" is missing on node "hn5504"
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7532 : Package "gcc-c++" is missing on node "hn5504"
INFO:           ERRORMSG(hn5504): PRVF-7532 : Package "gcc-c++" is missing on node "hn5504"
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7532 : Package "ksh" is missing on node "hn5504"
INFO:           ERRORMSG(hn5504): PRVF-7532 : Package "ksh" is missing on node "hn5504"
INFO: INFO: ERROR: [Result.addErrorDescription:624]  PRVF-7532 : Package "libaio-devel(x86_64)" is missing on node "hn5504"
INFO:           ERRORMSG(hn5504): PRVF-7532 : Package "libaio-devel(x86_64)" is missing on node "hn5504"

And this means the pre-requisite packages were not installed.

To use the new software, create an $ORACLE_HOME/network/admin/tnsnames.ora file (or copy one from another client), then

export ORACLE_HOME="/ora01/app/oracle/product/12.1.0/client_1"
export PATH="$ORACLE_HOME/bin:$PATH"

Install 19c client software without response file

Download Oracle software from edelivery.oracle.com or Oracle Database Software Downloads

Example: Oracle Client 19.3 “home image” on Linux silent installation (Install Type: Administrator)

Something like these lines can be put in the .profile (ksh) or .bash_profile (bash) to set the client up at login

umask 022
export ORACLE_BASE="/ora01/app/oracle"
export ORACLE_HOME="${ORACLE_BASE}/product/19.3.0/client_1"
export TNS_ADMIN="${ORACLE_HOME}/network/admin"
export PATH="${ORACLE_HOME}/bin:${PATH}"

Prepare the structure and unzip the client home

cd
. ./.profile
mkdir -m 755 -p "${ORACLE_HOME}"
chown oracle:dba "${ORACLE_HOME}"
cd "${ORACLE_HOME}"
unzip /oracle/Patches/V982065-01_LINUX.X64_193000_client_home.zip -d ./

On RHEL 8, we need to prevent some checks which will stop the installation.

To prevent

[WARNING] [INS-08101] Unexpected error while executing the action at state: 'clientSupportedOSCheck'
   CAUSE: No additional information available.
   ACTION: Contact Oracle Support Services or refer to the software manual.
   SUMMARY:
       - java.lang.NullPointerException

edit a configuration file to make a permanent change

vi $ORACLE_HOME/cv/admin/cvu_config

Remove the comment from this line:
#CV_ASSUME_DISTID=OEL5

or

perl -p -i -e 's/^#CV_ASSUME_DISTID=OEL5/CV_ASSUME_DISTID=OEL5/' "${ORACLE_HOME}/cv/admin/cvu_config"

To prevent

[WARNING] [INS-13001] Oracle Database Client is not supported on this operating system. Installer will not perform prerequisite checks on the system.
   CAUSE: This operating system may not have been in the certified list at the time of the release of this software.
   ACTION: Refer to My Oracle Support portal for the latest certification information for this operating system. Proceed with the installation if the operating system has been certified after the release of this software.

This is becaue /tmp is mounted with noexec option. This may be valid so the best way (and a by-product is that we can use a bigger tmp filesystem) is to use a non-default /tmp location.

We can set some environment variables to allow it to continue

mkdir ${ORACLE_BASE}/tmp
export _JAVA_OPTIONS="-Djava.io.tmpdir=${ORACLE_BASE}/tmp"
export CV_DESTLOC="${ORACLE_BASE}/tmp"
export TMP="${ORACLE_BASE}/tmp"
./runInstaller -silent -ignorePrereqFailure -waitForCompletion  \
    ORACLE_HOME="${ORACLE_HOME}"                                \
    ORACLE_BASE="${ORACLE_BASE}"                                \
    INVENTORY_LOCATION="/ora01/app/oraInventory"                \
    UNIX_GROUP_NAME="dba"                                       \
    oracle.install.IsBuiltInAccount="true"                      \
    oracle.install.client.installType="Administrator"

This produces something like this

Launching Oracle Database Client Setup Wizard...

[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2021-04-29_11-57-07AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: installActions2021-04-29_11-57-07AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /ora01/app/oracle/product/19.3.0/client_1/install/response/client_2021-04-29_11-57-07AM.rsp

You can find the log of this install session at:
 /tmp/InstallActions2021-04-29_11-57-07AM/installActions2021-04-29_11-57-07AM.log

As a root user, execute the following script(s):
        1. /ora01/app/oraInventory/orainstRoot.sh

Execute /ora01/app/oraInventory/orainstRoot.sh on the following nodes:
[hn1701]


Successfully Setup Software with warning(s).
Moved the install session logs to:
/ora01/app/oraInventory/logs/InstallActions2021-04-29_11-57-07AM

Perform root actions

sudo /ora01/app/oraInventory/orainstRoot.sh

Provide access to all users so that one client can serve everyone

In order to have the client shared by many users, certain permissions have to be relaxed

touch "${ORACLE_HOME}/network/admin/tnsnames.ora"
chmod o+r "${ORACLE_HOME}/network/admin/tnsnames.ora"
cd "${ORACLE_HOME}/lib"
chmod o+rx libagtsh*
chmod o+rx libclntsh*
chmod o+rx libocci*
cd "${ORACLE_HOME}/bin"
chmod o+rx sqlplus
while :; do
[[ "$(eval pwd)" == '/' ]] && break
pwd
chmod o+rx .
cd ..
done

Basic installation of Oracle software using default response file with command line overrides

${ORACLE_HOME}/runInstaller -ignorePrereq -waitforcompletion -silent \
> -responseFile ${ORACLE_HOME}/install/response/db_install.rsp \
> oracle.install.option=INSTALL_DB_SWONLY \
> ORACLE_HOSTNAME=${ORACLE_HOSTNAME} \
> UNIX_GROUP_NAME=oinstall \
> INVENTORY_LOCATION=${ORA_INVENTORY} \
> SELECTED_LANGUAGES=en \
> ORACLE_HOME=${ORACLE_HOME} \
> ORACLE_BASE=${ORACLE_BASE} \
> 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.CLUSTER_NODES=${NODE1_HOSTNAME},${NODE2_HOSTNAME} \
> oracle.install.db.isRACOneInstall=false \
> oracle.install.db.rac.serverpoolCardinality=0 \
> oracle.install.db.config.starterdb.type=GENERAL_PURPOSE \
> oracle.install.db.ConfigureAsContainerDB=false \
> SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
> DECLINE_SECURITY_UPDATES=true

For users other than the oracle user to be able to use SQL*Plus, it seems some libraries will need to be given wider permissions…

chmod o+rx ${ORACLE_HOME}/lib/libagtsh.so.1.0
chmod o+rx ${ORACLE_HOME}/lib/libclntshcore.so.19.1
chmod o+rx ${ORACLE_HOME}/lib/libclntsh.so.19.1
chmod o+rx ${ORACLE_HOME}/lib/libocci.so.19.1
chmod o+r ${ORACLE_HOME}/network/admin/tnsnames.ora

Notes :
1) The following OUI options are not mandatory but can be used when required:
– force : Allows silent mode installation into a non-empty ORACLE_HOME directory.
– debug : Displays extra debug information from OUI. If you want less output just omit it.
2) The following OUI variables are not mandatory but can be used when required:
– ORACLE_HOME_NAME – if not used , OUI will assign the name automatically (OraClient11g_Home1, OraClient11g_Home2, .. OraClient12g_Home1, OraClient11g_Home2,..)
3) Following are new groups introduced in Oracle 12.1:
oracle.install.db.BACKUPDBA_GROUP=dba
oracle.install.db.DGDBA_GROUP=dba
oracle.install.db.KMDBA_GROUP=dba

Detach an ORACLE_HOME from the central inventory

cd $ORACLE_HOME/oui/bin
$ ./runInstaller -detachHome ORACLE_HOME_NAME="OraDB18Home1" ORACLE_HOME="/cln/tst/ora_bin1/app/oracle/product/18c/dbhome_1"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 62464 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
'DetachHome' was successful.

or, run this shell that is constructed to do just what it says on the tin.

$ORACLE_HOME/oui/bin/detachHome.sh

Remove an ORACLE_HOME from the central inventory

This deletes the home and all files in it and cleans up the inventory. Different from detatching it!

${ORACLE_HOME}/oui/bin/runInstaller -deinstall -silent "REMOVE_HOMES={/cln/exp/ora_bin1/app/oracle/product/agent12c/core/12.1.0.3.0}" -waitForCompletion -removeAllFiles

Deinstall Oracle 19c binaries

This version does not support the -deinstall option of runInstaller

$ORACLE_HOME/deinstall/deinstall

Delete / Drop a database using silent mode

Remove a database without the GUI

export ORACLE_SID=aarct
. oraenv
dbca -silent -deleteDatabase -sourceDB aarct -sysDBAUserName sys -sysDBAPassword sys

Rebuild Oracle Central Inventory

If the Central Inventory becomes corrupt or simply lost, it can be rebuilt using the runInstaller executable in each ORACLE_HOME that needs attaching.

Where is the current Central Inventory?

If it exists, it should be referenced in the file /etc/oraInst.loc (or /var/oracle/oraInst.loc). If it is there, good. If not, it can be found by interrogating one of the homes

awk -F':' '{print $2}' /etc/oratab|grep -v "^#"|sort|uniq

Set ORACLE_HOME to one of the values shown

$ORACLE_HOME/OPatch/opatch lsinventory

See at the top of the listing where Central Inventory is shown

$ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.23
Copyright (c) 2021, Oracle Corporation.  All rights reserved.


Oracle Home       : /cln/tst/ora_bin1/app/oracle/product/19.9.0/dbhome_1
Central Inventory : /cln/tst/ora_bin1/app/oracle/oraInventory
   from           : /cln/tst/ora_bin1/app/oracle/product/19.9.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.23
OUI version       : 12.2.0.7.0
Log file location : /cln/tst/ora_bin1/app/oracle/product/19.9.0/dbhome_1/cfgtoollogs/opatch/opatch2021-02-09_11-03-21AM_1.log

Lsinventory Output file location : /cln/tst/ora_bin1/app/oracle/product/19.9.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2021-02-09_11-03-21AM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: hn5114
ARU platform id: 212
ARU platform description:: IBM_AIX

Installed Top-level Products (1):

Oracle Database 19c                                                  19.0.0.0.0
There are 1 products installed in this Oracle Home.


Interim patches (2) :
...

Rename the existing inventory

Now go to the ContentsXML subdirectory of that directory and rename the inventory.xml file

cd /cln/tst/ora_bin1/app/oracle/oraInventory/ContentsXML
cp inventory.xml inventory.xml.$(date '+%Y%m%d%H%M%S')
> inventory.xml

If the /etc/oraInst.loc (or /var/oracle/oraInst.loc) file did not exist, create one now. It should contain 2 lines

inventory_loc=<value shown as Central Inventory in the lsinventory>
inst_group=oinstall

Rebuild the new inventory

Now for each home found in the oratab, add the home to the Central Inventory using the runInstaller executable

cd <each oracle home>
./oui/bin/runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="<each oracle home>"

This should do it. If it complains about ORACLE_HOME_NAME not present then it will also have to be supplied (something like this: ORACLE_HOME_NAME=“OraDb11g_home1”) but it should default.

install_oracle_software_run_netca_and_dbca_without_gui_silent_option.txt · Last modified: 2024/03/08 12:32 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki