Friday, August 30, 2013

ORA-600 error



SQL>Startup mount ;

SQL>Show parameter control_files


Query 1

------------

sql>select a.member,a.group#,b.status from v$logfile a ,v$log b where a.group#=b.group# and b.status='CURRENT'


Note down the name of the redo log


SQL>Shutdown abort ;


Take a OS Level back of the controlfile (This is to ensure we have a backup of current state of controlfile)


SQL>Startup mount ;


SQL>recover database using backup controlfile until cancel ;


Enter location of redo log shown as current in Query 1 when prompted for recovery


Hit Enter


SQL>Alter database open resetlogs ;

Oracle 11G RMAN Restore Template

There are many ways to restore a database using an RMAN backup - this example assumes you are performing a Disaster-Recovery restore of all data and recovering the entire database with the same SID and the same disk/tablespace layout.
You will need the following information:
Database SID: ________
Database SYS password: ________
Disk layout and sizes: ________
Database ID (DBID): ________

There are 5 steps to recover the database:

1) Create a new (empty) database instance
2) Mount the instance
3) Restore the datafiles
4) Recover the database
5) Reset the logs

1) Create a new (empty) database instance
Configure the new server with same disk layout as the original database - if necessary use Symbolic Links (or in Windows use disk manager to re-assign drive letters.)
Ensure you have enough disk space for both the backup files plus the restored database files.
Create a new database with the database configuration assistant (DBCA) and set the SYS password and global database_name to the same as the original database.
If the database to be restored is in archive log mode, set the LOG_ARCHIVE_FORMAT parameter to match the setting in the original database.
The ORAPWD utility can also be used to change the SYS password.
Set the environment variable NLS_LANG for your character set -
NLS_LANG=American_America.WE8ISO8859P1

2)  Mount the empty instance

SQL> Shutdown immediate;
SQL> Startup mount;
or specifying the pfile explicitly:
SQL> CREATE PFILE='C:\oracle\Database\initashok.ora' FROM SPFILE;
SQL> Shutdown immediate;
SQL> Startup mount pfile=C:\oracle\Database\initashok.ora

3) Restore the datafiles

In this case we have copied the RMAN backup files and archive logs to R:\Rman\
Change the dbid to match that of the database being restored
RMAN> SET dbid = 777777774;
RMAN> run {
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT 'R:\Rman\%U';
restore database;
}
At this point the datafiles and tablespaces will be re-created. For a large database it can take a long time to restore each tablespace - for better performance during a restore place the RMAN backup files on a separate disk to the Oracle datafiles to reduce disk contention.

4) Recover the database

SQL> Recover from 'D:\oradata\ashok' database until cancel using backup controlfile;
SQL> cancel

5) Reset the logs

SQL> alter database open resetlogs;
This will update all current datafiles and online redo logs and all subsequent archived redo logs with a new RESETLOGS SCN and time stamp.


Thursday, August 29, 2013

Mechanism followed by RMAN Restore & Recovery.

Mechanism followed by RMAN Restore & Recovery.

•If we simply use RESTORE command then RMAN directs a server session to restore the file to default location that is overwrite the existing file.

•If we use RESTORE command with SET NEWNAME option then RMAN restore the file with specified location.

Example: RUN {
SET NEWNAME FOR DATAFILE '/oradata/datafile/1.dbf' TO '/tmp/1.dbf';
RESTORE DATAFILE '/oradata/datafile/1.dbf';
}


In this case, RMAN restore /oradata/datafile/1.dbf to /tmp/1.dbf
•RMAN always restore data file as image copy.

•After restoring a datafile to a new location if you want to use that then use the SWITCH command in order to update control file. RMAN SWITCH command is equivalent to SQL statement ALTER DATABASE RENAME FILE command.

Example: SWITCH DATAFILE '/oradata/datafile/1.dbf' TO DATAFILECOPY '/tmp/1.dbf';

•RMAN always select the most recent backup while restoring. If two backups are in the same point then RMAN prefers to use image copies over backup sets because RMAN can restore more quickly from image copies than from backup sets.

•During RESTORE operation if RMAN fails the restore one copy then i automatically searches other usable copy. If there is no backup exist then RMAN try to re-create the datafile.

•RMAN uses restore optimization to avoid restoring datafiles from backup when possible. If a datafile is already present in the correct location and its header contains the expected information, then RMAN does not restore the datafile from backup. However you can override this behavior by FORCE option of RESTORE command.

•If RMAN has a choice between archived redo logs and incremental backups then RMAN always choice incremental backups during recovery.If overlapping levels of incremental backups are available then RMAN choose the longest covering one.

Restore and Recovery of Individual Tablespaces or Datafiles

Restore and Recovery of Individual Tablespaces or Datafiles

In this mode some of the datafiles are damaged or lost. Now you can take the corresponding tablespace offline and perform restore and recover of the specified tablespaces.

Procedures:
--------------

Here I have deleted users01.dbf datafile from OS. Now to restore and recover the datafile you can keep your database mount or in open mode do the following.

1)Make offline of the affected tablespace.


RMAN> sql 'alter tablespace users offline immediate';
sql statement: alter tablespace users offline immediate

2)Restore Tablespace.

RMAN> restore tablespace users;
Starting restore at 27-APR-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=140 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to /oradata2/data1/data1/users01.dbf
channel ORA_DISK_1: reading from backup piece /oradata2/flash_recovery_area/DATA1/backupset/2008_04_27/o1_mf_nnndf_TAG20080427T130713_419dp1z4_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata2/flash_recovery_area/DATA1/backupset/2008_04_27/o1_mf_nnndf_TAG20080427T130713_419dp1z4_.bkp tag=TAG20080427T130713
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 27-APR-08

3)Recover Tablespace.

RMAN> recover tablespace users;
Starting recover at 27-APR-08
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:03
Finished recover at 27-APR-08

4)Make the tablespace online.

RMAN> sql'alter tablespace users online';
sql statement: alter tablespace users online

RMAN-How to skip a tablespace for restore operation

How to skip a tablespace for restore operation

Sometimes we want to restore full database except a certain tablespace. That is we need to skip a tablespace for restore operation. May be that the tablespace only contains tempoarary data and hence not useful for us. Or we are performing some database point in time recovery operation and we want to omit a big tablespace as the tablespace does not contain data needed for our requirement. In this way we can minimize our restore operation time.

With the RESTORE DATABASE command we perform all datafiles restore operation except those that are offline or read-only.

Note that RESTORE DATABASE does not work same as BACKUP DATABASE. With command BACKUP DATABASE, RMAN backs up datafiles along with controlfiles and spfile. But with RESTORE COMMAND operation, RMAN only restores datafiles.

To omit a certain tablespace for restore operation use RESTORE DATABASE SKIP TABLESPACE tablespace_name. Suppose I want to omit restore of indexed tablespace KRISH,KRISHNAand SIVA. Then my restore command will be,
RMAN>RESTORE DATABASE SKIP TABLESPACE KRISH,KRISHNA,SIVA;

If you specify SKIP FOREVER TABLESPACE, then RMAN specifies the DROP option of ALTER DATABASE DATAFILE ... OFFLINE when taking the datafiles that belong to the tablespace offline before the restore. The DROP option indicates that RMAN does not intend to recover these files and intends to drop their tablespaces from the database after the database is opened again. In other words, FOREVER indicates that RMAN never intends to do anything with the skipped tablespaces again.

Suppose you want to skip forever to restore tablespace KRISHNA,KRISH and SIVA then your command will be,
RMAN>RESTORE DATABASE SKIP FOREVER TABLESPACE KRISHNA, KRISH, SIVA;

Finding DBID in oracle when the database is up/down

We need DBID whenever we lost our all database files, or whenever we need to restore spfile or control file.

DBID is necessary forany Oracle DBA in multiple scenarios.
As it's unique for database to database few people use to keep a record of their DBID,
But this page is written for those who don't keep a record for that (Just Like me 'a Lazy DBA' :-)

So there are different ways to find DBID of a database, when a database is up/down.
Assuming that the database is up:
You can query V$database and get the DBID and record it in somewhere.
or,if the database is down and you have control file then you can mount the database and query from V$SATABASE.
SQL> SELECT DBID FROM V$DATABASE;
DBID
----------
236329879


If you log the RMAN backup or if you preserve output of RMAN session then you can get DBID from that output.
$rman TARGET /
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Aug 6 04:45:06 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: KRISH (DBID=236329879)


If you have configured AUTOBACKUP ON,
RMAN> SHOW CONTROLFILE AUTOBACKUP;
RMAN configuration parameters are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;


