OCP考試第17題
17. The INV_HISTORY table is created using the command:
SQL>CREATE TABLE INV_HISTORY (inv_no NUMBER(3), inv_date DATE, inv_amt NUMBER(10,2))
partition by range (inv_date)
interval (numtoyminterval(1,'month'))
(partition p0 values less than (to_date('01-01-2005','dd-mm-yyyy')),
partition p1 values less than (to_date('01-01-2006','dd-mm-yyyy')));
The following data has been inserted into the INV_HISTORY table :
INV_NO INV_DATE INV_AMT 1 30-dec-2004 1000 2 30-dec-2005 2000 3 1-feb-2006 3000 4 1-mar-2006
4000 5 1-apr-2006 5000
You would like to store the data belonging to the year 2006 in a single partition and issue the command:
SQL> ALTER TABLE inv_history MERGE PARTITIONS
FOR(TO_DATE('15-feb-2006','dd-mon-yyyy')), FOR(TO_DATE('15-apr-2006')) INTO PARTITION sys_py;
What would be the outcome of this command?
融合分割槽
A. It executes successfully, and the transition point is set to '1-apr-2006'.
B. It executes successfully, and the transition point is set to '15-apr-2006'.
C. It produces an error because the partitions specified for merging are not adjacent.
D. It produces an error because the date values specified in the merge do not match the date values
知識點:
融合(merge partition)分割槽:你可以融合範圍分割槽表和list分割槽表的兩個分割槽到一個分割槽,兩個原始的分割槽會被刪除,這個時候ROWID也就改變了,當然也包括刪除相關的本地索引。
限制:1、不能為hash分割槽使用這個語法,因為hash分割槽已經有了Coalescing Partitions分割槽的語法。
2、當融合範圍分割槽的時候必須是相鄰的分割槽,否則報錯ORA-14274: 要合併的分割槽不相鄰,但是list分割槽並沒有這個限制。
如果融合的時候
3、如果合併範圍分割槽表的分割槽和maxvalue分割槽,那合併後的還是maxvalue分割槽。
4、如果何必list分割槽的分割槽和default分割槽,那合併後的還是default分割槽。
5、如果合併的分割槽中有資料,那全域性索引和普通索引均失效,除非帶上update indexes
6、如果合併的分割槽中有資料,那本地索引關於合併後新分割槽的索引會失效,除非帶上update indexes
參考 http://blog.itpub.net/7728585/viewspace-757019/
答案:C,分割槽不連續。