Trying to establish a connection - oracle

I have just downloaded and extracted the Oracle SQLDeveloper in MAC OS X. Until then, when I am establishing a connection using the HR (default) as the username and password, ORCL for the SID... the test result always show "test failed the network adapter could not establish the connection". Any insights...
regards prinsipeluha

Your Host or Port entry is not correct and/or your host is not accessible from your machine (e.g. behind a firewall). If localhost the defaults would be
host: localhost
port: 1521

Related

how do I connect to postgresql with psql from powershell?

I have installed PostgreSQL 13 on Windows 10 using the EDB installer and it seems to work fine. I can connect easily with psql in the included SQL Shell application. However, I can not connect from powershell:
~> psql -U postgres -h localhost
psql: error: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Any permutation of psql command line switches yields the same result. I checked pg_hba.conf and it looks sane - all local connections are allowed. All the search results for the error code above on the internet assume the server is not running but it is running just fine (see SQL Shell above). Within that shell, all the postgres tables are visible, etc. What do I need to do to connect psql to the server on localhost from powershell?
Default installed pg_hba.conf:
# "local" is for Unix domain socket connections only
local all all scram-sha-256
# IPv4 local connections:
host all all 127.0.0.1/32 scram-sha-256
# IPv6 local connections:
host all all ::1/128 scram-sha-256
The IPv4 line above should cover me in powershell? Yes? tcp connections are allowed in postgresql.conf:
listen_addresses = '*' # what IP address(es) to listen on;
Long time linux PostgreSQL user, first time in powershell on Windows, though...
This morning I found the problem - the EDB installer had setup the postgres service to run on port 5433. After a couple of decades or running it on 5432 I didn't even notice that the number was different in postgresql.conf. It was late...
Something else must be running on 5432. Will check later on.

SQL*Plus connection SetUp: ORA-12154 Error

Sorry for the noob question but I am new to Oracle SQL software.
I've been trying to create a connection to my database student (created on SQL Developer), but got quite confusing since I'm using a client-computer which will connect to server.
Below are the info about the connection:
Connection Name: LARGER123
Username: LARGER123
Hostname: uxkg265.admin.plent
Port: 1520
SID: ticp5076
Client-computer username: r5678
When I open the SQL Plus prompt, I tried several combinations on the username in order to establish the connection, but got the same error ORA-12154 Error.
I though that it could be the way I was setting the things on username field, so I followed the instructions from Oracle's website:
https://docs.oracle.com/database/121/ADMQS/GUID-1A15D322-B3AC-426A-86A1-EB7590930687.htm#ADMQS045
Basically it tells to "build" the username structure in that way:
nick#"dbhost.example.com/orcl.example.com"
Where: "nick" is the user; "dbhost.example.com" is the host; and "orcl.example.com" is the database.
So, following the example I put my username in that way and got errors:
LARGER123#"uxkg265.admin.plent/student"
I tried different ways, including the Port and SID but got no success.
Do you have a better idea of what's my mistake?
Are you quite certain somebody is listening where you are trying to connect. I would suggest you start by testing with telnet.
You say your server has the domain name “uxkg265.admin.plent”
nslookup uxkg265.admin.plent
I just checked my IP address and found:
$ nslookup $(hostname)
Server: xxx.xxx.xxx.xxx
Address: xxx.xxx.xxx.xx##53
Name: mydomain.myorg.com
Address: 192.168.56.1
I just tried to connect to my oracle instance and got:
$ telnet 192.168.56.1 1521
Trying 192.168.56.1...
Connected to 192.168.56.1
Escape character is '^]'.
^]
telnet> quit
Connection closed.
If I try to the wrong port, I get:
$ telnet 192.168.56.1 1522
Trying 192.168.56.1...
telnet: connect to address 192.168.56.1: Connection refused
I was able to connect with:
sqlplus myoracle/testpass#192.168.56.1:1521/UPGR
where UPGR is the service name.
I was also able to connect with:
sqlplus myoracle/testpass#"(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.1)(PORT=1521))(CONNECT_DATA=(SID=UPGR)))"
With UPGR as the SID.
I had some trouble initially because my version of Oracle Linux had iptables enabled and that was keeping me from connecting using sqlplus. As soon as I disabled this protection, I was able to use Oracle.
sudo service iptables stop
sudo chkconfig iptables off
(Keep in mind that iptables serves a purpose. For my test system running on my PC in VirtualBox, turning it off is fine. For other systems, maybe not.)
ORA-12154 is TNS:could not resolve the connect identifier specified, but you likely aren't using TNS to resolve the connect identifier: have you edited the tnsnames.ora file on the client machine and created an entry for the SID you're trying to connect to? Probably not.
Instead of selecting SID, select "Service name" and put the Oracle SID there. With the "Basic" connection type, that should use the host/port and service name explicitly to build the connection rather than relying on TNS to look up (resolve) the SID.

postgres: client could not connect to server

For clarification, please note that I have found several similar questions on stackoverflow, but I could not fix my issue.
psql: could not connect to server: Connection refused” Error when connecting to remote database
psql: How to Allow Remote Access to PostgreSQL database
I am trying to connect to a postgres DB installed in a remote server.
To create a connection from the client I am using QGIS plugin (Add PostGIS Layer):
The error that occurs is:
could not connect to server: Connection refused (0x0000274D/10061) is the server running on host "localhost" (::1) and accepting TCP/IP connection on port 5432
Additionally I added the host's IP Adress in the Host field, but then another error message occurs:
could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "hosts_ip_adress" and accepting TCP/IP connections on port 5432?
My settings are:
Postgres installed version is 10.0 with PostGIS extension
Host operating System: Windows 7
Client operating System: Windows 7
I edited pg_hba.conf to:
host all all 0.0.0.0/0 md5
and changes listen parameter in 'postgresql.conf' to:
listen_addresses = '*'
both files are located in C:\Program Files\PostgreSQL\10\data
restartet pgAdmin4
My devices are in the same network. Each one is connected via LAN cable.
I suppose that a firewall is preventing the connection?

can't connect to postgres on windows10

I am setting up project on my windows PC and I have a problem with postgres.
Project is set on docker.
when I run docker-compose up I receive error
: *** Failed to connect to database dev; trying to create database
/usr/local/bundle/gems/sequel-4.48.0/lib/sequel/adapters/postgres.rb:224:in `initialize': PG::ConnectionBad: could not connect to server: Connection refused (Sequel::DatabaseConnectionError)
Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
I don't know what to do. I have already installed microsoft easy-fix for TCP-IP, shut down windows firewall, changed all connection in pg_hba.conf to trust. Nothing helps. I don't have any antivirus software installed.
nmap report:
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0027s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 995 closed ports
PORT STATE SERVICE
135/tcp open msrpc
445/tcp open microsoft-ds
2068/tcp open avocentkvm
2179/tcp open vmrdp
5432/tcp open postgresql
edit:
I run psql -h localhost and received
psql: CATASTROPHIC: role "Kamil" does not exist
Kamil is my PC name.
edit2:
is it possible that docker doesn't have access to postgres on localhost?
problem solved
I had to set environment var to DB_HOST=docker.for.win.localhost

DBVisualizer Hive SSH Tunnel Ignoring Server Information

I'm attempting to setup a connection to our Hadoop cluster via DBVisualizer.
In order to connect I need to SSH into a server on the domain and then I need to run the command to a remote server (I've not ssh'd onto the Hadoop cluster directly)
I have (figuratively)
Database Server: abcd.efg
Database Port: 12345
Database: Hello
configured for the Database section
SSH Host: hijk.efg
SSH Port: 678
When I attempt a connection, it returns
Could not open client transport with JDBC Uri:
jdbc:hive2://127.0.0.1:-----
Where 127.0.0.1 and ----- appear to be the defaults instead of what I entered.
Any idea how I get the SSH tunnel to use the server configuration I specify?
The SSH Tunnel is set up locally on the client, so connecting to the port on localhost tunnels you to the SSH Host/Port, which then sets up a connection to the database server/port you have specified. This page may help:
http://confluence.dbvis.com/display/UG100/Using+an+SSH+Tunnel
Best Regards,
Hans

Resources