{"id":1011,"date":"2012-07-13T23:12:37","date_gmt":"2012-07-13T15:12:37","guid":{"rendered":"https:\/\/yangtingkun.net\/?p=1011"},"modified":"2012-07-20T21:14:28","modified_gmt":"2012-07-20T13:14:28","slug":"%e5%88%86%e5%8c%ba%e8%a1%a8%e9%83%a8%e5%88%86%e5%88%86%e5%8c%ba%e4%b8%8d%e5%8f%af%e7%94%a8%e5%af%bc%e8%87%b4%e7%bb%9f%e8%ae%a1%e4%bf%a1%e6%81%af%e6%94%b6%e9%9b%86%e5%a4%b1%e6%95%88","status":"publish","type":"post","link":"https:\/\/yangtingkun.net\/?p=1011","title":{"rendered":"\u5206\u533a\u8868\u90e8\u5206\u5206\u533a\u4e0d\u53ef\u7528\u5bfc\u81f4\u7edf\u8ba1\u4fe1\u606f\u6536\u96c6\u5931\u6548"},"content":{"rendered":"<p>\u4e00\u4e2a\u5ba2\u6237\u78b0\u5230\u7684\u5177\u4f53\u9700\u6c42\uff0c\u5206\u533a\u8868\u4e2d\u6709\u4e9b\u5206\u533a\u6240\u5728\u7684\u8868\u7a7a\u95f4\u88abOFFLINE\uff0c\u5bfc\u81f4\u5728\u5220\u9664\u7edf\u8ba1\u4fe1\u606f\u65f6\u62a5\u9519\u3002<br \/>\n\u4e0b\u9762\u901a\u8fc7\u4f8b\u5b50\u6765\u8bf4\u660e\u8fd9\u4e2a\u95ee\u9898\uff1a<\/p>\n<pre lang='SQL'>SQL> create table t_part_read (id number)\r\n2 partition by range (id)\r\n3 (partition p1 values less than (10) tablespace ts1, \r\n4 partition p2 values less than (20) tablespace ts2, \r\n5 partition pmax values less than (maxvalue) tablespace users);\r\nTable created.\r\nSQL> insert into t_part_read select rownum from tab;\r\n54 rows created.\r\nSQL> commit;\r\nCommit complete.\r\nSQL> exec dbms_stats.gather_table_stats(user, 'T_PART_READ')\r\nPL\/SQL procedure successfully completed.\r\nSQL> alter tablespace ts1 read only;\r\nTablespace altered.\r\nSQL> exec dbms_stats.gather_table_stats(user, 'T_PART_READ')\r\nPL\/SQL procedure successfully completed.\r\nSQL> alter tablespace ts1 offline;\r\nTablespace altered.\r\nSQL> exec dbms_stats.gather_table_stats(user, 'T_PART_READ')\r\nBEGIN dbms_stats.gather_table_stats(user, 'T_PART_READ'); END;\r\n*\r\nERROR at line 1:\r\nORA-00376: file 6 cannot be read at this time\r\nORA-01110: data file 6: '\/u01\/app\/oracle\/oradata\/ORCL\/datafile\/o1_mf_ts1_7w8l5fz1_.dbf'\r\nORA-06512: at \"SYS.DBMS_STATS\", line 23829\r\nORA-06512: at \"SYS.DBMS_STATS\", line 23880\r\nORA-06512: at line 1<\/pre>\n<p>\u5982\u679c\u5c06\u8868\u7a7a\u95f4\u53ea\u8bfb\uff0c\u5e76\u4e0d\u4f1a\u5f71\u54cd\u5230\u8868\u7a7a\u95f4\u4e0a\u7684\u8868\u6216\u5206\u533a\u7684\u7edf\u8ba1\u4fe1\u606f\u7684\u6536\u96c6\uff0c\u56e0\u4e3a\u6536\u96c6\u8fc7\u7a0b\u53ea\u662f\u8bfb\u53d6\uff0c\u800c\u6536\u96c6\u7684\u7ed3\u679c\u4fe1\u606f\u662f\u5199\u5230SYSTEM\u8868\u7a7a\u95f4\u7684\u3002<br \/>\n\u4f46\u662f\u5982\u679c\u5206\u533a\u6240\u5728\u7684\u8868\u7a7a\u95f4\u5904\u4e8eOFFLINE\u72b6\u6001\uff0c\u90a3\u4e48\u5728\u7edf\u8ba1\u4fe1\u606f\u6536\u96c6\u7684\u8fc7\u7a0b\u4e2d\u5c31\u4f1a\u62a5\u9519\u3002<br \/>\n\u6709\u4e00\u4e2a\u5f88\u7b80\u5355\u7684\u65b9\u6cd5\u53ef\u4ee5\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u5c31\u662f\u5c06\u88abOFFLINE\u5f71\u54cd\u7684\u5206\u533a\u7684\u7edf\u8ba1\u4fe1\u606f\u9501\u5b9a\uff0c\u8fd9\u6837Oracle\u5728\u6536\u96c6\u7edf\u8ba1\u4fe1\u606f\u65f6\u5c31\u4f1a\u8df3\u8fc7\u9501\u5b9a\u7684\u5206\u533a\uff0c\u901a\u8fc7\u8fd9\u4e2a\u529e\u6cd5\u5c31\u53ef\u4ee5\u907f\u514d\u7edf\u8ba1\u4fe1\u606f\u6536\u96c6\u8fc7\u7a0b\u4e2d\u7684\u62a5\u9519\uff1a<\/p>\n<pre lang='SQL'>SQL> exec dbms_stats.lock_partition_stats(user, 'T_PART_READ', 'P1')\r\nPL\/SQL procedure successfully completed.\r\nSQL> exec dbms_stats.gather_table_stats(user, 'T_PART_READ')\r\nBEGIN dbms_stats.gather_table_stats(user, 'T_PART_READ'); END;\r\n*\r\nERROR at line 1:\r\nORA-00376: file 6 cannot be read at this time\r\nORA-01110: data file 6: '\/u01\/app\/oracle\/oradata\/ORCL\/datafile\/o1_mf_ts1_7w8l5fz1_.dbf'\r\nORA-06512: at \"SYS.DBMS_STATS\", line 23829\r\nORA-06512: at \"SYS.DBMS_STATS\", line 23880\r\nORA-06512: at line 1\r\n\r\nSQL> exec dbms_stats.gather_table_stats(user, 'T_PART_READ', granularity => 'PARTITION') \r\nPL\/SQL procedure successfully completed.<\/pre>\n<p>\u5373\u4f7f\u9501\u5b9a\u5206\u533a\u540e\uff0c\u5c1d\u8bd5\u6536\u96c6\u7edf\u8ba1\u4fe1\u606f\u4ecd\u7136\u62a5\u9519\uff0c\u8fd9\u662f\u56e0\u4e3aOracle\u9ed8\u8ba4\u9664\u4e86\u8981\u6536\u96c6\u5206\u533a\u4e0a\u7684\u7edf\u8ba1\u4fe1\u606f\u4ee5\u5916\uff0c\u8fd8\u8981\u6536\u96c6\u8868\u7ea7\u7684\u7edf\u8ba1\u4fe1\u606f\uff0c\u800c\u8fd9\u5c31\u4f1a\u9020\u6210\u88abOFFLINE\u5f71\u54cd\u7684\u5206\u533a\u4e5f\u8981\u88ab\u8bfb\u53d6\u3002<br \/>\n\u89e3\u51b3\u65b9\u6cd5\u5c31\u662f\u5728\u6536\u96c6\u7edf\u8ba1\u4fe1\u606f\u7684\u65f6\u5019\u6307\u5b9a\u6536\u96c6\u7684\u7c92\u5ea6\u662f\u5206\u533a\uff0c\u4e0d\u6536\u96c6\u8868\u4e0a\u7684GLOBAL\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u4e2a\u5ba2\u6237\u78b0\u5230\u7684\u5177\u4f53\u9700\u6c42\uff0c\u5206\u533a\u8868\u4e2d\u6709\u4e9b\u5206\u533a\u6240\u5728\u7684\u8868\u7a7a\u95f4\u88abOFFLINE\uff0c\u5bfc\u81f4\u5728\u5220\u9664\u7edf\u8ba1\u4fe1\u606f\u65f6\u62a5\u9519\u3002 \u4e0b\u9762\u901a\u8fc7\u4f8b\u5b50\u6765\u8bf4\u660e\u8fd9\u4e2a\u95ee\u9898\uff1a SQL> create table t_part_read (id number) 2 partition by range (id) 3 (partition p1 values less than (10) tablespace ts1, 4 partition p2 values less than (20) tablespace ts2, 5 partition pmax values less than (maxvalue) tablespace users); &hellip; <a href=\"https:\/\/yangtingkun.net\/?p=1011\">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":[255,871,868,869,163,870,460],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2yiY3-gj","_links":{"self":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/1011"}],"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=1011"}],"version-history":[{"count":2,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions"}],"predecessor-version":[{"id":1014,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions\/1014"}],"wp:attachment":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}