探讨Oracle 事务并行恢复

在之前的文章中提到过event 10513详见[url]http://itspace.iteye.com/blog/567754[/url],今天继续探讨Oracle smon进程并行恢复的话题。
在不同的Oracle版本中并行恢复或多或少存在部分bug,我们可以通过参数FAST_START_PARALLEL_ROLLBACK来设置恢复的并行度,Oracle默认设置是LOW
[quote]FAST_START_PARALLEL_ROLLBACK determines the maximum number of processes that can exist for performing parallel rollback. This parameter is useful on systems in which some or all of the transactions are long running.
Values:
*FALSE indicates that parallel rollback is disabled
*LOW limits the number of rollback processes to 2 * CPU_COUNT
*HIGH limits the number of rollback processes to 4 * CPU_COUNT[/quote]

由于并行恢复存在bug,有时候启用并行恢复并不比串行恢复来的快。查看并行恢复是否出问题,可以查看v$fast_start_servers。如果每个并行进程都处于RECOVERING状态,则建议修改参数FAST_START_PARALLEL_ROLLBACK为high。如果只有一个进程处于RECOVERING状态,其他进程处于IDEL状态,则建议将并行恢复转为串行恢复,方法如下(详见metalink doc238507.1):
[quote]1. Find SMON's Oracle PID:

Example:

SQL> select pid, program from v$process where program like '%SMON%';

PID PROGRAM
---------- ------------------------------------------------
6 oracle@stsun7 (SMON)

2. Disable SMON transaction cleanup:

SVRMGR> oradebug setorapid
SVRMGR> oradebug event 10513 trace name context forever, level 2

3. Kill the PQ slaves that are doing parallel transaction recovery.
You can check V$FAST_START_SERVERS to find these.

4. Turn off fast_start_parallel_rollback:

alter system set fast_start_parallel_rollback=false;

If SMON is recovering, this command might hang, if it does just control-C out of it. You may need to try this many times to get this to complete (between SMON cycles).

5. Re-enable SMON txn recovery:

SVRMGR> oradebug setorapid
SVRMGR> oradebug event 10513 trace name context off[/quote]

说到并行恢复,不得不提到参数_cleanup_rollback_entries,其主要作用为通知smon进程事务的条目,Oracle解释为
[quote]NAME VALUE PDESC
--------------------------------------------- -------------------- --------------------------------------------------
_cleanup_rollback_entries 100 no. of undo entries to apply per transaction clean[/quote]
在必要时我们可以加大该参数来达到加快串行事务恢复的效果(该参数为静态参数,修改该需要重启DB),另外我们可以通过x$ktuxe来观察事务恢复尤其是死事务恢复的进度
[quote]select KTUXECFL, KTUXESQN, KTUXESIZ from x$ktuxe where KTUXECFL='DEAD';[/quote]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值