Use incremental backup to restore the DG of the archive GAP

Source: Internet
Author: User

DBAs often hear that archiving logs and master databases are not synchronized because of inadequate monitoring of mongouard. what's even worse is that the master database usually has RMAN backup,

Archive logs are usually deleted after full-database backup is complete. In this case, it is found that many DBAs will start to recover from the full backup of the master database to the slave database,

When it comes to small databases, it is often unfortunate for databases with hundreds of gigabytes or terabytes of data, because the data copy time is quite long.

In fact, the gap between the slave database SCN and the master database is not big. It can also be understood as the DG with few gaps in the archive (for example, one of our databases has been online for one year, there is no synchronization gap in a month ),

There is no need to reply to the entire database. In this case, incremental recovery can quickly solve the problem. The following is a specific operation of the author.

Fault symptom:

Because the master database needs to migrate historical data on Saturday, DBA actively stops archive synchronization with the slave database. The tragedy is that the master database had a full-Database Backup action in the early morning of Sunday,

After the backup is complete, all the archives are deleted, which results in the loss of this part of the archive, from the inventory in the GAP. DBA intends to redo DG and applied for

8 hours in the evening, because data backup and migration takes 5 hours, the implementation and test plan is completed in 3 hours. The author analyzes few lost logs and immediately stops them.

This implementation application requires DBA to use the incremental recover (incremental Backup Recovery) method to synchronize the master database and slave database,

First, determine the current scn of the slave database. Then, execute incremental backup on the master database, upload the backup to the slave database, and use the recover noredo method to restore the slave database.

It turns out that this method is completely feasible.

The specific implementation is as follows.

I. Implementation preparation (confirmation of key data from the database)

  1. 1. SPFILE
  2. CreatePfile ='/Home/Oracle/dba/pfile_before_recover_dg.ora' FromSpfile;
  3.  
  4. -Rw-r-- R -- 1 oracle oinstall 1496 11-14 pfile_before_recover_dg.ora 
  5. Drwxr-xr-x 2 oracle oinstall 4096 11-14 spfile
  6. Drwxr-xr-x 2 oracle oinstall 4096 06-01 expdata
  7. Drwxr-xr-x 2 oracle oinstall 4096 script
  8. [Oracle @ L-DB-163-18 dba] $ more *. ora
  9. MYPORT. _ db_cache_size = 3741319168
  10. MYPORT. _ Java _pool_size = 16777216
  11. MYPORT. _ large_pool_size = 16777216
  12. MYPORT. _ shared_pool_size = 805306368
  13. MYPORT. _ streams_pool_size = 0
  14. *. Audit_file_dest ='/U01/app/oracle/admin/MYPORT/adump' 
  15. *. Background_dump_dest ='/U01/app/oracle/admin/MYPORT/bdump' 
  16. *. Compatible ='10. 2.0.3.0' 
  17. *. Control_files ='/U01/datafile/control01.ctl','/U01/datafile/control02.ctl'# Restore Controlfile
  18. *. Core_dump_dest ='/U01/app/oracle/admin/MYPORT/cdump' 
  19. *. Db_block_size = 8192
  20. *. Db_domain ='' 
  21. *. Db_file_multiblock_read_count = 32
  22. *. Db_file_name_convert ='+ DATA/MYPORT/datafile','/Oradata/datafile' 
  23. *. Db_name ='Myport' 
  24. *. Db_unique_name ='Standby' 
  25. *. Dispatchers ='' 
  26. *. Fal_client ='Standby' 
  27. *. Fal_server ='Myport' 
  28. *. Job_queue_processes = 10
  29. *. Log_archive_config ='Dg _ CONFIG = (MYPORT, standby )' 
  30. *. Log_archive_dest_1 ='Location =/u01/archive valid_for = (all_logfiles, all_roles) db_unique_name = standby' 
  31. *. Log_archive_dest_2 ='Service = MYPORT lgwr async valid_for = (online_logfiles, primary_role) db_unique_name = myport' 
  32. *. Log_archive_dest_state_1 ='Enable' 
  33. *. Log_archive_dest_state_2 ='Enable' 
  34. *. Log_archive_max_processes = 4
  35. *. Log_file_name_convert ='+ DATA/MYPORT/onlinelog','/U01/datafile' 
  36. *. Open_cursors = 1000
  37. *. Pga_aggregate_target = 1092957696
  38. *. Processses = 1000
  39. *. Remote_login_passwordfile ='Exclusion' 
  40. *. Sessions = 885
  41. *. Sga_max_size = 4589934592
  42. *. Sga_target = 4589934592
  43. *. Shared_servers = 0
  44. *. Standby_file_management ='Auto' 
  45. *. Undo_management ='Auto' 
  46. *. Undo_tablespace ='Undotbs1' 
  47. *. User_dump_dest ='/U01/app/oracle/admin/MYPORT/udump' 
  48. [Oracle @ L-DB-163-18 dba] $
  49.  
  50. 2. view online logs
  51. Cd/u01/datafile
  52. [Oracle @ L-DB-163-18 dba] $ cd/u01/datafile
  53. [Oracle @ L-DB-163-18 datafile] $ ls-lt
  54. Total 1474052
  55. -Rw-r----- 1 oracle oinstall 19873792 11-14 control01.ctl 
  56. -Rw-r----- 1 oracle oinstall 19873792 11-14 control02.ctl 
  57. -Rw-r----- 1 oracle oinstall 104858112 11-14 stand03.log 
  58. -Rw-r----- 1 oracle oinstall 104858112 11-14 stand01.log 
  59. -Rw-r----- 1 oracle oinstall 104858112 11-14 stand02.log 
  60. -Rw-r----- 1 oracle oinstall 104858112 11-14 stand04.log 
  61. -Rw-r----- 1 oracle oinstall 104858112 11-11 stand05.log 
  62. -Rw-r----- 1 oracle oinstall 104858112 11-11 stand06.log 
  63. -Rw-r----- 1 oracle oinstall 20979712 07-14 temp01.dbf 
  64. -Rw-r----- 1 oracle oinstall 104858112 07-14 group_4.270.697238219 
  65. -Rw-r----- 1 oracle oinstall 104858112 07-14 group_4.271.697238221 
  66. -Rw-r----- 1 oracle oinstall 104858112 07-14 group_3.268.697238217 
  67. -Rw-r----- 1 oracle oinstall 104858112 07-14 group_3.269.697238219 
  68. -Rw-r----- 1 oracle oinstall 104858112 07-14 group_2.264.697238179 
  69. -Rw-r----- 1 oracle oinstall 104858112 07-14 group_2.265.697238179 
  70. -Rw-r----- 1 oracle oinstall 104858112 07-14 group_1.262.697238177 
  71. -Rw-r----- 1 oracle oinstall 104858112 07-14 group_1.263.697238177 
  72. [Oracle @ L-DB-163-18 datafile] $
  73.  
  74. 3. View data files
  75. [Oracle @ L-DB-163-18 datafile] $ cd/oradata/datafile
  76. [Oracle @ L-DB-163-18 datafile] $ ls-lt
  77. Total 235078392
  78. -Rw-r----- 1 oracle oinstall 134225920 11-14 bbcled_data.588.7273820.5.dbf 
  79. -Rw-r----- 1 oracle oinstall 16106135552 11-14 auditbbc.882.710070905.dbf 
  80. -Rw-r----- 1 oracle oinstall 13631496192 11-14 eport_data.522.736786031.dbf 
  81. -Rw-r----- 1 oracle oinstall 268443648 11-14 eport_index.779.736786171.dbf 
  82. -Rw-r----- 1 oracle oinstall 26346135552 11-14 in_bbc_data.291.730331961.dbf 
  83. -Rw-r----- 1 oracle oinstall 10737426432 11-14 in_bbc_data.752.758820.65 
  84. -Rw-r----- 1 oracle oinstall 5368717312 11-14 in_bbc_index.869.729797303.dbf 
  85. -Rw-r----- 1 oracle oinstall 536879104 11-14 inman_data.617.718999513.dbf 
  86. -Rw-r----- 1 oracle oinstall 134225920 11-14 inman_index.723.718999521.dbf 
  87. -Rw-r----- 1 oracle oinstall 268443648 11-14 in_man_index.885.729797313.dbf 
  88. -Rw-r----- 1 oracle oinstall 34358697984 11-14 in_hangzhou_data.362.747696959.dbf 
  89. -Rw-r----- 1 oracle oinstall 10737426432 11-14 in_hangzhou_data.740.758652903 
  90. -Rw-r----- 1 oracle oinstall 8388616192 11-14 in_hangzhou_index.821.729797323.dbf 
  91. -Rw-r----- 1 oracle oinstall 104865792 11-14 in_xian_index.663.747696899.dbf 
  92. -Rw-r----- 1 oracle oinstall 268443648 11-14 in_xian_index.724.729797333.dbf 
  93. -Rw-r----- 1 oracle oinstall 34359730176 11-14 hangzhou.451.709317119.dbf 
  94. -Rw-r----- 1 oracle oinstall 2147491840 11-14 sysaux.257.697238119.dbf 
  95. -Rw-r----- 1 oracle oinstall 5368717312 11-14 system.256.697238117.dbf 
  96. -Rw-r----- 1 oracle oinstall 1056768 11-14 tbs_catalog.791.752426905.dbf 
  97. -Rw-r----- 1 oracle oinstall 1073750016 11-14 tbs_catalog.891.710434097.dbf 
  98. -Rw-r----- 1 oracle oinstall 209723392 11-14 ts_test.348.704715437.dbf 
  99. -Rw-r----- 1 oracle oinstall 7225745408 11-14 undotbs1.258.697238119.dbf 
  100. -Rw-r----- 1 oracle oinstall 4294975488 11-14 undotbs2.267.697238205.dbf 
  101. -Rw-r----- 1 oracle oinstall 34304827392 11-14 users.259.697238119.dbf 
  102. -Rw-r----- 1 oracle oinstall 23571996672 11-14 users.604.752426949.dbf 
  103. -Rw-r----- 1 oracle oinstall 536879104 11-14 xian.880.711538313.dbf 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.