-- Create table
create table P#FASP_T_PUPCS021
(
ADMDIV VARCHAR2(32) not null,
GUID VARCHAR2(32) not null,
ISLEAF NUMBER(1),
LEVELNO NUMBER(1),
REMARK VARCHAR2(500),
CREATETIME VARCHAR2(17),
VERSION NUMBER(9),
SUPERGUID VARCHAR2(32),
SRCGUID VARCHAR2(32),
CODE VARCHAR2(200) not null,
NAME VARCHAR2(255) not null,
DESGUID VARCHAR2(32),
SRCSCALE NUMBER(18,4),
STARTTIME VARCHAR2(17),
PINYIN VARCHAR2(200),
EMW VARCHAR2(32),
ALIAS VARCHAR2(100),
FGDG VARCHAR2(32),
ENDTIME VARCHAR2(17),
STATUS CHAR(1),
YEAR CHAR(4) not null,
PROVINCE VARCHAR2(9) not null,
ADMDIVGBCODE CHAR(6),
BORDERDISFLAG CHAR(1),
DIRUNDERFLAG CHAR(1),
ECONBELT VARCHAR2(32),
ECONBELTGUID VARCHAR2(32),
FINADMLEVEL VARCHAR2(32),
FINADMLEVELMARK VARCHAR2(32),
FOODREGFLAG CHAR(1),
GAPDIVFLAG CHAR(1),
HARDDISFLAG CHAR(1),
MINORITYDISFLAG CHAR(1),
OBAORFLAG CHAR(1),
PLANCITYFLAG CHAR(1),
POVDEVDISFLAG CHAR(1),
REVDISFLAG CHAR(1),
DBVERSION TIMESTAMP(6),
CANCELTIME VARCHAR2(17),
ENABLE CHAR(1),
ISSTRAIGHTCOUNTY VARCHAR2(10)
)
partition by list (YEAR)
(
partition P2016 values ('2016')
tablespace EFMIS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 16K
next 1M
minextents 1
maxextents unlimited
),
partition P2017 values ('2017')
tablespace EFMIS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 16K
next 1M
minextents 1
maxextents unlimited
),
partition P2018 values ('2018')
tablespace EFMIS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
)
);
-- Create/Recreate primary, unique and foreign key constraints
alter table P#FASP_T_PUPCS021
add constraint PK_P#FASP_T_PUPCS021 primary key (PROVINCE, YEAR, GUID)
using index
tablespace EFMIS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
-- Create/Recreate indexes
create unique index I_99_ADMDIV on P#FASP_T_PUPCS021 (PROVINCE, YEAR, CODE)
tablespace EFMIS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
-- Grant/Revoke object privileges
grant select on P#FASP_T_PUPCS021 to EFMIS_150001 with grant option;
grant select on P#FASP_T_PUPCS021 to OA_150001 with grant option;
grant select on P#FASP_T_PUPCS021 to PAY_150001 with grant option;