oracle 10g undo表空间使用率居高不下bug
对于UNDO
表空间大小的定义需要考虑UNDO_RETNETION
参数、产生的UNDO BLOCKS/
秒、UNDO BLOCK
的大小。undo_retention
:对于UNDO
表空间的数据文件属性为autoextensible,
则undo_retenion
参数必须设置,UNDO
信息将至少保留至undo_retention
参数设定的值内,但UNDO
表空间将会自动扩展。对于固定UNDO
表空间,将会通过表空间的剩余空间来最大限度保留UNDO
信息。如果FIXED UNDO
表空间没有对保留时间作GUARANTEE
(alter tablespace xxx retention guarantee;
),则undo_retention
参数将不会起作用。(警告:如果设置UNDO
表空间为retention guarantee
,则未过期的数据不会被复写,如果表空间不够则会导致DML
操作失败或者transation
挂起)
Oracle
10g
有自动Automatic Undo Retention Tuning
这个特性。设置的undo_retention
参数只是一个指导值,
,Oracle
会自动调整Undo (
会跨过undo_retention
设定的时间)
来保证不会出现Ora-1555
错误.
。通过查询V$UNDOSTAT
(该视图记录4
天以内的UNDO
表空间使用情况,超过4
天可以查询DBA_HIST_UNDOSTAT
视图) 的tuned_undoretention
(该字段在10G
版本才有,9I
是没有的)字段可以得到Oracle
根据事务量(如果是文件不可扩展,则会考虑剩余空间)采样后的自动计算出最佳的retenton
时间.
。这样对于一个事务量分布不均匀的
数据库
来说,
,就会引发潜在的问题--
在批处理的时候可能Undo
会用光, 而且这个状态将一直持续, 不会释放。
如何取消
10g
的
auto UNDO Retention Tuning
,有如下三种方法:
from metalink 420525.1
:
Automatic Tuning of Undo_retention Causes Space Problems
1.)
Set the autoextend and maxsize attribute of each datafile in the undo
ts so it is autoextensible and its maxsize is equal to its current size
so the undo tablespace now has the autoextend attribute but does not
autoend:
SQL> alter database datafile '<datafile_flename>'
autoextend on maxsize <current_size>;
With
this setting, v$undostat.tuned_undoretention is not calculated based on
a percentage of the undo tablespace size, instead
v$undostat.tuned_undoretention is set to the maximum of (maxquerylen
secs + 300) undo_retention specified
相关文档:
官方文档:http://tahiti.oracle.com/
metalink:http://metalink.oracle.com
itpub:www.itpub.com
TOM:asktom.oracle.com
oracle forum:http://forums.oracle.com/forums/main.jspa?categoryID=84
OTN:http://www.oracle.com/technology/index.html
www.oracle.com.cn
www.eygle.com
Oracle ERP
www.erp10 ......
转载
DML statements on temporary tables do not generate redo logs for the data changes. However, undo logs for the data
and redo logs for the undo logs are generated. Data from the temporary table is automatically
dropped in the case of session termination, either when the user logs o ......
正常来说,在完成Select语句、create index等一些使用TEMP表空间的排序操作后,Oracle是会自动释放掉临时段a的。但有些有侯我们则会遇到临时段没有被释放,TEMP表空间几乎满的状况,甚至是我们重启了数据库仍没有解决问题。这个问题在论坛中也常被网友问到,下面我总结一下,给出几种处理方法。
......
近期,在给客户做一个Demo页面时,需要用JAVA读取Oracle中的blob图片字段并显示,在此过程中,遇到一些问题,例如:连接Oracle数据库读取blob字段数据,对图片byte数据进行缩放等;特此记录,给自己备忘,给大家参考。
整个流程分为四步,连接oracle数据库 -> 读取blob图片字段 -> 对图片进行缩放 ->把图片展示在 ......
t表中将近有1100万数据,很多时候,我们要进行字符串匹配,在SQL语句中,我们通常使用like来达到我们搜索的目标。但经过实际测试发
现,like的效率与instr函数差别相当大。下面是一些测试结果:
SQL> set timing on
SQL> select count(*) from t where instr(title,’手册’)>0;
COUNT(*)
&mdash ......