Link to home
Start Free TrialLog in
Avatar of Haidar1
Haidar1Flag for United Arab Emirates

asked on

Connecto to Remote Oracle Database from Client

Hi Expets

Pls I need your help...
I need to connec to remote oracle database from my local machine but I am getting the following error

From My local machine

C:> Set oracle_sid=epprod1
C:\> sqlplus /  as sysdba
ORA-12560: TNS:protocol adapter error

tnsanmes is fine and slqnet.ora is fine
since I can tnsping the service name and I am getting reply
as you can see from below log
C:\Documents and Settings\mhaidaradm>tnsping epprod

TNS Ping Utility for 64-bit Windows: Version 11.1.0.6.0 - Production on 04-OCT-2011 10:51:37

Copyright (c) 1997, 2007, Oracle.  All rights reserved.

Used parameter files:
D:\Product\bloodbank-local\product\11.1.0\db_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.5.23)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.5.24)(PORT =
1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = epprod)))
OK (10 msec)

C:\Documents and Settings\mhaidaradm>tnsping epprod1

TNS Ping Utility for 64-bit Windows: Version 11.1.0.6.0 - Production on 04-OCT-2011 10:51:40

Copyright (c) 1997, 2007, Oracle.  All rights reserved.

Used parameter files:
D:\Product\bloodbank-local\product\11.1.0\db_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.5.23)(PORT = 1521)) (CONNECT_DATA = (INSTANCE_NAME = epprod1) (SERVER = d
edicated) (SERVICE_NAME = epprod)))
OK (10 msec)

C:\Documents and Settings\mhaidaradm>tnsping epprod2

TNS Ping Utility for 64-bit Windows: Version 11.1.0.6.0 - Production on 04-OCT-2011 10:51:43

Copyright (c) 1997, 2007, Oracle.  All rights reserved.

Used parameter files:
D:\Product\bloodbank-local\product\11.1.0\db_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.5.22)(PORT = 1521)) (CONNECT_DATA = (INSTANCE_NAME = epprod2) (SERVER = d
edicated) (SERVICE_NAME = epprod)))
OK (20 msec)

Please I need help...
SOLUTION
Avatar of Ivo Stoykov
Ivo Stoykov
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Haidar1

ASKER

thanks Zaharin... its working ... But I did
Set Oracle_sid=epprod1

 ... whey I have to use @epprod1
Avatar of Haidar1

ASKER

Thanks to  ivostoykov

But I did
Set Oracle_sid=epprod1

 ... whey I have to use @epprod1
- either way should work haidar. you can set the oracle_sid environment variable separately or supply it in the sqlplus command itself.
Avatar of Haidar1

ASKER

Hi Zaharin

But I set the environment its not working....

do i need to do some configuration...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Haidar1

ASKER

I think I foud my mistake If you are in the server where db is reside you don’t need to specify the @ just set the environment
But if you are connecting remotely you need to specify the @
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

You can set a 'default' remote database and not use the '@' in the connection.

TWO_TASK in Unix
LOCAL on Windows
if you have more than one database it is not a good idea to use sqlplus /  as sysdba for you could mess databases

Ivo Stoykov