![]() |
|
Shell ScriptDatabase Startup |
|
Simple database startup script. Gets the ORACLE_HOME from /etc/oratab. This script is a must since the Oracle supplied dbstart and dbstop do NOT work with Oracle 7.3 and above.
$1 - ORACLE_SID of the database to startup.
REM Copyright (C) Think Forward.com 1998- 2005. All rights reserved.
#!/bin/ksh DATABASE=$1 # Check that we have a database if [ -z "${DATABASE}" ] then echo echo "No Database Specified !" echo echo "Usage : ora_start.ksh" echo echo "where ORACLE_SID (Mandatory) - SID of database to start" echo echo " e.g. $ ora_start.ksh PROD" echo exit 1 fi # Get the ORACLE_HOME from the oratab file ORACLE_HOME=`cat /etc/oratab | grep $DATABASE | awk -F: '{print $2}'` if [ ! -d "${ORACLE_HOME}" ] then echo echo "$ORACLE_HOME does not exist !" echo exit 1 fi ORACLE_SID=$DATABASE export ORACLE_SID PATH=.:$ORACLE_HOME/bin:$PATH; export PATH # See if we can find svrmgrl, if not use sqldba instead if [ -x "${ORACLE_HOME}/bin/svrmgrl" ] then SVR="svrmgrl" else SVR="sqldba lmode=y" fi echo " " echo "Starting the Database" $DATABASE echo " " $SVR << EOF connect internal startup EOF exit 0
Return to Index of SQL Scripts
General Information :
Home | Company Profile
| Contact Us | Legal
Database Support :
Proactive Support
|
Pay Per Incident Support
Expert Services :
High Availability
|
Creative Solutions
|
Training
Build Services :
Oracle Installations
|
Revive your Oracle Setup
|
Low Cost Development
Free Oracle Resources:
DBA Scripts
|
Oracle Links