Now, take the backup of some datafile,
RMAN>backup datafile 12;
.
.
Starting Control File and SPFILE Autobackup at 06-AUG-13
piece handle=/backup/rman_bkp/ctrl_bkp-236329879-20130806-06


The autobackup format is by default c-XXXX-YYYYMMDD-QQ,(when it is %F) where:

XXXX stands for the DBID.
YYYYMMDD is a time stamp of the day the backup is generated
QQ is the hex sequence that starts with 00 and has a maximum of FF

I have seen that this format works when we set specifically/explicitly configure as
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';

Now in the file from ctrl_bkp-236329879-20130806-06 we get DBID is 236329879.

If you did not set Autobackup on which is by default. After many analysis I found that DBID can be seen from backup piece or any image copy that holds either SYSTEM or SYSAUX or UNDO datafiles.
Though if you backup your database as backup as compressed then with this method you will not be able to discover DBID.
If you have SYSTEM datafile or UNDO datafile either as image copy or as backup piece then you can use,
strings file_name |grep MAXVALUE, (In case of SYSTEM datafile)
strings file_name |grep MAXVALUE (In case of UNDO datafile)

to find DBID.

If you have SYSAUX datafile either as image copy or as backup piece then you can use,
strings file_name |grep DBID= to find DBID.

Examples:
-----------------

Both of these example is based on UNIX scenario.
I - RMAN> backup datafile 1;

Starting backup at 06-AUG-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=123 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oradata1/arju/datafiles/ARJU/system01.dbf
channel ORA_DISK_1: starting piece 1 at 06-AUG-13
channel ORA_DISK_1: finished piece 1 at 06-AUG-13
piece handle=/backup/rman_bkp/bkp_jjsk_TAG20130806T025704_46zwk6p8j_.bkp
RMAN> exit;
Recovery Manager complete.

bash-3.00$ strings
/backup/rman_bkp/bkp_jjsk_TAG20130806T025704_46zwk6p8j_.bkp |grep MAXVALUE,
.
.

236329879, MAXVALUE,

So here 236329879 is the DBID.

II - RMAN> backup as copy datafile 2;

Starting backup at 06-AUG-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=123 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00002 name=/oradata/krish/undotbs01.dbf
output filename=/backup/rman_bkp/o6_kg_undotbs1_41kghtx6_.dbf

bash-3.00$ strings
/backup/rman_bkp/o6_kg_undotbs1_41kghtx6_.dbf
|grep MAXVALUE

236329879 , MAXVALUE

Here 236329879 is the DBID

III - From physical data file you can also follow the same method.
From sysaux datafile,
bash-3.00$ strings /oradata/krish/sysaux01.dbf |grep DBID=
connected to target database: KRISH (DBID=236329879 , not open)
Here 236329879 is the DBID.

IV - From whole database backup you can also follow same method.
RMAN> BACKUP DATABASE;

Starting backup at 06-AUG-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=145 devtype=DISK
.
.
piece handle=/backup/rman_bkp/o6_kg_yyyfs_TAG20130806T01436_51udskgk.bkp

bash-3.00$ strings
/backup/rman_bkp/o6_kg_yyyfs_TAG20130806T01436_51udskgk.bkp |grep MAXVALUE,

.
.
236329879 , MAXVALUE,

Here 236329879 is the DBID.

RMAN-Recover database after only lose of all controlfiles

Recover database after only lose of all controlfiles

This example is based on,
You have lost all your current and backup of controlfile.
You have avaiable your current data files.
You have available your online redo log files.


In the scenario, I will show the procedure of how to recover database if you lose your all copies of controlfiles and you don't have any backup of your controlfile.

Let's start by deleting controlfile of my running database.

1.In order to know the controlfiles of my database issue,
SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/oradata2/arjudba/arjudba/control01.ctl
/oradata2/arjudba/arjudba/control02.ctl
/oradata2/arjudba/arjudba/control03.ctl

2.Delete all copies of controlfile. Here with one command I have deleted. But before deleting with one such command be conscious that this command will not delete other important files. You can delete files one by one.
SQL> !rm /oradata2/arjudba/arjudba/control0*

3.Now let's see whether controlfile is available or not by issuing following command.
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 314572800 bytes
Fixed Size 2020416 bytes
Variable Size 121637824 bytes
Database Buffers 184549376 bytes
Redo Buffers 6365184 bytes
ORA-00205: error in identifying control file, check alert log for more info

As it can't read controlfile so ORA-00205 arises.

4.From this state is your situation what you need to do. If you have previously issued ALTER DATABASE BACKUP CONTROLFILE TO TRACE then use that file and modify. If you don't have any backup of controlfile then you have to create a new one as below. Note that you have to remember the name of datafile and online redo log file.
-bash-3.00$ vi /oradata2/ctl.ctl
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ARJUDBA" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/oradata2/arjudba/arjudba/redo01.log' SIZE 50M,
GROUP 2 '/oradata2/arjudba/arjudba/redo02.log' SIZE 50M,
GROUP 3 '/oradata2/arjudba/arjudba/redo03.log' SIZE 50M
DATAFILE
'/oradata2/arjudba/arjudba/system01.dbf',
'/oradata2/arjudba/arjudba/undotbs01.dbf',
'/oradata2/arjudba/arjudba/sysaux01.dbf',
'/oradata2/arjudba/arjudba/users01.dbf'
CHARACTER SET WE8ISO8859P1
;

5.Save the script and run it inside SQL*plus.
SQL> @/oradata2/ctl.ctl
ORA-01081: cannot start already-running ORACLE - shut it down first

Control file created.

6. At this stage your database is mounted. You need to recover it.
SQL> recover database;
Media recovery complete.

7.Open the database after recovery completes.
SQL> alter database open;
Database altered.

8.As Create controlfile statement does not include Temp tablespace you may need to add it.
SQL>ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata2/arjudba/arjudba/temp01.dbf'
SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;

RMAN-(recovery scenario):lost all the data files, control files, redo log file and spfile

Restore and Recover database in Noarchivelog Mode

Before proceed we need to know while restoring data in noarchivelog mode that,

1)Only cold backups (that is, backups created when the database was shut down normally) can be used in restoring a database in NOARCHIVELOG mode.

2)Media recovery is not possible, because there are no archived logs.

3)If we exclude any tablespace except read-only or offline from taking database backup then those tablespaces will be lost.

In this scenario I have lost all the data files, control files, redo log file and spfile. I have also forgot DBID of the database. The procedure of restore and recovery of database in noarchivelog mode in as below.

A)Find the DBID of the Database from Backup Piece.
bash-3.00$ strings /oradata2/flash_recovery_area/DBASE1/backupset/2008_05_06/o1_mf_nnndf_TAG20080506T111057_420x821v_.bkp |grep MAXVALUE,

3386862614, MAXVALUE,


We got DBID here 3386862614. For more details have a look How to find DBID

B)Connect to target database with RMAN


bash-3.00$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Tue May 6 12:50:07 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database (not started)

C)Set the DBID.


RMAN> set dbid 3386862614

executing command: SET DBID

D)Start the database in nomount stage with dummy Parameter.


RMAN> startup force nomount

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/oracle/app/oracle/product/10.2.0/db_1/dbs/initdbase1.ora'

starting Oracle instance without parameter file for retrival of spfile
Oracle instance started

Total System Global Area 159383552 bytes

Fixed Size 2019224 bytes
Variable Size 67108968 bytes
Database Buffers 83886080 bytes
Redo Buffers 6369280 byte

E)Restore spfile


RMAN> restore spfile from '/oradata2/flash_recovery_area/DBASE1/autobackup/2008_05_06/o1_mf_s_653998009_420shstm_.bkp';

Starting restore at 06-MAY-08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK

channel ORA_DISK_1: autobackup found: /oradata2/flash_recovery_area/DBASE1/autobackup/2008_05_06/o1_mf_s_653998009_420shstm_.bkp
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 06-MAY-08

F)Mount the Database.

RMAN> startup force nomount;

Oracle instance started
Total System Global Area 209715200 bytes
Fixed Size 2019608 bytes
Variable Size 100667112 bytes
Database Buffers 100663296 bytes
Redo Buffers 6365184 bytes

G)Restore controlfile.
RMAN> restore controlfile from autobackup;


Starting restore at 06-MAY-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK

recovery area destination: /oradata2/flash_recovery_area
database name (or database unique name) used for search: DBASE1
channel ORA_DISK_1: autobackup found in the recovery area
channel ORA_DISK_1: autobackup found: /oradata2/flash_recovery_area/DBASE1/autobackup/2008_05_06/o1_mf_s_654001832_420xbfr6_.bkp
channel ORA_DISK_1: control file restore from autobackup complete
output filename=/oradata2/data1/dbase1/control01.ctl
output filename=/oradata2/data1/dbase1/control02.ctl
output filename=/oradata2/data1/dbase1/control03.ctl
Finished restore at 06-MAY-08

