I want to check SID and current database name.
I am using following query for checking oracle SID
select instance from v$thread;
but table or view does not exist error is coming.
I am using following query for checking current database name
select name from v$database;
but table or view does not exist error is coming.
Any idea for above two problems?
I presume SELECT user FROM dual;
should give you the current user
and SELECT sys_context('userenv','instance_name') FROM dual;
the name of the instance
I believe you can get SID as SELECT sys_context('USERENV', 'SID') FROM DUAL;