日期:2014-05-16 浏览次数:20470 次
㈣ 主键与本地索引
测试:
hr@ORCL> drop table t purge; Table dropped. hr@ORCL> create table t (id number not null,p_id number) 2 partition by range (p_id) 3 ( 4 partition p1 values less than (2), 5 partition p2 values less than (3), 6 partition p3 values less than (4), 7 partition p4 values less than (5), 8 partition p5 values less than (maxvalue) 9 ); Table created. hr@ORCL> insert into t select rownum,decode(mod(rownum,5),0,5,mod(rownum,5)) from dual connect by level<=100000; 100000 rows created. hr@ORCL> commit; Commit complete. hr@ORCL> alter table t add constraint pk_t primary key (id) using index local; alter table t add constraint pk_t primary key (id) using index local * ERROR at line 1: ORA-14039: partitioning columns must form a subset of key columns of a UNIQUE index hr@ORCL> alter table t add constraint pk_t primary key (id,p_id) using index local; Table altered.
Q: 1 Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) Which three statements insert a row into the table? (Ch