ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORA-27046,使用dd命令将裸设备数据文件内容转移到文件系统发生的问题

ORA-27046,使用dd命令将裸设备数据文件内容转移到文件系统发生的问题

原创 Linux操作系统 作者:weiluwei 时间:2009-12-21 15:49:47 0 删除 编辑

今日无聊,做了下关于DG的有关standby_file_management参数设置的一些实验。

其中一个实验,是在primary数据库将test表空间的数据库文件/dev/raw/raw5数据文件改名至/oracle/oradata/jnjg/test01.dbf

步骤如下:

sql>atler tablespace test offline;

sql>host

dd if=/dev/raw/raw5 f=/oracle/oradata/jnjg/test01.dbf

sql>alter database rename file '/dev/raw/raw5' to '/oracle/oradata/jnjg/test01.dbf';

sql>alter tablespace test online;

出现以下错误:

ERROR at line 1:
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/oracle/oradata/mytmp01.dbf'

告警日志中出现:

alter tablespace mytmp online
Sun Dec 20 08:04:47 2009
Errors in file /oracle/admin/jnjg/bdump/jnjg_dbw0_8308.trc:
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/oracle/oradata/mytmp01.dbf'
ORA-27046: file size is not a multiple of logical block size
Additional information: 1
ORA-1157 signalled during: alter tablespace mytmp online...

在命令行下,通过oerr命令查看错误号内容:

oerr ora 27046

bash-3.1$ oerr ora 27046
27046, 00000, "file size is not a multiple of logical block size"
// *Cause:  file size as indicated by stat is not correct, additional
//          information indicates which function encountered the error
// *Action: verify that the file has not been overwritten or truncated

没看出来有什么能够解决的方法,后来想了想,dd的时候没有制定bs参数,是不是因为操作系统块跟block_size不一致所致,于是

rm /oracle/oradata/jnjg/test01.dbf

dd if=/dev/raw/raw5 f=/oracle/oradata/jnjg/test01.dbf bs=8192

sql>alter tablespace test online;

成功

 

 

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7796861/viewspace-623207/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-06-16

  • 博文量
    10
  • 访问量
    41048