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. SPFILE
- CreatePfile ='/Home/Oracle/dba/pfile_before_recover_dg.ora' FromSpfile;
-
- -Rw-r-- R -- 1 oracle oinstall 1496 11-14 pfile_before_recover_dg.ora
- Drwxr-xr-x 2 oracle oinstall 4096 11-14 spfile
- Drwxr-xr-x 2 oracle oinstall 4096 06-01 expdata
- Drwxr-xr-x 2 oracle oinstall 4096 script
- [Oracle @ L-DB-163-18 dba] $ more *. ora
- MYPORT. _ db_cache_size = 3741319168
- MYPORT. _ Java _pool_size = 16777216
- MYPORT. _ large_pool_size = 16777216
- MYPORT. _ shared_pool_size = 805306368
- MYPORT. _ streams_pool_size = 0
- *. Audit_file_dest ='/U01/app/oracle/admin/MYPORT/adump'
- *. Background_dump_dest ='/U01/app/oracle/admin/MYPORT/bdump'
- *. Compatible ='10. 2.0.3.0'
- *. Control_files ='/U01/datafile/control01.ctl','/U01/datafile/control02.ctl'# Restore Controlfile
- *. Core_dump_dest ='/U01/app/oracle/admin/MYPORT/cdump'
- *. Db_block_size = 8192
- *. Db_domain =''
- *. Db_file_multiblock_read_count = 32
- *. Db_file_name_convert ='+ DATA/MYPORT/datafile','/Oradata/datafile'
- *. Db_name ='Myport'
- *. Db_unique_name ='Standby'
- *. Dispatchers =''
- *. Fal_client ='Standby'
- *. Fal_server ='Myport'
- *. Job_queue_processes = 10
- *. Log_archive_config ='Dg _ CONFIG = (MYPORT, standby )'
- *. Log_archive_dest_1 ='Location =/u01/archive valid_for = (all_logfiles, all_roles) db_unique_name = standby'
- *. Log_archive_dest_2 ='Service = MYPORT lgwr async valid_for = (online_logfiles, primary_role) db_unique_name = myport'
- *. Log_archive_dest_state_1 ='Enable'
- *. Log_archive_dest_state_2 ='Enable'
- *. Log_archive_max_processes = 4
- *. Log_file_name_convert ='+ DATA/MYPORT/onlinelog','/U01/datafile'
- *. Open_cursors = 1000
- *. Pga_aggregate_target = 1092957696
- *. Processses = 1000
- *. Remote_login_passwordfile ='Exclusion'
- *. Sessions = 885
- *. Sga_max_size = 4589934592
- *. Sga_target = 4589934592
- *. Shared_servers = 0
- *. Standby_file_management ='Auto'
- *. Undo_management ='Auto'
- *. Undo_tablespace ='Undotbs1'
- *. User_dump_dest ='/U01/app/oracle/admin/MYPORT/udump'
- [Oracle @ L-DB-163-18 dba] $
-
- 2. view online logs
- Cd/u01/datafile
- [Oracle @ L-DB-163-18 dba] $ cd/u01/datafile
- [Oracle @ L-DB-163-18 datafile] $ ls-lt
- Total 1474052
- -Rw-r----- 1 oracle oinstall 19873792 11-14 control01.ctl
- -Rw-r----- 1 oracle oinstall 19873792 11-14 control02.ctl
- -Rw-r----- 1 oracle oinstall 104858112 11-14 stand03.log
- -Rw-r----- 1 oracle oinstall 104858112 11-14 stand01.log
- -Rw-r----- 1 oracle oinstall 104858112 11-14 stand02.log
- -Rw-r----- 1 oracle oinstall 104858112 11-14 stand04.log
- -Rw-r----- 1 oracle oinstall 104858112 11-11 stand05.log
- -Rw-r----- 1 oracle oinstall 104858112 11-11 stand06.log
- -Rw-r----- 1 oracle oinstall 20979712 07-14 temp01.dbf
- -Rw-r----- 1 oracle oinstall 104858112 07-14 group_4.270.697238219
- -Rw-r----- 1 oracle oinstall 104858112 07-14 group_4.271.697238221
- -Rw-r----- 1 oracle oinstall 104858112 07-14 group_3.268.697238217
- -Rw-r----- 1 oracle oinstall 104858112 07-14 group_3.269.697238219
- -Rw-r----- 1 oracle oinstall 104858112 07-14 group_2.264.697238179
- -Rw-r----- 1 oracle oinstall 104858112 07-14 group_2.265.697238179
- -Rw-r----- 1 oracle oinstall 104858112 07-14 group_1.262.697238177
- -Rw-r----- 1 oracle oinstall 104858112 07-14 group_1.263.697238177
- [Oracle @ L-DB-163-18 datafile] $
-
- 3. View data files
- [Oracle @ L-DB-163-18 datafile] $ cd/oradata/datafile
- [Oracle @ L-DB-163-18 datafile] $ ls-lt
- Total 235078392
- -Rw-r----- 1 oracle oinstall 134225920 11-14 bbcled_data.588.7273820.5.dbf
- -Rw-r----- 1 oracle oinstall 16106135552 11-14 auditbbc.882.710070905.dbf
- -Rw-r----- 1 oracle oinstall 13631496192 11-14 eport_data.522.736786031.dbf
- -Rw-r----- 1 oracle oinstall 268443648 11-14 eport_index.779.736786171.dbf
- -Rw-r----- 1 oracle oinstall 26346135552 11-14 in_bbc_data.291.730331961.dbf
- -Rw-r----- 1 oracle oinstall 10737426432 11-14 in_bbc_data.752.758820.65
- -Rw-r----- 1 oracle oinstall 5368717312 11-14 in_bbc_index.869.729797303.dbf
- -Rw-r----- 1 oracle oinstall 536879104 11-14 inman_data.617.718999513.dbf
- -Rw-r----- 1 oracle oinstall 134225920 11-14 inman_index.723.718999521.dbf
- -Rw-r----- 1 oracle oinstall 268443648 11-14 in_man_index.885.729797313.dbf
- -Rw-r----- 1 oracle oinstall 34358697984 11-14 in_hangzhou_data.362.747696959.dbf
- -Rw-r----- 1 oracle oinstall 10737426432 11-14 in_hangzhou_data.740.758652903
- -Rw-r----- 1 oracle oinstall 8388616192 11-14 in_hangzhou_index.821.729797323.dbf
- -Rw-r----- 1 oracle oinstall 104865792 11-14 in_xian_index.663.747696899.dbf
- -Rw-r----- 1 oracle oinstall 268443648 11-14 in_xian_index.724.729797333.dbf
- -Rw-r----- 1 oracle oinstall 34359730176 11-14 hangzhou.451.709317119.dbf
- -Rw-r----- 1 oracle oinstall 2147491840 11-14 sysaux.257.697238119.dbf
- -Rw-r----- 1 oracle oinstall 5368717312 11-14 system.256.697238117.dbf
- -Rw-r----- 1 oracle oinstall 1056768 11-14 tbs_catalog.791.752426905.dbf
- -Rw-r----- 1 oracle oinstall 1073750016 11-14 tbs_catalog.891.710434097.dbf
- -Rw-r----- 1 oracle oinstall 209723392 11-14 ts_test.348.704715437.dbf
- -Rw-r----- 1 oracle oinstall 7225745408 11-14 undotbs1.258.697238119.dbf
- -Rw-r----- 1 oracle oinstall 4294975488 11-14 undotbs2.267.697238205.dbf
- -Rw-r----- 1 oracle oinstall 34304827392 11-14 users.259.697238119.dbf
- -Rw-r----- 1 oracle oinstall 23571996672 11-14 users.604.752426949.dbf
- -Rw-r----- 1 oracle oinstall 536879104 11-14 xian.880.711538313.dbf