Oracle 12C Installation On Linux

(You can find the every single command below the article.)

I installed oracle linux 7.5 before, you can check that article from here. Now i am going to install oracle 12c database onto linux operating system.

First we have to install some package for database installations. I prefer the install these package first, before configure the system and database installation.

First you have to mount your .iso file to the any directory. I am going to mount to the Desktop. As you can see there is a file which name is V975367.iso.

We will create a new directory and mount the files from Desktop .iso file to the that directory. For this process you can use that command;

mount -o loop -t iso9660 V975367.iso /media/cdrom

We create a directory /media/cdrom.

Now we have to go another directory and set some tag for .iso file before installation.

Use cd /etc/yum.repos.d  command for change directory and open dvd.repo  file command with vi dvd.repo.

Now we can write these information into the file.

Now ready to install packages. But before you have to import the files with rpm – – import command. Then you can install these packages step by step.

yum install binutils -y

yum install compat-libcap1 -y

yum install compat-libstdc++-33 -y

yum install compat-libstdc++-33.i686 -y

yum install gcc -y

yum install gcc-c++ -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 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 libaio -y

yum install libaio.i686 -y

yum install libaio-devel -y

yum install libaio-devel.i686 -y

yum install libXext -y

yum install libXext.i686 -y

yum install libXtst -y

yum install libXtst.i686 -y

yum install libX11 -y

yum install libX11.i686 -y

yum install libXau -y

yum install libXau.i686 -y

yum install libxcb -y

yum install libxcb.i686 -y

yum install libXi -y

yum install libXi.i686 -y

yum install make –y

yum install sysstat -y

yum install unixODBC -y

yum install unixODBC-devel -y

Now we have to edit our host file. We will write our ip address and hostname into the file.

Use vi /etc/hosts command and edit file. Then save and quit.

Now we sohuld add the following lines in the “/etc/sysctl.conf” file.

Go to file with vi/etc/sysctl.conf and add.

fs.file-max = 6815744

kernel.sem = 250 32000 100 128

kernel.shmmni = 4096

kernel.shmall = 1073741824

kernel.shmmax = 4398046511104

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

fs.aio-max-nr = 1048576

net.ipv4.ip_local_port_range = 9000 65500

After save and quit use mentioned command below.

sysctl -p

Add the following lines to the “/etc/security/limits.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

On this step we are going to create user and add them to group. These user will get permission to install oracle software.

groupadd -g 12347 oinstall

groupadd -g 12348 dba

groupadd -g 12349 oper

useradd -u 12347 -g oinstall -G dba,oper

Now we have to go to “/etc/security/limits.d/ directory then open and edit the file inside that directory. We have to change first line.

Change this

          soft    nproc    1024

To this

* – nproc 16384

Save and quit.

Now we have to change selinux status. For this step use

Vi /etc/selinux/config

And edit SELINUXTYPE to Permissive

After save the and quit file write command which is below .

 setenforce Permissive

Then stop iptables

# service iptables stop

# chkconfig iptables off

On this step, we need a directory for install oracle software, so we are going to create a directory and give permission to users for installing.

mkdir -p /u01/app/oracle/product/12.1.0/dbhome_1

chown -R oracle:oinstall /u01

chmod -R 775 /u01

Now we are ready for install oracle database. Go to oracle page and download oracle 12c software.

As you can see there is two .zip file. We are going to unzip them.

All you need just write “unzip and file name” as you can see in the picture.

There will be create a file which name is database. These two .zip file will be unzip in the same database file.

Now, as you can see there is a file created a database. Go inside of the database file with cd database command

And run install file.  With ./runinstall command.

And there is the first step of install screen.

If you want to receive an email you can write your email and push next. I am going to uncheck the box and next.

We can create and configure database at the same time or install only database without configure.

I selected Create and configure a database and next.

Selecting software class. I am going to select Desktop class.

We have to give directory to install in it that we created before. They are all come automatically but it is good to check always.

Set a global database name and password.

I am not create as a container database. So I unchecked the box then click next.

This is also come automatically. This directory is about log files. You can click next.

Installer checking for size.

Your selections before installation. You can check last time your selections on this screen and then install.

installation screen

Before finish installation there will be open a small tab which is include two .sh file. You have to copy – past and run them when you root.

Before finish installation there will be open a password management screen. On this screen you can manage you system users account and password.

At least you have to manage SYS and SYSTEM users passwords.

Then installation will be finish. Now switch with oracle user and enter your bash_profile file and add

Data mentioned below. Change ORACLE_HOSTNAME, ORACLE_UNQNAME, ORACLE_BASE, ORACLE_HOME, ORACLE_SID with your informations.

# Added for Oracle 12c

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_HOSTNAME=testcan.localdomain

export ORACLE_UNQNAME=candb

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1

export ORACLE_SID=candb

export PATH=/usr/sbin:$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

After save and quit from the file don’t forget to write . ./.bash_profile command on the console. This command make your system ready for the open your software from these directions.

Now we can connect to database with writing ” Sqlplus / as sysdba “

If you want to  connect your database from remote you have to edit your tnsnames.ora and listener.ora file.

Go to your oracle_base directory where is the /u01/app/oracle/product/12.1.0/dbhome_1/network/admin directory and edit your listener.ora file.

Listener.ora file

Tnsnames.ora file

On your remote machine you have to install oracle database software and the add your tns information in the tnsnames.ora file.

This is the tns file on my windows machine. I copy this information from my linux machine and past into windows tns.

Now we can connect to database remote.

If you get ORA-12170 timeout error, go to linux machine and disable firewall command with

systemctl stop firewalld.

Leave a Reply

Your email address will not be published. Required fields are marked *