getting server name and db name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard Gjerde

    getting server name and db name

    This is probably a very elementary question. I would like to have an sql
    which returns the name of the Oracle server and the current database. Could
    anybody help me out?

    Regards,
    Richard


  • Soeren Degn Jahns

    #2
    Re: getting server name and db name

    This is probably a very elementary question. I would like to have an sql
    which returns the name of the Oracle server and the current database.
    Could
    anybody help me out?
    Server name etc.:


    Current database.:



    // Soeren


    Comment

    • Richard Gjerde

      #3
      not quite enough?

      Thanks, Soeren. I found the last link helpful, but I don't see that the
      first one really tells you how to obtain the name of the server?

      "Soeren Degn Jahns" <nospam@nospam. dkwrote in message
      news:A58Mc.2705 9$Vf.1476075@ne ws000.worldonli ne.dk...
      This is probably a very elementary question. I would like to have an sql
      which returns the name of the Oracle server and the current database.
      Could
      anybody help me out?
      >
      Server name etc.:

      >
      Current database.:

      >
      >
      // Soeren
      >
      >

      Comment

      • Soeren Degn Jahns

        #4
        Re: not quite enough?

        Thanks, Soeren. I found the last link helpful, but I don't see that the
        first one really tells you how to obtain the name of the server?
        Hi Richard. Yeah, you're right. I was a bit too fast there, sorry. Would,
        what you are looking for, be the global_name then:
        SELECT global_name FROM global_name ;

        This would be equivialent to:
        SELECT ora_database_na me FROM dual;

        Hope this helps?

        // Soeren



        Comment

        • Mark D Powell

          #5
          Re: getting server name and db name

          "Soeren Degn Jahns" <nospam@nospam. dkwrote in message news:<A58Mc.270 59$Vf.1476075@n ews000.worldonl ine.dk>...
          This is probably a very elementary question. I would like to have an sql
          which returns the name of the Oracle server and the current database.
          Could
          anybody help me out?
          >
          Server name etc.:

          >
          Current database.:

          >
          >
          // Soeren
          Richard, you can find the database name in v$database while the
          machine name for both the front-end and Oracle session background
          processes can be found in v$session. The dynamic performance views,
          v$..., are documented in the Oracle version# Reference Manual.

          The sys_context function is a handy source of information about the
          current session including Oracle username, Os user, Proxy user, IP
          address, .... See the SQL Manual.

          HTH -- Mark D Powell --

          Comment

          Working...