Saturday, March 17, 2012

Again A Time To Celebrate !!!!!!!


Today , my blog visitor's hits crossed 50,000 and offcourse a time to celebrate this moment . I am blogging from last year (i.e, march 2011)  and almost taken one year to acheive this . This month is very special to me as ever. There are lots of thing to celebrate in this month . Holi one of my favourite festival , My Birthday and this time my Blog Hits and others .

This blogs helps to find some  good friends whom i have never met and they are very kind and helpful to me. Whenever I am publishing any post on my blog, it boost up my confidence and motivate me to post  further . Every comment by you all is helping me to go more deep . Kindly free feel to comment and ask your doubt and i will try my best to give  solution .




















I need  your support and wishes  to continue posting in future .  


Cheers  !!!!!!!


Wednesday, March 14, 2012

Automatically Starting/Stopping Oracle on Redhat Linux


Oracle recommends that we should configure our system to automatically start  Database when the system starts up, and to automatically shut it down when the system shuts down. Automating database startup and shutdown guards against incorrect database shutdown .

To automate database startup and shutdown, oracle use the dbstart and dbshut scripts, which are located in the $ORACLE_HOME/bin  directory. Let's have Look on the above scripts .

1.) Dbstart :  This script is used to start ORACLE  from /etc/rc(.local). It should ONLY be executed as part of the system boot procedure.This script will start all databases listed in the oratab file  whose third field is a "Y".  If the third field is set to "Y" and there is no ORACLE_SID for an entry (the first field is a *), then this script will ignore that entry.

2.) Dbshut :  This script is used to shutdown ORACLE from /etc/rc(.local). It should ONLY be executed as part of the system boot procedure.This script will shutdown all databases listed in the oratab file whose third field is a "Y".  If the third field is set to "Y" and there is no ORACLE_SID for an entry (the first field is a *), then this script will ignore that entry.

We need to create the script which will run dbshut and dbstart scripts in the /etc/init.d directory ,whenever the machine is shutdown or start . Whenever machine boots it runs the scripts beginning with Snnname in /etc/rc3.d ,where the nn indicates the order in which the scripts will run . Similarly in case of shutdown scripts are named as Knnnames which runs from rc0.d .If we want that Oracle is the last program that is automatically started, and it is the first to be shutdown then we will name the startup and shutdown scripts on OS like /etc/rc3.d/S99oracle and /etc/rc0.d/K01oracle respectively.

Let's have a demo of Automate Startup/Shutdown on Linux :

Step 1 : Edit the oratab file : 
Oratab file  is created by root.sh and updated by the Database Configuration Assistant when creating a database. The first and second fields are the system identifier and home directory of the database respectively.  The third filed indicates  to the dbstart utility that the database should , "Y", or should not, "N", be brought up at system boot time .In my case it is comcast:/home/oracle/product/10.2.0/db_1:N
So it edit as
comcast:/home/oracle/product/10.2.0/db_1:Y
Where my database name is comcast and ORACLE_HOME is  "/home/oracle/product/10.2.0/db_1"


Step 2 : Create a file called dbora and add the below lines 
[root@tech ~]# cd /etc/init.d
[root@tech init.d]# vi  dbora
add the following line

#! /bin/sh  -x
#
# Change the value of ORACLE_HOME to specify the correct Oracle home
# directory for your installation.
ORACLE_HOME=/home/oracle/product/10.2.0/db_1
#
# Change the value of ORACLE to the login name of the
# oracle owner at your site.
#
ORACLE=oracle
PATH=${PATH}:$ORACLE_HOME/bin
HOST=`hostname`
PLATFORM=`uname`
export ORACLE_HOME PATH
#
if [ ! "$2" = "ORA_DB" ] ; then
   if [ "$PLATFORM" = "HP-UX" ] ; then
      remsh $HOST -l $ORACLE -n "$0 $1 ORA_DB"
      exit
   else
      rsh $HOST -l $ORACLE  $0 $1 ORA_DB
      exit
   fi
fi
#
case $1 in
'start')
        if [ "$PLATFORM" = "Linux" ] ; then
          touch /var/lock/subsys/dbora
        fi
        $ORACLE_HOME/bin/dbstart $ORACLE_HOME &
        ;;
'stop')
        $ORACLE_HOME/bin/dbshut $ORACLE_HOME &
        ;;
*)
        echo "usage: $0 {start|stop}"
        exit
        ;;
esac

Step 3 : Change the group of the dbora file and set the permission 
[root@tech init.d]# chgrp dba dbora
[root@tech init.d]# chmod 750 dbora



Step 4 : Create symbolic links to the dbora 
Create symbolic links to the dbora script in the appropriate run-level script directories as follows.We need to add the appropriate symbolic links to cause the script to be executed when the system goes down, or comes up.

[root@tech init.d]# ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora
[root@tech init.d]# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
[root@tech init.d]# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora


Step 5 :  Test the scripts 
We can check the script by restarting the machine . Other alternative method  is

[root@tech init.d]#  /etc/init.d/dbora start (for startup)
[root@tech init.d]#  /etc/init.d/dbora stop  (for shutdown)

Above command will work same as we start the services in Window .


Enjoy      :-) 

Monday, March 12, 2012

Happy Birthday To Me


Today is my birthday , 13th March .  I will wish myself  a Very Very Happy Birthday To Me and may god fulfill  my wishes and dreams .
I am honor to say it was my year of Joy, Happiness great turn around and l thank God for all . He has in place for me in many years to come,am just so happy another new year is added to my new sweet life, Glory to God for everthing . He has done and more to do.

































Here is a nice Poem which is dedicated to myself .    :)

I'm not afraid of counting years;
Each year is a new myth exploded.
I'm not afraid of wrinkles and gray hair;
This body is how I navigate through the cosmos, so I try to love it and be
kind.
I'm not afraid of death; It is only the final myth to unravel. I'm not even afraid of the devil,
because it is our adversary who gives us life's most precious gifts. I'm
ftwenty years old and lost things are coming back:
Emails from long vanished friends
Bits of shattered faith discovered in between the cracks of the couch and
under the edges of the carpet that I'm piecing together into a mosaic New things
arrive every day too:
New poems
New stories spinning out of my brain
A new sense of my place in the old story
New meaning in the ancient struggle for justice Each year is a new crossroads.
 
    Happy birthday to me!!!!