Wednesday, March 7, 2012

How to Install Oracle 11g Release 2 on LINUX


Step1:  Hardware Capacity
Minimum Harddisk capacity is 20GB
Physical RAM size 2GB
To determine the RAM size, enter the following command:
# grep MemTotal /proc/meminfo

Swap space is
Available RAM Swap Space Required
Available RAM
Swap Space Required
Between 1 GB and 2 GB
1.5 times the size of the RAM
Between 2 GB and 16 GB
Equal to the size of the RAM
More than 16 GB
16 GB

To determine the size of the configured swap space, enter the following command:
# grep SwapTotal /proc/meminfo

•To determine whether the system architecture can run the software, enter the following command:
# uname -m

To determine the amount of shared memory available, enter the following command:
# df -h /dev/shm/

•At least 1 GB of disk space in the /tmp directory
#df –k /tmp

..To determine whether the required packages are installed, enter commands similar to the following:
# rpm -q package_name

Step2 :  Users and  Groups
The following local operating system groups and users are required if you are installing Oracle Database:
•The Oracle Inventory group (typically, oinstall)

•The OSDBA group (typically, dba)

•The Oracle software owner (typically, oracle)

•The OSOPER group (optional. Typically, oper)

To determine whether these groups and users exist, and if necessary, to create them, follow these steps:
1.To determine whether the oinstall group exists, enter the following command:
# more /etc/oraInst.loc
If the output of this command shows the oinstall group name, then the group exists.
If the oraInst.loc file exists, then the output from this command is similar to the following:
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
The inst_group parameter shows the name of the Oracle Inventory group, oinstall.
2.To determine whether the dba group exists, enter the following command:
# grep dba /etc/group
If the output from this commands shows the dba group name, then the group exists.

3.If groups not exist then we need to create these groups under roots user, enter the following commands to create the oinstall and dba groups:
# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
4.To determine whether the oracle user exists and belongs to the correct groups, enter the following command:
# id oracle
If the oracle user exists, then this command displays information about the groups to which the user belongs. The output should be similar to the following, indicating that oinstall is the primary group and dba is a secondary group:
uid=503(oracle) gid=503(oinstall) groups=504(dba),505(oper)
5.If necessary, complete one of the following actions:
◦If the oracle user exists, but its primary group is not oinstall or it is not a member of the dba group, then enter the following command:
# /usr/sbin/usermod -g oinstall -G dba oracle
◦If the oracle user does not exist, enter the following command to create it:
# /usr/sbin/useradd -g oinstall -G dba oracle
This command creates the oracle user and specifies oinstall as the primary group and dba as the secondary group.
6.Enter the following command to set the password of the oracle user:
# passwd oracle
To determine the distribution and version of Linux installed, enter the following command:
# cat /proc/version

Step3:  Kernel Parameter setting
1.Using any text editor, edit the /etc/sysctl.conf file, and add or edit lines similar to the following:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 = 1048586


Enter the following command to change the current values of the kernel parameters:
# /sbin/sysctl -p

2. Update the resource limits in the /etc/security/limits.conf configuration file for the installation owner. For example, add the following lines to the /etc/security/limits.conf file:
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
oracle              soft    stack   10240

Step4: Creating directories
# mkdir -p /mount_point/app/
# chown -R oracle:oinstall /mount_point/app/
# chmod -R 775 /mount_point/app/
For example:
# mkdir -p /u01/app/
# chown -R oracle:oinstall /u01/app/
# chmod -R 775 /u01/app/
Step5: check the security linux file as root user.
#cat /etc/selinux/config
SELINUX=Disabled

Step6: CONFIGURING THE ORACLE USER’s Environment
Login as root user
#xterm
It will open new window, in that type
#xhost + then exit
Now login as oracle user
#su – oracle  or pbrun –u oracle ksh
$
$ vi .bash_profile
umask 022
TMP=/tmp; export TMP
TMPDIR=/tmp; export TMPDIR
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_HOSTNAME=inatechsrv.blr.com; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0.1/server; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
 ESC :wq

$. ./.bash_profile
It should run it if it shows something means somewhere went wrong in this file.

Step 7: Installing oracle database
Copy the two zip files into /mnt,unzip the 11g software files
$unzip file1.zip
$unzip file2.zip
Step 8: If your installing Oracle under GUI Mode
Go to the respective folder
#su – oracle
#xterm
$cd /mnt/hgfs/shared/database
$./runInstaller.

Step 9: If your installing on silent Mode =====================================================================================
ORACLE 11G Release 2 Software silent Mode installation

Go to the software folder
Ex:
#su - oracle
$cd /mnt/database
Enter the below command
$./runInstaller –silent –debug –force \
FROM_LOCATION=/mnt/database/stage/products.xml \
oracle.install.option=INSTALL_DB_SWONLY \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=/u01/app/oracle/oraInventory \
ORACLE_HOME=/u01/app/oracle/product/11.2.0.1/server \
ORACLE_HOME_NAME="OraDb11g_Home2" \
ORACLE_BASE=/u01/app/oracle \
oracle.install.db.InstallEdition=EE \
oracle.install.db.isCustomInstall=false \
oracle.install.db.DBA_GROUP=dba \
oracle.install.db.OPER_GROUP=dba \
DECLINE_SECURITY_UPDATES=true
Enter
Running the rootpre.sh
# /directory_path/rootpre/rootpre.sh 
PRESS Y

Note: -ignoreSysPrereqs   to avoid system prerequisites.
While  installing if it gives error like

[FATAL] [INS-32035] Unable to create a new central inventory at the specified location.

