Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: OCI prg on Solaris boot failure

Re: OCI prg on Solaris boot failure

From: Joel R. Kallman <jkallman_at_us.oracle.com>
Date: Tue, 19 May 1998 15:22:00 GMT
Message-ID: <3561a1a5.5962463@newshost.us.oracle.com>


Hopefully the solution to your problem is as easy as I think it is.

I suspect that your OCI program is failing because your environment is not set properly. Remember that the startup scripts on Solaris are running as the "root" user. If you wish to execute a script as another user, you need to become another user via the "su" command. You also want to make sure that you execute su with the first argument as a '-' (see below for why). From my startup script for Oracle on Solaris:

    case "$1" in

	'start')
        su - oracle8 -c orastart
        ;;
	'stop')
        su - oracle -c orastop
        ;;

    esac

From the man page for "su":

     If the first argument to su is a ' - '  (dash),  the
     environment  is passed along unchanged, as if the user actu-
     ally logged  in  as  the  specified  user.   Otherwise,  the
     environment  is  passed  along, with the exception of $PATH,
     which is controlled by PATH and SUPATH in etc/default/su.


I suspect that when you are executing your S99script manually, that you are not doing it as the "root" user, but probably some other user (most likely, "oracle") whose environment is correctly set. Some of the environment variables that will be set are ORACLE_HOME, ORACLE_SID, etc.

Hope this helps.

On Tue, 19 May 1998 10:30:40 +0200, Mauro Macchi <mmacchi_at_ais.it> wrote:

>Hello everybody,
>
>I have a problem running an OCI program (Oracle 7.3) on Solaris 2.5.1 at
>boot time.
>I am trying to run the program from within a shell script in /etc/rc2.d
>directory,
>which gets executed after the oracle boot sequence.
>I am catching an error in the olog() routine, whatever delay I use into
>the script
>in order to be sure that oracle processes are up and running.
>BUT, if I run the same script (say 'S99script start') from an xterm,
>everything
>works fine. The only difference I see between the two runs is that in
>the second case
>the process has an associated terminal (the pts of the shell running
>into the xterm)
>while in the first case (at boot time) no terminal is associated to the
>process.
>I tried to redirect /dev/console as input file for the script and the
>process, but
>nothing changes. I also tried to execute from inittab, possibly applying
>the same
>redirections, but still nothing changes.
>
>Does anybody knows if the problem I am experiencing really depends on
>the missing
>terminal assignment to the process ?
>Does anybody knows a technique to startup an OCI program at boot time so
>that it works?
>
>Any help will be warmly appreciated, thanks a lot for the attention
>
> Mauro

Thanks!

Joel

Joel R. Kallman Oracle Government, Education, & Health

Columbus, OH                             http://govt.us.oracle.com

jkallman@us.oracle.com                   http://www.oracle.com




The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation. Received on Tue May 19 1998 - 10:22:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US