Pavan DBA's Blog

The DBA Knowledge Store

Archive for the ‘RMAN’ Category

how to define RMAN retention policy time?

Posted by Pavan DBA on July 11, 2011

Many a times, I heard DBA’s complaining about RMAN retention policy through which they face some problems during restore or  recovery.

For example a friend posted that his retention policy is set to recovery window of 90 days, but when tried to restore the database to 30 days back date, RMAN saying recovery till that time is not possible. he wondered why this cannot be done if he has retention of 90 days.

Here is the answer for the same….

we all know that RMAN will store backup metadata in control file’s reusable location if recovery catalog is not configured. Generally this information will be stored for 7 days and can be changed by modifying CONTROLFILE_RECORD_KEEP_TIME parameter.

whenever we define retention policy of RMAN either to recovery window or redundancy to some X value, we need to remember that  RMAN still follow the value defined for CONTROLFILE_RECOD_KEEP_TIME. That means, if recovery window is set to 30 days, but the above parameter is set to 7 days (default), you cannot recover beyond 7 days… which is very unfortunate…

Right ! so lets see what can be done for this?

we need to define CONTROLFILE_RECORD_KEEP_TIME always a higher value than what we set for retention policy. As per the formula, it should be

CONTROLFILE_RECORD_KEEP_TIME=retention policy value+ level 0 backup interval+ 1

let me throw some example for easy understanding…

If suppose your retention time is set to recovery window of 90 days and a weekly full level 0 backup is scheduled, then CONTROLFILE_RECORD_KEEP_TIME = 90 (retention policy) + 7 (level 0 backup interval) + 1 = 98

Note: In worst case, atleast you should set that same (equal to) as retention policy value

What happens if I don’t set to higher value?

In such case, RMAN will overwrite the content of backup metadata prior to obsolete them by RMAN and even though physically backup pieces are existing, you cannot use them

Hope this will help you ……………….

Posted in RMAN | 4 Comments »

How to solve ORA-19505: failed to identify file in RMAN?

Posted by Pavan DBA on January 18, 2011

DBA’s will feel bad when they got any error. It’s common for any :)

Lets say you got below error

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ch00 channel at 01/17/2011 13:01:03
ORA-19505: failed to identify file “/dwh1/oraarch/arch/1_1100721_664058960.dbf”
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

Don’t be panic, nothing happened to your backup or database. If you read the error, its saying particular archive logfile is not available. This may be due to file deleted at OS level due to some reason.

In this situation, do the following

1. Run crosscheck command against archivelogs

RMAN> crosscheck archivelog all;

2. If you find any archives marked as EXPIRED, then delete those expired archives using below command

RMAN> delete expired archivelog all;
This will prompt you YES or NO. If you don’t want a prompt, use below command

RMAN> delete noprompt archivelog all;

3. Take a fresh archivelog backup

RMAN> backup archivelog all; (you  can use delete input clause also)

Posted in RMAN | Tagged: , , | 2 Comments »

Resolving ORA-19588: archived log recid stamp is no longer valid

Posted by Pavan DBA on January 18, 2011

Sometimes you may find the following error in RMAN archive backup or online backup logfile

ORA-19588: archived log recid 24909 stamp 740658206 is no longer valid

This is not an error but a warning. The reason for this is archive logfile which this process is trying to take backup, is already been backed up by another process and file is deleted

This situation will occur if both archive backup job and full database backup (including archives) are executing at same time or two archive backup jobs executing at same time.

So to avoid this we have two ways

1. If you want to run a manual backup, just check whether any other RMAN backups are in execution phase. you can do this by

[oracle@viadbscph014 logs]$ ps -ef | grep rman

If any backup process is running, you will see a similar output as below

