免费观看又色又爽又黄的小说免费_美女福利视频国产片_亚洲欧美精品_美国一级大黄大色毛片

Oracle如何使用備份控制文件

這篇文章主要為大家展示了“Oracle如何使用備份控制文件”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“Oracle如何使用備份控制文件”這篇文章吧。

創(chuàng)新互聯(lián)公司主要從事成都網(wǎng)站制作、網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)習(xí)水,十余年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專(zhuān)業(yè),歡迎來(lái)電咨詢(xún)建站服務(wù):18980820575



示例一:冷備份所有數(shù)據(jù)文件--->新建表空間--->備份控制文件(日志文件完好)

實(shí)驗(yàn)環(huán)境:

當(dāng)前的控制文件損壞,新創(chuàng)建的表空間損壞,冷備的數(shù)據(jù)文件中沒(méi)有該數(shù)據(jù)文件的備份,但是控制文件和聯(lián)機(jī)日志中有相關(guān)的記錄;由于控制文件損壞,只能使用備份的控制文件來(lái)做恢復(fù)。

  1. --查看數(shù)據(jù)庫(kù)中已有的表空間

  2. SYS@seiang11g>select * from v$tablespace;


  3.        TS# NAME                                               INC BIG FLA ENC

  4. ---------- -------------------------------------------------- --- --- --- ---

  5.          0 SYSTEM                                             YES NO  YES

  6.          1 SYSAUX                                             YES NO  YES

  7.          2 UNDOTBS1                                           YES NO  YES

  8.          4 USERS                                              YES NO  YES

  9.          3 TEMP                                               NO  NO  YES

  10.          6 EXAMPLE                                            YES NO  YES

  11.          7 RMAN_CATALOG                                       YES NO  YES

  12.          8 SEIANG                                             YES NO  YES

  13.          9 WJQ                                                YES NO  YES

  14.         10 WJQBEST                                            YES NO  YES


  15. --查看當(dāng)前日志的序列號(hào)為3

  16. SYS@seiang11g>select group#,sequence#,status from v$log;


  17.     GROUP# SEQUENCE# STATUS

  18. ---------- ---------- ----------------

  19.          1          1 INACTIVE

  20.          2          2 INACTIVE

  21.          3          3 CURRENT



  22. --新創(chuàng)建一個(gè)表空間test

  23. SYS@seiang11g>create tablespace test datafile '/u01/app/oracle/oradata/OraDB11g/test01.dbf' size 5M;

  24. Tablespace created.



  25. --表空間創(chuàng)建完成之后,備份控制文件

  26. SYS@seiang11g>alter database backup controlfile to '/u01/app/oracle/oradata/OraDB11g/control.bak';

  27. Database altered.


  28. --查看數(shù)據(jù)庫(kù)中控制文件的多元化路徑

  29. SYS@seiang11g>show parameter control


  30. NAME TYPE VALUE

  31. ------------------------------------ ----------- ------------------------------

  32. control_file_record_keep_time integer 14

  33. control_files                        string /u01/app/oracle/oradata/OraDB1

  34.                                                  1g/control01.ctl, /u01/app/ora

  35.                                                  cle/fast_recovery_area/OraDB11

  36.                                                  g/control02.ctl

  37. control_management_pack_access       string      DIAGNOSTIC+TUNING



  38. --4在seiang用戶(hù)下創(chuàng)建一張表test4,隸屬于test表空間

  39. SYS@seiang11g>create table seiang.test4(ID number,name varchar2(30)) tablespace test;

  40. Table created.



  41. --在test4表中插入兩條數(shù)據(jù),并提交

  42. SYS@seiang11g>insert into seiang.test4 values(1001,'wjq');

  43. 1 row created.


  44. SYS@seiang11g>insert into seiang.test4 values(1002,'seiang');

  45. 1 row created.


  46. SYS@seiang11g>commit;

  47. Commit complete.


  48. --執(zhí)行日志切換,剛插入的表中的記錄信息已歸檔

  49. SYS@seiang11g>alter system switch logfile;

  50. System altered.


  51. --查看當(dāng)前的日志序列號(hào)為4

  52. SYS@seiang11g>select group#,sequence#,status from v$log;


  53.     GROUP# SEQUENCE# STATUS

  54. ---------- ---------- ----------------

  55.          1          4 CURRENT

  56.          2          2 INACTIVE

  57.          3          3 ACTIVE


  58. --再在test4表中插入兩條數(shù)據(jù),但后兩條插入的數(shù)據(jù)記錄在當(dāng)前日志文件1中

  59. SYS@seiang11g>insert into seiang.test4 values(1003,'wjqgood');

  60. 1 row created.


  61. SYS@seiang11g>insert into seiang.test4 values(1004,'wjqbest');

  62. 1 row created.


  63. SYS@seiang11g>commit;

  64. Commit complete.


  65. --查看test4表中數(shù)據(jù)的內(nèi)容

  66. SYS@seiang11g>select * from seiang.test4;


  67.         ID NAME

  68. ---------- --------------------------------------------------

  69.       1001 wjq

  70.       1002 seiang

  71.       1003 wjqgood

  72.       1004 wjqbest



  73. --模擬test表空間中數(shù)據(jù)文件損壞或丟失,以及控制文件損壞

  74. SYS@seiang11g>host rm /u01/app/oracle/oradata/OraDB11g/test01.dbf

  75. SYS@seiang11g>host rm /u01/app/oracle/oradata/OraDB11g/control01.ctl


  76. SYS@seiang11g>host rm /u01/app/oracle/fast_recovery_area/OraDB11g/control02.ctl



  77. --數(shù)據(jù)庫(kù)已經(jīng)宕機(jī),無(wú)法訪問(wèn)

  78. SYS@seiang11g>select * from seiang.test4;

  79. select * from seiang.test4

  80. *

  81. ERROR at line 1:

  82. ORA-03135: connection lost contact

  83. Process ID: 17679

  84. Session ID: 34 Serial number: 531

  1. --還原所有的數(shù)據(jù)文件和控制文件,準(zhǔn)備做不完全恢復(fù)

    SYS@seiang11g>host cp /u01/app/oracle/UMAN_Backup/*.dbf /u01/app/oracle/oradata/OraDB11g/


    SYS@seiang11g>host cp /u01/app/oracle/oradata/OraDB11g/control.bak /u01/app/oracle/oradata/OraDB11g/control01.ctl


    SYS@seiang11g>host cp /u01/app/oracle/oradata/OraDB11g/control.bak /u01/app/oracle/fast_recovery_area/OraDB11g/control02.ctl


  2. --查看控制文件和數(shù)據(jù)文件頭所記錄的SCN,發(fā)現(xiàn)test01.dbf數(shù)據(jù)文件頭沒(méi)有記錄

  3. SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile;


  4.      FILE# CHECKPOINT_CHANGE# NAME

  5. ---------- ------------------ --------------------------------------------------

  6.          1            1981768 /u01/app/oracle/oradata/OraDB11g/system01.dbf

  7.          2            1981768 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf

  8.          3            1981768 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf

  9.          4            1981768 /u01/app/oracle/oradata/OraDB11g/users01.dbf

  10.          5            1981768 /u01/app/oracle/oradata/OraDB11g/example01.dbf

  11.          6            1981768 /u01/app/oracle/oradata/OraDB11g/rman01.dbf

  12.          7            1981768 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf

  13.          8            1981768 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf

  14.          9            1981768 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf

  15.         10            1986000 /u01/app/oracle/oradata/OraDB11g/test01.dbf


  16. SYS@seiang11g>

  17. SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile_header;


  18.      FILE# CHECKPOINT_CHANGE# NAME

  19. ---------- ------------------ --------------------------------------------------

  20.          1            1913765 /u01/app/oracle/oradata/OraDB11g/system01.dbf

  21.          2            1913765 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf

  22.          3            1913765 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf

  23.          4            1913765 /u01/app/oracle/oradata/OraDB11g/users01.dbf

  24.          5            1913765 /u01/app/oracle/oradata/OraDB11g/example01.dbf

  25.          6            1913765 /u01/app/oracle/oradata/OraDB11g/rman01.dbf

  26.          7            1913765 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf

  27.          8            1913765 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf

  28.          9            1913765 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf

  29.         10                  0



  30. 可以看出:

  31. ①    file10在控制文件里記錄是test01.dbf,而與之對(duì)應(yīng)的數(shù)據(jù)文件10是不存在的,

  32. ②    備份的數(shù)據(jù)備份的SCN比控制文件SCN還老。



  33. --查看需要恢復(fù)的數(shù)據(jù)文件

  34. SYS@seiang11g>select * from v$recover_file;


  35.      FILE# ONLINE  ONLINE_ ERROR                                                                CHANGE# TIME

  36. ---------- ------- ------- ----------------------------------------------------------------- ---------- ---------

  37.          1 ONLINE  ONLINE  UNKNOWN ERROR                                                        1913765 02-AUG-17

  38.          2 ONLINE  ONLINE  UNKNOWN ERROR                                                        1913765 02-AUG-17

  39.          3 ONLINE  ONLINE  UNKNOWN ERROR                                                        1913765 02-AUG-17

  40.          4 ONLINE  ONLINE  UNKNOWN ERROR                                                        1913765 02-AUG-17

  41.          5 ONLINE  ONLINE  UNKNOWN ERROR                                                        1913765 02-AUG-17

  42.          6 ONLINE  ONLINE  UNKNOWN ERROR                                                        1913765 02-AUG-17

  43.          7 ONLINE  ONLINE  UNKNOWN ERROR                                                        1913765 02-AUG-17

  44.          8 ONLINE  ONLINE  UNKNOWN ERROR                                                        1913765 02-AUG-17

  45.          9 ONLINE  ONLINE  UNKNOWN ERROR                                                        1913765 02-AUG-17

  46.         10 ONLINE  ONLINE  FILE NOT FOUND                                                             0


  47.     

  48. --嘗試做完全恢復(fù),提示使用備份的控制文件來(lái)恢復(fù)

  49. SYS@seiang11g>recover database;

  50. ORA-00283: recovery session canceled due to errors

  51. ORA-01610: recovery using the BACKUP CONTROLFILE option must be done



  52. --使用備份的控制文件來(lái)做恢復(fù),出現(xiàn)報(bào)錯(cuò)

  53. SYS@seiang11g>recover database using backup controlfile;

  54. ORA-00283: recovery session canceled due to errors

  55. ORA-01110: data file 10: '/u01/app/oracle/oradata/OraDB11g/test01.dbf'

  56. ORA-01157: cannot identify/lock data file 10 - see DBWR trace file

  57. ORA-01110: data file 10: '/u01/app/oracle/oradata/OraDB11g/test01.dbf'


  58. 此錯(cuò)是因?yàn)槔蟼浞堇餂](méi)有abcd表空間,但只要控制文件里記錄了abcd就好辦,方法是建一個(gè)datafile的空文件,而其中內(nèi)容可由日志文件recover(前滾)時(shí)填補(bǔ)出來(lái)。



  59. --新建一個(gè)數(shù)據(jù)文件

  60. SYS@seiang11g>alter database create datafile '/u01/app/oracle/oradata/OraDB11g/test01.dbf';

  61. Database altered.



  62. --再次查看控制文件和數(shù)據(jù)文件頭中做記錄的SCN

  63. SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile;


  64.      FILE# CHECKPOINT_CHANGE# NAME

  65. ---------- ------------------ --------------------------------------------------

  66.          1            1981768 /u01/app/oracle/oradata/OraDB11g/system01.dbf

  67.          2            1981768 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf

  68.          3            1981768 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf

  69.          4            1981768 /u01/app/oracle/oradata/OraDB11g/users01.dbf

  70.          5            1981768 /u01/app/oracle/oradata/OraDB11g/example01.dbf

  71.          6            1981768 /u01/app/oracle/oradata/OraDB11g/rman01.dbf

  72.          7            1981768 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf

  73.          8            1981768 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf

  74.          9            1981768 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf

  75.         10            1986000 /u01/app/oracle/oradata/OraDB11g/test01.dbf


  76. 10 rows selected.


  77. SYS@seiang11g>

  78. SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile_header;


  79.      FILE# CHECKPOINT_CHANGE# NAME

  80. ---------- ------------------ --------------------------------------------------

  81.          1            1913766 /u01/app/oracle/oradata/OraDB11g/system01.dbf

  82.          2            1913766 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf

  83.          3            1913766 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf

  84.          4            1913766 /u01/app/oracle/oradata/OraDB11g/users01.dbf

  85.          5            1913766 /u01/app/oracle/oradata/OraDB11g/example01.dbf

  86.          6            1913766 /u01/app/oracle/oradata/OraDB11g/rman01.dbf

  87.          7            1913766 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf

  88.          8            1913766 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf

  89.          9            1913766 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf

  90.         10            1985999 /u01/app/oracle/oradata/OraDB11g/test01.dbf



  91. --再次使用備份的控制文件來(lái)做恢復(fù)

  92. SYS@seiang11g>recover database using backup controlfile;

  93. ORA-00279: change 1913766 generated at 08/02/2017 11:12:22 needed for thread 1

  94. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950971495_1.log

  95. ORA-00280: change 1913766 for thread 1 is in sequence #1


  96. Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

  97. auto (因?yàn)樾枰娜罩疽呀?jīng)歸檔,所以選擇auto)

  98. ORA-00279: change 1914386 generated at 08/02/2017 14:48:59 needed for thread 1

  99. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950971495_2.log

  100. ORA-00280: change 1914386 for thread 1 is in sequence #2

  101. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950971495_1.log' no longer needed for this recovery



  102. ORA-00279: change 1914402 generated at 08/02/2017 14:59:56 needed for thread 1

  103. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_1.log

  104. ORA-00280: change 1914402 for thread 1 is in sequence #1



  105. ORA-00279: change 1936446 generated at 08/02/2017 15:39:52 needed for thread 1

  106. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_2.log

  107. ORA-00280: change 1936446 for thread 1 is in sequence #2

  108. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_1.log' no longer needed for this recovery



  109. ORA-00279: change 1937042 generated at 08/02/2017 15:49:42 needed for thread 1

  110. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_3.log

  111. ORA-00280: change 1937042 for thread 1 is in sequence #3

  112. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_2.log' no longer needed for this recovery



  113. ORA-00279: change 1937100 generated at 08/02/2017 15:51:34 needed for thread 1

  114. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_4.log

  115. ORA-00280: change 1937100 for thread 1 is in sequence #4

  116. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_3.log' no longer needed for this recovery



  117. ORA-00279: change 1937111 generated at 08/02/2017 16:23:53 needed for thread 1

  118. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_1.log

  119. ORA-00280: change 1937111 for thread 1 is in sequence #1



  120. ORA-00279: change 1955524 generated at 08/02/2017 22:00:32 needed for thread 1

  121. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_2.log

  122. ORA-00280: change 1955524 for thread 1 is in sequence #2

  123. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_1.log' no longer needed for this recovery



  124. ORA-00279: change 1981768 generated at 08/03/2017 08:19:54 needed for thread 1

  125. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_3.log

  126. ORA-00280: change 1981768 for thread 1 is in sequence #3

  127. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_2.log' no longer needed for this recovery



  128. ORA-00279: change 1986580 generated at 08/03/2017 10:00:19 needed for thread 1

  129. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_4.log

  130. ORA-00280: change 1986580 for thread 1 is in sequence #4

  131. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_3.log' no longer needed for this recovery



  132. ORA-00308: cannot open archived log '/u01/app/oracle/arch/arch_1_950977433_4.log'

  133. ORA-27037: unable to obtain file status

  134. Linux-x86_64 Error: 2: No such file or directory

  135. Additional information: 3


  136. 出現(xiàn)此錯(cuò)誤,因?yàn)楫?dāng)前的當(dāng)前的日志文件尚未歸檔,所以出現(xiàn)錯(cuò)誤,所以接下來(lái)使用當(dāng)前的日志文件來(lái)做恢復(fù)


  137. SYS@seiang11g>recover database using backup controlfile;

  138. ORA-00279: change 1986580 generated at 08/03/2017 10:00:19 needed for thread 1

  139. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_4.log

  140. ORA-00280: change 1986580 for thread 1 is in sequence #4



  141. Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

  142. /u01/app/oracle/oradata/OraDB11g/redo01.log (當(dāng)前日志文件)

  143. Log applied.

  144. Media recovery complete.

  145. SYS@seiang11g>



  146. --恢復(fù)完成,使用resetlogs打開(kāi)數(shù)據(jù)庫(kù)

  147. SYS@seiang11g>alter database open resetlogs;

  148. Database altered.


  149. --查看控制文件和數(shù)據(jù)文件頭記錄的SCN一致

  150. SYS@seiang11g>select file#,checkpoint_change# from v$datafile;


  151.      FILE# CHECKPOINT_CHANGE#

  152. ---------- ------------------

  153.          1            1986883

  154.          2            1986883

  155.          3            1986883

  156.          4            1986883

  157.          5            1986883

  158.          6            1986883

  159.          7            1986883

  160.          8            1986883

  161.          9            1986883

  162.         10            1986883


  163. SYS@seiang11g>select file#,checkpoint_change# from v$datafile_header;


  164.      FILE# CHECKPOINT_CHANGE#

  165. ---------- ------------------

  166.          1            1986883

  167.          2            1986883

  168.          3            1986883

  169.          4            1986883

  170.          5            1986883

  171.          6            1986883

  172.          7            1986883

  173.          8            1986883

  174.          9            1986883

  175.         10            1986883


  176. --確認(rèn)test4表中的數(shù)據(jù)全部恢復(fù)成功

  177. SYS@seiang11g>select * from seiang.test4;


  178.         ID NAME

  179. ---------- --------------------------------------------------

  180.       1001 wjq

  181.       1002 seiang

  182.       1003 wjqgood

  183.       1004 wjqbest



示例二:冷備份所有數(shù)據(jù)文件--->備份控制文件--->新建表空間(日志文件完好)

 

實(shí)驗(yàn)環(huán)境:

當(dāng)前的控制文件損壞,新創(chuàng)建的表空間損壞,冷備的數(shù)據(jù)文件中沒(méi)有該數(shù)據(jù)文件的備份,控制文件中也沒(méi)有該表空間的記錄,但是聯(lián)機(jī)日志中有相關(guān)的記錄;由于控制文件損壞,只能使用備份的控制文件來(lái)做恢復(fù)。


  1. --查看數(shù)據(jù)庫(kù)中已存在的表空間

  2. SYS@seiang11g>select * from v$tablespace;

  3.        TS# NAME                                               INC BIG FLA ENC

  4. ---------- -------------------------------------------------- --- --- --- ---

  5.          0 SYSTEM                                             YES NO  YES

  6.          1 SYSAUX                                             YES NO  YES

  7.          2 UNDOTBS1                                           YES NO  YES

  8.          4 USERS                                              YES NO  YES

  9.          3 TEMP                                               NO  NO  YES

  10.          6 EXAMPLE                                            YES NO  YES

  11.          7 RMAN_CATALOG                                       YES NO  YES

  12.          8 SEIANG                                             YES NO  YES

  13.          9 WJQ                                                YES NO  YES

  14.         10 WJQBEST                                            YES NO  YES

  15. --備份控制文件

  16. SYS@seiang11g>alter database backup controlfile to '/u01/app/oracle/oradata/OraDB11g/control.bak1';

  17. Database altered.

  18. -創(chuàng)建表空間comsys該表空間記錄在當(dāng)前的日志redo01.log中

  19. SYS@seiang11g>create tablespace comsys datafile '/u01/app/oracle/oradata/OraDB11g/comsys01.dbf' size 5M;

  20. Tablespace created.

  21. --在seiang用戶(hù)下創(chuàng)建一張表test4,隸屬于comsys表空間

  22. SYS@seiang11g>create table seiang.test4(age number,address varchar2(10)) tablespace comsys;

  23. Table created.

  24. --在test4表中插入兩條數(shù)據(jù),并提交

  25. SYS@seiang11g>insert into seiang.test4 values(23,'beijing');

  26. 1 row created.

  27. SYS@seiang11g>insert into seiang.test4 values(25,'shanghai');

  28. 1 row created.

  29. SYS@seiang11g>commit;

  30. Commit complete.

  31. SYS@seiang11g>select * from seiang.test4;

  32.        AGE ADDRESS

  33. ---------- ----------

  34.         23 beijing

  35.         25 shanghai

  36. --查看當(dāng)前日志的序列號(hào)為1

  37. SYS@seiang11g>select group#,sequence#,status from v$log;

  38.     GROUP# SEQUENCE# STATUS

  39. ---------- ---------- ----------------

  40.          1          1 CURRENT

  41.          2          0 UNUSED

  42.          3          0 UNUSED

  43. --模擬comsys01.dbf數(shù)據(jù)文件丟失或損壞,控制文件損壞

  44. SYS@seiang11g>host rm /u01/app/oracle/oradata/OraDB11g/comsys01.dbf

  45. SYS@seiang11g>shutdown abort

  46. ORACLE instance shut down.

  47. --從備份的文件中還原控制文件和數(shù)據(jù)文件

  48. SYS@seiang11g>host cp /u01/app/oracle/oradata/OraDB11g/control.bak1 /u01/app/oracle/oradata/OraDB11g/control01.ctl

  49. SYS@seiang11g>host cp /u01/app/oracle/oradata/OraDB11g/control.bak1 /u01/app/oracle/fast_recovery_area/OraDB11g/control02.ctl

  50. SYS@seiang11g>host cp /u01/app/oracle/UMAN_Backup/*.dbf /u01/app/oracle/oradata/OraDB11g

  1. SYS@seiang11g>startup

  2. ORACLE instance started.

  3. Total System Global Area 1252663296 bytes

  4. Fixed Size 2252824 bytes

  5. Variable Size 788533224 bytes

  6. Database Buffers          452984832 bytes

  7. Redo Buffers                8892416 bytes

  8. Database mounted.

  9. ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

  10. --查看控制文件和數(shù)據(jù)文件頭,發(fā)現(xiàn)并沒(méi)有comsys表空間的相關(guān)記錄

  11. SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile;

  12.      FILE# CHECKPOINT_CHANGE# NAME

  13. ---------- ------------------ --------------------------------------------------

  14.          1            1986883 /u01/app/oracle/oradata/OraDB11g/system01.dbf

  15.          2            1986883 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf

  16.          3            1986883 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf

  17.          4            1986883 /u01/app/oracle/oradata/OraDB11g/users01.dbf

  18.          5            1986883 /u01/app/oracle/oradata/OraDB11g/example01.dbf

  19.          6            1986883 /u01/app/oracle/oradata/OraDB11g/rman01.dbf

  20.          7            1986883 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf

  21.          8            1986883 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf

  22.          9            1986883 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf

  23. SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile_header;

  24.      FILE# CHECKPOINT_CHANGE# NAME

  25. ---------- ------------------ --------------------------------------------------

  26.          1            1913765 /u01/app/oracle/oradata/OraDB11g/system01.dbf

  27.          2            1913765 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf

  28.          3            1913765 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf

  29.          4            1913765 /u01/app/oracle/oradata/OraDB11g/users01.dbf

  30.          5            1913765 /u01/app/oracle/oradata/OraDB11g/example01.dbf

  31.          6            1913765 /u01/app/oracle/oradata/OraDB11g/rman01.dbf

  32.          7            1913765 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf

  33.          8            1913765 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf

  34.          9            1913765 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf

  35. --嘗試完全恢復(fù),提示使用備份的控制文件做恢復(fù)

  36. SYS@seiang11g>recover database;

  37. ORA-00283: recovery session canceled due to errors

  38. ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

  39. --使用備份的控制文件做恢復(fù)

  40. SYS@seiang11g>recover database using backup controlfile;

  41. ORA-00279: change 1913766 generated at 08/02/2017 11:12:22 needed for thread 1

  42. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950971495_1.log

  43. ORA-00280: change 1913766 for thread 1 is in sequence #1

  44. Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

  45. auto    (該日志已歸檔,所以選擇auto)

  46. ORA-00279: change 1914386 generated at 08/02/2017 14:48:59 needed for thread 1

  47. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950971495_2.log

  48. ORA-00280: change 1914386 for thread 1 is in sequence #2

  49. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950971495_1.log' no longer needed for this recovery

  50. ORA-00279: change 1914402 generated at 08/02/2017 14:59:56 needed for thread 1

  51. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_1.log

  52. ORA-00280: change 1914402 for thread 1 is in sequence #1

  53. ORA-00279: change 1936446 generated at 08/02/2017 15:39:52 needed for thread 1

  54. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_2.log

  55. ORA-00280: change 1936446 for thread 1 is in sequence #2

  56. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_1.log' no longer needed for this recovery

  57. ORA-00279: change 1937042 generated at 08/02/2017 15:49:42 needed for thread 1

  58. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_3.log

  59. ORA-00280: change 1937042 for thread 1 is in sequence #3

  60. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_2.log' no longer needed for this recovery

  61. ORA-00279: change 1937100 generated at 08/02/2017 15:51:34 needed for thread 1

  62. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950972396_4.log

  63. ORA-00280: change 1937100 for thread 1 is in sequence #4

  64. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950972396_3.log' no longer needed for this recovery

  65. ORA-00279: change 1937111 generated at 08/02/2017 16:23:53 needed for thread 1

  66. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_1.log

  67. ORA-00280: change 1937111 for thread 1 is in sequence #1

  68. ORA-00279: change 1955524 generated at 08/02/2017 22:00:32 needed for thread 1

  69. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_2.log

  70. ORA-00280: change 1955524 for thread 1 is in sequence #2

  71. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_1.log' no longer needed for this recovery

  72. ORA-00279: change 1981768 generated at 08/03/2017 08:19:54 needed for thread 1

  73. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_3.log

  74. ORA-00280: change 1981768 for thread 1 is in sequence #3

  75. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_2.log' no longer needed for this recovery

  76. ORA-00279: change 1986580 generated at 08/03/2017 10:00:19 needed for thread 1

  77. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_950977433_4.log

  78. ORA-00280: change 1986580 for thread 1 is in sequence #4

  79. ORA-00278: log file '/u01/app/oracle/arch/arch_1_950977433_3.log' no longer needed for this recovery

  80. ORA-00279: change 1986880 generated at 08/03/2017 10:33:47 needed for thread 1

  81. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_951042827_1.log

  82. ORA-00280: change 1986880 for thread 1 is in sequence #1

  83. ORA-00308: cannot open archived log '/u01/app/oracle/arch/arch_1_951042827_1.log'

  84. ORA-27037: unable to obtain file status

  85. Linux-x86_64 Error: 2: No such file or directory

  86. Additional information: 3

  87. 出現(xiàn)此錯(cuò)誤,因?yàn)楫?dāng)前的日志文件尚未歸檔,所以出現(xiàn)錯(cuò)誤,所以接下來(lái)使用當(dāng)前的日志文件來(lái)做恢復(fù)

  88. SYS@seiang11g>recover database using backup controlfile;

  89. ORA-00279: change 1986880 generated at 08/03/2017 10:33:47 needed for thread 1

  90. ORA-00289: suggestion : /u01/app/oracle/arch/arch_1_951042827_1.log

  91. ORA-00280: change 1986880 for thread 1 is in sequence #1

  92. Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

  93. /u01/app/oracle/oradata/OraDB11g/redo01.log (當(dāng)前的日志文件)

  94. ORA-00283: recovery session canceled due to errors

  95. ORA-01244: unnamed datafile(s) added to control file by media recovery

  96. ORA-01110: data file 10: '/u01/app/oracle/oradata/OraDB11g/comsys01.dbf'

  97. (從當(dāng)前的日志文件中,我們發(fā)現(xiàn)了關(guān)于comsys表空間的相關(guān)記錄)

  98. ORA-01112: media recovery not started

  99. 當(dāng)再次使用備份的控制文件做恢復(fù)時(shí),出現(xiàn)如下的錯(cuò)誤提示

  100. SYS@seiang11g>recover database using backup controlfile;

  101. ORA-00283: recovery session canceled due to errors

  102. ORA-01111: name for data file 10 is unknown - rename to correct file

  103. ORA-01110: data file 10: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00010'

  104. ORA-01157: cannot identify/lock data file 10 - see DBWR trace file

  105. ORA-01111: name for data file 10 is unknown - rename to correct file

  106. ORA-01110: data file 10: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00010'

  107. --查看控制文件和數(shù)據(jù)文件頭,有了關(guān)于comsys表空間的相關(guān)記錄

  108. SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile;

  109.      FILE# CHECKPOINT_CHANGE# NAME

  110. ---------- ------------------ --------------------------------------------------

  111.          1            1986883 /u01/app/oracle/oradata/OraDB11g/system01.dbf

  112.          2            1986883 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf

  113.          3            1986883 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf

  114.          4            1986883 /u01/app/oracle/oradata/OraDB11g/users01.dbf

  115.          5            1986883 /u01/app/oracle/oradata/OraDB11g/example01.dbf

  116.          6            1986883 /u01/app/oracle/oradata/OraDB11g/rman01.dbf

  117.          7            1986883 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf

  118.          8            1986883 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf

  119.          9            1986883 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf

  120.         10            1988334 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAME

  121.                               D00010

  122. SYS@seiang11g>select file#,checkpoint_change#,name from v$datafile_header;

  123.      FILE# CHECKPOINT_CHANGE# NAME

  124. ---------- ------------------ --------------------------------------------------

  125.          1            1988336 /u01/app/oracle/oradata/OraDB11g/system01.dbf

  126.          2            1988336 /u01/app/oracle/oradata/OraDB11g/sysaux01.dbf

  127.          3            1988336 /u01/app/oracle/oradata/OraDB11g/undotbs01.dbf

  128.          4            1988336 /u01/app/oracle/oradata/OraDB11g/users01.dbf

  129.          5            1988336 /u01/app/oracle/oradata/OraDB11g/example01.dbf

  130.          6            1988336 /u01/app/oracle/oradata/OraDB11g/rman01.dbf

  131.          7            1988336 /u01/app/oracle/oradata/OraDB11g/seiang01.dbf

  132.          8            1988336 /u01/app/oracle/oradata/OraDB11g/wjq01.dbf

  133.          9            1988336 /u01/app/oracle/oradata/OraDB11g/wjqbest01.dbf

  134.         10                  0

  135. --創(chuàng)建數(shù)據(jù)文件,并對(duì)控制文件中記錄未知的數(shù)據(jù)文件重命名

  136. SYS@seiang1

    新聞名稱(chēng):Oracle如何使用備份控制文件
    轉(zhuǎn)載來(lái)源:http://m.newbst.com/article14/gpijde.html

    成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標(biāo)簽優(yōu)化手機(jī)網(wǎng)站建設(shè)微信公眾號(hào)用戶(hù)體驗(yàn)建站公司網(wǎng)站設(shè)計(jì)

    廣告

    聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)