H)Mount the Database.
RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

I)Restore Database.

As we have flash recovery area configured so it automatically cataloged backup sets.
RMAN> restore database;


Starting restore at 06-MAY-08
Starting implicit crosscheck backup at 06-MAY-08
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 12 objects
Finished implicit crosscheck backup at 06-MAY-08

Starting implicit crosscheck copy at 06-MAY-08
using channel ORA_DISK_1
Finished implicit crosscheck copy at 06-MAY-08

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /oradata2/flash_recovery_area/DBASE1/autobackup/2008_05_06/o1_mf_s_654001832_420xbfr6_.bkp

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oradata2/data1/dbase1/system01.dbf
restoring datafile 00002 to /oradata2/data1/dbase1/undotbs01.dbf
restoring datafile 00003 to /oradata2/data1/dbase1/sysaux01.dbf
restoring datafile 00004 to /oradata2/data1/dbase1/users01.dbf
restoring datafile 00005 to /oradata2/DBASE1/datafile/o1_mf_tbs2_41vyzfrq_.dbf
restoring datafile 00006 to /oradata2/DBASE1/datafile/o1_mf_after_on_420r4f9h_.dbf
restoring datafile 00007 to /oradata2/DBASE1/datafile/o1_mf_after_on_420r675z_.dbf
restoring datafile 00008 to /oradata2/DBASE1/datafile/o1_mf_after_on_420x2yw8_.dbf
channel ORA_DISK_1: reading from backup piece /oradata2/flash_recovery_area/DBASE1/backupset/2008_05_06/o1_mf_nnndf_TAG20080506T111057_420x821v_.bkp
ORA-19870: error reading backup piece /oradata2/flash_recovery_area/DBASE1/backupset/2008_05_06/o1_mf_nnndf_TAG20080506T111057_420x821v_.bkp
ORA-19612: datafile 1 not restored due to missing or corrupt data
failover to previous backup

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oradata2/data1/dbase1/system01.dbf
channel ORA_DISK_1: reading from backup piece /oradata2/flash_recovery_area/DBASE1/backupset/2008_05_05/o1_mf_nnnd0_LEVEL_0_BACKUP_41yo0jl9_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/oradata2/flash_recovery_area/DBASE1/backupset/2008_05_05/o1_mf_nnnd0_LEVEL_0_BACKUP_41yo0jl9_.bkp tag=LEVEL_0_BACKUP
channel ORA_DISK_1: restore complete, elapsed time: 00:00:56
Finished restore at 06-MAY-08

J)Recover Database:

If the current online logs contain all changes since the last backup , then you can run RECOVER DATABASE without specifying NOREDO. Otherwise you have to specify RECOVER DATABASE NOREDO.

RMAN> recover database;

Starting recover at 06-MAY-08
using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 11 is already on disk as file /oradata2/data1/dbase1/redo01.log
archive log thread 1 sequence 12 is already on disk as file /oradata2/data1/dbase1/redo02.log
archive log thread 1 sequence 13 is already on disk as file /oradata2/data1/dbase1/redo03.log
archive log filename=/oradata2/data1/dbase1/redo01.log thread=1 sequence=11
archive log filename=/oradata2/data1/dbase1/redo02.log thread=1 sequence=12
archive log filename=/oradata2/data1/dbase1/redo03.log thread=1 sequence=13
media recovery complete, elapsed time: 00:00:12
Finished recover at 06-MAY-08

K)Open the database with RESETLOGS options.

RMAN> alter database open resetlogs;

database opened.

RMAN-controlfile recovery scenarios

How to Restore the Controlfile from Backup.

If you loss or if your all copies of control file is corrupted and if you have backup of your control file then it is required to restore your control file from your backup.

Restore control file to default location:
----------------------------------------------

The default location is defined by CONTROL_FILES parameter of pfile/spfile. If you don't specify any location while restoring your control file then the control file will be restored to the location set by CONTROL_FILES parameter. TO determine DBID checkhttp://oracledatabasegrid.blogspot.in/2013/08/how-to-discover-find-dbid.html

RMAN>SET DBID 236329879
RMAN> RUN {
RESTORE CONTROLFILE FROM AUTOBACKUP;
}

Restore of the Control File from Control File Autobackup
-------------------------------------------------------------

If you are not using a recovery catalog, you must restore your control file from an autobackup. The database must be in a NOMOUNT state. And you have to set DBID. RMAN uses the autobackup format and DBID to determine where to find for the control file autobackup.

RMAN>SET DBID 236329879
RMAN> RUN {
SET CONTROLFILE AUTOBACKUP FORMAT
FOR DEVICE TYPE DISK TO 'autobackup_format';
RESTORE CONTROLFILE FROM AUTOBACKUP;
}

Restore of the Control File When Using a Flash Recovery Area
---------------------------------------------------------------------

Suppose you restored a backup of the control file. Now in that control file the backup information may not updated/full. May be it contains only current backup information of that session while taking backup. If you use flash recovery area then RMAN automatically catalog the backups in the flash recovery area. As a result the restored control file has a complete and accurate record of all backups in your flash recovery area and any other backups that were known to the control file at the time of the backup.

Restoring a Control File When Using a Recovery Catalog
------------------------------------------------------------------

The recovery catalog contains a complete record of your backups, including backups of the control
file. Therefore, you do not have to specify your DBID or control file autobackup format.
Just use,

$rman TARGET / CATALOG catdb/catdb
RMAN> RESTORE CONTROLFILE;

Restore of the Control File From a Known Location
-----------------------------------------------------

If you know the backuppiece of controlfile or any copy then simply you can use,

RMAN> RESTORE CONTROLFILE from 'filename';

Restore of the Control File to a New Location
---------------------------------------------------

In prior cases RMAN restore the control file to the location specified by CONTROL_FILES parameter of the spfile or pfile.

If you want to restore the control file to another location use,
RMAN>RESTORE CONTROLFILE TO 'give_here_new_location';

You can also change CONTROL_FILES parameter and then perform RESTORE CONTROLFILE to change location.

Limitations When Using a Backup Control File
------------------------------------------------

After you restore your database using a backup control file, you must run RECOVER DATABASE and perform an OPEN RESETLOGS on the database.








ORA-00214: Controlfile Version Inconsistent on Startup or Shutdown

Problem Description:
ORA-00214: control file {name} version {num} inconsistent with file {name}.

Cause of The Problem:
Oracle detects an inconsistency between the mirrored copies of the control file.

All copies of the control file must have the same internal sequence number for oracle to start up the database or shut it down in normal or immediate mode.

If the database is running and the checkpoint in the file header could not be advanced the datafile will be taken offline.

Typical scenarios in which you may receive an ORA-00214 include:

1. You have restored the control file from backup, but forgot to copy it onto all of the mirrored copies of the control file as listed in the "CONTROL_FILES" parameter in the initialization parameter.

2. You have moved one or more copies of the control file to a different location while the database was up and running.

3. You accidentally overwrote one of the copies of the control file with an old copy.

4. The database or the system crashed while the mirrored copies of the control file were being updated, causing them to be out of sync.

5. You are restoring a database backup that was improperly taken with the database up and running ("fuzzy" backup).

Solution of the Problem:
To fix the error start your database with single copy of the control file and then shut the database down and then copy the version of good copy of control file onto the other mirror copies.


Step 01)
If database is still up do a shutdown abort.

Step 02)
If you use pfile then edit the CONTROL_FILES parameter from init.ora and modify it to include just one copy of control file.

If you use spfile then after issuing startup nomount use show control_files to see existing controlfiles inside spfile and then you can use ALTER SYSTEM SET CONTROL_FILES=file_name; in order to point just one copy of control file.

Step 03)
Start the database in restricted mode. startup restrict
If it is fine go to step 04.

If instead you get ORA-1122, ORA-1110, and ORA-1207, go back to step 2 and try with another control file.

If you have already tried each and every one of the mirrored copies unsuccessfully, you must create a new control file for the database.

If you get ORA-1113 and ORA-1110 pointing to one of the datafiles, it means the copy of the control file you picked is good, but the referenced datafile must be recovered before the database can be opened.Then RECOVER DATBASE, apply the log it prompt and ALTER DATABASE OPEN.

Step 04) Shut the database down.
SQL>shutown

Step 05)
Copy the good mirrored copy of the control file that you just used to bring the database up onto all other copies, as originally listed in the CONTROL_FILES parameter of your init.ora file.

Step 06) Edit the init.ora file's CONTROL_FILES parameter to include all mirror copy again.

Step 07) Start the database.



Controlfile in Oracle Database.

