Quantcast
Channel: Thinking Out Loud
Viewing all articles
Browse latest Browse all 666

Rolling forward a standby database using RMAN Incremental Backup

$
0
0

I am not going to post on how to roll forward standby database as it has been written in many blogs already.

Instead, I am going to share what I have learned how it may have been done incorrectly using the wrong SCN.

Typically, select current_scn from v$database should work until it doesn’t.

But why take the chance and why not do it right the first time.

In reviewing Steps to perform for Rolling forward a standby database using RMAN Incremental Backup. (Doc ID 836986.1)

SQL> select current_scn from v$database;

-- If no READ ONLY Tablespaces/datafiles in database use
-- Both should be the same
SQL> select min(fhscn) from x$kcvfh;
OR
SQL> select min(checkpoint_change#) from v$datafile_header;

-- If READ ONLY tablespaced/datafiles in database use
SQL> select min(f.fhscn) from x$kcvfh f, v$datafile d where f.hxfil =d.file# and d.enabled != 'READ ONLY';

In ideal situation the above 2 queries will return the almost same SCN.
However if there is huge difference its better to take backup using the SCN from second or third query (lesser SCN), as one of the datafile may be behind.

Here is a demo:

SYS@san> select current_scn from v$database;
----------------
1005703

SYS@san> select min(fhscn) from x$kcvfh;

MIN(FHSCN)
—————-
1004302

SYS@san> select min(checkpoint_change#) from v$datafile_header;

MIN(CHECKPOINT_CHANGE#)
———————–
1004302

SYS@san> select min(f.fhscn) from x$kcvfh f, v$datafile d where f.hxfil =d.file# and d.enabled != ‘READ ONLY’;

MIN(F.FHSCN)
—————-
1004302

SYS@san>



Viewing all articles
Browse latest Browse all 666

Trending Articles