{"id":6070,"date":"2024-11-14T13:58:14","date_gmt":"2024-11-14T05:58:14","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6070\/"},"modified":"2024-11-14T13:58:14","modified_gmt":"2024-11-14T05:58:14","slug":"oracle%e5%ad%97%e6%ae%b5%e9%95%bf%e5%ba%a6%e5%a6%82%e4%bd%95%e4%bf%ae%e6%94%b9","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6070\/","title":{"rendered":"oracle\u5b57\u6bb5\u957f\u5ea6\u5982\u4f55\u4fee\u6539"},"content":{"rendered":"<blockquote><p>\n  oracle \u5b57\u6bb5\u957f\u5ea6\u4fee\u6539\u65b9\u6cd5\uff1a\u4fee\u6539\u8868\u5b9a\u4e49\uff1aalter table table_name alter column column_name datatype(new_length);\u91cd\u5efa\u8868\uff1aalter table table_name rebuild;\u91cd\u65b0\u6574\u7406\u8868\uff08\u53ef\u9009\uff09\uff1aalter table table_name reorganize\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/12\/2024061221031798330.jpg\" class=\"aligncenter\" title=\"oracle\u5b57\u6bb5\u957f\u5ea6\u5982\u4f55\u4fee\u6539\u63d2\u56fe\" alt=\"oracle\u5b57\u6bb5\u957f\u5ea6\u5982\u4f55\u4fee\u6539\u63d2\u56fe\" \/><\/p>\n<p><strong>Oracle \u5b57\u6bb5\u957f\u5ea6\u5982\u4f55\u4fee\u6539\uff1f<\/strong><\/p>\n<p>\u4fee\u6539 Oracle \u5b57\u6bb5\u957f\u5ea6\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\uff1a<\/p>\n<p><strong>1. \u4fee\u6539\u8868\u5b9a\u4e49<\/strong><\/p>\n<p>\u4f7f\u7528 ALTER TABLE \u8bed\u53e5\u4fee\u6539\u8868\u5b9a\u4e49\uff0c\u6307\u5b9a\u8981\u4fee\u6539\u7684\u5b57\u6bb5\u53ca\u5176\u65b0\u957f\u5ea6\u3002\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>ALTER TABLE table_name\nALTER COLUMN column_name datatype(new_length);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>ALTER TABLE employees\nALTER COLUMN last_name VARCHAR2(50);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u91cd\u5efa\u8868<\/strong><\/p>\n<p>\u4e3a\u4e86\u5e94\u7528\u66f4\u6539\uff0c\u9700\u8981\u91cd\u5efa\u8868\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528 ALTER TABLE \u8bed\u53e5\u4ee5\u53ca REBUILD \u5b50\u53e5\u6765\u5b9e\u73b0\u3002\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>ALTER TABLE table_name\nREBUILD;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>ALTER TABLE employees\nREBUILD;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u91cd\u65b0\u6574\u7406\u8868\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<p>\u91cd\u5efa\u8868\u540e\uff0c\u53ef\u4ee5\u91cd\u65b0\u6574\u7406\u8868\u4ee5\u4f18\u5316\u5176\u6027\u80fd\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528 ALTER TABLE \u8bed\u53e5\u4ee5\u53ca REORGANIZE \u5b50\u53e5\u6765\u5b9e\u73b0\u3002\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>ALTER TABLE table_name\nREORGANIZE;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>ALTER TABLE employees\nREORGANIZE;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5b57\u6bb5\u957f\u5ea6\u5982\u4f55\u4fee\u6539\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>oracle \u5b57\u6bb5\u957f\u5ea6\u4fee\u6539\u65b9\u6cd5\uff1a\u4fee\u6539\u8868\u5b9a\u4e49\uff1aalter table table_name alter column column_name datatype(new_length);\u91cd\u5efa\u8868\uff1aalter table table_name rebuild;\u91cd\u65b0\u6574\u7406\u8868\uff08\u53ef\u9009\uff09\uff1aalter table table_name reorganize\u3002 Oracle \u5b57\u6bb5\u957f\u5ea6\u5982\u4f55\u4fee\u6539\uff1f \u4fee\u6539 Oracle \u5b57\u6bb5\u957f\u5ea6\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\uff1a 1. \u4fee\u6539\u8868\u5b9a\u4e49 \u4f7f\u7528 ALTER TABLE \u8bed\u53e5\u4fee\u6539\u8868\u5b9a\u4e49\uff0c\u6307\u5b9a\u8981\u4fee\u6539\u7684\u5b57\u6bb5\u53ca\u5176\u65b0\u957f\u5ea6\u3002\u8bed\u6cd5\u5982\u4e0b\uff1a ALTER TABLE table_name ALTER COLUMN column_name datatype(new_length); \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff1a ALTER TABLE employees ALTER COLUMN last_name VARCHAR2(50); \u767b\u5f55\u540e\u590d\u5236 2. \u91cd\u5efa\u8868 \u4e3a\u4e86\u5e94\u7528\u66f4\u6539\uff0c\u9700\u8981\u91cd\u5efa\u8868\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528 ALTER TABLE \u8bed\u53e5\u4ee5\u53ca REBUILD \u5b50\u53e5\u6765\u5b9e\u73b0\u3002\u8bed\u6cd5\u5982\u4e0b\uff1a ALTER TABLE table_name REBUILD; \u767b\u5f55\u540e\u590d\u5236 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6070","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6070"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6070\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}