Case 3:
--All of the table space data files are lost, restore data files (open)
1) test environment
07:37:23 sql> INSERT INTO scott.test values (6);
1 row created.
07:39:18 sql> INSERT INTO scott.test values (7);
1 row created.
07:39:20 sql> INSERT INTO scott.test values (8);
1 row created.
07:39:21 sql> commit;
Commit complete.
07:39:23 sql> SELECT * from Scott.test;
Id
----------
6
7
8
1
2
3
4
5
8 rows selected.
07:40:06 sql>
----datafile is corrupted in open state
[Oracle@work ~]$ rm/u01/app/oracle/oradata/prod/test0*.dbf
[Oracle@work ~]$
07:41:19 sql> alter system flush Buffer_cache;
System altered.
07:41:25 sql> Conn Scott/tiger
Connected.
07:41:28 sql>
This column more highlights: http://www.bianceng.cn/database/Oracle/
07:41:28 sql> INSERT INTO scott.test values (10);
INSERT into scott.test values (10)
*
ERROR at line 1:
Ora-01116:error in opening database file 8
Ora-01110:data file 8: '/U01/APP/ORACLE/ORADATA/PROD/TEST02.DBF '
Ora-27041:unable to open File
Linux error:2: No such file or directory
Additional Information:3
07:41:31 sql>
2) Recovery using Rman
Rman> Run {
2> SQL ' ALTER DATABASE datafile 6,8 offline ';
3> Restore datafile 6, 8;
4> Recover datafile 6, 8;
5> SQL ' ALTER DATABASE datafile 6,8 online ';
6>}
3) Verify
07:41:31 sql> INSERT INTO scott.test values (10);
1 row created.
07:45:58 sql> commit;
Commit complete.
07:46:01 sql> SELECT * from test;
Id
----------
10
6
7
8
9
1
2
3
4
5
Ten rows selected.
07:46:04 sql>