{"id":69,"date":"2017-02-07T15:17:25","date_gmt":"2017-02-07T14:17:25","guid":{"rendered":"https:\/\/blog.kurschies.de\/?p=69"},"modified":"2017-02-23T07:20:42","modified_gmt":"2017-02-23T06:20:42","slug":"ora-01652-who-is-using-the-temp-tablespace","status":"publish","type":"post","link":"https:\/\/blog.kurschies.de\/index.php\/2017\/02\/07\/ora-01652-who-is-using-the-temp-tablespace\/","title":{"rendered":"ORA-01652: Who is using the temp tablespace?"},"content":{"rendered":"<p>if you are getting the error &#8220;ORA-01652: unable to extend temp segment by 128 in tablespace TEMP&#8221; you could just increase the temp tablespace, i.e. by adding an additional tempfile&#8230; the smarter way would be to check who is consuming so much temp tablespace&#8230;<\/p>\n<p>The following SQL is giving you a live view:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nSELECT\r\n\t s.sid\r\n\t,s.serial#  \r\n\t,s.osuser\r\n\t,s.user#\r\n\t,s.username \r\n\t,s.sql_id\r\n\t,s.module\r\n\t,s.program \r\n\t,round(su.blocks * tbs.block_size \/ 1024 \/ 1024 \/1024) gb_used \r\n\t,su.tablespace\r\n\t--,sa.sql_text     -- uncomment if you want to see the SQL text\r\n\t--,sa.sql_fulltext -- uncomment if your Client can handle CLOB's (i.e. SQL Developer)\r\nFROM  v$sort_usage su   \r\ninner join v$session s on su.session_addr=s.saddr\r\ninner join dba_tablespaces tbs on su.tablespace=tbs.tablespace_name\r\ninner join v$sqlarea sa on s.sql_id=sa.sql_id\r\nwhere su.blocks*tbs.block_size &gt; 1024*1024*1024 -- more than 1 GB TEMP\r\nORDER BY gb_used desc; \r\n<\/pre>\n<p>and if you have to check what happende some time ago (take care: Diagnosting &#038; Tuning pack required!)<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nSELECT\r\n   snap_id\r\n  ,sample_time\r\n  ,session_id\r\n  ,session_serial#\r\n  ,sql_id\r\n  ,round(temp_space_allocated\/1024\/1024\/1024) gb_used\r\n  FROM dba_hist_active_sess_history\r\nWHERE temp_space_allocated &gt; 1024*1024*1024\r\nORDER BY sample_time;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>if you are getting the error &#8220;ORA-01652: unable to extend temp segment by 128 in tablespace TEMP&#8221; you could just increase the temp tablespace, i.e. by adding an additional tempfile&#8230; the smarter way would be to check who is consuming &hellip; <a href=\"https:\/\/blog.kurschies.de\/index.php\/2017\/02\/07\/ora-01652-who-is-using-the-temp-tablespace\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[7],"class_list":["post-69","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-oracle"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8m6YC-17","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/blog.kurschies.de\/index.php\/wp-json\/wp\/v2\/posts\/69","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kurschies.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kurschies.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kurschies.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kurschies.de\/index.php\/wp-json\/wp\/v2\/comments?post=69"}],"version-history":[{"count":7,"href":"https:\/\/blog.kurschies.de\/index.php\/wp-json\/wp\/v2\/posts\/69\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/blog.kurschies.de\/index.php\/wp-json\/wp\/v2\/posts\/69\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/blog.kurschies.de\/index.php\/wp-json\/wp\/v2\/media?parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kurschies.de\/index.php\/wp-json\/wp\/v2\/categories?post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kurschies.de\/index.php\/wp-json\/wp\/v2\/tags?post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}