Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle undo tablespace list by user

-- UNDO tablespace usage per user / session
SELECT s.SID, s.USERNAME, round(sum(ss.VALUE) / 1e6, 2) AS UNDO_SIZE_MB,
       sql.ELAPSED_TIME, sql.SQL_TEXT
FROM V$SESSTAT ss JOIN V$SESSION s ON s.SID = ss.SID
     JOIN V$STATNAME STAT ON STAT.STATISTIC# = ss.STATISTIC#
     LEFT JOIN V$SQLAREA sql 
     	ON s.SQL_ADDRESS = sql.ADDRESS AND s.SQL_HASH_VALUE = sql.HASH_VALUE
WHERE STAT.NAME = 'undo change vector size' AND s.TYPE <> 'BACKGROUND' 
  AND s.USERNAME IS NOT NULL AND ss.VALUE >= 0.01 * 1e6
GROUP BY s.SID, s.USERNAME, sql.ELAPSED_TIME, sql.SQL_TEXT
ORDER BY s.USERNAME, round(sum(ss.VALUE) / 1e6, 2);
Comment

PREVIOUS NEXT
Code Example
Sql :: oracle undo tablespace schema 
Sql :: square in sql 
Sql :: how to comment in sql 
Sql :: google cloud sql postgres url example 
Sql :: how to relationship query two different tables in MySQL 
Sql :: cast in sql 
Sql :: sql insert into statement 
Sql :: sql join on comma separated field 
Sql :: sql insert exemplo 
Sql :: sql server select record with max id 
Sql :: if else sql 
Sql :: like query 
Sql :: sql exemplos 
Sql :: select only distinct values another table 
Sql :: sql select data type of query 
Sql :: group by max date 
Sql :: sql rownum 
Sql :: set engine to innodb 
Sql :: get number of rows in every table mysql 
Sql :: find most frequent word in sql server 
Sql :: subquery in mysql 
Sql :: SQL SELECT TOP Equivalent in oracal 
Sql :: tsql from yyyymm to date 
Sql :: tablo silme SQL 
Sql :: plsql find location of procedure 
Sql :: generate random data in mysql 
Sql :: sql server inner join 
Sql :: mysql stored procedure insert if not exists 
Sql :: mysql in clausule string array 
Sql :: oracle drop program 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =