Академический Документы
Профессиональный Документы
Культура Документы
2. Stop the managed recovery processes on the physical standby database.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
NOTE: If using broker, you will need to stop MRP through DGMGRL. I.e.:
12 rows selected.
4. Note the current SCN of the physical standby database. This is required to
determine, in a later step, if new data files were added to the primary
database.
Query the V$DATABASE view to obtain the current SCN using the following command:
SQL> col CURRENT_SCN for 9999999999999999999999
SQL> SELECT CURRENT_SCN FROM V$DATABASE;
CURRENT_SCN
-----------------------
11057448269019;
5. The RECOVER … FROM SERVICE command refreshes the standby data files
and rolls them forward to the same point-in-time as the primary. (Action on
standby)
6. Lets check the SCNs of the datafiles at primary and standby now.
Primary
--------
SQL> set linesize 500
SQL> col SUBSTR(HXFNM,1,40) for a41
SQL> select HXFIL File_num,substr(HXFNM,1,40),fhscn from x$kcvfh;
13 rows selected.
Standby
--------
RMAN> select HXFIL File_num,substr(HXFNM,1,40),fhscn from x$kcvfh;
FILE_NUM SUBSTR(HXFNM,1,40) FHSCN
---------- ----------------------------------------- --------------------
1 +DATA/DBG12STB/DATAFILE/system.458.98525 11081227006998
3 +DATA/DBG12STB/DATAFILE/sysaux.459.98525 11081227007089
4 +DATA/DBG12STB/DATAFILE/undotbs1.460.985 11081227011746
5 +DATA/DBG12STB/740468FDDCC102E0E0530A014 1424145
6 +DATA/DBG12STB/740468FDDCC102E0E0530A014 1424145
7 +DATA/DBG12STB/DATAFILE/users.463.985259 11081227012106
15 +DATA/DBG12STB/741BC83F33A50206E0530A014 11081227012161
16 +DATA/DBG12STB/741BC83F33A50206E0530A014 11081227012184
17 +DATA/DBG12STB/741BC83F33A50206E0530A014 11081227012733
18 +DATA/DBG12STB/741BC83F33A50206E0530A014 11081227012753
19 +DATA/DBG12STB/741BC83F33A50206E0530A014 11081227012760
20 +DATA/DBG12STB/741BC83F33A50206E0530A014 11081227012772
12 rows selected.
7. Use the following commands to shut down the standby database and then
start it in NOMOUNT mode.
8. Restore the standby control file by using the control file on the primary
database using service prim.
The following command restores the control file on the physical standby database by
using the primary database control file.
Statement processed
released channel: ORA_DISK_1
9. Update the names of the data files and the temp files in the standby
control file.
*Note: It is recommended to check the incarnation of the primary and
standby prior to continuing:
On standby
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 DBG12 780455898 PARENT 1 01-APR-17
2 2 DBG12 780455898 CURRENT 1395990 22-AUG-18
On Primary
RMAN> list incarnation;
Use the CATALOG command and the SWITCH command to update all the data file names.
RMAN> catalog start with '<path where the actual standby datafile existed>';
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of switch to copy command at 06/10/2019 10:52:08
RMAN-06571: datafile 21 does not have recoverable copy
11. Use the current SCN returned in Step 4 to determine if new data files were
added to the primary database since the standby database was last refreshed. If
yes, these data files need to be restored on the standby from the primary database.
The following example assumes that the CURRENT_SCN returned in Step 6 is 1984232
and lists the data files that were created on the primary after the timestamp
represented by this SCN:
SQL> SELECT file# FROM V$DATAFILE WHERE creation_change# >= 11057448269019;
FILE#
----------
21
If no files are returned in Step 11, then go to Step 13. If one or more files are returned
in Step 11, then restore these data files from the primary database as in step 12.
12. If you are not connected to a recovery catalog, then use the following
commands to restore data files that were added to the primary after the
standby was last refreshed ( assuming datafile 21 added to the primary):
RUN
{
SET NEWNAME FOR DATABASE TO '+DATA/DG12STB';
RESTORE DATAFILE 21 FROM SERVICE DBG12;
}
executing command: SET NEWNAME
RMAN> exit
13 rows selected.
12 rows selected.
Database altered.