• OCP-1Z0-052-V8.02-29题


    29. Your database instance is configured with automatic undo management and the UNDO_RETENTION

    parameter is set to 900 seconds. You executed the following command to enable retention guarantee:

    SQL> ALTER TABLESPACE undotbs1 RETENTION GUARANTEE;

    What effect would this command have on the database?

    A.The extents in the undo tablespace retain data until the next full database backup.

    B.The extents containing committed undo in the undo tablespace are not overwritten for at least 15

    minutes.

    C.The extents containing committed data in the undo tablespace are not overwritten until the instance is

    shut down.

    D.The extents containing committed undo in the undo tablespace are transferred to Flash Recovery Area

    before being overwritten.

    Answer: B

    答案解析:

    参考:http://blog.csdn.net/rlhua/article/details/12259555

    保证还原保留时间

    默认还原行为是覆盖已提交、但尚未过期的事务处理的还原信息,而不是让活动事务处理因缺少还原空间而失败。
    保证保留时间会改变此行为有了保留时间保证,即使会导致事务处理失败,仍然会强制执行还原保留时间设置
    RETENTION GUARANTEE是表空间属性而不是初始化参数。此属性只可使用SQL 命令行语句来更改。通过更改还原表空间来保证保留时间的语法是:
    SQL> ALTER TABLESPACE undotbs1 RETENTION GUARANTEE;
    要将有保留时间保证的还原表空间返回到其常规设置,请使用以下命令:
    SQL> ALTER TABLESPACE undotbs1 RETENTION NOGUARANTEE;
    保留时间保证仅适用于还原表空间。尝试对非还原表空间设置保留时间会产生以下错误:
    SQL> ALTER TABLESPACE example RETENTION GUARANTEE;
    ERROR at line 1:
    ORA-30044: 'Retention' can only specified for undo tablespace

    1、解释下undo_retention:
    设置undo_retention,保证commit 后的数据在undo segment中保留多长时间。

    但是并不能保证commit后的undo 信息在undo_retention的时间内一定不被覆写,当undo segment不够时,还是会覆盖已commit的undo 信息。

    2、如果需要保证在undo_retention时间内undo 信息一定不被覆写的话,可以对undo segment设置RETENTION GUARANTEE。
    但是这个参数受到undo_retention和undo size的限制。如果undo size 太小,undo_retention设置太久,设置retention guarantee 时就会报错:
    ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDOTBS2'
    官方解释:
    Retention Guarantee
    To guarantee the success of long-running queries or Oracle Flashback operations, you can enable retention guarantee.
    If retention guarantee is enabled, the specified minimum undo retention is guaranteed;
    the database never overwrites unexpired undo data even if it means that transactions fail due to lack of space in the undo tablespace.
    If retention guarantee is not enabled, the database can overwrite unexpired undo when space is low, thus lowering the undo retention for the system.
    This option is disabled by default.
    WARNING:
    Enabling retention guarantee can cause multiple DML operations to fail. Use with caution.
    You enable retention guarantee by specifying the RETENTION GUARANTEE clause for the undo tablespace
    when you create it with either the CREATE DATABASE or CREATE UNDO TABLESPACE statement.
    Or, you can later specify this clause in an ALTER TABLESPACE statement.
    You disable retention guarantee with the RETENTION NOGUARANTEE clause.
    You can use the DBA_TABLESPACES view to determine the retention guarantee setting for the undo tablespace.
    A column named RETENTION contains a value of GUARANTEE, NOGUARANTEE, or NOT APPLY,
    where NOT APPLY is used for tablespaces other than the undo tablespace.
    sys@TEST0910> select TABLESPACE_NAME,RETENTION from dba_tablespaces;
    TABLESPACE_NAME RETENTION
    ------------------------------ -----------
    SYSTEM NOT APPLY
    SYSAUX NOT APPLY
    UNDOTBS1 NO GUARANTEE 默认
    TEMP NOT APPLY
    USERS NOT APPLY
    EXAMPLE NOT APPLY
    TESTTBS NOT APPLY
    7 rows selected.

  • 相关阅读:
    io几乎没有,iowait却很高
    rcu使用遇到问题汇总
    Groovy In Action 笔记 (5) -- List 相关
    Groovy In Action 笔记 (4) -- String相关
    Groovy In Action 笔记 (3) -- 基本数据类型
    Groovy In Action 笔记 (2) -- '=='与‘equals’
    Groovy In Action 笔记 (1) -- 概述
    ansible notes
    grafana中如何根据label选取数据
    向node_exporter中添加新监控信息
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13317241.html
Copyright © 2020-2023  润新知