Sunday, January 4, 2009

automatic startup and shutdown the database

AUTOMATIC STARTUP AND SHUTDOWN THE DATABASE

1. Inorder to schedule the automatic stratup and schedule we use crontab utility.
2. cron is a utility that allows tasks to be automatically run in the background at regular intervals. These tasks are often termed as cron jobs in unix.
Crontab is used to assign jobs at particular at a particular time and data specified by a user.
3. A crontab file has five fields for specifying day , date and timefollowed by the command to be run at that interval.

Steps to startup the database automatically
To startup the database automatically at a particular time the following steps need to be done:
1. In the bin directory of a user i.e., in the ORACLE_HOME/bin we find script to start and shut the database(dbstart and dbshut).
2. Just open the crontab and add the following lines
For example we want to start the database at 3:35P.M of August on Saturday.
3. Open crontab file and add following data
$crontab –e
A crontab file consists of lines of six fields each.The fields are separated by spaces or tabs. The first five are integers consists of above data which are specified in step 3.


Eg: 35 15 2 8 6 /d01/mt/ora9i/9.2.0.4/bin/dbstart
4. Save and exit
5. For checking the contents of a file type crontab –l
6. Go to root user, edit the oratab file and restart the service as

# service crond restart

If you specified your email id, contrab will mail you the information about the job and process that have taken place.

No comments:

Post a Comment