Thursday, May 7, 2009

Oracle: SQL to find CPU used percentage for each session

Select username,v.sid||','||v.serial# sid_session,round((s.value/y.value)*100,2) cpu_used_percentage
from v$session v, v$sesstat s,v$sysstat y
where v.username is not null
and v.sid = s.sid
and s.statistic#=y.statistic#
and y. name = 'CPU used by this session'
Order by username,3 desc

EXP-00003: no storage definition found for segment(xx, xx)

This error may occur while exporting table with LOB columns or large tables expanding to multiple extents.

Resolution: Make sure that the version of your export client matches or greater than database version.

You will get this error when export client version is lower than database version.

Example: Exporting 9.2.08 database with 9.2.0.1 client.