Archive for 5月, 2006
不知道大家有没有发现,当你往临时表空间里添加临时文件时速度很快,这是为什么呢?原来 oracle 采用了稀疏文件(Sparse Files )技术。那么什么是稀疏文件呢?
1。什么是稀疏文件
稀疏文件是指内部具有一个或多个未分派数据的区域的文件。程序将会发现这些未分派的包含零字节的区域,但是没有实际的磁盘空间用来代表这些零。换句话说,所有有意义或非零数据得到了分配,而所有无意义的数据(一大串由零组成的数据)没有得到分配。当读入稀疏文件时,已分配的数据以存储方式返回,在默认情况下,按照 C2 安全需求规范未分配的数据以零的方式返回。稀疏文件支持允许在文件的任意位置解除分配数据—-来自Windows在线帮助
A sparse file is a file where any ‘empty’ O/S blocks do not actually take up a full block but have a marker to show the block is empty. The operating system then finds a free block for use when the block is populated with data.—-来自 oracle 的解释
2。稀疏文件的优缺点
优点:通过稀疏文件, oracle [...]
还是上次查询报错的例子:
ERROR:
ORA-01114: IO error writing block to file 201 (block # 1048178)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
OSD-04026: Invalid parameter passed. (OS 1048192)
ORA-01114: IO error writing block to file 201 (block # 1048178)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
OSD-04026: Invalid parameter passed. (OS 1048192)
我们看这里出现一个file 201,而查找数据字典就是找不到这个文件:
SQL> select [...]
最近在执行一个大数据量查询时报如下错误:
ORA-01114: IO error writing block to file 201 (block # 523913)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
OSD-04026: Invalid parameter passed. (OS 523927)
ORA-01114: IO error writing block to file 201 (block # 523913)
经查询file 201是临时表空间的第一个文件,该文件初始大小为2GB,自动扩展,每次扩展640K,当到达4G时出现以上错误。后来又测试了一下,发现在跨越8G时也会出现以上错误:
SQL> select * from v_offtake_profit_inv_national;
ERROR:
ORA-01114: IO error writing block to file 201 (block # 1048178)
ORA-27069: skgfdisp: attempt to [...]
drop index时出现如下错误:
SQL> drop index oos_index;
drop index oos_index
*
ERROR at line 1:
ORA-02429: cannot drop index used for enforcement of unique/primary key
我们知道当创建Primary key和unique约束时,如果在该key上不存在索引,则 oracle 会自动创建对应的unique索引,而当你要删除该索引时,必须先Disable或Drop该约束。看下面的例子: