Search
 
SCRIPT & CODE EXAMPLE
 

SQL

oracle undotbs usage

-- UNDO tablespace current usage / available space
SELECT a.TABLESPACE_NAME, SIZEMB, USAGEMB, (SIZEMB - USAGEMB) AS FREEMB
FROM (SELECT round(sum(BYTES) / 1e6) AS SIZEMB, b.TABLESPACE_NAME
      FROM DBA_DATA_FILES a, DBA_TABLESPACES b
      WHERE a.TABLESPACE_NAME = b.TABLESPACE_NAME AND b.CONTENTS LIKE '%UNDO%'
      GROUP BY b.TABLESPACE_NAME) a,
     (SELECT c.TABLESPACE_NAME, sum(BYTES) / 1e6 AS USAGEMB
      FROM DBA_UNDO_EXTENTS c
      WHERE STATUS <> 'EXPIRED'
      GROUP BY c.TABLESPACE_NAME) b
WHERE a.TABLESPACE_NAME = b.TABLESPACE_NAME;
Comment

oracle undotbs usage

-- UNDOTBS usage per User:
SELECT u.TABLESPACE_NAME          AS TABLESPACE,
       s.USERNAME,
       u.STATUS,
       sum(u.BYTES) / 1024 / 1024 AS SUM_IN_MB,
       count(u.SEGMENT_NAME)      AS SEG_CNTS
FROM DBA_UNDO_EXTENTS u, V$TRANSACTION T, V$SESSION s
WHERE T.ADDR = s.TADDR
GROUP BY u.TABLESPACE_NAME, s.USERNAME, u.STATUS
ORDER BY 1, 2, 3;
Comment

PREVIOUS NEXT
Code Example
Sql :: foreign key sqlite3 python 
Sql :: change old domain to new domain name wordpress 
Sql :: buscar nombre de columna en todas las tablas sql server 
Sql :: sql remove not null constraint 
Sql :: Select last row from SQL Table 
Sql :: oracle search in date columns 
Sql :: sql timestamp to date 
Sql :: grant all privileges mysql 
Sql :: replace all numbers in mysql 
Sql :: mysql how to change default charset 
Sql :: mysql concatenate select results 
Sql :: opensuse restart MySQL 
Sql :: convert rows to string sql server 
Sql :: insert data in pgsql 
Sql :: alter table add column forigen key mysql 
Sql :: SQL Server Get the current identity value of the table 
Sql :: sql server: difference between hashtable and table declared using declare keyword 
Sql :: install postgresql centos 5 
Sql :: sql add column to table 
Sql :: mysql limit rows 
Sql :: CONCAT_WS() concat function we can use for adds two or more expressions together with a separator or delimeter. 
Sql :: oracle show column of table 
Sql :: SQL Server rename foreign key constraint 
Sql :: sql column contains special character 
Sql :: sqlite truncate tables command 
Sql :: How to drop a foreign key constraint in mysql ? 
Sql :: sql function 
Sql :: drop multiple columns in sql 
Sql :: Postgresql get diff between two dates in Months 
Sql :: oracle log files 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =