<p>Why do I need two of them? When I have to use one or another?</p>

[{'answer_id': 43883, 'author': 'DAC', 'author_id': 1111, 'author_profile': 'https://Stackoverflow.com/users/1111', 'pm_score': 5, 'selected': False, 'text': '<p>Please see: <a href="http://www.sap-img.com/oracle-database/finding-oracle-sid-of-a-database.htm" rel="noreferrer">http://www.sap-img.com/oracle-database/finding-oracle-sid-of-a-database.htm</a></p>\n\n<blockquote>\n  <p>What is the difference between Oracle\n  SIDs and Oracle SERVICE NAMES. One\n  config tool looks for SERVICE NAME and\n  then the next looks for SIDs! What\'s\n  going on?!</p>\n  \n  <p>Oracle SID is the unique name that\n  uniquely identifies your\n  instance/database where as Service\n  name is the TNS alias that you give\n  when you remotely connect to your\n  database and this Service name is\n  recorded in Tnsnames.ora file on your\n  clients and it can be the same as SID\n  and you can also give it any other\n  name you want.</p>\n  \n  <p>SERVICE_NAME is the new feature from\n  oracle 8i onwards in which database\n  can register itself with listener. If\n  database is registered with listener\n  in this way then you can use\n  SERVICE_NAME parameter in tnsnames.ora\n  otherwise - use SID in tnsnames.ora.</p>\n  \n  <p>Also if you have OPS (RAC) you will\n  have different SERVICE_NAME for each\n  instance.</p>\n  \n  <p>SERVICE_NAMES specifies one or more\n  names for the database service to\n  which this instance connects. You can\n  specify multiple services names in\n  order to distinguish among different\n  uses of the same database. For\n  example:</p>\n  \n  <p>SERVICE_NAMES = sales.acme.com,\n  widgetsales.acme.com</p>\n  \n  <p>You can also use service names to\n  identify a single service that is\n  available from two different databases\n  through the use of replication.</p>\n  \n  <p>In an Oracle Parallel Server\n  environment, you must set this\n  parameter for every instance.</p>\n</blockquote>\n\n<p>In short: SID = the unique name of your DB instance, ServiceName = the alias used when connecting</p>\n'}, {'answer_id': 43901, 'author': 'Matthew Watson', 'author_id': 3839, 'author_profile': 'https://Stackoverflow.com/users/3839', 'pm_score': 8, 'selected': True, 'text': '<p><a href="https://stackoverflow.com/a/43883/6571020">Quote by @DAC</a></p>\n<blockquote>\n<p>In short: SID = the unique name of\nyour DB, ServiceName = the alias used\nwhen connecting</p>\n</blockquote>\n<p>Not strictly true. SID = unique name of the INSTANCE (eg the oracle process running on the machine). Oracle considers the &quot;Database&quot; to be the files.</p>\n<p>Service Name = alias to an INSTANCE (or many instances). The main purpose of this is if you are running a cluster, the client can say &quot;connect me to <code>SALES.acme.com</code>&quot;, the DBA can on the fly change the number of instances which are available to <code>SALES.acme.com</code> requests, or even move <code>SALES.acme.com</code> to a completely different database without the client needing to change any settings.</p>\n'}, {'answer_id': 2653106, 'author': 'Ashish', 'author_id': 318500, 'author_profile': 'https://Stackoverflow.com/users/318500', 'pm_score': 1, 'selected': False, 'text': '<p>As per Oracle Glossary : </p>\n\n<blockquote>\n  <p>SID is a unique name for an Oracle database instance. ---> To switch\n  between Oracle databases, users must specify the desired SID &lt;---. The\n  SID is included in the CONNECT DATA parts of the connect descriptors\n  in a TNSNAMES.ORA file, and in the definition of the network listener\n  in the LISTENER.ORA file. Also known as System ID. Oracle Service Name\n  may be anything descriptive like "MyOracleServiceORCL". In Windows,\n  You can your Service Name running as a service under Windows Services.</p>\n</blockquote>\n\n<p>You should use SID in TNSNAMES.ORA as a better approach.</p>\n'}, {'answer_id': 30327260, 'author': 'seorphates', 'author_id': 4916341, 'author_profile': 'https://Stackoverflow.com/users/4916341', 'pm_score': 5, 'selected': False, 'text': "<p>I know this is ancient however when dealing with finicky tools, uses, users or symptoms re: sid &amp; service naming one can add a little flex to your tnsnames entries as like:<br><br></p>\n\n<pre><code>mySID, mySID.whereever.com =\n(DESCRIPTION =\n  (ADDRESS_LIST =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = myHostname)(PORT = 1521))\n  )\n  (CONNECT_DATA =\n    (SERVICE_NAME = mySID.whereever.com)\n    (SID = mySID)\n    (SERVER = DEDICATED)\n  )\n)\n</code></pre>\n\n<p>I just thought I'd leave this here as it's mildly relevant to the question and can be helpful when attempting to weave around some less than clear idiosyncrasies of oracle networking.</p>\n"}, {'answer_id': 48168294, 'author': 'swaroop', 'author_id': 3519301, 'author_profile': 'https://Stackoverflow.com/users/3519301', 'pm_score': 3, 'selected': False, 'text': '<blockquote>\n  <p>what is a SID and Service name</p>\n</blockquote>\n\n<p>please look into oracle\'s documentation at <a href="https://docs.oracle.com/cd/B19306_01/network.102/b14212/concepts.htm" rel="nofollow noreferrer">https://docs.oracle.com/cd/B19306_01/network.102/b14212/concepts.htm</a></p>\n\n<p>In case if the above link is not accessable in future, At the time time of writing this answer, the above link will direct you to, "Database Service and Database Instance Identification" topic in Connectivity Concepts chapter of "Database Net Services Administrator\'s Guide". This guide is published by oracle as part of "Oracle Database Online Documentation, 10g Release 2 (10.2)"</p>\n\n<blockquote>\n  <p>When I have to use one or another? Why do I need two of them?</p>\n</blockquote>\n\n<p>Consider below mapping in a RAC Environment,</p>\n\n<p>SID &nbsp; &nbsp;&nbsp;&nbsp;SERVICE_NAME <br/>\nbob1&nbsp; &nbsp;                 bob<br/>\nbob2&nbsp; &nbsp;                bob<br/>\nbob3&nbsp; &nbsp;                 bob<br/>\nbob4&nbsp; &nbsp;                 bob<br/></p>\n\n<p>if load balancing is configured, the listener will \'balance\' the workload across all four SIDs. Even if load balancing is configured, you can connect to bob1 all the time if you want to by using the SID instead of SERVICE_NAME.</p>\n\n<p>Please refer, <a href="https://community.oracle.com/thread/4049517" rel="nofollow noreferrer">https://community.oracle.com/thread/4049517</a></p>\n'}]
['https://Stackoverflow.com/questions/43866', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4052/']