Backup physical standby delete arch
Hi
I am scheduling hot backup for physical standby, the backup does backup database plus archivelog delete input...
my question is what if there is delay with apply process and the rman job back's up the archive log and removes them before they get aplplied to the standby?
is above described case a vlaid senario ? what can i do to avoid this ?
thanks
you said:
>
consider senario where logs are not shipped due to network issue ... so standby is couple of hours behind ....
and also we loss the primary !! how do you recover the gap between primary and stnadby ?
>
Let us just assume that:
1. Your Network Connection to the Standby interrupts
2. After a while, the Primary gets completely destroyed
Your solution to that would be to ship Archivelogs that you took on the Primary to the Standby? When where the Archivelogs taken?
Regardless of your concrete answer to that: You are encountering loss of transactional data with that 'solution' - the only question is: How much data do you lose?
In other words: This is not really a sensible solution to that assumed scenario.
Instead, the real solution would be to
a) Have multiple Standby Databases
b) Have at least redundant Network Connection to the one Standby
Instead of fixing your dysfunctional solution, you may better put your efforts on the implementation of a functional solution.
At least that is what I would recommend.
Kind regards
Uwe Hesse
http://uhesse.wordpress.com
Edited by: Uwe Hesse on 30.07.2011 22:45
removed the Recover Primary part
Similar Messages
-
Backup Physical Standby (Dataguard) using RMAN : Issues
Hello All,
I am running a RMAN backup on standby server using the command below. The RMAN backup is actually connecting to the primary database on another server, I found this very confusing and to reassure, i shutdown the primary database and ran the backup again. It fails with not able to conenct to target database. Can you please explain?
run {
allocate channel t1 type disk format '/backup/oracle/PRODCDW/RMAN/DBFILES_%d_t%t_s%s_p%p';
allocate channel t2 type disk format '/backup/oracle/PRODCDW/RMAN/DBFILES_%d_t%t_s%s_p%p';
recover copy of database with tag 'STDBY_PRODCDW';
backup as compressed backupset format '/backup/oracle/PRODCDW/RMAN/DBFILES_%d_t%t_s%s_p%p' tag 'STDBY_PRODCDW' incremental level 1 for recover of copy with tag 'STDBY_PRODCDW' database plus archivelog delete input;
}I am not doing the image copy anymore, I am taking the RMAN incremental backups for the database. I am not getting any errors now but, Here is what I want to achieve:
I am running the RMAN backups on the standby database. I want to :
1) Delete archivelogs on my PRIMARY server only when these logs are successfully TRANSFERED/APPLIED to all my standby databases?
2) Delete archivelogs on my STANDBY server only when these logs are sucessfully APPLIED to the database?
Regards -
Backup physical standby database
Hi,
as for a backup & restore concept we are planning to implement a physical standby database using Oracle 10g on Sun Solaris.
The idea is to use the standby database as backup source.
What are the required steps and constraints, do i have to stop log apply during backups or change the database state from recovery mode ?
Thanks,
RobertHi,
Its a good way to reduce load of backup on Live node.
According to the your plan:
If the live node has failes Standby will be failed over or switched over to production.
Then through RMAN we can restore the standby database from It's backup , and the standby is back.
Is this correct/Feasible....?
Regards,
Ven. -
CHECKPOINT_CHANGE# at Physical Standby is Higer then Primary
CHECKPOINT_CHANGE# at Physical Standby is Higer then Primary
Hello, We have hot backup Physical standby implementation (8.1.X way to implement the Standby). Now one thing i saw which i could not understand.. The CHECKPOINT_CHANGE# at Standby is coming out to be higer then the one at the Primary.. After i give ALTER SYSTEM SWITCH LOGFILE on the primary..
ON PRIMARY:-
EVT SQL> select distinct checkpoint_change#/100 from v$database;
CHECKPOINT_CHANGE#/100
139305020
Elapsed: 00:00:00.01
ON STANDBY:-
1* select distinct checkpoint_change#/100 from v$datafile_header
SQL>
SQL> /
CHECKPOINT_CHANGE#/100
139305283
Elapsed: 00:00:01.20
Did any one of you saw that before or can you explain it, why this must be happening or how it is possible.
Thanks,
Sameer Zai.If Data Guard is setup correctly the application is not losing data, you cannot read from it, but it will apply logs:
Ex.
/home/oracle:STANDBY >sqlplus "/ as sysdba"
SQL> select * from BIGSHOW.CUSTOMER;
select * from BIGSHOW.CUSTOMER
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only
So even as the SYS user I cannot read from my test user's tables.
ORA-01219 is expected when the standby is in this state.
You can open READ ONLY if you have Active Data Guard, but generally that will cost you extra.
OR, you can do thing to check your data:
To open a standby database for read-only access when it is currently performing managed recovery:
Cancel log apply services:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Open the database for read-only access:
SQL> ALTER DATABASE OPEN READ ONLY;
At some point you have start the recovery again, you probably don't have an issue.
If you want more peace of mind on this you have to setup a test Data Guard system and bang on it.
Best Regards
mseberg -
Rman backup on physical standby database without cancelling MRP
Hi all,
Could anyone share, is this possible to take RMAN backup on physical standby database without cancelling MRP process.
regarrds,Hi,
On Standby Side:
SQL> alter database mount;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.
SQL> select max(Sequence#) from v$archived_log;
MAX(SEQUENCE#)
405
SQL> select max(Sequence#) from v$archived_log where applied='YES';
MAX(SEQUENCE#)
404
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@oel62-x64 Desktop]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Tue May 21 15:31:43 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ADMDB (DBID=4063877183, not open)
RMAN> backup database plus archivelog delete all input;
Starting backup at 21-MAY-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=32 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=390 RECID=391 STAMP=815416638
input archived log thread=1 sequence=391 RECID=392 STAMP=815421952
input archived log thread=1 sequence=392 RECID=393 STAMP=815422343
input archived log thread=1 sequence=393 RECID=394 STAMP=815422434
input archived log thread=1 sequence=394 RECID=395 STAMP=815422570
input archived log thread=1 sequence=395 RECID=396 STAMP=815476598
input archived log thread=1 sequence=396 RECID=397 STAMP=815476615
input archived log thread=1 sequence=397 RECID=398 STAMP=815476645
input archived log thread=1 sequence=398 RECID=399 STAMP=815477471
input archived log thread=1 sequence=399 RECID=400 STAMP=815477475
input archived log thread=1 sequence=400 RECID=401 STAMP=815477628
input archived log thread=1 sequence=401 RECID=403 STAMP=815584146
input archived log thread=1 sequence=402 RECID=402 STAMP=815584137
input archived log thread=1 sequence=403 RECID=405 STAMP=816017446
*input archived log thread=1 sequence=404 RECID=404 STAMP=816017444*
*input archived log thread=1 sequence=405 RECID=406 STAMP=816017455*
channel ORA_DISK_1: starting piece 1 at 21-MAY-13
channel ORA_DISK_1: finished piece 1 at 21-MAY-13
piece handle=/u01/app/oracle/fast_recovery_area/stldb/STLDB/backupset/2013_05_21/o1_mf_annnn_TAG20130521T153202_8spm937d_.bkp tag=TAG20130521T153202 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_14/o1_mf_1_390_8s48hfrp_.arc RECID=391 STAMP=815416638
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_14/o1_mf_1_391_8s4fohwb_.arc RECID=392 STAMP=815421952
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_14/o1_mf_1_392_8s4g1q0v_.arc RECID=393 STAMP=815422343
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_14/o1_mf_1_393_8s4g4l8z_.arc RECID=394 STAMP=815422434
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_14/o1_mf_1_394_8s4g8t9h_.arc RECID=395 STAMP=815422570
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_15/o1_mf_1_395_8s631622_.arc RECID=396 STAMP=815476598
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_15/o1_mf_1_396_8s631qjj_.arc RECID=397 STAMP=815476615
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_15/o1_mf_1_397_8s632od8_.arc RECID=398 STAMP=815476645
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_15/o1_mf_1_398_8s63whqc_.arc RECID=399 STAMP=815477471
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_15/o1_mf_1_399_8s63wly4_.arc RECID=400 STAMP=815477475
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_15/o1_mf_1_400_8s641d8j_.arc RECID=401 STAMP=815477628
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_16/o1_mf_1_401_8s9d21jk_.arc RECID=403 STAMP=815584146
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_16/o1_mf_1_402_8s9d1skv_.arc RECID=402 STAMP=815584137
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_21/o1_mf_1_403_8spm6p4h_.arc RECID=405 STAMP=816017446
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_21/o1_mf_1_404_8spm6mqj_.arc RECID=404 STAMP=816017444
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_21/o1_mf_1_405_8spm6yg0_.arc thread=1 sequence=405
Finished backup at 21-MAY-13
Starting backup at 21-MAY-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/stldb/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/stldb/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/stldb/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/stldb/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/stldb/appdata01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/stldb/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-MAY-13
channel ORA_DISK_1: finished piece 1 at 21-MAY-13
piece handle=/u01/app/oracle/fast_recovery_area/stldb/STLDB/backupset/2013_05_21/o1_mf_nnndf_TAG20130521T153213_8spm9fnc_.bkp tag=TAG20130521T153213 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 21-MAY-13
channel ORA_DISK_1: finished piece 1 at 21-MAY-13
piece handle=/u01/app/oracle/fast_recovery_area/stldb/STLDB/backupset/2013_05_21/o1_mf_ncsnf_TAG20130521T153213_8spmfqxf_.bkp tag=TAG20130521T153213 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 21-MAY-13
Starting backup at 21-MAY-13
using channel ORA_DISK_1
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 21-MAY-13
RMAN> exit
Recovery Manager complete.
[oracle@oel62-x64 Desktop]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue May 21 15:34:42 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select max(Sequence#) from v$archived_log;
MAX(SEQUENCE#)
405
SQL> select max(Sequence#) from v$archived_log where applied='YES';
MAX(SEQUENCE#)
404
SQL> There have no problem, backup database when MRP is running. But if you want delete, then you are getting RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process.
And will not delete this archived log, because it is needed for standby or upstream capture process.
Updated
When MRP stoped
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@oel62-x64 Desktop]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Tue May 21 15:46:07 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ADMDB (DBID=4063877183, not open)
RMAN> backup database plus archivelog delete all input;
Starting backup at 21-MAY-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=405 RECID=406 STAMP=816017455
channel ORA_DISK_1: starting piece 1 at 21-MAY-13
channel ORA_DISK_1: finished piece 1 at 21-MAY-13
piece handle=/u01/app/oracle/fast_recovery_area/stldb/STLDB/backupset/2013_05_21/o1_mf_annnn_TAG20130521T154617_8spn3s9w_.bkp tag=TAG20130521T154617 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_21/o1_mf_1_405_8spm6yg0_.arc RECID=406 STAMP=816017455
Finished backup at 21-MAY-13
Starting backup at 21-MAY-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/stldb/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/stldb/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/stldb/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/stldb/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/stldb/appdata01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/stldb/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-MAY-13
channel ORA_DISK_1: finished piece 1 at 21-MAY-13
piece handle=/u01/app/oracle/fast_recovery_area/stldb/STLDB/backupset/2013_05_21/o1_mf_nnndf_TAG20130521T154618_8spn3v4f_.bkp tag=TAG20130521T154618 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:16
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 21-MAY-13
channel ORA_DISK_1: finished piece 1 at 21-MAY-13
piece handle=/u01/app/oracle/fast_recovery_area/stldb/STLDB/backupset/2013_05_21/o1_mf_ncsnf_TAG20130521T154618_8spn6779_.bkp tag=TAG20130521T154618 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 21-MAY-13
Starting backup at 21-MAY-13
using channel ORA_DISK_1
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 21-MAY-13
RMAN> Apply process is stopped and new redo received from primary.
SQL> select max(Sequence#) from v$archived_log;
MAX(SEQUENCE#)
407
SQL> select max(Sequence#) from v$archived_log where applied='YES';
MAX(SEQUENCE#)
405
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@oel62-x64 Desktop]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Tue May 21 15:49:28 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ADMDB (DBID=4063877183, not open)
RMAN> backup database plus archivelog delete all input;
Starting backup at 21-MAY-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=32 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=406 RECID=407 STAMP=816018527
input archived log thread=1 sequence=407 RECID=408 STAMP=816018530
channel ORA_DISK_1: starting piece 1 at 21-MAY-13
channel ORA_DISK_1: finished piece 1 at 21-MAY-13
piece handle=/u01/app/oracle/fast_recovery_area/stldb/STLDB/backupset/2013_05_21/o1_mf_annnn_TAG20130521T154937_8spnb1y3_.bkp tag=TAG20130521T154937 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_21/o1_mf_1_406_8spn8hkn_.arc thread=1 sequence=406
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/fast_recovery_area/stldb/STLDB/archivelog/2013_05_21/o1_mf_1_407_8spn8l69_.arc thread=1 sequence=407
Finished backup at 21-MAY-13
Starting backup at 21-MAY-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/stldb/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/stldb/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/stldb/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/stldb/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/stldb/appdata01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/stldb/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-MAY-13
channel ORA_DISK_1: finished piece 1 at 21-MAY-13
piece handle=/u01/app/oracle/fast_recovery_area/stldb/STLDB/backupset/2013_05_21/o1_mf_nnndf_TAG20130521T154939_8spnb3f5_.bkp tag=TAG20130521T154939 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 21-MAY-13
channel ORA_DISK_1: finished piece 1 at 21-MAY-13
piece handle=/u01/app/oracle/fast_recovery_area/stldb/STLDB/backupset/2013_05_21/o1_mf_ncsnf_TAG20130521T154939_8spndhly_.bkp tag=TAG20130521T154939 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 21-MAY-13
Starting backup at 21-MAY-13
using channel ORA_DISK_1
specification does not match any archived log in the repository
backup cancelled because there are no files to backup
Finished backup at 21-MAY-13
RMAN> I think, codes is understandable.
Regard
Mahir M. Quluzade
Edited by: Mahir M. Quluzade on May 21, 2013 3:36 PM -
Hi All,
I have recently setup Dataguard Configuration on 11gR2 Grid Infrastructure. Now i have off load the Primary and run the backup jobs from physical standby. Can any one provide me a Doc and steps to through this task.
Help would be appreciated.
ThanksHi,
If you know how to backup a database with RMAN you know how to backup a physical standby database : you can use the same type of scripts and you can use the backups to restore the primary if you want.
http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/toc.htm
Just read the classic guide to choose the good strategy according to your needs (recovery window etc.).
A few details :
- I would turn on controlfile autobackup on the primary to have backups of the controfile/spfile (those files are different on the standby) and I would make regular backups of those files. You also have to find an adequate strategy to delete the archivelog files on the primary and the standby (I backup/delete them periodically based a recovery window AND their application on the standby)
- I would turn flashback on for the standby, it can solve many issues
Best regards
Phil -
ARCHIVELOG deletion on primary and physical standby
Hi,
We have a primary and a physical standby database running Oracle 11.1.0.7.0 software on Red Hat Enterprise Linux x-64 bit OS. I will be using backup software
to only backup the primary database and do not have the backup software for the standby server and database.
We need to backup archived redo log files from primary site and delete the ones which are more than one month old. These archived redo log files will be applied from primary to standby database as and when the log switch occurs.
Can anybody please let me know if the following steps can be used:
Details are:
primary database name - sun (machine name is node1)
standby database name - drsun (machine name is node2)
On node1 as oracle user:
$ cat /export/home/oracle/rman/scripts/cleanup_rman_arch_sun.sh
#!/bin/sh
ORACLE_SID=sun; export ORACLE_SID
ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1; export ORACLE_HOME
PATH=$ORACLE_HOME/bin; export PATH
$ORACLE_HOME/bin/rman target sys/oracle@sun nocatalog log=/export/home/oracle/rman/log/cleanup_rman_arch_sun.log
@/export/home/oracle/rman/scripts/cleanup_rman_arch_sun.rcv
exit
$ cat /export/home/oracle/rman/scripts/cleanup_rman_arch_sun.rcv
allocate channel for delete type disk;
crosscheck archivelog all;
sql "alter system switch logfile";
delete noprompt expired archivelog all;
change archivelog until time 'SYSDATE-1' delete;
release channel;
$ crontab -l
# Delete the archived redo log files at 11:00 PM on the first day of every month
00 23 1 * * /export/home/oracle/rman/scripts/cleanup_rman_arch_sun.sh
On node2 as oracle user:
$ cat /export/home/oracle/rman/scripts/cleanup_rman_arch_drsun.sh
#!/bin/sh
ORACLE_SID=drsun; export ORACLE_SID
ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1; export ORACLE_HOME
PATH=$ORACLE_HOME/bin; export PATH
$ORACLE_HOME/bin/rman target sys/oracle@drsun nocatalog log=/export/home/oracle/rman/log/cleanup_rman_arch_drsun.log
@/export/home/oracle/rman/scripts/cleanup_rman_arch_drsun.rcv
exit
$ cat /export/home/oracle/rman/scripts/cleanup_rman_arch_drsun.rcv
allocate channel for delete type disk;
crosscheck archivelog all;
sql "alter system switch logfile";
delete noprompt expired archivelog all;
change archivelog until time 'SYSDATE-1' delete;
release channel;
$ crontab -l
# Delete the archived redo log files at 11:00 PM on the first day of every month
00 23 1 * * /export/home/oracle/rman/scripts/cleanup_rman_arch_drsun.sh
RegardsHello;
Welcome to the forums. ( By physical Standby I assume Data Guard )
The short answer is it should work. I noticed this :
/cleanup_rman_arch_drsun.rcv
crosscheck archivelog all;
sql "alter system switch logfile";
delete noprompt expired archivelog all;
change archivelog until time 'SYSDATE-1' delete;I see no reason for the "alter system switch logfile". In fact you can do something very simple on the Standby :
$ORACLE_HOME/bin/rman target / catalog <user>/<password>@<catalog> << EOF
delete noprompt ARCHIVELOG UNTIL TIME 'SYSDATE-1';
exit
EOFThis assumes you have doing a backup with RMAN on the Primary ( tested on 11.2.0.2 ) and have this set on the Primary :
CONFIGURE ARCHIVELOG DELETEION POLICY TO APPLIED ON ALL STANDBY;
If you are deleting Archive without using RMAN first then yes something like this ( But I would try to use RMAN and not delete using another method )
echo `date`
echo "Runnung RMAN archive crosscheck"
$ORACLE_HOME/bin/rman <<EOF
connect target /
crosscheck archivelog all;
delete noprompt expired archivelog all;
exit
EOF
echo `date`
Best Regards
mseberg
h2. Another Standby Option
/u01/app/oracle/dba_tool/bin/removestandbyarch.sql
SET echo off
SET feedback off
SET term off
SET pagesize 0
SET linesize 200
SET newpage 0
SET space 0
col name format a120
spool /u01/app/oracle/dba_tool/bin/rm_arch_standby.sh
select 'rm '||NAME from v$archived_log
where REGISTRAR='RFS'
and APPLIED='YES'
and DELETED='NO'
and COMPLETION_TIME < (SYSDATE-10);
SPOOL OFFMain shell script
/u01/app/oracle/dba_tool/bin/removestandbyarch.sh
#!/bin/bash
if [ "$1" ]
then DBNAME=$1
else
echo "basename $0 : Syntax error : use . removestandbyarch <DBNAME> "
exit 1
fi
# Set the Environmental variable for input instance ( ORACLE_SID, ORACLE_HOME path etc )
. /u01/app/oracle/dba_tool/env/${DBNAME}.env
$ORACLE_HOME/bin/sqlplus /nolog <<EOF
connect / as sysdba
-- spool /u01/app/oracle/dba_tool/bin/rm_arch_${ORACLE_SID}.sh
@/u01/app/oracle/dba_tool/bin/removestandbyarch.sql
SPOOL OFF
EOF
echo `date`
# Now run the generated script
echo "Setting permissions and running script"
chmod 740 /u01/app/oracle/dba_tool/bin/rm_arch_standby.sh
. /u01/app/oracle/dba_tool/bin/rm_arch_standby.sh
# Use RMAN to update V$ARCHIVED_LOG.DELETED
echo `date`
echo "Runnung RMAN archive crosscheck"
$ORACLE_HOME/bin/rman <<EOF
connect target /
crosscheck archivelog all;
delete noprompt expired archivelog all;
exit
EOF
echo `date`Edited by: mseberg on Apr 30, 2012 8:40 AM -
Physical standby database backup
HI,
Is it necessary to take a physical standby Db backup.our standby db is in manual mode and it is opened for read only mode.we are taking backups of priamary database,I am taking care of DR site.So i would like to know should i go for a RMAN to take a standby database or as wer are taking a backup of primarty db so there is no need to take backup of standby db.
If our primary db is failed then we can swithciover to standby to primary but if we are not having a backup of standby db then can we recover the standby db from primary db backup.
another question is that while taking logical backup of the primary db from the client side i.e remote location ,backup is failed bcoz our ary Db version is
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
PL/SQL Release 9.2.0.6.0 - Production
CORE 9.2.0.6.0 Production
TNS for Solaris: Version 9.2.0.6.0 - Production
NLSRTL Version 9.2.0.6.0 - Productionbut our oracle client version is 9.2.0.1 and the backup was terminated after gerating an error *"ORA-03113 exp-00056 getting an error while exporting "*
Pls suggest me.....Hi!
There is no need to take a backup of your standby DB. A standby DB is only a clone of your primary DB so if your standby DB crashes you can take a backup of your primary DB and build a new standby DB.
Your problem with logical backup. The Oracle clientsoftware should allways have the same version as your DB. Avoid situations where client and server have different version. If it is possible upgrade your clientsoftware.
Hope this helps! -
Backups on Physical standby database?
I am using dataguard and a physical standby database.How to assign backups on physical standby database to reduce the load on Primary database.
environment: windows
Database version:11.2.0.1.0
What are the pro and cons on assigning RMAN backups jobs to physical standby database?Is it better to assign the RMAN backups on standby?i am using the RMAN catalog.Yes, Already mentioned to reduce contention on primary. You can register even standby.
Do i need to change the setting to backup archive logs from standby database? If i won't backup the archive logs on Primary the FRA will be full and i can't access it ?You can include even archive logs with your database backup.
How to assign the archive logs backups,full backup on standby database?Same script will work, Before that cancel MRP and after backup start MRP. That should be fine.
Recently i tested backup from standby and restore, Please see below log.
=================================================================================================
Backup Scrpts:-
=================================================================================================
RMAN> run
2> 3> ALLOCATE CHANNEL dev11 type disk;
4> backup as compressed backupset
5> format '/home/oracle/backup/DBF_FULLCOLD_BKP_%s'
6> filesperset 30
7> (database);
backup current controlfile format
8> 9> '/home/oracle/backup/CTL_FULLCOLD_BKP_%s';
RELEASE CHANNEL dev1;
RELEASE CHANNEL dev2;
10> 11> 12> }
using target database control file instead of recovery catalog
allocated channel: dev11
channel dev11: SID=1 device type=DISK
Starting backup at 03-FEB-13
Starting implicit crosscheck backup at 03-FEB-13
Finished implicit crosscheck backup at 03-FEB-13
Starting implicit crosscheck copy at 03-FEB-13
Crosschecked 4 objects
Finished implicit crosscheck copy at 03-FEB-13
searching for all files in the recovery area
channel dev11: starting compressed full datafile backup set
channel dev11: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel dev11: starting piece 1 at 03-FEB-13
channel dev11: starting compressed full datafile backup set
channel dev11: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel dev11: starting piece 1 at 03-FEB-13
channel dev11: finished piece 1 at 03-FEB-13
piece handle=/home/oracle/backup/DBF_FULLCOLD_BKP_23 tag=TAG20130203T192535 comment=NONE
channel dev11: backup set complete, elapsed time: 00:03:57
channel dev11: starting compressed full datafile backup set
channel dev11: specifying datafile(s) in backup set
including current control file in backup set
channel dev11: starting piece 1 at 03-FEB-13
channel dev11: finished piece 1 at 03-FEB-13
piece handle=/home/oracle/backup/DBF_FULLCOLD_BKP_24 tag=TAG20130203T192535 comment=NONE
channel dev11: backup set complete, elapsed time: 00:00:02
Finished backup at 03-FEB-13
Starting backup at 03-FEB-13
channel dev11: starting full datafile backup set
channel dev11: specifying datafile(s) in backup set
including current control file in backup set
channel dev11: starting piece 1 at 03-FEB-13
channel dev11: finished piece 1 at 03-FEB-13
piece handle=/home/oracle/backup/CTL_FULLCOLD_BKP_25 tag=TAG20130203T192939 comment=NONE
channel dev11: backup set complete, elapsed time: 00:00:03
Finished backup at 03-FEB-13
released channel: dev11
=================================================================================================
Backup Files:-
=================================================================================================
[oracle@oracle-stby backup]$ ls -ltr
total 364572
-rw-r----- 1 oracle oinstall 361684992 Feb 3 19:29 DBF_FULLCOLD_BKP_23
-rw-r----- 1 oracle oinstall 1163264 Feb 3 19:29 DBF_FULLCOLD_BKP_24
-rw-r----- 1 oracle oinstall 10092544 Feb 3 19:29 CTL_FULLCOLD_BKP_25
[oracle@oracle-stby backup]$
=================================================================================================
Restore CONTROL FILE:-
=================================================================================================
RMAN> restore controlfile from '/home/oracle/backup/CTL_FULLCOLD_BKP_25';
Starting restore at 03-FEB-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/u02/app/oracle/oradata/orcl/control01.ctl
output file name=/u02/app/oracle/flash_recovery_area/orcl/control02.ctl
Finished restore at 03-FEB-13
RMAN> sql 'alter database mount';
sql statement: alter database mount
released channel: ORA_DISK_1
RMAN>
=================================================================================================
Restore Database:-
=================================================================================================
RMAN> restore database;
Starting restore at 03-FEB-13
Starting implicit crosscheck backup at 03-FEB-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
Crosschecked 2 objects
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/orcl/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/orcl/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/orcl/undotbs01.dbf
Sun Feb 03 19:37:47 2013
Checker run found 4 new persistent data failures
Sun Feb 03 19:38:40 2013
Full restore complete of datafile 3 /u01/app/oracle/oradata/orcl/undotbs01.dbf. Elapsed time: 0:00:56
checkpoint is 1595132
last deallocation scn is 1519218
channel ORA_DISK_1: piece handle=/home/oracle/backup/DBF_FULLCOLD_BKP_23 tag=TAG20130203T192535
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:07
Finished restore at 03-FEB-13
RMAN>
=================================================================================================
Open Database:-
=================================================================================================
SQL> alter database open resetlogs;
Database altered.
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
READ WRITE PRIMARY
SQL>Edited by: CKPT on Feb 21, 2013 11:24 PM -
How to delete archivelogs once they are applied on Physical Standby
We have 10.2.0.4 Primary and Physical Standby.
According to Note, ID 331924.1, we have
on Primary:
RMAN> SHOW ARCHIVELOG DELETION POLICY;
RMAN configuration parameters are:
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
on Standby:
RMAN> SHOW ARCHIVELOG DELETION POLICY;
RMAN configuration parameters are:
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
I would like to delete the archivelogs from Primary(as soon as they are applied to standby) as well as from standby and schedule a RMAN script which will run every hourly. The archivelogs are taken on flashback area.
Please guide.Handle: chakra
Status Level: Newbie
Registered: Oct 27, 2006
Total Posts: 107
Total Questions: 56 (46 unresolved)
Name Anirban
Why so many open questions. Close the answered questions, give points and keep forum clean.
Refer the below link
Best Way to monitor standby, primary databases, including alert logs, etc.
Edited by: jazz81 on 10-May-2012 16:38 -
Deleting archivelog files once applied to physical standby database
Hi,
Any procedure for automatically deleting the archivelog files after applied to physical standby database.also pls see DataGuard: auto delete redo logs after applied to physical standby?
-
Physical standby database backup issue
Hello
We have a Data Guard environment if I open Physical Standby database for query by this statement:
"Alter database recover managed standby database cancel" and then start redo apply by
"alter database recover managed standby database using current logfile" and then backup the Physical standby database by RMAN
for example
RMAN> backup database;
I will get this error :
Starting backup at 03-FEB-09
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 02/03/2009 15:36:45
ORA-01219: database not open: queries allowed on fixed tables/views only
but if before restarting redo apply after opening standby database for query I shutdown the database first and then start redo apply I don't get that error while backing up
If DataGuard mode is Maximum Performance or Maximum Availability shutting down the standby database before
restarting redo apply is possible but if DataGuard mode is Maximum Protection shutting down the standby database
cause failing Primary database
do you know what is problem and it's solution ?
thankslike I said bro, i have made standby controlfile....
I made it on Primary Database (DG1)...........
but when I copied it to Physical Standby Database, the error message raised "DBID IS NOT SAME",
thanks Renato OCP for uR attention..........
is there any other suggestion.............?
regards
abip -
Got RMAN error when running RMAN backup of archivelogs on physical standby database
Got below error when running RMAN backup of datafiles and archivelogs on physical standby database.
RMAN-06820: WARNING: failed to archive current log at primary database
ORACLE error from target database:
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-00942: table or view does not exist
Could anyone help me? Thanks,Hello;
When you connect RMAN to the source database as TARGET you must specify a password even if RMAN uses operating system authentication.
So the errors ORA-17627 and ORA-00942 appear to be cause and effect.
What version of Oracle? ( 11.2.0.4 according to the tag )
Can you post your backup script?
Best Regards
mseberg
Update
According to :
Database Error Messages 11g Release 2 (11.2) E17766-03
RMAN-06820: WARNING: failed to archive current log at primary database
Cause: An attempt to switch the archived log at the primary database failed.
So I would check my Primary alert log for an issue.
Message was edited by: mseberg -
Rman backup of physical standby
Hi:
I am on 10.2.0.3.
Trying to run rman backup on physical standby while it's in managed recovery mode. Whould it be useable for recovery being that it will be inconsistent?
I went through this: http://youngcow.net/doc/oracle10g/server.102/b14239/rman.htm and some other sites
but they don't tell how to register the standby first. By the way, do I have to change DBID as well? Am I missing some step?
Below are the errors I'm getting.
TIA.
RMAN> register database;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of register command at 12/04/2008 11:42:02
RMAN-08040: full resync skipped, control file is not current or backup
RMAN> show all;
RMAN configuration parameters are:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of show command at 12/04/2008 11:42:09
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalogI meant this sentence from the documentation:
In a standby environment, backing up data files and archived redo log files taken on the primary or standby system are usable on either system for recovery.
You can take a backup (datafiles and archivelogs) on the primary side and then restore/recover on the standby side. The same is true vice versa. There's no difference,where you take the backup. The recovery catalog is necessary to resync the controlfiles on both sides with the backup records. By the way I prefer in any case to take archivelog backups on the primary side. Because sometimes archivelog transfer to the standby is interrupted and you don't catch all archivelogs on the standby side (in the moment you take the backup).
Werner -
Hi All,
I have a configured data guard in my local system . Please find the below configuration of the Data guard
Data Guard Type : - Physical Standby (Oracle version 11g)
Service Responsible for Log Transport : - ARCH
No Standby Redo log : - Neither in Primary Nor in Standby
I am trying to fail over by using command "alter database recover managed standby database finish"
Please find the below alert log info after this command .
Tue Dec 03 01:42:14 2013
alter database recover managed standby database finish
Attempt to do a Terminal Recovery (PRD)
Media Recovery Start: Managed Standby Recovery (PRD)
Fast Parallel Media Recovery enabled
Managed Standby Recovery not using Real Time Apply
Media Recovery Waiting for thread 1 sequence 145
Terminal Recovery timestamp is '12/03/2013 01:42:15'
Terminal Recovery: applying standby redo logs.
Terminal Recovery: thread 1 seq# 145 redo required
Media Recovery Waiting for thread 1 sequence 145
Terminal Recovery: End-Of-Redo log allocation
Terminal Recovery: standby redo logfile 3 created '/data/PRD_DR/arch/arch_1_0_831359165.arch'
This standby redo logfile is being created as part of the failover
operation. This standby redo logfile should be deleted after the
switchover to primary operation completes.
Media Recovery Log /data/PRD_DR/arch/arch_1_0_831359165.arch
Terminal Recovery: log 3 reserved for thread 1 sequence 145
Recovery of Online Redo Log: Thread 1 Group 3 Seq 145 Reading mem 0
Mem# 0: /data/PRD_DR/arch/arch_1_0_831359165.arch
Identified End-Of-Redo for thread 1 sequence 145
Incomplete recovery applied all redo ever generated.
Recovery completed through change 559773 time 11/23/2013 13:38:13
Media Recovery Complete (PRD)
Terminal Recovery: successful completion
Resetting standby activation ID 1895332757 (0x70f87b95)
Completed: alter database recover managed standby database finish
Tue Dec 03 01:42:50 2013
alter database commit to switchover to primary
ALTER DATABASE SWITCHOVER TO PRIMARY (PRD)
Maximum wait for role transition is 15 minutes.
Backup controlfile written to trace file /apps/oracle/diag/rdbms/stand/PRD/trace/PRD_ora_9466.trc
tkcrrxms: Killing 3 processes (all RFS)
Standby terminal recovery start SCN: 559772
RESETLOGS after complete recovery through change 559773
Online log /data/PRD_DR/REDOLOG11.LOG: Thread 1 Group 1 was previously cleared
Online log /data/PRD_DR/REDOLOG21.LOG: Thread 1 Group 2 was previously cleared
Standby became primary SCN: 559771
Tue Dec 03 01:42:53 2013
Here my question is , why oracle implicitly creates a standby redo log in Standby database for successful completion of 'alter database recover managed standby database finish'.
Thanks,Terminal Recovery timestamp is '12/03/2013 01:42:15'
Terminal Recovery: applying standby redo logs.
Terminal Recovery: thread 1 seq# 145 redo required
Media Recovery Waiting for thread 1 sequence 145
Terminal Recovery: End-Of-Redo log allocation
Terminal Recovery: standby redo logfile 3 created '/data/PRD_DR/arch/arch_1_0_831359165.arch'
This standby redo logfile is being created as part of the failover
operation. This standby redo logfile should be deleted after the
switchover to primary operation completes.
Media Recovery Log /data/PRD_DR/arch/arch_1_0_831359165.arch
Terminal Recovery: log 3 reserved for thread 1 sequence 145
Recovery of Online Redo Log: Thread 1 Group 3 Seq 145 Reading mem 0
Mem# 0: /data/PRD_DR/arch/arch_1_0_831359165.arch
Identified End-Of-Redo for thread 1 sequence 145
Looks like, its due to the following bug.
Bug 5889025 : FINISH FAILOVER GENERATES INCORRECT STANDBY REDO LOG.
Maybe you are looking for
-
Payment proposal data to be transfered to third party software
Hi, I want to transfer prposal data to third party software to write check and attach digital signature. And once checks are prepared want to bring that data in SAP for payment run to generate accounting entry. I was wondering which BTE can help me i
-
ITunes doesn't add files to my Movies library
So I just added a video, but now, I want to add another 2 but I can't. I Do all of the steps but the video won't show on the library. What's the problem? or what can I do?
-
Temporary files and buffersize limit question
Hello, I have two questions : 1. Buffer limit Is there a limit for the buffer to return to a client. I have a conversational service routine. If I want to return 50 record ( i.e. view structures ) my service routine hangs. If I do 10 records than it
-
Excise Utilization through J2IUN
Hi i am doing excise utilization through Transaction code J2IUN at the Utilzation screen balance appearing under Account Name PLABED is different that the actual GL Balance. in this respect i have another question that is, whether the PLA Balance is
-
I receive an invalid user name message in Creative Suite 2
Jeff, I own CS2 and have had it on my Windows 7 computer until the computer crashed last week. I bought a new computer and it has Windows 8. I went to install my CS2 cds and it doesn't work. I read this thread and installed the software via the in