CentOS 7.2 system silently installs Oracle 11g2


1 Install centos7 System Environment (2 Core 2G40G Disk)

Minimize installation by using CentOS 7.2 system, i.e. CentOS-7-x86_64-DVD-1511.iso image.

After installation, adjust network settings IP, close firewall and selinux

 vi /etc/sysconfig/network-scripts/ifcfg-eno16777736 ##Configuration network
##Restart network
  systemctl restart network
##Installation tools
 yum isntall vim wget net-tools unzip -y   
##Close the firewall   #Close selinux
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
##Setting host name
hostnamectl set-hostname tester
hostname tester
vim /etc/hosts
192.168.1.5

2 Download oracle 11g

Download from the official website, download the following packages and upload them to the machine.

     linux.x64_11gR2_database_1of2.zip

     linux.x64_11gR2_database_2of2.zip


3 Installation Dependency Package

yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel expat gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make pdksh sysstat unixODBC unixODBC-devel

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

//Check whether the dependency packages are installed successfully (ksh and pdksh are conflicting, select ksh)
rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel expat gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make pdksh sysstat unixODBC unixODBC-devel | grep "not installed"
rpm -q 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

4. Create oinstall and dba groups and oracle users

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle
//Setting oracle user password passwd oracle
//Verify that the user is correct id oracle
[root@tester ~]$ id oracle
uid=1000(oracle) gid=1000(oinstall) group=1000(oinstall),1001(dba)


5 Configure Kernel Parameters

vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
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

----------------------Parameter interpretation-----------------------
shmmax=physical memory*80%*80%,Units are bytes
kernel.shmmax: Represents the maximum value of a single shared memory segment in bytes, which is generally half of physical memory, but it doesn't matter if it's larger. Here, the value is set to 4. GB,That is, "4294967295"/1024/1024/1024=4G". 
kernel.shmmin: Represents the minimum value of a single shared memory segment, defaulting to 1 byte
kernel.shmall: Represents the total number of shared memory pages available throughout the system, in pages( page),On a 32-bit system, a page equals 4 kB,That's 4096 bytes. The calculation formula is as follows: shmmax/PAGE_SIZE
kernel.shmmni: Represents the maximum number of memory segments throughout the system, usually 4096.
ip_local_port_range  : Represents the range of ports. Ports in the specified range are used when the listener helps the client process establish a connection with the server process.
kernel.sem  : Represents the set semaphore, and the size of the four parameters is fixed.
net.core.rmem_default  : A default value (in bytes) representing the size of the receiving socket buffer.
net.core.rmem_max  : Represents the maximum size of the receiving socket buffer (in bytes)
net.core.wmem_default  : Represents the default value (in bytes) of the size of the sending socket buffer.
net.core.wmem_max  : Represents the maximum size (in bytes) of the sending socket buffer.
------------------------------------------------------

//Effective immediately. sysctl-p

6. Modify the System Configuration File

vim  /etc/security/limits.conf
#Add at the end
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240

//Add the following to the/etc/pam.d/login file
session required /lib64/security/pam_limits.so
session required pam_limits.so

//Add the following to the / etc/profile file
if [ $USER = "oracle" ]; then
   if [ $SHELL = "/bin/ksh" ]; then
       ulimit -p 16384
       ulimit -n 65536
    else
       ulimit -u 16384 -n 65536
   fi
fi

//Execute source/etc/profile

7 Create oracle installation directory

mkdir -p /opt/app/oracle/
chmod 755 /opt/app/oracle/
chown oracle.oinstall -R /opt/app/oracle/

8 Setting oracle environment variables

Use oracle account
#su - oracle
$ vi ~/.bash_profile 
#Setting oracle variables
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export ORACLE_PID=ora11g
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

//Execution after completion:
env | grep ORA #Check whether the environment variable is complete
ORACLE_BASE=/opt/app/oracle
ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1


9 Install oracle

