还原表及表的约束

flashback table 表名  to before drop;

清理删除表的残留文件(清理回收站之后无法还原)

purge recyclebin;


表的约束

  • 非空约束 not null
  • 主键约束 primary key
  • 唯一约束 unique
  • 外键约束 foreign key
  • 检查约束 check
  • 默认约束 default

1.创建定义主键约束

  alter table 表名 add constraint 约束名 primary key (列名)

2.删除主键约束

  alter table 表名 drop constraint 约束名/(primary key)

 

posted @ 2020-10-21 18:01  年少而为  阅读(68)  评论(0编辑  收藏  举报