Академический Документы
Профессиональный Документы
Культура Документы
http://arup.blogspot.in/2009/12/resolving-gaps-in-data-guard-apply.html 1/7
Resolving Gaps in Data Guard Apply Using Incremental RMAN
BAckup
Recently, we had a glitch on a Data Guard (physical standby database) on infrastructure.
This is not a critical database; so the monitoring was relatively lax. And that being done by
an outsourcer does not help it either. In any case, the laxness resulted in a failure remaining
undetected for quite some time and it was eventually discovered only when the customer
complained. This standby database is usually opened for read only access from time
totime.This time, however, the customer saw that the data was significantly out of sync
with primary and raised a red flag. Unfortunately, at this time it had become a rather
political issue.
Since the DBA in charge couldnt resolve the problem, I was called in. In this post, I will
describe the issue and how it was resolved. In summary, there are two parts of the problem:
(1) What happened
(2) How to fix it
What Happened
Lets look at the first question what caused the standby to lag behind. First, I looked for
the current SCN numbers of the primary and standby databases. On the primary:
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
1447102
On the standby:
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
1301571
Clearly there is a difference. But this by itself does not indicate a problem; since the standby
is expected to lag behind the primary (this is an asynchronous non-real time apply setup).
The real question is how much it is lagging in the terms of wall clock. To know that I used
the scn_to_timestamp function to translate the SCN to a timestamp:
SQL> select scn_to_timestamp(1447102) from dual;
SCN_TO_TIMESTAMP(1447102)
-------------------------------
18-DEC-09 08.54.28.000000000 AM
I ran the same query to know the timestamp associated with the SCN of the standby
8/24/2014 The Arup Nanda Blog: Resolving Gaps in Data Guard Apply Using Incremental RMAN BAckup
http://arup.blogspot.in/2009/12/resolving-gaps-in-data-guard-apply.html 2/7
database as well (note, I ran it on the primary database, though; since it will fail in the
standby in a mounted mode):
SQL> select scn_to_timestamp(1301571) from dual;
SCN_TO_TIMESTAMP(1301571)
-------------------------------
15-DEC-09 07.19.27.000000000 PM
This shows that the standby is two and half days lagging! The data at this point is not just
stale; it must be rotten.
The next question is why it would be lagging so far back in the past. This is a 10.2 database
where FAL server should automatically resolved any gaps in archived logs. Something must
have happened that caused the FAL (fetch archived log) process to fail. To get that answer,
first, I checked the alert log of the standby instance. I found these lines that showed the
issue clearly: