Method for installing Oracle (CentOS Oracle 12c) under Linux

  • 2020-05-13 04:14:22
  • OfStack

Step 1: network connection, which was introduced in my last blog, no more.

Network connection purpose: to be able to use the yum command, download files directly from the web.

Step 2: go to the oracle website and download 12c

Two files on database server side :(installed on Linux)

linuxamd64_12102_database_1of2.zip

linuxamd64_12102_database_2of2.zip

Place these two files in the tmp directory of Linux and unzip them using the unzip command.

database client 1 file :(installed at Windows)

32-bit oracle 11g client windows version

win32_11gR2_client.zip

1.

Add users, groups, and related directories

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle

Change the owner of oracle12c media

chown -R oracle:oinstall /tmp

2.

-- create the oracle installation directory

mkdir -p /u01/app/oracle/product/12.1.0/db_1
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01
chmod -R 777 /u01

3.

The system relies on package installation verification

yum -y install binutils
yum -y install compat-libcapl
yum -y install gcc-
yum -y install gcc-c++-
yum -y install glib2-devel
yum -y install glibc
yum -y install ksh
yum -y install libaio
yum -y install libaio-devel
yum -y install libgcc-
yum -y install libstdc++-
yum -y install libstdc++-devel
yum -y install libX11
yum -y install libXau
yum -y install libxcb
yum -y install libXext
yum -y install libXtst
yum -y install make
yum -y install sysstat
yum -y install compat-libstdc++
yum -y install libstdc++
yum -y install compat-c++
yum -y install compat-libcap
yum -y install gcc-c++
yum -y install unixODBC
yum -y install unixODBC-devel
yum -y install xterm
yum -y install elfutils-libelf
yum -y install libaio-devel
yum -y install libgcc
yum -y install pdksh
yum -y install compat-libstdc++

Of course, when copying all of these commands, it is often the case that some of them are not downloaded. You need to go to RPM Search to download it. (the completion of this work will be verified when Oracle is installed)

4.

Modify the linux core configuration file

vi /etc/sysctl.conf

Add content (the four parameters of Kernel are related to your memory Settings, there may be a problem here)

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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 = 1048576

Execute the order to give effect to the above:

su root
sysctl -p

5.

-- modify system restrictions
vi /etc/security/limits.conf

Add content:

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

6.

vi /etc/pam.d/login

Add content:

session required /lib/security/pam_limits.so
session required pam_limits.so

7.

Modify system environment variables

vi /etc/profile

Add content:

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

8.

Add environment variables for the newly added user Oracle

su oracle
vi ~/.bash_profile

Add content:

ORACLE_BASE=/u01/app/oracle
ORACLE_HOME = $ORACLE_BASE/product / 12.1.0 / db_1 (pit here)
ORACLE_SID=test
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH
-- the oracle user himself executes the following command
source ~/.bash_profile

9.

Here USES the graphical interface installation, enters the interface

su root
chown -R oracle:oinstall /tmp/database
export DISPLAY=:0.0
xhost +
su oracle
cd /tmp/database
sh runInstaller.sh (run the command, open the graphical installation interface)

10.

Graphical installation interface not to say, installation steps to solve the error. Anyway, lots of holes, lots of holes.

In this step, I just installed Oracle and did not create the database.

11.

Create a database

dbca

(there is a hole here, the command may not exist, that is because when installing Oracle, the directory installed is in dbhome_1, not in our db_1, so change the red value of step 8 to dbhome_1.)

The command also opens a graphical interface as shown above to create a database.

12.

Create listener
The netca command and sample 1 above open a graphical interface to create a listener.

13.

Start the Oracle service.

sqlplus / as sysdba
SQL- > startup (startup service)

14.

Install the client under Windows: 32-bit oracle 11g client windows version.

net manager tool adds new [service naming]

15.

At this point, we can test to see if we can connect Linux at Windows.

Open CMD and enter: tnsping [service name you just set]

If not, it may be a problem with the Linux firewall. Close the Linux firewall

systemctl stop firewalld.service # stop the firewall
systemctl disable service # do not allow firewall startup
systemctl start firewalld.service # start the firewall
systemctl status firewalld.service # view firewall status

After the firewall is closed, retest.

16.

Install toad for oracle to operate Oracle.

To log in.


Related articles: