Reputation: 459
I have access to oracle database server. I wanted to connect it with sql developer. I have certain username /password for the remote server. and within that server I have access to database with certain username/ password.
I access to that database form server using sql plus with command sqlplus abcd@xe
and i have access to that database.
Whenever I tried to connect it with sql developer, connection is not established.
I tired as :
connection name: test
username: username to the remote server
password: password to remote server.
hostname: server host name
port :1521
sid : xe
how can I connect to remote database located in remote server?
Upvotes: 1
Views: 8538
Reputation: 1898
I am assuming the following scenario: You use an ssh client such as Bitvise to forward between local ports and remote ones. You want to sql developer to connect to an existing db where you already have the db and the user credentials. And you also have SSH access to the machine that hosts the Oracle DB.
SSH into the remote DB and switch to the DB user. Check the Listener port:
cat $ORACLE_HOME/network/admin/listener.ora
This returns among other things a line like:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <servername>)(PORT = 1521))
Now you know your target port is 1521
.
Check the Oracle SID:
echo $ORACLE_SID
You'll need this later on.
Forward a local port of your choice to the remote one in Bitvise along the lines of:
Listen Interface List. Port Destination Host Dest. Port Comment
127.0.0.1 11521 <servername> 1521 Oracle-DB
Fire up Oracle SQL Developer
Click the green + sign - up pops the new connection menu.
Connection Name: XYZ_Oracle
Username: Oracle_db_username
Password: pwd_for_db_username
Connection type: Basic
Role: Default
Hostname: 127.0.0.1
Port: 11521 (the forwarded port)
SID: the ID of the particular DB you want to access aka db name
Press Test
Press Connect
Invalid username/password - Make sure you use the uname/pwd that you use to access the DB with slqplus.
String index out of range - Are you trying to connect on a wrong port? Maybe 22? Check the listening port / forwarding port
Listener refused the connection. Unknown SID. - Make sure you are using the right system ID.
Upvotes: 0