Linux Beginner Series: Oracle Installation Preparation under Linux

Keywords: Linux Database Oracle

Installing Oracle on Linux requires some preparation, such as dependency packages, groups and users, kernel parameters, resource constraints, directories, environment variables, and so on.

This series of articles is to share the author's practical records when he first came into contact with and studied Linux. It mainly includes some theoretical concepts, Web programs, simple installation and deployment of mysql database, and hope to help some beginners to avoid some detours.

Be careful:

Case sensitive on Linux;
Linux multi-user and multi-threaded;
Every file and directory under Linux has access rights;

Preparing for Oracle installation on Linux

Installing Oracle on Linux requires some preparation, such as dependency packages, groups and users, kernel parameters, resource constraints, directories, environment variables, and so on.
Installation environment: CentOS7 64 bit, Oracle11g(11.2)
Oracle Installation Preparation under #Linux#, #CentOS7#, #Oracle11g#

1. Install oracle dependency packages

Oracle11g Dependent Package in centos7 Environment

binutils-2.23.52.0.1-12.el7.x86_64 
compat-libcap1-1.10-3.el7.x86_64 
compat-libstdc++-33-3.2.3-71.el7.i686
compat-libstdc++-33-3.2.3-71.el7.x86_64
gcc-4.8.2-3.el7.x86_64 
gcc-c++-4.8.2-3.el7.x86_64 
glibc-2.17-36.el7.i686 
glibc-2.17-36.el7.x86_64 
glibc-devel-2.17-36.el7.i686 
glibc-devel-2.17-36.el7.x86_64 
ksh
libaio-0.3.109-9.el7.i686 
libaio-0.3.109-9.el7.x86_64 
libaio-devel-0.3.109-9.el7.i686 
libaio-devel-0.3.109-9.el7.x86_64 
libgcc-4.8.2-3.el7.i686 
libgcc-4.8.2-3.el7.x86_64 
libstdc++-4.8.2-3.el7.i686 
libstdc++-4.8.2-3.el7.x86_64 
libstdc++-devel-4.8.2-3.el7.i686 
libstdc++-devel-4.8.2-3.el7.x86_64 
libXi-1.7.2-1.el7.i686 
libXi-1.7.2-1.el7.x86_64 
libXtst-1.2.2-1.el7.i686 
libXtst-1.2.2-1.el7.x86_64 
make-3.82-19.el7.x86_64 
sysstat-10.1.5-1.el7.x86_64

ODBC driver packages, officially required, do not install, generally we do not use ODBC on the server.

unixODBC-2.3.1-6.el7.x86_64 or later
unixODBC-2.3.1-6.el7.i686 or later
unixODBC-devel-2.3.1-6.el7.x86_64 or later
unixODBC-devel-2.3.1-6.el7.i686 or later
Note: It is important to note that the same package in the list requires both 32-bit and 64-bit, and the package name (64-bit), including.i686 Package name of suffix name (32 bit), otherwise only install by default.x86_64 For example: glibc glibc.i686

Installing Oracle dependency packages using yum

# yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libXi libXi.i686 libXtst libXtst.i686 make sysstat

#Install ODBC driver packages
# yum -y install unixODBC unixODBC.i686 unixODBC-devel unixODBC-devel.i686

2. Create Oracle Groups and Users

# groupadd oinstall #Create Installation User Group
# groupadd dba #Create dba user group
# useradd -g oinstall -G dba oracle #Create user, -g sets oinstall as group, -G sets dba as additional group.
# id oracle #View the user and group information for the oracle user to confirm that the oracle group is correct
# passwd oracle #Set oracle user's password

3. Configuring linux system kernel parameters

# vim /etc/sysctl.conf

Add the following

semmni = 128

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 sysctl-p for the kernel parameters to take effect

# sysctl -p

4. Configure resource constraints for oracle users

Configure resource constraints for oracle users, including the number of open files nofile s, the number of processes available to users nproc, the size of stack of process stack segments, and ulimit resource constraints including soft and hard constraints.

# vim /etc/security/limits.conf

Add the following:

oracle           soft    nofile 1024
oracle           hard    nofile 65536
oracle           soft    nproc  2047
oracle           hard    nproc  16384
oracle           soft    stack  10240
oracle           hard    stack  32768

5. Directories needed to create oracle

# mkdir -p /u01/app/oracle # oracle root directory, -p means recursive directory creation
# chown -R oracle:oinstall /u01 #Assign directories to oracle users
# chmod -R 775 /u01 #Set directory to 775 permissions

6. Setting DISPLAY environment variable

Note: This is required for graphical interface installations and not for silent installations.

Because the OUI graphical interface of oracle is used in the installation, X support is required. The default oracle user does not support graphical operations, and X must be set as root for oracle users.
The root user runs the following command:

# xhost +

Tip: access control disabled,clients can connect from any host
(Access control is disabled and clients can connect from any host). The above text indicates that the setup was successful.

If you need to install Oracle remotely, you need to use Oracle to set the DISPLAY environment variable to client IP.

$ export DISPLAY=172.16.2.111:0.0

7. Configuring oracle user environment variables

Execute Under oracle user

# su - oracle #Switch oracle users

implement

# vim .bash_profile

Add the following:

#Oracle user variables
umask 022

export ORACLE_BASE=/u01/app/oracle #oracle base directory
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 #oracle product installation directory
export ORACLE_SID=orcl #oracle database instance name

#Add PATH system environment variable
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib

Make environment variables valid

# source .bash_profile  #Make environment variables valid

Setting temporary environment variables

#When the system's own / tmp directory space is less than 1 GB, you need to set these two items yourself, otherwise you don't need them
# export TMP=/u01/tmp
# export TMPDIR=$TMP

# export ORACLE_TERM=xterm #xterm Window Mode Installation

8. Prevent the installation interface from scrambling

The reason is that the operating system itself does not have Chinese packages or fonts.
1. Method 1: Set up temporary encoding and install using English interface

# export LANG=en

2. Method 2: Install Chinese language support and increase font library

# yum install kde-l10n-Chinese
 Normally, font libraries are installed automatically after installing Chinese support. If no fonts are installed automatically, download the font file, and zysong.ttf Copy to/usr/share/fonts/zh_CN/TrueType Catalog
# mkdir -p /usr/share/fonts/zh_CN/TrueType
# mv zysong.ttf /usr/share/fonts/zh_CN/TrueType

IT Little Fat Bean: Beginners walk on the road and share the process, I hope to help some beginners, welcome IT workers, into the pit discussion - -

Posted by molave on Thu, 16 Sep 2021 20:21:01 -0700