Skip to Main Content

Breadcrumb

May 4th

Question and Answer

Tom Kyte

Thanks for the question, Tran Le.

Asked: August 30, 2001 - 9:42 pm UTC

Last updated: August 18, 2006 - 8:27 am UTC

Version: 8.1.7

Viewed 10K+ times! This question is

You Asked

Hi Tom,
I was install database oracle 8.1.7 for WinNT. The Database run well but after I restart my computer i must type command :
ORADIM -startup -SID mySID pfile=ORACLE_HOME\oradata=inimySID.ora'
to run svrmgrl.
Can you show me proceduce auto startup database( run SVRMGRL don't need to type "ORADIM -startup -SID mySID pfile=ORACLE_HOME\oradata=inimySID.ora") for each turn on or restart computer.

Thanks



and Tom said...

use oradim to set the autostart attribute

read
</code> http://docs.oracle.com/cd/A81042_01/DOC/nt.816/a73008/ch5.htm#1013701 <code>
for details

Rating

  (11 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Ajay, January 28, 2003 - 12:15 pm UTC

Well the link points to the read the complete manual from oracle. Simple you could suggest the chap my giving your suggestion which is not that lenghty.

Tom Kyte
January 28, 2003 - 2:58 pm UTC

Ajay -- get a grip or get a real browser.

when I click on it, it sort of takes me to:

...
Modifying an Instance

To modify an instance...

Use this syntax:

ORADIM -EDIT -SID SID [-NEWSID NEWSID] [-INTPWD INTERNAL_PWD]

[-STARTMODE AUTO | MANUAL][-PFILE FILENAME]
.........

which hey, is what you typed right below -- bravo ;)




Ajay, January 28, 2003 - 12:19 pm UTC

If you need to auto start the oracle database on server restart do specify -STARTMODE AUTO .
And do check under service if the startup is set to automatic.

Auto startup on Linux RH9?

Sikandar Hayat, September 02, 2003 - 1:03 pm UTC


I have installed Oracle 9i R2 on Linux RH9 but each time I have to startup database manually. What is the best way to do autostartup the database?

Tom Kyte
September 02, 2003 - 3:08 pm UTC

add to the /etc/rc3.d/S99local script something like:

su - c oracle orastart


and create an orastart script in your $ORACLE_HOME/bin that starts the db. I like that better then "dbstart" myself.

Your script

Sikandar Hayat, September 08, 2003 - 11:32 pm UTC


TOM as you know that I am new to Oracle on Linux so please let me know that why this technique is better than dbstart?

Tom Kyte
September 09, 2003 - 11:28 am UTC



because you control it completely, i just like it better personally. i never use dbstart/dbshut.

starting and stopping a database typically involves MORE then just the database. I use an "orastart" script to do whatever I need to have done -- eg:

"start listener,
start db,
start processes that need to be running when db is up"

with dbstart you get

start db


and that is all....

Not working

Sikandar Hayat, September 12, 2003 - 1:31 pm UTC


add to the /etc/rc3.d/S99local script something like:

su - c oracle orastart

I have used the above techniques but its not working.

$su -c oracle orastart
su: user orastart does not exist

if I use -l then it asks for passord but as the current use is already oracle so it should not ask for password. Also please paste your orastart script which will guide me as well.

Tom Kyte
September 12, 2003 - 2:15 pm UTC

umm, write orastart

it is just a script, you code it.

Oh no

Sikandar Hayat, September 12, 2003 - 11:37 pm UTC

Sorry Tom I thought that I have to code like dbstart which has many conditions so can't code like that.

Tom Kyte
September 13, 2003 - 9:03 am UTC

nope, orastart can be as easy as:


lsnrctl start
export ORACLE_SID=sid_name

sqlplus "/ as sysdba" <<EOF
startup
EOF

<any other things you want to run>



it need not be generic at all -- just put the commands you would normally "type" in there.

Re:su - c oracle orastart &#65311;maybe a mistake

Fenng, January 07, 2004 - 4:51 am UTC

#man su

then I got the following contents:
----------------------------------------------------
NAME
su - run a shell with substitute user and group IDs

SYNOPSIS
su [OPTION]... [-] [USER [ARG]...]

DESCRIPTION
Change the effective user id and group id to that of USER.

-, -l, --login
make the shell a login shell

-c, --commmand=COMMAND
pass a single COMMAND to the shell with -c

-f, --fast
pass -f to the shell (for csh or tcsh)

-m, --preserve-environment
do not reset environment variables

-p same as -m

-s, --shell=SHELL
run SHELL if /etc/shells allows it

--help display this help and exit

--version
output version information and exit

--------------------------------------------------

[root@Linux root]# su - c oracle Shutdown
su: user c does not exist
[root@Linux root]# su -c oracle Shutdown
su: user Shutdown does not exist
[root@Linux root]# su -c Shutdown oracle
bash: /root/.bashrc: Permission denied
bash: Shutdown: command not found
[root@Linux root]# su - oracle Shutdown

so ,it's working.....





Tom Kyte
January 07, 2004 - 8:01 am UTC

$ su - ora9ir2 -c ls

sorry, had the -c in the wrong place.




Need help on how dbstart utility

A reader, May 18, 2005 - 11:25 pm UTC

Tom i am facing problem with dbstart when i se this command it is giving canot find init file for database $oracle_sid
Database $oracle_sid not started but the startup and shutdown works fine with sqlplus / nolog conn / as sysdba

Tom Kyte
May 19, 2005 - 7:44 am UTC

I don't really use dbstart, but if the init.ora is not in the default location with the default name

$ORACLE_HOME/dbs/init$ORACLE_SID.ora

it'll not work.

auto stop

S Devarshi, August 18, 2006 - 5:32 am UTC

I have SCO Unix SVR5 7.1.1 and Oracle 8.1.7.0.0 . My script works right for start up but does not work for shutdown. The alert log file show ,thread recovery every time the oracle starts up.And no shut down Normal is shown.
My scipt in /etc/init.d is (file name oracle)
#!/bin/sh
case "$1" in
'start') su -c oracle8i orastart ;;
'stop') su -c oracle8i orastop ;;
esac

