自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Oracle數(shù)據(jù)庫RMAN不完全恢復之基于日志序列號恢復

數(shù)據(jù)庫 Oracle
本文我們主要介紹了Oracle數(shù)據(jù)庫RMAN不完全恢復之基于日志序列號恢復的一個代碼示例,通過這個示例讓我們一起來了解一下基于日志序列號恢復的相關知識吧,希望能夠?qū)δ兴鶐椭?/div>

之前介紹了:Oracle數(shù)據(jù)庫RMAN不完全恢復之基于SCN恢復,本文我們主要介紹一下Oracle數(shù)據(jù)庫RMAN不完全恢復之基于日志序列號恢復的相關知識,希望能夠?qū)δ兴鶐椭?/p>

基于日志序列號恢復是指恢復數(shù)據(jù)庫到指定日志序列號的狀態(tài)。

  1. --查看歸檔日志信息     
  2. SQL> select * from t_user;    
  3. TEXT    
  4. --------------------     
  5. java_    
  6. spring_    
  7. spring mvc_    
  8. SQL> insert into t_user select 'oracle_' from dual;    
  9. 1 row created.    
  10. SQL> commit;    
  11. Commit complete.    
  12. SQL> alter system switch logfile;    
  13. System altered.    
  14. SQL> alter system checkpoint;    
  15. System altered.    
  16. SQL> select sequence#,name,first_change# from v$archived_log where status='A' order by sequence#;    
  17. SEQUENCE# NAME                                                   FIRST_CHANGE#    
  18. ---------- ---------------------------------------------------------------------------------------------------- -------------     
  19. 1 /oracle/10g/oracle/log/archive_log/archive_1_1_760487088.arclog                                            1214497    
  20. 1 /oracle/10g/oracle/log/archive_log2/archive_1_1_760487088.arclog                                           1214497    
  21. 1 /oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_29/o1_mf_1_1_7       1214498    
  22. 5q9bh9d_.arc    
  23. 1 /oracle/10g/oracle/log/archive_log/archive_1_1_760487985.arclog                                            1214498    
  24. 1 /oracle/10g/oracle/log/archive_log2/archive_1_1_760487985.arclog                                           1214498    
  25. 1 /oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_29/o1_mf_1_1_7       1214497    
  26. 5q95ksf_.arc    
  27. 6 rows selected.    
  28. SQL> insert into t_user select 'oracle_seq3' from dual;    
  29. 1 row created.    
  30. SQL> commit;    
  31. Commit complete.    
  32. SQL> alter system switch logfile; --生成日志序列號為2的歸檔日志     
  33. System altered.    
  34. SQL> alter system checkpoint;    
  35. System altered.    
  36. SQL> select sequence#,name,first_change# from v$archived_log where status='A' order by sequence#;    
  37. SEQUENCE# NAME                                                     FIRST_CHANGE#    
  38. ---------- ---------------------------------------------------------------------------------------------------- -------------     
  39. 1 /oracle/10g/oracle/log/archive_log/archive_1_1_760487088.arclog                                            1214497    
  40. 1 /oracle/10g/oracle/log/archive_log2/archive_1_1_760487088.arclog                                           1214497    
  41. 1 /oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_29/o1_mf_1_1_7       1214497    
  42. 5q95ksf_.arc    
  43. 1 /oracle/10g/oracle/log/archive_log/archive_1_1_760487985.arclog                                            1214498    
  44. 1 /oracle/10g/oracle/log/archive_log2/archive_1_1_760487985.arclog                                           1214498    
  45. 1 /oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_29/o1_mf_1_1_7       1214498    
  46. 5q9bh9d_.arc    
  47. 2 /oracle/10g/oracle/log/archive_log/archive_1_2_760487985.arclog                                            1216167    
  48. SEQUENCE# NAME                                                     FIRST_CHANGE#    
  49. ---------- ---------------------------------------------------------------------------------------------------- -------------     
  50. 2 /oracle/10g/oracle/log/archive_log2/archive_1_2_760487985.arclog                                           1216167    
  51. 2 /oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_29/o1_mf_1_2_7       1216167    
  52. 5q9cvt1_.arc    
  53. 9 rows selected.    
  54. SQL> insert into t_user select 'oracle_seq3_act' from dual;    
  55. 1 row created.    
  56. SQL> commit;    
  57. Commit complete.    
  58. SQL> alter system switch logfile; --生成日志序列號為3的歸檔日志     
  59. System altered.    
  60. SQL> alter system checkpoint;    
  61. System altered.    
  62. SQL> select sequence#,name,first_change# from v$archived_log where status='A' order by sequence#;    
  63. SEQUENCE# NAME                                                     FIRST_CHANGE#    
  64. ---------- ---------------------------------------------------------------------------------------------------- -------------     
  65. 1 /oracle/10g/oracle/log/archive_log/archive_1_1_760487088.arclog                                            1214497    
  66. 1 /oracle/10g/oracle/log/archive_log2/archive_1_1_760487088.arclog                                           1214497    
  67. 1 /oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_29/o1_mf_1_1_7       1214497    
  68. 5q95ksf_.arc    
  69. 1 /oracle/10g/oracle/log/archive_log/archive_1_1_760487985.arclog                                            1214498    
  70. 1 /oracle/10g/oracle/log/archive_log2/archive_1_1_760487985.arclog                                           1214498    
  71. 1 /oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_29/o1_mf_1_1_7       1214498    
  72. 5q9bh9d_.arc    
  73. 2 /oracle/10g/oracle/log/archive_log/archive_1_2_760487985.arclog                                            1216167    
  74. SEQUENCE# NAME                                                     FIRST_CHANGE#    
  75. ---------- ---------------------------------------------------------------------------------------------------- -------------     
  76. 2 /oracle/10g/oracle/log/archive_log2/archive_1_2_760487985.arclog                                           1216167    
  77. 2 /oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_29/o1_mf_1_2_7       1216167    
  78. 5q9cvt1_.arc    
  79. 3 /oracle/10g/oracle/log/archive_log/archive_1_3_760487985.arclog                                            1216186    
  80. 3 /oracle/10g/oracle/log/archive_log2/archive_1_3_760487985.arclog                                           1216186    
  81. 3 /oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_29/o1_mf_1_3_7       1216186    
  82. 5q9f4d6_.arc    
  83. 12 rows selected.    
  84. --恢復到日志序列號為3時的狀態(tài)     
  85. [oracle@localhost ~]$ rman target sys/oracle@oralife nocatalog    
  86. RMAN> run {    
  87. startup force mount;    
  88. set until sequence=3;    
  89. restore database;    
  90. recover database;    
  91. sql 'alter database open resetlogs';    
  92. }    
  93. --查看,可見不包括日志序列號為3的歸檔日志信息(oracle_seq3_act),即恢復到日志序列號為2的歸檔日志     
  94. SQL> conn sys/oracle@oralife as sysdba    
  95. Connected.    
  96. SQL> select * from t_user;    
  97. TEXT    
  98. --------------------     
  99. java_    
  100. spring_    
  101. oracle_    
  102. oracle_seq3    
  103. spring mvc_   

