Article From:

CentOS 7Silent (no graphical interface) installation of Oracle 11g


Prepare the CentOS 7 system environment

Let me take CentOS-7-x86_64-DVD-1511.iso Oracle as an example to briefly describe the installation process of 11g.

Due to the installation of silent mode (silent), I did not need to use graphical interfaces. I chose the smallest installed server version of CentOS 7.

The installation process can be referred to

After the installation is completed, only the command line interface is available.


To facilitate command operation, I used the remote connection tool Xshell.

I would like to share with you the green version of XshellXftpPortable:

After downloading, unzip can be used


Download Oracle 11g

OracleOfficial website

My machine is installed on the CentOS7 64 bit system, so the Oracle version downloaded is also 64 bits.  zlinux64The version of Oracle is installed on the IBM server, and CentOS 7 is not installed.

After the download is completed, there are two compressed files And


Uploading the compressed file to /db/ via Xftp

Install dependency package

Before installing the dependency package, it is recommended that the yum source be modified to aliyun source and download faster.

cd /etc

mv yum.repos.d yum.repos.d.bak

mkdir yum.repos.d

wget -O /etc/yum.repos.d/CentOS-Base.repo

yum clean all

yum makecache


After the modification is successful, install the following 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 \


After the installation is completed, the following interface is displayed


Use the following commands to check whether the dependencies are complete

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”

There is no installation of pdksh


Execute the yum -y install pdksh and find that CentOS 7 does not have relevant installation packages available.


Download the pdksh RPM package directly through the WGet command. I downloaded it to /tmp/.

wget -O /tmp/pdksh-5.2.14-37.el5_8.1.x86_64.rpm

After the download is completed, enter the /tmp/


rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm


Again check whether the dependency package is complete

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”


This depends on the complete package installation

Add Oracle user groups and users

groupadd oinstall

groupadd dba

groupadd asmadmin

groupadd asmdba

useradd -g oinstall -G dba,asmdba oracle -d /home/oracle

When the addition is finished, look at the Oracle user

id oracle

Initializing the password for the Oracle user

passwd oracle


Configuring hostname (native IP mapping)

vim /etc/hosts centos-oracle

Test hostname

ping -c 3 centos-oracle


Optimization of OS kernel parameters

kernel.shmmax The parameters are set to half of the physical memory

vim /etc/sysctl.conf





kernel.shmmax = 1073741824

kernel.sem=250 32000 100 128

net.ipv4.ip_local_port_range=9000 65500





Make the parameters effective

sysctl -p


Limit the shell permissions of Oracle users

vim /etc/security/limits.conf

oracle              soft    nproc   2047

oracle              hard    nproc   16384

oracle              soft    nofile  1024

oracle              hard    nofile  65536

vim /etc/pam.d/login

session  required   /lib64/security/

session  required

vim /etc/profile

if [ $USER = “oracle” ]; then

if [ $SHELL = “/bin/ksh” ]; then

ulimit -p 16384

ulimit -n 65536


ulimit -u 16384 -n 65536



Create the Oracle installation directory

mkdir -p /db/app/oracle/product/11.2.0

mkdir /db/app/oracle/oradata

mkdir /db/app/oracle/inventory

mkdir /db/app/oracle/fast_recovery_area

chown -R oracle:oinstall /db/app/oracle

chmod -R 775 /db/app/oracle

Configuring the Oracle user environment variable

su – oracle

vim .bash_profile

umask 022

export ORACLE_HOSTNAME=centos-orcl

export ORACLE_BASE=/db/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/



export LC_ALL=”en_US”

export LANG=”en_US”



After the above configuration is completed, it is recommended that the system be restarted.


Unzip the Oracle compressed file to the /db

cd /db/

unzip -d /db

unzip -d /db


After unzip

mkdir /db/etc/

