---sms_bengine
---分区名命名方法:PART_TYYYYMM ,分区列:view_time
---最大分区名:PART_T201100
---有maxvalues不能新增分区
select count(1) from sms_bengine partition(PART_T201100);
---PART_T201100
alter table sms_bengine drop partition PART_T201100 UPDATE GLOBAL INDEXES;
alter table sms_bengine rename partition PART_T201112 to PART_T201012;
----------------------------------------------------------------
set serveroutput on size 10000
declare
l_str varchar(1000);
begin
for mm in 1..12 loop
-- for n in 0..2 loop
select 'alter table sms_bengine add PARTITION PART_T2011'||lpad(mm,2,'0')||' VALUES LESS THAN (TIMESTAMP '||chr(39)||'2011-'||lpad(mm+1,2,'0')||'-01 00:00:00'||chr(39)||') TABLESPACE ECHNHAND_DAT;' into l_str from dual;
dbms_output.put_line(replace(l_str,'2011-13','2012-01'));
-- end loop;
end loop;
end;
/
------------------------------------------------------------------
alter table sms_bengine add PARTITION PART_T201101 VALUES LESS THAN (TIMESTAMP '2011-02-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_bengine add PARTITION PART_T201102 VALUES LESS THAN (TIMESTAMP '2011-03-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_bengine add PARTITION PART_T201103 VALUES LESS THAN (TIMESTAMP '2011-04-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_bengine add PARTITION PART_T201104 VALUES LESS THAN (TIMESTAMP '2011-05-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_bengine add PARTITION PART_T201105 VALUES LESS THAN (TIMESTAMP '2011-06-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_bengine add PARTITION PART_T201106 VALUES LESS THAN (TIMESTAMP '2011-07-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_bengine add PARTITION PART_T201107 VALUES LESS THAN (TIMESTAMP '2011-08-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_bengine add PARTITION PART_T201108 VALUES LESS THAN (TIMESTAMP '2011-09-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_bengine add PARTITION PART_T201109 VALUES LESS THAN (TIMESTAMP '2011-10-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_bengine add PARTITION PART_T201110 VALUES LESS THAN (TIMESTAMP '2011-11-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_bengine add PARTITION PART_T201111 VALUES LESS THAN (TIMESTAMP '2011-12-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_bengine add PARTITION PART_T201212 VALUES LESS THAN (TIMESTAMP '2012-01-01 00:00:00') TABLESPACE ECHNHAND_DAT;
---默认分区
alter table sms_bengine add PARTITION PART_T201300 VALUES LESS THAN (MAXVALUE) TABLESPACE ECHNHAND_DAT;
---sms_mo
---分区名命名方法:PART_TYYYYMM ,分区列:up_time
---最大分区名:PART_T201100
---有maxvalues不能新增分区
select count(1) from sms_mo partition(PART_T201100);
---PART_T201100
alter table sms_mo drop partition PART_T201100 UPDATE GLOBAL INDEXES;
alter table sms_mo rename partition PART_T201112 to PART_T201012;
----------------------------------------------------------------
set serveroutput on size 10000
declare
l_str varchar(1000);
begin
for mm in 1..12 loop
-- for n in 0..2 loop
select 'alter table sms_mo add PARTITION PART_T2011'||lpad(mm,2,'0')||' VALUES LESS THAN (TIMESTAMP '||chr(39)||'2011-'||lpad(mm+1,2,'0')||'-01 00:00:00'||chr(39)||') TABLESPACE ECHNHAND_DAT;' into l_str from dual;
dbms_output.put_line(replace(l_str,'2011-13','2012-01'));
-- end loop;
end loop;
end;
/
------------------------------------------------------------------
alter table sms_mo add PARTITION PART_T201101 VALUES LESS THAN (TIMESTAMP '2011-02-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mo add PARTITION PART_T201102 VALUES LESS THAN (TIMESTAMP '2011-03-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mo add PARTITION PART_T201103 VALUES LESS THAN (TIMESTAMP '2011-04-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mo add PARTITION PART_T201104 VALUES LESS THAN (TIMESTAMP '2011-05-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mo add PARTITION PART_T201105 VALUES LESS THAN (TIMESTAMP '2011-06-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mo add PARTITION PART_T201106 VALUES LESS THAN (TIMESTAMP '2011-07-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mo add PARTITION PART_T201107 VALUES LESS THAN (TIMESTAMP '2011-08-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mo add PARTITION PART_T201108 VALUES LESS THAN (TIMESTAMP '2011-09-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mo add PARTITION PART_T201109 VALUES LESS THAN (TIMESTAMP '2011-10-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mo add PARTITION PART_T201110 VALUES LESS THAN (TIMESTAMP '2011-11-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mo add PARTITION PART_T201111 VALUES LESS THAN (TIMESTAMP '2011-12-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mo add PARTITION PART_T201212 VALUES LESS THAN (TIMESTAMP '2012-01-01 00:00:00') TABLESPACE ECHNHAND_DAT;
---默认分区
alter table sms_mo add PARTITION PART_T201300 VALUES LESS THAN (MAXVALUE) TABLESPACE ECHNHAND_DAT;
---sms_mt
---分区名命名方法:PART_TYYYYMM ,分区列:down_time
---最大分区名:PART_T201100
---有maxvalues不能新增分区
select count(1) from sms_mt partition(PART_T201100);
---PART_T201100
alter table sms_mt drop partition PART_T201100 UPDATE GLOBAL INDEXES;
alter table sms_mt rename partition PART_T201112 to PART_T201012;
----------------------------------------------------------------
set serveroutput on size 10000
declare
l_str varchar(1000);
begin
for mm in 1..12 loop
-- for n in 0..2 loop
select 'alter table sms_mt add PARTITION PART_T2011'||lpad(mm,2,'0')||' VALUES LESS THAN (TIMESTAMP '||chr(39)||'2011-'||lpad(mm+1,2,'0')||'-01 00:00:00'||chr(39)||') TABLESPACE ECHNHAND_DAT;' into l_str from dual;
dbms_output.put_line(replace(l_str,'2011-13','2012-01'));
-- end loop;
end loop;
end;
/
------------------------------------------------------------------
alter table sms_mt add PARTITION PART_T201101 VALUES LESS THAN (TIMESTAMP '2011-02-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mt add PARTITION PART_T201102 VALUES LESS THAN (TIMESTAMP '2011-03-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mt add PARTITION PART_T201103 VALUES LESS THAN (TIMESTAMP '2011-04-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mt add PARTITION PART_T201104 VALUES LESS THAN (TIMESTAMP '2011-05-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mt add PARTITION PART_T201105 VALUES LESS THAN (TIMESTAMP '2011-06-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mt add PARTITION PART_T201106 VALUES LESS THAN (TIMESTAMP '2011-07-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mt add PARTITION PART_T201107 VALUES LESS THAN (TIMESTAMP '2011-08-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mt add PARTITION PART_T201108 VALUES LESS THAN (TIMESTAMP '2011-09-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mt add PARTITION PART_T201109 VALUES LESS THAN (TIMESTAMP '2011-10-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mt add PARTITION PART_T201110 VALUES LESS THAN (TIMESTAMP '2011-11-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mt add PARTITION PART_T201111 VALUES LESS THAN (TIMESTAMP '2011-12-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table sms_mt add PARTITION PART_T201212 VALUES LESS THAN (TIMESTAMP '2012-01-01 00:00:00') TABLESPACE ECHNHAND_DAT;
---默认分区
alter table sms_mt add PARTITION PART_T201200 VALUES LESS THAN (MAXVALUE) TABLESPACE ECHNHAND_DAT;
---分区索引
---原索引IDX_ACCESSLOG_SUBURL,基于create_date做的全局索引失效。
---wap_log
---分区名命名方法:PART_TYYYYMM ,分区列:view_time
---最大分区名:PART_T201100
---有maxvalues不能新增分区
select count(1) from wap_log partition(PART_T201100);
---PART_T201100
alter table wap_log drop partition PART_T201100 UPDATE GLOBAL INDEXES;
alter table wap_log rename partition PART_T201112 to PART_T201012;
----------------------------------------------------------------
set serveroutput on size 10000
declare
l_str varchar(1000);
begin
for mm in 1..12 loop
-- for n in 0..2 loop
select 'alter table wap_log add PARTITION PART_T2011'||lpad(mm,2,'0')||' VALUES LESS THAN (TIMESTAMP '||chr(39)||'2011-'||lpad(mm+1,2,'0')||'-01 00:00:00'||chr(39)||') TABLESPACE ECHNHAND_DAT;' into l_str from dual;
dbms_output.put_line(replace(l_str,'2011-13','2012-01'));
-- end loop;
end loop;
end;
/
------------------------------------------------------------------
alter table wap_log add PARTITION PART_T201101 VALUES LESS THAN (TIMESTAMP '2011-02-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table wap_log add PARTITION PART_T201102 VALUES LESS THAN (TIMESTAMP '2011-03-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table wap_log add PARTITION PART_T201103 VALUES LESS THAN (TIMESTAMP '2011-04-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table wap_log add PARTITION PART_T201104 VALUES LESS THAN (TIMESTAMP '2011-05-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table wap_log add PARTITION PART_T201105 VALUES LESS THAN (TIMESTAMP '2011-06-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table wap_log add PARTITION PART_T201106 VALUES LESS THAN (TIMESTAMP '2011-07-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table wap_log add PARTITION PART_T201107 VALUES LESS THAN (TIMESTAMP '2011-08-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table wap_log add PARTITION PART_T201108 VALUES LESS THAN (TIMESTAMP '2011-09-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table wap_log add PARTITION PART_T201109 VALUES LESS THAN (TIMESTAMP '2011-10-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table wap_log add PARTITION PART_T201110 VALUES LESS THAN (TIMESTAMP '2011-11-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table wap_log add PARTITION PART_T201111 VALUES LESS THAN (TIMESTAMP '2011-12-01 00:00:00') TABLESPACE ECHNHAND_DAT;
alter table wap_log add PARTITION PART_T201212 VALUES LESS THAN (TIMESTAMP '2012-01-01 00:00:00') TABLESPACE ECHNHAND_DAT;
---默认分区
alter table wap_log add PARTITION PART_T201300 VALUES LESS THAN (MAXVALUE) TABLESPACE ECHNHAND_DAT;
/* tb_uservisit */
-------------
-- Create table
create table TB_USERVISIT_NEW
(
USER_PHONE VARCHAR2(50),
PAHT VARCHAR2(200),
NODEID VARCHAR2(100),
VISIT_TIME DATE,
TOKEN VARCHAR2(200),
USERID VARCHAR2(200),
AREACODE VARCHAR2(20),
REMARK VARCHAR2(200),
TYPE VARCHAR2(20),
RESNAME VARCHAR2(200),
RESTYPE VARCHAR2(200),
COLUMNID VARCHAR2(200),
COLUMNNAME VARCHAR2(200),
FLAG VARCHAR2(100),
CLIENTIP VARCHAR2(200),
TERMINALTYPE VARCHAR2(3)
)
partition by range (VISIT_TIME)
(
partition PART_T201201 values less than (TO_DATE(' 2012-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201202 values less than (TO_DATE(' 2012-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201203 values less than (TO_DATE(' 2012-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201204 values less than (TO_DATE(' 2012-05-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201205 values less than (TO_DATE(' 2012-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201206 values less than (TO_DATE(' 2012-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201207 values less than (TO_DATE(' 2012-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201208 values less than (TO_DATE(' 2012-09-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201209 values less than (TO_DATE(' 2012-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201210 values less than (TO_DATE(' 2012-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201211 values less than (TO_DATE(' 2012-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201312 values less than (TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201300 values less than (MAXVALUE)
tablespace PORTAL_DAT
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
)
);
-- Add comments to the table
comment on table TB_USERVISIT_NEW
is '用户访问日志';
-- Add comments to the columns
comment on column TB_USERVISIT_NEW.USER_PHONE
is '手机号码';
comment on column TB_USERVISIT_NEW.PAHT
is '访问目录';
comment on column TB_USERVISIT_NEW.NODEID
is '资源编码';
comment on column TB_USERVISIT_NEW.VISIT_TIME
is '访问时间';
comment on column TB_USERVISIT_NEW.TOKEN
is '用户Token';
comment on column TB_USERVISIT_NEW.USERID
is '用户帐号';
comment on column TB_USERVISIT_NEW.AREACODE
is '访问地市编码';
comment on column TB_USERVISIT_NEW.REMARK
is '备注';
comment on column TB_USERVISIT_NEW.TYPE
is '访问类型';
comment on column TB_USERVISIT_NEW.RESNAME
is '资源名称';
comment on column TB_USERVISIT_NEW.RESTYPE
is '资源分类';
comment on column TB_USERVISIT_NEW.COLUMNID
is '归属叶子节点栏目ID';
comment on column TB_USERVISIT_NEW.COLUMNNAME
is '归属叶子节点栏目名称';
comment on column TB_USERVISIT_NEW.FLAG
is '0:手机号,1:邮箱,空:匿名';
comment on column TB_USERVISIT_NEW.CLIENTIP
is '手机客户端IP';
comment on column TB_USERVISIT_NEW.TERMINALTYPE
is ' 1.手机;2.电脑;3. 其它;';
-- creat_index
create index IDX_TB_USERVISIT_VISIT_TIME on TB_USERVISIT_NEW (VISIT_TIME)
tablespace PORTAL_DAT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
pctincrease 0
);
create index IDX_TB_USERVISIT_USER_PHONE on TB_USERVISIT_NEW (USER_PHONE)
tablespace PORTAL_DAT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
pctincrease 0
);
create index IDX_TB_USERVISIT_RESNAME on TB_USERVISIT_NEW (RESNAME)
tablespace PORTAL_DAT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
pctincrease 0
);
create index IDX_TB_USERVISIT_AREACODE on TB_USERVISIT_NEW (AREACODE)
tablespace PORTAL_DAT
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
pctincrease 0
);
-- Grant/Revoke object privileges
alter table TB_USERVISIT rename to TB_USERVISIT_HISTORY2012;
alter table TB_USERVISIT_NEW rename to TB_USERVISIT;
grant select on TB_USERVISIT to ICITYRPT;
------------
-- Create table
-- Create table
create table TW_CALL_SERVICE_LOG
(
SERVICE_NAME VARCHAR2(100),
CALL_START_TIME DATE,
CALL_END_TIME DATE,
PROCESS_TIME NUMBER,
LOGIN_NO VARCHAR2(30),
IN_PARA VARCHAR2(4000),
RET_CODE VARCHAR2(100),
RET_MESSAGE VARCHAR2(4000)
)
partition by range (CALL_END_TIME)
(
partition PART_T201301 values less than (TO_DATE(' 2013-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201302 values less than (TO_DATE(' 2013-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201303 values less than (TO_DATE(' 2013-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201304 values less than (TO_DATE(' 2013-05-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201305 values less than (TO_DATE(' 2013-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201306 values less than (TO_DATE(' 2013-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201307 values less than (TO_DATE(' 2013-08-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201308 values less than (TO_DATE(' 2013-09-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201309 values less than (TO_DATE(' 2013-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201310 values less than (TO_DATE(' 2013-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201311 values less than (TO_DATE(' 2013-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201412 values less than (TO_DATE(' 2014-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
),
partition PART_T201400 values less than (MAXVALUE)
tablespace PORTAL_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
next 1M
minextents 1
maxextents unlimited
pctincrease 0
)
);
-- Add comments to the columns
comment on column TW_CALL_SERVICE_LOG.SERVICE_NAME
is '接口方法名称';
comment on column TW_CALL_SERVICE_LOG.CALL_START_TIME
is '访问开始时间';
comment on column TW_CALL_SERVICE_LOG.CALL_END_TIME
is '访问结束时间';
comment on column TW_CALL_SERVICE_LOG.PROCESS_TIME
is '访问经历时间';
comment on column TW_CALL_SERVICE_LOG.LOGIN_NO
is '登陆账号';
comment on column TW_CALL_SERVICE_LOG.IN_PARA
is '输入参数';
comment on column TW_CALL_SERVICE_LOG.RET_CODE
is '返回状态码';
comment on column TW_CALL_SERVICE_LOG.RET_MESSAGE
is '返回状态描述';
create index IDX_SERVICE_LOG_SERVICE_NAME on TW_CALL_SERVICE_LOG (SERVICE_NAME) LOCAL
tablespace PORTAL_DATA
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
pctincrease 0
);
create index IDX_SERVICE_LOG_LOGIN_NO on TW_CALL_SERVICE_LOG (LOGIN_NO) LOCAL
tablespace PORTAL_DATA
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
pctincrease 0
);
rename tb_uservisit to tb_uservisit_bak1;
rename TB_USERVISIT_NEW to TB_USERVISIT;
create table tb_uservisit_3 as select * from tb_uservisit_bak1 where visit_time >sysdate-3;
alter table TB_USERVISIT exchange partition PART_T201207 with table tb_uservisit_3 ;
表分区建立以及删除.sql
最新推荐文章于 2024-07-24 22:36:05 发布