Step by Step guide to install oracle database 12c - 12.2.1.0 on linux 7.5
HOW TO INSTALL ORACLE DATABASE 12.2.1.0 ON LINUX 7.5
Hardware and Software required to
install oracle database 12.2.1.0
i)
Go through these link to
know more about installatation hardware requirement -- https://docs.oracle.com/database/121/NTDBI/reqs.htm#NTDBI7423
Make sure the O.S
configuration should match with database
configuration.
ii)
Download the oracle database from oracle e-delivery service link provided below
(make sure the correct version for different operating system)
Login with normal oracle credentials
2. Download the Oracle Database and unzip file
and save it to Oracle Home
3.Check the jdk version in shell/command
by “# java -version” if the java
version is “open jdk” from root user.
# java –version
( example output )
java version
"1.7.0_55"
OpenJDK Runtime
Environment (rhel-2.4.7.1.el6_5-x86_64 u55-b13)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)
i)
Uninstall
open jdk from command prompt --
# yum -y remove java *
The java
-version command should no longer display the currently
installed java version.
# java –version
-bash:
/usr/bin/java: No such file or directory
ii)
Download Oracle JDK
Download oracle jdk form :
Download the rpm version of the oracle 1.8 jdk for oracle
database 12.2.1.0
iii)
Oracle
jdk file should be moved to oracle home and from command prompt run the
installer
# rpm -ivh “jdk version”
For example
# rpm -ivh jdk-8u151-linux-x64.rpm
After the process has been completed please make sure the java version
has been installed by the following java –version command.
4. Set the Path for jdk in Oracle_home
Go to Oracle_Home
In .bash_profile
Set the following path
JAVA_HOME=/usr/java/jdk1.8.0_171-amd64
Here
set the java file directory in java_Home
5. With the oracle user set
the host name
Go
to Oracle_Home/ etc/hosts
Open
the hosts file
Set
the following ip of your system
For
example -
127.0.0.1 localhost localhost.localdomain localhost4
localhost4.localdomain4
192.168.56.107 ol7-122.localdomain ol7-122
Here
the 127.0.0.1 is default IP let it be, now
Insert
your ip below with machine name with
machine name
<IP-address> <fully-qualified-machine-name> <machine-name>
Eg:
192.168.0.96 ol7.localdomain ol7(this is my ip address and machine name)
6. check the hostname
Check
this from Oracle User
$ vi hostname
Run
the following command without going to anydirectory
Check
the hostname if it matches to the host name you have given in previous step
7.
Run the prerequisites before installing oracle database
Run
the following command
# yum install oracle-database-server-12cR2-preinstall -y
While the process is running
make sure if any input will ask in yes or no then write yes and continue
8.
After the process has been completed then run the updates to verify all the
prerequisites has been properly installed
# yum update -y
This
step might take some time
Yes
to all configuration required while update installation.
Manual Setup –
This
process is required if prerequisite are not run previously so it can be done manually but you can cross check each and every file
if they have properly installed after the prerequisites run.
Add the
following lines to the "/etc/sysctl.conf" file, or in a file called
"/etc/sysctl.d/98-oracle.conf". to command line and check the
following setup
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
Run the following command to change the current
kernel parameters.
# /sbin/sysctl -p
Check the following lines to a file called
"/etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf"
file.
oracle soft nofile
1024
oracle hard nofile
65536
oracle soft nproc
16384
oracle hard nproc
16384
oracle soft stack
10240
oracle hard stack
32768
oracle hard memlock
134217728
oracle soft memlock
134217728
Run the following packages one by one -
yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install make -y
yum install nfs-utils -y
yum install net-tools -y
yum install smartmontools -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel –y
Create the new groups and users.
please run the following
command line by line in root user
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
#groupadd -g 54324 backupdba
#groupadd -g 54325 dgdba
#groupadd -g 54326 kmdba
#groupadd -g 54327 asmdba
#groupadd -g 54328 asmoper
#groupadd -g 54329 asmadmin
#groupadd -g 54330 racdba
useradd -u 54321 -g oinstall -G dba,oper oracle
Set
the password for oracle user
# passwd oracle
Set secure Linux to permissive by editing the
"/etc/selinux/config" file, making sure the SELINUX flag is set as
follows.
SELINUX=permissive
Run the following command
# setenforce Permissive
If you have the Linux firewall enabled, you will need to disable
or configure it, To disable it, do the following.
Check the status of
firewall before disable it by
#systemctl status firewalld
If the
firewall status shows disable the don’t
run the command written below
# systemctl stop firewalld
# systemctl disable firewalld
Create
the directories in which the Oracle software will be installed.
mkdir -p /u01/app/oracle/product/12.2.0.1/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
Create a "scripts" directory.
mkdir /home/oracle/scripts
Create an environment file called
"setEnv.sh".
cat > /home/oracle/scripts/setEnv.sh <<EOF
# Oracle Settings
export TMP=/tmp
export TMPDIR=\$TMP
export ORACLE_HOSTNAME=ol7.localdomain
export ORACLE_UNQNAME=orcle
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=u01/app/oracle/product/12.2.0.1/db_1
export ORACLE_SID=orcl
export PATH=/usr/sbin:/usr/local/bin:\$PATH
export PATH=\$ORACLE_HOME/bin:\$PATH
export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib
EOF
Add a reference to the "setEnv.sh" file
at the end of the "/home/oracle/.bash_profile" file. From oracle user
echo ". /home/oracle/scripts/setEnv.sh" >> /home/oracle/.bash_profile
Create a "start_all.sh" and
"stop_all.sh" script that can be called from a startup/shutdown
service. Make sure the ownership and permissions are correct.
cat > /home/oracle/scripts/start_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh
export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES
dbstart \$ORACLE_HOME
EOF
cat > /home/oracle/scripts/stop_all.sh <<EOF
#!/bin/bash
. /home/oracle/scripts/setEnv.sh
export ORAENV_ASK=NO
. oraenv
export ORAENV_ASK=YES
dbshut \$ORACLE_HOME
EOF
chown -R oracle.oinstall /home/oracle/scripts
chmod u+x /home/oracle/scripts/*.sh
Run the installer by
following steps:
Go to oracle user :
oracle_Home/database
Run the following command
from oracle user
$ ./runInstaller
The
Installing of Database 12c has been started.
welcome page
Please skip all and select
next a popup warning box will appear click ok and select next
software
Update page
Please
skip all the software update and click next
Select
create and configure a database option and click next.
Click and configure Database: This
process will install database and configure it automatically during installation.
Install
Database only: This option will install database only and
the configuration part will be done manually by running the dbca in the bin
folder.
Upgrade
an existing Database: This option will upgrade an existing
database.
Select server class in system class
Select the installation type, select
typical installation. (This screenshot is of 12.1 database so please don’t be
confused in grid installation option it is not available in 12.2 please follow
the similar tutorial to corresponding setups page seen on your wizard)
fill
all the detail in typical installation type.
Oracle base: /u01/app/Oracle
Software location:
/u01/app/Oracle/product/database
version/db_1
let the location be default
Global database name: orcl
(or any other)
Password: According to your
choice
Unselect the container
database
Password Format Warning error
regarding password will appear , select next
Prerequisites check please let it be done
Make
sure the prerequisite completes 100%
Check
summary and click next
Install product
9
ii) Run the following roots file one by one in terminal by oracle user when
prompted
9iii) If configuration file automatically configured then click next or
Configure
the following database when prompted.
(below
image showing the automatic configuration of database while installing)
*
If database not configure automatically then :
Go to directory – From Oracle user
$
/u01/app/oracle/product/12.2.0.1/db_1/bin
(start dbca to configure)\
$ ./dbca
fininsh the installation and click next .
go to oratab file and make the following yes
/u01/app/oracle/product/12.2.0.1/db_1/install
$ vi
oratab
And write the following to
yes.
cdb1:/u01/app/oracle/product/12.2.0.1/db_1:Y
before start the
database do the additional setup
Go
to u01/app/oracle/product/12.2.0.1/db_1/network/admin
Check
the listener.ora file
Check the following
configuration in it if not present then write it
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY =
EXTPROC1522))
(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.0.96)(PORT = 1522))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME =
/u01/app/oracle/product/12.2.0.1/db_1)
(SID_NAME = orcl)
)
)
~
~
~
Check
the tnsnames.ora for the following configuration
LISTENER =
(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.0.96)(PORT = 1522))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.0.96)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
Check
the sqlnet.ora
NAMES.DIRECTORY_PATH=
(TNSNAMES, EZCONNECT)
Before Starting the database
Go to /u01/app/oracle/product/12.2.0.1/db_1/bin
$ vi dbstart
Check the following line
ORACLE_HOME_LISTNER=$ORACLE_HOME
Now restart the Machine.
Start the database by oracle user
$ ./dbstart $ORACLE_HOME
Run If database is running
$./sqlplus
User name -
Sys as sysdba
Password -
Welcome1
Run the queries:
$ Select * from dual;
Check
if listener is running or not
$ lsnrctl status
Resources :
Listener.ora, tnsnames.ora
file samples link:
ERROR
MIGHT OCCUR WHILE RUNNING DATABASE 12C
1. INS
– 20802 :Oracle Database Configuration Assistant Failed.
Soln:
this error will occur while database configuration
Check
and run the prerequisites installation ,
Check
the user added or group added
Check
each and every modification has been configured properly by opening a folder.
2. TNS-01150
: The Address of the specified listener is incorrect.
Soln: This error occurred
while checking listener status
Check
the listener.ora file and tnsnames.ora file.
Check
for the configuration.











Comments
Post a Comment