Contents
- Document Overview:-. 2
- Prerequisites: 2
- Preparing for Oracle 12c Installation. 2
- To begin, make sure that all the packages currently installed on your RHEL/CentOS 7system are updated to their latest versions. 2
- Next, installed all the required dependencies for the RDBMS, along with the zip and unzip packages. 2
- Create the user account and groups for Oracle. 3
- Add the following kernel parameters to /etc/sysctl.conf file. 3
- Set the limits for oracle in /etc/security/limits.conf file. 4
- Swap Space addition. 5
- Run Below commands to add 2 GB swap space with filesystem. 5
- Create the top level directory for the Oracle user, change the ownership, and set privileges: 5
- Download Oracle software. 6
- Create response files to server at /u01 location. 6
- Installation. 6
- Now run the ‘root’ scripts as the root user: 8
- CREATING A SILENT DATABASE. 9
- Set your environment: 9
Document Overview:-
Oracle database is one of the most widely used relational database management systems (RDBMS) in enterprise environments. Developed, maintained, and supported by Oracle Corporation, this RDBMS is often installed on top of a flavor of Enterprise Linux (RHEL, CentOS, or Scientific Linux). This makes for a very robust operating system – database choice.
In this Document, I will explain how to install Oracle 12c Release 2 on a RHEL/CentOS 7 GUI server.
Prerequisites:
Additionally, please note that an Oracle account is required to download the Oracle Database 12c installation file (3.2 GB). Don’t worry about this, though, as you can create an account for free.
Finally, make sure your server has at least 2 GB of RAM and 30 GB of available disk space. These hardware requirements are safe for a testing environment such as ours, but will need to increase if you consider using Oracle in production
Preparing for Oracle 12c Installation
To begin, make sure that all the packages currently installed on your RHEL/CentOS 7system are updated to their latest versions.
# yum update -y
Next, installed all the required dependencies for the RDBMS, along with the zip and unzip packages.
# yum install -y binutils.x86_64 compat-libcap1.x86_64 gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64 glibc-devel.i686 glibc-devel.x86_64 ksh compat-libstdc++-33 libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64 libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libXi.i686 libXi.x86_64 libXtst.i686 libXtst.x86_64 make.x86_64 sysstat.x86_64 zip unzip
cd /etc/yum.repos.d
wget –no-check-certificate https://public-yum.oracle.com/public-yum-ol7.repo
wget –no-check-certificate https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
yum -y install oracle-rdbms-server-12cR1-preinstall
Create the user account and groups for Oracle.
# groupadd oinstall
# groupadd dba
# useradd -g oinstall -G dba oracle
Finally, set a password for the newly created oracle account.
# passwd oracle
Add the following kernel parameters to /etc/sysctl.conf file.
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 8329226240
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
and apply them:
# sysctl -p
# sysctl -a
Set the limits for oracle in /etc/security/limits.conf file.
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
Swap Space addition
Add minimum 2 GB Swap space
Run Below commands to add 2 GB swap space with filesystem.
sudo install -o root -g root -m 0600 /dev/null /swapfile
dd if=/dev/zero of=/swapfile bs=1k count=2048k
mkswap /swapfile
swapon /swapfile
echo “/swapfile swap swap auto 0 0” | sudo tee -a /etc/fstab
sudo sysctl -w vm.swappiness=10
echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
Create the top level directory for the Oracle user, change the ownership, and set privileges:
mkdir –p /u01
chown oracle:dba /u01 -R
chmod 775 /u01
Download Oracle software
Download the Oracle Database 12c installation file (3.2 GB) and place under /u01/install_files
and unzip it
cd /u01/install_files/
unzip linuxx64_12201_database.zip
chown oracle:dba /u01 -R
chmod 775 /u01
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.
Create response files to server at /u01 location
Create below response files at server
Installation
The command to run the Oracle home in silent mode (running from the database directory) is:
/runInstaller -silent -responseFile /u01/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@sovmc201 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@sovmc201 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:
[root@sovmc201 ~]# cd /u01/app/oraInv*
[root@sovmc201 oraInventory]# ls
ContentsXML logs oraInst.loc orainstRoot.sh oui
[root@sovmc201 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@sovmc201 oraInventory]#
[root@sovmc201 oraInventory]# cd /u01/app/oracle/product/12.2.0.1/dbhome_1
[root@sovmc201 dbhome_1]# ./root.sh
Check /u01/app/oracle/product/12.2.0.1/dbhome_1/install/root_sovmc201.localdomain_2017-11-02_15-12-34-541423307.log for the output of root script
[root@sovmc201 dbhome_1]#
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.
Set your environment:
export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH.
Now Create Database with response file created under /u01 during installation
[oracle@sovmc201 u01]$ 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
68% 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.
[oracle@sovmc201 u01]$ ps -ef |grep pmon
oracle 5137 1 0 20:26 ? 00:00:00 ora_pmon_silent
oracle 5507 3552 0 20:26 pts/2 00:00:00 grep –color=auto pmon
[oracle@sovmc201 u01]$ . oraenv
ORACLE_SID = [oracle] ? silent
The Oracle base has been set to /u01/app/oracle
[oracle@sovmc201 u01]$
In this article I described Oracle 12C release 2 Installation, creating a database home and creating a new database using the silent option.