Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

starting Oracle db instance

Status
Not open for further replies.

tomecki24

Programmer
Jun 13, 2001
52
DE
Hello,

I've got a script for starting db instance on Solaris 7 startup. But there is an error in it. Could You tell if the script is ok?
Here it is:

#!/bin/ksh -
#script for Oracle
ORACLE_SID=myDB
export ORACLE_SID
su -o oracle -c svrmgrl <<EOF
connect internal
startup
EOF

Thanks
Tomasz
 
Here is mine and it works.

ORACLE_HOME=/u01/app/oracle/product/8.1.6; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
$ORACLE_HOME/bin/svrmgrl << command
connect internal
startup
exit;
command
 
If you're runing the script as the Oracle software owner, lweng's script will work, however, if the user you're running the script as is not a member of the dba group you'll get an access violation error from Oracle.
 
If you moved the initSID.ora file from its standard location ($ORACLE_HOME/dbs) and you do not specify the location of the file when you issue the startup, then you will get an error.
the syntax to specify the full access to initSID.ora is :

startup pfile=/path/initSID.ora.

Also when you do su - , the environment variable that you set prior are lost. If you do not want to loose the environment remove the &quot;-&quot; .
 
Hi,
I think you r running this script from root-id.The first two lines of your script will export the sid in the id from where u r running this script.So this script will open up a server manager session for the default Sid which is there in oracle-id.
So either u export the variable after u su to oracle or run this from oracle-id.
I hope this helps....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top