Restore operation
1. Non-system table space Recovery steps
A. alter datafile n offline immediate; | Alter tablespace tbs_name offline immediate;
B. Restore
C. recover
d. alter datafile n online; | Alter Tablespace Tbs_name Online
--delete data files for non-system tablespace users (database is in open state)
[Oracle@oradb orcl]$ pwd
/u01/oracle/oradata/orcl
[Oracle@oradb orcl]$ RM users01.dbf
Lion@orcl> select * from TB2;
SELECT * FROM TB2
*
ERROR at line 1:
Ora-01116:error in opening database file 4
Ora-01110:data file 4: '/U01/ORACLE/ORADATA/ORCL/USERS01.DBF '
Ora-27041:unable to open File
Linux error:2: No such file or directory
Additional Information:3
Rman> Run {
2> Allocate channel CH1 device type disk;
3> SQL "Alter TABLESPACE users offline immediate";
4> restore tablespace users;
5> Recover tablespace users;
6> SQL "alter tablespace users online";
7>}
Lion@orcl> select * from TB2;
ID NAME
---------- ---------------
1 Robinson
You can also use the following recovery method to complete the recovery
Rman> Run {
2> Allocate channel CH1 device type disk;
3> SQL "ALTER DATABASE datafile 4 offline";
4> restore DataFile 4;
5> recover datafile 4;
6> SQL "ALTER DATABASE datafile 4 online";
7>}
If the required log is not archived when the media is restored, you need to specify where the online redo log files are located