-
-- Show CPU Usage for Active Sessions
--
SET PAUSE ON
SET PAUSE 'Press Return to Continue'
SET PAGESIZE 60
SET LINESIZE 300
COLUMN username FORMAT A30
COLUMN sid FORMAT 999,999,999
COLUMN serial# FORMAT 999,999,999
COLUMN "cpu usage (seconds)" FORMAT 999,999,999.0000
SELECT
s.username,
t.sid,
s.serial#,
SUM(VALUE/100) as "cpu usage (seconds)"
FROM
v$session s,
v$sesstat t,
v$statname n
WHERE
t.STATISTIC# = n.STATISTIC#
AND
NAME like '%CPU used by this session%'
AND
t.SID = s.SID
AND
s.status='ACTIVE'
AND
s.username is not null
GROUP BY username,t.sid,s.serial#
/
Monday, 14 August 2017
cpu usage per session
Subscribe to:
Post Comments (Atom)
Featured post
Restircted session due to sync filed with ora-65177
Application is unable to connect the database due to restricted session. sql> show pdbs; SQL> show con_name CON_NAME -----------------...
-
Step 1:Check the last analyzed, tables size before Reorganization: -- Query 1:Check the last Analyzed and number of rows: SQL> sele...
-
Use the following script for this purpose for each database. REF :This script is also present in the link https://www.sqlservercentral.co...
-
alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = demo.localdomain)(PORT = 1531))'; alter system set local_listene...
No comments:
Post a Comment