ALTER TABLE ADMIN.TEST_CARD ADD PARTITION PMAX VALUES LESS THAN (maxvalue);
ALTER TABLE ADMIN.TEST_CARD ADD PARTITION P201207 VALUES LESS THAN (TIMESTAMP' 2012-07-01 00:00:00');
ALTER TABLE ADMIN.TEST_CARD SPLIT PARTITION PMAX AT (TIMESTAMP' 2012-07-01 00:00:00') INTO (PARTITION P201207,PARTITION PMAX);
CREATE TABLE ADMIN.TEST_CARD
(
ID NUMBER(19) NOT NULL,
CREATEDATE TIMESTAMP(6),
INFO VARCHAR2(255 CHAR),
LASTDATE TIMESTAMP(6),
OPERATOR VARCHAR2(100 CHAR),
ORDERID VARCHAR2(100 CHAR),
PARVALUE NUMBER(10) NOT NULL,
PASSWORD VARCHAR2(100 CHAR),
PAYMONEY NUMBER(10) NOT NULL,
RECEIVE NUMBER(1) NOT NULL,
REQUESTTIME TIMESTAMP(6),
SENDURL VARCHAR2(100 CHAR),
SN VARCHAR2(100 CHAR),
STATUS VARCHAR2(20 CHAR),
USERNAME VARCHAR2(50 CHAR),
IS_SUBMIT NUMBER(1),
BOUND_ID NUMBER(19)
)
TABLESPACE CARD_DATA
PCTUSED 0
PCTFREE 20
INITRANS 1
MAXTRANS 255
PARTITION BY RANGE (CREATEDATE)
(
PARTITION P201104 VALUES LESS THAN (TIMESTAMP' 2011-04-01 00:00:00')
LOGGING
NOCOMPRESS
TABLESPACE CARD_DATA
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 100M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201107 VALUES LESS THAN (TIMESTAMP' 2011-07-01 00:00:00')
LOGGING
NOCOMPRESS
TABLESPACE CARD_DATA
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 100M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201110 VALUES LESS THAN (TIMESTAMP' 2011-10-01 00:00:00')
LOGGING
NOCOMPRESS
TABLESPACE CARD_DATA
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 100M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201201 VALUES LESS THAN (TIMESTAMP' 2012-01-01 00:00:00')
LOGGING
NOCOMPRESS
TABLESPACE CARD_DATA
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 100M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201204 VALUES LESS THAN (TIMESTAMP' 2012-04-01 00:00:00')
LOGGING
NOCOMPRESS
TABLESPACE CARD_DATA
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 100M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201207 VALUES LESS THAN (TIMESTAMP' 2012-07-01 00:00:00')
LOGGING
NOCOMPRESS
TABLESPACE CARD_DATA
PCTFREE 20
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 50M
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION PMAX VALUES LESS THAN (MAXVALUE)
LOGGING
NOCOMPRESS
TABLESPACE CARD_DATA
PCTFREE 20
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 50M
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
)
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
CREATE INDEX ADMIN.IDX_TEST_CARD_BOUND_ID ON ADMIN.TEST_CARD
(BOUND_ID)
PCTFREE 10
INITRANS 2
MAXTRANS 255
LOCAL (
PARTITION P201104
LOGGING
NOCOMPRESS
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201107
LOGGING
NOCOMPRESS
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201110
LOGGING
NOCOMPRESS
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201201
LOGGING
NOCOMPRESS
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201204
LOGGING
NOCOMPRESS
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
NEXT 50M
BUFFER_POOL DEFAULT
),
PARTITION P201207
LOGGING
NOCOMPRESS
TABLESPACE CARD_DATA
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 50M
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION PMAX
LOGGING
NOCOMPRESS
TABLESPACE CARD_DATA
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 50M
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
)
NOPARALLEL;
CREATE INDEX ADMIN.IDX_TEST_CARD_SN ON ADMIN.TEST_CARD
(SN)
PCTFREE 10
INITRANS 2
MAXTRANS 255
LOCAL (
PARTITION P201104
LOGGING
NOCOMPRESS
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201107
LOGGING
NOCOMPRESS
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201110
LOGGING
NOCOMPRESS
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201201
LOGGING
NOCOMPRESS
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION P201204
LOGGING
NOCOMPRESS
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
NEXT 50M
BUFFER_POOL DEFAULT
),
PARTITION P201207
LOGGING
NOCOMPRESS
TABLESPACE CARD_DATA
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 50M
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
),
PARTITION PMAX
LOGGING
NOCOMPRESS
TABLESPACE CARD_DATA
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 50M
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
)
NOPARALLEL;
CREATE UNIQUE INDEX ADMIN.PK_TEST_CARD ON ADMIN.TEST_CARD
(ID)
LOGGING
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 50M
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
NOPARALLEL;
ALTER TABLE ADMIN.TEST_CARD ADD (
CONSTRAINT PK_TEST_CARD
PRIMARY KEY
(ID)
USING INDEX
TABLESPACE CARD_INDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 50M
NEXT 50M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
));
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25198367/viewspace-710220/,如需转载,请注明出处,否则将追究法律责任。