[oracle@lucky ~]$ cd /u01/app/oracle/oradata/orcl/
[oracle@lucky orcl]$ ls
control01.ctl redo2.log redo4.log system.dbf test.dbf undotbs2.dbf
redo1.log redo3.log sysaux.dbf temp.dbf undotbs1.dbf users.dbf
[oracle@lucky orcl]$ dd if=test.dbf of=test.dbf_bak bs=8k skip=0 count=1200 ---模拟
1200+0 records in
1200+0 records out
9830400 bytes (9.8 MB) copied, 0.097539 seconds, 101 MB/s
[oracle@lucky orcl]$ ll
总计 3416068
-rw-r----- 1 oracle oinstall 18825216 11-13 18:43 control01.ctl
-rw-r----- 1 oracle oinstall 52429312 11-13 05:00 redo1.log
-rw-r----- 1 oracle oinstall 52429312 11-13 18:43 redo2.log
-rw-r----- 1 oracle oinstall 52429312 11-12 22:23 redo3.log
-rw-r----- 1 oracle oinstall 52429312 11-12 22:23 redo4.log
-rw-r----- 1 oracle oinstall 1436557312 11-13 18:43 sysaux.dbf
-rw-r----- 1 oracle oinstall 765468672 11-13 18:43 system.dbf
-rw-r----- 1 oracle oinstall 524296192 11-13 13:08 temp.dbf
-rw-r----- 1 oracle oinstall 10493952 11-13 18:43 test.dbf ---10493952/8192=1281块 os比db多一个块
-rw-r--r-- 1 oracle oinstall 9830400 11-13 18:45 test.dbf_bak ---9830400/8192=1200块
-rw-r----- 1 oracle oinstall 634396672 11-13 18:43 undotbs1.dbf
-rw-r----- 1 oracle oinstall 367009792 11-13 18:43 undotbs2.dbf
-rw-r----- 1 oracle oinstall 36708352 11-13 18:43 users.dbf
[oracle@lucky orcl]$ mv test.dbf test.dbf_s
[oracle@lucky orcl]$ mv test.dbf_bak test.dbf
[oracle@lucky orcl]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 13 18:47:18 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1503199232 bytes
Fixed Size 2213536 bytes
Variable Size 1140853088 bytes
Database Buffers 352321536 bytes
Redo Buffers 7811072 bytes
Database mounted.
ORA-01122: database file 6 failed verification check
ORA-01110: data file 6: '/u01/app/oracle/oradata/orcl/test.dbf'
ORA-01200: actual file size of 1199 is smaller than correct size of 1280 blocks
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@lucky orcl]$ dd if=/dev/zero of=test.dbf bs=8k seek=1200 count=81 ---修复
81+0 records in
81+0 records out
663552 bytes (664 kB) copied, 0.002212 seconds, 300 MB/s
[oracle@lucky orcl]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 13 18:49:39 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database open;
Database altered.
SQL> select * from v$database_block_corruption;
no rows selected
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1503199232 bytes
Fixed Size 2213536 bytes
Variable Size 1140853088 bytes
Database Buffers 352321536 bytes
Redo Buffers 7811072 bytes
Database mounted.
Database opened.
SQL> select * from v$database_block_corruption;
no rows selected
SQL>
[oracle@lucky orcl]$ ls
control01.ctl redo2.log redo4.log system.dbf test.dbf undotbs2.dbf
redo1.log redo3.log sysaux.dbf temp.dbf undotbs1.dbf users.dbf
[oracle@lucky orcl]$ dd if=test.dbf of=test.dbf_bak bs=8k skip=0 count=1200 ---模拟
1200+0 records in
1200+0 records out
9830400 bytes (9.8 MB) copied, 0.097539 seconds, 101 MB/s
[oracle@lucky orcl]$ ll
总计 3416068
-rw-r----- 1 oracle oinstall 18825216 11-13 18:43 control01.ctl
-rw-r----- 1 oracle oinstall 52429312 11-13 05:00 redo1.log
-rw-r----- 1 oracle oinstall 52429312 11-13 18:43 redo2.log
-rw-r----- 1 oracle oinstall 52429312 11-12 22:23 redo3.log
-rw-r----- 1 oracle oinstall 52429312 11-12 22:23 redo4.log
-rw-r----- 1 oracle oinstall 1436557312 11-13 18:43 sysaux.dbf
-rw-r----- 1 oracle oinstall 765468672 11-13 18:43 system.dbf
-rw-r----- 1 oracle oinstall 524296192 11-13 13:08 temp.dbf
-rw-r----- 1 oracle oinstall 10493952 11-13 18:43 test.dbf ---10493952/8192=1281块 os比db多一个块
-rw-r--r-- 1 oracle oinstall 9830400 11-13 18:45 test.dbf_bak ---9830400/8192=1200块
-rw-r----- 1 oracle oinstall 634396672 11-13 18:43 undotbs1.dbf
-rw-r----- 1 oracle oinstall 367009792 11-13 18:43 undotbs2.dbf
-rw-r----- 1 oracle oinstall 36708352 11-13 18:43 users.dbf
[oracle@lucky orcl]$ mv test.dbf test.dbf_s
[oracle@lucky orcl]$ mv test.dbf_bak test.dbf
[oracle@lucky orcl]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 13 18:47:18 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1503199232 bytes
Fixed Size 2213536 bytes
Variable Size 1140853088 bytes
Database Buffers 352321536 bytes
Redo Buffers 7811072 bytes
Database mounted.
ORA-01122: database file 6 failed verification check
ORA-01110: data file 6: '/u01/app/oracle/oradata/orcl/test.dbf'
ORA-01200: actual file size of 1199 is smaller than correct size of 1280 blocks
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@lucky orcl]$ dd if=/dev/zero of=test.dbf bs=8k seek=1200 count=81 ---修复
81+0 records in
81+0 records out
663552 bytes (664 kB) copied, 0.002212 seconds, 300 MB/s
[oracle@lucky orcl]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 13 18:49:39 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database open;
Database altered.
SQL> select * from v$database_block_corruption;
no rows selected
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1503199232 bytes
Fixed Size 2213536 bytes
Variable Size 1140853088 bytes
Database Buffers 352321536 bytes
Redo Buffers 7811072 bytes
Database mounted.
Database opened.
SQL> select * from v$database_block_corruption;
no rows selected
SQL>