Home » Infrastructure » Linux » Sqlplus connecting to database of different oracle home (11g, 11.2.0.1, red hat 5.9)
Sqlplus connecting to database of different oracle home [message #628787] Fri, 28 November 2014 07:48 Go to next message
ashishkumarmahanta80
Messages: 231
Registered: October 2006
Location: kolkatta
Senior Member
Dear All,

My testing database is in linus server of having 32 bit OS. I am trying to connect to the database with the exported ORACLE_HOME but it's connecting to another one.

Here, I want to upgrade 11.2.0.1 database "TEST" to 11.2.0.3.

bash-3.2$ export ORACLE_HOME=/usr[b]/11.2.0.3[/b]/db_home1
bash-3.2$ export ORACLE_SID=TEST
bash-3.2$ export PATH=$PATH:$ORACLE_HOME/bin
bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release [b]11.2.0.1.0[/b] Production on Fri Nov 28 19:00:13 2014

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

Connected to an idle instance.

SQL>


bash-3.2$ ps -ef|grep pmon
oracle    3691     1  0 18:03 ?        00:00:00 ora_pmon_TEST
oracle    6272 26741  0 18:57 pts/2    00:00:00 grep pmon


Please assist me to know, why it is taking previous database path?

Regards,
Ashish
Re: Sqlplus connecting to database of different oracle home [message #628789 is a reply to message #628787] Fri, 28 November 2014 08:09 Go to previous messageGo to next message
EdStevens
Messages: 1339
Registered: September 2013
Senior Member
You are adding the newly set ORACLE_HOME/bin to the tail-end of your PATH. What references are in the existing PATH that come ahead of it?

Instead of

export PATH=$PATH:$ORACLE_HOME/bin

try

export PATH=$ORACLE_HOME/bin:$PATH
Re: Sqlplus connecting to database of different oracle home [message #628996 is a reply to message #628789] Tue, 02 December 2014 00:21 Go to previous message
ashishkumarmahanta80
Messages: 231
Registered: October 2006
Location: kolkatta
Senior Member
Dear EdStevens,

I tried what you suggested. Unable to connect to 11.2.0.3 database. Please check my below steps. If need any correction then please revert.

-bash-3.2$ export ORACLE_SID=TEST
-bash-3.2$ echo $ORACLE_HOME
/usr/11.2.0.3/db_home1
-bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 2 11:42:59 2014

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

Connected to an idle instance.

SQL> exit
Disconnected
-bash-3.2$ export PATH=$ORACLE_HOME/bin:$PATH
-bash-3.2$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 2 11:43:33 2014

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

Connected to an idle instance.

SQL> exit
Disconnected
-bash-3.2$ echo $PATH
/usr/11.2.0.3/db_home1/bin:.:/usr/local/java/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin:/usr/11.2.0.3/db_home1/bin:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin:/u01/app/common/oracle/bin
-bash-3.2$


Thanks,
Ashish Kumar Mahanta
Previous Topic: Oracle linux
Next Topic: Permission denied error occur during the installation of database
Goto Forum:
  


Current Time: Fri Sep 17 15:06:55 CDT 2021