1. Create swap partition
Use the dd command to create a 20G swap partition
dd if=/dev/zero of=/home/swap bs=100M count=200
After the command is executed, format the partition
mkswap /home/swap
Set the formatted file partition to swap partition
swapon /home/swap
Set and mount
vi /etc/fstab
and paste the following into
/home/swap swap swap defaults 0 0
Then execute the command to make the setting effective.
mount -a
has completed the setting at this time, and you can check the partition status through df -h
2. Install dependent packages
yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -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 libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install libXtst -y
yum install libXtst.i686 -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 libxcb -y
yum install libxcb.i686 -y
yum install make -y
yum install nfs-utils -y
yum install net-tools -y
yum install smartmontools -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
3. Create a new group and user
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
useradd -u 54321 -g oinstall -G dba,oper oracle
You don’t have to follow the name oinstall and dba, but in general documents, it’s called the
oinstall group for installing the database. The
dba group is used to manage the database.
-g represents the main group of
this user -G identifies other groups of this user
A user can belong to multiple user groups, but a user can only specify one group as its primary group
4. Modify the settings SELINUX
vi /etc/selinux/config
SELINUX=permissive
5. Disable the firewall
systemctl stop firewalld
systemctl disable firewalld
6. Create the oracle installation directory
mkdir -p /home/oracle/products/oracle12c
chown -R oracle:oinstall /home/oracle
chmod -R 775 /home/oracle/
7. Configure environment variables and verify under the oracle user
vi .bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=oracle12c
export ORACLE_UNQNAME=orcl
export ORACLE_BASE=/home/oracle/products/oracle12c
export ORACLE_HOME=$ORACLE_BASE/oracle12c
export ORACLE_SID=orcl
export PATH=/usr/sbin:/usr/local/bin:$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
Note: The above hostname = oracle12c in oracle12c is the hostname source.bash_profile set in vi /etc/hostname to
make the file effective immediately
8. Set system information
vim /etc/sysctl.conf
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
net.ipv4.ip_local_port_range =9000 65500
fs.file-max=65536
fs.aio-max-nr = 1048576
Use the sysctl -p command to make the file effective immediately
9. Decompress the database (Note: To upload the database compression package to the oracle user)
unzip linuxx64_12201_database.zip -d /home/oracle
10. Install
cd /home/oralce/database
./runInstaller After
performing the above two steps, wait a moment to see the installation page
The installation process is roughly the same as the oracle process
During the prerequisite check, several errors may occur, one is a soft limit, and the other is a hard limit.
Modify the following files, paste the following lines in, save and exit
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
If it does not take effect, you need to restart the oracle user, and then perform the installation again to complete.
The last step is to wait for the database installation to complete.
There should be no problem with database monitoring.
There is another problem with the character set. The default installation may be ZHS8GBK or AL32UTF8
To modify the character set, use the following command
SQL>select userenv('language') from dual;
SQL>SHUTDOWN IMMEDIATE
SQL>STARTUP MOUNT
SQL>ALTER SYSTEM ENABLE RESTRICTED SESSION;
SQL>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
SQL>ALTER SYSTEM SET AQ_TM_PROCESSES=0;
SQL>ALTER DATABASE OPEN;
SQL>ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK;
SQL>SHUTDOWN IMMEDIATE;
SQL>STARTUP;
SQL>select userenv('language') from dual;