The hr user executes the following query on the employees table but does not issue commit, rollback, or any data definition language (DDL) command after that:

SQL> SELECT job

FROM employees

WHERE job='CLERK' FOR UPDATE OF empno;

HR then opens a second session.

Which two operations wait when executed in HR's second session?

A.INSERT INTO employees(empno,ename,job) VALUES (2001,'Harry','CLERK');

B. LOCK TABLE employees IN EXCLUSIVE MODE;

C. SELECT empno,ename FROM employees WHERE job='CLERK';

D. SELECT job FROM employees WHERE job='CLERK' FOR UPDATE OF empno;

E. INSERT INTO employees(empno,ename) VALUES (1289,'Dick');

Answer: BD

【解析】

使用FOR UPDATE子句可以锁定选定的行,以便其他用户在结束事务之前不能锁定或更新该行。只能在顶级SELECT语句中指定此子句,而不能在子查询中指定此子句。

加上OF ... column子句仅锁定联接中特定表或视图的选择行。OF子句中的列仅指示锁定的表或视图行,您指定的特定列并不重要。 但是,必须指定实际的列名,而不是列别名。如果省略此子句,则数据库将锁定查询中所有表中的选定行。

【官方手册】

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SELECT.html#GUID-CFA006CA-6FF1-4972-821E-6996142A51C6

1z0-062 题库解析3的更多相关文章

  1. 【OCP|052】OCP最新题库解析(052)--小麦苗解答版

    [OCP|052]OCP最新题库解析(052)--小麦苗解答版 OCP最新题库解析历史连接(052):http://mp.weixin.qq.com/s/bUgn4-uciSndji_pUbLZfA ...

  2. OCP考试062题库出现大量新题-19

    choose three Which three statements are true about Oracle Data Pump? A) Oracle Data Pump export and ...

  3. OCP 12c考试题,062题库出现大量新题-第20道

    choose three Your database is configured for ARCHIVELOG mode, and a daily full database backup is ta ...

  4. OCP考试062题库出现大量新题-18

    choose two Examine this command executed on a client that is remote from the database server. SQL> ...

  5. 【2019】OCP 12c 062题库更新大量新题-7

    7.daily_ords_lst is created in locally managed tablespace ORDERS_TBS which uses automatic segment sp ...

  6. 【新题】OCP 062题库出现很多新题-6

    6.Which four statements are true about database instance behavior? A) Redo log files can be renamed ...

  7. OCP 12c 062题库大更新,出现大量新题-5

    5.One of your databases supports an OLTP workload. The default undo tablespace is fixed size with: 1 ...

  8. 1z0-062 题库解析5

    题目: Which three statements are true about Flashback Database? A. Flashback logs are written sequenti ...

  9. 1z0-062 题库解析4

    题目: Examine this parameter: NAME                     TYPE          VALUE ------------------------ -- ...

随机推荐

  1. 打地鼠游戏(2)之定义地鼠函数及函数原型 prototype

    在JavaScript中,prototype对象是实现面向对象的一个重要机制. 每个函数就是一个对象(Function),函数对象都有一个子对象 prototype对象,类是以函数的形式来定义的.pr ...

  2. CSU 2005: Nearest Maintenance Point(Dijkstra + bitset)

    Description A county consists of n cities (labeled 1, 2, …, n) connected by some bidirectional roads ...

  3. 【31.95%】【CF 714B】Filya and Homework

    time limit per test 1 second memory limit per test 256 megabytes input standard input output standar ...

  4. 牛客小白月赛15A 斑羚飞渡

    链接:https://ac.nowcoder.com/acm/contest/917/A 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 131072K,其他语言262144K 64b ...

  5. 【Linux】sed笔记

     sed - stream editor for filtering and transforming text(用于过滤和转换文本的SED流编辑器),主要是以行为单位进行处理,可以将数据行进行替换. ...

  6. Github Pages 无法调用 node_modules 文件夹的解决方案

    今天写一个demo,用npm安装的前端库,然后想在github的pages上展示出来 发布到github后,发现node_modules文件夹下的js无法调用 google解决方案:新增一个名字为.n ...

  7. Popup a window before the MainWindow

    protected override void OnStartup(StartupEventArgs e) { Window w = new Window(); w.ShowDialog(); bas ...

  8. AOP 事物连接,记忆连接数据库,连接池

    <?xml version="1.0" encoding="UTF-8"?><beans xmlns:xsi="http://www ...

  9. 利用OGG进行数据库表的初始化

    OGG初始化 1.停止目标端re1进程 2.配置ei进程(若目标端有ei进程之前投递的文件则先清空) GGSCI (localhost) 1>add extract ei1, sourceist ...

  10. 《提升能力,涨薪可待》-Java并发之AQS全面详解

    欢迎关注公众号[Ccww笔记],原创技术文章第一时间推出 一.AQS是什么?有什么用? AQS全称AbstractQueuedSynchronizer,即抽象的队列同步器,是一种用来构建锁和同步器的框 ...