{"id":365,"date":"2026-01-26T07:24:16","date_gmt":"2026-01-26T07:24:16","guid":{"rendered":"https:\/\/blog.gpst.net.cn:4008\/?p=365"},"modified":"2026-01-28T06:24:13","modified_gmt":"2026-01-28T06:24:13","slug":"oracle%e8%bf%90%e7%bb%b4-%e8%a1%a8%e7%a9%ba%e9%97%b4%e6%89%a9%e5%ae%b9","status":"publish","type":"post","link":"https:\/\/opshub.com.cn\/?p=365","title":{"rendered":"oracle\u8fd0\u7ef4\u2014\u2014\u8868\u7a7a\u95f4\u6269\u5bb9"},"content":{"rendered":"\n<p>\u67e5\u770b\u8868\u7a7a\u95f4\u7684\u540d\u5b57\u53ca\u6587\u4ef6\u6240\u5728\u4f4d\u7f6e\uff1a<\/p>\n\n\n\n<p>select tablespace_name,file_id,file_name,round(bytes\/(1024*1024),0) total_space from dba_data_files order by tablespace_name;<\/p>\n\n\n\n<p>\u589e\u5927\u6240\u9700\u8868\u7a7a\u95f4\u5927\u5c0f:<\/p>\n\n\n\n<p>1.\u624b\u52a8\u5728\u539f\u6709\u8868\u7a7a\u95f4\u4e0a\u589e\u52a0\u8868\u7a7a\u95f4\u7684\u5927\u5c0f<\/p>\n\n\n\n<p>alter database datafile &#8216;\u8868\u7a7a\u95f4\u4f4d\u7f6e&#8217; resize \u65b0\u7684\u5c3a\u5bf8;<\/p>\n\n\n\n<p>\u4f8b\u5982: alter database datafile &#8216;\\oracle\\oradata\\anita_2024.dbf&#8217; resize 3000m<\/p>\n\n\n\n<p>2.\u624b\u52a8\u5728\u539f\u6709\u7684\u8868\u7a7a\u95f4\u6587\u4ef6\u57fa\u7840\u4e0a\u7ee7\u7eed\u589e\u52a0\u8868\u7a7a\u95f4\u6587\u4ef6\u6570\u91cf<\/p>\n\n\n\n<p>alter tablespace \u8868\u7a7a\u95f4\u540d\u79f0 add datafile &#8216;\u65b0\u7684\u6570\u636e\u6587\u4ef6\u5730\u5740&#8217; size \u6570\u636e\u6587\u4ef6\u5927\u5c0f<\/p>\n\n\n\n<p>\u4f8b\u5982: alter tablespace ESPS_2024 add datafile &#8216;\\oracle\\oradata\\anita_2025.dbf&#8217; size 1000m<\/p>\n\n\n\n<p>3.\u8bbe\u7f6e\u8868\u7a7a\u95f4\u81ea\u52a8\u6269\u5bb9<\/p>\n\n\n\n<p>alter database datafile &#8216;\u6570\u636e\u6587\u4ef6\u4f4d\u7f6e&#8217; autoextend on next \u81ea\u52a8\u6269\u5c55\u5927\u5c0f maxsize \u6700\u5927\u6269\u5c55\u5927\u5c0f<\/p>\n\n\n\n<p>alter database datafile &#8216;\\oracle\\oradata\\anita_2024.dbf&#8217; autoextend on next 100m maxsize 10000m<\/p>\n\n\n\n<p>\u67e5\u8be2\u8868\u7a7a\u95f4\u4f7f\u7528\u60c5\u51b5:<\/p>\n\n\n\n<p>select a.tablespace_name,a.bytes\/1024\/1024 &#8220;sum MB&#8221;,&nbsp;&nbsp;(a.bytes-b.bytes)\/1024\/1024 &#8220;used MB&#8221;,b.bytes\/1024\/1024 &#8220;free MB&#8221;,&nbsp;round (((a.bytes-b.bytes)\/a.bytes)*100,2) &#8220;used%&#8221; from&nbsp;(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a,&nbsp;(select tablespace_name,sum(bytes) bytes,max (bytes) largest from dba_free_space group by tablespace_name)b&nbsp;&nbsp;where a.tablespace_name=b.tablespace_name order by ((a.bytes-b.bytes)\/a.bytes) desc;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u67e5\u770b\u8868\u7a7a\u95f4\u7684\u540d\u5b57\u53ca\u6587\u4ef6\u6240\u5728\u4f4d\u7f6e\uff1a select tablespace_name,file_id,file_name,round(bytes\/(1024*1024),0) total_space from dba_data_files order by tablespace_name; \u589e\u5927\u6240\u9700\u8868\u7a7a\u95f4\u5927\u5c0f: 1.\u624b\u52a8\u5728\u539f\u6709\u8868\u7a7a\u95f4\u4e0a\u589e\u52a0\u8868\u7a7a\u95f4\u7684\u5927\u5c0f alter database datafile &#8216;\u8868\u7a7a\u95f4\u4f4d\u7f6e&#8217; resize \u65b0\u7684\u5c3a\u5bf8; \u4f8b\u5982: alter database datafile &#8216;\\oracle\\oradata\\anita_2024.dbf&#8217; resize 3000m 2.\u624b\u52a8\u5728\u539f\u6709\u7684\u8868\u7a7a\u95f4\u6587\u4ef6\u57fa\u7840\u4e0a\u7ee7\u7eed\u589e\u52a0\u8868\u7a7a\u95f4\u6587\u4ef6\u6570\u91cf alter tablespace \u8868\u7a7a\u95f4\u540d\u79f0 add datafile &#8216;\u65b0\u7684\u6570\u636e\u6587\u4ef6\u5730\u5740&#8217; size \u6570\u636e\u6587\u4ef6\u5927\u5c0f \u4f8b\u5982: alter tablespace ESPS_2024 add datafile &#8216;\\oracle\\oradata\\anita_2025.dbf&#8217; size 1000m 3.\u8bbe\u7f6e\u8868\u7a7a\u95f4\u81ea\u52a8\u6269\u5bb9 alter database datafile &#8216;\u6570\u636e\u6587\u4ef6\u4f4d\u7f6e&#8217; autoextend on next \u81ea\u52a8\u6269\u5c55\u5927\u5c0f maxsize \u6700\u5927\u6269\u5c55\u5927\u5c0f alter database [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-365","post","type-post","status-publish","format-standard","hentry","category-8"],"_links":{"self":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=365"}],"version-history":[{"count":1,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/365\/revisions"}],"predecessor-version":[{"id":366,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/365\/revisions\/366"}],"wp:attachment":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}