0
votes

I enter this command in windows7 for connect to Oracle database on windows server 2008:

 sqlplus 'user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=hostname.network)(Port=1521))(CONNECT_DATA=(SID=remote_SID)))'

but it raise this error:

error: ORA-12560: TNS: protocol adapter error.

I googled and all I find is about check oracle services is started in windows server 2008.
I checked and all oracle services are started.
what should I do?

2

2 Answers

0
votes


Did you check the below things
1. Can you ping from win 7 machine to Server? If Yes
2. Check firewall of server. Make disable and test.
3. If doesn't work then, check listener service.
You can check it by simply creating tns and ping it.
tnsping tnsname
If all fine, then please share version info and above result to me. Hope it will be solve. Thanks.

0
votes

You should not have the single quotes; they are making the whole string be interpreted as the username, so it will probably prompt for a password and then get the ORA-12560 error.

sqlplus user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=hostname.network)(Port=1521))(CONNECT_DATA=(SID=remote_SID)))

or you can still put just the connection description in quotes:

sqlplus user/pass@'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=hostname.network)(Port=1521))(CONNECT_DATA=(SID=remote_SID)))'

or if you know the service name (which may or may not be the same as the SID) you can use easy connect syntax:

sqlplus user/pass@//hostname.network:1521/remote_service_name

Even the default port can be omitted, but I prefer to see it.

Read more.