本想通过C语言分析ORACLE数据文件,由于本人以前没怎么用过C,遇到不小的困难,请大家指教!
void do_more( FILE *fp )
/*
* read PAGELEN lines, then call see_more() for further instructions
*/
{
char line[LINELEN];
int num_of_lines = 0;
int see_more(), reply;
int outlen=0;
while ( fgets( line, LINELEN, fp ) ){ /* more input */
if ( num_of_lines == PAGELEN ) { /* full screen? */
reply = see_more(); /* y: ask user */
if ( reply == 0 ) /* n: done */
break;
num_of_lines -= reply; /* reset count */
}
while(outlen<16){
printf("%x",line[outlen]);
printf("\t%d\n",line[outlen]);
outlen=outlen+1;
}
num_of_lines++; /* count it */
}
}
输出结果如下:
0 0
ffffffa2 -94
0 0
0 0
0 0
0 0
ffffffc0 -64
ffffffff -1
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
用BBED查看,结果如下:
[oracle@localhost ~]$ bbed parfile=parfile.txt
BBED: Release 2.0.0.0.0 - Limited Production on Tue Jan 29 06:18:17 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set filename '/u01/oradata/orcl/system01.dbf'
FILENAME /u01/oradata/orcl/system01.dbf
BBED> set block 0
BLOCK# 0
BBED> dump /v offset 0
File: /u01/oradata/orcl/system01.dbf (1)
Block: 0 Offsets: 0 to 511 Dba:0x00400000
-------------------------------------------------------
00a20000 0000c0ff 00000000 00000000 l .?...?.......
请各位高手帮忙解释一下,问题出在什么地方,为什么会得出这样的结果?