OCP-1Z0-053-V12.02-17题
来源:互联网 发布:老司机开车 知乎 编辑:程序博客网 时间:2024/04/30 10:33
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
stored in the table.
Answer: C
答案解析:
参考实验:
sys@TEST1107> CREATE TABLE INV_HISTORY (inv_no NUMBER(3), inv_date DATE, inv_amt NUMBER(10,2))
2 partition by range (inv_date) interval (numtoyminterval(1,'month'))
3 (partition p0 values less than (to_date('01-01-2005','dd-mm-yyyy')),
4 partition p1 values less than (to_date('01-01-2006','dd-mm-yyyy')));
Table created.
sys@TEST1107> insert into INV_HISTORY values (1,'30-dec-2004',1000);
1 row created.
sys@TEST1107> insert into INV_HISTORY values (2,'30-dec-2005',2000);
1 row created.
sys@TEST1107> insert into INV_HISTORY values (3,'1-feb-2006',3000);
1 row created.
sys@TEST1107> insert into INV_HISTORY values (4,'1-mar-2006',4000);
1 row created.
sys@TEST1107> insert into INV_HISTORY values (5,'1-apr-2006',5000);
1 row created.
sys@TEST1107> select * from INV_HISTORY;
INV_NO INV_DATE INV_AMT
---------- ------------------ ----------
1 30-DEC-04 1000
2 30-DEC-05 2000
3 01-FEB-06 3000
4 01-MAR-06 4000
5 01-APR-06 5000
INTERVAL Clause
Use this clause to establish interval partitioning for the table. Interval partitions are partitions based on a numeric range or datetime interval. They extend range partitioning by instructing the database to create partitions of the specified range or interval automatically when data inserted into the table exceeds all of the range partitions.
- OCP-1Z0-053-V12.02-17题
- OCP-1Z0-053-V12.02-679题
- OCP-1Z0-053-V12.02-591题
- OCP-1Z0-053-V12.02-590题
- OCP-1Z0-053-V12.02-552题
- OCP-1Z0-053-V12.02-551题
- OCP-1Z0-053-V12.02-549题
- OCP-1Z0-053-V12.02-548题
- OCP-1Z0-053-V12.02-234题
- OCP-1Z0-053-V12.02-584题
- OCP-1Z0-053-V12.02-595题
- OCP-1Z0-053-V12.02-184题
- OCP-1Z0-053-V12.02-59题
- OCP-1Z0-053-V12.02-676题
- OCP-1Z0-053-V12.02-667题
- OCP-1Z0-053-V12.02-660题
- OCP-1Z0-053-V12.02-580题
- OCP-1Z0-053-V12.02-323题
- 做菜时你绝对不知道的123个门道
- 基于内容的推荐
- db2命令一些总结
- strstr函数的用法
- 小杨教书
- OCP-1Z0-053-V12.02-17题
- CentOS6.4 读写NTFS分区
- poj 1655 Balancing Act(树形DP)
- 用户级线程和系统级线程
- Laravel 一步步写Laravel CMS(二)——后台文章发布
- Netflix Recommendations
- 《软件设计师考试后记》
- 写论文中word页脚和脚注的问题和删除空白页
- 设计一个整型链表类list,能够实现链表节点的插入、删除、以及链表数据的输出操作。