演示一个带有全文索引表的分区交换例子


一、实验说明:

      操作系统:rhel 5.4 x86

      数据库:Oracle 11g R2

      实验说明:该实验参照了谭老师的《让Oracle跑的更快2》中的一个案例。

二、在数据库中创建带加载数据的分区表及索引

----------创建一个包含3个分区的分区表,分区的字段是一个时间字段,分别存放2011年、2012年和之后的数据。-----
SQL> create table jack_test(id int,name varchar2(60),created date)
  2  partition by range(created)
  3  (
  4  partition p2011 values less than(to_date('2012-01-01','yyyy-mm-dd')),
  5  partition p2012 values less than(to_date('2013-01-01','yyyy-mm-dd')),
  6  partition pmax values less than (maxvalue)
  7  );

Table created.
 ----------创建全文索引----------------------------------------------------------------------

SQL> create index jack_test_ind on jack_test(name) indextype is ctxsys.context local;

Index created.

三、在数据库中创建临时表

----------创建一个和jack_test表结构完全相同的临时表jack_test,只是它不是分区表,临时表上暂时不需要创建索引-------
1
SQL>

相关内容