{"id":21,"date":"2012-03-01T02:09:24","date_gmt":"2012-03-01T02:09:24","guid":{"rendered":"http:\/\/oranotes.tuktaroff.com\/?page_id=21"},"modified":"2012-11-12T03:07:51","modified_gmt":"2012-11-12T03:07:51","slug":"tempfiles","status":"publish","type":"page","link":"http:\/\/oranotes.tuktaroff.com\/?page_id=21","title":{"rendered":"Tempfiles"},"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<h2>\nTemp tablespaces datafiles<br \/>\n<\/h2>\n<pre class=\"qcode\">\r\nSET LINESIZE 147\r\nSET PAGESIZE 9999\r\nSET VERIFY   OFF\r\n\r\nCOLUMN tablespace      FORMAT a29                HEADING 'Tablespace Name'\r\nCOLUMN filename        FORMAT a64                HEADING 'Filename'\r\nCOLUMN filesize        FORMAT 9,999,999,999,999  HEADING 'File Size'\r\nCOLUMN autoextensible  FORMAT a4                 HEADING 'Auto'\r\nCOLUMN increment_by    FORMAT 999,999,999        HEADING 'Next'\r\nCOLUMN maxbytes        FORMAT 99,999,999,999     HEADING 'Max'\r\n\r\nBREAK ON report\r\nCOMPUTE SUM OF filesize  ON report\r\n\r\nSELECT\r\n    d.tablespace_name                     tablespace \r\n  , d.file_name                           filename\r\n  , d.bytes                               filesize\r\n  , d.autoextensible                      autoextensible\r\n  , d.increment_by * e.value              increment_by\r\n  , d.maxbytes                            maxbytes\r\nFROM\r\n    sys.dba_temp_files d\r\n  , (SELECT value\r\n     FROM v$parameter \r\n     WHERE name = 'db_block_size') e\r\nORDER BY 1,2\r\n\/\r\n<\/pre>\n<form action=\"\"><textarea name=\"data\" cols=\"50\" rows=\"10\" style=\"display:none;\"><br \/>\nSET LINESIZE 147<br \/>\nSET PAGESIZE 9999<br \/>\nSET VERIFY   OFF<\/p>\n<p>COLUMN tablespace      FORMAT a29                HEADING 'Tablespace Name'<br \/>\nCOLUMN filename        FORMAT a64                HEADING 'Filename'<br \/>\nCOLUMN filesize        FORMAT 9,999,999,999,999  HEADING 'File Size'<br \/>\nCOLUMN autoextensible  FORMAT a4                 HEADING 'Auto'<br \/>\nCOLUMN increment_by    FORMAT 999,999,999        HEADING 'Next'<br \/>\nCOLUMN maxbytes        FORMAT 99,999,999,999     HEADING 'Max'<\/p>\n<p>BREAK ON report<br \/>\nCOMPUTE SUM OF filesize  ON report<\/p>\n<p>SELECT<br \/>\n    d.tablespace_name                     tablespace<br \/>\n  , d.file_name                           filename<br \/>\n  , d.bytes                               filesize<br \/>\n  , d.autoextensible                      autoextensible<br \/>\n  , d.increment_by * e.value              increment_by<br \/>\n  , d.maxbytes                            maxbytes<br \/>\nFROM<br \/>\n    sys.dba_temp_files d<br \/>\n  , (SELECT value<br \/>\n     FROM v$parameter<br \/>\n     WHERE name = 'db_block_size') e<br \/>\nORDER BY 1,2<br \/>\n\/<br \/>\n<\/textarea><input type=\"button\" value=\"Clipboard\" onclick=\"copy(this.form.data)\"><\/form>\n<h2>\nTemp tablespace usage<br \/>\n<\/h2>\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<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<h2>\nAdd new datafile to temp tablespace<br \/>\n<\/h2>\n<pre class=\"qcode\">\r\nalter tablespace TEMP add tempfile 'new_temp_file' size 1G autoextend on next 128M maxsize 4G;\r\n<\/pre>\n<form action=\"\"><textarea name=\"data\" cols=\"50\" rows=\"10\" style=\"display:none;\"><br \/>\nalter tablespace TEMP add tempfile 'new_temp_file' size 1G autoextend on next 128M maxsize 4G;<br \/>\n<\/textarea><input type=\"button\" value=\"Clipboard\" onclick=\"copy(this.form.data)\"><\/form>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Temp tablespaces datafiles SET LINESIZE 147 SET PAGESIZE 9999 SET VERIFY OFF COLUMN tablespace FORMAT a29 HEADING &#8216;Tablespace Name&#8217; COLUMN filename FORMAT a64 HEADING &#8216;Filename&#8217; COLUMN filesize FORMAT 9,999,999,999,999 HEADING &#8216;File Size&#8217; COLUMN autoextensible FORMAT a4 HEADING &#8216;Auto&#8217; COLUMN increment_by FORMAT 999,999,999 HEADING &#8216;Next&#8217; COLUMN maxbytes FORMAT 99,999,999,999 HEADING &#8216;Max&#8217; BREAK ON report COMPUTE SUM [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":11,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-21","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P2NVny-l","_links":{"self":[{"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=\/wp\/v2\/pages\/21","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=21"}],"version-history":[{"count":6,"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=\/wp\/v2\/pages\/21\/revisions"}],"predecessor-version":[{"id":407,"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=\/wp\/v2\/pages\/21\/revisions\/407"}],"up":[{"embeddable":true,"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=\/wp\/v2\/pages\/11"}],"wp:attachment":[{"href":"http:\/\/oranotes.tuktaroff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}