Connecting to a remote Oracle database

Solved
BidiBidouille Posted messages 37 Status Member -  
 BidiBidouille -
Hello,

Configuration: Windows 7 / Windows Server 2008 R2

I can no longer connect from my machine to an Oracle database on my server. It worked last week. Since then, the Zyxel router has been relegated to the role of simple modem (acting as a bridge) and a new router (Netgear) has been installed.

I can ping the server and the Oracle database is accessible from the server as well. However, a tnsping on the server does not succeed:

C:\Users\Administrator>tnsping DYNAXIS-SRV

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on JUL-19-2012 11:46:00

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

Parameter files used:
C:\appli\Oracle\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

EZCONNECT adapter used for alias resolution
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=fe80::3ca1:e1f8:52c8:3a55%17)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.33)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=fdc9:e1b8:7137:143c::1)(PORT=1521)))
TNS-12560: TNS: protocol adapter error

The first IPv6 address (fe80...) corresponds to the server's link-local address (I don't know what that is) and the second (fdc9...) corresponds to the server's 'normal' IPv6 address.

Could someone tell me what the problem is? Any leads? Could the new router be blocking some traffic (everything else seems to be working fine)?

For your information:

tnsnames.ora:
...
ORCL_DYN =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DYNAXIS-SRV)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

sqlnet.ora:
SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

listener.ora:

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\appli\Oracle\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\appli\Oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = DYN-YBI-PC)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = DYNAXIS-SRV)(PORT = 1521))
)
)

ADR_BASE_LISTENER = C:\appli\Oracle

10 answers

DROE Posted messages 148 Registration date   Status Member Last intervention   48
 
Hello,

When we have this type of error generally on Oracle, it's a problem of undefined environment variables
ORACLE_HOME + ORACLE_SID

What I notice is that the tnsping should be done on ORCL_DYN and not on DYNAXIS-SRV.

What does the command
TNSPING ORCL_DYN
return?
DROE
--
Experience is the name everyone gives to their mistakes.
0
BidiBidouille Posted messages 37 Status Member 1
 
Thank you for your help, DROE!

Damn, for the tnsping! I was sure I was doing it right... I tried again:

C:\Users\Administrator>tnsping ORCL_DYN

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 20-JUL.
-2012 11:56:14

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

Parameter files used:
C:\appli\Oracle\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

TNSNAMES adapter used for alias resolution
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = DYNAXIS-SRV)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl))
)
TNS-12560: TNS: protocol adapter error

Now, as for the environment variables, I’m a bit confused, because it was working before.

My ORACLE_SID variable is 'orcl3' (a database that is on my machine). Should I change it to 'orcl'? Do I need to understand that this variable must be modified each time I want to work on a new database? Do I need to specify the name of the database that is on the server, or is it sufficient to update the ORACLE_SID on the server itself?

As for my ORACLE_HOME variable, it had no value! I set it to the folder name where the 'admin', 'oradata', 'product', 'diag', 'flash_recovery_area' folders are located (C:\appli\Oracle)... is that correct, or should it be something like: C:\appli\Oracle\product\11.2.0\dbhome_1?

On the server, both variables did not exist, so I created them.... but I didn't notice any improvements... Any idea? Did I make a mistake?

Thank you :)
0
DROE Posted messages 148 Registration date   Status Member Last intervention   48
 
It's not going to be easy with your story :)
If you say it worked before and now it doesn't, something in the configuration or environment has changed.

Is it a lab or a production database?

Have you checked the alert and trace files of the listener for error messages?
Have you considered stopping and restarting the listener on the server?

DROE

Experience is the name everyone gives to their mistakes.
0
BidiBidouille Posted messages 37 Status Member 1
 
No, my questions are never easy! (otherwise, normally, I manage on my own ;) )

What has changed, as I mentioned above, is that we installed a new router because the Zyxel (our modem that now acts as a bridge) was doing a poor job.

This is a lab setup, not production.

I haven't found any listener.log files. Which file are you referring to exactly?
I found a sqlnet.log file (in D:\APPLI\ORA11\product\11.2.0\dbhome_1\NETWORK\log), but that doesn't seem to be it:

Fatal NI connect error 12528, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DYNAXIS-SRV)(PORT=1521))(CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=D:\APPLI\ORA11\product\11.2.0\dbhome_1\bin\emagent.exe)(HOST=DYNAXIS-SRV)(USER=System))))

VERSION INFORMATION:
TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 64-bit Windows: Version 11.2.0.3.0 - Production
Time: 20-JUNE-2012 16:30:29
Tracing not turned on.
Tns error struct:
ns main err code: 12564
TNS-12564: TNS: connection refused
ns secondary err code: 0
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0

IPv6 is already disabled on the router: 'The default setting is "Disabled", which turns off the IPv6 function.'

But can you confirm that I have correctly filled in the ORACLE_HOME and ORACLE_SID variables?
0
DROE Posted messages 148 Registration date   Status Member Last intervention   48
 
Delete the variables you created on the server, they won't be of any use for this problem. (oracle_home= C:\appli\Oracle\product\11.2.0\dbhome_1)
Your issue to resolve on the forum is complex, there are so many parameters to consider and test for diagnosis.
Since the equipment change, have the server and your PC been restarted?
0
BidiBidouille Posted messages 37 Status Member 1
 
Strange, your message is different from the one I received by email.

Okay, I've changed my variables. But I'm still not sure about the SID I need to put on my machine. Just to be safe, I put orcl (the database on the server).

I know it's complicated...

The server hasn't been restarted, has it... I didn't even think of that :/ I'm going to do that.

