这是个例子:
建立分区表
create table partition_test
(
id number(9),
tmpStr varchar2(10)
)
partition by range(id)
(
partition id01 values less than (3000000) tablespace test_tabspc1,
partition id02 values less than (6000000) tablespace test_tabspc2,
partition id03 values less than (9000000) tablespace test_tabspc3,
partition id04 values less than (12000000) tablespace test_tabspc4,
partition id05 values less than (MAXVALUE) tablespace test_tabspc5
)
/1、建立局部分区索引
Create index your_index on caishui.partition_test(id)
local
(
partition id01 tablespace test_tabspc1,
partition id02 tablespace test_tabspc2,
partition id03 tablespace test_tabspc3,
partition id04 tablespace test_tabspc4,
partition id05 tablespace test_tabspc5
)
/2、重建某一个分区的索引
alter index your_index rebuild partition id01 tablespace test_tabspc1
/3、增加分区
alter table caishui.partition_test
add partition id06 values less than (15000000) tablespace test_tabspc6
/4、有影响5、可以
ALTER TABLE PARTITION_TEST
MERGE PARTITIONS
id01, id02
INTO PARTITION 新分区名
/6、外部数据文件 d:\test.txt
1|猪八戒
2|孙悟空
3|唐僧
建一个控制文件 d:\test.ctl
load data
infile 'd:\test.txt'
append
into table partition_test
FIELDS TERMINATED BY "|"
(id,tmpStr)
将数据文件的数据导入数据库
sqlldr userid=caishui/password control=d:\test.ctl
建立分区表
create table partition_test
(
id number(9),
tmpStr varchar2(10)
)
partition by range(id)
(
partition id01 values less than (3000000) tablespace test_tabspc1,
partition id02 values less than (6000000) tablespace test_tabspc2,
partition id03 values less than (9000000) tablespace test_tabspc3,
partition id04 values less than (12000000) tablespace test_tabspc4,
partition id05 values less than (MAXVALUE) tablespace test_tabspc5
)
/1、建立局部分区索引
Create index your_index on caishui.partition_test(id)
local
(
partition id01 tablespace test_tabspc1,
partition id02 tablespace test_tabspc2,
partition id03 tablespace test_tabspc3,
partition id04 tablespace test_tabspc4,
partition id05 tablespace test_tabspc5
)
/2、重建某一个分区的索引
alter index your_index rebuild partition id01 tablespace test_tabspc1
/3、增加分区
alter table caishui.partition_test
add partition id06 values less than (15000000) tablespace test_tabspc6
/4、有影响5、可以
ALTER TABLE PARTITION_TEST
MERGE PARTITIONS
id01, id02
INTO PARTITION 新分区名
/6、外部数据文件 d:\test.txt
1|猪八戒
2|孙悟空
3|唐僧
建一个控制文件 d:\test.ctl
load data
infile 'd:\test.txt'
append
into table partition_test
FIELDS TERMINATED BY "|"
(id,tmpStr)
将数据文件的数据导入数据库
sqlldr userid=caishui/password control=d:\test.ctl
解决方案 »
- 连合查询语句问题
- 为何找不到qu.id???????
- oracle Wrap 问题求解
- oracle读取文件的路径问题
- A用户登录后,查user_tab_privs 和user_sys_privs都查不到B用户的信息,为何能访问B用户的table
- Oracle双机热备时出现的问题:Ora-01033----解决当即给分!!!大虾们辛苦了
- 请问oracle有没有让id自动增长(insert时不用手动插入id)的办法?
- 关于查询返回结果的分页显示问题?
- 一个sql语句问题
- oracle9i備份後如何還原?
- pro c不支持这样insert 吗?
- 用触发器中,我想得到当前被UpDate的行的rowid?应该如何实现???
by the way what do "shuffle up" and "shuffle down" mean??
How to translate them into Chinese?