How to get IP Address , Computer Name,Database User, Oracle, Database user ID, Database Name n Oracle?

You can get IP Address , Computer Name,Database User, Oracle, Database user ID, Database Name n Oracle by using these commands;

SELECT
UPPER(GET_CONTEXT_VALUE(‘TERMINAL’)) COMPUTER_NAME
FROM DUAL;

SELECT
UPPER(GET_CONTEXT_VALUE(‘SESSION_USER’)) ORACLE_USER_NAME
FROM DUAL;

SELECT
UID ORACLE_USER_ID
FROM DUAL;

SELECT
UPPER(GET_CONTEXT_VALUE(‘OS_USER’)) OS_USER_NAME
FROM DUAL;

SELECT
SYS_CONTEXT(‘USERENV’,’IP_ADDRESS’) IP_ADDRESS
FROM DUAL;
SELECT
HOST_NAME DB_NAME
FROM V$INSTANCE;

 


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>