[oracle@sha Desktop]$ . oraenv ORACLE_SID = [oracle] ? sha The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle [oracle@sha Desktop]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Sat Jun 6 14:50:59 2019 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> create tablespace corrupt datafile '/u01/app/oracle/sha/corrupt.dbf' size 10m; Tablespace created. SQL> create user aaa identified by aaa default tablespace corrupt quota unlimited on corrupt; User created. SQL> grant create session, resource to aaa; Grant succeeded. SQL> conn Enter user-name: aaa Enter password: Connected. SQL> create table student(sid number(4),sname varchar(10)) tablespace corrupt; Table created. SQL> insert into values (11,'SMITH'); insert into values (11,'SMITH') * ERROR at line 1: ORA-00903: invalid table name SQL> insert into values student(11,'SMITH'); insert into values student(11,'SMITH') * ERROR at line 1: ORA-00903: invalid table name SQL> insert into student values(11,'SMITH'); 1 row created. SQL> insert into student values(22,'MILLER'); 1 row created. SQL> select * from student; SID SNAME ---------- ---------- 11 SMITH 22 MILLER SQL> select count(*) from student; COUNT(*) ---------- 2 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@sha Desktop]$ rman target / Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jun 6 14:59:51 2019 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: sha (DBID=1367673488) RMAN> report schema; using target database control file instead of recovery catalog Report of database schema for database with db_unique_name sha List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---- -------- -------------------- ------- ------------------------ 1 325 SYSTEM *** /u01/app/oracle/sha/system01.dbf 2 325 SYSAUX *** /u01/app/oracle/sha/sysaux01.dbf 3 200 UNDOTBS1 *** /u01/app/oracle/sha/undotbs01.dbf 4 500 USERS *** /u01/app/oracle/sha/users01.dbf 5 10 CRASH *** /u01/app/oracle/sha/crash.dbf 6 10 CORRUPT *** /u01/app/oracle/sha/corrupt.dbf List of Temporary Files ======================= File Size(MB) Tablespace Maxsize(MB) Tempfile Name ---- -------- -------------------- ----------- -------------------- 1 20 TEMPTS1 20 /u01/app/oracle/sha/temp01.dbf RMAN> backup tablespace corrupt; Starting backup at 06-JUN-22 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=33 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00006 name=/u01/app/oracle/sha/corrupt.dbf channel ORA_DISK_1: starting piece 1 at 06-JUN-22 channel ORA_DISK_1: finished piece 1 at 06-JUN-22 piece handle=/u01/app/oracle/flash_recovery_area/sha/backupset/2019_07_06/o1_mf_nnndf_TAG20190706T150030_gl0tkqj3_.bkp tag=TAG20190706T150030 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 06-JUN-22 RMAN> exit Recovery Manager complete. [oracle@sha Desktop]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Sat Jun 6 15:00:52 2019 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> SELECT header_block FROM dba_segments WHERE segment_name='STUDENT'; HEADER_BLOCK ------------ 130 [oracle@sha Desktop]$ [oracle@sha Desktop]$ [oracle@sha Desktop]$ dd of=/u01/app/oracle/sha/corrupt.dbf bs=8192 conv=notrunc seek=131 << EOF > testing corruption > EOF 0+1 records in 0+1 records out 19 bytes (19 B) copied, 6.7745e-05 s, 280 kB/s [oracle@sha Desktop]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Sat Jun 6 15:04:20 2019 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 SYSTEM FLUSH BUFFER_CACHE; System altered. SQL> conn aaa/aaa; Connected. SQL> select * from student; select * from student * ERROR at line 1: ORA-01578: ORACLE data block corrupted (file # 6, block # 131) ORA-01110: data file 6: '/u01/app/oracle/sha/corrupt.dbf' SQL> ho [oracle@sha Desktop]$ dbv file=/u01/app/oracle/sha/corrupt.dbf blocksize=8192; DBVERIFY: Release 11.2.0.1.0 - Production on Sat Jun 6 15:12:10 2019 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. DBVERIFY - Verification starting : FILE = /u01/app/oracle/sha/corrupt.dbf Page 131 is marked corrupt Corrupt block relative dba: 0x01800083 (file 6, block 131) Bad header found during dbv: Data in bad block: type: 116 format: 5 rdba: 0x20676e69 last change scn: 0x7075.72726f63 seq: 0x74 flg: 0x69 spare1: 0x73 spare2: 0x74 spare3: 0xa consistency value in tail: 0x8c550602 check value in block header: 0x6e6f block checksum disabled DBVERIFY - Verification complete Total Pages Examined : 1280 Total Pages Processed (Data) : 4 Total Pages Failing (Data) : 0 Total Pages Processed (Index): 0 Total Pages Failing (Index): 0 Total Pages Processed (Other): 130 Total Pages Processed (Seg) : 0 Total Pages Failing (Seg) : 0 Total Pages Empty : 1145 Total Pages Marked Corrupt : 1 Total Pages Influx : 0 Total Pages Encrypted : 0 Highest block SCN : 363618 (0.363618) [oracle@sha Desktop]$ rman target / Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jun 6 15:12:31 2019 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: sha (DBID=1367673488) RMAN> report schema; using target database control file instead of recovery catalog Report of database schema for database with db_unique_name sha List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---- -------- -------------------- ------- ------------------------ 1 325 SYSTEM *** /u01/app/oracle/sha/system01.dbf 2 325 SYSAUX *** /u01/app/oracle/sha/sysaux01.dbf 3 200 UNDOTBS1 *** /u01/app/oracle/sha/undotbs01.dbf 4 500 USERS *** /u01/app/oracle/sha/users01.dbf 5 10 CRASH *** /u01/app/oracle/sha/crash.dbf 6 10 CORRUPT *** /u01/app/oracle/sha/corrupt.dbf List of Temporary Files ======================= File Size(MB) Tablespace Maxsize(MB) Tempfile Name ---- -------- -------------------- ----------- -------------------- 1 20 TEMPTS1 20 /u01/app/oracle/sha/temp01.dbf RMAN> BLOCKRECOVER DATAFILE 6 BLOCK 131; Starting recover at 06-JUN-22 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=46 device type=DISK channel ORA_DISK_1: restoring block(s) channel ORA_DISK_1: specifying block(s) to restore from backup set restoring blocks of datafile 00006 channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/sha/backupset/2019_07_06/o1_mf_nnndf_TAG20190706T150030_gl0tkqj3_.bkp channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/sha/backupset/2019_07_06/o1_mf_nnndf_TAG20190706T150030_gl0tkqj3_.bkp tag=TAG20190706T150030 channel ORA_DISK_1: restored block(s) from backup piece 1 channel ORA_DISK_1: block restore complete, elapsed time: 00:00:01 starting media recovery media recovery complete, elapsed time: 00:00:02 Finished recover at 06-JUN-22 RMAN> exit Recovery Manager complete. [oracle@sha Desktop]$ sqlplus SQL*Plus: Release 11.2.0.1.0 Production on Sat Jun 6 15:13:42 2019 Copyright (c) 1982, 2009, Oracle. All rights reserved. Enter user-name: aaa Enter password: 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> select count(*) from student; COUNT(*) ---------- 2 SQL> select * from student; SID SNAME ---------- ---------- 11 SMITH 22 MILLER SQL>