不知道大家有没有发现,当你往临时表空间里添加临时文件时速度很快,这是为什么呢?原来 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 能快速创建临时文件
缺点:1。使用稀疏文件分配空间时如果空间不够会产生错误
2。容易产生磁盘碎片,因为在使用的过程中,有可能连续的空闲空间被其他文件使用,此时
oracle 只能去寻找另外的未使用块来供 oracle 填充数据
3。如何识别稀疏文件
在Linux下可以简单通过ls和df两个指令来辨别
No Comments
Be the first to comment on this entry.
Leave a comment
Fields in bold are required. Email addresses are never published or distributed.
Some HTML code is allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>URLs must be fully qualified (eg: http://www.dbifan.com),and all tags must be properly closed.
Line breaks and paragraphs are automatically converted.
Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.