设为首页 加入收藏

TOP

Oracle穿越incarnation恢复数据(一)
2014-11-24 02:21:46 来源: 作者: 【 】 浏览:3
Tags:Oracle 穿越 incarnation 恢复 数据

当进行不完全恢复后,可能没达到恢复的要求,这个时候数据库已经被resetlogs方式打开过了,如果在进行不完全恢复前没有对数据库进行全库备份,这个时候又想恢复上一个incarnation的某些数据,在这种场景下就需要进行incarnation穿越,下面来演示下这个场景!
一:准备实验基础数据
1. SQL> create table t043_incarnation(a varchar2(20)) tablespace example;
2. Table created.
3.
4. SQL> insert into t043_incarnation values ('corss successful');
5. 1 row created.
6.
7. SQL> commit;
8. Commit complete.
9.
10. SQL> create table t043_other (a number) tablespace example;
11. Table created.
12.
13. SQL> insert into t043_other values (1);
14. 1 row created.
15.
16. SQL> insert into t043_other values (2);
17. 1 row created.
18.
19. SQL> commit;
20. Commit complete.
21.
22. SQL> alter system switch logfile;
23. System altered.
24.
25. SQL> insert into t043_other values (3);
26. 1 row created.
27.
28. SQL> alter system switch logfile;
29. System altered.
30.
31. SQL> select sysdate from dual;
32.
33. SYSDATE
34. -------------------
35. 2011-07-17-21:22:30
36.
37. SQL> truncate table t043_incarnation;
38. Table truncated.
39.
40. SQL> archive log list;
41. Database log mode Archive Mode
42. Automatic archival Enabled
43. Archive destination USE_DB_RECOVERY_FILE_DEST
44. Oldest online log sequence 64
45. Next log sequence to archive 66
46. Current log sequence 66
47. SQL> insert into t043_other values (4);
48. 1 row created.
49.
50. SQL> commit;
51. Commit complete.
52.
53. SQL> alter system switch logfile;
54. System altered.
55.
56. SQL> insert into t043_other values (5);
57. 1 row created.
58.
59. SQL> alter system switch logfile;
60. System altered.
61.
62. SQL> commit;
63. Commit complete.
64.
65. SQL> alter system switch logfile;
66. System altered.
二:删除全部控制文件第67号归档日志文件,这样进行恢复的时候就必须进行不完全恢复
1. [oracle@rhel6 2011_07_17]$ pwd
2. /u01/app/flash_recovery_area/ORA10G/archivelog/2011_07_17
3. [oracle@rhel6 2011_07_17]$ rm -i o1_mf_1_67_725rmcx1_.arc
4. rm: remove regular file `o1_mf_1_67_725rmcx1_.arc' y
5. [oracle@rhel6 2011_07_17]$ rm -rf /u01/app/oradata/ora10g/control0*
6.
7. SQL> shutdown abort;
8. ORACLE instance shut down.
9. SQL> startup
10. ORACLE instance started.
11.
12. Total System Global Area 629145600 bytes
13. Fixed Size 2022824 bytes
14. Variable Size 205521496 bytes
15. Database Buffers 415236096 bytes
16. Redo Buffers 6365184 bytes
17. ORA-00205: error in identifying control file, check alert log for more info
三:使用控制文件二进制自动备份进行恢复,也可以使用trace脚本,由于归档日志丢失的原因,都需要进行不完全恢复
1. RMAN> restore controlfile from autobackup;
2. Starting restore at 2011-07-17-21:28:29
3. using target database control file instead of recovery catalog
4. allocated channel: ORA_DISK_1
5. channel ORA_DISK_1: sid=154 devtype=DISK
6.
7. recovery area destination: /u01/app/flash_recovery_area
8. database name (or database unique name) used for search: ORA10G
9. channel ORA_DISK_1: autobackup found in the recovery area
10. channel ORA_DISK_1: autobackup found: /u01/app/flash_recovery_area/ORA10G/autobackup/2011_07_17/o1_mf_s_756768121_725rhvkf_.bkp
11. channel ORA_DISK_1: control file restore from autobackup complete
12. output filename=/u01/app/oradata/ora10g/control01.ctl
13. output filename=/u01/app/oradata/ora10g/control02.ctl
14. out

首页 上一页 1 2 3 下一页 尾页 1/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇oracle密码过期的处理办法 下一篇oracle临时表空间

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: