1 dd
模拟物理坏块
SQL> select * from v$database_block_corruption;
no rows selected
SQL> select * from v$backup_corruption;
no rows selected
SQL> select * from v$copy_corruption;
no rows selected
SQL> create tablespace physical_corrupt datafile size 10m autoextend on;
Tablespace created.
SQL> conn hr/hr
Connected.
SQL> create table tt (i int) tablespace physical_corrupt;
Table created.
SQL> insert into tt values(1);
1 row created.
SQL> insert into tt values(2);
1 row created.
SQL> commit;
Commit complete.
SQL> select tt.*,dbms_rowid.rowid_block_number(rowid) from tt;
I DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
---------- ------------------------------------
1 15
2 15
SQL> select tablespace_name,file_name from dba_data_files where tablespace_name='PHYSICAL_CORRUPT';
TABLESPACE_NAME
------------------------------
FILE_NAME
--------------------------------------------------------------------------------
PHYSICAL_CORRUPT
/u01/app/oracle/oradata/ORCL/datafile/o1_mf_physical_88gkb4l9_.dbf
[oracle@Think ~]$ dd of=/u01/app/oracle/oradata/ORCL/datafile/o1_mf_physical_88gkb4l9_.dbf bs=8192 conv=notrunc seek=15 <