Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Getting the name of the database and machine

Re: Getting the name of the database and machine

From: Joel Garry <joelga_at_pebble.org>
Date: Thu, 23 Jul 1998 23:45:31 GMT
Message-Id: <slrn6rfis2.a1i.joelga@pebble.org>


On Thu, 23 Jul 1998 11:09:14 -0700, Ken Madsen <madsenkj_at_pe-nelson.com> wrote:
>I read a tip on one of these newsgroups to place the machine name in a
>SQL*Plus prompt and I have used it successfully on many databases except
>one.
>
>Here is the SQL tip implemented in my glogin.sql file:
>
> set termout off
> col value new_value sid
> SELECT Initcap(machine) value FROM v$session WHERE sid = 1;
> col value clear
> set sqlprompt 'SQL &sid> '
> set termout on
>
>I did a SELECT * FROM V$SESSION and discovered that the Machine column
>on the one database is not populated for SCHEMA_NAME = SYS
>
>What may have caused this and is it a problem?
>
>Is there a special meaning for SID=1?

SID is session identifier. The first one is likely to be the machine you are on, I suppose. See the Server Reference Manual for the basic layout of V$SESSION.

>
>Any background on how v$session is created and populated would be useful
>as well.

Go to $ORACLE_HOME/rdbms/admin and check out catalog.sql. You see, it is actually the V_$session table.

When you log in, the server process populates it. I would have guessed the machine comes from /etc/hosts for local and sqlnet for remote. But let us know what you figure out. Is your machine listed in its own hosts file? Have you run all the cat* programs?

>
>--
>Ken Madsen

jg
--
These opinions are my own and not necessarily those of Information Quest or Pebble In The Sky http://www.informationquest.com mailto:jgarry@nospameiq.com http://ourworld.compuserve.com/homepages/joel_garry Remove nospam to reply. mailto:joel_garry_at_compuserve.nospam.com "See your DBA?" I AM the @#%*& DBA! Received on Thu Jul 23 1998 - 18:45:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US