{"id":249,"date":"2012-03-02T04:36:02","date_gmt":"2012-03-02T04:36:02","guid":{"rendered":"http:\/\/oranotes.tuktaroff.com\/?page_id=249"},"modified":"2012-03-02T04:36:36","modified_gmt":"2012-03-02T04:36:36","slug":"temp-tbs-status","status":"publish","type":"page","link":"http:\/\/oranotes.tuktaroff.com\/?page_id=249","title":{"rendered":"Temp tbs status"},"content":{"rendered":"<p><code><br \/>\n<script type=\"text\/javascript\"> \nfunction copy(what) {\n    window.clipboardData.setData('Text',what.value);\n}\nfunction paste(what) {\n    what.value = window.clipboardData.getData('Text');\n}\n<\/script><\/p>\n<form action=\"\"><textarea name=\"data\" cols=\"50\" rows=\"10\" style=\"display:none;\"><br \/>\nSET LINESIZE 145<br \/>\nSET PAGESIZE 9999<br \/>\nSET VERIFY   off<\/p>\n<p>COLUMN tablespace_name       FORMAT a18               HEAD 'Tablespace Name'<br \/>\nCOLUMN tablespace_status     FORMAT a9                HEAD 'Status'<br \/>\nCOLUMN tablespace_size       FORMAT 999,999,999,999   HEAD 'Size'<br \/>\nCOLUMN used                  FORMAT 999,999,999,999   HEAD 'Used'<br \/>\nCOLUMN used_pct              FORMAT 999               HEAD 'Pct. Used'<br \/>\nCOLUMN current_users         FORMAT 9,999             HEAD 'Current Users'<\/p>\n<p>BREAK ON report<br \/>\nCOMPUTE SUM OF tablespace_size  ON report<br \/>\nCOMPUTE SUM OF used             ON report<br \/>\nCOMPUTE SUM OF current_users    ON report<\/p>\n<p>SELECT<br \/>\n    d.tablespace_name                      tablespace_name<br \/>\n  , d.status                               tablespace_status<br \/>\n  , NVL(a.bytes, 0)                        tablespace_size<br \/>\n  , NVL(t.bytes, 0)                        used<br \/>\n  , TRUNC(NVL(t.bytes \/ a.bytes * 100, 0)) used_pct<br \/>\n  , NVL(s.current_users, 0)                current_users<br \/>\nFROM<br \/>\n    sys.dba_tablespaces d<br \/>\n  , ( select tablespace_name, sum(bytes) bytes<br \/>\n      from dba_temp_files<br \/>\n      group by tablespace_name<br \/>\n    ) a<br \/>\n  , ( select tablespace_name, sum(bytes_cached) bytes<br \/>\n      from v$temp_extent_pool<br \/>\n      group by tablespace_name<br \/>\n    ) t<br \/>\n  , v$sort_segment  s<br \/>\nWHERE<br \/>\n      d.tablespace_name = a.tablespace_name(+)<br \/>\n  AND d.tablespace_name = t.tablespace_name(+)<br \/>\n  AND d.tablespace_name = s.tablespace_name(+)<br \/>\n  AND d.extent_management like 'LOCAL'<br \/>\n  AND d.contents like 'TEMPORARY'<br \/>\n\/<br \/>\n<\/textarea><input type=\"button\" value=\"Clipboard\" onclick=\"copy(this.form.data)\"><\/form>\n<pre class=\"qcode\">\r\nSET LINESIZE 145\r\nSET PAGESIZE 9999\r\nSET VERIFY   off\r\n\r\nCOLUMN tablespace_name       FORMAT a18               HEAD 'Tablespace Name'\r\nCOLUMN tablespace_status     FORMAT a9                HEAD 'Status'\r\nCOLUMN tablespace_size       FORMAT 999,999,999,999   HEAD 'Size'\r\nCOLUMN used                  FORMAT 999,999,999,999   HEAD 'Used'\r\nCOLUMN used_pct              FORMAT 999               HEAD 'Pct. Used'\r\nCOLUMN current_users         FORMAT 9,999             HEAD 'Current Users'\r\n\r\nBREAK ON report\r\nCOMPUTE SUM OF tablespace_size  ON report\r\nCOMPUTE SUM OF used             ON report\r\nCOMPUTE SUM OF current_users    ON report\r\n\r\nSELECT\r\n    d.tablespace_name                      tablespace_name\r\n  , d.status                               tablespace_status\r\n  , NVL(a.bytes, 0)                        tablespace_size\r\n  , NVL(t.bytes, 0)                        used\r\n  , TRUNC(NVL(t.bytes \/ a.bytes * 100, 0)) used_pct\r\n  , NVL(s.current_users, 0)                current_users\r\nFROM\r\n    sys.dba_tablespaces d\r\n  , ( select tablespace_name, sum(bytes) bytes\r\n      from dba_temp_files\r\n      group by tablespace_name\r\n    ) a\r\n  , ( select tablespace_name, sum(bytes_cached) bytes\r\n      from v$temp_extent_pool\r\n      group by tablespace_name\r\n    ) t\r\n  , v$sort_segment  s\r\nWHERE\r\n      d.tablespace_name = a.tablespace_name(+)\r\n  AND d.tablespace_name = t.tablespace_name(+)\r\n  AND d.tablespace_name = s.tablespace_name(+)\r\n  AND d.extent_management like 'LOCAL'\r\n  AND d.contents like 'TEMPORARY'\r\n\/\r\n<\/pre>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SET LINESIZE 145 SET PAGESIZE 9999 SET VERIFY off COLUMN tablespace_name FORMAT a18 HEAD &#8216;Tablespace Name&#8217; COLUMN tablespace_status FORMAT a9 HEAD &#8216;Status&#8217; COLUMN tablespace_size FORMAT 999,999,999,999 HEAD &#8216;Size&#8217; COLUMN used FORMAT 999,999,999,999 HEAD &#8216;Used&#8217; COLUMN used_pct FORMAT 999 HEAD &#8216;Pct. Used&#8217; COLUMN current_users FORMAT 9,999 HEAD &#8216;Current Users&#8217; BREAK ON report COMPUTE SUM OF tablespace_size [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":25,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-249","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P2NVny-41","_links":{"self":[{"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=\/wp\/v2\/pages\/249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=249"}],"version-history":[{"count":2,"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=\/wp\/v2\/pages\/249\/revisions"}],"predecessor-version":[{"id":251,"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=\/wp\/v2\/pages\/249\/revisions\/251"}],"up":[{"embeddable":true,"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=\/wp\/v2\/pages\/25"}],"wp:attachment":[{"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}