ASM+udev+oracle11gR2+rhel7–1.rhel7 server environment construction

(1) Introduction to building

The purpose of this article is to build a single instance database oracle11gR2 + ASM + udev for subsequent testing.

There are 4 articles in the column, each introducing the following steps:

rhel7 server environment setup

udev configure disk and disk planning

Visual installation grid + asm configuration

Visual installation database

Current server rhel7 8G memory

(2) Server environment modification

1. Modify the host configuration

Log in to the system as root

Modify the /etc/hosts configuration by yourself. Modify the host name here.

hostnamectl set-hostname oomc
vim /etc/hosts
--192.168.80.111 oomc

2. Configure the locale

Modify the environment variables, English, if it is Chinese, then the visual installation will be garbled, you have to change it.

echo "export LANG=en_US.UTF8" >> ~/.bash_profile
source ~/.bash_profile

3. Check the hardware requirements (just take a brief look, generally they are met)

[root@oomc ~]# grep MemTotal /proc/meminfo
MemTotal: 8010980 kB
[root@oomc ~]# uname -m
x86_64
[root@oomc ~]# grep SwapTotal /proc/meminfo
SwapTotal: 16777212 kB
[root@oomc ~]# free -m
              total used free shared buff/cache available
Mem: 7823 565 6593 14 663 6967
Swap: 16383 0 16383
[root@oomc ~]# df -h /dev/shm/
Filesystem Size Used Avail Use% Mounted on
tmpfs 3.9G 0 3.9G 0% /dev/shm
3.1 Memory Check

The corresponding relationship between memory and swap space is

On Linux, the HugePages feature uses memory-mapped files to allocate non-swappable memory for large page tables. If HugePages is enabled, the memory allocated to HugePages should be deducted from available RAM before swap space is calculated.

Available memory Required swap space
Between 1 GB and 2 GB 1.5 times the memory size
Between 2 GB and 16 GB Equal to the size of memory
More than 16 GB 16 Gigabytes

Starting with Oracle Database 11g, the automatic memory management feature requires more shared memory (and file descriptors). The size of shared memory should be at least the larger of each Oracle instance on the machine.

/dev/shm MEMORY_MAX_TARGETMEMORY_TARGET

MEMORY_MAX_TARGET and does not work with HugePages when enabled or on Linux. MEMORY_TARGETLOCK_SGA

3.2 System Architecture

uname This command displays the processor type. Verify that the processor architecture matches the Oracle software version to be installed. If you do not see the expected output, the software cannot be installed on this system.

3.3 Disk Space
[root@oomc ~]# df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 64G 4.3G 60G 7% /
[root@oomc ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 64G 4.3G 60G 7% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 10M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sdb1 100G 33M 100G 1% /u01
tmpfs 783M 12K 783M 1% /run/user/989
tmpfs 783M 0 783M 0% /run/user/0

Installation type Software file requirements (GB)
Enterprise Edition 4.7
Standard Edition 4.6
Installation type Data file requirements (GB)
Enterprise Edition 1.7
Standard Edition 1.5

4. Check software requirements

This includes operating system checks, kernel checks, and compiler checks, which are omitted.

For example, if you install the Oracle database on the CentOS series, you can install it. However, since the CentOS series is not an officially supported operating system, you cannot get official support when you encounter problems.

Official support: OEL, rhel, Asianux Server, suse10,11,12, NeoKylin Linux6,7, etc.

5. Create users, groups, directories

common group

  • Oracle manifest group (usually, oinstall)

  • OSDBA group (usually, dba)

  • Oracle software owner (usually, oracle)

  • OSOPER group (optional. Usually oper)

#Create combined user grid user asm, oracle user database
groupadd oinstall
groupadd dba
groupaddoper
groupadd asmadmin
groupadd asmoper
groupadd asmdba
useradd -g oinstall -G dba,asmdba,oper,asmadmin oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper,dba grid
#change Password
echo oracle1 | passwd --stdin oracle
echo grid1 | passwd --stdin grid
#Create a directory
mkdir -p /u01/app/oracle
mkdir -p /u01/app/grid
mkdir -p /u01/app/grid/11.2.0
chown -R grid:oinstall /u01/app/grid
chown -R oracle:oinstall /u01/app/oracle
mkdir /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
chmod -R 775 /u01

6.yum install dependent packages

Let’s execute one first to see if yum can be used. If it doesn’t work, mount the CD-ROM drive. If it works, just copy and execute them all.

yum install binutils compat-libstdc + + -33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc- gcc-c + + libaio-devel libaio libgcc libstdc + + libstdc + + -devel make sysstat unixODBC unixODBC-devel pdksh ksh compat-libcap1
yum -y install *vnc*

7. Modify kernel parameters

cat >> /etc/sysctl.conf << EOF
#ORACLE
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 1887436
#//The size of shmall is 7730941100/4k = 1887436.
kernel.shmmax = 7730941100
#//It can be 90% of the system memory. The unit is bytes. 8G*1024*1024*1024*90% is approximately equal to 7730941100.
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
EOF

-- take effect
sysctl -p

Kernel parameter and shell limit values on official documentation are minimum values only. For production database systems, Oracle recommends that you adjust these values to optimize system performance.

Parameters Minimum File
semmsl

semmns

semopm

semmni

250

32000

100

128

/proc/sys/kernel/sem
shmall 2097152 /proc/sys/kernel/shmall
shmmax Minimum: 536870912

Maximum value: a value 1 byte smaller than the physical memory

Recommendation: More than half of physical memory

For more information about configuration, see My Oracle Support Note 567506.1. shmmax

/proc/sys/kernel/shmmax
shmmni 4096 /proc/sys/kernel/shmmni
filemax 6815744 /proc/sys/fs/file-max
ip_local_port_range Minimum: 9000

Maximum value: 65500

/proc/sys/net/ipv4/ip_local_port_range
rmem_default 262144 /proc/sys/net/ core/rmem_default
rmem_max 4194304 /proc/sys/net/core/rmem_max
wmem_default 262144 /proc/sys/net/core/wmem_default
wmem_max 1048576 /proc/sys/net/core/wmem_max
aio-max-nr 1048576

Note: This value limits concurrent outstanding requests and should be set to avoid I/O subsystem failures.

/proc/sys/fs/aio-max-

8. Control user allocation of resources

vi /etc/security/limits.conf
--Add it in
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 1024

--Check 
ulimit -a
Resource Shell Limitation Resource Soft limit Hard limit

open file descriptor

No file

At least 1024

At least 65536

Number of processes available to a single user

Non-Prock

At least 2047

At least 16384

The size of the process stack segment

stack

At least 10240 KB

Minimum 10240 KB, maximum 32768 KB

9. Configure security, disable selinux and firewall

systemctl stop firewalld
systemctl disable firewalld
vi /etc/selinux/config
--SELINUX=disabled

10. Configure environment variables grid and oracle

su-oracle
vim .bash_profile
--Add it in
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_SID=oomcdb
export PATH=$PATH:$ORACLE_HOME/bin


exit
--Exit and enter grid
su-grid
vim .bash_profile
export PATH
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/grid/11.2.0
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:.
export PATH=$PATH:$ORACLE_HOME/bin:.
export ORACLE_SID= + ASM

11. Restart

First upload the compressed package to /u01 to facilitate subsequent operations.

Restart the server

reboot