Re: Taking Backup from standby database

  • From: Vadim Keylis <vkeylis2009@xxxxxxxxx>
  • To: gogala.mladen@xxxxxxxxx
  • Date: Fri, 2 Dec 2016 16:08:51 -0800

How do you include archive logs when backup is taken from standby?
Executing this command on standby database "BACKUP INCREMENTAL LEVEL 0 TAG
LEVEL_0_20161202_1550 DATABASE plus archivelog ;" fails

Thanks so much in advance,
Vadim

On Thu, Dec 1, 2016 at 11:41 PM, Mladen Gogala <gogala.mladen@xxxxxxxxx>
wrote:

On 12/02/2016 01:09 AM, Vadim Keylis wrote:

Good evening oracle experts. I am having issue activating database
restored using backup taken from standby.
    Our current setup: We have one primary and one standby database. The
standby database is kept in sync with primary using dataguard. We are
currently taking backups from primary. We are want to move backups from
primary to standby database.


I used script bellow to take backup from standby database and then
restored backup on different server. The database was successfully restored
and physical standby. The problem started when I try activating it. I got
the following error
    ORA-01194: file 1 needs more recovery to be consistent
    ORA-01110: data file 1: '+STAGEDATA/SETLR/DATAFILE/sys
tem.5096.929468439'



I will greatly appreciate suggestions on taking backups from standby in
order to restore as primary in case of emergency as well as how to solve
inconsistency error after standby database is activated.

Thanks so much,
Vadim


-------------------------Script to backup from physical standby
-------------------------------------------------
run
{
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO
'/mnt/db_transfer/SETL/rman_backup/ctl/control_%F';
CONFIGURE MAXSETSIZE TO 128 G;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/mnt/db_transfer/SETL/rman_ba
ckup/ctl/snapcf_SETL.f';
ALLOCATE CHANNEL ch1 DEVICE TYPE DISK FORMAT
'/mnt/db_transfer/SETL/rman_backup/db_%d_df_t%t_s%s_p%p_level0';
BACKUP INCREMENTAL LEVEL 0 TAG LEVEL_0_20161201_1526 DATABASE ;
DELETE FORCE NOPROMPT OBSOLETE;
RELEASE CHANNEL ch1;
}



Vadim, in addition to what Don has said, I don't see "RESYNC CATALOG" in
your script, which probably means that you are not using catalog. If you
are taking a backup from the standby DB, you MUST use a catalog. The
explanation is very simple: without catalog, the standby database records
the information about the backup into its control file. That control file
is separate from the primary control file, which means that the primary
knows nothing about the backup taken on standby. The only shared place
where both databases can look for backup is rman catalog.
The use of rman catalog is required for any type of a proxy backup, like
the backup from a storage snapshot or a backup using standby. The rman
catalog used DBID as the primary key, so it will recognize both the primary
database and a standby as the same database and will be able to restore the
primary from a backup taken on the standby.
Oh yes, as Don has said, you really, really want to include archive logs
in the backup.


--
Mladen Gogala
Oracle DBA
Tel: (347) 321-1217

--
//www.freelists.org/webpage/oracle-l



Other related posts: