primary db was in no force logging mode :(
On standby db appears ORA-26040. So I'm trying to resync primary and standby db.
I'm doing these steps:
SQL> alter database force logging;
SQL> alter system archive log current;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL IMMEDIATE;
SQL> SELECT MIN(FIRST_NONLOGGED_SCN) FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN>0;
-- got some SCN
RMAN> BACKUP INCREMENTAL FROM SCN <I've got from 2nd step> DATABASE FORMAT '/FRA/tmp/ForStandby_%U' tag 'FOR STANDBY';
4. copy backupsets from primary to standby
RMAN> CATALOG START WITH '/FRA/tmp/ForStandby_';
RMAN> RECOVER DATABASE NOREDO;
6. check standby:
SQL> SELECT FILE#, FIRST_NONLOGGED_SCN FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN > 0;
-- here must be no rows, BUT instead of I've got SCN. This SCN greater than SCN form 1st step, but still it here!
Why? What I did wrong?
Edited by: bas_ua on 15.02.2013 12:05
Edited by: bas_ua on 15.02.2013 12:06
Is it possible that your Primary does not have forced logging on?
SELECT force_logging FROM v$database;
My friend CPKT has a good note on a roll forward here :
in general, it looks like FORCE NOLOGGING mode doesn't turned on (but it turned). Because after steps I posted, FIRST_NONLOGGED_SCN changed to greater value, and difference between it and current_scn on primary DB much shorter.
So, I'd say that while I doing incremental backup and restoring it on standby db, NOLOGGING operations continue playing on primary db, so by the time I mount standby I have new FIRST_NONLOGGED_SCN.
I read somewhere, can't remeber exactly, but something like 'alter database force logging waits nologging operation to complete'. Is it possible that I need to restart primary db in turn to FORCE LOGGING mode take effect?
rman report unrecoverable command on primary db showed almost all users datafiles.
So I made full backup of primary db, and then just run duplicate target for stadby.
I know that's not prity well practice for large databases, but it solved the problem.