oracle普通表转分区表(在线重定义方式)

1.1.TAB_TAOBAO_BILL

1.1.1检查下这张表是否可以在线重定义,无报错表示可以,报错会给出错误信息:

exec dbms_redefinition.can_redef_table(‘ycheng‘, ‘P_TAB_TAOBAO_BILL‘);

1.1.2.expdp导出表进行备份(这里的DATA_PUMP_1目录是/data1/dpdump)

expdp \‘\/ as sysdba\‘ directory=DATA_PUMP_1 tables=TAB_TAOBAO_BILL dumpfile=ycheng_TAB_TAOBAO_BILL0914.dmp logfile=ycheng_TAB_TAOBAO_BILL0914.log parallel=2;

1.1.3检查TAB_GS_BAG表使用的表空间使用率(这里检查表空间是否充裕,如果表空间不足,执行1.1.4,增加表空间)

SELECT D.TABLESPACE_NAME,

SPACE || ‘M‘ "SUM_SPACE(M)",

BLOCKS "SUM_BLOCKS",

SPACE - NVL (FREE_SPACE, 0) || ‘M‘ "USED_SPACE(M)",

ROUND ( (1 - NVL (FREE_SPACE, 0) / SPACE) * 100, 2) || ‘%‘

"USED_RATE(%)",

FREE_SPACE || ‘M‘ "FREE_SPACE(M)"

FROM ( SELECT TABLESPACE_NAME,

ROUND (SUM (BYTES) / (1024 * 1024), 2) SPACE,

SUM (BLOCKS) BLOCKS

FROM DBA_DATA_FILES

GROUP BY TABLESPACE_NAME) D,

( SELECT TABLESPACE_NAME,

ROUND (SUM (BYTES) / (1024 * 1024), 2) FREE_SPACE

FROM DBA_FREE_SPACE

GROUP BY TABLESPACE_NAME) F

WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME(+)

UNION ALL

SELECT D.TABLESPACE_NAME,

SPACE || ‘M‘ "SUM_SPACE(M)",

BLOCKS SUM_BLOCKS,

USED_SPACE || ‘M‘ "USED_SPACE(M)",

ROUND (NVL (USED_SPACE, 0) / SPACE * 100, 2) || ‘%‘ "USED_RATE(%)",

NVL (FREE_SPACE, 0) || ‘M‘ "FREE_SPACE(M)"

FROM ( SELECT TABLESPACE_NAME,

ROUND (SUM (BYTES) / (1024 * 1024), 2) SPACE,

SUM (BLOCKS) BLOCKS

FROM DBA_TEMP_FILES

GROUP BY TABLESPACE_NAME) D,

( SELECT TABLESPACE_NAME,

ROUND (SUM (BYTES_USED) / (1024 * 1024), 2) USED_SPACE,

ROUND (SUM (BYTES_FREE) / (1024 * 1024), 2) FREE_SPACE

FROM V$TEMP_SPACE_HEADER

GROUP BY TABLESPACE_NAME) F

WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME(+)

ORDER BY 1;

1.1.4增加表空间

ALTER TABLESPACE USERS ADD DATAFILE ‘/data1/ycmain/USERS20160914.dbf‘ SIZE 31G;

1.2 创建YCHENG.P_TAB_TAOBAO_BILL中间表

create table P_TAB_TAOBAO_BILL

