I cannot believe that oracle still didn't create a function
which would return session id and serial#. This question has been
asked ever since Oracle v6 and it is always the same answer:
userenv('AUDSID') (or, equivalent version: SYS_CONTEXT('USERENV','AUDSID'))
How long will it take for them to finally get it? Is there a reason
why we cannot have simple SYS_CONTEXT('USERENV','SID') ?