-- Create table
create table T_FTP_OPERATION_LOG
(
I_ID INTEGER not null,
I_MODEL_ID INTEGER,
I_USER_ID INTEGER,
I_OPERATION_TYPE INTEGER,
DTM_OPERATION_TIME DATE
)
tablespace S_NOSS_DEV_USER
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64
next 1
minextents 1
maxextents unlimited
);
-- Add comments to the columns
comment on column T_FTP_OPERATION_LOG.I_ID
is '唯一标示,自动增长列';
comment on column T_FTP_OPERATION_LOG.I_MODEL_ID
is '模板ID';
comment on column T_FTP_OPERATION_LOG.I_USER_ID
is 'FTP操作人ID';
comment on column T_FTP_OPERATION_LOG.I_OPERATION_TYPE
is '操作类型1.添加2.修改.3删除';
comment on column T_FTP_OPERATION_LOG.DTM_OPERATION_TIME
is '操作时间';
-- Create/Recreate primary, unique and foreign key constraints
alter table T_FTP_OPERATION_LOG
add constraint P_I_ID primary key (I_ID)
using index
tablespace S_NOSS_DEV_USER
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
-- Grant/Revoke object privileges
--授权
grant select on T_FTP_OPERATION_LOG to NOSS_TEST;
--建立公共同义词
create or replace public synonym T_FTP_OPERATION_LOG for noss_dev.T_FTP_OPERATION_LOG;
--建立序列
create sequence T_FTP_OPERATION_LOG_seq
minvalue 1
maxvalue 9999999999
increment by 1
cache 20;
--建立触发器,插入数据时,插入下个序列到主键
create or replace trigger T_FTP_OPERATION_LOG_tri
before insert on T_FTP_OPERATION_LOG
for each row
begin
select T_FTP_OPERATION_LOG_seq.Nextval into :new.id from dual;
end;
create table T_FTP_OPERATION_LOG
(
I_ID INTEGER not null,
I_MODEL_ID INTEGER,
I_USER_ID INTEGER,
I_OPERATION_TYPE INTEGER,
DTM_OPERATION_TIME DATE
)
tablespace S_NOSS_DEV_USER
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64
next 1
minextents 1
maxextents unlimited
);
-- Add comments to the columns
comment on column T_FTP_OPERATION_LOG.I_ID
is '唯一标示,自动增长列';
comment on column T_FTP_OPERATION_LOG.I_MODEL_ID
is '模板ID';
comment on column T_FTP_OPERATION_LOG.I_USER_ID
is 'FTP操作人ID';
comment on column T_FTP_OPERATION_LOG.I_OPERATION_TYPE
is '操作类型1.添加2.修改.3删除';
comment on column T_FTP_OPERATION_LOG.DTM_OPERATION_TIME
is '操作时间';
-- Create/Recreate primary, unique and foreign key constraints
alter table T_FTP_OPERATION_LOG
add constraint P_I_ID primary key (I_ID)
using index
tablespace S_NOSS_DEV_USER
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
-- Grant/Revoke object privileges
--授权
grant select on T_FTP_OPERATION_LOG to NOSS_TEST;
--建立公共同义词
create or replace public synonym T_FTP_OPERATION_LOG for noss_dev.T_FTP_OPERATION_LOG;
--建立序列
create sequence T_FTP_OPERATION_LOG_seq
minvalue 1
maxvalue 9999999999
increment by 1
cache 20;
--建立触发器,插入数据时,插入下个序列到主键
create or replace trigger T_FTP_OPERATION_LOG_tri
before insert on T_FTP_OPERATION_LOG
for each row
begin
select T_FTP_OPERATION_LOG_seq.Nextval into :new.id from dual;
end;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26940217/viewspace-733119/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26940217/viewspace-733119/