Thursday, November 30, 2017

Oracle Tablespace sizes

select TABLESPACE_NAME "Tablspace"
 FILE_NAME "Filename"
 BYTES/1024/1024 "Size MB",
 MAXBYTES/1024/1024 "Maximum Size MB",
 AUTOEXTENSIBLE "Autoextensible"

from SYS.DBA_DATA_FILES



Wednesday, November 22, 2017

TIME STAMP DIFFERENCE AVG


 select
    avg(extract(second from intrvl)
        + extract(minute from intrvl) * 60
        + extract(hour from intrvl) * 60 * 60
        + extract(day from intrvl) * 60 * 60 * 24) average
from (
 SELECT    ( TIME_STAMP1-TIME_STAMP2) intrvl

  FROM  Z_TABLE   )