rman实验之归档模式无备份,正常关机丢失数据文件的恢复


并不是所有数据文件丢失都能够直接被恢复,如system;也不是所有数据文件丢失都需要恢复,如temp表空间。

下面模拟一张业务表。

1 创建演示环境

  1. sys@ORCL> archive log list;  
  2. Database log mode              Archive Mode  
  3. Automatic archival             Enabled  
  4. Archive destination            USE_DB_RECOVERY_FILE_DEST  
  5. Oldest online log sequence     16  
  6. Next log sequence to archive   18  
  7. Current log sequence           18  
  8. sys@ORCL> create tablespace think datafile '/u01/app/Oracle/oradata/ORCL/datafile/think.dbf' size 10m;  
  9.   
  10. Tablespace created.  
  11.   
  12. sys@ORCL> create user think identified by think default tablespace think quota unlimited on think;  
  13.   
  14. User created.  
  15.   
  16. sys@ORCL> grant connect,resource to think;  
  17.   
  18. Grant succeeded.  
  19.   
  20. sys@ORCL> conn think/think  
  21. Connected.  
  22. think@ORCL> create table tt (name varchar2(20));  
  23.   
  24. Table created.  
  25.   
  26. think@ORCL> insert into tt values('think');  
  27.   
  28. 1 row created.  
  29.   
  30. think@ORCL> commit;  
  31.   
  32. Commit complete.  
  33.   
  34. think@ORCL> select * from tt;  
  35.   
  36. NAME  
  37. --------------------   
  38. think  

2 模拟数据文件丢失

  1. sys@ORCL> shutdown immediate;  
  2. Database closed.  
  3. Database dismounted.  
  4. ORACLE instance shut down.  
  5. sys@ORCL> host rm -rf /u01/app/oracle/oradata/ORCL/datafile/think.dbf  
  6. 重新启动数据库  
  7. sys@ORCL> startup  
  8. ORACLE instance started.  
  9.   
  10. Total System Global Area  419430400 bytes  
  11. Fixed Size                  1219760 bytes  
  12. Variable Size             125829968 bytes  
  13. Database Buffers          289406976 bytes  
  14. Redo Buffers                2973696 bytes  
  15. Database mounted.  
  16. ORA-01157: cannot identify/lock data file 8 - see DBWR trace file  
  17. ORA-01110: data file 8: '/u01/app/oracle/oradata/ORCL/datafile/think.dbf'  
  • 1
  • 2
  • 下一页

相关内容