Is this a shell setting problem?

I have a question regarding shell settings. I have one Sun server with Solaris 9 and Oracle 10g R2 on it. DB is up running well. I created a script to start DB automatically when server reboot. It didn't work. I manually run dbstart under $ORACLE_HOME/bin, the server return message like:" dbstart: VER10LIST=10 is not an identifier". It seems this a shell problem. The shell couldn't identify this script. On this server, root user and oracle user all use bourne shell /bin/sh.

I ahve 2nd Sun box running Solaris 10 and Oracle 10g R2 too. I manually or automatically execut "dbstart" script under $ORACLE_HOME/bin and it works very well. On 2nd box, root user is bourne shell and oracle is Korn shell. dbstart script should be run by root user when system reboot. So what is the problem on 1st server and why dbstart couldn't be run on bourne shell? Please advise.

yes, this error means that somewhere in the script there is a line:

export VER10LIST=10

this syntax is not supported in bourne shell, it needs to be two distinct commands:
VER10LIST=10
and
export VER10LIST

having said that, if the shell script were correctly written the login shell for the user would not matter. The magic number would identify the interpreter, and if this was Korn(or bash or zsh) shell then problem would not arise.

Thanks for your advice. But I may not agree with you. Because the dbstart script is coming with Oracle 10g software, it is not created by me. On both saver, I used the same Oracle 10g R2 file to install database system. So the dbstart is the same script. On saver one, I login as oracle user first, then su -root user. I created the dbora script as root user and other group user. On 2nd saver, I can login as root user and root group user to create the same dbora script. In dbora script on saver one, 3 out of 4 agent scripts worked, only dbstart didn't work. In dbora script on saver two, 4 agent scripts all worked fine. This is where my problem is.

If login shell doesn't matter, I manually run dbstart script on saver one as $dbstart or $ $ORACLE_HOME/bin/dbstart, system all return 'VER10LIST=10 is not an identifier'. This is checking listener version. Oracle 10g db must use listener 10 to start database. It seems nothing to do with a line in script? If I am wrong, please comment more? Thanks.

You misunderstand. You sometimes have to correct scripts that come with products so they work in your environment - or you have to use a different default shell.

Correction add this to the top of the script that fails - you need to do

which ksh

in order to find the correct location of ksh:

#!/bin/ksh

or change the export statement.

Other choice: change the .profile in the login directory for the account. Use another shell that supports the syntax. Bourne is VERY antiquated and a lot of products assume that systems have modern shells.

The login shell of the user does matter if the scripts does not indicate on the first line what kind of shell it is supposed to run in.

So, if the script, as indicated, does contain a line like:

#!/bin/ksh

<rest of script>

the login shell does not matter.

However if this line is missing the login shell does matter.

Most likely this line is missing in your script.
On 1 system there will be a Born (sh) shell as login shell, where on the other there will be a Korn (ksh) or even Bash (bash) shell as login shell.

Thanks for each of you for your help. Two dbstart scripts on two saver are identical. They begin as:

:
#
# $Id: dbstart.sh.pp 11-May_2005 18:18:07 Vikrkuma Exp$
# rest of comments

There is no #!/bin/sh or #!/bin/ksh in the begining.
On saver one, I login as Bourne shell at path: /u01/app/oracle. On saver two, I login as Korn shell at path: /u01/app/oracle. Only differences are: I can manually execute dbstart at saver two and I can not execute manually dbstart on saver one. System will return "VER10LIST=10 is not an indetifier" from saver one. So how can I undrstand this. The same oracle-generated script and under different shell. But rember: dbstart is only used to start database when system reboot so it should be run by root user. In my two scripts that I used to execute dbstart script, I do put #!/bin/sh in the begining, Even saver two oracle user in under korn shell. My script still worked fine. Saver one root user and oracle user are all under bourne shell, it seems that #!/bin/sh should work. But the fact is that it didn't work. Please give me more tips. Thanks.

Since the script doesn't contain a line at the beginning stating the shell to run in, it will run on server 1 within a Born shell and on server 2 within in a Korn shell.

As mentioned before the script will contain a line:
export VER10LIST=10

In a Korn shell this is a valid statement, however not in a Born shell.

Either change the login shell on server 1 to a Korn shell or put the following line at the beginning of the scripts:

#!<path where ksh is located>/ksh

sb008:

You are so good to identify the problem. Thanks so much. I will try your way and return to report the result.

Here is the report:

The major reason is that UNIX admin didn't configure shell correctly. Then we reconfigure it to Korne shell and modified oracle's scripts. Then VER10LIST=10 never come out as you pointed out that korn shell would accept that. Thanks for your help.