Oracle外键不加索引引起死锁示例.docVIP

  • 2
  • 0
  • 约1.31千字
  • 约 3页
  • 2019-10-11 发布于江西
  • 举报
Oracle外键不加索引引起死锁示例 这篇文章主要介绍了Oracle外键不加索引引起死锁的情况及解决,需要的朋友可以参考下 --创建一个表,此表作为子表 create table fk_t as select *from user_objects; delete from fk_t where object_id is null; commit; --创建一个表,此表作为父表 create table pk_t as select *from user_objects; delete from pk_t where object_id is null; commit; --创建父表的主键 alter table PK_t add constraintpk_pktable primary key (OBJECT_ID); --创建子表的外键 alter table FK_t addconstraint fk_fktable foreign key (OBJECT_ID) references pk_t (OBJECT_ID); --session1:执行一个删除操作,这时候在子表和父表上都加了一个Row-S(SX)锁 delete from fk_t whereobject_id=100; delete from pk_t wh

文档评论(0)

1亿VIP精品文档

相关文档