58. View the Exhibit and examine the parameters.
User A executes the following command to update the TRANS table:
SQL> UPDATE B.trans SET tr_amt=tr_amt+500 WHERE c_code='C005';
Before user A issues a COMMIT or ROLLBACK command, user B executes the following command on
the TRANS table:
SQL> ALTER TABLE trans MODIFY (tr_type VARCHAR2(3));
What would happen in this scenario?
A.The ALTER TABLE command modifies the column successfully.
B.The DDL operation gets higher priority and transaction for user A is rolled back.
C.The ALTER TABLE command waits indefinitely until user A ends the transaction.
D.The ALTER TABLE command fails after waiting for 60 seconds due to the resource being busy.
Answer: D
当不断有业务在执行时,执行ddl会报错。在没有ddl_lock_timeout参数时,只能通过loop,不停的来执行ddl。
设置ddl_lock_timeout后,可以让ddl等待一段时间,如果在这个期间内dml已提交。则ddl将执行成功,否则超时报错。
User A executes the following command to update the TRANS table:
SQL> UPDATE B.trans SET tr_amt=tr_amt+500 WHERE c_code='C005';
Before user A issues a COMMIT or ROLLBACK command, user B executes the following command on
the TRANS table:
SQL> ALTER TABLE trans MODIFY (tr_type VARCHAR2(3));
What would happen in this scenario?
A.The ALTER TABLE command modifies the column successfully.
B.The DDL operation gets higher priority and transaction for user A is rolled back.
C.The ALTER TABLE command waits indefinitely until user A ends the transaction.
D.The ALTER TABLE command fails after waiting for 60 seconds due to the resource being busy.
Answer: D
当不断有业务在执行时,执行ddl会报错。在没有ddl_lock_timeout参数时,只能通过loop,不停的来执行ddl。
设置ddl_lock_timeout后,可以让ddl等待一段时间,如果在这个期间内dml已提交。则ddl将执行成功,否则超时报错。
SESSION1 > update emp set sal = 100 where empno = 7788;
1 row updated
SESSION2> show parameter ddl_lock_timeout
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
ddl_lock_timeout integer 0
SESSION2> alter table emp modify ename varchar2(50);
alter table emp modify ename varchar2(50)
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
SESSION2> alter session set ddl_lock_timeout=3;
Session altered
SESSION2> alter table emp modify ename varchar2(50);
alter table emp modify ename varchar2(50)
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
SESSION2> alter session set ddl_lock_timeout=10;
Session altered
SESSION2> alter table emp modify ename varchar2(50);
SESSION1 > rollback;
Rollback complete
Table altered
Executed in 6.844 seconds