Every database has a control file which is a binary file that records the physical structure of the database. Control file is called the heart of the database.

The control file includes:

• The database name.

• Names and locations of associated datafiles and redo log files.

• The timestamp of the database creation.

• The current log sequence number.

• Checkpoint information.

• Information of the tablespaces.

• Datafile offline ranges.

• The log history.

• Archived log information.

• Database backup information taken through RMAN.

• The current log sequence number.

• Datafile copy information.

How to see the control file Contents:
--------------------------------------


Control file creation sql command/syntax can be seen by,

alter database backup controlfile to trace as '/u01/ctrl.txt'


After issuing the command if you open /u01/ctrl.txt you will see the sql script of creation controlfile.

If you don't use trace suppose you use,
alter database backup controlfile as '/u01/ctrl.txt' then you will get a duplicate binary copy of the current control file.



New Feature of 10.2g: Eliminate Control File Re-Creation

Before Oracle 10.2g if we need to change the limit of MAXLOGFILE, MAXLOGMEMBERS, MAXLOGHISTORY, MAXDATAFILES, and MAXINSTANCES then the possible solutions is either RE-create new controlfile or create a new database.

But from Oracle 10.2g all sections of the control file are now automatically extended when they run out of space. This means that there is no longer a requirement to re-create the control file when changes in the configuration parameter the MAXLOGFILE, MAXLOGMEMBERS, MAXLOGHISTORY, MAXDATAFILES, and MAXINSTANCES are needed.

Two different Sections of Control file:
--------------------------------------------


1)Circularly reusable Sections:
The CONTROL_FILE_RECORD_KEEP_TIME specifies the minimum number of days before a reusable record in the control file can be reused. Example of circularly reusable records are archive log records and various backup records.

2)Not circularly reusable Sections:
Records such as datafile, tablespace, and redo thread records, which are never reused unless the corresponding object is dropped from the tablespace.

For the circularly reusable sections the behaviour remain same with previous version.

The new feature in Oracle 10.2g is that for the non-reusable records we now also extend the control file size if we go over the previous limit.

Though the values for MAXLOGFILE, MAXLOGMEMBERS,MAXLOGHISTORY, MAXDATAFILES, and MAXINSTANCES are still useful since they initialize the control file at a certain size, but they no longer set a hard limit for the number of records in the control file.

Therefore 10.2g onwards, we can get rid of re-creating controlfile whenever we need change parameter like MAXLOGFILE, MAXLOGMEMBERS,MAXLOGHISTORY, MAXDATAFILES, and MAXINSTANCES and keep the database alive.




Creating controlfile fails with ORA-01503, ORA-01161

Error Description
While creating cloning database I have modified controlfile contents as below where I like to change my database name to krishna.

STARTUP NOMOUNT PFILE='F:\PFILE.ORA'
CREATE CONTROLFILE REUSE DATABASE "krishna" RESETLOGS ARCHIVELOG
.
.
.

'F:\ORACLE\KRISHNA\SYSTEM01.DBF',
.
.
.
CHARACTER SET WE8MSWIN1252
;

Now I ran this script to create controlfile and it fails
SQL> @f:\controlfile.ctl
ORACLE instance started.

Total System Global Area 104857600 bytes
Fixed Size 1247516 bytes
Variable Size 71304932 bytes
Database Buffers 25165824 bytes
Redo Buffers 7139328 bytes
CREATE CONTROLFILE REUSE DATABASE "krishna" NORESETLOGS ARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01161: database name krishna in file header does not match given name of
krish
ORA-01110: data file 1: 'F:\ORACLE\krish\SYSTEM01.DBF'
Cause of The Problem
Control file script has been changed, more specifically database name has been changed.

Solution of the Problem
To create the new controlfile for the new database you must use the word 'SET'
in the CREATE CONTROLFILE COMMAND. The SET DATABASE command is what enables the
changes to the name of the database. So the script will be like below
STARTUP NOMOUNT PFILE='F:\PFILE.ORA'
CREATE CONTROLFILE REUSE SET DATABASE "krishna" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 'F:\ORACLE\KRISHNA\REDO01.LOG' SIZE 50M,
GROUP 2 'F:\ORACLE\KRISHNA\REDO02.LOG' SIZE 50M,
GROUP 3 'F:\ORACLE\KRISHNA\REDO03.LOG' SIZE 50M
DATAFILE
'F:\ORACLE\KRISHNA\SYSTEM01.DBF',
'F:\ORACLE\KRISHNA\UNDOTBS01.DBF',
'F:\ORACLE\KRISHNA\SYSAUX01.DBF',
'F:\ORACLE\KRISHNA\USERS01.DBF',
'F:\ORACLE\KRISHNA\EXAMPLE01.DBF',
'F:\ORACLE\KRISHNA\TEST_TBS01.DBF'
CHARACTER SET WE8MSWIN1252
;
Now run this will successfully run,
SQL> @f:\controlfile.ctl
ORACLE instance started.

Total System Global Area 104857600 bytes
Fixed Size 1247516 bytes
Variable Size 71304932 bytes
Database Buffers 25165824 bytes
Redo Buffers 7139328 bytes

Control file created.



Recover database after only lose of all controlfiles

This example is based on,
You have lost all your current and backup of controlfile.
You have avaiable your current data files.
You have available your online redo log files.


In the scenario, I will show the procedure of how to recover database if you lose your all copies of controlfiles and you don't have any backup of your controlfile.

Let's start by deleting controlfile of my running database.

1.In order to know the controlfiles of my database issue,
SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u01/krishna/control01.ctl
/u01/krishna/control02.ctl
/u01/krishna/control03.ctl

2.Delete all copies of controlfile. Here with one command I have deleted. But before deleting with one such command be conscious that this command will not delete other important files. You can delete files one by one.
SQL> !rm /u01/krishna/control0*

3.Now let's see whether controlfile is available or not by issuing following command.
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 314572800 bytes
Fixed Size 2020416 bytes
Variable Size 121637824 bytes
Database Buffers 184549376 bytes
Redo Buffers 6365184 bytes
ORA-00205: error in identifying control file, check alert log for more info

As it can't read controlfile so ORA-00205 arises.

4.From this state is your situation what you need to do. If you have previously issued ALTER DATABASE BACKUP CONTROLFILE TO TRACE then use that file and modify. If you don't have any backup of controlfile then you have to create a new one as below. Note that you have to remember the name of datafile and online redo log file.
-bash-3.00$ vi /u01/krishna/control_file.ctl
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "krishna" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/u01/krishna/redo01.log' SIZE 50M,
GROUP 2 '/u01/krishna/redo02.log' SIZE 50M,
GROUP 3 '/u01/krishna/redo03.log' SIZE 50M
DATAFILE
'/u01/krishna/system01.dbf',
'/u01/krishna/undotbs01.dbf',
'/u01/krishna/sysaux01.dbf',
'/u01/krishna/users01.dbf'
CHARACTER SET WE8ISO8859P1
;

5.Save the script and run it inside SQL*plus.
SQL> @/u01/krishna/control_file.ctl
ORA-01081: cannot start already-running ORACLE - shut it down first

Control file created.

6. At this stage your database is mounted. You need to recover it.
SQL> recover database;
Media recovery complete.

7.Open the database after recovery completes.
SQL> alter database open;
Database altered.

8.As Create controlfile statement does not include Temp tablespace you may need to add it.
SQL>ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/krishna/temp01.dbf'
SIZE 100M REUSE AUTOEXTEND ON NEXT 100 MAXSIZE 1024M;



RMAN ERRORS


PL/SQL package CATDBA.DBMS_RCVCAT version 11.02.00.02 in RCVCAT database is not current

Problem Description
While starting Oracle RMAN backup whenever we use catalog database as repository it fails with following errors:
$rman target / catalog catdba@RMAN

Recovery Manager: Release 11.2.0.3.0 - Production on Tue Nov 22 22:30:47 2011

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: SPMDP (DBID=2694055214)
recovery catalog database Password:
connected to recovery catalog database
PL/SQL package CATDBA.DBMS_RCVCAT version 11.02.00.02 in RCVCAT database is not current
PL/SQL package CATDBA.DBMS_RCVMAN version 11.02.00.02 in RCVCAT database is not current

Depending on the version of the RMAN-catalog schema version there might notice following errors.
PL/SQL package RMAN.DBMS_RCVCAT version 11.01.00.07 in RCVCAT database is not current
PL/SQL package RMAN.DBMS_RCVMAN version 11.01.00.07 in RCVCAT database is not current
or,
PL/SQL package RMAN.DBMS_RCVCAT version 11.02.00.01 in RCVCAT database is not current
PL/SQL package RMAN.DBMS_RCVMAN version 11.02.00.01 in RCVCAT database is not current

