It’s been years since I last used a GUI to install Oracle software or create a database with DBCA. Sometimes it is baffling to see Word documents with dozens of screenshots showing how to setup Oracle at customer sites. In my opinion, showing the silent mode call (of OUI, DBCA, etc.) in the documentation is all you need. One single page, that’s it. OK, if you want to split hairs, the DBCA .dbt file is multiple pages in the appendix :-).
Knowing all this silent mode stuff will really make your life easier when it comes to automation. Think of Chef, Puppet, Ansible and what not. Even dockerized Oracle is now all the rage.
In this post we start with the Oracle software installation.
First we specify some environment variables to tell what and where to extract the Oracle software zips:
export ORA_SW_TMP=/tmp/oraswtmp # that is where the Oracle zip files will be extracted to export ORA_ZIP_1=/tmp/p21419221_121020_Linux-x86-64_1of10.zip # zip one of the Oracle database software export ORA_ZIP_2=/tmp/p21419221_121020_Linux-x86-64_2of10.zip # zip two of the Oracle database software
Then we specify some well known Oracle environment variables:
export ORACLE_HOSTNAME=$(hostname) export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=${ORACLE_BASE}/product/ora12102 export INVENTORY_LOCATION=/u01/app/oraInventory
Extracting the Oracle zips:
mkdir ${ORA_SW_TMP} unzip ${ORA_ZIP_1} -d ${ORA_SW_TMP} unzip ${ORA_ZIP_2} -d ${ORA_SW_TMP}
Run the installer in silent mode:
${ORA_SW_TMP}/database/runInstaller -silent -waitforcompletion \ oracle.install.option=INSTALL_DB_SWONLY \ ORACLE_HOSTNAME="${ORACLE_HOSTNAME}" \ UNIX_GROUP_NAME=oinstall \ INVENTORY_LOCATION="${INVENTORY_LOCATION}" \ SELECTED_LANGUAGES=en \ ORACLE_HOME="${ORACLE_HOME}" \ ORACLE_BASE="${ORACLE_BASE}" \ oracle.install.db.InstallEdition=EE \ oracle.install.db.DBA_GROUP=dba \ oracle.install.db.OPER_GROUP=oper \ oracle.install.db.BACKUPDBA_GROUP=backupdba \ oracle.install.db.DGDBA_GROUP=dgdba \ oracle.install.db.KMDBA_GROUP=kmdba \ DECLINE_SECURITY_UPDATES=true
Run the Oracle root scripts:
sudo ${INVENTORY_LOCATION}/orainstRoot.sh sudo ${ORACLE_HOME}/root.sh
Go grab a coffe.
Then, put that in a shell script and you’re all set.
P.s. this also works on Windows, just with slighlty different parameters.
set ORACLE_HOSTNAME=%HOSTNAME% set ORACLE_BASE=D:\app\oracle set ORACLE_HOME=%ORACLE_BASE%\product\ora12102 set INVENTORY_LOCATION=C:\app\oraInventory set ORA_HOME_USER=spotonoracle\OracleSA$ # use Group Managed Service Account otherwise you also have to provide a password .\setup.exe -silent -waitforcompletion ^ oracle.install.option=INSTALL_DB_SWONLY ^ ORACLE_HOSTNAME="%ORACLE_HOSTNAME%" ^ INVENTORY_LOCATION="%INVENTORY_LOCATION%" ^ SELECTED_LANGUAGES=en ^ ORACLE_HOME="%ORACLE_HOME%" ^ ORACLE_BASE="%ORACLE_BASE%" ^ oracle.install.db.InstallEdition=EE ^ oracle.install.IsBuiltInAccount=false ^ oracle.install.OracleHomeUserName="%ORA_HOME_USER%" ^ DECLINE_SECURITY_UPDATES=true