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: Different connect strings needed for RMAN and sqlplus?

Re: Different connect strings needed for RMAN and sqlplus?

From: hpuxrac <johnbhurley_at_sbcglobal.net>
Date: 5 Dec 2006 06:34:06 -0800
Message-ID: <1165329246.411147.26160@f1g2000cwa.googlegroups.com>

Andy Kent wrote:
> Sorry, it does in fact execute 'sqlplus "sys/password_at_targbox as
> sysdba" '. What I can't understand is why that should cause the
> shutdown / startup not to complete cleanly, as though an incorrect
> environment is getting picked up, whereas doing it with both 'sqlplus /
> as sysdba' and through rman with the full connect string works fine.

Why don't you dot in the correct set of environment variables before attempting your connection.

Something like ...

#!/bin/ksh
. /whatever_place/directory/correct_env_vars.sh sqlplus /nolog << EOF
connect info ...

If you export the ORACLE_SID in the correct_env_vars.sh script that you want and are running in the dba group you can avoid containing a password.

>
> The root of the problem probably lies in having old, untidy DBA scripts
> on a box with multiple databases and Oracle versions installed. I am as
> surprised that the rman method *does* work than that the first sqlplus
> one *doesn't*! What I am trying to understand better is what kind of
> inherent differences there are in the three methods being tried as to
> how the connection gets established. I hope that makes some sense!
>

That's a strong argument for dotting in and supplying exactly the environment that you need to run. Often an approach is used that dot's in a file that is actually a symbolic link. Then you can change the contents of that "dotted in" file instead of making script changes. Received on Tue Dec 05 2006 - 08:34:06 CST

Original text of this message

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