Database Administration (MOSC)

MOSC Banner

Unable to connect to Oracle database on RHEL 4.2

edited Mar 1, 2011 9:29PM in Database Administration (MOSC) 2 commentsAnswered
 Hi,

I am trying to connect to the Oracle 10gr2 db instance from a script using the following cmd:-

/u01/app/oracle/oracle/product/10.2.0/db_1/bin/sqlplus sys/password AS SYSDBA<<EOF
!env | grep ORACLE
select 'RM_STATUS:'  || status as a from v\$instance;
disconnect;
exit;

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 2 06:37:14 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> ORACLE_SID=RMTEST
ORACLE_HOME=/u01/app/oracle/oracle/product/10.2.0/db_1

 SQL> select 'RM_STATUS:'  || status as a from v$instance
*
ERROR at line 1:
ORA-01034: ORACLE not available


 SQL> Disconnected

The ORACLE_HOME and ORACLE_SID are set correctly. I always end up getting connected to an idle instance even when the database is up and running:-

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center