{"id":175,"date":"2010-11-07T17:42:33","date_gmt":"2010-11-07T15:42:33","guid":{"rendered":"http:\/\/zoharelkayam.wordpress.com\/?p=175"},"modified":"2010-11-07T17:42:33","modified_gmt":"2010-11-07T15:42:33","slug":"shrink-tbs-to-min-size","status":"publish","type":"post","link":"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/","title":{"rendered":"\u05d0\u05d9\u05da \u05dc\u05e9\u05d7\u05e8\u05e8 \u05e9\u05d8\u05d7 \u05de-tablespace \u05dc\u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05d9\u05e0\u05d9\u05de\u05dc\u05d9 \u05e9\u05dc\u05d5"},"content":{"rendered":"<p style=\"direction:rtl;\">\u05db\u05d0\u05e9\u05e8 \u05e0\u05d5\u05e6\u05e8 \u05de\u05e6\u05d1 \u05e9\u05d1\u05d5 \u05d1-<a class=\"zem_slink\" title=\"Tablespace\" href=\"http:\/\/en.wikipedia.org\/wiki\/Tablespace\" rel=\"wikipedia\">tablespace<\/a> \u05de\u05ea\u05e4\u05e0\u05d4 \u05de\u05e7\u05d5\u05dd \u05e8\u05d1, \u05d0\u05d5\u05e8\u05e7\u05dc \u05de\u05d0\u05e4\u05e9\u05e8\u05d9\u05dd \u05dc\u05d4\u05e7\u05d8\u05d9\u05df \u05d0\u05ea \u05d4-tablespace \u05e2\u05dc \u05d9\u05d3\u05d9 \u05de\u05e2\u05d1\u05e8 \u05e2\u05dc \u05d4-datafile-\u05d9\u05dd \u05e9\u05dc\u05d5 \u05d5\u05d1\u05d9\u05e6\u05d5\u05e2\u00a0\u05e4\u05e7\u05d5\u05d3\u05d5\u05ea\u00a0resize. \u05d4\u05d1\u05e2\u05d9\u05d4 \u05de\u05ea\u05e2\u05d5\u05e8\u05e8\u05ea\u00a0\u05db\u05d0\u05e9\u05e8 \u05d9\u05e9\u05e0\u05d5 Tablespace \u05e2\u05dd \u05de\u05e1\u05e4\u05e8 datafiles (\u05d5\u05dc\u05e4\u05e2\u05de\u05d9\u05dd \u05d6\u05d4 \u05d9\u05db\u05d5\u05dc \u05dc\u05d4\u05d2\u05d9\u05e2 \u05d2\u05dd \u05dc\u05e2\u05e9\u05e8\u05d5\u05ea) \u05d5\u05d0\u05d6 \u05d4\u05e2\u05d1\u05d5\u05d3\u05d4 \u05e9\u05dc \u05de\u05e6\u05d9\u05d0\u05ea \u05d4\u05e1\u05d2\u05de\u05e0\u05d8 \u05e9&quot;\u05d7\u05d5\u05e1\u05dd&quot; \u05d0\u05ea \u05e9\u05d7\u05e8\u05d5\u05e8 \u05d4\u05e9\u05d8\u05d7 \u05d4\u05e4\u05e0\u05d5\u05d9\u00a0\u05d4\u05d5\u05e4\u05da \u05dc\u05d4\u05d9\u05d5\u05ea \u05de\u05e9\u05d9\u05de\u05d4 \u05de\u05d4\u05d2\u05d4\u05d9\u05e0\u05d5\u05dd: \u05d2\u05dd \u05d4\u05d6\u05d9\u05d4\u05d5\u05d9 \u05d1\u05e6\u05d5\u05e8\u05d4 \u05d9\u05d3\u05e0\u05d9\u05ea \u05e9\u05dc \u05d4\u05d1\u05dc\u05d5\u05e7 \u05d4\u05ea\u05e4\u05d5\u05e1 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df (HWM) \u05d5\u05d2\u05dd \u05d4-resize \u05e9\u05dc\u05e4\u05e2\u05de\u05d9\u05dd \u05dc\u05d5\u05e7\u05d7 \u05d6\u05de\u05df.<\/p>\n<p>\u05d3\u05e8\u05da \u05d0\u05d2\u05d1, \u05d0\u05dd \u05d9\u05e9 tablespace \u00a0\u05d1\u05de\u05e6\u05d1 read-only \u05d5\u05d1\u05d5 \u05d0\u05d9\u05e0\u05d3\u05e7\u05e1\u05d9\u05dd \u05e9\u05dc \u05d0\u05d5\u05d1\u05d9\u05d9\u05e7\u05d8 \u05e9\u05d4\u05d5\u05d0 \u05dc\u05d0 \u05d1-read-only, \u05d0\u05d6 \u05db\u05d0\u05e9\u05e8 \u05d6\u05d5\u05e8\u05e7\u05d9\u05dd \u05d0\u05ea \u05d4\u05d8\u05d1\u05dc\u05d4 \u05d0\u05d5 \u05d4-partition \u05d0\u05d6 \u05d4\u05e9\u05d8\u05d7 \u05d1-tablespace \u05d4\u05d6\u05d4 \u05dc\u05d0 \u05de\u05e9\u05ea\u05d7\u05e8\u05e8 &#8211; \u05d4\u05e1\u05d2\u05de\u05e0\u05d8\u05d9\u05dd \u05e9\u05dc \u05d4\u05d0\u05d9\u05e0\u05d3\u05e7\u05e1 \u05d4\u05d5\u05e4\u05db\u05d9\u05dd \u05dc-temp segments \u05d5\u05e2\u05d3 \u05e9\u05dc\u05d0 \u05e0\u05e4\u05ea\u05d7 \u05d0\u05ea \u05d4-tablespace \u05dc-read write \u05d4\u05e9\u05d8\u05d7 \u05dc\u05d0 \u05d9\u05d6\u05d5\u05d4\u05d4 \u05db\u05e4\u05e0\u05d5\u05d9.<\/p>\n<p>\u05db\u05d3\u05d9 \u05dc\u05d4\u05ea\u05d2\u05d1\u05e8 \u05e2\u05dc \u05db\u05dc \u05d4\u05d1\u05e2\u05d9\u05d5\u05ea \u05d4\u05d0\u05dc\u05d4 \u05e0\u05d9\u05ea\u05df \u05dc\u05d4\u05e9\u05ea\u05de\u05e9 \u05d1\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4 \u05d4\u05e1\u05d5\u05e4\u05e8 \u05e9\u05d9\u05de\u05d5\u05e9\u05d9\u05ea \u05d4\u05d1\u05d0\u05d4.<\/p>\n<p><!--more--><\/p>\n<p>\u05d4\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4 \u05d9\u05d5\u05d3\u05e2\u05ea \u05dc\u05e7\u05d1\u05dc \u05e9\u05dd \u05e9\u05dc tablespace \u05d5\u05d0\u05ea \u05db\u05de\u05d5\u05ea \u05d4\u05e9\u05d8\u05d7 (\u05d1\u05d0\u05d7\u05d5\u05d6\u05d9\u05dd) \u05e9\u05d0\u05e0\u05d7\u05e0\u05d5 \u05e8\u05d5\u05e6\u05d9\u05dd \u05dc\u05e9\u05d7\u05e8\u05e8 (\u05dc\u05d3\u05d5\u05d2\u05de\u05d4, \u05d0\u05dd \u05d9\u05e9 100 \u05de\u05d2\u05d4 \u05e4\u05e0\u05d5\u05d9 \u05e9\u05e0\u05d9\u05ea\u05df \u05dc\u05e9\u05d7\u05e8\u05e8 \u05d5\u05d0\u05e0\u05d7\u05e0\u05d5 \u05e8\u05d5\u05e6\u05d9\u05dd \u05e9\u05d9\u05e9\u05d0\u05e8 20, \u05e0\u05d9\u05ea\u05df \u05dc\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4 0.8) \u05d5\u05d4\u05d9\u05d0 \u05d9\u05d5\u05d3\u05e2\u05ea \u05dc\u05e2\u05d1\u05d5\u05e8 \u05d1\u05db\u05dc datafile \u05d5\u05ea\u05e9\u05d7\u05e8\u05e8 \u05d0\u05ea \u05d4\u05e9\u05d8\u05d7 \u05d4\u05e4\u05e0\u05d5\u05d9 \u05e2\u05d3 \u05dc-High water mark. \u05d4\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4 \u05d9\u05d5\u05d3\u05e2\u05ea \u05d2\u05dd \u05dc\u05d9\u05d9\u05e6\u05e8 \u05e1\u05e7\u05e8\u05d9\u05e4\u05d8 \u05de\u05d1\u05dc\u05d9 \u05dc\u05d4\u05e8\u05d9\u05e5 \u05d0\u05ea \u05d4\u05e4\u05e7\u05d5\u05d3\u05d5\u05ea \u05d1\u05e4\u05d5\u05e2\u05dc \u05d5\u05d0\u05e3 \u05dc\u05d9\u05d9\u05e6\u05e8 \u05ea\u05d7\u05d6\u05d9\u05ea \u05e9\u05dc \u05db\u05de\u05d5\u05ea \u05d4\u05e9\u05d8\u05d7 \u05e9\u05d9\u05ea\u05e4\u05e0\u05d4 \u05de\u05d4-tablespace.<\/p>\n<p>\u05d5\u05e0\u05e2\u05d1\u05d5\u05e8 \u05dc\u05e4\u05e8\u05d5\u05e6\u05d3\u05d5\u05e8\u05d4:<\/p>\n<pre class=\"brush: sql; title: ; wrap-lines: false; notranslate\" title=\"\">\nprocedure shrink_files_to_limit(p_tbs      in varchar2,\n                                p_in_mode  in char default &#039;N&#039;,\n                                p_full_pct in number default 0.2,\n                                p_do_cmd   varchar2 default &#039;N&#039;) is\n    cmd    varchar2(200);\n    p_mode varchar2(20);\n\n    sum_mbytes_freed number := 0;\n    tbs_status       varchar2(100);\n\n    -- Protected do_command:\n    -- 1. Run command only if the p_do_cmd = Y\n    -- 2. Igonres ORA-03297\n    procedure do_command_protect(p_cmd    in varchar2,\n                                 p_do_cmd in varchar2) is\n        sql_err_msg varchar2(1000);\n    begin\n        dbms_output.put_line(p_cmd || &#039;;&#039;);\n        if p_do_cmd = &#039;Y&#039;\n        then\n            begin\n                execute immediate (p_cmd);\n            exception\n                when others then\n                    sql_err_msg := sqlerrm;\n                    null;\n                    if sqlcode = -3297\n                    then\n                        -- if unable to resize, ignore\n                        null;\n                    else\n                        dbms_output.put_line(&#039;error was &#039; || replace(sql_err_msg, &#039;ORA&#039;, &#039;ora&#039;));\n                        null;\n                        -- raise;\n                    end if;\n            end;\n        end if;\n    end do_command_protect;\n\nbegin\n    p_mode := upper(p_in_mode);\n    if p_mode not in (&#039;N&#039;, &#039;SHRINK&#039;)\n    then\n        raise_application_error(-20001, &#039;Please enter valid shrink mode:  SHRINK\/N&#039;);\n    end if;\n\n    if p_do_cmd not in (&#039;Y&#039;, &#039;N&#039;)\n    then\n        raise_application_error(-20002, &#039;Please enter valid do mode: Y\/N&#039;);\n    end if;\n\n    -- Open the R\/O tablespace (this will drop automaticly temp segments)\n    begin\n        select distinct t.status\n          into tbs_status\n          from dba_data_files f\n          join dba_tablespaces t on f.tablespace_name = t.tablespace_name\n         where f.tablespace_name = p_tbs\n           and t.status in (&#039;READ ONLY&#039;, &#039;ONLINE&#039;)\n           and t.contents = &#039;PERMANENT&#039;;\n\n        if p_mode = &#039;SHRINK&#039; and tbs_status = &#039;READ ONLY&#039;\n        then\n            cmd := &#039;alter tablespace &#039; || p_tbs || &#039; READ WRITE&#039;;\n            do_command_protect(cmd, p_do_cmd);\n        end if;\n    exception\n        when no_data_found then\n            raise_application_error(-20003, &#039;Tablespace &#039; || p_tbs || &#039; does not exist&#039;);\n    end;\n\n    -- Check for the last extent on each datafile in the tablespace. This is the min resize size of the datafile.\n    for cur in (select substr(f.file_name, 1, 70) filename,\n                       f.tablespace_name,\n                       ceil(max(nvl(e.block_id * t.block_size + e.bytes,\n                                    nvl(t.next_extent, 104857600) + 4 * t.block_size)) \/ 1024) min_k_size,\n                       (max(f.bytes) \/ 1024 -\n                       ceil(max(nvl(e.block_id * (e.bytes \/ e.blocks) + e.bytes,\n                                     nvl(t.next_extent, 104857600) + 4 * t.block_size)) \/ 1024)) free_k_size,\n                       max(f.bytes) \/ 1024 curr_k_size,\n                       f.autoextensible\n                  from dba_extents e\n                 right outer join dba_data_files f on e.file_id = f.file_id\n                                                  and e.tablespace_name = f.tablespace_name\n                  join dba_tablespaces t on f.tablespace_name = t.tablespace_name\n                 where f.tablespace_name = p_tbs\n                   and t.status in (&#039;READ ONLY&#039;, &#039;ONLINE&#039;)\n                   and t.contents = &#039;PERMANENT&#039;\n                 group by f.file_name, f.tablespace_name, f.autoextensible)\n    loop\n        -- Check if there is free space to be removed\n        if cur.free_k_size &amp;gt; 0 and\n           cur.min_k_size + ceil((1 - p_full_pct) * cur.free_k_size) &amp;lt; cur.curr_k_size\n        then\n            if p_mode = &#039;SHRINK&#039;\n            then\n                -- If the datafile is not autoextandable, make the datafile autoextendable and set the maximum size to\n                -- the size we just resized from. This is done to protect the datafile from over-shrinking\n                if cur.autoextensible = &#039;NO&#039;\n                then\n                    cmd := &#039;alter database datafile &#039;&#039;&#039; || cur.filename ||\n                           &#039;&#039;&#039;  autoextend on next 16000k maxsize &#039; || trim(to_char(cur.curr_k_size)) || &#039;k&#039;;\n                    do_command_protect(cmd, p_do_cmd);\n                end if;\n\n                -- resize the datafile to the new size\n                cmd := &#039;alter database datafile &#039;&#039;&#039; || cur.filename || &#039;&#039;&#039; resize &#039; ||\n                       to_char(cur.min_k_size + ceil((1 - p_full_pct) * cur.free_k_size)) || &#039;k&#039;;\n\n                do_command_protect(cmd, p_do_cmd);\n            end if;\n            sum_mbytes_freed := sum_mbytes_freed + floor((p_full_pct) * cur.free_k_size);\n        end if;\n    end loop;\n\n    if p_mode = &#039;N&#039;\n    then\n        dbms_output.put_line(&#039;Total space that can be freed for tablespace &#039; || p_tbs || &#039; (&#039; ||\n                             tbs_status || &#039;): &#039; || round(sum_mbytes_freed \/ 1024, 1) || &#039;M&#039;);\n    end if;\nend shrink_files_to_limit;\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u05db\u05d0\u05e9\u05e8 \u05e0\u05d5\u05e6\u05e8 \u05de\u05e6\u05d1 \u05e9\u05d1\u05d5 \u05d1-tablespace \u05de\u05ea\u05e4\u05e0\u05d4 \u05de\u05e7\u05d5\u05dd \u05e8\u05d1, \u05d0\u05d5\u05e8\u05e7\u05dc \u05de\u05d0\u05e4\u05e9\u05e8\u05d9\u05dd \u05dc\u05d4\u05e7\u05d8\u05d9\u05df \u05d0\u05ea \u05d4-tablespace \u05e2\u05dc \u05d9\u05d3\u05d9 \u05de\u05e2\u05d1\u05e8 \u05e2\u05dc \u05d4-datafile-\u05d9\u05dd \u05e9\u05dc\u05d5 \u05d5\u05d1\u05d9\u05e6\u05d5\u05e2\u00a0\u05e4\u05e7\u05d5\u05d3\u05d5\u05ea\u00a0resize. \u05d4\u05d1\u05e2\u05d9\u05d4 \u05de\u05ea\u05e2\u05d5\u05e8\u05e8\u05ea\u00a0\u05db\u05d0\u05e9\u05e8 \u05d9\u05e9\u05e0\u05d5 Tablespace \u05e2\u05dd \u05de\u05e1\u05e4\u05e8 datafiles (\u05d5\u05dc\u05e4\u05e2\u05de\u05d9\u05dd \u05d6\u05d4 \u05d9\u05db\u05d5\u05dc \u05dc\u05d4\u05d2\u05d9\u05e2 \u05d2\u05dd \u05dc\u05e2\u05e9\u05e8\u05d5\u05ea) \u05d5\u05d0\u05d6 \u05d4\u05e2\u05d1\u05d5\u05d3\u05d4 \u05e9\u05dc \u05de\u05e6\u05d9\u05d0\u05ea \u05d4\u05e1\u05d2\u05de\u05e0\u05d8 \u05e9&quot;\u05d7\u05d5\u05e1\u05dd&quot; \u05d0\u05ea \u05e9\u05d7\u05e8\u05d5\u05e8 \u05d4\u05e9\u05d8\u05d7 \u05d4\u05e4\u05e0\u05d5\u05d9\u00a0\u05d4\u05d5\u05e4\u05da \u05dc\u05d4\u05d9\u05d5\u05ea \u05de\u05e9\u05d9\u05de\u05d4 \u05de\u05d4\u05d2\u05d4\u05d9\u05e0\u05d5\u05dd: \u05d2\u05dd \u05d4\u05d6\u05d9\u05d4\u05d5\u05d9 \u05d1\u05e6\u05d5\u05e8\u05d4 \u05d9\u05d3\u05e0\u05d9\u05ea \u05e9\u05dc \u05d4\u05d1\u05dc\u05d5\u05e7 \u05d4\u05ea\u05e4\u05d5\u05e1 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df (HWM) [&hellip;]<\/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":false,"_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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6,8,13],"tags":[126,134],"class_list":["post-175","post","type-post","status-publish","format-standard","hentry","category-oracle","category-plsql","category-13","tag-sql","tag-tablespace"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u05d0\u05d9\u05da \u05dc\u05e9\u05d7\u05e8\u05e8 \u05e9\u05d8\u05d7 \u05de-tablespace \u05dc\u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05d9\u05e0\u05d9\u05de\u05dc\u05d9 \u05e9\u05dc\u05d5 - Real Time DBA Magic<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/\" \/>\n<meta property=\"og:locale\" content=\"he_IL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u05d0\u05d9\u05da \u05dc\u05e9\u05d7\u05e8\u05e8 \u05e9\u05d8\u05d7 \u05de-tablespace \u05dc\u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05d9\u05e0\u05d9\u05de\u05dc\u05d9 \u05e9\u05dc\u05d5 - Real Time DBA Magic\" \/>\n<meta property=\"og:description\" content=\"\u05db\u05d0\u05e9\u05e8 \u05e0\u05d5\u05e6\u05e8 \u05de\u05e6\u05d1 \u05e9\u05d1\u05d5 \u05d1-tablespace \u05de\u05ea\u05e4\u05e0\u05d4 \u05de\u05e7\u05d5\u05dd \u05e8\u05d1, \u05d0\u05d5\u05e8\u05e7\u05dc \u05de\u05d0\u05e4\u05e9\u05e8\u05d9\u05dd \u05dc\u05d4\u05e7\u05d8\u05d9\u05df \u05d0\u05ea \u05d4-tablespace \u05e2\u05dc \u05d9\u05d3\u05d9 \u05de\u05e2\u05d1\u05e8 \u05e2\u05dc \u05d4-datafile-\u05d9\u05dd \u05e9\u05dc\u05d5 \u05d5\u05d1\u05d9\u05e6\u05d5\u05e2\u00a0\u05e4\u05e7\u05d5\u05d3\u05d5\u05ea\u00a0resize. \u05d4\u05d1\u05e2\u05d9\u05d4 \u05de\u05ea\u05e2\u05d5\u05e8\u05e8\u05ea\u00a0\u05db\u05d0\u05e9\u05e8 \u05d9\u05e9\u05e0\u05d5 Tablespace \u05e2\u05dd \u05de\u05e1\u05e4\u05e8 datafiles (\u05d5\u05dc\u05e4\u05e2\u05de\u05d9\u05dd \u05d6\u05d4 \u05d9\u05db\u05d5\u05dc \u05dc\u05d4\u05d2\u05d9\u05e2 \u05d2\u05dd \u05dc\u05e2\u05e9\u05e8\u05d5\u05ea) \u05d5\u05d0\u05d6 \u05d4\u05e2\u05d1\u05d5\u05d3\u05d4 \u05e9\u05dc \u05de\u05e6\u05d9\u05d0\u05ea \u05d4\u05e1\u05d2\u05de\u05e0\u05d8 \u05e9&quot;\u05d7\u05d5\u05e1\u05dd&quot; \u05d0\u05ea \u05e9\u05d7\u05e8\u05d5\u05e8 \u05d4\u05e9\u05d8\u05d7 \u05d4\u05e4\u05e0\u05d5\u05d9\u00a0\u05d4\u05d5\u05e4\u05da \u05dc\u05d4\u05d9\u05d5\u05ea \u05de\u05e9\u05d9\u05de\u05d4 \u05de\u05d4\u05d2\u05d4\u05d9\u05e0\u05d5\u05dd: \u05d2\u05dd \u05d4\u05d6\u05d9\u05d4\u05d5\u05d9 \u05d1\u05e6\u05d5\u05e8\u05d4 \u05d9\u05d3\u05e0\u05d9\u05ea \u05e9\u05dc \u05d4\u05d1\u05dc\u05d5\u05e7 \u05d4\u05ea\u05e4\u05d5\u05e1 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df (HWM) [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/\" \/>\n<meta property=\"og:site_name\" content=\"Real Time DBA Magic\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/zohare\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/zohare\" \/>\n<meta property=\"article:published_time\" content=\"2010-11-07T15:42:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.realdbamagic.com\/wp-content\/uploads\/2014\/12\/Facebook-Share-profile-photo-270-x-270_2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"270\" \/>\n\t<meta property=\"og:image:height\" content=\"270\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@realmgic\" \/>\n<meta name=\"twitter:site\" content=\"@realmgic\" \/>\n<meta name=\"twitter:label1\" content=\"\u05e0\u05db\u05ea\u05d1 \u05e2\u05dc \u05d9\u05d3\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u05d6\u05de\u05df \u05e7\u05e8\u05d9\u05d0\u05d4 \u05de\u05d5\u05e2\u05e8\u05da\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u05d3\u05e7\u05d5\u05ea\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/shrink-tbs-to-min-size\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/shrink-tbs-to-min-size\\\/\"},\"author\":{\"name\":\"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#\\\/schema\\\/person\\\/fef9c8983df7a5ec53d0e2c733148334\"},\"headline\":\"\u05d0\u05d9\u05da \u05dc\u05e9\u05d7\u05e8\u05e8 \u05e9\u05d8\u05d7 \u05de-tablespace \u05dc\u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05d9\u05e0\u05d9\u05de\u05dc\u05d9 \u05e9\u05dc\u05d5\",\"datePublished\":\"2010-11-07T15:42:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/shrink-tbs-to-min-size\\\/\"},\"wordCount\":667,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#\\\/schema\\\/person\\\/13e6cf68689bd7ea5f6556f5246e6175\"},\"keywords\":[\"SQL\",\"Tablespace\"],\"articleSection\":[\"Oracle\",\"PL\\\/SQL\",\"\u05e1\u05e7\u05e8\u05d9\u05e4\u05d8\"],\"inLanguage\":\"he-IL\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/shrink-tbs-to-min-size\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/shrink-tbs-to-min-size\\\/\",\"url\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/shrink-tbs-to-min-size\\\/\",\"name\":\"\u05d0\u05d9\u05da \u05dc\u05e9\u05d7\u05e8\u05e8 \u05e9\u05d8\u05d7 \u05de-tablespace \u05dc\u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05d9\u05e0\u05d9\u05de\u05dc\u05d9 \u05e9\u05dc\u05d5 - Real Time DBA Magic\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#website\"},\"datePublished\":\"2010-11-07T15:42:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/shrink-tbs-to-min-size\\\/#breadcrumb\"},\"inLanguage\":\"he-IL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/shrink-tbs-to-min-size\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/shrink-tbs-to-min-size\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u05d0\u05d9\u05da \u05dc\u05e9\u05d7\u05e8\u05e8 \u05e9\u05d8\u05d7 \u05de-tablespace \u05dc\u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05d9\u05e0\u05d9\u05de\u05dc\u05d9 \u05e9\u05dc\u05d5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#website\",\"url\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/\",\"name\":\"Real Time DBA Magic\",\"description\":\"Doing Real Time DBA Magics\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#\\\/schema\\\/person\\\/13e6cf68689bd7ea5f6556f5246e6175\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"he-IL\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#\\\/schema\\\/person\\\/13e6cf68689bd7ea5f6556f5246e6175\",\"name\":\"Zohar Elkayam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"he-IL\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g\",\"caption\":\"Zohar Elkayam\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g\"},\"sameAs\":[\"https:\\\/\\\/zoharelkayam.me\",\"https:\\\/\\\/facebook.com\\\/zohare\",\"https:\\\/\\\/x.com\\\/realmgic\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/#\\\/schema\\\/person\\\/fef9c8983df7a5ec53d0e2c733148334\",\"name\":\"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"he-IL\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g\",\"caption\":\"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd\"},\"sameAs\":[\"https:\\\/\\\/zoharelkayam.me\",\"https:\\\/\\\/facebook.com\\\/zohare\",\"https:\\\/\\\/x.com\\\/realmgic\"],\"url\":\"https:\\\/\\\/www.realdbamagic.com\\\/he\\\/author\\\/zohar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u05d0\u05d9\u05da \u05dc\u05e9\u05d7\u05e8\u05e8 \u05e9\u05d8\u05d7 \u05de-tablespace \u05dc\u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05d9\u05e0\u05d9\u05de\u05dc\u05d9 \u05e9\u05dc\u05d5 - Real Time DBA Magic","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/","og_locale":"he_IL","og_type":"article","og_title":"\u05d0\u05d9\u05da \u05dc\u05e9\u05d7\u05e8\u05e8 \u05e9\u05d8\u05d7 \u05de-tablespace \u05dc\u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05d9\u05e0\u05d9\u05de\u05dc\u05d9 \u05e9\u05dc\u05d5 - Real Time DBA Magic","og_description":"\u05db\u05d0\u05e9\u05e8 \u05e0\u05d5\u05e6\u05e8 \u05de\u05e6\u05d1 \u05e9\u05d1\u05d5 \u05d1-tablespace \u05de\u05ea\u05e4\u05e0\u05d4 \u05de\u05e7\u05d5\u05dd \u05e8\u05d1, \u05d0\u05d5\u05e8\u05e7\u05dc \u05de\u05d0\u05e4\u05e9\u05e8\u05d9\u05dd \u05dc\u05d4\u05e7\u05d8\u05d9\u05df \u05d0\u05ea \u05d4-tablespace \u05e2\u05dc \u05d9\u05d3\u05d9 \u05de\u05e2\u05d1\u05e8 \u05e2\u05dc \u05d4-datafile-\u05d9\u05dd \u05e9\u05dc\u05d5 \u05d5\u05d1\u05d9\u05e6\u05d5\u05e2\u00a0\u05e4\u05e7\u05d5\u05d3\u05d5\u05ea\u00a0resize. \u05d4\u05d1\u05e2\u05d9\u05d4 \u05de\u05ea\u05e2\u05d5\u05e8\u05e8\u05ea\u00a0\u05db\u05d0\u05e9\u05e8 \u05d9\u05e9\u05e0\u05d5 Tablespace \u05e2\u05dd \u05de\u05e1\u05e4\u05e8 datafiles (\u05d5\u05dc\u05e4\u05e2\u05de\u05d9\u05dd \u05d6\u05d4 \u05d9\u05db\u05d5\u05dc \u05dc\u05d4\u05d2\u05d9\u05e2 \u05d2\u05dd \u05dc\u05e2\u05e9\u05e8\u05d5\u05ea) \u05d5\u05d0\u05d6 \u05d4\u05e2\u05d1\u05d5\u05d3\u05d4 \u05e9\u05dc \u05de\u05e6\u05d9\u05d0\u05ea \u05d4\u05e1\u05d2\u05de\u05e0\u05d8 \u05e9&quot;\u05d7\u05d5\u05e1\u05dd&quot; \u05d0\u05ea \u05e9\u05d7\u05e8\u05d5\u05e8 \u05d4\u05e9\u05d8\u05d7 \u05d4\u05e4\u05e0\u05d5\u05d9\u00a0\u05d4\u05d5\u05e4\u05da \u05dc\u05d4\u05d9\u05d5\u05ea \u05de\u05e9\u05d9\u05de\u05d4 \u05de\u05d4\u05d2\u05d4\u05d9\u05e0\u05d5\u05dd: \u05d2\u05dd \u05d4\u05d6\u05d9\u05d4\u05d5\u05d9 \u05d1\u05e6\u05d5\u05e8\u05d4 \u05d9\u05d3\u05e0\u05d9\u05ea \u05e9\u05dc \u05d4\u05d1\u05dc\u05d5\u05e7 \u05d4\u05ea\u05e4\u05d5\u05e1 \u05d4\u05e2\u05dc\u05d9\u05d5\u05df (HWM) [&hellip;]","og_url":"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/","og_site_name":"Real Time DBA Magic","article_publisher":"https:\/\/facebook.com\/zohare","article_author":"https:\/\/facebook.com\/zohare","article_published_time":"2010-11-07T15:42:33+00:00","og_image":[{"width":270,"height":270,"url":"https:\/\/www.realdbamagic.com\/wp-content\/uploads\/2014\/12\/Facebook-Share-profile-photo-270-x-270_2.png","type":"image\/png"}],"author":"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd","twitter_card":"summary_large_image","twitter_creator":"@realmgic","twitter_site":"@realmgic","twitter_misc":{"\u05e0\u05db\u05ea\u05d1 \u05e2\u05dc \u05d9\u05d3":"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd","\u05d6\u05de\u05df \u05e7\u05e8\u05d9\u05d0\u05d4 \u05de\u05d5\u05e2\u05e8\u05da":"3 \u05d3\u05e7\u05d5\u05ea"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/#article","isPartOf":{"@id":"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/"},"author":{"name":"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd","@id":"https:\/\/www.realdbamagic.com\/he\/#\/schema\/person\/fef9c8983df7a5ec53d0e2c733148334"},"headline":"\u05d0\u05d9\u05da \u05dc\u05e9\u05d7\u05e8\u05e8 \u05e9\u05d8\u05d7 \u05de-tablespace \u05dc\u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05d9\u05e0\u05d9\u05de\u05dc\u05d9 \u05e9\u05dc\u05d5","datePublished":"2010-11-07T15:42:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/"},"wordCount":667,"commentCount":1,"publisher":{"@id":"https:\/\/www.realdbamagic.com\/he\/#\/schema\/person\/13e6cf68689bd7ea5f6556f5246e6175"},"keywords":["SQL","Tablespace"],"articleSection":["Oracle","PL\/SQL","\u05e1\u05e7\u05e8\u05d9\u05e4\u05d8"],"inLanguage":"he-IL","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/","url":"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/","name":"\u05d0\u05d9\u05da \u05dc\u05e9\u05d7\u05e8\u05e8 \u05e9\u05d8\u05d7 \u05de-tablespace \u05dc\u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05d9\u05e0\u05d9\u05de\u05dc\u05d9 \u05e9\u05dc\u05d5 - Real Time DBA Magic","isPartOf":{"@id":"https:\/\/www.realdbamagic.com\/he\/#website"},"datePublished":"2010-11-07T15:42:33+00:00","breadcrumb":{"@id":"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/#breadcrumb"},"inLanguage":"he-IL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.realdbamagic.com\/he\/shrink-tbs-to-min-size\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.realdbamagic.com\/he\/"},{"@type":"ListItem","position":2,"name":"\u05d0\u05d9\u05da \u05dc\u05e9\u05d7\u05e8\u05e8 \u05e9\u05d8\u05d7 \u05de-tablespace \u05dc\u05d2\u05d5\u05d3\u05dc \u05d4\u05de\u05d9\u05e0\u05d9\u05de\u05dc\u05d9 \u05e9\u05dc\u05d5"}]},{"@type":"WebSite","@id":"https:\/\/www.realdbamagic.com\/he\/#website","url":"https:\/\/www.realdbamagic.com\/he\/","name":"Real Time DBA Magic","description":"Doing Real Time DBA Magics","publisher":{"@id":"https:\/\/www.realdbamagic.com\/he\/#\/schema\/person\/13e6cf68689bd7ea5f6556f5246e6175"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.realdbamagic.com\/he\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"he-IL"},{"@type":["Person","Organization"],"@id":"https:\/\/www.realdbamagic.com\/he\/#\/schema\/person\/13e6cf68689bd7ea5f6556f5246e6175","name":"Zohar Elkayam","image":{"@type":"ImageObject","inLanguage":"he-IL","@id":"https:\/\/secure.gravatar.com\/avatar\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g","caption":"Zohar Elkayam"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/6b35de11903784dc7095933d7c48e0508b11bb277a2a3f4fe58d43f868e2260b?s=96&d=monsterid&r=g"},"sameAs":["https:\/\/zoharelkayam.me","https:\/\/facebook.com\/zohare","https:\/\/x.com\/realmgic"]},{"@type":"Person","@id":"https:\/\/www.realdbamagic.com\/he\/#\/schema\/person\/fef9c8983df7a5ec53d0e2c733148334","name":"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd","image":{"@type":"ImageObject","inLanguage":"he-IL","@id":"https:\/\/secure.gravatar.com\/avatar\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b5c39e9d46112c05384eec046632222fbe1d0bb2af3d452e44e29b6f3956eeea?s=96&d=monsterid&r=g","caption":"\u05d6\u05d4\u05e8 \u05d0\u05dc\u05e7\u05d9\u05d9\u05dd"},"sameAs":["https:\/\/zoharelkayam.me","https:\/\/facebook.com\/zohare","https:\/\/x.com\/realmgic"],"url":"https:\/\/www.realdbamagic.com\/he\/author\/zohar\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p5e40u-2P","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/posts\/175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/comments?post=175"}],"version-history":[{"count":0,"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/posts\/175\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/media?parent=175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/categories?post=175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.realdbamagic.com\/he\/wp-json\/wp\/v2\/tags?post=175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}