Tag Archives: service_name

Check user environment value from SQL PROMPT in Oracle

Check user environment value from SQL PROMPT in Oracle

Check the Current Schema in Oracle

SELECT SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA') FROM DUAL;

SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
--------------------------------------------
SYS

Check the Current User in Oracle

SELECT SYS_CONTEXT('USERENV', 'SESSION_USER') FROM DUAL;

SYS_CONTEXT('USERENV','SESSION_USER')
-------------------------------------------
SYSBACKUP

Check the current Service Name

select sys_context('userenv', 'service_name') from dual;

SYS_CONTEXT('USERENV','SERVICE_NAME')
--------------------------------------------
SYS$USERS

Check the current DB Unique Name

SELECT sys_context('userenv', 'db_unique_name') FROM DUAL;

SYS_CONTEXT('USERENV','DB_UNIQUE_NAME')
--------------------------------------------
XE

Check the current Instance Name

Select sys_context('userenv', 'instance_name') from dual;

SYS_CONTEXT('USERENV','INSTANCE_NAME')
------------------------------------------
xe

Check the current Server host Name

select sys_context('userenv', 'server_host') from dual;

SYS_CONTEXT('USERENV','SERVER_HOST')
-------------------------------------------
ixc1-lp48zj622