27 Januari, 2015

SQL untuk mengetahui nama database oracle dari user

Untuk mengetahui database name, instance name, current user, dan host name dari sintak SQL Oracle, bisa dilakukan dengan cara berikut :

SQL:

select 
  user "CURRENT USER", 
  sys_context('userenv','instance_name') "INSTANCE NAME",
  sys_context('userenv','db_name') "DB NAME", 
  sys_context('userenv', 'server_host') "HOST NAME"
from 
  dual;


Contoh output :
CURRENT USER          INSTANCE NAME          DB NAME      HOST NAME    
---------------------            ------------------------           ----------------- ---------------
APSQA                           orcl                                     orcl                 hermanw-pc    

1 rows selected


2 komentar:

Anonim mengatakan...

Great blog you have got here.. It's difficult to find
good quality writing like yours these days. I truly appreciate
individuals like you! Take care!!

Stop by my homepage website []

Anonim mengatakan...

Pretty! This was a really wonderful article. Thank
you for supplying these details.

my site ::