Monday, April 30, 2012

Oracle: To Display list of table spaces

SELECT dd.tablespace_name tablespace_name, dd.file_name file_name, dd.bytes/1024 TABLESPACE_KB, SUM(fs.bytes)/1024 KBYTES_FREE, MAX(fs.bytes)/1024 NEXT_FREE

FROM sys.dba_free_space fs, sys.dba_data_files dd

WHERE dd.tablespace_name = fs.tablespace_name

AND dd.file_id = fs.file_id

GROUP BY dd.tablespace_name, dd.file_name, dd.bytes/1024

ORDER BY dd.tablespace_name, dd.file_name;

Monday, April 9, 2012

Oracle SQL Thread: Convert String to Datetime

Found this link useful


select to_date('2007-01-01 12:00:01 AM','yyyy-mm-dd hh:mi:ss pm') as dt from dual;