4.You currently have an active transaction in your session and have been granted select access to V$TRANSACTION
SQL> select xid, status from v$transaction;
XID STATUS
---------------- ------------------------------------------------
0A000100C1330000 ACTIVE
In which three situations will re-executing this query still return a row but with a different XID indicating a new transaction has started?
A.after successfully executing a TRUNCATE statement followed by a DML statement
B.after successfully executing a CREATE TABLE AS Select statement followed by a SELECT FOR UPDATE statement
C.after successfully executing a CREATE TABLE statement followed by a CREATE INDEX statement
D.after successfully executing a commit or ROLLBACK followed by a DML statement
E.after successfully executing a DML statement following a failed DML statement
F. after successfully executing a commit or ROLLBACK followed by a Select statement
答案:ABD
针对A答案,可以看到A执行后的XID不一样,所以A正确
SQL> select xid, status from v$transaction;
XID STATUS
---------------- ------------------------------------------------
03000A00DD0D0000 ACTIVE
SQL> truncate table transaction_table8;
Table truncated.
SQL> insert into transaction_table8 select * from dba_objects;
73552 rows created.
SQL> select xid, status from v$transaction;
XID STATUS
---------------- ------------------------------------------------
06001600DE0D0000 ACTIVE
针对B答案:
SQL> create table t2 as select * from t1;
Table created.
SQL> select xid, status from v$transaction;
no rows selected
SQL> select * from t2 where id=1 for update;
ID NAME
---------- ------------------------------
1 aa
SQL> select xid, status from v$transaction;
XID STATUS
---------------- ------------------------------------------------
09001F0078160000 ACTIVE
针对D答案
SQL> create table transaction_table8 as select * from dba_objects;
Table created.
SQL> insert into transaction_table8 select * from dba_objects;
73552 rows created.
SQL> select xid, status from v$transaction;
XID STATUS
---------------- ------------------------------------------------
0A001A00C0330000 ACTIVE
SQL> commit;
Commit complete.
SQL> insert into transaction_table8 select * from dba_objects;
73552 rows created.
SQL> select xid, status from v$transaction;
XID STATUS
---------------- ------------------------------------------------
06000900E40D0000 ACTIVE
由此可见,正确答案ABD
版权声明:本文为博主原创文章,未经博主允许不得转载。
oracle
- 上一篇:oracle 1z-082 第3题
- 下一篇:oracle 1z-082 第5题