How to install Oracle 12c on Linux

1. Installation conditions

System and configuration requirements
Physical memory, not less than 1GB

Swap partition When the
physical memory is 1-2GB, set it to 1.5-2 times the
physical memory. When the physical memory is 2-16GB, set the physical memory size to be the same,
not less than 4G

Disk space, create xfs file system and mount no less than 15G

Has a fixed FQDN name, it is not recommended to change it after installation

Software requirements
GNOME Chinese desktop environment
Chinese JAva support
Installation required software packages

2. Installation environment

Virtual machine VMware
Centos 7.6 version
Kernel version is 3.10.0-957.el7.x86_64
swap The swap partition is 16GB, the
new disk is a 50GB
firewall, and the core protection is off. The
yum warehouse is an online source

Three, the installation process

3.1. Change the hostname Oracle and mount the new disk

[root@localhost ~]# hostnamectl set-hostname oracle   
[root@localhost ~]# su
[root@oracle ~]# vim /etc/hosts
20.0.0.25 oracle
[root@oracle ~]# fdisk /dev/sdb  
[root@oracle ~]# mkfs -t xfs /dev/sdb1   
[root@oracle ~]# mkdir /orc/   
[root@oracle ~]# vi /etc/fstab
/dev/sdb1       /orc    xfs     defaults 0 0   ##新增
[root@oracle ~]# mount -a

3.2. Install the software environment package

[root@oracle ~]# yum -y install binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel

3.3, adjust the kernel parameters

[root@oracle ~]# vim /etc/sysctl.conf

# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).

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
[root@oracle ~]# sysctl -p

3.4. User environment configuration

[root@oracle ~]# groupadd oinstall
[root@oracle ~]# groupadd dba
[root@oracle ~]# useradd -g oinstall -G dba oracle
[root@oracle ~]# passwd oracle #密码自设
[root@oracle ~]# mkdir -p /orc/app/oracle
[root@oracle ~]# chown -R oracle:oinstall /orc/app/
[root@oracle ~]# chmod -R 755 /orc/app/oracle/
[root@oracle ~]# vim /home/oracle/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

umask 022
ORACLE_BASE=/orc/app/oracle
ORACLE_HOME=/orc/app/oracle/product/12.2.0/dbhome_1/
ORACLE_SID=orcl
NLS_LANG="SIMPLIFIED CHINESE_CHINA".UTF8
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin
LANG=zh_CN.UTF-8

export PATH LANG NLS_LANG ORACLE_BASE ORACLE_HOME ORACLE_SID

3.5, Oracle user resource limit

Use pam_limits authentication module

[root@oracle ~]# vim /etc/pam.d/login

#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth       substack     system-auth
auth       include      postlogin
account    required     pam_nologin.so
account    include      system-auth
password   include      system-auth
session    required     /lib/security/pam_limits.so      新增下面两行添加资源限制模块
session    required     pam_limits.so
...省略下面内容
[root@oracle ~]# vim /etc/security/limits.conf
oracle        soft    nproc           2047
oracle        hard    nproc           16384
oracle        soft    nofile          1024
oracle        hard    nofile          65536
oracle        soft    stack           10240
[root@oracle ~]# vim /etc/profile
if [ $USER = "oracle" ]           最后插入
 then
   if [ $SHELL = "/bin/ksh" ]
     then
       ulimit -p 16384
       ulimit -n 65536
   else
     ulimit -u 16384 -n 65536
   fi
fi
[root@oracle ~]# source /etc/profile

3.6, oracle installation

[root@oracle ~]# mkdir /abc
[root@oracle ~]# cd /abc

At this time, use xshell to put the installation package into the abc directory for decompression

[root@oracle abc]# unzip linuxx64_12201_database.zip 

Graphical interface operation

[root@oracle ~]# xhost +
[root@oracle ~]# su - oracle
[oracle@oracle ~]$ cd abc
[oracle@oracle abc]$ export DISPLAY=:0.0
[oracle@oracle abc]$ cd database/
[oracle@oracle database]$ ./runInstaller

Executing the graphical installer will
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
install windows shot deal
Insert picture description here

Enter the following two commands under the root user

[root@oracle ~]# /orc/app/oraInventory/orainstRoot.sh
[root@oracle ~]# /orc/app/oracle/product/12.2.0/dbhome_1/root.sh

Note that you have to wait until the scripts are loaded, and then continue to choose to install. The
Insert picture description here
installation is successful

3.7, test the Oracle database

[oracle@oracle database]$ sqlplus / as sysdba
连接到: 
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>    ## 已连接

SQL> show user   ## 查看下当前用户
USER 为 "SYS"

Guess you like

Origin blog.csdn.net/weixin_48191211/article/details/109225836