Size of the datafile recorded in the Oracle database datafile header
Environment: Oracle Databae 12.1.0.2, rhel5.9 x86-64bit
[Oracle @ rhel59 orcl] $ pwd/u01/app/oracle/oradata/orcl [oracle @ rhel59 orcl] $ ls-lrttotal 2104544drwxr-x --- 2 oracle oinstall 4096 Dec 26 2014 pdbseeddrwxr-x --- 2 oracle oinstall 4096 Dec 26 2014 PN1drwxr-x --- 2 oracle oinstall 4096 Dec 26 2014 PN2-rw-r ----- 1 oracle oinstall 5251072 Jul 31 users01.dbf-rw-r ----- 1 oracle oinstall 52429312 Jul 31 redo03.log -rw-r ----- 1 oracle oinstall 52429312 Jul 31 redo01.log-rw-r ----- 1 oracle oinstall 74457088 Jul 31 temp01.dbf-rw-r ----- 1 oracle oinstall 602939392 Jul 31 undotbs01.dbf- rw-r ----- 1 oracle oinstall 870326272 Jul 31 system01.dbf-rw-r ----- 1 oracle oinstall 765468672 Jul 31 sysaux01.dbf-rw-r ----- 1 oracle oinstall 52429312 Jul 31 redo02.log-rw -r ----- 1 oracle oinstall 17973248 Jul 31 control01.ctl [oracle @ rhel59 orcl] $ dd if =/u01/app/oracle/oradata/orcl/system01.dbf bs = 512 count = 1 | od-x1 + 0 records in1 + 0 records out512 bytes (512 B) copied, 0.027559 seconds, 18.6 kB/s0000000 a200 0000 0000 ffc0 0000 0000 0000 00000000020 6567 0000 2000 9f00 0000 7c7d 7a7b0000040 81a0 0001 0000 0000 0000 0000 0000 0000 00000000060 0000 0000 0000 0000*0000 [oracle @ rhel59 orcl] $ dd if =/u01/app/oracle/oradata/orcl/system01.dbf bs = 512 count = 1 | od-i1 + 0 records in1 + 0 records out512 bytes (512 B) copied, 2.9e-05 seconds, 17.7 MB/s0000000 41472-4194304 0 00000020 25959 8192 106240 20549131490000040 0 0 33184 0 0 0 0*00000060 [oracle @ rhel59 orcl] $ [oracle @ rhel59 orcl] $ [oracle @ rhel59 orcl] $ ls-lrt8192 * 106240 = 870318080 while the result of ls-lrt shows the size of system01.dbf: 870326272870326272-870318080 = 8192. The other one is the OS header in datafile,
8192 manual calculation process;
2000 0000 after flip: 00002000, converted to decimal, that is, 8192
106240 manual calculation process:
After 9f00 0001 is flipped: 00019f00, converted to decimal, Which is 106240
Note: This article only provides calculation ideas. In fact, the conversion process of the number of db blocks is incorrect.