ITPub博客

首页 > 数据库 > Oracle > resumable_timeout 参数说明

resumable_timeout 参数说明

原创 Oracle 作者:gholay 时间:2014-03-02 17:04:18 0 删除 编辑

作用:

一个SESSION在空间不够的情况下会出错误信息而且回滚,如果有这个参数,可以给你resumable_timeout的时间让你来补救


这个功能主要是防止因为空间不够的原因导致session failed,

例如你create一个很大index,三天三夜后,完成了99%,这时候表空间用完了导致create失败,那只能吐血了

有了resumable session后,他会等待一段时间,等你有了空间后继续

使用很简单,首先user要有resumable权限,如果没有,可以grant resumable to user

在session开始时,alter session enable resumable 就可以了

对于application可以通过logon trigger:

SQL> create or replace trigger logon_set_resumable 
2 after logon 
3 on xfan.schema 
4 begin 
5 execute immediate ‘alter session enable resumable
 timeout 1200′; 
6 end; 
7 /

Trigger created.

这样当你空间不够的时候,session会等你,alert.log中有类似如下的信息

statement in resumable session ‘User CG15_USER(19), Session 1455, Instance 1′ was suspended due to

ORA-01652: unable to extend temp segment by 12800 in tablespace CATYINDX01

当你扩展表空间后,该session继续工作,alert.log中也有记录:

session in resumable session ‘User CG15_USER(19), Session 1455, Instance 1′ was resumed

当然在job开始之前预先加好空间还是上上之选,这个功能是为了以防万一

注意, 设定resumable_timeout的user , 必须有resumable 权限.

如:
SQL> alter session enable resumable; 
ERROR: 
ORA-01031: insufficient privileges

SQL> grant resumable to user;

SQL> alter session set resumable_time=9000;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29196873/viewspace-1098125/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-12-28

  • 博文量
    82
  • 访问量
    694144