Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: db_name, instance_name, service_names and the sqlnet alias
see answer below.
> -----Original Message-----
> From: ALEMU Abiy [mailto:abiy.alemu_at_criltechnology.com]
>
> What is the relation between db_name, instance_name,
> service_names and the
> sqlnet alias for an instance. 'Cause in my init.ora file I
> fdefined the
> following things
> db_name = "db1"
> instance_name=inst1
> service_names=service1
>
> And I defined an entry in my tnsnames.ora file, for my
> instance as following
> :
>
> cs_inst1 =
> (DESCRIPTION = > (ADDRESS_LIST = > (ADDRESS = > (COMMUNITY = TCPCOM) > (PROTOCOL = TCP) > (Host = alpha) > (Port = 1527) > ) > ) > (CONNECT_DATA = > (SID = db1) > (GLOBAL_NAME = cs_inst1) > ) > )
The db_name is the name of the database (the files on disk). The SID is the name of the instance (the background processes and shared memory).
The database name and the SID are not necessarily the same, and for example if you have Oracle Parallel Server (OPS) running, you can have several instances for one database. So you can see why there are good reasons for them to be different. Also database names cannot be as long as SIDs.
The alias in your TNSnames.ora file can be different from the db_name and also different from the SID. Or all three can be the same. However, the SID= parameter in TNSnames.ora expects an INSTANCE name, the SID, and NOT the database name. This can also be explained with the OPS example: when you have several instances accessing the same database, the instances are typically on different hosts, and you are connecting to only one of those instances.
In your case, you have the database name as a value for SID=, which is incorrect.
![]() |
![]() |