• Arun Kumar

Find Current Session SID in Oracle

Sometimes when you are connected to Oracle database, you might need to find your own session SID and serial number. Below are the two queries that can help you find SID and serial number of current sessions that you connected with


Find SID in normal database


In a normal standalone database, use below query

select sid from v$mystat where rownum=1;


Find SID in RAC database


In a RAC database, you must also know the details of the instance that you are connected with. Below query will give you SID, serial # along with the instance number

SELECT SID, SERIAL#,inst_id
FROM GV$SESSION
WHERE sid=(select sid from v$mystat where rownum=1); 


48 views

Recent Posts

See All

Temp Tablespace utilization

It is very common that as a DBA you will encounter ‘ORA-1652: unable to extend temp segment’. Handling temporary tablespace is different than permanent tablespaces inside Oracle. On a high level, temp

Estimate flashback destination size

Sometimes application team will ask DBA to enable flashback for x number of days. In such case, a DBA needs to estimate the flashback space required for x number of days in order to store the flashbac

Datafile utilization check

When you want to shrink a datafile, you must always check the single datafile utilization. In case if you shrink datafile more than the used size, it will fail. Below query gives the datafile utilizat

  • Facebook
  • Twitter
  • YouTube
  • Instagram

© 2020 by DBA Genesis

Feedback