On this simple article, I am going to show you how to recreate and fix a simple standby database, not using data guard feature, using an incremental backup.
Initially, if database is not open, so, open the database in READ ONLY mode. On standby, do that:
SQL> startup nomount;
SQL> alter database mount standby database;
SQL> alter database open read only;
Now, we need to find the latest standby SCN, to have an initial point to take the incremental backup. On standby, do that:
SQL> SELECT to_char(Current_scn, '9999999999999999') FROM V$DATABASE;
10925472277
With SCN found, lets take an incremental backup from primary, changing the SCN value:
RMAN> run {
allocate channel d1 type disk FORMAT '/orabackup/dbprod/forstandby/ForStandby_%U' maxpiecesize 3000M;
BACKUP INCREMENTAL FROM SCN 10925472277 database format '/orabackup/dbprod/forstandby/ForStandby_%U' tag 'FORSTANDBY';
BACKUP CURRENT CONTROLFILE FOR STANDBY FORMAT '/orabackup/dbprod/forstandby/ForStandbyCTRL.bck';
}
Send the RMAN backup files, to standby server. You can do that using scp command.
After, sent the files, let’s start the standby database in MOUNT mode to start the recover. In standby database, do that:
SQL> shutdown immediate;
SQL> startup nomount;
SQL> alter database mount standby database;
To make the recover possible, using the incremental backup files, we need to make the standby database aware about the backups files. To this, we need catalog the backup files. On RMAN and on standby server:
RMAN> CATALOG START WITH '/orabackup/fisico/';
Now, we can start the recover:
RMAN> RECOVER DATABASE NOREDO;
Execute the controlfile restore. To do that, the standby database need to be started in NOMOUNT mode:
RMAN> SHUTDOWN IMMEDIATE;
RMAN> STARTUP NOMOUNT;
RMAN> RESTORE STANDBY CONTROLFILE FROM '/orabackup/fisico/ForStandbyCTRL.bck';
Generate the last archivelog from primary:
SQL> alter system switch logfile;
Copy the archive file to archivelog dest on standby server.
Execute the recover on standby database:
SQL> alter database mount standby database;
SQL> recover automatic standby database;
Finally, after to apply all necessary archivelogs, check the database integrity, opening in READ ONLY mode:
SQL> alter database open read only;