This is linked to a a file S99orastart in /etc/rc3.d directory.

If i execute the orastop in oracle8i it shutsdown the database . the script is as follows
#!/bin/csh
lsnrctl stop
svrmgrl<<EOF
connect internal
shutdown
exit
EOF

What could be wrong ?




Tom Kyte
August 18, 2006 - 8:27 am UTC

S stands for start
K for kill

so, do you have the "K" version?

thanks

s devarshi, August 23, 2006 - 4:50 am UTC

No I did not have one. I added one in /etc/rc0.d linking it to init.d file . That did the trick.
Devarshi




Additional info for dbstart

Rich Janson, September 05, 2006 - 2:20 pm UTC

Tom,

I know you don't care for the use of dbstart, but I came across the same issue as a reader above ("Can't find init file for Database"). I thought I would link to the solution I found if I may.

Basically dbstart only looks for your pfile, so if you are using spfiles, you will get this error. The fix comes from this site (the arcitle deals with Oracle 9i on Linux in particular, but I found the response helpful for me on AIX):
</code> http://www.dbspecialists.com/presentations/oracle920linux.html <code>

From the article:
Unfortunately, the dbstart script has a bug that will cause it to fail with the error message "Can't find init file for Database" in certain situations. One way to fix this bug is to add the following line immediately after line 55:

SPFILE=${ORACLE_HOME}/dbs/spfile${ORACLE_SID}.ora

and change line 117 to read:

if [ -f $PFILE -o -f $SPFILE ] ; then

You are basically making dbstart aware to look for spfiles as well as pfiles.