添加主键:
alter table CWH_REPORT add primary key (ID);
添加外键:
alter table 子表名 add constraint 子表名 foreign key(子表字段) references c父表名(父表字段) on delete CASCADE;级联删除。
同时注意一点Oracle没有级联更新,如果想更新需要用触发器。
create sequence seq_cwh_sub_monitor_log
minvalue 1
maxvalue 99999999999
start with 1
increment by 1
nocache
order;