Chinaunix

标题: pfile出问题? [打印本页]

作者: zcwolf    时间: 2006-01-16 16:48
标题: pfile出问题?
SQL> create pfile='/data/oradata/test/pfile1' from spfile;
create pfile='/data/oradata/test/pfile1' from spfile
*
ERROR at line 1:
ORA-27046: file size is not a multiple of logical block size
Additional information: 1


这个问题是什么意思啊?没遇到过!??
作者: macrodba    时间: 2006-01-16 17:23
create pfile='/data/oradata/test/pfile1' from spfile;
不需要pfile1
create pfile='/data/oradata/test/' from spfile;
作者: rambus    时间: 2006-01-16 17:32
原帖由 macrodba 于 2006-1-16 17:23 发表

不错,另外怎么不用SPFILE啊?
作者: zcwolf    时间: 2006-01-17 10:16
pfile1只是一个文件名
而且照macrodba说的也是出现相同的错误!
作者: remen    时间: 2006-01-17 10:56
原帖由 macrodba 于 2006-1-16 17:23 发表
create pfile='/data/oradata/test/pfile1' from spfile;
不需要pfile1
create pfile='/data/oradata/test/' from spfile;


你的建议好像有问题阿,看例子:

SQL> create pfile='/T3/ORACLE/spile1.ora' from spfile;

File created.

SQL> create pfile='/T3/ORACLE/spile1' from spfile;

File created.

SQL> host ls /T3/ORACLE/spi*
/T3/ORACLE/spile1      /T3/ORACLE/spile1.ora

SQL> host file  /T3/ORACLE/spi*
/T3/ORACLE/spile1:      ascii text
/T3/ORACLE/spile1.ora:  ascii text

SQL>
SQL> create pfile='/T3/ORACLE/' from spfile;
create pfile='/T3/ORACLE/' from spfile
*
ERROR at line 1:
ORA-07391: sftopn: fopen error, unable to open text file.


SQL>
作者: remen    时间: 2006-01-17 11:05
^_^,终于被我模拟出来了!
你的问题在于你用spfile启动了db,然后在db running的过程中手工修改了spfile导致的!
作者: remen    时间: 2006-01-17 11:07
请看具体过程:
SQL> startup
ORACLE instance started.

Total System Global Area  219644872 bytes
Fixed Size                   730056 bytes
Variable Size             201326592 bytes
Database Buffers           16777216 bytes
Redo Buffers                 811008 bytes
Database mounted.
Database opened.
SQL> host
$ ls
init.ora        initdw.ora      initora9.ora    lkORA9          orapwora9       spfileora9.ora
$ cp  spfileora9.ora  spfileora9.ora.bak
$ vi  spfileora9.ora
^E^B^B^C\351"z^E\377*.aq_tm_processes=1
*.background_dump_dest='/T3/ORACLE/admin/ora9/bdump'
*.compatible='9.2.0.0.0'
*.control_files='/T3/ORACLE/oradata/ora9/control01.ctl','/T3/ORACLE/oradata/ora9/control02.ctl','/T3/ORACLE/oradata/ora9/control03.c
tl'
*.core_dump_dest='/T3/ORACLE/admin/ora9/cdump'
*.db_block_size=8192
*.db_cache_size=16777216
............................
然后手工随便不输入几个字母,保存,退出

$ exit

SQL> create pfile='/T3/ORACLE/pfile1' from spfile;
create pfile='/T3/ORACLE/pfile1' from spfile
*
ERROR at line 1:
ORA-27046: file size is not a multiple of logical block size
Additional information: 1


SQL>
作者: remen    时间: 2006-01-17 11:19
继续往下看:
现在我们还原刚才备份的那个spfile,重新创建pfile
SQL> host
$ ls
init.ora            initora9.ora        orapwora9           spfileora9.ora.bak
initdw.ora          lkORA9              spfileora9.ora
$ cp spfileora9.ora.bak spfileora9.ora
$ exit

SQL> l
  1* create pfile='/T3/ORACLE/pfile1' from spfile
SQL> /

File created.
成功!
下面我们模仿在db running过程中del掉spfile,看看会出现什么情况:

SQL> host
$ ls
init.ora            initora9.ora        orapwora9           spfileora9.ora.bak
initdw.ora          lkORA9              spfileora9.ora
$ mv spfileora9.ora spfileora9.ora.bak2
$ exit

SQL> l
  1* create pfile='/T3/ORACLE/pfile1' from spfile
SQL> /
create pfile='/T3/ORACLE/pfile1' from spfile
*
ERROR at line 1:
ORA-27037: unable to obtain file status
SVR4 Error: 2: No such file or directory
Additional information: 3


SQL>
出错,提示找不到spfile,看来当我们发出create pfile from spfile的时候他会道相应目录寻找spfile,如果有而且正确就create pfile,否则提示找不到该文件或者文件不对,即使我们用pfile启动,当我们发出create pfile from spfile的时候仍然遵循这一个原则。
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> host
$ ls
init.ora            initora9.ora        orapwora9           spfileora9.ora.bak
initdw.ora          lkORA9              spfileora9.ora
$ mv spfileora9.ora spfileora9.ora.bak2
$ exit

SQL> startup nomount
ORACLE instance started.

Total System Global Area  219644872 bytes
Fixed Size                   730056 bytes
Variable Size             201326592 bytes
Database Buffers           16777216 bytes
Redo Buffers                 811008 bytes
SQL> create pfile='/T3/ORACLE/pfile1.ora' from spfile;
create pfile='/T3/ORACLE/pfile1.ora' from spfile
*
ERROR at line 1:
ORA-27037: unable to obtain file status
SVR4 Error: 2: No such file or directory
Additional information: 3


SQL> create pfile='/T3/ORACLE/pfile1.ora' from spfile='/T3/ORACLE/product/9.2.0/dbs/spfileora9.ora.bak2';

File created.

SQL> host
$ ls
init.ora             initora9.ora         orapwora9            spfileora9.ora.bak2
initdw.ora           lkORA9               spfileora9.ora.bak
$ mv spfileora9.ora.bak2 spfileora9.ora
$ exit
SQL> create pfile='/T3/ORACLE/pfile1.ora' from spfile;

File created.

SQL>
作者: remen    时间: 2006-01-17 11:22
看完这个,我相信你有关spfile和pfile的互相创建的问题你应该就全部明白了
作者: doni    时间: 2006-01-17 12:24
remen真是强人,我想讲清楚pfile 与 spfile很多人能做到,但能找到LZ的问题是如何发生的,PFing
作者: remen    时间: 2006-01-17 13:27
让老大见笑了!
作者: txfy    时间: 2006-01-17 13:51
这应该是因为你的db_block_size设置的不对造成的!
作者: remen    时间: 2006-01-17 13:54
原帖由 txfy 于 2006-1-17 13:51 发表
这应该是因为你的db_block_size设置的不对造成的!


请老大明示???
作者: oracle-hpunix    时间: 2006-01-17 14:02
是不是哪个参数设置的大小不是BLOCK的整数倍造成的?
作者: remen    时间: 2006-01-17 14:06
我认为我得试验已经很能说明问题了,老大为何说是db_block_size的问题,请明示!
作者: remen    时间: 2006-01-17 14:07
$ 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
$
作者: txfy    时间: 2006-01-17 14:16
我说的是一种可能。你如果有空闲机器可以试试,做好恢复准备。
作者: pq777    时间: 2006-01-18 01:02
厉害...
作者: zcwolf    时间: 2006-01-18 09:54
谢谢各位大大了哈!!讲解得很详细!!




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2