In the meantime, the lsnrctl start and stop commands don't work on my machine... Apparently, there is no listener process. I looked at the list of services, and the OracleOraDb11g_home1TNSListener is not started and doesn't want to start. When I try, a message informs me that it has started and then stopped automatically because it is not used by other services.

But does the listener on my machine really need to be running? After all, the database I'm interested in is on the server...
0
DROE Posted messages 148 Registration date   Status Member Last intervention   48
 
Different message as it has been reissued, what I suggested with the ports was not correct.

Yes, the lsnrctl stop and lsnrctl start must be done on the server.
Do a lsnrctl status and copy-paste it

Otherwise, copy-paste here:
- the listener.ora from the server
- the sqlnet.ora from the server

- the tnsnames.ora from your PC
- the sqlnet.ora from your PC

--
Experience is the name everyone gives to their mistakes.
0
BidiBidouille Posted messages 37 Status Member 1
 
Alright. I then set the same ports (1521) everywhere. I also restarted both machines: no changes.

C:\Windows\system32>lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.2.0.3.0 - Production on 20-JUL-2012 17:
11:48

Copyright (c) 1991, 2011, Oracle. All rights reserved.

Connection to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
LISTENER PROCESS STATUS
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 11.2.0.3.0 - Produ
ction
Start date 20-JUL-2012 16:48:48
Uptime 0 days 0 hours 23 min. 0 sec
Tracing level off
Security ON: Local OS Authentication
SNMP OFF
Listener parameter file D:\APPLI\ORA11\product\11.2.0\db
home_1\network\admin\listener.ora
Listener log file D:\APPLI\ORA11\diag\tnslsnr\DYNAXIS-SRV\listener\alert\log.xml
Listener endpoint summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DYNAXIS-SRV)(PORT=1521)))
Service summary...
The service "CLRExtProc" has 1 instance(s).
The instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
The service "orcl" has 1 instance(s).
The instance "orcl", status READY, has 1 handler(s) for this service...

The service "orclXDB" has 1 instance(s).
The instance "orcl", status READY, has 1 handler(s) for this service...

The command was successful

I looked at the file D:\APPLI\ORA11\diag\tnslsnr\DYNAXIS-SRV\listener\alert\log.xml, but it's quite unintelligible.

Here are my files:

listener from the server:

# listener.ora Network Configuration File: D:\APPLI\ORA11\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\APPLI\ORA11\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\APPLI\ORA11\product\11.2.0\dbhome_1\bin\oraclr11.dll" )
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = DYNAXIS-SRV)(PORT = 1521))
)
)

ADR_BASE_LISTENER = D:\APPLI\ORA11

sqlnet from the server:
# sqlnet.ora Network Configuration File: D:\APPLI\ORA11\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file won't exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

tnsname from my machine:
# tnsnames.ora Network Configuration File: C:\appli\Oracle\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)

ORCL3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DYN-YBI-PC)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl3)
)
)

ORCL_DYN =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DYNAXIS-SRV)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

sqlnet from my machine:
# sqlnet.ora Network Configuration File: C:\appli\Oracle\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file won't exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
0
A.Nonymous
 
Does a telnet connection succeed?
telnet <server.ip> 1521

Then, since the .ora contains aliases and not IPs:
telnet <server-alias> 1521
0
BidiBidouille Posted messages 37 Status Member 1
 
I had to enable the telnet command beforehand. On my machine, I did:
pkgmgr.exe /iu:TelnetClient
and on the server, I did:
pkgmgr.exe /iu:TelnetServer

I hope that's correct because the command didn't work :/

C:\Users\Administrator>telnet DYNAXIS-SRV 1521
Connecting to DYNAXIS-SRV...Unable to open a connection to the host, on port 1521: Connection failed

C:\Users\Administrator>telnet 192.168.1.33 1521
Connecting to 192.168.1.33...Unable to open a connection to the host, on port 1521: Connection failed

Does that mean that port 1521 on the server is not responding?
0
A.Nonymous
 
It was not necessary to install a ServerTelnet: the telnet client is a very basic TCP client.
telnet google.fr 80
Means opening a connection on port 80 of google.fr, just like an HTTP browser would do.

So if Telnet has failed, either port 1521 is not reachable (firewall? port filtering? IP filtering?), or the server itself is no longer reachable.

A ping test could give a better idea:
ping <server-ip>
ping <server-alias>

If one of the pings succeeds, it means that a firewall is blocking the connection on port 1521. If both fail, we won’t be any further ahead.
0
BidiBidouille
 
Pings are going through without any issues... I've already checked the new router, which doesn't seem to have any particular restrictions. After that, it might be due to the modem (the Linksys router acting as a bridge), but that would still be quite surprising. As for the server itself, it allowed me to connect to port 1521 two weeks ago... I'll check if I can verify whether port 1521 is not blocked...
If, from the server, the command 'telnet google.fr 1521' fails, it means the port is blocked from the server, right?
0
A.Nonymous
 
Doing a ""telnet google.fr 1521" won't help you much :)
It's unlikely that port 1521 of 'google.fr is open and listening ;)

If the ping worked, you should try a TCP connection on a port other than 1521. Is there not an HTTP server on it, an SSH server or even an FTP server?
If there's a firewall configured for standard web use, it should allow connections to such services.
0
BidiBidouille
 
Ok! I went on the server and created a rule to accept TCP input and output on port 1521. And it works! However, I don't understand why it was working two weeks ago and not last week... I need to review the other rules.

In any case, thanks a lot to DROE and A.Nonymous for their help! :) Really, thank you very much!
0
BidiBidouille
 
For posterity, I specify that the issue was not a change in connection rules on the server, but rather a change in domain (public/business/private). The networks had been defined as public, and that prompted the server to guard against certain connections (if I understood correctly).
0