Reputation: 425
I am trying to understand the oracle database environment in my office.
In the Oracle SQL developer in my office, there are multiple connections with same port and host, but with different services.
From oracle documentation, I have read this:
Port: This is the listener port for the database. The default port for Oracle Database is 1521. Service name: This is the network service name of the database. Select either SID or Service name.
Does it mean that the services/database instance runs on different ports but have a common listener port to external connections?
Upvotes: 0
Views: 1888
Reputation: 3372
Each database will have a distinct SID (Service ID) and Service Name. The SID is the older, deprecated naming method and the service name is now the recommended naming method.
It is very common to have one listener and more that one database. The listener has a config file that tells it which databases it is aware of.
If using the native Oracle client on your client host you will have a TNSnames.ora file listing each database you can connect to and the listener that listens for connections to the DBs. Alternately you may use another connection type, e.g. JDBC, that lists the same details; service name, host and port.
So to connect to a DB from your client you tell the connecting software (oracle client, your bespoke app, etc) to connect to a DB via a listener.
A connection is established from client to listener, the listener then passes that connection off to the DB and specifies a port number for that connection. But only the listener port is published and only the listener port needs to be known.
Upvotes: 3