SELECT name

FROM V$database;                      
                                                              
Cria uma função no oracle pra não precisar dar acesso da V$database para
todos os usuários.

-----Mensagem original-----
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome
de Marcelo Guimarães
Enviada em: segunda-feira, 30 de abril de 2007 16:55
Para: [email protected]
Assunto: Re: SPAM:[sqlwin] NOME DO HOST


Grato pela atenção,
 
Mas eu preciso de informações do servidor, não do cliente. 
Como posso obter o nome do servidor com o qual estou conectado?

----- Original Message ----- 
From: Jose Augusto S.  <mailto:[EMAIL PROTECTED]> Oliveira

To: [email protected] <mailto:[email protected]>  
Sent: Monday, April 30, 2007 8:22 AM
Subject: RES: SPAM:[sqlwin] NOME DO HOST


Talvez isso ajude....

 

 

Select SYS_CONTEXT('USERENV','OS_USER') From Dual

 


é o usuário que utiliza para se logar. Veja a lista completa do que vc pode
obter com sys_context:


Possible values that can be used for the USERENV Namespace:
---------------------------------------------------------

(Extracted from SQL Reference Documentation)

TERMINAL          The operating system identifier for the client of the 
                  current session.  In distributed SQL statements, this 
                  option returns the identifier for your local session. 
                  In a distributed environment, this is supported only 
                  for remote SELECTs, not for remote INSERTs, UPDATEs, 
                  or DELETEs. (The return length of this parameter may 
                  vary by operating system.) 
LANGUAGE          The language and territory currently used by your session,

                  along with the database character set, in this form: 
                    language_territory.characterset 
LANG              The ISO abbreviation for the language name, a shorter form

                  than the existing 'LANGUAGE' parameter. 
SESSIONID         The auditing session identifier.  You cannot use this 
                  option in distributed SQL statements. 
INSTANCE          The instance identification number of the current
instance.  
ENTRYID           The available auditing entry identifier.  You cannot use 
                  this option in distributed SQL statements.  To use this 
                  keyword in USERENV, the initialization parameter
AUDIT_TRAIL 
                  must be set to TRUE.  
ISDBA             TRUE if you currently have the DBA role enabled and FALSE 
                  if you do not.  
CLIENT_INFO       Returns up to 64 bytes of user session information that
can 
                  be stored by an application using the
DBMS_APPLICATION_INFO 
                  package. 
NLS_TERRITORY     The territory of the current session. 
NLS_CURRENCY      The currency of the current session. 
NLS_CALENDAR      The current calendar of the current session. 
NLS_DATE_FORMAT   The date format for the session. 
NLS_DATE_LANGUAGE The language used for expressing dates. 
NLS_SORT          BINARY or the linguistic sort basis. 
CURRENT_USER      The name of the user whose privilege the current session
is 
                  under. 
CURRENT_USERID    User ID of the user whose privilege the current session is

                  under. 
SESSION_USER      Database user name by which the current user is
authenticated. 
                  This value remains the same throughout the duration of the

                  session. 
SESSION_USERID    Identifier of the database user name by which the current 
                  user is authenticated. 
CURRENT_SCHEMA    Name of the default schema being used in the current
schema.  
                  This value can be changed during the session with an ALTER

                  SESSION SET CURRENT_SCHEMA statement. 
CURRENT_SCHEMAID  Identifier of the default schema being used in the current

                  session. 
PROXY_USER        Name of the database user who opened the current session
on 
                  behalf of SESSION_USER. 
PROXY_USERID      Identifier of the database user who opened the current
session
                  on behalf of SESSION_USER. 
DB_DOMAIN         Domain of the database as specified in the DB_DOMAIN 
                  initialization parameter. 
DB_NAME           Name of the database as specified in the DB_NAME 
                  initialization parameter. 
HOST              Name of the host machine from which the client has
connected. 
OS_USER           Operating system username of the client process that
initiated 
                  the database session. 
EXTERNAL_NAME     External name of the database user.  For SSL authenticated

                  sessions using V.503 certificates, this field returns the 
                  distinguished name (DN) stored in the user certificate. 
IP_ADDRESS        IP address of the machine from which the client is
connected. 
NETWORK_PROTOCOL  Network protocol being used for communication, as
specified 
                  in the 'PROTOCOL=protocol' portion of the connect string. 
BG_JOB_ID         Job ID of the current session if it was established by an 
                  Oracle background process.  Null if the session was not 
                  established by a background process. 
FG_JOB_ID         Job ID of the current session if it was established by a 
                  client foreground process.  Null if the session was not 
                  established by a foreground process. 
AUTHENTICATION_TYPE  How the user was authenticated: 
                     DATABASE: Username/password authentication. 
                     OS: Operating system external user authentication.
                     NETWORK: Network protocol or ANO authentication. 
                     PROXY: OCI proxy connection authentication. 
AUTHENTICATION_DATA  Data being used to authenticate the login user.  For 
                     X.503 certificate authenticated sessions, this field 
                     returns the context of the certificate in HEX2 format

 

 

-----Mensagem original-----
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em nome
de Marcelo Guimarães
Enviada em: sexta-feira, 27 de abril de 2007 17:45
Para: sqlwin
Assunto: SPAM:[sqlwin] NOME DO HOST

 

Caros Colegas,

possuo três servidores ORACLE e preciso saber dentro de um aplicativo gupta
com qual servidor estou conectado. 

 

No cliente do oracle mudo o nome do serviço e do host associado, mantendo o
mesmo nome do serviço de rede. Desta forma, dentro do aplicativo a variável
SqlDatabase permanece com o mesmo valor para qualquer um dos três host. 

Então como posso obter o nome do host com o qual estou conectado?

 

 

atenciosamente,

Marcelo Guimarães


---------------------------------------------------------- 
Esta mensagem e seus anexos podem conter informações confidenciais ou
privilegiadas. Se você não é o destinatário dos mesmos você não está
autorizado a utilizar o material para qualquer fim. Solicitamos que você
apague a mensagem e avise imediatamente ao remetente. O conteúdo desta
mensagem e seus anexos não representam necessariamente a opinião e a
intenção da empresa, não implicando em qualquer obrigação ou
responsabilidade por parte da mesma.
 This message may contain confidential and/or privileged information. If you
are not the addressee or authorized to receive this for the addressee, you
must not use, copy, disclose or take any action based on this message or any
information herein. If you have received this message in error, please
advise the sender immediately by reply e-mail and delete this message. The
contents of this message and its attachments do not necessarily express the
opinion or the intention of the company, and do not implies any legal
obligation or responsabilities from this company. 
----------------------------------------------------------

Responder a