Unzip oracle Software in / opt directory
[root@tester opt]# unzip linux.x64_11gR2_database_1of2.zip
[root@tester opt]# unzip linux.x64_11gR2_database_2of2.zip
 After decompression, we get the database directory, which contains the response directory. There are three rsp files in the directory, which can be used as templates for the response files during silent installation.
The functions of the three documents are as follows:
db_install.rsp: Installation Response
 dbca.rsp: Creating database replies
 netca.rsp: response to network settings such as monitoring, local service name, etc.

Modify the silent installation configuration file (pay attention to modifying the corresponding parameters, more important, variables, names, paths, etc.)

[oracle@tester ~]$ cat /opt/database/response/db_install.rsp |grep -v "#" |grep -v "^$"
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=tester
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/opt/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/opt/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=ora11g
oracle.install.db.config.starterdb.SID=ora11g
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=1500
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=oracle
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.dbcontrol.emailAddress=
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=


Start silent installation

[oracle@tester ~]$  /opt/database/runInstaller -silent -force -responseFile /opt/database/response/db_install.rsp

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 165908 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 16383 MB    Passed
. . . . . 
. . . . . (Eliminate intermediate warning)
The following configuration scripts need to be executed as the "root" user. 
 #!/bin/sh 
 #Root scripts to run

/opt/app/oracle/oraInventory/orainstRoot.sh
/opt/app/oracle/product/11.2.0/db_1/root.sh
To execute the configuration scripts:
         1. Open a terminal window 
         2. Log in as "root" 
         3. Run the scripts 
         4. Return to this window and hit "Enter" key to continue

Successfully Setup Software.
//After installation, the above information will be prompted and the script will be executed as required.

//Open a new window to execute the corresponding script with root
/opt/app/oracle/oraInventory/orainstRoot.sh
/opt/app/oracle/product/11.2.0/db_1/root.sh
//Then go back to the original window and press enter.

Next, configure the monitor program to start the monitor Cheng Xun

[oracle@tester bin]$ $ORACLE_HOME/bin/netca /silent /responseFile /opt/database/response/netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /opt/database/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Listener "LISTENER" already exists.
Oracle Net Services configuration successful. The exit code is 0
//Start monitoring program
$  /opt/app/oracle/product/11.2.0/db_1/bin/lsnrctl start LISTENER



Silent dbca Library Building

 vim /opt/database/response/dbca.rsp
 GDBNAME = "ora11g.tester"78 That's ok Name of global database=SID+Host domain name
 SID="ora11g" //149 row SID
 CHARACTERSET="AL32UTF8" //415 lines of coding
 NATIONALCHARACTERSET="UTF8" //425 lines of code

 //Execution database
 [oracle@tester response]$ $ORACLE_HOME/bin/dbca -silent -responseFile /opt/database/response/dbca.rsp
Enter SYS user password: 
  
Enter SYSTEM user password: 
 
sh: /bin/ksh: No such file or directory
sh: /bin/ksh: No such file or directory
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
57% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
74% complete
85% complete
96% complete
100% complete
Look at the log file "/opt/app/oracle/cfgtoollogs/dbca/ora11g/ora11g.log" for further details.

Start the database (default will start automatically later)

Note that there must be SID environment variables

[oracle@tester ~]$ echo $ORACLE_SID

ora11g

[oracle@tester ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 21 18:44:19 2019
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> start
SP2-1506: START, @ or @@ command has no arguments
SQL> startup
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL>


Use show parameter; or select table_name from dba_tables to see if

Start listening: lsnrctl start

View listener: lsnrctl status
Stop listening: lsnrctl stop

Reference documents:
https://blog.csdn.net/u010469514/article/details/73822099
https://www.cnblogs.com/it1992/p/9468124.html
https://blog.csdn.net/h8178/article/details/78251198







Tags: Linux Oracle Database glibc network

Posted on Mon, 25 Mar 2019 01:15:28 -0700 by patricklcam