Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle undo tablespace schema

-- 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 :: postgresql port 5432 not open 
Sql :: case statement in select query in sql 
Sql :: mysql last friday of current month 
Sql :: mysql default port number 
Sql :: concat all rows in sql postgres 
Sql :: add column postgresql 
Sql :: order by sql query 
Sql :: fk in insert mysql 
Sql :: sql date with month and year only 
Sql :: oracle drop type 
Sql :: sqlite update query python 
Sql :: between date in sql server 
Sql :: mysql select inside sum 
Sql :: insert data from one database table to another database table in postgresql using pgadmin 
Sql :: get only one row in mysql 
Sql :: mysql string split to array 
Sql :: spark apache sql coalesce 
Sql :: SQL isnumeric DB2 
Sql :: sql not equal to operator 
Sql :: what is drop in sql 
Sql :: postgres insert into table 
Sql :: sql order of execution 
Sql :: how to show current database in mysql 
Sql :: oracle create or replace index 
Sql :: mysql remove tabs from string 
Sql :: postgresql inheritance 
Sql :: how to declare variable date in mysql 
Sql :: change column in mysql 
Sql :: insert ip address in mysql 
Sql :: oracle swap partition 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =