Chinaunix首页 | 论坛 | 博客
  • 博客访问: 673585
  • 博文数量: 487
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 4936
  • 用 户 组: 普通用户
  • 注册时间: 2018-07-05 13:59
个人简介

ocp考试资料群:569933648 验证码:ocp OCP 12c 19c考试题库解析与资料群:钉钉群号:35277291

文章分类

全部博文(487)

文章存档

2024年(2)

2023年(37)

2021年(151)

2020年(37)

2019年(222)

2018年(38)

我的朋友

分类: Oracle

2019-06-26 14:33:27

51题、choose one

The HR. DEPARTMENTS table is the parent of the HR. EMPLOYEES table. The EMPLOYEES .

DEPARTMENT_ID column has a foreign key constraint with the ON DELETE CASCADE option that refers to the DEPARTMENTS. DEPARTMENT_ID column. An index exists on the DEPARTMENTS. DEPARTMENT_ID column. A transaction deletes a primary key in the DEPARTMENTS table, which has child rows in the EMPLOYEES table.

Which statement is true?

A) The transaction acquires a table lock on the DEPARTMENTS table. This lock enables other sessions to query but not update the DEPARTMENTS table until the transaction on the DEPARTMENTS table is complete.

B) The transaction acquires a table lock on the EMPLOYEES table. This lock enables other sessions to query but not update the EMPLOYEES table until the transaction on the DEPARTMENTS table is complete.

C) Only the rows that are deleted in the DEPARTMENTS and EMPLOYEES tables are locked until the transaction on the DEPARTMENTS table is complete.

D) The transaction acquires a table lock only on the DEPARTMENTS table until the transaction is complete.

Answer:C

(解析:这道题的关键点就是ON DELETE CASCADE选项,如果把父表的主键删除(注意这里不是删除主键约束),那么子表相对应的行也会被删除,所以在删除父表主键的时候,子表是被锁住的,目的是同时要删除子表对应的行。因为oracle删除行时是基于行级的锁。试验证明是可以删除其它子表上的行。)


阅读(1035) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~