[oracle@viadbscph014 logs]$ ps -ef | grep rman
root      3022  3015  0 00:15 ?        00:00:00 su – oracle -c ?ORACLE_HOME=/opt/oracle/oracle/product/10.2.0?export ORACLE_HOME?ORACLE_SID=dwh2?export ORACLE_SID?/opt/oracle/oracle/product/10.2.0/bin/rman target / nocatalog msglog /opt/oracle/admin/DWH2/backup/logs/online_backup_20110118.out append << EOF?RUN {?ALLOCATE CHANNEL ch00 TYPE sbt PARMS=’ENV=(NB_ORA_SCHED=Default-Application-Backup,NB_ORA_CLIENT=viadbscph014)’;?ALLOCATE CHANNEL ch01 TYPE sbt PARMS=’ENV=(NB_ORA_SCHED=Default-Application-Backup,NB_ORA_CLIENT=viadbscph014)’;?BACKUP?    INCREMENTAL LEVEL=0?    SKIP INACCESSIBLE?    FILESPERSET 5?    # recommended format?    FORMAT ‘bk_%s_%p_%t_%U’?    DATABASE;?    sql ‘alter system archive log current’;?RELEASE CHANNEL ch00;?RELEASE CHANNEL ch01;?# backup all archive logs?ALLOCATE CHANNEL ch00 TYPE sbt PARMS=’ENV=(NB_ORA_SCHED=Default-Application-Backup,NB_ORA_CLIENT=viadbscph014)’;?ALLOCATE CHANNEL ch01 TYPE sbt PARMS=’ENV=(NB_ORA_SCHED=Default-Application-Backup,NB_ORA_CLIENT=viadbscph014)’;?BACKUP?   filesperset 20?   FORMAT ‘al_%s_%p_%t_%U’?   ARCHIVELOG ALL DELETE INPUT;?  # ARCHIVELOG ALL;?RELEASE CHANNEL ch00;?RELEASE CHANNEL ch01;?#?# Note: During the process of backing up the database, RMAN also backs up the?# control file.  This version of the control file does not contain the?# information about the current backup because nocatalog has been specified.?# To include the information about the current backup, the control file should?# be backed up as the last step of the RMAN section.  This step would not be?# necessary if we were using a recovery catalog.?#?ALLOCATE CHANNEL ch00 TYPE sbt PARMS=’ENV=(NB_ORA_SCHED=Default-Application-Backup,NB_ORA_CLIENT=viadbscph014)’;?BACKUP?    # recommended format?    FORMAT ‘cntrl_%s_%p_%t_%U’?    CURRENT CONTROLFILE;?    sql ‘alter database backup controlfile to trace’;?    sql “alter database backup controlfile to ”/opt/oracle/oracle/product/10.2.0/dbs/dwh2_backup_controlfile.ctl” reuse”;??RELEASE CHANNEL ch00;?}?EOF?
Note: Output may differ. In my case RMAN backup is initiated through Netbackup tool

2. Don’t schedule archive backup job during full database backup. Always make sure you have only one RMAN backup in process

Posted in RMAN | Tagged: , , | Leave a Comment »

RMAN no channel allocated for maintenance

Posted by Pavan DBA on December 23, 2010

Many a times, when you issue some commands in RMAN you may receive following error

RMAN> run
{
allocate channel c1 device type sbt_tape;
delete noprompt obsolete;
}

released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of crosscheck command at 12/23/2010 10:57:21
RMAN-06091: no channel allocated for maintenance (of an appropriate type)

Cause:
This is because of command change across versions especially between 9i and 10g. The command which we used above is for 10g and will not work in 9i.

Solution:
Use the below way to use rman commands in 9i

RMAN> allocate channel for maintenance type sbt_tape;

allocated channel: ORA_MAINT_SBT_TAPE_1
channel ORA_MAINT_SBT_TAPE_1: sid=1059 devtype=SBT_TAPE
channel ORA_MAINT_SBT_TAPE_1: VERITAS NetBackup for Oracle – Release 6.0 (2008012304)

Posted in RMAN | Tagged: , , , | Leave a Comment »

RMAN initiation problem

Posted by Pavan DBA on December 23, 2010

Today, When I am accessing RMAN for a database in one of my prod server, i got below error

Copyright (c) 1982, 2007, Oracle.  All rights reserved.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-03000: recovery manager compiler component initialization failed
RMAN-06035: wrong version of recover.bsq, expecting 10.2.0.4, found 10.2.0.3

By this its clear that there could be some version mismatch. Then i checked how many oracle homes are existing on the server. I found there are 3 different 10g oracle homes (each of different version).

In this kind of situation, you can invoke rman by going to HOME path/bin directory

[oracle@pc14 ~]$ cd $ORACLE_HOME/bin

[oracle@pc14 ~]$ ./rman

RMAN> connect target /

So folks, if you face same error…don’t be panic its all simple that we can solve this issue.

Tip: To avoid these complications, Oracle always recommend to maintain same version of database under a release in the server

Posted in RMAN | Tagged: , , , , , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 1,272 other followers