Oracle SID & SERVICE_NAME

What is the difference between Oracle SID & SERVICE_NAME ?
and which one is better to use in tnsnames.ora and why ?

When you use the names resolution service TNSNAMES, you always use both a service name and a SID in each entry of the client's TNSNAMES.ORA file. The SID is the actual name of an instance as recorded in the INSTANCE_NAME column of the instance's V$INSTANCE view and as specified in the instance's entry in the server's LISTENER.ORA file. The service name is an alias for the instance that is found only in the client's TNSNAMES.ORA file. Here is an example of a series of entries in a client's TNSNAMES.ORA file for three databases on three servers all having the same SID:DEVDB.WORLD =
(DESCRIPTION =
   (ADDRESS =
      (PROTOCOL = TCP)
      (PORT = 1521)
      (HOST = DEVSVR.OURCOMPANY.COM)
   (CONNECT_DATA = (SID = OURSID))
TESTDB.WORLD =
(DESCRIPTION =
   (ADDRESS =
      (PROTOCOL = TCP)
      (PORT = 1521)
      (HOST = TESTSVR.OURCOMPANY.COM)
   (CONNECT_DATA = (SID = OURSID))
PRODDB.WORLD =
(DESCRIPTION =
   (ADDRESS =
      (PROTOCOL = TCP)
      (PORT = 1521)
      (HOST = PRODSVR.OURCOMPANY.COM)
   (CONNECT_DATA = (SID = OURSID))
)The SID is OURSID and is the same for each of these databases, but each resides on a separate host--DEVSVR, TESTSVR, and PRODSVR. The service names are DEVDB.WORLD, TESTDB.WORLD, and PRODDB.WORLD, and each is an alias for a database on a particular server. The SIDs of all three databases are the same, however. If the server configurations are identical, it is possible to use copies of OURSID from PRODSVR in TESTSVR and DEVSVR without making any control file changes. Although the service name may be the same as the SID, it needn't be.
We have hundreds of databases in our enterprise, and we make extensive use of the aliasing capability of the TNSNAMES.ORA entries.
Kind regards,
Russ

Similar Messages

  • Get SID (SERVICE_NAME)

    How can I programmatically get SID (SERVICE_NAME) of Oracle DB on which application server is running except for query "select sys_context('userenv','db_name') from dual"?

    Hi,
    select * from v$session
    Thanks
    --Anil                                                                                                                                                                                                               

  • Question about an Oracle SID

    I'm a bit confused about what a SID is. I understand that it represents a Database instance. However, as I create my database for the first time, I'm asking myself if I really understand what a SID is?
    My impression of a SID is a database instance that can contain/manage serveral databases. Is that correct?
    However, I wonder if I'm being miss lead by my thinking. During the database creation process it appears that there is a one-to-one relationship between a database and a SID. Meaning that a SID and database are a unique pair and that a one-to-one relationship exist only.
    That being the case when it comes the environment variable for "Oracle_SID" does it support having multiple SID's. What is the maximum number of SID that it can support? When connecting to a database in Oracle do I have to supply both the SID and global database name to make a connection? I plan to connect to my databases using both Java and C++.
    Thanks

    Thanks for you help. However, My question is about
    the "Oracle_SID" environment variable. I fully
    understand that a SID helps identify resources to
    manage a database. However, a server/machine can
    have any number of database residing on the
    server/machine.
    The installation instructions talk about the
    environment variables for a machine with the
    "Oracle_SID being one of those variables. Based on
    what you are telling me a server/machine can have
    only 1/one database residing on it based on the fact
    that the "Oracle_SID" environment variable can only
    accomodate one/1 SID. NO. That is NOT what I said. I said - One SID will equate to One database instance.
    You can have any number of SIDs.
    BUT you set the SID as an environment variable to tell the software which instance to you wish to connect. ORACLE_SID can only be set to one value. That represents the database instance to which you are about to connect. A tool such as SQLPlus supports only one connection to one instance at a time.
    >
    Is the "Oracle_SID" environment variable important
    when it comes to connecting to a database remotely?Not really. The key is the SERVICE_NAME which is used to tell the LISTENER which SERVICE you want to use.
    By default, there is one service that has the same name as the instance's SID.
    There is a connection description file, called TNSNAMES.ORA. That file is used the same as /etc/hosts in *nix - pass in an alias and get a connection description - IP in the case of HOSTS; machine, listener port and 'instance information' in the case of TNSNAMES.ORA
    The typical connection to an instance is something like
    sqlplus hans/test@ORCL
    The ORCL is the alias to look up in the TNSNAMES.ORA (or other lookup technique - equivalent to DNS). The client looks up the 3 pieces of information, sends a request to the listener which is (hopefully) listening on the specified port on the indicated machine. It then uses the 'instance information' to ask the database instance for a thread or process.
    Oracle8 and older used ORACLE_SID as the 'instance information'
    Oracle8i and newer uses SERVICE_NAME as the 'instance information'.
    Some Newbie DBAs equate SERVICE_NAME to ORACLE_SID, because one of the services has the same name as the SID. However, one can have up to 64 SERVICES managed by a single instance.
    Some Experienced DBAs equate SERVICE_NAME to ORACLE_SID, because they have not spent time in the documentation to understand the difference between SERVICE_NAME and SID. As a result, they generally do not 'get it' when it comes to resource management or instance consolidation.
    >
    If I'm managing a database at the server and the
    server has multiple database residing on it, how do I
    define a SID for each database using the "Oracle_SID"
    environment variable?If on LINUX, using bash, you simply
    export ORACLE_SID=abc
    or use the oraenv script to set the SID and all the other environment variables based on the SID.I give a description and example below.
    >
    I'm just not clear about the relationship between the
    "Oracle_SID" environment variable and access a
    database when logged onto the database
    server/machine.Say I have 2 databases, called 'ORCL' and 'TEST', each with a user (and schema) called 'hans'. Both are down. I want them both up. Therefore I want to start 2 instances.The pattern, on Linux (it's subtly different on Windows) is
    # set the environment to start ORCL
    . oraenv
    ORCL
    # or
    export ORACLE_SID=ORCL
    export ORACLE_HOME=some-directory-path-to-the-ORCL-database's-software
    export PATH=$PATH:$ORACLE_HOME/bin
    # use the tools to start the database
    sqlplus / as sysdba   # note that I did not specify SID ... that was given above
    startup
    exit
    # at this point ORCL database, and all the schemas in the ORCL database, are available
    # from anywhere in the network, or on the local machine, I can:
    sqlplus hans/password@ORCL
    select * from dual;
    exit
    # but TEST is not up and
    sqlplus hans/password@TEST
    #  will fail with a 'database not available' type of message
    # now set up to start test.  Use oraenv OR do it manually
    export ORACLE_SID=TEST
    export ORACLE_HOME=the-path-to-the-TEST-database's-software-which-could-be-the-same
    export PATH=$PATH:$ORACLE_HOME/bin
    # and use the tools to start the database
    sqlplus / as sysdba 
    startup
    exit
    # note that I did not specify SID ... that was given above and tells SQLPLUS to establish a connect to the
    # instance called TEST.  SQLPlus has special powers in the "as sysdba" mode - it can execute the
    # startup process.
    # NOW the TEST and the ORCL databases are available through the TEST and ORCL instances
    sqlplus hans/password@TEST
    select * from dual;
    connect hans/password@ORCL
    select * from dual;
    exit>
    I understand that when using the Enterprise Manager I
    have to specify the SID and database name but, does
    the environment variable "Oracle_SID" have to reflect
    a SID for each database that is present on the
    server/machine.
    The SID tells the system
    1) which shared memory segment to use - if we are on the server
    2) which instance to connect to over the network, because the SID is the same as the default SERVICE
    In Enterprise Manager Database Control, the entry point for the configuration files is a special directory under the ORACLE_HOME that consists of the machine name and the SID. The purpose of setting the ORACLE_SID in this case is to tell the database control which directory to use to find the EM configuration files for that database and instance.
    No matter which way you slice it:
    1) an Oracle SID is used to point to the configuration information for one database and it's related instance;
    2) an Oracle SID is really only meaningful on the machine where the instance is to run;
    3) an Oracle SID environment variable can only contain the value for one SID if it is to be intepreted by Oracle programs;
    4) an Oracle SID plays no significant part in establishing the connection for an appication;
    5) an Oracle SID MAY be used as input to environment-setting programs that make it easier to get the right environment for an application;
    6) an Oracle SID is NO LONGER the correct way to set up the TNSNAMES.ORA file to establish a connection.

  • Difference between SID, Service_name, Database_Name and DB_ID.

    Hi Experts
    Can anyone please clarify me whats the difference between the SID, Service_name, Database_Name and DB_ID.Thanks in advance
    Ram

    In summary:
    SID - uniquely identifies an instance. This given as the intialisation parameter INSTANCE_NAME. The SID and the Database name should be the same in a single instance database, but in RAC environment where multiple instances are associated to one database, there will be different name for each instance.
    Service Name - Registers the database on the oracle network. For instance, when the database starts, it needs to be registered to the listener service for other clients to see it on the network. This is what you need in the SERVICE_NAME entry of the tnsnames.ora. This is specified as the initialisation parameter SERVICE_NAME.
    Database_Name - This is the unique name that identifies all the mounted databases. This is the name you used when the database was created and is shown in the initialisation parameter DB_NAME.
    DBID - This is the Database numeric Identifier. It is found on the header of all controlfiles and you can see it in v$database view. e.g select name,dbid from v$database. You can also see this when you connect to the database with RMAN. e.g rman target /
    Note that you can use DBNEWID to change both the db_name and DBID. You can read more on all these to get more details

  • After brrestore: Couldn't open verify PSE file /oracle/ sid /LASVerify.pse

    After a brrestore on same server and <SID> each time that we run cleanup logs from DB13  we see:
    BR0801I BRCONNECT 7.00 (32)
    BR1301W Error message from likeywlib: likey_init: Couldn't open verify PSE file ("/oracle/<sid>/LASVerify.pse") for writing, errno = 13 (Permission denied).
    BR1302W Initialization of license key library likeywlib failed, return code 1
    BR1304W Checking SAP license failed at location BrLicCheck-104
    BR0602W No valid SAP license found - please contact SAP
    BR0805I Start of BRCONNECT processing: cdzkodpr.cln 2008-12-06 22.46.27
    BR0484I BRCONNECT log file: /oracle/<sid>/sapcheck/cdzkodpr.cln
    It is on a Linux SuSE X64 - Oracle 10.2.0.4 box
    Regards.
    Ganimede Dignan.

    > After a brrestore on same server and <SID> each time that we run cleanup logs from DB13  we see:
    >
    > BR0801I BRCONNECT 7.00 (32)
    > BR1301W Error message from likeywlib: likey_init: Couldn't open verify PSE file ("/oracle/<sid>/LASVerify.pse") for writing, errno = 13 (Permission denied).
    you <SID>adm user has no permissions to write this file.
    Markus

  • 3 Instnaces with same Oracle SID, How I do?

    Plase look and your concern about follow scenario:
    Server A is production, oracle sid = uno
    Server B will be a stand by database from Server A, oracle sid = ??? "uno"
    Server B will be QA database from Server A, oracle sid = ?? (uno)
    - Product 8.1.7 on unix backup box
    - I want to have one standby database with one unix user ora8i1 and sid="db1".
    - I want to have a QA instance in same box with other unix user ora8i2 and sid="db2".
    - Can I have it these?
    - What about the listener, Do I need configurate it manually?
    My Idea is:
    1. Produccion rdbms sid='db1'
    2. Backup server with stand by database sid=???
    3. To have a QA instance from db1 on the backup server where the analyst can test their programs, before Produccion, sid=????.
    4. Point 2 and 3 with Ora8i 8.1.7.1 on same unix hp box.
    In the other words, I want to have on same hp unix box two instances from main production instance 'db1'. One instance have a stand by database and other instance have a QA test database, both instances have a dentical copy from 'db1' inicially.
    What you suggest me?
    Thanks

    Plase look and your concern about follow scenario:
    Server A is production, oracle sid = uno
    Server B will be a stand by database from Server A, oracle sid = ??? "uno"
    Server B will be QA database from Server A, oracle sid = ?? (uno)
    - Product 8.1.7 on unix backup box
    - I want to have one standby database with one unix user ora8i1 and sid="db1".
    - I want to have a QA instance in same box with other unix user ora8i2 and sid="db2".
    - Can I have it these?
    - What about the listener, Do I need configurate it manually?
    My Idea is:
    1. Produccion rdbms sid='db1'
    2. Backup server with stand by database sid=???
    3. To have a QA instance from db1 on the backup server where the analyst can test their programs, before Produccion, sid=????.
    4. Point 2 and 3 with Ora8i 8.1.7.1 on same unix hp box.
    In the other words, I want to have on same hp unix box two instances from main production instance 'db1'. One instance have a stand by database and other instance have a QA test database, both instances have a dentical copy from 'db1' inicially.
    What you suggest me?
    Thanks

  • Get Oracle SID in PL/SQL with out a query

    Hi,
    Is there any way where I can get ORACLE SID value in the PL/SQL layer with out actually querying v$database tables.
    I am looking for key word in PL/SQL which stores currect SID name, just like how keyword 'user' stores the current user who has logged in.
    Thanks
    Sree

    Hi,
    Is there any way where I can get ORACLE SID valuein
    the PL/SQL layer with out actually querying
    v$database tables.
    I am looking for key word in PL/SQL which stores
    currect SID name, just like how keyword 'user'stores
    the current user who has logged in.Subtle correction ...
    [url=http://download-east.oracle.com/docs/cd/B19306_01
    /appdev.102/b14261/subprograms.htm#sthref1776]'user'
    is a built-in function provided by Oracle. Why don't you create your own function to perform the
    Select?
    I know I can create a function but, I dont want to read the table everytime it is called. Knowing that Database sid is going to be constant for next couple of years.
    The procedure in which I am going to use database sid is called for almost every transaction in the database. I am trying to avoid IO operation for a constant value. I cant declare a global constant as it is going to be different for each environment Dev, QA, Production etc..and we are looking to deploy same code for all the environments. We are anticipating to have multiple databases for production too.

  • Oracle sid 102isql service not working

    Hi,
    oracle<sid>102isql is not in start status, when i try to start it i got below message.
    the above service could not start local services and error:1067 the process terminated unexpectedly.
    iam not able to connect the SAP for this reason.Please advice.
    Regards,
    Asif

    Hi,
    Check the DB and Listener is UP or not.. If it OK and still you are facing database connection problem then check the TNS entry in tnsnames.ora file is correcty given or not. The host, port and SID of TNS entry should match with Listener Host, Port and SID.
    Check the Listener status using the command
    lsnrctl status
    Check the TNSping using Command
    tnsping <DB TNS entry name>
    Then check SAP is able to connect the DB using command
    R3trans -d
    if it give the return code 0, then SAP will be able to connect DB.
    Thanks
    Manoj

  • DRDA is installed just on the Oracle side?

    After reading this I still dont get it...
    http://download-east.oracle.com/docs/cd/B19306_01/gateways.102/b16217/intro.htm#i3621
    This documentation does not get to the point at all. It is not written at a level for people who have never installed a Transparent Gateway...
    So, If I install the DRDA type Transparent Gateway I'm hoping I only have to put software on the Oracle side - my side? Not the DB2 side? I saw via someone else's post where during DRDA setup a package is created on DB2 side by issuing commands on the Oracle side?
    If this is true, which I hope it is, why and what benefit is obtained by installing the other type of gateway Transparent Gateway for DB2 (TD4DB2) which requires installation of software on both sides - I think?
    I would like to only have to install software on the Oracle side since the DB2 machine is not owned by us and all we will have is a user account on the DB2 side.
    Give me few quick pointers please.. Thanks...

    The DRDA Gateway software is only installed on the the Oracle server machine (or a 3rd machine).
    There are several notes on Metalink "How to setup TG4DRDA" which explain in detail WHAT steps are required to configure the gateway.
    Regarding the Bind package: at the Db2 database the 2PC table must be created and then use SQL*Plus to bind a package at the Db2 side.
    This is mandatory for the DRDA gateway, but I want to make it clear again: NO software is installed on the DB2 machine.
    So the difference between the TG4DB2/400 and TG4DRDA is the location of the software.
    TG4DRDA is installed on Unix or Windows platforms, commonly in the Oracle database home whereas TG4DB2/400 is installed on the AS400 machine.

  • Difference between Oracle SID and an Oracle Database

    Hi
    Can any one please differeniate what exactly is the difference between an Oracle SID and a new Oracle Database?
    We just need to create another instance of an application (so we need another copy of all tables).
    So either we can:
    1. New database SID created or
    2. New user created in existing schema or
    3. New database provided
    Which is the best approach?

    Hi,
    New database SID created orThat is equivalent of creating a new database in your case.
    New user created in existing schema orYou meant new schema(user) created in existing database. I assumed this because you do not want both application to update the same table copy, but different copy.
    3. New database providedIt all depends on your you whether you want to create a new database or a new schema for getting another copy of table.
    Some points which I take in mind
    1) If I have a production database and I need to create a new set of tables for testing or any other purpose, I would create a new database.
    2) If I have a test database and I need to create a new set of tables for testing or any other purpose, if possible I would create a new schema in existing database.
    3) If I am running less in resources(hardware/memory), I would be createing a new schema in existing database.
    4) If I am not running less in resources and I would to keep these two copies entirely different, then from security purpose I would create a new database.
    Regards
    Anurag Tibrewal.

  • /oracle/ SID Directory is full

    Hi, All
    We are using ECC6 on HPUnix with Oracle. in our quality server /oracle/<sid> directory is full. Any one can explain what are the files i have to delete or i have to increase the volume.
    Please suggest
    Thanks & Regard
    Venkat

    Hi
    Please also check the size of the /oracle/SID/saptrace directory, you can use du:
    orasid> du -k /oracle/SID/saptrace
    The saptrace directory holds the alert log, user and background traces of the database. Sometimes core files are placed there as well. All those files can be deleted (please do not remove the background and usertrace directories), but if you encounter a lot of traces or cores, you should investigate further and try to fix the problems.
    Best regards
    Michael

  • Changing Oracle SID

    I have copied a database (all physical files) from one server to another. I now want to change the Oracle SID (from prod to dev) of the copied database - How can I achieve this?
    Thanks in advance
    Terry

    set ORACLE_SID = 'DEV'
    or If u r using NT then make this Change in registry so u dont have u use set command all the time.

  • OID Working Normally But I Want to Understand "oracle SID " Processes

    I'm runninng OID as part of an Identity Mangagement 10.1.4.0.1 installation on Linux. When I look at the processes that oracle is running I see many "oracle<SID>" processes.
    I'm looking for where I can read about the different types of processes that comprise OID on Unix/Linux. I'm particularly interested in knowing how "oracle<SID>" processes are created and destroyed -- is each process synonymous with an active connection to the directory?
    Thank you for pointing me to the docs on this or telling me what you believe these "oracle<SID>" processes represent.

    Those Oracle<sid> processes are database instance processes - OID is implemented in a database (where else?).
    They should be there for the life time of your server - they should not be killed, destroyed or whatever - they can be stopped by logging into your server - after setting the proper environment variables, execute:
    sqlplus / as sysdba
    shutdown
    exit
    The shutdown can take a while - it allows all active, current sessions to do their thing. Another option is shutdown immediate, which will kill active sessions, as soon as the running transaction finishes. Both options result in a clean shutdown, leaving the database in a consistent state.
    A real killer is shutdown abort - it will simply abort all transactions, but leaves the database in an inconsistent state. Oracle will recover automatically in most cases.
    More on http://tahiti.oracle.com, in the database section

  • IP Address Changed in the Oracle SID

    Dear Team ,
    I have Changed the IP address of the Oracle SID I am using (ORACLE 10g) in Listener.ora and tnsnames.ora file .
    While I am starting my application I got this below error.
    Io exception: The Network Adapter could not establish the
    connection
    Is there any procedure to be followed while changing the Ip Address .
    Kindly help me to sort out this Issue .
    Regards ,
    Augustine

    Augustine Vinish wrote:
    Dear Team ,
    I have Changed the IP address of the Oracle SID I am using (ORACLE 10g) in Listener.ora and tnsnames.ora file .
    While I am starting my application I got this below error.
    Io exception: The Network Adapter could not establish the
    connection
    Is there any procedure to be followed while changing the Ip Address .
    Did you restart the listener after changing the ip address in listener.ora?
    Also check /etc/hosts file...
    If your server IP is changed then you need to make changes in listener.ora and tnsnames.ora only..
    Regards
    Rajesh

  • Oracle service Oracle sid oracle version iSQL*Plus is not getting started

    Hi,
    we have installed Oracle 10g on WIN2003 Enterpeise Server sp2 & installed Solution Manager7.0 ehp1 for Development server successfully.
    For Production server, we had installed  WIN2003 Enterpeise Server sp2 & while installing Oracle for Production Server , Oracle service ( OraclePRD102iSQL*Plus) is not gettting started. we are not sure what went Wrong.
    Thanks in Advance,

    Hi,
    Along with the above suggestions, refer the following REFERENCE links.
    [         Oracle<SID>102iSQL*Plus service fails    |Re: Oracle<SID>102iSQL*Plus service fails;
    [Oracle<SID>102iSQL*Plus service is not starting  |Oracle<SID>102iSQL*Plus service is not starting;
    Regards,
    Bhavik G. Shroff

Maybe you are looking for

  • Error in running example of returning a simple struct by calling DLL

    Hi, all. I downloaded the LabVIEWWrapper.zip from this place:https://decibel.ni.com/content/docs/DOC-9079 And I run the following VI in "LabVIEWWrapper_PassingDataSampleDLL.lvlib" "Returning A Value Simple Struct Added.vi" I did not change anything i

  • How to type the rupee symbol in hp pavilion g4?

    My HP Pavilion notebook's model is G4, TX series 1202. the key board shows the rupee symbol (bottom right) on the same key as the $ and 4. but i am unable to figure out how to type! any pointers?

  • Error message when deleting downloaded video on No...

    Hi, I have recently bought a Nokia 6730i and have tried to upgrade the Ovi Maps but do not have enough internal memory.  I have therefore tried to delete videos downloaded from the internet. I have successfully managed this apart from one last file w

  • Daily dump by Autoabap - DATA_LENGTH_0

    Hello, We use our Flash recovery area as our archive log destination and since we started doing so we get this dump: DATA_LENGTH_0 - CX_SY_RANGE_OUT_OF_BOUNDS The problem occurs here (in RSORADBA): 262   perform get_db_parameter(rsora001) using 'log_

  • Can't edit and save drafts on my ipad

    Hi there, I have a MobileMe email account that I access on both my Mac and my iPad. When I create a new message and save it as a draft on my Mac it gets saved in my MobileMe IMAP Drafts folder on the server. I can then jump on my iPad and view the dr