Andy Kerber (@dbakerber), Senior Consultant
A basic skill of any Oracle DBA is to install the Oracle database software, both silently and using the installer through X-Windows. In this article, we will discuss installing the Oracle database home using the silent installation method, and also cloning the Oracle database home. The operating system in this example is RHEL 7.
Installing Oracle (Silent Install)
Please note that unless you routinely use the silent install, cloning, and database creation methods, it is likely that it will take you several tries to get all the settings for your environment correct. I recommend that you practice this procedure in a test environment a few times until you are confident in your ability to get the response files correct, and accomplish your intended task without errors.
First, a very quick overview of the pre-installation tasks.
- Install the following packages:
binutils
compat-libcap1
compat-libstdc++-33
compat-libstdc++-33.i686
glibc
glibc.i686
glibc-devel
glibc-devel.i686
ksh
libaio
libaio.i686
libaio-devel
libaio-devel.i686
libX11
libX11.i686
libXau
libXau.i686
libXi
libXi.i686
libXtst
libXtst.i686
libgcc
libgcc.i686
libstdc++
libstdc++.i686
libstdc++-devel
libstdc++-devel.i686
libxcb
libxcb.i686
make
nfs-utils
net-tools
smartmontools
sysstat
unixODBC
unixODBC-devel
gcc
gcc-c++
libXext
libXext.i686
zlib-devel
zlib-devel.i686
- Add the operating system groups:
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
- Create the Oracle user:
useradd –u 54321 –g oinstall –G dba,oracle,oper
- Set the password for the Oracle user:
passwd oracle
- Create the top level directory for the Oracle user, change the ownership, and set privileges:
mkdir –p /u01
chown oracle:dba /u01
chmod 775 /u01
- Now, as Oracle, download the Oracle software from OTN or Oracle Software Delivery.
- Unzip the downloaded file:
unzip linuxx64_12201_database.zip
- Configure Tuned as described in House of Brick’s blog post (Tuned is installed by default on RHEL7).
At this point, we are ready to begin the initial software installation. As the downloaded file was unzipped, a directory called database was created under your current directory.
- Cd to the ./database/response directory.
- Copy the db_install.rsp file to the ./database directory. In my case, it will be copied from /home/oracle/database/response directory to /home/oracle/database
- Modify the following lines (only) to read as follows (or customize for your environment) in the file /home/oracle/database/db_install.rsp:
oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/app/oraInventory ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/dbhome_1 ORACLE_BASE=/u01/app/oracle 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.OSRACDBA_GROUP=dba SECURITY_UPDATES_VIA_MYORACLESUPPORT=false DECLINE_SECURITY_UPDATES=true
- After making the changes to the db_install.rsp file, you are ready to run the Oracle installation. The command to run the Oracle home in silent mode (running from the database directory) is:
./runInstaller -silent -responseFile
/home/oracle/database/db_install.rsp
Note that a common mistake is to put a ‘=’ after –responseFile. Do not do this, it will cause an error.
The output of a successful installation will look like this:
[oracle@rhel7 database]$ ./runInstaller -silent -responseFile /home/oracle/database/db_install.rsp Starting Oracle Universal Installer... Checking Temp space: must be greater than 500 MB.  Actual 66020 MB  Passed Checking swap space: must be greater than 150 MB.  Actual 16379 MB  Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-11-02_03-04-27PM. Please wait ...[oracle@rhel7 database]$ You can find the log of this install session at: /u01/app/oraInventory/logs/installActions2017-11-02_03-04-27PM.log The installation of Oracle Database 12c was successful. Please check '/u01/app/oraInventory/logs/silentInstall2017-11-02_03-04-27PM.log' for more details.
As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh 2. /u01/app/oracle/product/12.2.0.1/dbhome_1/root.sh Successfully Setup Software.
- Now run the ‘root’ scripts as the root user:
Password: Last login: Thu Nov 2 15:04:11 CDT 2017 on pts/0 [root@rhel7 ~]# cd /u01/app/oraInv* [root@rhel7 oraInventory]# ls ContentsXML logs oraInst.loc orainstRoot.sh oui [root@rhel7 oraInventory]# ./orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete. [root@rhel7 oraInventory]# [root@rhel7 oraInventory]# cd /u01/app/oracle/product/12.2.0.1/dbhome_1 [root@rhel7 dbhome_1]# ./root.sh Check /u01/app/oracle/product/12.2.0.1/dbhome_1/install/root_rhel7.localdomain_2017-11-02_15-12-34-541423307.log for the output of root script [root@rhel7 dbhome_1]#
Cloning the Oracle Home
At this point, your new Oracle Home has been successfully created. Next, we will cover the steps for cloning the Oracle home. To start, create a zip file of the current home.
- cd /u01/app/oracle/product/12.2.01
- zip –r dbhome_1.zip dbhome_1
- In our case, we are just going to create a new database home next to the current one, so we are going to put the zipped filed into dbhome_2. This takes a little trick:
mkdir dbhome_2
unzip dbhome_1.zip –d dbhome_2 cd dbhome_2 cd dbhome_1 mv * ..
Now the directory /u01/app/oracle/product/12.2.0.1/dbhome_2 is a copy of /u01/app/oracle/product/12.2.0.1/dbhome_1.
- Next, the following three items are not vital, but help prevent typos:
export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/dbhome_2 export ORACLE_BASE=/u01/app/oracle export ORAINST_LOC=/u01/app/oraInventory
- Change to the cloning directory of the new home:
cd /u01/app/oracle/product/12.2.0.1/dbhome_2/clone/bin
- Run the clone command using the parameters we defined earlier:
./clone.pl ORACLE_BASE=$ORACLE_BASE ORACLE_HOME=$ORACLE_HOME INVENTORY_LOCATION=$ORAINST_LOC
- The output should look like this if successful:
[oracle@rhel7 bin]$ ./clone.pl ORACLE_BASE=$ORACLE_BASE ORACLE_HOME=$ORACLE_HOME INVENTORY_LOCATION=$ORAINST_LOC Starting Oracle Universal Installer...
Checking Temp space: must be greater than 500 MB.  Actual 47004 MB  Passed Checking swap space: must be greater than 500 MB.  Actual 16379 MB  Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-11-02_04-41-17PM. Please wait ...You can find the log of this install session at: /u01/app/oraInventory/logs/cloneActions2017-11-02_04-41-17PM.log ..................................................  5% Done. ..................................................  10% Done. ..................................................  15% Done. ..................................................  20% Done. ..................................................  25% Done. ..................................................  30% Done. ..................................................  35% Done. ..................................................  40% Done. ..................................................  45% Done. ..................................................  50% Done. ..................................................  55% Done. ..................................................  60% Done. ..................................................  65% Done. ..................................................  70% Done. ..................................................  75% Done. ..................................................  80% Done. ..................................................  85% Done. .......... Copy files in progress. 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 successful. The cloning of OraHome1 was successful. Please check '/u01/app/oraInventory/logs/cloneActions2017-11-02_04-41-17PM.log' for more details. Setup Oracle Base in progress. Setup Oracle Base successful. ..................................................  95% Done.
As a root user, execute the following script(s):
1. /u01/app/oracle/product/12.2.0.1/dbhome_2/root.sh
..................................................  100% Done.
- Run the root script as directed.
[oracle@rhel7 bin]$ su - Password: Last login: Thu Nov 2 15:12:05 CDT 2017 on pts/1 [root@rhel7 ~]# /u01/app/oracle/product/12.2.0.1/dbhome_2/root.sh Check /u01/app/oracle/product/12.2.0.1/dbhome_2/install/root_rhel7.localdomain_2017-11-02_16-45-28-955255610.log for the output of root script
You have now installed Oracle using the silent install method, and have also cloned the Oracle home.
Creating a Silent Database
The next step is the silent database creation. This is a fairly straightforward process, and very similar to the Oracle home installation process. First, find the file dbca.rsp and copy it to a new location. The dbca.rsp file will be in the same directory as the db_install.rsp file.
- Make the following changes to dbca.rsp. Note that ‘silent’ is the database name and sid:
gdbName=silent sid=silent databaseConfigType=SI createAsContainerDatabase=false templateName=General_Purpose.dbc sysPassword=oracle12c systemPassword=oracle12c emConfiguration=NONE datafileDestination=/u01/oradata recoveryAreaDestination=/u01/recovery_area storageType=FS characterSet=AL32UTF8 sampleSchema=TRUE
- Set your environment:
export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/dbhome_1 export PATH=$ORACLE_HOME/bin:$PATH.
- Create the database:
[oracle@rhel7 ~]$ dbca -silent -createDatabase -responseFile dbca.rsp Copying database files 1% complete 2% complete 18% complete 33% complete Creating and starting Oracle instance 35% complete 40% complete 44% complete 49% complete 53% complete 54% complete 55% complete 58% complete Completing Database Creation 59% complete 60% complete 61% complete 64% complete 65% complete 69% complete Executing Post Configuration Actions 100% complete Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/silent/silent.log" for further details.
In this article we described creating a database home, cloning a database home, and creating a new database using the silent option. While the interactive method using X-Windows is generally easier and more forgiving, installing Oracle using the silent method, and creating a database with the silent method are very import skills for a DBA to have in his or her toolkit.