(

tx_logistic_id VARCHAR2(64) not null,

trade_no VARCHAR2(64),

bill_code VARCHAR2(64),

flag NUMBER,

create_date DATE default sysdate not null,

status NUMBER(2) default 0 not null,

rec_site VARCHAR2(30),

rec_man VARCHAR2(30),

rec_bill_man VARCHAR2(30),

rec_date DATE,

accept_date DATE,

send_site VARCHAR2(30),

send_man VARCHAR2(30),

send_date DATE,

bl_cancel NUMBER(1) default 0 not null,

cancel_date DATE,

cancel_desc VARCHAR2(215),

bl_dispart NUMBER(1) default 0 not null,

prepare_site VARCHAR2(400),

name VARCHAR2(120),

address VARCHAR2(256),

post_code VARCHAR2(20),

phone VARCHAR2(32),

mobile VARCHAR2(32),

prov VARCHAR2(64),

city VARCHAR2(64),

county VARCHAR2(64),

send_start_time DATE,

send_end_time DATE,

item_name VARCHAR2(256),

piece NUMBER,

special NUMBER,

remark VARCHAR2(512),

insurance_value NUMBER,

package_or_not NUMBER(1),

send_name VARCHAR2(120) not null,

send_address VARCHAR2(256) not null,

send_post_code VARCHAR2(20),

send_phone VARCHAR2(32),

send_mobile VARCHAR2(32),

send_prov VARCHAR2(64) not null,

send_city VARCHAR2(64) not null,

send_county VARCHAR2(64) not null,

cancel_site VARCHAR2(30),

cancel_man VARCHAR2(30),

rec_goods_man VARCHAR2(30),

message VARCHAR2(100),

customer_id VARCHAR2(64),

goods_value NUMBER(10,2),

items_value NUMBER,

companyname VARCHAR2(110),

send_companyname VARCHAR2(110),

total_weight NUMBER(10,2),

total_volume NUMBER(10,2),

pay_type VARCHAR2(10),

transport_price NUMBER default 0.0,

insurance_price NUMBER,

package_service VARCHAR2(32),

package_service_price NUMBER,

other_price NUMBER,

total_price NUMBER,

promotion VARCHAR2(500),

member_type VARCHAR2(32),

business_network_no VARCHAR2(32),

gmt_commit DATE,

gmt_updated DATE,

logistic_company_id VARCHAR2(32),

schedule_type NUMBER,

order_flag VARCHAR2(32),

tms_service_code VARCHAR2(64),

logisticproviderid VARCHAR2(20),

opt_date DATE,

opt_man VARCHAR2(64),

other7 NUMBER(10,2),

other9 VARCHAR2(30),

wmsaddress VARCHAR2(500),

other8 VARCHAR2(3),

other10 VARCHAR2(30),

logistype VARCHAR2(30),

eccompanyid VARCHAR2(64),

total_service_fee NUMBER(9,2),

buy_service_fee NUMBER(9,2),

cod_split_fee NUMBER(9,2),

type VARCHAR2(5),

ordertype NUMBER,

servicetype NUMBER,

seq NUMBER,

send_company VARCHAR2(110),

is_beyond NUMBER(1),

guid VARCHAR2(36),

cus_id VARCHAR2(36),

weight_rate NUMBER(5,2),

volume_rate NUMBER(5,2),

least_expenses NUMBER,

transport_type VARCHAR2(20),

vist_receive VARCHAR2(1),

vist_receive_price NUMBER(8,2),

delivery_type VARCHAR2(2),

delivery_price NUMBER(8,2),

cod_type VARCHAR2(2),

cod_price NUMBER(8,2),

back_signbill VARCHAR2(2),

back_signbill_price NUMBER(8,2),

wait_notifysend VARCHAR2(2),

wait_notifysend_price NUMBER(8,2),

sms_notify VARCHAR2(1),

sms_notify_price NUMBER(8,2),

fuelsurcharge VARCHAR2(1),

fuelsurcharge_price NUMBER(8,2),

duty_site VARCHAR2(30),

modifier VARCHAR2(30),

modify_site VARCHAR2(30),

modify_code VARCHAR2(30),

destination VARCHAR2(50),

favourable_bill VARCHAR2(50),

bl_order_status NUMBER(1),

online_price NUMBER(10,2),

sign_status VARCHAR2(20),

bl_insurance NUMBER(1),

creater_man VARCHAR2(30),

creater_site VARCHAR2(30),

creater_code VARCHAR2(30),

rec_bill_code VARCHAR2(30),

bl_depute NUMBER(1),

bl_tms_control NUMBER(1),

ordersource VARCHAR2(10)

)

partition by range(create_date)

interval (numtoyminterval(1,‘month‘))

