Wednesday, November 24, 2010

Oracle 10g Installation on Linux ES4

ORACLE 10g ON REDHAT LINUX ES4 INSTALLATION        
                                   GUIDE.


Install Oracle 10g on REDHAT LINUX ( for bellow assumptions )


Assumptions :

  1. 512 MB RAM
  2. Oracle Release 10.1.0.2.0

It seems a complex operation to install Oracle 10g  Database server on a Sun Solaris 10 intel platform edition. I tried to Install the Oracle several times and it is easy to say that is not difficult to install Oracle Software.But not easy to say the same for the database.creation procedure.

If  You are not familiar  with the Solaris and Oracle, I hope this tutorial will show you how to install and create the Oracle database on your Solaris Intel System.The Most Important thing to say about installing.Oracle is to set the right kernel parameters and to make the kernel patches at the beginning. I am consider that you patched the kernel with the latest “Kernal Jumbo Patches”.

So, Let’s move to finish the Job.

PRE-INSTALLATION TASKS

TASKS TO PERFORM BY ROOT

1.)    Open “/etc/ sysctl.conf” file by using a preferable text editor utility for yourself.
2.)    Insert the following rows at the bottom of “/etc/ sysctl.conf”   file.

CAUTION:-These values are for a computer with 512MB RAM. You need to change these values according to your computers physical RAM. While you create a database select 5 as “maximum concurrent connection”. Otherwise you will receive an “Oracle not available” or “not connected to Oracle” error. You will need a good luck……………….”

(Note: Insert the below information in “/etc/ sysctl.conf “  file )


kernel.core_uses_pid = 1
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 65536
kernel.msgmax = 2097152
kernel.msgmni = 16394
kernel.msgmnd = 2097152
kernel.msgtql = 2097152
kernel.msgseg = 16384
kernel.msgsez = 256
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144


These settings are for your Operating Environment’s Kernel . Oracle Database needs you to make these modifications to run properly. You may need to edit these values according to your computers RAM. Please refer to your “system Manufactures Assistance” and documentation.

3.)    Reboot your system to activate the new kernel parameters. When your computer is restarted, you can check the amount of “Maximum shared Memory” and “Minimum Shared Memory” by the command;

sysdef


This will give the important values about your system. You can see “Shared Memory Area” section at the bottom of the listing.

4.)    Open a terminal window as root. Type

admintool

and press ENTER to run administration tool.

You need at least one user and two groups to install and run Oracle Database. First let’s create the UNIX groups, then let’s create a UNIX user account by using admintool. Make
Following step by step.

#groupadd dba
#groupadd oinstall
#useradd –g dba –G oinstall  –d  /home/oracle –m –s /bin/bash oracle
#passwd oracle


5.)Create a directory named “/u01/app/oracle” in the root directory (or where you want) to become the base and others for Oracle Database as follows.

                       mkdir  –p /u01/app/oracle/product/10.1.0
                        mkdir –p /u01/app/oracle/oraInventory


Now you need to grant this directory for user “oracle” to install and manage Oracle database. Make the user ‘oracle” owner of this directory as follows.

                     Chown –R oracle:dba  /u01/app/oracle

“Oracle Universal Installer” will make other sub-directories automatically in this base directory except where the databse files.(“ORADATA”directory)would reside.Installer will ask you this direcotry’s  location.


Now Create another  “oracle” directory in the “ /var/opt “ for your database startup options. File (called “ oratab “) and make the user “oracle” of this directory,too,as follows.

                   mkdir  /var/opt/oracle
                   chown  –R  oracle:dba /var/opt/oracle

5.)    You need to login as ‘ORACLE USER” to the system. So, logout and login as user “oracle” to system again.

1.You, logged as Oracle User named “oracle”, need to make some modifications to your environment variables to run “ORACLE UNIVERSAL Installer” for installing and managing Oracle Database.

If you choose “/export/home/oracle”directory as home and Bourne Shell as login shell while creating user “oracle”, you have a hidden file named”   “.bash_profile” in “/export/home/oracle” directory. Open this file and replace the PATH string by follwing.

(Note:- Insert below information in .bash_profile file)

## Oracle Settings##

ORACLE_BASE=u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.1.0; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$ORACLE_HOME/bin:$PATH; export PATH
ORACLE_OWNER=oracle; export ORACLE_OWNER
ORACLE_SID=TSH1; export ORACLE_SID

LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH
     CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms:.
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib;
export CLASSPATH

LD_ASSUME_KERNEL=2.4.1; export LD_ASSUME_KERNEL
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

