Red Hat 7.2 Install oracle 12c

Experimental environment: Red Hat 7.2x64, Oracle 12c

System requirements:

    1. Oracle 12c's minimum requirement for system memory is 1G, recommending 2G or larger memory

    2. Oracle's recommendation for Swap Space is as follows:


    3. Oracle 12c Enterprise Edition needs 6.4 G of disk space, and Standard Edition needs 6.1 G of disk space. / tmp requires at least 1G in size.


Software dependency: 

yum -y install binutils compat-libcap1 gcc gcc-c++ glibcglibc.i686 glibc-devel glibc.i686 ksh libaio libaio.i686 libaio-devellibaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++-devellibstdc++-devel.i686 compat-libstdc++-33 compat-libstdc++-33.i686 libXilibXi.i686 libXtst libXtst.i686 make sysstat unixODBC unixODBC-devel xterm


System configuration:

    Close selinux:

setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config


    Configure firewalls:

firewall-cmd --set-default-zone=trusted


   Modify / etc/hosts and add host name explanation:

vim /etc/hosts
192.168.100.104 www.oracle.com


    Configure the kernel parameters:

MEMTOTAL=$(free -b | sed -n '2p' | awk '{print $2}')
SHMMAX=$(expr $MEMTOTAL \*4 / 5)
SHMMNI=4096
SHMALL=$(expr $MEMTOTAL /\( 4 \* 1024 \))
        
cp /etc/sysctl.conf /etc/sysctl.conf.bak
cat >> /etc/sysctl.conf << EOF
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = $SHMMAX
kernel.shmall = $SHMALL
kernel.shmmni = $SHMMNI
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
kernel.panic_on_oops = 1
EOF

sysctl -p

# kernel.shmmax is larger than shared memory area and smaller than physical memory
# kernel.shmall Physical Memory/4K


Modify system restrictions:

vim /etc/security/limits.conf
    # End offile  
    oracle soft  nproc   2047
    oracle hard  nproc   16384
    oracle soft  nofile  1024
    oracle hard  nofile  65536
    oracle soft  stack   10240
    oracle hard  stack   32768
    
vim /etc/security/limits.d/20-nproc.conf
    #The first line of ordinary user's process restriction is commented out and a line is added.
    #*         soft    nproc     4096
    *      -       nproc   16384
    
 vim /etc/pam.d/login
    # near line 14:add 
    session    required     pam_limits.so


Add users and related directories:

groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle
echo 'oracle' | passwd --stdin oracle
mkdir -p /oracle/app/oracle/product/12.1.0/db_1
mkdir -p /oracle/app/oraInventory
chown -R oracle:oinstall /oracle/
chmod -R 775 /oracle


Unzip installation package:

unzip linuxamd64_12102_database_1of2.zip
unzip linuxamd64_12102_database_2of2.zip


Switch to oracle user and configure environment variables:

su - oracle
vim~/.bash_profile
    #export PATH
    ORACLE_BASE=/oracle/app/oracle
    ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1  
    ORACLE_SID=orcl
    PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin  
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib  
    export ORACLE_BASE ORACLE_HOME ORACLE_SID PATHLD_LIBRARY_PATH
 
    if [ $USER = "oracle" ]; then
        if [ $SHELL ="/bin/ksh" ]; then
              ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
    fi
 
source ~/.bash_profile


Install oracle software:

#Remote call graphical interface to install vnc
yum install tigervnc-server.x86_64 -y
su - oracle
vncserver
#winodws client uses vnc viewer to login remotely

#Enter the installation package decompression directory
cd database
./runInstaller

 

    Whether to accept the official patch information, you need to fill in oracle's mailbox account and password:

   Select save to save a configuration file and click Install to install:


    Run as root:

/oracle/app/oraInventory/orainstRoot.sh
/oracle/app/oracle/product/12.1.0/db_1/root.sh


Configure oracle listeners:

#oracle users run netca configuration monitoring
[oracle@www ~]$ netca

    Finally, click finish to complete the configuration of listening:

#Monitor View Command
[oracle@www ~]$ lsnrctl status/start/stop


Create a database instance:

#Running dbca on oracle users
[oracle@www~]$ dbca

    Open the mirror function of the log:

    Flash back and archive functions are not selected at the time of installation, but are started manually after the instance is created.

    In production environments, SCA size sets half of physical memory and PCA size sets physical memory * 80%* 20%:

    The number of database connections can be set larger:

    Character Set Selection UTF-8

    Click Configuration Control Files and Table Space Settings:

    In the production environment, the control file is set to 8192, and the parameters of tablespace data file are set as follows:

    In the production environment, 6-8 groups with 200 M capacity are needed:


Configuration archiving and flashback:

#To start flashback, archive first
mkdir /oracle/arch
sqlplus "/as sysdba"
    altersystem set db_recovery_file_dest_size=2g scope=both;
    altersystem set db_recovery_file_dest='/oracle/arch' scope=both;
    shutdown immediate;
    startup mount;
    alter database archivelog;
    alter database flashback ON;
    alter database open;
    archive log list;


Keywords: Oracle Database vim SELinux

Added by PhilippeDJ on Wed, 03 Jul 2019 02:05:25 +0300