cp /db/database/response/* /db/etc/

vim /db/etc/db_install.rsp















Start installation

su – oracle

cd /db/database/

./runInstaller -silent -ignorePrereq -responseFile /db/etc/db_install.rsp

During installation, you can use the tail command to monitor the installation log of Oracle.

tail -f /db/app/oracle/inventory/logs/installActions2017-07-12_03-48-29PM.log


Installation is done, prompting Successfully Setup Software.

Complete the configuration according to the hint


su root

sh /db/app/oracle/inventory/

sh /db/app/oracle/product/11.2.0/


Silent monitor

su – oracle

netca /silent /responsefile /db/etc/netca.rsp


[oracle@localhost ~]$ cat /db/app/oracle/product/11.2.0/network/admin/listener.ora
# listener.ora Network Configuration File: /db/app/oracle/product/11.2.0/network/admin/listener.ora
# Generated by Oracle configuration tools.

(ADDRESS = (PROTOCOL = TCP)(HOST = centos-oracle)(PORT = 1521))

ADR_BASE_LISTENER = /db/app/oracle


View the monitor port

netstat -tnulp | grep 1521

Silent creation of a database

TOTALMEMORY Set to 80% of the total memory

vi /db/etc/dbca.rsp

GDBNAME = “orcl”

SID = “orcl”

SYSPASSWORD = “oracle”




DATAFILEDESTINATION =/db/app/oracle/oradata




Execution of silence

dbca -silent -responseFile /db/etc/dbca.rsp


Look at the Oracle instance process

ps -ef | grep ora_ | grep -v grep


View the monitoring state

lsnrctl status

cp -a /db/app/oracle/admin/orcl/pfile/init.ora.522018105539 /db/app/oracle/product/11.2.0/dbs/initORCL.ora



Open the instance with the default parameter file (SPFILE), load the default database, and open the database.

It is equal to the following three commands

startup nomount

alter database mount

alter database open


Create a directory file

[root@localhost ~]# cat /etc/oracle/olr.loc
olrconfig_loc = /db/app/oracle/product/11.2.0/cdata/centos-oracle.olr
CRS_HOME = /db/app/oracle/product/11.2.0/

touch  /db/app/oracle ……olr



Log in to sqlplus to see the instance state

sqlplus / as sysdba

select status from v$instance;


View the database code

select userenv(‘language’) from dual;


View the database version information

select * from v$version;


Activating Scott users

alter user scott account unlock;

alter user scott identified by tiger;

select username,account_status from all_users;


NavicatRemote connection Oracle

Open 1521 port

firewall-cmd –zone=public –add-port=1521/tcp –permanent

firewall-cmd –reload

Official website

Download the instantclient-basic, unzip the compressed file


Download Navicat

Open Navicat, tool – Option

Open the OCI interface, select the oci.dll under the instantclient-basic decompression directory on the right OCI library column, then click OK.


Restart Navicat, click the connection, and select Oracle


IPFor the IP address of the Oracle server, the instance name of the service named Oracle can be ignored.

select instance_name from v$instance;


The user name uses the newly activated Scott and the password is tiger. After completing the above information, click the connection test.


The Navicat remote connection to the Oracle database is successful

Set the Oracle boot to start

vi /db/app/oracle/product/11.2.0/bin/dbstart


vi /db/app/oracle/product/11.2.0/bin/dbshut


vi /etc/oratab


vi /etc/rc.d/init.d/oracle


[plain] view plain copy

  1. #! /bin/bash  
  2. # oracle: Start/Stop Oracle Database 11g R2  
  3. #  
  4. # chkconfig: 345 90 10  
  5. # description: The Oracle Database is an Object-Relational Database Management System.  
  6. #  
  7. # processname: oracle  
  8. . /etc/rc.d/init.d/functions  
  9. LOCKFILE=/var/lock/subsys/oracle  
  10. ORACLE_HOME=/db/app/oracle/product/11.2.0  
  11. ORACLE_USER=oracle  
  12. case “$1” in  
  13. ‘start’)  
  14.    if [ -f $LOCKFILE ]; then  
  15.       echo $0 already running.  
  16.       exit 1  
  17.    fi  
  18.    echo -n $”Starting Oracle Database:”  
  19.    su – $ORACLE_USER -c “$ORACLE_HOME/bin/lsnrctl start”  
  20.    su – $ORACLE_USER -c “$ORACLE_HOME/bin/dbstart $ORACLE_HOME”  
  21.    su – $ORACLE_USER -c “$ORACLE_HOME/bin/emctl start dbconsole”  
  22.    touch $LOCKFILE  
  23.    ;;  
  24. ‘stop’)  
  25.    if [ ! -f $LOCKFILE ]; then  
  26.       echo $0 already stopping.  
  27.       exit 1  
  28.    fi  
  29.    echo -n $”Stopping Oracle Database:”  
  30.    su – $ORACLE_USER -c “$ORACLE_HOME/bin/lsnrctl stop”  
  31.    su – $ORACLE_USER -c “$ORACLE_HOME/bin/dbshut”  
  32.    su – $ORACLE_USER -c “$ORACLE_HOME/bin/emctl stop dbconsole”  
  33.    rm -f $LOCKFILE  
  34.    ;;  
  35. ‘restart’)  
  36.    $0 stop  
  37.    $0 start  
  38.    ;;  
  39. ‘status’)  
  40.    if [ -f $LOCKFILE ]; then  
  41.       echo $0 started.  
  42.       else  
  43.       echo $0 stopped.  
  44.    fi  
  45.    ;;  
  46. *)  
  47.    echo “Usage: $0 [start|stop|status]”  
  48.    exit 1  
  49. esac  
  50. exit 0  

Boot up Oracle

systemctl enable oracle

Startup problem

oracle ORA-12547: TNS:lost contact

cd /db/app/oracle/product/11.2.0/bin/

chmod 6751 oracle

TNS-12555: TNS:permission denied

cd /var/tmp

chown -R oracle:oinstall .oracle

Copyright notice: This article is an original article for bloggers. It can not be reproduced without permission from bloggers. Https://
Article Tags: oracleoracle 11g server centoscentos7

Leave a Reply

Your email address will not be published. Required fields are marked *