After Modification of  .profile file,save it and relogin as the user “oracle”

   PERFORM INSTALLATION
Make sure that your environment variables set correctly by entering following command.
         
                   Set

Now, your system is ready to install Oracle 10g. To install Oracle change default directory to where your oracle files reside. For example, if your installation files are at “ /export/home/oracle , type the following command:.

And run Install program by the command:
      
                 ./runInstaller   (Backup where did u kept)




Possible errors : ( and solutions before graphical mode opened )

1: when invoke runInstaller : ( bellow error may come)
    [oracle@yslhost database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-2.1, UnitedLinux-1.0 or redhat
-3
                                      Passed


All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-06-12_03
-03-47PM. Please wait ...[oracle@yslhost database]$ Oracle Universal Installer,
Version 10.1.0.2.0 Production
Copyright (C) 1999, 2004, Oracle. All rights reserved.

Xlib: connection to "192.168.100.175:0.0" refused by server
Xlib: No protocol specified

Can't connect to X11 window server using '192.168.100.175:0.0' as the value of t
he DISPLAY variable.
192.168.100.175:0.0
192.168.100.175:0.0
Unable to start an interactive install session because of the following error:Ca
n't connect to X11 window server using '192.168.100.175:0.0' as the value of the
 DISPLAY variable. The DISPLAY environment variable should be set to <hostname o
r IP address>:<screen>, where the <screen> is usually '0.0'.
Depending on the Unix Shell, you can use one of the following commands as exampl
es to set the DISPLAY environment variable:
- For csh:                      % setenv DISPLAY 192.168.1.128:0.0
- For sh, ksh and bash:         $ DISPLAY=192.168.1.128:0.0; export DISPLAY
Use the following command to see what shell is being used:
        echo $SHELL
Use the following command to view the current DISPLAY environment variable setti
ng:
        echo $DISPLAY
- Make sure that client users are authorized to connect to the X Server.
To enable client users to access the X Server, open an xterm, dtterm or xconsole
 as the user that started the session and type the following command:
% xhost +
To test that the DISPLAY environment variable is set correctly, run a X11 based
program that comes with the native operating system such as 'xclock':
        % <full path to xclock... see below>
If you are not able to run xclock successfully, please refer to your PC-X Server
 or OS vendor for further assistance.
Typical path for 'xclock': '/usr/X11R6/bin/xclock'
2: Error: Can't open display: localhost:0.0


Solution : ( for above errors )
   Add localhost to the X server's list of connectables
Code:
$sudo xhost + localhost
Update DISPLAY (as you, not root):
Code:
$export DISPLAY=localhost:0


After Graphical Mode opening : ( first read the all points )

1)    if window prompts about the path to strore the database files…. Please set the bellow path ( this is oracle_home all files will be stored here)

/u01/app/oracle/product/10.1.0  




2)when window prompts for oraInventory … Please give the bellow path

            /u01/app/oracle/oraInventory

3)      it prompts for global database name, SID please give the bellow for both

TSH1
4) put a “ tick” mark for “ create db with sample tables and schemas.+

5) when ever the db creation is completed  Press “EXIT” to close runinstaller.


After successfully completion of oracle installation  :
Oracle Auto Startup script  :
create a file called dbora in /etc/init.d location with the below content in it.

Content : ( of   /etc / init.d / dbora )

#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORA_HOME=/u01/app/oracle/product/10.2
ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart ]
then
    echo "Oracle startup: cannot start"
    exit
fi

case "$1" in
    'start')
        # Start the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
        su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
        ;;
    'stop')
        # Stop the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
        su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
        ;;
esac




# Now give the bellow commands ( 1.Grant full permission 2. invoke dbora while booting )


# chmod 777 /etc/init.d/dbora  
# chkconfig --add dbora

Now we should give the execute permissions to all (for sqlplus,bin files) :

Oracle]$  chmod 6750 $ORACLE_HOME /bin/oracle

Oracle]$  chmod 6751 $ORACLE_HOME /bin/sqlplus


10g installation has been completed …………………………

We need to modify the other OS user’s .bash_profile  as same as oracle’s .bash_profile


When we connect from LINUX terminal to  other server:

User]$  ssh   oracle@<server IP >

Here oracle is os user of server.. its may be any one …..


Error : When we use ssh command the bellow error msg may come

Path <………..>
Ip    <…………>
RSA host key verification failed

Action :  Go to the specified path and remove the specified IP  from there… now ssh  will be worked and we can successfully connect to the server.





       









No comments:

Post a Comment