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

Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-01034 and ORA-01034, if starting oracle from script

Re: ORA-01034 and ORA-01034, if starting oracle from script

From: Ed Stevens <nospam_at_noway.nohow>
Date: Wed, 07 Jul 2004 13:59:47 -0500
Message-ID: <rehoe0tshrt5q1ri4ph96rn096fvletdcu@4ax.com>


On 7 Jul 2004 08:01:35 -0700, chico_at_grumly.info (cyril) wrote:

>Hi,
>
>I am building a cluster with oracle. My cluster (Redhat cluster suite)
>needs scripts in order to start and stop oracle.
>
>My problem is these 2 errors when I'm trying to stop my oracle service
>(if I call the stopdb script from a shell):
>ORA-01034: ORACLE not available
>ORA-01034: shared memory realm does not exist
>
>My environment variable are correctly set. I'm really searching from a
>long time witout succes. (But I'm a newbie in oracle).
>
>An other thing I have tried :
>Start the database from my script (as oracle user). Start sqlplus and
>try to stop the database (shutdown). I Still got the same errors.
>
>I'm working with Oracle 9.2 on RedHat ES 3.
>
>Thanks a lot.
>
>PS : Here I give you my scripts (from the redhat documentation :
>http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/cluster-suite/ch-db-service.html#S1-SERVICE-ORACLE)
>
>------------- Start the database ---------------
>#!/bin/sh
>#
>
>#
># Script to start the Oracle Database Server instance.
>#
>########################################################################
>#
># ORACLE_RELEASE
>#
># Specifies the Oracle product release.
>#
>########################################################################
>
>ORACLE_RELEASE=9.2.0
>
>########################################################################
>#
># ORACLE_SID
>#
># Specifies the Oracle system identifier or "sid", which is the name
>of
># the Oracle Server instance.
>#
>########################################################################
>
>export ORACLE_SID=TEST
>
>########################################################################
>#
># ORACLE_BASE
>#
># Specifies the directory at the top of the Oracle software product
>and
># administrative file structure.
>#
>########################################################################
>
>export ORACLE_BASE=/u01/app/oracle
>
>########################################################################
>#
># ORACLE_HOME
>#
># Specifies the directory containing the software for a given release.
># The Oracle recommended value is $ORACLE_BASE/product/<release>
>#
>########################################################################
>
>export ORACLE_HOME=/u01/app/oracle/product/${ORACLE_RELEASE}
>
>########################################################################
>#
># LD_LIBRARY_PATH
>#
># Required when using Oracle products that use shared libraries.
>#
>########################################################################
>
>export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:$LD_LIBRARY_PATH
>
>########################################################################
>#
># PATH
>#
># Verify that the users search path includes $ORACLE_HOME/bin
>#
>########################################################################
>
>export PATH=$PATH:${ORACLE_HOME}/bin
>
>########################################################################
>#
># This does the actual work.
>#
># Start the Oracle Server instance based on the initSID.ora
># initialization parameters file specified.
>#
>########################################################################
>
>/u01/app/oracle/product/9.2.0/bin/sqlplus << EOF
>sys as sysdba
>spool /home/oracle/startdb.log
>startup pfile = /u01/app/oracle/product/9.2.0/admin/test/scripts/init.ora
>open;
>spool off
>quit;
>EOF
>
>exit
>
>------------------------ Stop the database ---------------
>
>#!/bin/sh
>#
>#
># Script to STOP the Oracle Database Server instance.
>#
>######################################################################
>#
># ORACLE_RELEASE
>#
># Specifies the Oracle product release.
>#
>######################################################################
>
>ORACLE_RELEASE=9.2.0
>
>######################################################################
>#
># ORACLE_SID
>#
># Specifies the Oracle system identifier or "sid", which is the name
># of the Oracle Server instance.
>#
>######################################################################
>
>export ORACLE_SID=TEST
>
>######################################################################
>#
># ORACLE_BASE
>#
># Specifies the directory at the top of the Oracle software product
># and administrative file structure.
>#
>######################################################################
>
>export ORACLE_BASE=/u01/app/oracle
>
>######################################################################
>#
># ORACLE_HOME
>#
># Specifies the directory containing the software for a given release.
># The Oracle recommended value is $ORACLE_BASE/product/<release>
>#
>######################################################################
>
>export ORACLE_HOME=/u01/app/oracle/product/${ORACLE_RELEASE}
>
>######################################################################
>#
># LD_LIBRARY_PATH
>#
># Required when using Oracle products that use shared libraries.
>#
>######################################################################
>
>export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:$LD_LIBRARY_PATH
>
>######################################################################
>#
># PATH
>#
># Verify that the users search path includes $ORACLE_HOME/bin
>#
>######################################################################
>
>export PATH=$PATH:${ORACLE_HOME}/bin
>
>######################################################################
>#
># This does the actual work.
>#
># STOP the Oracle Server instance in a tidy fashion.
>#
>######################################################################
>
>/u01/app/oracle/product/9.2.0/bin/sqlplus << EOF
>sys as sysdba
>spool /home/oracle/stopdb.log
>shutdown abort;
>spool off
>quit;
>EOF
>
>exit

What are you seeing in your spooled files? The "ORA-01034: ORACLE not available" means the database isn't started. And since your scripts have so many errors, it's guaranteed you'll never get the db started with them. Your spool files should reveal some fundamental problems.

First, you have to connect to the instance, and neither your start or stop scripts issues a 'connect' command. The string 'sys as sysdba' is an argument of the 'connect' command, but you've never said to connect.

Second, what is the purpose of the 'open;' command in your startup script? If startup works, the database is open -- assuming no specific arguments to the contrary.

And on your shutdown script, why are you doing a 'shutdown abort'? While a shutdown abort is recoverable and not to be feared of itself, I'd hardly call that a 'tidy' shutdown. Received on Wed Jul 07 2004 - 13:59:47 CDT

Original text of this message

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