Tuesday, 12 October 2010

Clonning Oracle Database with same SID in RMAN

Step 1. Take a full RMAN backup of the source Database server.

Step 2. Copy all the backup files to the destination Database server (Clone).

Step 3. Delete all archivelogs in the FRA(Flash fecovery are) if exist in the destination Database server.
#rm -rf *

Step 4. In the destination Database server execute the following command
rman target /
RMAN> startup nomount

Step 5. restore control file
RMAN> RESTORE CONTROLFILE FROM '/u4/backup/backup_19072010/c-31327963-20100719-00';

Step 6.
RMAN> ALTER DATABASE MOUNT;
RMAN> CROSSCHECK BACKUP;
RMAN> CROSSCHECK COPY OF ARCHIVELOG ALL;
RMAN> DELETE EXPIRED BACKUP;
RMAN> DELETE EXPIRED COPY;

Step 7:
RMAN> catalog backuppiece '/u4/backup_12102010/atlq76gj_1_1';
RMAN> catalog backuppiece '/u4/backup_12102010/59ll5vff_1_1';
RMAN> catalog backuppiece '/u4/backup_12102010/58ll5v75_1_1';
RMAN> catalog backuppiece '/u4/backup_12102010/57ll5v2t_1_1';

Step 8:
RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE;

Note : This will error out because there isn't an UNTIL clause. But since the database is consistent after applying the archivelog generated during the backup, we can open the database with resetlogs.

Step 9:
RMAN>ALTER DATABASE OPEN RESETLOGS;

No comments:

Post a Comment