Oracle 11g Installation on Linux (Silent Mode)

Oracle 11g Installation on Linux

Silent mode:-Silent Mode installation allows to configure necessary Oracle components without using graphical interface means no need to user interaction.

It’s very useful method especially when you want to prepare standard installation using shell scripts.
 

Note:-Prerequisites are same as normal installaton


Pre requisite :-

1) Create groups and user
groupadd -g oinstall
groupadd -g dba
groupadd -g oper
 
useradd -g oinstall -G dba,oper oracle

2) Change password for Oracle user
passwd oracle

3) Set the kernel Parameter
 
cat>>/etc/sysctl.conf
kernel.shmmni = 4096
kernel.shmmax = 4398046511104
kernel.shmall = 1073741824
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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 = 1048586
EOF

Show Kernel parameter
sysctl -p

4) Set the user limitation parameter
cat>>/etc/security/limits.conf
oracle   soft   nproc    131072
oracle   hard   nproc    131072
oracle   soft   nofile   131072
oracle   hard   nofile   131072
oracle   soft   core     unlimited
oracle   hard   core     unlimited
oracle   soft   memlock  50000000
oracle   hard   memlock  50000000
EOF

5) Set the IP and Hostname in /etc/hosts file
 

cat>>/etc/hosts
192.168.1.100 example.oracle.com oracle
EOF

Note:- Here "192.168.1.100" is the your system ip which can be get by "ifconfig" command

6) Set the .bash_profile for oracle user
 

cat>>/home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle 
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=ORA11G
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
EOF


7) Check missing packages and install
 

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' binutils \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
unixODBC-devel

Install missing packages by one of below command
yum install unixODBC unixODBC-devel sysstat

                            (OR)
rpm -Uvh unixODBC*

8) Create directory structure and change the owner and group
mkdir -p /ora01/app/oracle/product/11.2.0/db_1
chown oracle:oinstall -R /ora01

9) Stop and disable firewall:-
 
systemctl stop firewalld
systemctl disable firewalld
service iptables stop
chkconfig iptables off


10) Restart the system and login with Oracle User

Copy the Oracle11g Software to /home/oracle directory with the help of WinScp software or by share folder

unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip

Note:- "database" folder will be created after unzip of files.


cd /home/oracle/database/response

[oracle@oel6 response]$ ls
dbca.rsp  db_install.rsp  netca.rsp

cp db_install.rsp db_install_11g.rsp

11) Set the parameters values in Response file

vi db_install_11g.rsp

force to install only database software
oracle.install.option=INSTALL_DB_SWONLY
set your hostname
ORACLE_HOSTNAME=example.oracle.com
set unix group for oracle inventory
UNIX_GROUP_NAME=oinstall
set directory for oracle inventory
INVENTORY_LOCATION=/ora01/app/oraInventory
set oracle home for binaries
ORACLE_HOME=/ora01/app/oracle/product/11.2.0/db_1
set oracle home for binaries
ORACLE_BASE=/ora01/app/oracle
set version of binaries to install
EE - enterprise edition
oracle.install.db.InstallEdition=EE
force to install advanced options
oracle.install.db.EEOptionsSelection=true
specify which advanced option to install
oracle.oraolap:11.2.0.4.0 - Oracle OLAP
oracle.rdbms.dm:11.2.0.4.0 - Oracle Data Mining
oracle.rdbms.dv:11.2.0.4.0 - Oracle Database Vault
oracle.rdbms.lbac:11.2.0.4.0 - Oracle Label Security
oracle.rdbms.partitioning:11.2.0.4.0 - Oracle Partitioning
oracle.rdbms.rat:11.2.0.4.0 - Oracle Real Application Testing
WATCHOUT - should be one line I have changed format here :)

specify extra groups for database managementoracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oper

Now go the database software directory and run the "runInstaller"
 
Options available for silent installation  
-silent            : Run in silent mode.
-responsefile      : Specified the location of the response file. 
-ignoreSysPrereqs  : Ignore the system prerequisite checks.
-ignorePrereq      : Ignore the general prerequisite checks.
-waitforcompletion : Stop the installer spawning as a separate process, so scripts happen in sequence.
-invPtrLoc         : Used to specify the location of the oraInst.loc file, which in turn specifies the inventory details.
-force             : Installation continues when a non-empty directory is used for the ORACLE_HOME.
-showProgress      : Displays line of "." to show something is happeing.

cd /home/oracle/database

./runInstaller -ignorePrereq -ignoreSysPrereqs -silent -responseFile /home/oracle/database/response/db_install_11g.rsp

Output would like be:-

