DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: ORACLE_SID

  1. #1
    Join Date
    Nov 2000
    Posts
    14

    Question

    Guys,

    Why Oracle needs ORACLE_SID? How does Oracle use it? If I am gonna have several instances of oracle on the same mashine, where ORACLE_SID going to point to?
    --
    Dmitri Don

  2. #2
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    The environment variable.ORACLE_SID is defined in .profile in UNIX OS. When the Oracle user logs in to, all the environment variables are defined. They are all used to simplify typing again and again. If more instances are configured in one Unix box, have a script to swicth from one instance to another. In one window, only one ORACLE_SID can be set.

    Check oratab file to know all the instances running in the system.

  3. #3
    Join Date
    Nov 2000
    Posts
    14
    I see... thanks! So, ORACLE_SID is just a default database for the unix user. And ORACLE_SID cannot affect ORACLE itself, right?
    --
    Dmitri Don

  4. #4
    Join Date
    Jul 2000
    Location
    Oxford, OH
    Posts
    117
    Oracle uses the environmental parameter, ORACLE_SID, as a pointer to the database instance that the user wants to work with. This is to support having multiple instances on a single server.

    If you had, say, three separate instances on one server PROD, TEST, and DUMPME, Oracle needs to know which particular database you want to work with. If your ORACLE_SID is set to PROD, and you log into SVRMGRL and type startup, it is going to start the PROD database and not TEST or DUMPME. In order to reference the other databases, you would need to change ORACLE_SID and reset the environment to reflect the change.

    Oracle SID can have an affect on Oracle. If it's not set, you will not be able to log in. Also if you have ORACLE_SID set to PROD when you log in, but you thought it was set to TEST and you go in and truncate a table, you just blew a production table away!

    As tamilselvan was saying, usually if you are running multiple instances on a single box, you will write something that allows the user to select which database they want to work with when they create their Unix session. If you are only running a single instance, this is not necessary.

    If you are running multiple instances, also, as tamilselvan said, check your oratab file to make sure those instances are defined.

    Joe
    _________________________
    Joe Ramsey
    Senior Database Administrator
    dbaDirect, Inc.
    (877)687-3227

  5. #5
    Join Date
    Nov 2000
    Posts
    14

    Smile

    This is very clear now, thank you very much!
    --
    Dmitri Don

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width