加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

ORA-01114错误解决方法

(2009-07-03 14:42:30)
标签:

ora-01114

临时表空间

oracle

it

分类: oracle9i

ORA-01114错误解决方法

    今天在一个库上运行一个比较大的查询时,多表关联(A\B\C三表),其中A\B表比较大,结果出现下面的错误:
ORA-01114: IO error writing block to file 203 (block # 971238)
ORA-27063: skgfospo: number of bytes read/written is incorrect
IBM AIX RISC System/6000 Error: 28: No space left on device
Additional information: -1
Additional information: 253952

刚开始以为数据文件有坏块,通过下面的语句,想查出file 203 block #971238是哪个对象:
SELECT tablespace_name, segment_type, owner, segment_name
 FROM dba_extents
WHERE file_id = 203
   and 971238 between block_id AND block_id + blocks - 1
查询不到记录。
再检查了一下A\B\C表,没有发现有坏块。
此时有点纳闷了,上网查询了一下错误,网上也有人遇到了类似的错误。
在初始化参数中,db_files = 200 , file#=201 就是第一个temp file,用下面的语句就可以查出FILE 203是哪个文件了。
SELECT * FROM (
SELECT file_name , tablespace_name ,file_id,'datafile' AS TYPE
FROM DBA_DATA_FILES
UNION ALL
SELECT file_name , tablespace_name ,file_id + value ,'tempfile '
FROM DBA_TEMP_FILES , v$parameter p
WHERE p.name = 'db_files'
)
WHERE file_id = 203;
file 203就是对应了temp03.dbf。
    临时表空间是用来做排序、汇总用的,多表关联\ORDER BY\GROUP BY都会用到临时表空间。而临时表空间中的数据文件又跟其它表空间的数据文件不一样。临时文件是在排序开始的时候才给排序分配空间,不是创建数据文件的时候预先分配好的。而其它表空间的数据文件是在创建的时候就分配好了空间。所以出现上面问题的原因有一个可能就是临时文件所在的目录没有空闲空间了。
    检查了一下,果真没有空闲空间。

    解决方法也比较简单,可以给目录清理出多点的空闲空间,也可以重建一下临时表空间,将临时文件放到其它空闲的盘上。
最后查了一下ORA-01114的解释,才发现解释中已经给出了很明确的提示。
ORA-01114 IO error writing block to file string (block # string)
Cause: The device on which the file resides is probably offline. If the file is a temporary file, then it is also possible that the device has run out of space. This could happen because disk space of temporary files is not necessarily allocated at file creation time.
Action: Restore access to the device or remove unnecessary files to free up space.

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有