Hi,
We are trying to Migrate this T-SQL code snippet :-
SELECT master.dbo.sysdatabases.name
FROM master.dbo.sysdatabases
INNER JOIN master.dbo.sysprocesses
on master.dbo.sysprocesses.dbid = master.dbo.sysdatabases.dbid
WHERE master.dbo.sysprocesses.spid = @@SPID
We have migrated @@SPID in Oracle in this Way :-
SELECT SYS_CONTEXT ('USERENV' ,'SESSIONID') FROM DUAL;
However, we are facing a problem when we try to query the data in V$Session and V$Process Tables. We are nto sure if we need to get the SERVICE_NAME in V$Session based on a comparison with AUDSID or SID.
We are also not sure about the meaning of SPID in V$Process.
Can anyone shed some light on this ? We are desperately looking for an equivalent for this code. We are using Oracle 10G:-
SQL> SELECT * FROM V$VERSION;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
Thanks,
Sandeep