{"id":652,"date":"2012-03-11T23:02:58","date_gmt":"2012-03-11T15:02:58","guid":{"rendered":"https:\/\/yangtingkun.net\/?p=652"},"modified":"2012-03-13T18:07:27","modified_gmt":"2012-03-13T10:07:27","slug":"%e6%95%b0%e6%8d%ae%e6%b3%b5%e9%80%a0%e6%88%90%e7%9a%84%e6%95%b0%e6%8d%ae%e6%8d%9f%e5%a4%b1","status":"publish","type":"post","link":"https:\/\/yangtingkun.net\/?p=652","title":{"rendered":"\u6570\u636e\u6cf5\u9020\u6210\u7684\u6570\u636e\u635f\u5931"},"content":{"rendered":"<p>\u5ba2\u6237\u5c1d\u8bd5\u5bfc\u5165\u4e00\u4e2a\u5206\u533a\u8868\u7684\u4e2a\u522b\u51e0\u4e2a\u5206\u533a\uff0c\u7ed3\u679c\u5374\u635f\u5931\u4e86\u6574\u4e2a\u5206\u533a\u8868\u7684\u6570\u636e\u3002<br \/>\n\u4e0b\u9762\u901a\u8fc7\u4e00\u4e2a\u4f8b\u5b50\u6765\u5728\u7ebf\u8fd9\u4e2a\u95ee\u9898\uff1a<br \/>\nSQL> CREATE TABLE T_PART PARTITION BY RANGE (CREATED)<br \/>\n2 (PARTITION P1 VALUES LESS THAN (TO_DATE(&#8216;2012-1-1&#8217;, &#8216;YYYY-MM-DD&#8217;)),<br \/>\n3 PARTITION P2 VALUES LESS THAN (TO_DATE(&#8216;2012-2-1&#8217;, &#8216;YYYY-MM-DD&#8217;)),<br \/>\n4 PARTITION P3 VALUES LESS THAN (TO_DATE(&#8216;2012-3-1&#8217;, &#8216;YYYY-MM-DD&#8217;)),<br \/>\n5 PARTITION P4 VALUES LESS THAN (TO_DATE(&#8216;2012-4-1&#8217;, &#8216;YYYY-MM-DD&#8217;)),<br \/>\n6 PARTITION PMAX VALUES LESS THAN (MAXVALUE))<br \/>\n7 AS SELECT * FROM DBA_OBJECTS;<br \/>\nTable created.<br \/>\nSQL> host expdp test directory=d_output dumpfile=t_part.dp logfile=t_part.log tables=t_part:p3, t_part:p4<br \/>\nExport: Release 11.2.0.3.0 &#8211; Production on Tue Mar 13 12:17:00 2012<br \/>\nCopyright (c) 1982, 2011, Oracle and\/or its affiliates. All rights reserved.<br \/>\nPassword:<br \/>\nConnected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 &#8211; 64bit Production<br \/>\nWith the Partitioning, Oracle Label Security and Real Application Testing options<br \/>\nStarting &#8220;TEST&#8221;.&#8221;SYS_EXPORT_TABLE_01&#8243;: test\/******** directory=d_output dumpfile=t_part.dp logfile=t_part.log tables=t_part:p3, t_part:p4<br \/>\nEstimate in progress using BLOCKS method&#8230;<br \/>\nProcessing object type TABLE_EXPORT\/TABLE\/TABLE_DATA<br \/>\nTotal estimation using BLOCKS method: 16 MB<br \/>\nProcessing object type TABLE_EXPORT\/TABLE\/TABLE<br \/>\n. . exported &#8220;TEST&#8221;.&#8221;T_PART&#8221;:&#8221;P3&#8243; 29.89 KB 193 rows<br \/>\n. . exported &#8220;TEST&#8221;.&#8221;T_PART&#8221;:&#8221;P4&#8243; 65 KB 425 rows<br \/>\nMaster table &#8220;TEST&#8221;.&#8221;SYS_EXPORT_TABLE_01&#8243; successfully loaded\/unloaded<br \/>\n******************************************************************************<br \/>\nDump file set for TEST.SYS_EXPORT_TABLE_01 is:<br \/>\n\/home\/oracle\/t_part.dp<br \/>\nJob &#8220;TEST&#8221;.&#8221;SYS_EXPORT_TABLE_01&#8243; successfully completed at 12:17:17<br \/>\n\u5ba2\u6237\u5c1d\u8bd5\u5bfc\u5165\u51e0\u4e2a\u5206\u533a\uff0c\u4f46\u662f\u8fd9\u4e9b\u5206\u533a\u5e76\u4e0d\u4e3a\u7a7a\uff0c\u4e8e\u662f\u5728\u5bfc\u5165\u65f6\u6307\u5b9a\u4e86\u9519\u8bef\u7684TABLE_EXISTS_ACTION\u53c2\u6570\u4e3aREPLACE\uff1a<br \/>\nSQL> host impdp test directory=d_output dumpfile=t_part.dp logfile=t_part_imp.log tables=t_part:p3 table_exists_action=replace<br \/>\nImport: Release 11.2.0.3.0 &#8211; Production on Tue Mar 13 14:51:55 2012<br \/>\nCopyright (c) 1982, 2011, Oracle and\/or its affiliates. All rights reserved.<br \/>\nPassword:<br \/>\nConnected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 &#8211; 64bit Production<br \/>\nWith the Partitioning, Oracle Label Security and Real Application Testing options<br \/>\nMaster table &#8220;TEST&#8221;.&#8221;SYS_IMPORT_TABLE_01&#8243; successfully loaded\/unloaded<br \/>\nStarting &#8220;TEST&#8221;.&#8221;SYS_IMPORT_TABLE_01&#8243;: test\/******** directory=d_output dumpfile=t_part.dp logfile=t_part_imp.log tables=t_part:p3 table_exists_action=replace<br \/>\nProcessing object type TABLE_EXPORT\/TABLE\/TABLE<br \/>\nProcessing object type TABLE_EXPORT\/TABLE\/TABLE_DATA<br \/>\n. . imported &#8220;TEST&#8221;.&#8221;T_PART&#8221;:&#8221;P3&#8243; 29.89 KB 193 rows<br \/>\nJob &#8220;TEST&#8221;.&#8221;SYS_IMPORT_TABLE_01&#8243; successfully completed at 14:52:00<br \/>\n\u867d\u7136\u5bfc\u5165\u7684\u65f6\u5019\u4ec5\u6307\u5b9a\u4e86\u4e00\u4e2a\u5206\u533a\uff0c\u4f46\u662fOracle\u5e76\u4e0d\u4f1a\u5bf9\u8fd9\u4e00\u4e2a\u5206\u533a\u6267\u884cTRUNCATE\u64cd\u4f5c\uff0c\u800c\u662f\u5c06\u6574\u4e2a\u8868DROP\u6389\uff0c\u7136\u540e\u5229\u7528\u6570\u636e\u6cf5\u4e2d\u7684\u6e90\u6570\u636e\u91cd\u5efa\u3002<br \/>\nSQL> SELECT COUNT(*) FROM T_PART PARTITION (P1);<br \/>\nCOUNT(*)<br \/>\n&#8212;&#8212;&#8212;-<br \/>\n0<br \/>\nSQL> SELECT COUNT(*) FROM T_PART PARTITION (P2);<br \/>\nCOUNT(*)<br \/>\n&#8212;&#8212;&#8212;-<br \/>\n0<br \/>\nSQL> SELECT COUNT(*) FROM T_PART PARTITION (P3);<br \/>\nCOUNT(*)<br \/>\n&#8212;&#8212;&#8212;-<br \/>\n193<br \/>\nSQL> SELECT COUNT(*) FROM T_PART PARTITION (P4);<br \/>\nCOUNT(*)<br \/>\n&#8212;&#8212;&#8212;-<br \/>\n0<br \/>\nSQL> SELECT COUNT(*) FROM T_PART PARTITION (PMAX);<br \/>\nCOUNT(*)<br \/>\n&#8212;&#8212;&#8212;-<br \/>\n0<br \/>\n\u8fd9\u4e2a\u8868\u4e2d\u53ea\u6709\u5bfc\u5165\u7684\u5206\u533a\u8bb0\u5f55\u5b58\u5728\uff0c\u539f\u5219\u4e0aimpdp\u5bf9\u5e94\u7684\u6570\u636e\u6cf5\u5bfc\u51fa\u6587\u4ef6\u4e2d\u7684\u8bb0\u5f55\u4e5f\u90fd\u662f\u53ef\u4ee5\u6062\u590d\u7684\uff0c\u4f46\u662f\u8868\u4e2d\u5176\u4ed6\u7684\u5206\u533a\u6570\u636e\u5219\u5b8c\u5168\u4e22\u5931\u3002<br \/>\n\u800c\u4e14Oracle\u5728\u5220\u9664\u7684\u65f6\u5019\u8fd8\u4f7f\u7528PURGE\u9009\u9879\uff0c\u4f7f\u5f97\u5206\u533a\u8868\u5728\u5220\u9664\u7684\u65f6\u5019\u5e76\u6ca1\u6709\u88ab\u653e\u5230\u56de\u6536\u7ad9\u4e2d\uff0c\u800c\u662f\u76f4\u63a5\u4ece\u6570\u636e\u5e93\u4e2d\u88ab\u6e05\u9664\u3002\u4ece\u8fd9\u4e00\u70b9\u4e0a\u8bb2\uff0cOracle\u5e94\u8be5\u53bb\u6389PURGE\u8bed\u53e5\uff0c\u6216\u8005\u81f3\u5c11\u7ed9\u51fa\u4e00\u4e2a\u9009\u9879\uff0c\u6bd5\u7adfDROP TABLE\u5bf9\u4e8e\u7cfb\u7edf\u6765\u8bf4\u6709\u98ce\u9669\u7684\u3002<br \/>\n\u6700\u8fd1\u78b0\u5230\u4e24\u4e09\u6b21\u7684\u95ee\u9898\u90fd\u662f\u548cimp\u4ee5\u53caimpdp\u6709\u5173\uff0c\u56e0\u6b64\u53ea\u8981\u662f\u6d89\u53ca\u5230\u6570\u636e\u5e93\u4fee\u6539\u7684\uff0c\u8fd8\u662f\u8981\u8c28\u614e\u5904\u4e4b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5ba2\u6237\u5c1d\u8bd5\u5bfc\u5165\u4e00\u4e2a\u5206\u533a\u8868\u7684\u4e2a\u522b\u51e0\u4e2a\u5206\u533a\uff0c\u7ed3\u679c\u5374\u635f\u5931\u4e86\u6574\u4e2a\u5206\u533a\u8868\u7684\u6570\u636e\u3002 \u4e0b\u9762\u901a\u8fc7\u4e00\u4e2a\u4f8b\u5b50\u6765\u5728\u7ebf\u8fd9\u4e2a\u95ee\u9898\uff1a SQL> CREATE TABLE T_PART PARTITION BY RANGE (CREATED) 2 (PARTITION P1 VALUES LESS THAN (TO_DATE(&#8216;2012-1-1&#8217;, &#8216;YYYY-MM-DD&#8217;)), 3 PARTITION P2 VALUES LESS THAN (TO_DATE(&#8216;2012-2-1&#8217;, &#8216;YYYY-MM-DD&#8217;)), 4 PARTITION P3 VALUES LESS THAN (TO_DATE(&#8216;2012-3-1&#8217;, &#8216;YYYY-MM-DD&#8217;)), 5 PARTITION P4 VALUES LESS THAN &hellip; <a href=\"https:\/\/yangtingkun.net\/?p=652\">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_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":""},"categories":[3],"tags":[534,460,22,535],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2yiY3-aw","_links":{"self":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/652"}],"collection":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=652"}],"version-history":[{"count":1,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/652\/revisions"}],"predecessor-version":[{"id":653,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/652\/revisions\/653"}],"wp:attachment":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}