Whenever it is issued "register database" it fails with following error:
RMAN> register database;

DBGSQL: RCVCAT> begin dbms_rcvman.dumpPkgState('RCVMAN after sqlerror'); end;
DBGSQL: sqlcode = 6550

DBGSQL: RCVCAT> begin dbms_rcvcat.dumpPkgState('RCVCAT after sqlerror');end;
DBGSQL: sqlcode = 6550
database registered in recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03008: error while performing automatic resync of recovery catalog
RMAN-10015: error compiling PL/SQL program
RMAN-10014: PL/SQL error 0 on line 1655 column 12: Statement ignored
RMAN-10014: PL/SQL error 306 on line 1655 column 12: wrong number or types of arguments in call to 'CHECKTABLESPACE'

Resync catalog also fails with following error:
RMAN> resync catalog;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of resync command on default channel at 11/22/2011 23:09:07
RMAN-10015: error compiling PL/SQL program
RMAN-10014: PL/SQL error 0 on line 1655 column 12: Statement ignored
RMAN-10014: PL/SQL error 306 on line 1655 column 12: wrong number or types of arguments in call to 'CHECKTABLESPACE'

Recent Changes
The target database has been recently upgrades and so RMAN executable is upgraded but catalog database is not aware of this upgrade.

Cause of the Problem
The problem happened due to version mismatch between the RMAN-executable and the RMAN-catalog SCHEMA.

Solution of the Problem
Solution 01:
Upgrade the RMAN catalog SCHEMA. Start the RMAN-executable from the ORACLE_HOME which has been upgraded. There is only a connection to the CATALOG required.
A connection to the TARGET is optional.

For example issue,
$ rman catalog $RMAN_USERID/$RMAN_PASSWD@$RMAN_CONN_STR
RMAN> upgrade catalog;
Solution 02:
Don't use catalog for backup information. So run backup without connecting catalog database.
$ rman target /
$ backup database;


RMAN Backup on RAC fails with ORA-00245: control file backup operation failed

Problem Description
In Oracle database version 11.2g RMAN Backup on RAC database fails with following errors while doing controlfile autobackup.

RMAN-00571: =========================================================== 
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== 
RMAN-00571: =========================================================== 
RMAN-03009: failure of Control File and SPFILE Autobackup command on 
ORA_DISK_1 channel at 301/10/2011 12:10:12 
ORA-00245: control file backup operation failed
While backing up through Sql*plus ORA-00245 error also returned.
alter database backup controlfile to '/oracle/cntl_file' 
ERROR at line 1:
ORA-00245: control file backup operation failed
Cause of the Problem
From Oracle documentation we get following information about the error ORA-00245.

ORA-00245 "control file backup failed; target is likely on a local file system"
// *Cause: Failed to create a control file backup because some process
// signaled an error during backup creation. This is likely caused
// by the backup target being on a local file system so it could not
// be accessed by other instances. It can also be caused by other
// I/O errors to the backup target. Any process of any instance that
// starts a read/write control file transaction must have access
// to the backup control file during backup creation.
// *Action: Check alert files of all instances for further information.

RMAN creates a copy of the control file for read consistency, this is the snapshot controlfile. Due to the changes made to the controlfile backup mechanism in 11gR2 any instances in the cluster may write to the snapshot controlfile. Therefore, the snapshot controlfile file needs to be visible to all instances.

The same happens when a backup of the controlfile is created directly from sqlplus any instance in the cluster may write to the backup controfile file.

In 11gR2 onwards, the controlfile backup happens without holding the control file enqueue. For non-RAC database, this doesn't change anything.

But, for RAC database, the snapshot controlfile location must be in a shared file system that will be accessible from all the nodes. So if you put your snapshot controlfile in local file system and if that file are not accessible to other nodes of the RAC database you will likely face Oracle error ORA-00245.

Solution of the Problem
The snapshot controlfile must be accessible by all nodes of a RAC database. If the snapshot controlfile does not reside in on a shared device this error will raise.

1. Check the existing snapshot controlfile location:

rman> show all;

2. Configure the snapshot controlfile to a shared disk:

rman> CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'shared_disk/snapcf.f'; # default

RMAN-20070 on RESYNC or CROSSCHECK archivelog

Problem Description
After switchover operation standby database now becomes primary database and now database backups, crosscheck archivelog all on new primary database fails with error RMAN-20070.

RMAN> CROSSCHECK archivelog all;

starting full resync of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of crosscheck command at 30/10/2011 12:13:00
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of full resync command on default channel at 30/10/2011 12:13:00
RMAN-20070: invalid log history sequence#
Cause of the Problem
This issue is due to Oracle Bug:4755799 RMAN-20070 ERROR ON PRIMARY AFTER DATAGUARD SWITCHOVER

RMAN-20070 can occur during RMAN resync after a dataguard switchover. Also this bug can appear on using CROSSCHECK as it also implies a resync.
This bug remains in,
9.2.0.4 to 9.2.0.8
10.1 to 10.1.0.4
10.2.0.1 to 10.2.0.2
However, this issue does not affect 10.1.0.5, 10.2.0.3 or higher, and 11g.

Solution of the Problem
Workaround:
Disable the rlh_u2 constraint after connecting to the recovery catalog schema.

$ sqlplus rman/rman@catalog_db
SQL> alter table rlh modify constraint rlh_u2 disable ;

Fix:
- Upgrade to 11g, 10.2.0.3 or 10.1.0.5 (fixed versions)
- Apply patch 4755799 if it is available for your platform and release.

RMAN-20032 while taking backup using RMAN with catalog

Problem Description
Backup of Oracle database using RMAN with catalog fails with RMAN-20032:
RMAN-00571: =========================================================== 
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== 
RMAN-00571: =========================================================== 
RMAN-03002: failure of show command at 30/10/2011 10:21:12 
RMAN-03014: implicit resync of recovery catalog failed 
RMAN-03009: failure of full resync command on default channel at 30/10/2011 10:21:12
RMAN-20032: checkpoint change# too low

Cause of the Problem
Database was resorted from the cold backup. Catalog can not be reseted for this change.
Reset database will not work as open resertlogs is a prerequisite for reset.

Solution of the Problem
$ rman TARGET / CATALOG rman/password@catalog
RMAN> UNREGISTER DATABASE NOPROMPT;
RMAN> REGISTER DATABASE;

ORA-30036 error in undo tablespace during RMAN backup

Problem Description
During Oracle RMAN database backup ORA-30036 error is raised.
starting full resync of recovery catalog 
RMAN-00571: =========================================================== 
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== 
RMAN-00571: =========================================================== 
RMAN-03002: failure of show command at 30/10/2011 10:32:12 
RMAN-03014: implicit resync of recovery catalog failed 
RMAN-03009: failure of full resync command on default channel at 30/10/2011 10:32:12
ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDOTBS1' 
The funny thing is error is not reported in alert log and does not generate trace files.

Cause of the Problem
The problem happened due to oracle bug 8416270 - ORA-30036 DURING RMAN RESYNC.

Solution of the Problem
Workaround of this bug is to turn off undo autotune hidden parameter in init.ora:

_undo_autotune = false

If you are using spfile, then you have to issue,

alter system set "_undo_autotune" = false scope=spfile;
shutdown immediate
startup


Note that, with _undo_autotune=false, statistics tracking on UNDO is no longer available (for example, in V$UNDOSTAT).

RMAN backup using catalog database terminates with deadlock Error ORA-00060

Problem Description
RMAN backups that use catalog database fails with following deadlock errors.
RMAN-00571: =========================================================== 
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== 
RMAN-00571: =========================================================== 
RMAN-03002: failure of backup plus archivelog command at 30/10/2011 12:00:40 
RMAN-03014: implicit resync of recovery catalog failed 
RMAN-03009: failure of partial resync command on default channel at 30/10/2011 12:00:40
ORA-00060: deadlock detected while waiting for resource 
Dead lock trace file contains the following statement

DELETE FROM CKP WHERE DBINC_KEY = :B1 AND CKP_KEY IN (SELECT CKP_KEY1 FROM
(SELECT CKP_KEY CKP_KEY1 FROM CKP WHERE DBINC_KEY = :B1 ) CKP1, (SELECT :B2
CKP_KEY2 FROM DUAL UNION SELECT :B3 FROM DUAL UNION SELECT NVL(MAX(CKP_KEY),0) F
ROM CKP WHERE DBINC_KEY=:B1 UNION SELECT START_CKP_KEY FROM TSATT WHERE DBINC_KE
Y = :B1 UNION SELECT NVL(END_CKP_KEY,0) FROM TSATT WHERE DBINC_KEY = :B1 UNION S
ELECT START_CKP_KEY FROM DFATT WHERE DBINC_KEY = :B1 UNION SELECT NVL(END_CKP_KE
Y,0) FROM DFATT WHERE DBINC_KEY = :B1 UNION SELECT START_CKP_KEY FROM TFATT WHER
E DBINC_KEY = :B1 UNION SELECT NVL(END_CKP_KEY,0) FROM TFATT WHERE DBINC_KEY = :
B1 ) CKP2 WHERE CKP_KEY1 = CKP_KEY2(+) AND CKP_KEY2 IS NULL)