可見不包括日志序列號為3的歸檔日志信息(oracle_seq3_act),即恢復到日志序列號為2的歸檔日志。

在執(zhí)行了不完全恢復之后,推薦刪除早期所有備份,重新備份數(shù)據(jù)庫。

關于Oracle數(shù)據(jù)庫RMAN不完全恢復之基于日志序列號恢復的相關知識就介紹到這里了,希望本次的介紹能夠?qū)δ兴斋@!

【編輯推薦】

  1. Oracle數(shù)據(jù)庫PL/SQL快捷鍵設置詳解
  2. Oracle數(shù)據(jù)庫學習筆記之表的聯(lián)合查詢
  3. 一個Oracle數(shù)據(jù)庫執(zhí)行存儲過程的錯誤解決
  4. Oracle數(shù)據(jù)庫日期范圍搜索的兩種方法簡介
  5. Oracle數(shù)據(jù)庫RMAN恢復之數(shù)據(jù)文件的恢復詳解
責任編輯:趙鵬 來源: CSDN博客
相關推薦

2011-08-30 09:50:22

OracleRMAN不完全恢復基于SCN恢復

2011-08-30 09:35:10

OracleRMAN不完全恢復基于時間恢復

2017-04-13 08:46:41

oracle數(shù)據(jù)挖掘

2011-08-23 11:09:36

Oraclerman恢復system表空間恢復

2011-08-29 16:41:14

OracleRMAN恢復數(shù)據(jù)文件的恢復

2011-08-29 17:00:47

Oracle數(shù)據(jù)庫RM表空間數(shù)據(jù)塊介質(zhì)

2011-08-03 18:42:21

Oracle數(shù)據(jù)庫重做日志

2010-03-31 10:39:40

RMANOracle

2011-05-24 10:26:12

Oracle數(shù)據(jù)庫日志文件

2009-11-20 13:29:59

Oracle數(shù)據(jù)庫恢復

2011-05-26 09:36:07

Oracle數(shù)據(jù)庫Redo故障

2011-02-28 13:31:17

Oracle數(shù)據(jù)庫

2011-08-01 12:44:25

Oracle基于用戶管理備份與恢復

2010-11-19 13:28:13

2011-05-11 13:25:57

Oracle數(shù)據(jù)庫后備恢復

2011-03-04 14:59:16

Raidoracle數(shù)據(jù)庫

2009-04-03 10:54:49

Oracle備份恢復

2011-03-24 17:21:42

Oracle數(shù)據(jù)庫Redo故障

2021-05-20 11:45:16

數(shù)據(jù)庫中間件架構

2011-08-01 14:50:10

日志挖掘數(shù)據(jù)庫
點贊
收藏

51CTO技術棧公眾號