단, 백업되어 있어야 하고, 아카이브 모드이어야 함.
0. 데이터 파일 분실
[oracle@edrsr4p1 ~]$ rm /u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_3xs9d86x_.dbf
1. 데이터 파일 오류 발생.
SQL> create table xx(x date ) tablespace example;
create table xx(x date ) tablespace example
*
ERROR at line 1:
ORA-01116: error in opening database file 5
ORA-01110: data file 5: '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_3xs9d86x_.dbf'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
2. 복원(restore)
SQL> alter tablespace example offline for recover;
Tablespace altered.
SQL>
SQL> host ls /backup
g1_3.log o1_mf_3_3trzhlhr_.log
g2_3.log o1_mf_3_3trzhm2l_.log
g3_3 o1_mf_3trzhg7o_.ctl
g4_1.log o1_mf_3trzhgfx_.ctl
g4_2.log o1_mf_example_3xs9d86x_.dbf
g4_3.log o1_mf_sysaux_3trzfl4m_.dbf
o1_mf_1_3trzhh5c_.log o1_mf_system_3trzfl2y_.dbf
o1_mf_1_3trzhhyx_.log o1_mf_undotbs1_3trzflk7_.dbf
o1_mf_2_3trzhk5m_.log o1_mf_users_3trzflmk_.dbf
o1_mf_2_3trzhkq8_.log
SQL> host cp /backup/o1_mf_example_3xs9d86x_.dbf /u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_3xs9d86x_.dbf
3. 복구(recover)
SQL> recover datafile '/u01/app/oracle/oradata/ORCL/datafile/o1_mf_example_3xs9d86x_.dbf';
Media recovery complete.
4. 온라인(online)
Media recovery complete.
SQL> alter tablespace example online;
Tablespace altered.
SQL>
5. 확인
SQL> create table xx(x date ) tablespace example;
SQL>