Cause of the Problem
Oracle is buggy product. And this issue is due to Bug 6830296.

Solution of Problem
Workaround
In RMAN catalog database create the following indexes :

CREATE INDEX tfatt_i_sck on tfatt(start_ckp_key) ;
CREATE INDEX tfatt_i_eck on tfatt(end_ckp_key) ;

You can also check for availability of one off patch 6830296.

RMAN backup fails with errors RMAN-03014 RMAN-03009 ORA-01580 ORA-27037

Problem Description
Oracle database backup and maintenance commands fail with following errors:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of show command at 30/10/2011 19:26:33
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of full resync command on default channel at 30/10/2011 19:26:33
ORA-01580: error creating control backup file /u011/app/oracle/admin/BDDBA/snapctl/
ORA-27037: unable to obtain file status
SVR4 Error: 20: Not a directory
Additional information: 6
Cause of the Problem
The error occurred due to wrong name in snapshot control file. You have to specify full name of snapshot control file including file name. By default snapshot controlfile name is '$ORACLE/HOME/dbs/snapcf_$ORACLE_SID.f'. Instead of snapshot controlfile name if only the directory is given, you will see above errors.

For example if you specify following command in RMAN you will face this error.
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u011/app/oracle/admin/BDDBA/snapctl';

Because here file name is not given, only the location is specified in the configure snapshot controlfile name.

Solution of the Problem
Connect to RMAN with nocatalog option and then set the snapshot controlfile to the proper location and specify name.

$ rman target / nocatalog
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u011/app/oracle/admin/BDDBA/snapctl/snapcf_ora10g.f';


Once the snapshot controlfile name is set properly; the backups or maintenance operation can be performed successfully without any error.


ORA-3135: connection lost contact during RMAN backup

Problem Description
Database version is 10.2.0.3 and it is 5 nodes RAC on Red Hat Enterprise Linux. RMAN backup is integrated with Veritas Netbackup 5.1 (MP6). Whenever run backup operation is going to be hanged for long periods of time and then generates error:

ORA-3135: connection lost contact

once if we kill the backup job everything goes back to normal.

Investigation
From the OEM ADDM it is found followings:

FINDING 1: 100% impact (98213 seconds)
---------------------------------------------
Wait class "Scheduler" was consuming significant database time.

Cause of the Problem
This is Oracle bug specifically Bug 6874858 Poor performance with Resource Manager when RMAN is running. When RMAN is running with Resource Manager enabled, the performance of the system may degrade. Users may have problems logging in. When this occurs large waits will be seen with the wait event "resmgr:cpu quantum" with low CPU utilization.

Solution of the Problem
Workaround you can disable Oracle Resource Manager.
However this bug is fixed in following versions:

- 11.2.0.1 (Base Release)
- 11.1.0.7 (Server Patch Set)
- 10.2.0.5 (Server Patch Set)
- 11.1.0.6 Patch 11 on Windows Platforms
- 10.2.0.4 Patch 41 on Windows Platforms

So upgrade to your Oracle database is another solution.


RMAN backup Fails with ORA-19510 and ORA-27046

Problem Description
RMAN backup failed with error message RMAN-03009, ORA-19510 and ORA-27046.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on channel1 channel at 20/12/2010 01:22:21
ORA-19510: failed to set size of 262143 blocks for file "/backup/database/prod/hot_backup.rman" (blocksize=)
ORA-27046: file size is not a multiple of logical block size
Additional information: 2

Cause of the Problem
Note that, there are several variants of this ORA-19510 error. You can search for ORA-19510 within my blog. In this case problem started due to the operating system size limit. RMAN backup piece size exceed the max file size limit of the O/S.

Solution of the Problem
Make sure that rman backup piece won't exceed the O/S permitted filesize limit. You can restrict the rman backup piece using the MAXPIECESIZE option.
For example in RMAN prompt issue,

RMAN> Configure channel device type disk MAXPIECESIZE = 2G;
And then run your backup command again.

RMAN> backup database ;

ORA-19510, ORA-27044 HP-UX Error: 2: No such file or directory

Problem Description
While taking RMAN backup it fails with following message.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on channel1 channel at 12/20/2010 01:30:21
ORA-19510: failed to set size of 6410 blocks for file "/backup/PROD_DATABASE/rman/PROD_tdatabase_s2398_LVL_1" (blocksize=8192)
ORA-27044: unable to write the header block of file
HP-UX Error: 2: No such file or directory
Additional information: 7
ORA-19510: failed to set size of 4294967295 blocks for file "/backup/PROD_DATABASE/rman/PROD_tdatabase_s2398_LVL_1" (blocksize=8192)
ORA-27044: unable to write the header block of file


Cause of the Problem
The backup fails as there is no space available on the disk.

Solution of the Problem
Check the space where you are taking RMAN backup. For example, in this case we see backup is generated in the location /backup/PROD_DATABASE/rman/ so check disk space usage or free disk space remained into /backup partition. You can check space usage on unix file system by using du -sh * comamnd. You can also issue,
$df -h
to see free space available.
In order to take backup you need to delete unnecessary files from the partition.

RMAN-03009, ORA-19510, ORA-27037, IBM AIX RISC System/6000 Error

Problem Description
While taking RMAN backup it fails with following errors:
RMAN-03009: failure of backup command on DISK1 channel at 09/19/2005 19:51:02
ORA-19510: failed to set size of 268930 blocks for file
"/backup/rman/backup/full/rman_complete_backup" (blocksize=8192)
ORA-27037: unable to obtain file status
IBM AIX RISC System/6000 Error: 2: No such file or directory
Additional information: 5
Cause of the Problem
The problem occurred because backup piece is being removed from disk before the backup finished. That means backup piece is deleted before RMAN completely finishes creating it. In fact there was a scheduled cron purge job that conflicted with the RMAN backup and was removing the piece before RMAN finished creating it.

Solution of the Problem
The solution is schedule the cron purge job to run at a different time to allow the RMAN backup job to complete or remove the cron purge job entirely.

RMAN-03002, RMAN-06059, ORA-19625 and ORA-27037 during RMAN archivelog backup

Problem Description
Starting backup at 19-OCT-2010 00:31:37
current log archived
released channel: channel1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 10/19/2010 00:32:03
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /u01/app/oracle/admin/ORACLE/arch/arch_94049.log
ORA-27037: unable to obtain file status
HP-UX Error: 2: No such file or directory
Additional information: 3
Cause of the Problem
The problem happened because Oracle archivelog files were deleted at OS level.

Solution of the Problem
Run following commands in your RMAN prompt to resolve the issue,
Rman> Crosscheck copy of archivelog all; 
Rman> Crosscheck archivelog all; 
Rman> Resync catalog; 
Rman> delete force obsolete; 
Rman> delete expired archivelog all ; 

After you run the above commands in your RMAN prompt RMAN will unlink all archived log entry from its repository. But due to oracle bug
- if still it can't delete or,
- delete force obsolete and delete expired archivelog all fails with segmentation errors or,
- delete is succeed but still you face RMAN-03002, RMAN-06059, ORA-19625 and ORA-27037 error then do the following:


Rman> Change archivelog '{location of archivelog which is deleted}' UNCATALOG ;

Please note the first archive log name would be present in the error message ORA-19625:

For example in our case our error output was:
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /u01/app/oracle/admin/ORACLE/arch/arch_94049.log
ORA-27037: unable to obtain file status
HP-UX Error: 2: No such file or directory
So run the following command,

Rman> Change archivelog '/u01/app/oracle/admin/ORACLE/arch/arch_94049.log' uncatalog;

Run the archive log backup command check if you still get the error

Keeping specify the archive log file name reported in ORA-19625 till backup of archive log goes fine.

If there is so many archivelog you deleted from specify then alternatively you can do the following as each time specifying the name will take much time.

Rman> Change archivelog all uncatalog ;

Please note the above command will uncatalog the information about the Archive log from catalog database.

Creation of second standby database using RMAN DUPLICATE fails with RMAN-20242

