oracle+ddl+执行很慢,长时间回滚oracle响应慢解决。

现象:

1. 应用连接数据异常缓慢,查询,更新,插入响应速度缓慢

分析:

查看这个小时的AWR,发现等待事件中

wait for a undo record   排在第二位。。。

原因:

经过baidu和现在询问得知,开发人员昨天晚上向数据库中一张表插入大量数据,到白天看插入还没有完成就强行结束进程,

导致数据库回滚,占用大量资源。

解决办法:

1.使用下面sql语句查看大致需要回滚时间:

select  undoblockstotal "Total", undoblocksdone "Done", undoblockstotal-undoblocksdone  2   "ToDo",decode(cputime,0,'unknown',to_char(sysdate+(((undoblockstotal-undoblocksdone)  3   / (undoblocksdone / cputime)) / 86400),'yyyy-mm-dd hh24:mi:ss'))  4  "Estimated time to complete",to_char(sysdate,'yyyy-mm-dd hh24:mi:ss')  5  from v$fast_start_transactions;

2.关闭数据库,设置参数FAST_START_PARALLEL_ROLLBACK=false

3.重启数据库,查看回滚速度

4.FAST_START_PARALLEL_ROLLBACK的作用

详见:http://www.xifenfei.com/2534.html

结论如下:

1)Oracle大事物回滚,是没有办法取消,但是可以通过FAST_START_PARALLEL_ROLLBACK干预回滚速度

2)数据库的并发效率高于低,取决于系统的资源情况(如果你系统的cpu非常强大,那么可能设置HIGH速度最快)

3)回滚的数据类型,在回滚表中数据时可能设置并发比FALSE快,

但是如果是要回滚串行数据(如:index),那么可能串行方法方式速度更快

4)根据你的系统的使用状况,比如你想让系统的业务受到的影响最小,那么设置FALSE可能是个不错的选择。

5.FAST_START_PARALLEL_ROLLBACK的官方说明。

FAST_START_PARALLEL_ROLLBACK

specifies the degree of parallelism used when recovering terminated transactions.Terminated transactions are transactions that are active before a system failure.If a system fails when there are uncommitted parallel DML or DDL transactions,then you can speed up transaction recovery during startup by using this parameter.

Values:

FALSE    Parallel rollback is disabled

LOW      Limits the maximum degree of parallelism to 2 * CPU_COUNT

HIGH     Limits the maximum degree of parallelism to 4 * CPU_COUNT

Note:  If you change the value of this parameter,then transaction recovery will be stopped and restarted with the new implied degree of parallelism.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值