教学文章
Technology Exchange
热门课程
400电话

免费咨询热线
400-090-9964

教学文章

Oracle 11g OCP认证052考试题库(66)-CUUG内部学员版

时间:2019-09-17 来源:

11g版本的OCP考试持续了好几年,一直比较稳定,直到2018年4月份左右,052考试不断的出现新的考题,虽然我们收集整理了不少,但新题还是难避免,这样出现一部分新题,我们收集一部分,持续了不短的时间。

对于这些052考试新题,不仅老师给出了答案,学员也积极的找资料、查文档,形成了一份内部综合版本,通过分数非常高,一起渡过这次052考试的难关。

-----------------------------------------------

052考试题-66(OCP考试题库讨论群:101-5267-481 验证:ocp)

Examine these SQL statements and their output:

SQL> select name,value

2 from v$parameter

3 where name like 'undo%';

NAME  VALUE

-------------------- ----------------

undo_management AUTO

undo_tablespace UNDO

undo_retention 900

SQL> select contents,retention

2 from dba_tablespaces

3 where tablespace_name='UNDO';

CONTENTS RETENTION

-------------- --------------

UNDO GUARANTEE

SQL> select blocks,autoextensible,maxblocks

2 from dba_data_files

3 Where tablespace_name='UNDO';

BLOCKS AUT MAXBLOCKS

------------- ----- -----------------

6400  NO  0

Which two are true?

A)Transactions will wait until free space becomes available in the undo tablespace when they have failed to allocate space

B)The undo tablespace will grow automatically if there is not enough space to retain active undo C)Inactive undo will be retain for at least 15 minutes

D)Expired undo will be retained as long as possible within the limits of the current size of the undo tablespace

E)Active undo will be retained as long as needed by the transactions

Answer: CE

赵:

对于 A 选项,空间不足会报错,不会等待。

对于 B 选项, autoextensible 列的值为 NO ,表示非自动扩展。

对于 D 选项, Expired undo 会被覆盖。

undo_retention:指定事务 commit 后 undo 将要保存的时间(秒),在 ORACLE10g 中默认的是 900 秒(15分钟)。

GUARANTEE : 保证 undo_retention 参数所设定的时间有效,这个是 10g 的新功能。

SQL> ALTER TABLESPACE undotbs1 RETENTION GUARANTEE;

SQL> ALTER TABLESPACE undotbs1 RETENTION NOGUARANTEE;

在没有 guarantee 的保证下,ORACLE 并不能保证能够将 undo 信息存储 900 秒,如果 undo 表空间不足,那么 ORACLE 将忽略 undo_retention 的设置,直接覆盖掉以前的 undo,这个时候有可能会产生ORA-01555 错误。如果 undo 表空间空间足够,那么 undo 将会保存很长一段时间,直到 undo 表空间达到 maxsize,这个时候才会覆盖 undo 信息,而且 ORACLE 会从最古老的 undo 信息开始覆盖。

ORACLE 推荐我们将 undo 表空间中的 datafile 设定 MAXSIZE ,不要让它一直自动扩展,如果 ORACLE 获得了自动扩展的能力,那么旧的 undo 不会被覆盖,到后来 undo 表空间会越来越大,越来越大,直到将磁盘空间耗尽。

在有 guarantee 的保证下,ORACLE 将会保证 undo 信息能够保存到 undo_retention 设定的值之后才被覆盖,如果这个时候同时执行了很多事务,将 undo 表空间耗完了,那么那个事务会失败,会报 ORA-30036 错误,所以使用 guarantee 一定要慎用,如果非要使用 guarantee,那么尽量将 undo 表空间设大 一点。

版权所有@北京神脑资讯技术有限公司(CUUG,中国UNIX用户协会) Copyright ALL Rights Reserved 京ICP备11008061号-1

CUUG旗下网站:www.cuug.com.cn www.cuug.com oracle.cuug.com bbs.cuug.com www.cuug.net

电话:010-59426307 010-59426319 邮政编码:100089

地址:北京市海淀区北清路164号28-38号院