You are on page 1of 8

CLONING

ASM to NORMAL FILE SYSTEM(RMAN)


Author : AJEETH KUMAR
Version : Version 1.1
Date : JUN2013

Author DATE Version Change


AJEETH KUMAR 13/06/2013 Version 1.0
AJEETH KUMAR 14/06/2013 Version 1.1 Implementation and Issues

Page 1
Towards Production(Server)
Step 1: Take a backup of full database,controlfile and archives using
rman.
RMAN>run

CONFIGURE RETENTION POLICY TO REDUNDANCY 1;

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO


'/apps/backup/rman/ctl.rman_%F';

allocate channel c1 type disk format '/apps/backup/rman/rman_db_%T_%U.rman';

backup as compressed backupset full database include current controlfile;

release channel c1;

allocate channel c1 type disk format '/apps/backup/rman/rman_arc_%T_%U.rman';

sql "alter system archive log current";

backup as compressed backupset archivelog all;

release channel c1;

delete noprompt obsolete;

Step 2.: Take a backup of contolfile on production machine


SQL>alter database backup controlfile to trace as /apps/backup/rman/control.sql;

Page 2
Step 3: Transfer the rman backup and control file backup from
production(server) to test machine(orcl).

Step4: Note down the DBID at production machine


<SQL> SELECT DBID FROM V$DATABASE;

Step 5: Disconnect the Production session

Towards test machine(eg.testrman)


Pre-check before cloning

Check dba name

$ export ORACLE_SID=orcl

Check the mount point space

$ df h

Step 1:Connect to test machine & perform the following steps:


Down the listener

Lsnrctl stop listener

Sqlplus /as sysdba


<SQL>Startup mount restrict

<SQL>Drop database

Or

Manually purge the data files and control files.

(but make sure that database is shutdown)

Edit the pfile and give the dbname as same as production database name(server)

Page 3
$ sqlplus '/as sysdba'

SQL> startup nomountpfile=$ORACLE_HOME/dbs/iniorcl.ora

SQL>exit

$rmantarget /

RMAN>set DBID=3811002090

Where DBID is a production databases DBID

Step 2:Restorecontrolfile on testserver


RMAN>restore controlfilefrom /U03/rambackup_14jun13/ctl.rman_c-3811002090-20130615-01;

RMAN> mount database;

*RMAN> crosscheck backup of database;

Step 3: Execute the following commands which renames and


restores datafiles in required path on test machine.... This is because
if the structure of testmachine is different from that of producton.
RMAN> RUN {

allocate channel ch1 type disk;

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/system.262.810214099' to


'/u02/orcl/system01.dbf';

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/sysaux.263.810214113' to


'/u02/orcl/sysaux.dbf';

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/undotbs.268.810837851' to


'/u02/orcl/ undotbs01.dbf';

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/undotbs02.dbf' to '/u02/orcl/


undotbs02.dbf ';

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/undotbs1.264.810214125' to


'/u02/orcl/ undotbs03.dbf';

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/users.266.810214175' to


'/u02/orcl/users.dbf';

Page 4
SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/system.267.810838825' to
'/u02/orcl/ system02.dbf';

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/xxxx.270.810838969' to


'/u02/orcl/ xxx01.dbf;

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/xxxx.271.810839131' to


'/u02/orcl/xxx02.dbf;

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/xxxx.272.810839261' to


'/u02/orcl/ xxx03.dbf;

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/xxxx.273.810839295' to


'/u02/orcl/xxx04.dbf;

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/xxxx.274.810839405' to


'/u02/orcl/ xxx01.dbf;

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/xxxx.275.810839517' to


'/u02/orcl/ xxx02.dbf;

SET NEWNAME FOR DATAFILE '+ORA_DATA/server/datafile/xxxx.276.813070931' to


'/u02/orcl/ xxx.dbf;

RESTORE Database;

Switch datafile all;

release channel ch1;

Step 4: Edit the backup controlfile and change the paths of


datafiles.redolog files & database name accordingly(control.sql).

Step 5: Shutdown the test instance.


SQL>shutdown immediate

SQL>exit

Page 5
Step 6: Rename the all restored controlfiles on test machine.
ie. /u03/orcl/controlfiles/control01.ctl to control01.ctl_bkup ...

Step 7: Now recreate controlfile and also can change the test
machine database name.
To change database name

a.edit the parameter db_name=new_db_name(orcl)

b.editcontrolfile(control.sql)

Step 8: CREATE CONTROLFILE SET DATABASE new_db_name (orcl)


RESETLOGS ARCHIVELOG

To recreate controlfile

$ export ORACLE_SID=ORCL

$ sqlplus '/as sysdba'

SQL>startup nomount;

SQL>@/u03/orcl/control.sql

Step 9: Recover database .


SQL> recover database UNTIL CANCEL using backup controlfile;

Step 10: Open the Database with Resetlogs.


SQL> alter database open resetlogs;

Page 6
Step 11: Put the Database in NOARCHIVE mode
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>startup mount
ORACLE instance started.
SQL> alter database noarchivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;

ISSUES

ERROR FACED AT THE TIME OF CLONING ARE:

*{[Error 1:-while converting the datafiles path from asm to non-asm we got the following
Error
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

failover to previous backup

creatingdatafile file number=1 name=/u02/orcl/datafiles/system01.dbf


released channel: ch1
RMAN-00571:
===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
===========================================================
RMAN-03002: failure of restore command at 06/15/2013 12:47:49
ORA-01180: can not create datafile 1
ORA-01110: data file 1: '+ORA_DATA/server/datafile/system.262.810214099']

Solution:-This Error occurred because we had 3 backups in our backup set so other two backup
piece was no datafiles to restore the actual datafiles was in the 3rd backup piece, so we gave a
command as
Page 7
RMAN> crosscheck backup of database;

This command made the other two backup piece has expired and the one we need was made as
available.}

Page 8

You might also like