Problem Description
You can run the following command to create a physical standby database from the primary database.
run{
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate auxiliary channel stby1 type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'BDDIPDC','BDDIPDRS'
set db_file_name_convert='/BDDIPDC/','/BDDIPDRS/'
set log_file_name_convert='/BDDIPDC/','/BDDIPDRS/'
set 'db_unique_name'='BDDIPDRS'
set control_files='+DATA/BDDIPDRS/control01.ctl','+DATA/BDDIPDRS/control02.ctl'
set db_recovery_file_dest='+RECOVERY/BDDIPDRS'
set DB_RECOVERY_FILE_DEST_SIZE='500G'
nofilenamecheck;
}
So you have one primary and one physical standby database. Now you want to add another standby database in your Data Guard environment. And you issued following command but it failed with
RMAN-20242
rman target sys/sys@bddipdc auxiliary sys/sys@bddipdrs
DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE DORECOVER SPFILE 
SET db_unique_name = 'BDDIPDRS' 
SET FAL_CLIENT = 'BDDIPDRS' 
SET FAL_SERVER = 'BDDIPDC' 
set log_archive_dest_1 = 'LOCATION=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles) db_unique_name=x11106_stby2' 
set log_archive_dest_2 = 'db_unique_name=BDDIPDC SERVICE=BDDIPDC valid_for=(online_logfile, primary_role) REOPEN=60 OPTIONAL LGWR SYNC AFFIRM' 
CONTROL_FILES='+DATA/BDDIPDRS/control01.dbf' 
set DB_FILE_NAME_CONVERT='/BDDIPDC/','/BDDIPDRS/' 
set LOG_FILE_NAME_CONVERT='/BDDIPDC/','/BDDIPDRS/' 
NOFILENAMECHECK;
Following is the error output,
RMAN-8162: executing Memory Script

RMAN-3090: Starting backup at 01-NOV-10
RMAN-12016: using channel ORA_DISK_1
RMAN-571: ===========================================================
RMAN-569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-571: ===========================================================
RMAN-3002: failure of Duplicate Db command at 11/01/2010 04:26:39
RMAN-3015: error occurred in stored script Memory Script
RMAN-20242: specification does not match any archived log in the recovery 
catalog
Cause of the Problem
The problem happened due to oracle bug. If the source database has standby destination, then while copying archived logs from the source database the bug will fire. Oracle named this bug as Bug 6603587.

Solution of the Problem
Solution 01: This bug is fixed in Oracle 11.2 and in patchset 11.1.0.7. So upgrade your current oracle software is a solution.

Solution 02: For DUPLICATE DATABASE FOR STANDBY FROM ACTIVE, simply avoid using the DORECOVER clause. Logs will ship naturally as part of the standby log shipping.

Solution 03: For DUPLICATE TARGET DATABASE ... FROM ACTIVE, defer all standby destinations prior to executing the command. For example, issue
alter system set LOG_ARCHIVE_DEST_STATE_2=DEFER scope=both sid='*';
where LOG_ARCHIVE_DEST_STATE_2 is standby destination.

RMAN duplicate fails with RMAN-10006, ORA-03113, ORA-01092

Problem Description
While duplicating database using RMAN it fails with ORA-01092: "ORACLE instance terminated. Disconnection forced" and ora-03113 error reported.
RMAN-00601: fatal error in recovery manager
RMAN-03004: fatal error during execution of command
RMAN-10039: error encountered while polling for RPC completion on channel clone_default
RMAN-10006: error running SQL statement: select act from x$ksusex where sid=:1 and serial=:2
RMAN-10002: ORACLE error: ORA-03113: end-of-file on communication channel
RMAN-03002: failure of Duplicate Db command at 02/30/2010 01:21:18
RMAN-03015: error occurred in stored script Memory Script
RMAN-06136: ORACLE error from auxiliary database: 
ORA-01092: ORACLE instance terminated. Disconnection forced
If we look for the auxiliary database alert.log file then it shows that Undo Tablespace 'UNDOTBS1' does not exist or of wrong type.

Cause of the Problem
The UNDO_TABLESPACE parameter of auxiliary database is not same as target database. In the source database undo tablespace is set to UNDOTBS2 while in target database undo tablespace is set to UNDOTBS1. The undo tablespace specified in the auxiliary database parameter file does not exist.

Solution of the Problem
Make sure that the undo tablespace for auxiliary database is same as of target database.
Edit the init.ora or alter the UNDO_TABLESPACE parameter of the auxiliary instance and set
undo_tablespace = UNDOTBS2
- restart the auxiliary instance in nomount mode and repeat the duplicate database command.

RMAN duplicate database fails with RMAN-00601, RMAN-10006, ORA-00704, ORA-39700

Problem Description
Duplicating database using RMAN fails with following errors.
channel channel1: starting piece 1 at 29-JUL-2010 03:49:19
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00601: fatal error in recovery manager
RMAN-03004: fatal error during execution of command
RMAN-10039: error encountered while polling for RPC completion on channel channel1
RMAN-10006: error running SQL statement: select action from gv$session where sid=:1 and serial#=:2 and inst_id=:3 
RMAN-10002: ORACLE error: ORA-3114: not connected to ORACLE 
RMAN-10041: Could not re-create polling channel context following failure. 
RMAN-10024: error setting up for rpc polling 
RMAN-10005: error opening cursor 
RMAN-10002: ORACLE error: ORA-3114: not connected to ORACLE 
RMAN-03002: failure of Duplicate Db command at 02/23/2007 11:11:50 
RMAN-03015: error occurred in stored script Memory Script 
RMAN-06136: ORACLE error from auxiliary database: ORA-1092: ORACLE instance 
terminated. Disconnection forced 
ORA-00704: bootstrap process failure 
ORA-39700: database must be opened with UPGRADE option

Cause of the Problem
The errors occurred because the Oracle versions for both the target database home and the auxiliary database home are not same.

Solution of the Problem
The solution is to upgrade the auxiliary database server binaries to match the target database server. Also if there is one off patches that exist on the target database, you also need to apply on the auxiliary database in order to make the duplication work.

Thursday, June 10, 2010

crosscheck archivelog fails with validation failed for archived log