(

partition TAB_TAOBAO_BILL_2014_12 values less than (TO_DATE(‘ 2015-01-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_01 values less than (TO_DATE(‘ 2015-02-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_02 values less than (TO_DATE(‘ 2015-03-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_03 values less than (TO_DATE(‘ 2015-04-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_04 values less than (TO_DATE(‘ 2015-05-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_05 values less than (TO_DATE(‘ 2015-06-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_06 values less than (TO_DATE(‘ 2015-07-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_07 values less than (TO_DATE(‘ 2015-08-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_08 values less than (TO_DATE(‘ 2015-09-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_09 values less than (TO_DATE(‘ 2015-10-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_10 values less than (TO_DATE(‘ 2015-11-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_11 values less than (TO_DATE(‘ 2015-12-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2015_12 values less than (TO_DATE(‘ 2016-01-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_01 values less than (TO_DATE(‘ 2016-02-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_02 values less than (TO_DATE(‘ 2016-03-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_03 values less than (TO_DATE(‘ 2016-04-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_04 values less than (TO_DATE(‘ 2016-05-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_05 values less than (TO_DATE(‘ 2016-06-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_06 values less than (TO_DATE(‘ 2016-07-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_07 values less than (TO_DATE(‘ 2016-08-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_08 values less than (TO_DATE(‘ 2016-09-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_09 values less than (TO_DATE(‘ 2016-10-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_10 values less than (TO_DATE(‘ 2016-11-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_11 values less than (TO_DATE(‘ 2016-12-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2016_12 values less than (TO_DATE(‘ 2017-01-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_01 values less than (TO_DATE(‘ 2017-02-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_02 values less than (TO_DATE(‘ 2017-03-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_03 values less than (TO_DATE(‘ 2017-04-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_04 values less than (TO_DATE(‘ 2017-05-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_05 values less than (TO_DATE(‘ 2017-06-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_06 values less than (TO_DATE(‘ 2017-07-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_07 values less than (TO_DATE(‘ 2017-08-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_08 values less than (TO_DATE(‘ 2017-09-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_09 values less than (TO_DATE(‘ 2017-10-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_10 values less than (TO_DATE(‘ 2017-11-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_11 values less than (TO_DATE(‘ 2017-12-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2017_12 values less than (TO_DATE(‘ 2018-01-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘)),

partition TAB_TAOBAO_BILL_2018_01 values less than (TO_DATE(‘ 2018-02-01 00:00:00‘, ‘SYYYY-MM-DD HH24:MI:SS‘))

TABLESPACE "USERS";

1.3.1.删除索引

drop INDEX "YCHENG"."TAB_TAOBAO_BILL_I";

drop INDEX "YCHENG"."TAB_TAOBAO_BILL_I1";

drop INDEX "YCHENG"."TAB_TAOBAO_BILL_I2";

drop INDEX "YCHENG"."TAB_TAOBAO_BILL_I3";

drop INDEX "YCHENG"."TAB_TAOBAO_BILL_I4";

drop INDEX "YCHENG"."TAB_TAOBAO_BILL_I6";

drop INDEX "YCHENG"."TAB_TAOBAO_BILL_I7";

drop INDEX "YCHENG"."TAB_TAOBAO_BILL_I8";

drop INDEX "YCHENG"."TAB_TAOBAO_BILL_I9";

1.3.2.新建索引

-- Create/Recreate indexes

create index TAB_TAOBAO_BILL_I on P_TAB_TAOBAO_BILL (BILL_CODE)

nologging local;

create index TAB_TAOBAO_BILL_I1 on P_TAB_TAOBAO_BILL (CREATE_DATE, REC_SITE, STATUS)

nologging local;

create index TAB_TAOBAO_BILL_I2 on P_TAB_TAOBAO_BILL (CREATE_DATE, SEND_SITE, STATUS)

nologging local;

create index TAB_TAOBAO_BILL_I3 on P_TAB_TAOBAO_BILL (CREATE_DATE, BL_DISPART, STATUS)

nologging local;

create index TAB_TAOBAO_BILL_I4 on P_TAB_TAOBAO_BILL (CUSTOMER_ID)

nologging local;

create index TAB_TAOBAO_BILL_I6 on P_TAB_TAOBAO_BILL (MOBILE)

nologging local;

create index TAB_TAOBAO_BILL_I7 on P_TAB_TAOBAO_BILL (SEND_MOBILE)

nologging local;

create index TAB_TAOBAO_BILL_I8 on P_TAB_TAOBAO_BILL (SEND_PHONE)

nologging local;

create index TAB_TAOBAO_BILL_I9 on P_TAB_TAOBAO_BILL (ACCEPT_DATE, LOGISTICPROVIDERID)

nologging local;

CREATE INDEX ind_bill_status ON P_tab_taobao_bill ("REC_BILL_MAN", "STATUS") online nologging parallel 8;

1.4.1新建立主键

-- Create/Recreate primary, unique and foreign key constraints

alter table P_TAB_TAOBAO_BILL

add constraint P_TAB_TAOBAO_BILL_P primary key (TX_LOGISTIC_ID)

using index

tablespace USERS

1.42授权

grant select on TAB_TAOBAO_BILL to YCQUERY;

1.5启动在线重定义:

exec dbms_redefinition.start_redef_table(‘ycheng‘, ‘TAB_TAOBAO_BILL‘, ‘P_TAB_TAOBAO_BILL‘);

1.6.查看量表数据是否一致

select count(1) from YCHENG.TAB_TAOBAO_BILL;

select count(1) from YCHENG.P_TAB_TAOBAO_BILL;

1.7.使用dbms_redefinition包的sync_interim_table模块刷新数据后,中间表也可以看到数据更改(这里,当原表数据发生改变时,可用如下刷新同步数据)

--管理员权限执行sql命令行执行,同步两边数据

exec dbms_redefinition.sync_interim_table(‘ycheng‘, ‘TAB_TAOBAO_BILL‘, ‘P_TAB_TAOBAO_BILL‘);

--管理员权限执行sql命令行执行

1.8.结束在线重定义

--管理员权限执行sql命令行执行,结束重定义

exec dbms_redefinition.finish_redef_table(‘ycheng‘, ‘TAB_TAOBAO_BILL‘, ‘P_TAB_TAOBAO_BILL‘);

--管理员权限执行sql命令行执行

1.9.验证数据

select count(1) from YCHENG.TAB_TAOBAO_BILL;

select count(1) from YCHENG.P_TAB_TAOBAO_BILL;

1.10.查看各分区数据是否正确

select PARTITION_NAME from user_tab_partitions where table_name = ‘TAB_TAOBAO_BILL‘;

select * from TAB_TAOBAO_BILL partition(TAB_TAOBAO_BILL_2016_12);

1.11.删掉中间表

drop table P_TAB_TAOBAO_BILL;

1.12.修改主键

alter table "YCHENG"."TAB_TAOBAO_BILL" drop constraint P_TAB_TAOBAO_BILL_P cascade drop index;

-- Create/Recreate primary, unique and foreign key constraints

alter table TAB_TAOBAO_BILL

add constraint TAB_TAOBAO_BILL_P primary key (TX_LOGISTIC_ID)

using index

tablespace USERS

1.13 收集TAB_TAOBAO_BILL分区表及相关对象的优化器统计信息

需要用到sys用户在SQLPLUS下进行操作

EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>‘YCHENG‘,TABNAME=>‘TAB_TAOBAO_BILL‘,ESTIMATE_PERCENT=>100,METHOD_OPT=>‘FOR ALL COLUMNS SIZE AUTO‘,DEGREE=>2,NO_INVALIDATE=>FALSE,CASCADE=>TRUE);

时间: 2024-11-09 03:36:49

oracle普通表转分区表(在线重定义方式)的相关文章

一个完整的以在线重定义方式普通表转分区表的方案

1. 转分区表原因 生产数据库,一张表,一亿多行数据,绝大部分查询按月为维度做时间范围查 询,未分区状态下,查询IO量大,计划以分区截剪的方式减少IO量,提升前前台查询性能 2. 实施目的 将未分区的oXX_XXt_owner.id_oXXXdx_mX表以(stat_XXcle)字段为分区键,以在定义的方式转换成按月分区表的时间范围分区表,利且在线重定义的特性,保留权限的不漏赋以及极少时间的影响生产. 3. 注意事项 (1)       数据库若是双节点,只需在其中一个节点的数据库上实施. (2

如何对已经存在数据的表进行在线重定义方式实现分区

转一位大神的笔记. Oracle的普通表没有办法通过修改属性的方式直接转化为分区表,必须通过重建的方式进行转变,下面介绍三种效率比较高的方法,并说明它们各自的特点. 方法一:利用原表重建分区表. 步骤: SQL> CREATE TABLE T (ID NUMBER PRIMARY KEY, TIME DATE); 表已创建. SQL> INSERT INTO T SELECT ROWNUM, CREATED FROM DBA_OBJECTS; 已创建6264行. SQL> COMMIT;

Oracle在线重定义(online redefinition)--将普通表改为分区表

使用Oracle的在线重定义技术,可以将Oracle的普通表改为分区表.操作如下: STEP1:测试表是否可以在线重定义,这里以unixdev数据库的LIJIAMAN.BSTEST为例 EXEC DBMS_REDEFINITION.CAN_REDEF_TABLE('LIJIAMAN','BSTEST', DBMS_REDEFINITION.CONS_USE_PK); 如果表上没有主键,则会报错:SQL> exec dbms_redefinition.start_redef_table('LIJI

使用ORACLE在线重定义将普通表改为分区表

1.首先建立测试表,并插入测试数据: create table myPartition(id number,code varchar2(5),identifier varchar2(20)); insert into myPartition values(1,'01','01-01-0001-000001'); insert into myPartition values(2,'02','02-01-0001-000001'); insert into myPartition values(3,

Oracle在线重定义DBMS_REDEFINITION 普通表—>分区表

实验环境:RHEL 6.4 + Oracle 11.2.0.3实验:在线重定义 普通表 为 分区表,包括主键对应的索引都改造为分区索引. 1,构造普通表t_objects conn test1/test1; create table t_objects as select * from dba_objects; SQL> select count(1) from t_objects; COUNT(1) ---------- 468738 --t_objects建立主键和索引 alter tabl

oracle 11g在线重定义 普通表变分区表

第一种方法使用主键id进行重定义--createusertestidentifiedby1accountunlock;--grantresource--grantcreateanytable,alteranytable,dropanytable,lockanytable,selectanytabletotest;--<1>创建测试表,以下使用在线重定义把表转换为分区表,created为分区键,object_id为.. v.17173.com/playlist_17354294.htmlv.17

ORACLE系统包DBMS_REDEFINITION实现表的在线重定义

ORACLE自带的DBMS_REDEFINITION包功能非常强大,可以用于降低高水位线,回收碎片空间,对表做在线重定义(添加或删除字段,改变字段类型,普通表重定义表为分区表,分区表重定义表为普通表等等) 另外,它有一个非常强大的功能,"在线"二字体现得淋漓尽致,但是也并不是完全的在线,因为在完成重定义前的最后一下,会持会表级排他锁,但这个锁定时间是可控的. 如果你也曾为delete无法降低高水位线而烦恼或者由于历史表太大导致维护困难,我相信这篇文章将对你有很大的感触,因此相信绝大朋友

Oracle已有数据表建立表分区—在线重定义

今天在做数据抽取的时候,发现有一张业务表数据量达到了5000W,所以就想将此表改为分区表.分区表的有点如下: 1.改善查询性能:对分区对象的查询可以仅搜索自己关心的分区,提高检索速度.2.增强可用性:如果表的某个分区出现故障,表在其他分区的数据仍然可用:3.维护方便:如果表的某个分区出现故障,需要修复数据,只修复该分区即可:4.均衡I/O:可以把不同的分区映射到磁盘以平衡I/O,改善整个系统性能. 第一步:首先对要在线重定义的表自行验证,看该表是否可以重定义,如果不可以则会提示错误信息 SQL>

oracle在线重定义表

在一个高可用系统中,如果需要改变一个表的定义是一件比较棘手的问题,尤其是对于7×24系统.Oracle提供的基本语法基本可以满足一般性修改,但是对于把普通堆表改为分区表,把索引组织表修改为堆表等操作就无法完成了.而且,对于被大量DML语句访问的表,幸运的是,Oracle从9i版本开始提供了在线重定义表功能,通过调用DBMS_REDEFINITION包,可以在修改表结构的同时允许DML操作. 在线重定义表具有以下功能:修改表的存储参数:可以将表转移到其他表空间:增加并行查询选项:增加或删除分区:重