We are using Windows 2012 R2 and Oracle 12.1.0.2. Database are in a GRID cluster but this won't affect our problem.
We just wanted to connect to a database from a "company A" network to a "company B" (which host the dbs) network and we are getting an error: IO error: network adapter could not establish the connection (sqldev output)
We opened network connection (input/output) on listener port 1521 on company A and B firewall.
And we can see connection trace on company B firewall.
We don't see anything on listener.log but i m not sure about information I should look for in this file (because i wont see the public AND final IP address of company A).
With this type of connection, is there any special parameter to set on the database/listener... side?
For information, in the KEY_Ora_GI12Home1 Windows registry (for both server) we created a new key called USE_SHARED_SOCKET with value "TRUE".
Related
I'm trying to connect to Oracle database hosted in a Linux Virtual Machine, using SQL Developer. Any leads on how to go about it?
I tried connecting using the IP address as HostName. But doesn't work.
In SQL Developer, create a new connection using the following
Connection Name:
Username: The username you use to log into the database
Password:
Hostname: The IP address of the virtual machine
Port: 1521
SID: The Oracle SID of the database you want to connect to
Status : Failure -Test failed: IO Error: The Network Adapter could not
establish the connection (CONNECTION_ID)
This error is almost always caused by a firewall. Make sure the local firewall on the database VM has opened the port 1521 for external connections. It can also sometimes be caused by anti-virus software on the client, preventing outgoing connections that haven't been whitelisted, but this is less common.
I make a connection for connect to the Database Server (other machine).
Then I found "An error was encountered performing the requested operation:
IO Error: The Network Adapter could not establish the connection
Vendor code 17002".
Please look the picture in URL below.
I tried to make a connection but can't access but my team can access it.
My friend used TNS connection type and I did everthing similar him but can't access. I tried to use JDBC thin for connect but can't also.
I had the old connection which I can connect but why I can't connect the new connection.
You're trying to connect to a machine on a network that SQL Developer is unable to reach.
For a TNS connection,
Look at the appropriate TNSNames entry (you will have a tnsnames.ora) file, and find the IP address or network name associated with the connection you're trying to establish -
And then start by trying to ping that resource.
In this case, i'm trying to talk to a database on MY machine, on port 1521. Yours should look quite different.
If you're using a basic connection, then you can look at the connection properties and see what machine/port you're trying to communicate with.
Ping
If you can't reach that machine from your machine, there's zero chance you can connect to a database there.
So, always start with a ping.
Once you see that you can get to that machine, if you're still getting that message, the next thing to think about is blocked ports, the listener defaults to port 1521, but you'll see that in the TNS descriptor as well.
It usually happens when a another process is running on the same port or there is an absence of listener.
Go to Run>services.msc>OracleXETNSListener>Start
Try to reconnect.. Even if the error still prevail then go to cmd
Use code:
npx kill-port <portnumber>
The port number by default is 1521, but you can check the port number in database properties.
It is possible, that your connection is forbidden by the firewall -
go to Control Panel\System and Security\Windows Defender Firewall - Advanced - Outbound Rules - Add a rule. (If you have some antivirus firewall, add rules there)
Create a temporary TCP rule for your port and another rule for UDP. Allow all nets and comps.
Check the telnet connection as cmd -> telnet ->
open remote.host.address PortNumber
If you can connect now, then the problem IS in firewall - edit your new rules, setting the hosts and nets exactly.
This error is because your sqldeveloper is not able to reach the database server's sql service.
One reason could be lsnrctl is down for some reason.
If you have access to machine where database is installed.
In Windows machine, follow: https://www.youtube.com/watch?v=r9pHqOfV2f0&ab_channel=TLinaTutorials
In Linux/macOS machine: Go to $ORACLE_HOME/bin and check status of lsnrctl
execute from $ORACLE_HOME/bin lsnrctl status, if it's down. Then restart it by lsnrctl start.
Check the details of connection in command output like SID, PORT, HOST etc. and try connecting again from sqldeveloper.
following scenario with a firewall inbetween this PCs:
Client PC
IP 10.10.140.100
Subnet 255.255.0.0
Gateway: 10.10.0.254
Server PC
IP 10.40.140.100
Subnet 255.255.0.0
Gateway: 10.140.255.254
The communication itself is already working (ping, using a WebClient) so don't worry too much about that.
I'm facing a connection problem connecting to a named instance (in this case "WINCC") from the Client PC to the Server PC(SQL Server 2008 R2) using the following connection string in the application (Database name is correct, have checked that!):
strserver = "10.40.140.100"
strConnectionString = "Provider=SQLNCLI10.1;Integrated Security=SSPI; Persist Security Info=False;Initial Catalog=" & Database & ";Data Source=" & strServer & "\WINCC"
Circumstances:
Microsoft SQL Server 2008 Native Client is installed on the Client PC
The windows user used on the Client PC is existing on the Server PC and part of the necessary User Group (in this case SIMATIC HMI Group because of WinCC)
I have looked up the dynamic port used by the sql server which is 49181 and the port was opened in the firewall of the network
This has worked in every other network environment till now but something is still somehow blocking the access in the network
The script is crashing with the following error:
"SQL Server Network Interfaces: Error locating Server/Instance Specified [xFFFFFFFF]" when attempting to establish the connection to the database (.Open command).
I'm 99% sure it has to do something with a port not opened. I have seen several times that the UDP Port 1434 of the Sql Browser service has to be open for . Is this also relevant when using the SQL NAtive Client Provider? Or should I try to name the port specifically in the connection string? (Like "10.40.140.100,49181/WINCC"?)
Any comment is appreciated, thanks!
Best regards,
CMSPaul
Using a Dynamic port can often cause issues. If you have an App server connecting to the SQL server inside your network I would suggest using a Static IP on the SQL server and then route it through the firewall as defined. Also as you said I would define the TCP/IP port in your connection string.
This would be set up in SQL Server Configuration manager under SQL Server Network Configuration. Select Protocols for . Right click TCP/IP and select the IP Address tab. Make sure all TCP Dynamic Ports are set to 0. Under IPALL, set the TCP Port to the static IP address. Once that is done, you will need to restart the SQL server service.
I'm trying to add a Data Connection in Visual Studio 2010 to a SQL Server 2008 database at a given IP (thru internet). What ports do I need to open up and forward to make the magic happen?
Any settings in the SQL Server I need to set to allow external connections?
Port 1433 is the default one used.
See TCP/IP port numbers required to communicate to SQL over a firewall for more details.
The default SQL Server port is 1433, and client ports are assigned a random value between 1024 and 5000.
And:
The port doesn't need to be 1433, but 1433 is the official Internet Assigned Number Authority (IANA) socket number for SQL Server.
to to sql server configuration manager toi check the port being used and open that port.
Also, on Sql Server Management Studio, right click the instance -> Properties -> Connections -> Check "Allow remote connections to this server".
I am attempting to create a new Database Project in VS2010 via the New Project Wizard, and via this article: http://msdn.microsoft.com/en-us/library/aa833432(v=vs.100).aspx
I am on the 'Configure Build/Deploy' step, and am attempting to connect to a named instance of SQL Server 2008R2 that I just installed, called DEVELOPMENT. Assuming the server name is DB-01, I am using DB-01\DEVELOPMENT as the Server name in the dialog in the screenshot below. I'm also using the remaining settings in the dialog, but it keeps giving me the following error:
A network-related or instance-specific error occurred while
establishing a connection to the SQL Server. The server was not found
or was not accessible. Verify that the instance name is correct and
that SQL Server is configured to allow remote connections. (provider:
TCP Provider, error: 0 - A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to
respond.)
DEV is the name of a database I created on the DEVELOPMENT instance. If I use DB-01 as the server name, which is the default instance, it connects. In the past, we've been developing from a database on the default instance, with no issues, but I'm trying to move to local, source-controlled databases. What am I missing with this not connecting?
EDIT: As a little more context, it's not the username/pw combination, or the existence of the DEV db on the instance, because I receive different errors if either of those are incorrect. It's simply not able to connect once I give it the named instance.
Figured it out:
The default instance of SQL Server (called MSSQLSERVER in some places) uses port 1433 by default for incoming connections, which was opened in Windows Firewall. This is why I was able to connect to the default instance (DB-01). If you've created a named instance of SQL Server, by default these instances use port 1434 for incoming connections. These are TCP ports for each case. Well, I have to admit that I opened TCP port 1434 in Windows Firewall and still was not able to connect to the named instance remotely, and still am not sure why this was the case. So instead, I opened up a random port (6969) in Windows Firewall, and configured the DEVELOPMENT (named) instance to accept incoming connecting over that port only. For instructions on how to configure specific SQL Server instances to use ports other than the default, see this article:
Configure a Server to Listen on a Specific TCP Port
Once I configured the instance to use port 6969, I was able to connect with no issue. Hope this helps others that are having a similar/same issue.