Problem Description
Whenever I run "crosscheck archivelog all" it failed with message "validation failed for archived log" like below.
RMAN> crosscheck archivelog all;
 
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=323 devtype=DISK
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_10/o1_mf_1_3_5bkc1o5q_.arc recid=6 stamp=697208725
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_10/o1_mf_1_4_5bkd60x4_.arc recid=7 stamp=697209883
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_10/o1_mf_1_5_5bkd78q9_.arc recid=8 stamp=697209922
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_10/o1_mf_1_6_5bkf2rwx_.arc recid=9 stamp=697210802
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_10/o1_mf_1_7_5blbdsqs_.arc recid=10 stamp=697240820
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_10/o1_mf_1_8_5blc2tvx_.arc recid=11 stamp=697241524
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_11/o1_mf_1_9_5bm1t7hk_.arc recid=12 stamp=697264802
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_11/o1_mf_1_10_5bmqwzr6_.arc recid=13 stamp=697287417
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_11/o1_mf_1_11_5bnjqg4n_.arc recid=14 stamp=697312840
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_11/o1_mf_1_12_5bnytoy5_.arc recid=15 stamp=697327280
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_12/o1_mf_1_13_5boplo7l_.arc recid=16 stamp=697351600
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_12/o1_mf_1_14_5bp6vv6w_.arc recid=17 stamp=697368277
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_12/o1_mf_1_15_5bpdtlfn_.arc recid=18 stamp=697374380
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_13/o1_mf_1_16_5br3nh19_.arc recid=19 stamp=697430505
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_13/o1_mf_1_17_5brvlghg_.arc recid=20 stamp=697455015
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_14/o1_mf_1_18_5btzdcv5_.arc recid=21 stamp=697524454
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_14/o1_mf_1_19_5bw0drf0_.arc recid=22 stamp=697558259
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_14/o1_mf_1_20_5bwvyksr_.arc recid=23 stamp=697586476
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_15/o1_mf_1_21_5bxmsqql_.arc recid=24 stamp=697610898
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_15/o1_mf_1_22_5bz0h5on_.arc recid=25 stamp=697656639
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_15/o1_mf_1_23_5bzjbvg2_.arc recid=26 stamp=697672884
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_16/o1_mf_1_24_5c0lgk9r_.arc recid=27 stamp=697707819
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_16/o1_mf_1_25_5c24o21l_.arc recid=28 stamp=697759227
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_17/o1_mf_1_26_5c30s9py_.arc recid=29 stamp=697788035
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_17/o1_mf_1_27_5c4s0wyy_.arc recid=30 stamp=697845623
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_18/o1_mf_1_28_5c5k0jrj_.arc recid=31 stamp=697870186
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_18/o1_mf_1_29_5c6z1g0p_.arc recid=32 stamp=697917319
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_18/o1_mf_1_30_5c7mqfl8_.arc recid=33 stamp=697938502
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_19/o1_mf_1_31_5c89jkhw_.arc recid=34 stamp=697960811
validation failed for archived log
archive log filename=/u01/app/oracle/archivelog/2009_09_19/o1_mf_1_32_5c9ggk5p_.arc recid=35 stamp=697998634
validation succeeded for archived log
archive log filename=/u01/app/oracle/archivelog/2009_12_02/o1_mf_1_343_5kdfc1sv_.arc recid=36 stamp=704560058
validation succeeded for archived log
archive log filename=/u01/app/oracle/archivelog/2009_12_02/o1_mf_1_344_5kdfy3pd_.arc recid=37 stamp=704560667
validation succeeded for archived log
archive log filename=/u05/archive/%t_%s_%r.arc1_345_697204983.dbf recid=38 stamp=704560901
validation succeeded for archived log
archive log filename=/u05/archive/1_346_697204983.dbf recid=39 stamp=704561258
validation succeeded for archived log
archive log filename=/u05/archive/1_347_697204983.dbf recid=40 stamp=704561835
validation succeeded for archived log
archive log filename=/u05/archive/1_348_697204983.dbf recid=41 stamp=704561992
validation succeeded for archived log
archive log filename=/u05/archive/1_349_697204983.dbf recid=42 stamp=704562987
validation succeeded for archived log
archive log filename=/u05/archive/1_350_697204983.dbf recid=43 stamp=704562987
validation succeeded for archived log
archive log filename=/u05/archive/1_351_697204983.dbf recid=44 stamp=704562992
validation succeeded for archived log
archive log filename=/u05/archive/1_352_697204983.dbf recid=45 stamp=704563257
validation succeeded for archived log
archive log filename=/u05/archive/1_353_697204983.dbf recid=46 stamp=704563321
validation succeeded for archived log
archive log filename=/u05/archive/1_354_697204983.dbf recid=47 stamp=704563408
validation succeeded for archived log
archive log filename=/u05/archive/1_355_697204983.dbf recid=48 stamp=704563434
validation succeeded for archived log
archive log filename=/u05/archive/1_356_697204983.dbf recid=49 stamp=704584836
validation succeeded for archived log
archive log filename=/u05/archive/1_357_697204983.dbf recid=50 stamp=704586204
validation succeeded for archived log
archive log filename=/u05/archive/1_358_697204983.dbf recid=51 stamp=704611511
validation succeeded for archived log
archive log filename=/u05/archive/1_359_697204983.dbf recid=52 stamp=704648675
validation succeeded for archived log
archive log filename=/u05/archive/1_360_697204983.dbf recid=53 stamp=704650176
validation succeeded for archived log
archive log filename=/u05/archive/1_361_697204983.dbf recid=54 stamp=704650675
validation succeeded for archived log
archive log filename=/u05/archive/1_362_697204983.dbf recid=55 stamp=704671244
validation succeeded for archived log
archive log filename=/u05/archive/1_363_697204983.dbf recid=56 stamp=704692487
validation succeeded for archived log
archive log filename=/u05/archive/1_364_697204983.dbf recid=57 stamp=704708839
validation succeeded for archived log
archive log filename=/u05/archive/1_365_697204983.dbf recid=59 stamp=704736263
validation succeeded for archived log
archive log filename=/u05/archive/1_366_697204983.dbf recid=58 stamp=704736262
validation succeeded for archived log
archive log filename=/u05/archive/1_367_697204983.dbf recid=60 stamp=704736266
validation succeeded for archived log
archive log filename=/u05/archive/1_368_697204983.dbf recid=61 stamp=704737398
Crosschecked 56 objects
Cause of the Problem
The problem happened because archive log file destination was changed or someone deleted the archive log files manually using OS commands.

Solution of the Problem
The solution is to delete the expired archive log files. So do following,
$ rman
RMAN> connect target /
RMAN> crosscheck archivelog all;
RMAN> delete expired archivelog all;

About RMAN Compatibility Matrix

About RMAN Environment
If you say about RMAN Environment, then there comes the following components.
1) RMAN executable
2) Recovery catalog database
3) Recovery catalog schema in the recovery catalog database
4) Target database
5) Auxiliary database (used for duplicate, duplicate for standby or tablespace point-in-time recovery)

Each component has a release number. Oracle uses up to 5 digits to indicate a version of the release, but only up to 4 are significant for RMAN compatibility purposes. For example, to check the release number of RMAN executable just issue, rman on command prompt like below.
E:\Documents and Settings\Arju>rman

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Mar 2 16:16:59 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Here we see the version is 10.2.0.1.0

Determine the Recovery Catalog Schema Version

Use SQL*Plus to connect to the recovery catalog database as the catalog owner. For example, enter:

$ sqlplus rman@catdb
Query the rcver catalog table. For example, run this query:

SQL> SELECT * FROM rcver;

VERSION
------------
09.00.01.00
10.02.01.00
11.01.00.03
Note that, if multiple versions are listed, then the last row is the current version, and the rows before it are prior versions. In the preceding example, the current recovery catalog schema version is 11.1 and the previous version was 10.2.

Note that for releases 10.2 and later, the last two digits in the rcver output indicate patch level. For earlier releases, they are always zeros.

RMAN Compatibility Matrix
In general, the rules of RMAN compatibility are as follows:

1) You can create an 8.x or 9.x recovery catalog schema in any Oracle database release 8.1.x (or higher), and a 10.0.1 (or higher) recovery catalog schema in any Oracle database release 9.0.1 (or higher).

2) The version of an auxiliary database instance must be equal to the version of the RMAN client.

3) Any release of Oracle database can restore backup sets and copies created by any prior release back to Oracle8i.

4) The RMAN executable version should be the same as the target database. There are some exceptions regarding this rule.

5) The RMAN catalog schema version must be greater than or equal to the RMAN executable.

6) The RMAN catalog is backwards compatible with target databases from earlier releases.

7) While backing up an Oracle Database 10g or later database with the Oracle9i RMAN client, you cannot include a control file that was created using COMPATIBLE=10.0.0 in a datafile backup set. The workaround is to turn control file autobackup ON.

RMAN Compatibility table is shown below.








Target/Auxiliary
Database
RMAN Executable Catalog Database Catalog Schema
8.0.68.0.6>=8.1.7>=8.0.6
8.1.78.0.6.1>=8.1.7>=8.1.7
8.1.78.1.7>=8.1.7>=RMAN executable
8.1.7.4 8.1.7.4 >=8.1.7 8.1.7.4
8.1.7.4 8.1.7.4 >=8.1.7 >=9.0.1.4
9.0.1 9.0.1>=8.1.7 >= RMAN executable
9.2.0>=9.0.1.3 and <= Target database>=8.1.7>= RMAN executable
10.1.0>=9.0.1.3 and <= Target database>=9.0.1>= RMAN executable
10.2.0>=9.0.1.3 and <= target database executable>=9.0.1>= RMAN executable
11.1.0>=9.0.1.3 and <= target database executable>=9.0.1>= RMAN executable
11.2.0>=9.0.1.3 and <= target database executable>=9.0.1>= RMAN executable


From above table you can easily conclude about the compatibility about different components of RMAN.

Note that when compatibility matrix is broken the following error message may be generated.
- RMAN-06186: PL/SQL package string.string version string in string database is too old
- RMAN-06429: string database is not compatible with this version of RMAN



RMAN-06900 RMAN-06901 ORA-19921: maximum number of 64 rows exceeded

Problem Description
RMAN backup completed successfully but backup logs shows warning message as,
RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows ORACLE error from target database:
ORA-19921: maximum number of 64 rows exceeded

A variant version of warning message is like below,

connected to target database: PROD1 (DBID=3378321056)
RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows
ORACLE error from target database:
ORA-19921: maximum number of 128 rows exceeded

Cause of the Problem
The RMAN-06900 RMAN-06901 ORA-19921 error stack indicates oracle RMAN bug. ORA-19921: maximum number of 64 rows exceeded is oracle bug 4659734 and ORA-19921: MAXIMUM NUMBER OF 128 ROWS EXCEEDED is oracle Bug 8264365. This bug fires when the RMAN output is too huge because it couldn't log the output in v$rman_output.

Solution of the Problem
If your RMAN goes well and you only see warning message in your RMAN log then simply you can ignore these warnings. The bug "ORA-19921: maximum number of 64 rows exceeded" is fixed in Oracle 10.2.0.4 version and in 11g. So to solve it upgrade your oracle version or apply oracle patch. If you already have oracle version 10.2.0.4 + and hit this bug then in fact you should do nothing and just to wait for oracle to resolve the issue.