Tag Archives: RMAN

Duplicate database from RAC to Single node

I bet you know how to duplicate database from primary, or read only standby databases. But do you know how to duplicate from active database RAC environment into Single instance node without ASM or any shared file system? It’s really awkward feeling while searching this simple information, because no one mention about it. While you duplicating database from RAC to the Single, you needs to configure controlfile snapshot to the ASM or shared filesystem. If you haven’t any, you need to create some. Fortunately we’ve got very small ASM diskgroup only for ocr and voting files. So we can involve this group to our process.

rman target sys/pass@RO_standby auxiliary sys/pass@AIM_standby

RMAN> configure snapshot controlfile name to '+ocrvt/hostname';
RMAN> duplicate target database for standby from active database nofilenamecheck;

The duplicate process just using this controlfile snapshot for creating normal controlfile in location which mention in the spfile.


ORA-15196: invalid ASM block header. Continued investigation.

Hey fellas. As you know from previous article, I’ve got the error around ASM block header. Which I also tried to solve with scrubbing mechanism which has appeared in 12c Oracle. You know this mechanism is working well, but only one’s you need to know, you must have at least one type of block (primary or mirror) in correct state, and then the scrubbing mechanism can afford to save your data. But not in my situation which I’ve described in previous article.

Continue reading

Interesting method of creation copy database in the same ASM diskgroup.

Sometimes I need to make a copy of database in the same ASM diskgroup for tests. What are the main steps you know to make a copy database? Backup database, backup controlfile, prepare pfile, restore controlfile, restore database, recover database.

For example you have one instance with datafile path ‘+DATA/base1’ and you want to create one more instance with datafile path ‘+DATA/base2′. Assume that you’ve done those steps, backup controlfile, backup database and prepared pfile. Obviously you need to use ‘db_unique_name’ in both instances pfiles/spfiles. What next? You should start your second instance with ‘nomount’ option and have to try to restore ‘controlfile’.

SQL> startup nomount pfile='/tmp/pfile';
RMAN> restore standby controlfile from '+FRA/base1/backupset/2014_03_14/ncnnf0_tag20140314t150912_0.266.842195359';

Starting restore at 14 mar 2014 15:19
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file

channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
output file name=+DATA/base2/controlfile/current.1803.842195953
Finished restore at 14 mar 2014 15:19

The next step you should do, mount database and to try to restore datafiles from backup which you previously prepared.

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> restore datafile 1;

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 +DATA/base1/datafile/system.328.841732809
channel ORA_DISK_1: reading from backup piece +FRA/base1/backupset/2014_03_12/nnndf0_tag20140312t144756_0.261.842021421

But unfortunately you’ll stumbled upon pitfalls! Path should be ‘+DATA/base2’ compared ‘+DATA/base1’.

This had happened because in the ‘controlfile’ contains information about old path for files, path for the first instance! And this situation I use some trick with ‘datafilecopy’ option.

RMAN> backup as copy database format '+DATA';

Starting backup at 14 mar 2014 15:41
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00012 name=+DATA/base1/datafile/apps_undots2.274.841716353
output file name=+DATA/base2/datafile/apps_undots2.1807.842197313 tag=TAG20140314T154147 RECID=210180 STAMP=842197566
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:04:15

RMAN> switch database to copy;

After this datafiles will placed in correct place and we can use recover database.


Basic Concepts of Block Media Recovery

Usually, the database marks a block as media corrupt and then writes it to disk when the corruption is first encountered. No subsequent read of the block is successful until the block is recovered. You can perform block recovery only on blocks that are marked corrupt or that fail a corruption check.

If the database on which the corruption occurs is associated with a real-time query physical standby database, then the database automatically attempts to perform block media recovery. The primary database searches for good copies of blocks on the standby database and, if they are found, repairs the blocks with no impact to the query that encountered the corrupt block. The Oracle Database physical block corruption message (ORA-1578) is displayed only if the database cannot repair the corruption.

Whenever block corruption has been automatically detected, you can perform block media recovery manually with the RECOVER ... BLOCK command. By default, RMAN first searches for good blocks in the real-time query physical standby database, then flashback logs and then blocks in full or level 0 incremental backups.


For block media recovery to work automatically, the physical standby database must be in real-time query mode. An Oracle Active Data Guard license is required.

If a corrupt data block is discovered on a real-time query physical standby database, the server attempts to repair the corruption by obtaining a copy of the block from the primary database. The repair is performed in the background, enabling subsequent queries to succeed if the repair is successful. Automatic block repair is attempted if the following database initialization parameters are configured on the standby database as described:

  • The LOG_ARCHIVE_CONFIG parameter is configured with a DG_CONFIG list and a LOG_ARCHIVE_DEST_n parameter is configured for the primary database with the DB_UNIQUE_NAME attribute

Details: http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmblock.htm#i1006577