CAUSE: The central inventory location provided is not empty.

Please create oraInst.loc file,  this file will be in /etc/oraInst.loc or /var/opt/oracle/oraInst.loc (it depends on OS)

Creating oraInst.loc
#vi /etc/oraInst.loc  or /var/opt/oracle/oraInst.loc
Enter the data
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
save it :wq

again run it but this time please remove the line(INVENTORY LOCATION).
#su – oracle
$cd /mnt/database
$./runInstaller –silent –debug –force –ignoreSysPrereqs  \
FROM_LOCATION=/mnt/patch/database/stage/products.xml  \
oracle.install.option=INSTALL_DB_SWONLY \
UNIX_GROUP_NAME=oinstall \
ORACLE_HOME=/u01/app/oracle/product/11.2.0.1/server  \
ORACLE_HOME_NAME="OraDb11g_Home2" \
ORACLE_BASE=/u01/app/oracle \
oracle.install.db.InstallEdition=EE \
oracle.install.db.isCustomInstall=false \
oracle.install.db.DBA_GROUP=dba \
oracle.install.db.OPER_GROUP=dba \
DECLINE_SECURITY_UPDATES=true

Enter,  it will ask to run rootpre.sh, press Y.
now oracle software will install smoothly.  At  end of the installation , we can see a text called
The following configuration scripts need to be executed as the "root" user.
 #!/bin/sh
 #Root scripts to run
/u01/app/oracle/product/11.2.0.1/server/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

We need to run this script under root user
#cd /u01/app/oracle/product/11.2.0.1/server
#./root.sh

 To confirm this script ran successfully
#cat /etc/oratab
If it shows then script run successfully.  If file doesn’t exist means root.sh script not ran successfully.

Step10: Creating listeners
Copy the response file netca.rsp to some other location, open the file
Modify the values.
Note: INSTALL_TYPE should be custom(if u want to use your listener name else default ).

Please check some prerequisites
#ping hostname
#ping ipaddress
Both should successfully otherwise listener creation will fails.
$cd $ORACLE_HOME/bin
$./netca /silent /responsefile /mnt/database/database/netca.rsp

Step11: Create the database
Copy the dbca.rsp to some other location, change the parameters whichever is applicable.

#su – oracle
$cd $ORACLE_HOME/bin
[oracle@inatechsrv bin]$ ./dbca -silent -responseFile /mnt/database/database/dbca.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
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/DB11G/DB11G.log" for further details.
[oracle@inatechsrv bin]$

Step12:HOW TO CREATE ENTERPRISE MANAGER
#su – oracle
$cd $ORACLE_HOME/bin
$./emca -config dbcontrol db -repos create

Enter all parameter values, press Y.  While creating repository if given error like already repository available
$ ./emca -config dbcontrol db
Just enter all parameter values and press Y.

POST Installation Check

Step1: Check  . oraenv working properly or not
#su – oracle
$. Oraenv

Step2: Check sqlplus command working fine or not
#su  - oracle
$sqlplus
Enter username: /as sysdba

Step3:  check the database Mode
Sql> select name,open_mode from v$database;
DB11G READWRITE

Step4: Check whether database using spfile file or not
SQL>show parameter spfile;

If it using pfile just create it.
SQL> create spfile from pfile;

Step5:  Check whether sys user working as sysdba or not
#su – oracle
$sqlplus sys$DB11G
Enter the password
SQL>

If any error throws just check below documents.

Step6:  Just check listener status & tnsname entry
#su – oracle
$lsnrctl status <listenername>

Got to $ORACLE_HOME/network/admin
Check whether tnsnames.ora file has entry.

Check the connectivity
#su – oracle
$sqlplus sys@


Step7: Create one tablespace and make it default.
SQL> create tablespace red_fms datafile ‘/u01/app/test1.dbs’ size 1G;
SQL>alter database default tablespace red_fms;

Step8: Check whether enterprise manager working or not.
Open explorer and type above URL.


ERRORS

ERROR1
[oracle@inatechsrv ~]$ sqlplus sys@DB11G


SQL*Plus: Release 11.2.0.1.0 Production on Fri Feb 3 17:02:25 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter password:
ERROR:
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

Solution:
SQL> alter system set o7_dictionary_accessibility=true scope=spfile;

System altered.

Error2: ORA-01994: GRANT failed: password file missing or disabled
Recreate the password file.
$orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=newsyspassword entries=16 force=y

SQL> show parameter REMOTE_LOGIN_PASSWORDFILE

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE

SQL> select * from v$pwfile_users;

USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE


2 comments:

  1. Hello Sir:

    I really appreciate you for sharing your knowledge and your Oracle 11gr2 installation instruction is amazing and so precise.

    I am a newbie to Oracle and very interested in Oracle technology and currently studying 'Oracle Database Administration & PL\SQL'.

    I've been trying to install oracle database 11gr2 on (OELv5.7 on Virtual Machine) just to continue with my study as I am preparing to get my OCP, OCE, etc.

    I've configured every aspect of the installation and it has been painful but overall went smooth up to the point when I was installing the 11gr2 and progress bar showing %28
    then I got an error saying:

    invalid entry CRC (expected 0x57a8ddf4) but got 0x73a47af4

    I've been googling for this error but so far nothing to help me out.

    Please help me to fix this issue as I am totally hopeless.

    regards

    Sean

    ReplyDelete
    Replies
    1. Hi Shawn K, I belive you have some problem with your installation files, I would recomend you to download it again from https://edelivery.oracle.com

      Delete

Share your knowledge it really improves, don't show off...