{"id":73,"date":"2022-11-09T15:17:04","date_gmt":"2022-11-09T18:17:04","guid":{"rendered":"https:\/\/kappasoft.com.br\/wiki\/?p=73"},"modified":"2022-11-09T15:17:05","modified_gmt":"2022-11-09T18:17:05","slug":"query-para-saber-o-tamanho-das-tablespaces","status":"publish","type":"post","link":"https:\/\/kappasoft.com.br\/wiki\/2022\/11\/09\/query-para-saber-o-tamanho-das-tablespaces\/","title":{"rendered":"Query para saber o tamanho das tablespaces"},"content":{"rendered":"\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;sql&quot;,&quot;mime&quot;:&quot;text\/x-sql&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;SQL&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;sql&quot;}\">set echo off feedback off verify off pages 75\ncol tablespace_name format a20 head 'Tablespace Name'\ncol total format 999,999,999,999 head 'Total(KB)'\ncol used format 999,999,999,999 head 'Used(KB)'\ncol free format 999,999,999,999 head 'Free(KB)'\ncol pct format 999 head 'Percent|Used'\nbreak on report\ncompute sum of total on report\ncompute sum of used on report\ncompute sum of free on report\nselect    tbs.tablespace_name,\ntot.bytes\/1024 total,\ntot.bytes\/1024-sum(nvl(fre.bytes,0))\/1024 used,\nsum(nvl(fre.bytes,0))\/1024 free,\n(1-sum(nvl(fre.bytes,0))\/tot.bytes)*100 pct\nfrom      dba_free_space fre,\n(select  tablespace_name, sum(bytes) bytes\nfrom      dba_data_files\ngroup by tablespace_name) tot,\ndba_tablespaces tbs\nwhere   tot.tablespace_name    = tbs.tablespace_name\nand        fre.tablespace_name(+) = tbs.tablespace_name\ngroup by tbs.tablespace_name, tot.bytes\/1024, tot.bytes\nunion\nselect    tsh.tablespace_name,\ndtf.bytes\/1024 total,\nsum(nvl(tsh.bytes_used,0))\/1024 used,\nsum(nvl(tsh.bytes_free,0))\/1024 free,\n(1-sum(nvl(tsh.bytes_free,0))\/dtf.bytes)*100 pct\nfrom             v$temp_space_header tsh,\n(select tablespace_name, sum(bytes) bytes\nfrom dba_temp_files\ngroup by tablespace_name) dtf\nwhere   dtf.tablespace_name     = tsh.tablespace_name(+)\ngroup by tsh.tablespace_name, dtf.bytes\/1024, dtf.bytes\norder by 1\n<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2],"tags":[],"class_list":["post-73","post","type-post","status-publish","format-standard","hentry","category-banco-de-dados","category-oracle"],"_links":{"self":[{"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":1,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/posts\/73\/revisions"}],"predecessor-version":[{"id":74,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/posts\/73\/revisions\/74"}],"wp:attachment":[{"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/media?parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kappasoft.com.br\/wiki\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}