[oracle@oel6 database]$ ./runInstaller -ignorePrereq -ignoreSysPrereqs -silent -responseFile /home/oracle/database/response/db_install_11g.rsp

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.  Actual 41752 MB    Passed
Checking swap space: must be greater than 150 MB.  Actual 4095 MB    Passed
Preparing to launch Oracle Universal Installer
from /tmp/OraInstall2015-02-06_09-58-53PM.
Please wait ...[oracle@oel6 database]$ No protocol specified
[WARNING] - My Oracle Support Username/Email Address Not Specified
[SEVERE] - The product will be registered
anonymously using the specified email address.
You can find the log of this install session at:
 /ora01/app/oraInventory/logs/installActions2015-02-06_09-58-53PM.log
The installation of Oracle Database 11g was successful.
Please check  '/ora01/app/oraInventory/logs/silentInstall2015-02-06_09-58-53PM.log'
for more details.

As a root user, execute the following script(s):
    1. /ora01/app/oraInventory/orainstRoot.sh
    2. /ora01/app/oracle/product/11.2.0/db_1/root.sh

Successfully Setup Software.

12) Run the above listed scripts from root user:-
su -
sh /ora01/app/oraInventory/orainstRoot.sh
sh /ora01/app/oracle/product/11.2.0/db_1/root.sh

13) Configure Oracle Net:-
Oracle Listener also can be configured through response file
cd /home/oracle/database/response
cp netca.rsp netca_11g.rsp

Now edit netca_11g.rsp to set own parameters.
I didn't changed anything here. So just start standard configuration.
It will configure LISTENER with standard settings.

netca -silent -responseFile /home/oracle/database/response/netca.rsp

Output would like be:-

netca -silent -responseFile /home/oracle/database/response/netca.rsp

Parsing command line arguments:
  Parameter "silent" = true
  Parameter "responsefile" = /home/oracle/database/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
  Running Listener Control:
    /ora01/app/oracle/product/11.2.0/db_1/bin/lsnrctl start LISTENER
  Listener Control complete.
  Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0

Check LISTENER status:-
lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 -
Production on 06-FEB-2015 23:00:09

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1522)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0
                          - Production
Start Date                06-FEB-2015 22:58:06
Uptime                    0 days 0 hr. 2 min. 2 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File  
/ora01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File        
/ora01/app/oracle/diag/tnslsnr/oel6/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel6)(PORT=1521)))
The listener supports no services
The command completed successfully

Configure database:-
The last setup is to create new database example.oracle.com

Prepare directories for database datafiles and flash recovery area

mkdir /ora01/app/oracle/oradata
mkdir /ora01/app/oracle/flash_recovery_area

backup original response file for dbca

cd /home/oracle/database/response

cp dbca.rsp dbca_11g.rsp
vi dbca_11g.rsp

set below parameters value

global database name
GDBNAME = "ORA11G.oracle.com"
instance database name
SID = "ORA11G"
template name used to create database
TEMPLATENAME = "General_Purpose.dbc"
password for user sys
SYSPASSWORD = "oracle"
password for user system
SYSTEMPASSWORD = "oracle"
creates database console
EMCONFIGURATION = "LOCAL"
password for sysman user
SYSMANPASSWORD = "oracle"
password for dbsnmp user
DBSNMPPASSWORD = "oracle"
storage used to create database
FS - it means OS data files
STORAGETYPE=FS
default directory for oracle database datafiles
DATAFILEDESTINATION=/ora01/app/oracle/oradata
default directory for flashback data
RECOVERYAREADESTINATION=/ora01/app/oracle/flash_recovery_area
STORAGETYPE=FS
database character set
CHARACTERSET = "AL32UTF8"
national database character set
NATIONALCHARACTERSET= "AL16UTF16"
listener name to register database to
LISTENERS = "LISTENER"
force to install sample schemas on the database
SAMPLESCHEMA=TRUE
specify database type
DATABASETYPE = "OLTP"force to use autmatic mamory management
AUTOMATICMEMORYMANAGEMENT = "TRUE"
defines size of memory used by the database
TOTALMEMORY = "800"

Run the database installation:-
dbca -silent -responseFile /home/oracle/database/response/dbca_11g.rsp

Output would like be:-
dbca -silent -responseFile /home/oracle/database/response/dbca_11g.rsp
Copying database files
1% complete
3% 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
85% complete
96% complete
100% complete
Look at the log file  "/ora01/app/oracle/cfgtoollogs/dbca/ORA11G/ORA11G.log"
for further details.

Verify connection

[oracle@oel6 admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Feb 6 23:45:16 2015
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition
Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining
and Real Application Testing options

SQL> show parameter db_name

NAME         TYPE    VALUE
------------ ------- -------
db_name      string  ORA11G
SQL>

Check status of database console

[oracle@oel6 ~]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
https://oel6.dbaora.com:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------

Edit the “/etc/oratab” file to set restart flag for ORA11G to ‘Y’.

ORA11G:/ora01/app/oracle/product/11.2.0/db_1:Y

No comments:

Post a Comment