Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. select SUM(bytes/1024/1024) from dba_data_files where TABLESPACE_NAME='UNDOTBS1'
  2.  
  3. SUM(BYTES/1024/1024)
  4. --------------------
  5. 7000
  6.  
  7. select SUM(BYTES/1024/1024) from DBA_UNDO_EXTENTS where STATUS LIKE 'ACTIVE';
  8.  
  9. SUM(BYTES/1024/1024)
  10. --------------------
  11. 8
  12.  
  13. select SUM(bytes/1024/1024) from dba_data_files where TABLESPACE_NAME='UNDOTBS1'
  14. minus
  15. select SUM(BYTES/1024/1024) from DBA_UNDO_EXTENTS where STATUS='ACTIVE';
  16.  
  17. SELECT
  18. (SELECT SUM(bytes/1024/1024) as sum_a
  19. from dba_data_files where TABLESPACE_NAME='UNDOTBS1')
  20. - (select SUM(BYTES/1024/1024) as sum_b
  21. from DBA_UNDO_EXTENTS where STATUS LIKE 'ACTIVE') as Difference
  22. FROM
  23. dual;
  24.  
  25. SELECT sum_a-sum_b as result
  26. FROM
  27. (SELECT SUM(bytes/1024/1024) as sum_a from dba_data_files where TABLESPACE_NAME='UNDOTBS1') as a,
  28. (select SUM(BYTES/1024/1024) as sum_b from DBA_UNDO_EXTENTS where STATUS LIKE 'ACTIVE') as b
  29.  
  30. SELECT ...
  31. minus
  32. SELECT...
  33.  
  34. select (SUM(u.bytes) - SUM(a.BYTES)) /1024/1024
  35. from dba_data_files u
  36. cross join DBA_UNDO_EXTENTS a
  37. where u.TABLESPACE_NAME='UNDOTBS1'
  38. and a.STATUS='ACTIVE';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement