In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces how to resynchronize physical standby under the missing DG archive scenario, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.
one。 Scene description
Due to the loss of the archive log, the physical slave MRP process cannot synchronize with the main database.
SQL > select thread#, max (sequence#) "Last Standby Seq Received"
2 from v$archived_log val, v$database vdb
3 whereval.resetlogs_change# = vdb.resetlogs_change#
4 group by thread# order by 1
THREAD# Last Standby Seq Received
--
1 1121
2 1143
SQL > select thread#, max (sequence#) "Last Standby Seq Applied"
2 from v$archived_log val, v$database vdb
3 whereval.resetlogs_change# = vdb.resetlogs_change#
4 and val.applied in ('YES','IN-MEMORY')
5 group by thread# order by 1
THREAD# Last Standby Seq Applied
-
1 882
2 853
two。 Using the incremental backup of the main library for backup recovery
1. Query the repository SCN
SQL > SELECT CURRENT_SCN FROM V$DATABASE
SQL > select min (fhscn) from xampkcvfh;-- recommended
MIN (FHSCN)
-
41888422
two。 Read-only tablespace processing
If there is a read-only tablespace, you need to execute the following command in the main library:
SQL > alter tablespace xxx read write
SQL > alter tablespace xxx read only
3. Perform incremental backups in the main database according to the standby database SCN
RMAN > BACKUP INCREMENTAL FROM SCN 41888422 DATABASE FORMAT'/ tmp/ForStandby_%U' tag 'FORSTANDBY'
Starting backup at 2018-03-30 15:38:47
Using target database control file instead of recovery catalog
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID=39 instance=racdb12c1 device type=DISK
Channel ORA_DISK_1: starting full datafile backup set
Channel ORA_DISK_1: specifying datafile (s) in backup set
Input datafile file number=00006 name=+DGDATA1/RACDB12C/DATAFILE/ees_dat01.dbf
Input datafile file number=00007 name=+DGDATA2/RACDB12C/DATAFILE/ees_idx01.dbf
Input datafile file number=00002 name=+DGSYSTEM/RACDB12C/DATAFILE/sysaux.272.960743041
Input datafile file number=00001 name=+DGSYSTEM/RACDB12C/DATAFILE/system.271.960743017
Input datafile file number=00008 name=+DGDATA1/racdb12c/datafile/ees_idx02.dbf
Input datafile file number=00009 name=+DGDATA1/racdb12c/datafile/ees_idx03.dbf
Input datafile file number=00003 name=+DGSYSTEM/RACDB12C/DATAFILE/undotbs1.273.960743055
Input datafile file number=00004 name=+DGSYSTEM/RACDB12C/DATAFILE/undotbs2.275.960743081
Input datafile file number=00005 name=+DGSYSTEM/RACDB12C/DATAFILE/users.276.960743083
Channel ORA_DISK_1: starting piece 1 at 2018-03-30 15:38:52
Channel ORA_DISK_1: finished piece 1 at 2018-03-30 15:45:50
Piece handle=/tmp/ForStandby_5fsv3e4b_1_1 tag=FORSTANDBY comment=NONE
Channel ORA_DISK_1: backup set complete, elapsed time: 00:06:58
Channel ORA_DISK_1: starting full datafile backup set
Channel ORA_DISK_1: specifying datafile (s) in backup set
Including current control file in backup set
Channel ORA_DISK_1: starting piece 1 at 2018-03-30 15:45:58
Channel ORA_DISK_1: finished piece 1 at 2018-03-30 15:46:05
Piece handle=/tmp/ForStandby_5gsv3ehf_1_1 tag=FORSTANDBY comment=NONE
Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 2018-03-30 15:46:05
4. Copy the backup files to the standby library and register them
Scp root@rac1:/tmp/ForStandby_5fsv3e4b_1_1 / tmp
Scp root@rac1:/tmp/ForStandby_5gsv3ehf_1_1 / tmp
Catalog backuppiece'/ tmp/ForStandby_5fsv3e4b_1_1'
Catalog backuppiece'/ tmp/ForStandby_5gsv3ehf_1_1'
-confirm
List backup
BS Key Type LV Size Device Type Elapsed Time Completion Time
12 Incr 1.96G DISK 00:06:55 2018-03-30 15:45:46
BP Key: 12 Status: AVAILABLE Compressed: NO Tag: FORSTANDBY
Piece Name: / tmp/ForStandby_5fsv3e4b_1_1
List of Datafiles in backup set 12
File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name
1 Incr 52145113 2018-03-30 15:38:52 NO / oradata/racdb12cdg/datafilesys/datafile/system.271.960743017
2 Incr 52145113 2018-03-30 15:38:52 NO / oradata/racdb12cdg/datafilesys/datafile/sysaux.272.960743041
3 Incr 52145113 2018-03-30 15:38:52 NO / oradata/racdb12cdg/datafilesys/datafile/undotbs1.273.960743055
4 Incr 52145113 2018-03-30 15:38:52 NO / oradata/racdb12cdg/datafilesys/datafile/undotbs2.275.960743081
5 Incr 52145113 2018-03-30 15:38:52 NO / oradata/racdb12cdg/datafilesys/datafile/users.276.960743083
6 Incr 52145113 2018-03-30 15:38:52 NO / oradata/racdb12cdg/datafileuser/datafile/ees_dat01.dbf
7 Incr 52145113 2018-03-30 15:38:52 NO / oradata/racdb12cdg/datafileuser/datafile/ees_idx01.dbf
8 Incr 52145113 2018-03-30 15:38:52 NO / oradata/racdb12cdg/datafileuser/datafile/ees_idx02.dbf
9 Incr 52145113 2018-03-30 15:38:52 NO / oradata/racdb12cdg/datafileuser/datafile/ees_idx03.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
13 Incr 46.50m DISK 00:00:08 2018-03-30 15:45:59
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: FORSTANDBY
Piece Name: / tmp/ForStandby_5gsv3ehf_1_1
Control File Included: Ckp SCN: 52146933 Ckp time: 2018-03-30 15:45:51
5. Restore standby controlfile
(1)。 Start standby to nomount status
Startup nomount
(2)。 Backup backup database control files
Cp / oradata/control_file/control01.ctl / oradata/control_file/control01.ctl.bak
(3)。 Restore control file
Restore standby controlfile to'/ oradata/control_file/control01.ctl' from'/ tmp/ForStandby_5gsv3ehf_1_1'
(4)。 View the contents of the recovery control file
Alter database backup controlfile to trace
* since the control file is recovered from the main library, you need to confirm whether the file names of the relevant files are consistent, and the relevant command:
SELECT a.FILE#, a.NAME,a.CHECKPOINT_CHANGE#,a.LAST_CHANGE#,status FROM v$datafile a
Alter system set standby_file_management=manual
Alter database rename file 'file_name' to' file_name'
6. Apply incremental backup to the standby database
RMAN > RECOVER DATABASE NOREDO
Starting recover at 2018-03-30 16:00:23
Using target database control file instead of recovery catalog
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID=22 device type=DISK
Channel ORA_DISK_1: starting incremental datafile backup set restore
Channel ORA_DISK_1: specifying datafile (s) to restore from backup set
Destination for restore of datafile 00001: / oradata/racdb12cdg/datafilesys/datafile/system.271.960743017
Destination for restore of datafile 00002: / oradata/racdb12cdg/datafilesys/datafile/sysaux.272.960743041
Destination for restore of datafile 00003: / oradata/racdb12cdg/datafilesys/datafile/undotbs1.273.960743055
Destination for restore of datafile 00004: / oradata/racdb12cdg/datafilesys/datafile/undotbs2.275.960743081
Destination for restore of datafile 00005: / oradata/racdb12cdg/datafilesys/datafile/users.276.960743083
Destination for restore of datafile 00006: / oradata/racdb12cdg/datafileuser/datafile/ees_dat01.dbf
Destination for restore of datafile 00007: / oradata/racdb12cdg/datafileuser/datafile/ees_idx01.dbf
Destination for restore of datafile 00008: / oradata/racdb12cdg/datafileuser/datafile/ees_idx02.dbf
Destination for restore of datafile 00009: / oradata/racdb12cdg/datafileuser/datafile/ees_idx03.dbf
Channel ORA_DISK_1: reading from backup piece / tmp/ForStandby_5fsv3e4b_1_1
Channel ORA_DISK_1: piece handle=/tmp/ForStandby_5fsv3e4b_1_1 tag=FORSTANDBY
Channel ORA_DISK_1: restored backup piece 1
Channel ORA_DISK_1: restore complete, elapsed time: 00:00:55
Finished recover at 2018-03-30 16:01:21
7. confirm
Confirm the master / slave library SCN, and start the MRP process. If the synchronization continues successfully, the task is completed.
This is the end of how to resynchronize physical standby in the case of missing DG archives. I hope the above content can be helpful to you and learn more. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.