oracle Resumable Space Allocation

 

从9i开始,Oracle提供了一种避免因为space Error而导致事务异常的操作: resumable spaceallocation. 在Oracle 10g的OCP 考试中有考resumable session 的这个知识点。


官网对Resumable的解释:

Advantage is forDBAs who are running yearly reports and do not know how much extra disk spaceis required for TEMP, UNDO or DATA tablespaces in order to complete the job.This functionality does not break the job, but raises an alert for the DBA tofix the issue. The job automatically resumes once the DBA has fixed the issue.


--当我们执行一个事务操作,如果使用了resumable space allocation,那么如果遇到space空间不够的情况,事务不会中断,而是生成一条alert log 发送给DBA,当DBA 解决这个问题之后,事务自动恢复运行。


在Oracle 10g中对resumable session功能做了增强,这些新特性在MOS的文档上有说明:

10g NEW FEATUREon RESUMABLE TIMEOUT [ID 240991.1]


10g中增强的内容有:

1)增加了一个resumable_timeout的参数

   该参数可以在system和session level级均可以修改.对RAC db,每个instance可以单独设置. 而9i中只能在session一级中设置。


A resumableoperation is suspended whenever it encounters some space issue. (See DatabaseAdministrator's Guide for information about enabling resumable  space allocation, what conditions areresumable, and what statements can be made resumable.  For example,DEADLOCK or ORA-00600 error are not resumable situations).


Once theoperation is suspended, an alert message is sent to the DBA. Once the causethat caused the failure is fixed, the suspended statement automatically resumesits execution.  Every"resumable" operation has a time-out period associated. The defaultvalue of the time-out period is 2 hours (unless the user issues an altersession enable resumable). A suspended operation is automatically aborted ifthe error condition is not fixed within the "time-out".


--设置resumable_timeout 之后,在指定的timeout 时间内会自动恢复,如果超过这个时间没有解决问题,事务操作还是会被中断。


2)对分布式事务的支持

Distributed Transactions Behavior

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In 9i, users arenot allowed to start a distributed transaction in a resumable enabled session.  And if a session has a distributedtransaction, users are not allowed to enable resumable.


Theserestrictions are removed in 10g. However, in a distributed transaction, if usersenable/disable resumable or change resumable_timeout, only the local instancesare affected. In a distributed transaction, sessions on remote instances aresuspended if resumable has been enabled in the remote instance.


3)增加了一个监控的视图

在10g中,我们也可以通过DBA_OUTSTANDING_ALERTS来监控resumablesession.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
resumable.js 是一个 JavaScript 库,用于在网络连接中断或暂停时,使文件上传能够恢复。以下是 resumable.js 的官方教程: 1. 安装 resumable.js 你可以通过 npm 安装 resumable.js: ``` npm install resumablejs ``` 或者,你可以将 resumable.js 下载到本地,并将其包含在你的 HTML 文件中: ``` <script src="path/to/resumable.js"></script> ``` 2. 准备 HTML 代码 在你的 HTML 文件中添加以下代码: ``` <input type="file" id="fileInput"> <button id="uploadButton">Upload</button> ``` 这将创建一个文件上传控件和一个上传按钮。 3. 初始化 resumable.js 在你的 JavaScript 文件中添加以下代码: ``` var r = new Resumable({ target: '/upload', chunkSize: 1 * 1024 * 1024, simultaneousUploads: 4, testChunks: false }); r.assignBrowse(document.getElementById('fileInput')); r.assignDrop(document.body); document.getElementById('uploadButton').addEventListener('click', function() { r.upload(); }); ``` 这将创建一个 Resumable 对象,并将其绑定到文件上传控件和上传按钮。`target` 属性指定文件上传的目标 URL,`chunkSize` 属性指定上传的块大小,`simultaneousUploads` 属性指定同时上传的块数,`testChunks` 属性指定是否测试上传的块。 4. 处理事件 你可以通过监听 Resumable 对象的事件来处理上传过程中的不同阶段。以下是一些常用的事件: - `fileAdded`:当文件添加到上传队列时触发。 - `fileSuccess`:当文件上传成功时触发。 - `fileError`:当文件上传失败时触发。 - `progress`:当上传进度发生变化时触发。 你可以使用以下代码来监听事件: ``` r.on('fileAdded', function(file) { console.log('File added:', file); }); r.on('fileSuccess', function(file) { console.log('File uploaded:', file); }); r.on('fileError', function(file, message) { console.log('File upload error:', file, message); }); r.on('progress', function() { console.log('Progress:', r.progress()); }); ``` 5. 完整示例 下面是一个完整的示例,演示如何使用 resumable.js 进行文件上传: ``` <!DOCTYPE html> <html> <head> <title>Resumable.js Example</title> <script src="path/to/resumable.js"></script> </head> <body> <input type="file" id="fileInput"> <button id="uploadButton">Upload</button> <script> var r = new Resumable({ target: '/upload', chunkSize: 1 * 1024 * 1024, simultaneousUploads: 4, testChunks: false }); r.assignBrowse(document.getElementById('fileInput')); r.assignDrop(document.body); r.on('fileAdded', function(file) { console.log('File added:', file); }); r.on('fileSuccess', function(file) { console.log('File uploaded:', file); }); r.on('fileError', function(file, message) { console.log('File upload error:', file, message); }); r.on('progress', function() { console.log('Progress:', r.progress()); }); document.getElementById('uploadButton').addEventListener('click', function() { r.upload(); }); </script> </body> </html> ``` 这个示例将上传文件块大小设置为 1MB,同时最多上传 4 个块。在文件添加、上传成功、上传失败和上传进度发生变化时,会在控制台中输出相应的信息。当点击上传按钮时,将触发上传操作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值