{"id":421,"date":"2008-06-05T17:25:17","date_gmt":"2008-06-05T15:25:17","guid":{"rendered":"http:\/\/www.loeda.net\/blog\/?p=421"},"modified":"2009-03-21T23:49:21","modified_gmt":"2009-03-21T22:49:21","slug":"oracle-check-freeused-space-per-tablespace","status":"publish","type":"post","link":"https:\/\/www.loeda.net\/bitacora\/2008\/06\/05\/oracle-check-freeused-space-per-tablespace\/","title":{"rendered":"Oracle, Check free\/used space per tablespace"},"content":{"rendered":"<p>Esta consulta permite ver el espacio libre y el ocupado en oracle.<br \/>\n[sourcecode language=\u00bbsql\u00bb]<br \/>\nSELECT<br \/>\n  df.tablespace_name \u00abTablespace\u00bb,<br \/>\n  df.bytes \/ (1024 * 1024) \u00abTama\u00f1o (Mb)\u00bb,<br \/>\n  SUM(fs.bytes) \/ (1024 * 1024) \u00abLibre (Mb)\u00bb,<br \/>\n  Nvl(Round(SUM(fs.bytes) * 100 \/ df.bytes),1) \u00ab% Libre\u00bb,<br \/>\n  Round((df.bytes &#8211; SUM(fs.bytes)) * 100 \/ df.bytes) \u00ab% Usado\u00bb<br \/>\nFROM<br \/>\n  dba_free_space fs,<br \/>\n    (<br \/>\n      SELECT<br \/>\n        tablespace_name,SUM(bytes) bytes<br \/>\n      FROM<br \/>\n        dba_data_files<br \/>\n      GROUP BY<br \/>\n        tablespace_name<br \/>\n    ) df<br \/>\nWHERE<br \/>\n  fs.tablespace_name (+)  = df.tablespace_name<br \/>\nGROUP BY<br \/>\n  df.tablespace_name,df.bytes<br \/>\nUNION ALL<br \/>\nSELECT<br \/>\n  df.tablespace_name tspace,<br \/>\n  fs.bytes \/ (1024 * 1024),<br \/>\n  SUM(df.bytes_free) \/ (1024 * 1024),<br \/>\n  Nvl(Round((SUM(fs.bytes) &#8211; df.bytes_used) * 100 \/ fs.bytes), 1),<br \/>\n  Round((SUM(fs.bytes) &#8211; df.bytes_free) * 100 \/ fs.bytes)<br \/>\nFROM<br \/>\n  dba_temp_files fs,<br \/>\n    (<br \/>\n      SELECT<br \/>\n        tablespace_name,bytes_free,bytes_used<br \/>\n      FROM<br \/>\n        v$temp_space_header<br \/>\n      GROUP BY<br \/>\n        tablespace_name,bytes_free,bytes_used<br \/>\n    ) df<br \/>\nWHERE<br \/>\n  fs.tablespace_name (+)  = df.tablespace_name<br \/>\nGROUP BY<br \/>\n  df.tablespace_name,fs.bytes,df.bytes_free,df.bytes_used<br \/>\nORDER BY<br \/>\n5 DESC;<br \/>\n[\/sourcecode]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Esta consulta permite ver el espacio libre y el ocupado en oracle. [sourcecode language=\u00bbsql\u00bb] SELECT df.tablespace_name \u00abTablespace\u00bb, df.bytes \/ (1024 * 1024) \u00abTama\u00f1o (Mb)\u00bb, SUM(fs.bytes) \/ (1024 * 1024) \u00abLibre (Mb)\u00bb, Nvl(Round(SUM(fs.bytes) * 100 \/ df.bytes),1) \u00ab% Libre\u00bb, Round((df.bytes &#8211; SUM(fs.bytes)) * 100 \/ df.bytes) \u00ab% Usado\u00bb FROM dba_free_space fs, ( SELECT tablespace_name,SUM(bytes) bytes FROM [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[750],"class_list":["post-421","post","type-post","status-publish","format-standard","hentry","category-espana","tag-sin-etiqueta","author-emilio"],"_links":{"self":[{"href":"https:\/\/www.loeda.net\/bitacora\/wp-json\/wp\/v2\/posts\/421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.loeda.net\/bitacora\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.loeda.net\/bitacora\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.loeda.net\/bitacora\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.loeda.net\/bitacora\/wp-json\/wp\/v2\/comments?post=421"}],"version-history":[{"count":0,"href":"https:\/\/www.loeda.net\/bitacora\/wp-json\/wp\/v2\/posts\/421\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.loeda.net\/bitacora\/wp-json\/wp\/v2\/media?parent=421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.loeda.net\/bitacora\/wp-json\/wp\/v2\/categories?post=421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.loeda.net\/bitacora\/wp-json\/wp\/v2\/tags?post=421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}