Monday, August 17, 2015

The differences between SID and Service Name in Oracle connection

When creating an Oracle connection, there are two types of connections that can be used:
  •  SID
  • SERVICE_NAME

The differences between those are:
  • SID = the unique name of your DB
  • ServiceName = the alias used when connecting

SID = unique name of the INSTANCE
For example, the oracle process running on the machine, the SID is the local name of the database on your system, and the Service Name is the name of the system to the outside world.
For example, you might have a QA database and a production database with the same SID but referenced with 2 different service names:
QA.WORLD =
 (DESCRIPTION =
   (ADDRESS =
      (PROTOCOL = TCP)
       (PORT = 1521)
     (HOST = QA.ACME.ORG)
   )
   (CONNECT_DATA = (SID = MYSID))
)

PROD.WORLD =
 (DESCRIPTION =
   (ADDRESS =
      (PROTOCOL = TCP)
      (PORT = 1521)
      (HOST = PROD.ACME.ORG)
   )
   (CONNECT_DATA = (SID = MYSID))

)

Cheers!
Uma

1 comment: