3 Replies Latest reply: May 9, 2011 11:32 PM by Levi Pereira RSS

    RMAN clone; Avoid backup image

    user9074881
      Oracle 10.2.0.5

      When cloning databases with RMAN on ASM, it creates a backup image before restoring the backup to a clone. Whenever I clone a database, I need double amount of storage to do it.

      Is there way to clone a database in ASM and avoid the additional backup image?

      I appreciate the help.
      Thank you
        • 1. Re: RMAN clone; Avoid backup image
          Levi Pereira
          Hi,
          user9074881 wrote:
          Oracle 10.2.0.5

          When cloning databases with RMAN on ASM, it creates a backup image before restoring the backup to a clone.
          Whenever I clone a database, I need double amount of storage to do it.
          Double amount. Maybe...because you can use backup compression(Compressed Backupsets) which significantly reduces the size of the backup.
          >
          Is there way to clone a database in ASM and avoid the additional backup image?
          <s>Using RMAN 10g is not possible clone a database without Backup Image</s>, but using RMAN 11g is possible using active database duplication (A duplicate database that is created over a network without restoring backups of the target database).

          Using third party software or feature of storage you can clone the ASMDISK (Luns) of Diskgroup and move ASMDISK (Luns) to another ASM instance with same Diskgroup Name.

          Regards,
          Levi Pereira

          Edited by: Levi Pereira on May 10, 2011 1:39 AM # Using DUPLICATE command on RMAN 10gR1/R2 it's not possible,but using BACKUP as COPY command on RMAN 10gR1/R2 it's possible.
          • 2. Re: RMAN clone; Avoid backup image
            Philippe Florent
            Hi,
            If you have 2 hosts that can be connected to the same storage (SAN etc.) it's possible to proceed without any outage on the original database.
            It's possible to clone even with one host and without any supplementary storage though. As Levi mentioned you cannot use duplicate since a backup is necessary and you don't want that. In my scenario original instance has to be stopped but the outage can be short if you prepare the operations. Notice I didn't use ASM but it's very similar since the operations are done with sqlplus/RMAN (directories can be created with asmcmd).
            oracle@dellsp:~> rman target /
            
            Recovery Manager: Release 10.2.0.5.0 - Production on Sat May 7 13:47:51 2011
            
            Copyright (c) 1982, 2007, Oracle.  All rights reserved.
            
            connected to target database: P102 (DBID=1526015026)
            
            RMAN> report schema;
            
            using target database control file instead of recovery catalog
            Report of database schema
            
            List of Permanent Datafiles
            ===========================
            File Size(MB) Tablespace           RB segs Datafile Name
            ---- -------- -------------------- ------- ------------------------
            1    450      SYSTEM               ***     /u02/oradata/P102/system01.dbf
            2    450      UNDOTBS1             ***     /u02/oradata/P102/undotbs01.dbf
            3    260      SYSAUX               ***     /u02/oradata/P102/sysaux01.dbf
            4    5        USERS                ***     /u02/oradata/P102/users01.dbf
            5    100      USERS                ***     /u02/oradata/P102/users02.dbf
            
            List of Temporary Files
            =======================
            File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
            ---- -------- -------------------- ----------- --------------------
            1    100      TEMP                 100         /u02/oradata/P102/temp01.dbf
            
            oracle@dellsp:/u02/oradata> mkdir P102BIS -- use asmcmd with ASM
            
            RMAN> BACKUP AS COPY DEVICE TYPE DISK DATABASE FORMAT '/u02/oradata/P102BIS/%U';
            
            Starting backup at 07-MAY-11
            using channel ORA_DISK_1
            channel ORA_DISK_1: starting datafile copy
            input datafile fno=00001 name=/u02/oradata/P102/system01.dbf
            output filename=/u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-SYSTEM_FNO-1_0lmbo2c4 tag=TAG20110507T135827 recid=6 stamp=750520753
            channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
            channel ORA_DISK_1: starting datafile copy
            input datafile fno=00002 name=/u02/oradata/P102/undotbs01.dbf
            output filename=/u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-UNDOTBS1_FNO-2_0mmbo2dr tag=TAG20110507T135827 recid=7 stamp=750520805
            channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
            channel ORA_DISK_1: starting datafile copy
            input datafile fno=00003 name=/u02/oradata/P102/sysaux01.dbf
            output filename=/u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-SYSAUX_FNO-3_0nmbo2f9 tag=TAG20110507T135827 recid=8 stamp=750520839
            channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
            channel ORA_DISK_1: starting datafile copy
            input datafile fno=00005 name=/u02/oradata/P102/users02.dbf
            output filename=/u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-USERS_FNO-5_0ombo2gc tag=TAG20110507T135827 recid=9 stamp=750520853
            channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
            channel ORA_DISK_1: starting datafile copy
            input datafile fno=00004 name=/u02/oradata/P102/users01.dbf
            output filename=/u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-USERS_FNO-4_0pmbo2gr tag=TAG20110507T135827 recid=10 stamp=750520860
            channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
            Finished backup at 07-MAY-11
            
            Starting Control File and SPFILE Autobackup at 07-MAY-11
            piece handle=/u01/app/oracle/product/10.2.0/db_1/dbs/c-1526015026-20110507-00 comment=NONE
            Finished Control File and SPFILE Autobackup at 07-MAY-11
            
            SQL> create pfile from spfile;
            
            File created.
            
            oracle@dellsp:/u01/app/oracle/product/10.2.0/db_1/dbs> cp -p initP102.ora initP102BIS.ora
            
            Edition of the file :1,$s/P102/P102BIS/g , keep DB_NAME unchanged, adjust SERVICE_NAMES, create any missing directory...
            
            SQL> alter database backup controlfile to trace;
            
            Database altered.
            
            SQL> shutdown immediate
            Database closed.
            Database dismounted.
            ORACLE instance shut down.
            
            oracle@dellsp:/u01/app/oracle/product/10.2.0/db_1/dbs> export ORACLE_SID=P102BIS
            
            
            SQL> CREATE CONTROLFILE DATABASE "P102" RESETLOGS  ARCHIVELOG
                MAXLOGFILES 16
                MAXLOGMEMBERS 3
                MAXDATAFILES 100
                MAXINSTANCES 8
                MAXLOGHISTORY 292
            LOGFILE
              GROUP 1 '/u02/oradata/P102BIS/redo01.rdo'  SIZE 50M,
              GROUP 2 '/u02/oradata/P102BIS/redo02.rdo'  SIZE 50M,
              GROUP 3 '/u02/oradata/P102BIS/redo03.rdo'  SIZE 50M
            -- STANDBY LOGFILE
            DATAFILE
              '/u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-SYSTEM_FNO-1_0lmbo2c4',
              '/u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-UNDOTBS1_FNO-2_0mmbo2dr',
              '/u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-SYSAUX_FNO-3_0nmbo2f9',
              '/u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-USERS_FNO-4_0pmbo2gr',
              '/u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-USERS_FNO-5_0ombo2gc'
            CHARACTER SET WE8ISO8859P1
            ;
              2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19  
            
            Control file created.
            
            
            SQL> recover database using backup controlfile; -- use necessary redo information, could have done better to avoid the use of online redo but forgot to archive log current...
            
            Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
            /u02/oradata/P102/redo02.rdo
            Log applied.
            Media recovery complete.
            
            SQL> alter database open resetlogs;
            
            Database altered.
            
            SQL> shutdown immediate
            Database closed.
            Database dismounted.
            ORACLE instance shut down.
            
            SQL> startup mount
            ORACLE instance started.
            
            Total System Global Area  167772160 bytes
            Fixed Size                  1272600 bytes
            Variable Size              96470248 bytes
            Database Buffers           67108864 bytes
            Redo Buffers                2920448 bytes
            Database mounted.
            
            oracle@dellsp:/u01/app/oracle/product/10.2.0/db_1/dbs> nid TARGET=/ DBNAME=P102BIS
            
            DBNEWID: Release 10.2.0.5.0 - Production on Sat May 7 18:14:28 2011
            
            Copyright (c) 1982, 2007, Oracle.  All rights reserved.
            
            Connected to database P102 (DBID=1526015026)
            
            Connected to server version 10.2.0
            
            Control Files in database:
                /u02/oradata/P102BIS/control01.ctl
                /u02/oradata/P102BIS/control02.ctl
                /u02/oradata/P102BIS/control03.ctl
            
            Change database ID and database name P102 to P102BIS? (Y/[N]) => Y
            
            Proceeding with operation
            Changing database ID from 1526015026 to 1988082244
            Changing database name from P102 to P102BIS
                Control File /u02/oradata/P102BIS/control01.ctl - modified
                Control File /u02/oradata/P102BIS/control02.ctl - modified
                Control File /u02/oradata/P102BIS/control03.ctl - modified
                Datafile /u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-SYSTEM_FNO-1_0lmbo2c4 - dbid changed, wrote new name
                Datafile /u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-UNDOTBS1_FNO-2_0mmbo2dr - dbid changed, wrote new name
                Datafile /u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-SYSAUX_FNO-3_0nmbo2f9 - dbid changed, wrote new name
                Datafile /u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-USERS_FNO-4_0pmbo2gr - dbid changed, wrote new name
                Datafile /u02/oradata/P102BIS/data_D-P102_I-1526015026_TS-USERS_FNO-5_0ombo2gc - dbid changed, wrote new name
                Control File /u02/oradata/P102BIS/control01.ctl - dbid changed, wrote new name
                Control File /u02/oradata/P102BIS/control02.ctl - dbid changed, wrote new name
                Control File /u02/oradata/P102BIS/control03.ctl - dbid changed, wrote new name
                Instance shut down
            
            Database name changed to P102BIS.
            Modify parameter file and generate a new password file before restarting.
            Database ID for database P102BIS changed to 1988082244.
            All previous backups and archived redo logs for this database are unusable.
            Database has been shutdown, open database with RESETLOGS option.
            Succesfully changed database name and ID.
            DBNEWID - Completed succesfully.
            
            oracle@dellsp:/u01/app/oracle/product/10.2.0/db_1/dbs> vi initP102BIS.ora
            (change DB_NAME from P102 to P102BIS)
            
            oracle@dellsp:/u01/app/oracle/product/10.2.0/db_1/dbs> orapwd file=orapw102BIS password=XXXXXXX
            
            SQL> startup mount
            ORACLE instance started.
            
            Total System Global Area  167772160 bytes
            Fixed Size                  1272600 bytes
            Variable Size              96470248 bytes
            Database Buffers           67108864 bytes
            Redo Buffers                2920448 bytes
            Database mounted.
            SQL> alter database open resetlogs;
            
            Database altered.
            
            SQL> alter tablespace temp add tempfile '/u02/oradata/P102BIS/temp01.dbf' size 100M;
            
            Tablespace altered.
            
            oracle@dellsp:/u02/oradata/P102> export ORACLE_SID=P102
            
            SQL> startup
            ORACLE instance started.
            
            Total System Global Area  167772160 bytes
            Fixed Size                  1272600 bytes
            Variable Size              96470248 bytes
            Database Buffers           67108864 bytes
            Redo Buffers                2920448 bytes
            Database mounted.
            Database opened.
            Best regards
            Phil

            Edited by: Philippe Florent on May 8, 2011 4:37 PM -- typo, adding precision
            • 3. Re: RMAN clone; Avoid backup image
              Levi Pereira
              Hi Philippe,

              I really appreciate your post, doing things that seem impossible to be possible. (such as to duplicate (online) a database in 10g without restore). :)

              I decided to complement your post doing duplicate using ASM.
              I did not make step by step, but for any Senior DBA can understand.

              P.S: For All:
              Be very careful to do this using ASM because you can damage or remove your target database if the parameters(init<instance_name>.ora) are not configured correctly.
              I created/used a different diskgroup from that used by the target database, for precaution and safety.


              rman target /
              
              Recovery Manager: Release 10.2.0.5.0 - Production on Mon May 9 22:01:42 2011
              
              Copyright (c) 1982, 2007, Oracle.  All rights reserved.
              
              connected to target database: DB10G (DBID=142098503)
              
              RMAN> report schema;
              
              using target database control file instead of recovery catalog
              Report of database schema
              
              List of Permanent Datafiles
              ===========================
              File Size(MB) Tablespace           RB segs Datafile Name
              ---- -------- -------------------- ------- ------------------------
              1    450      SYSTEM               ***     +DG_ORCL/db10g/datafile/system.259.749761723
              2    1105     UNDOTBS1             ***     +DG_ORCL/db10g/datafile/undotbs1.258.749761723
              3    250      SYSAUX               ***     +DG_ORCL/db10g/datafile/sysaux.257.749761723
              4    3250     USERS                ***     +DG_ORCL/db10g/datafile/users.256.749761725
              
              List of Temporary Files
              =======================
              File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
              ---- -------- -------------------- ----------- --------------------
              1    98       TEMP                 32767       +DG_ORCL/db10g/tempfile/temp.260.749761777
              
              
              # Oracle ASM use db_unique_name to create directory. So I go use.
              
              sqlplus / as sysdba
              
              SQL*Plus: Release 10.2.0.5.0 - Production on Mon May 9 22:38:48 2011
              
              Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
              
              SQL:db10g> show parameter db_unique
              
              NAME                                 TYPE        VALUE
              ------------------------------------ ----------- ------------------------------
              db_unique_name                       string      DB10G
              SQL:db10g> ALTER SYSTEM SET db_unique_name=dbclone scope=spfile;
              
              SQL:db10g> shutdown immediate;
              Database closed.
              Database dismounted.
              ORACLE instance shut down.
              
              SQL:db10g> startup mount
              ORACLE instance started.
              
              Total System Global Area  293601280 bytes
              Fixed Size                  2095872 bytes
              Variable Size             104858880 bytes
              Database Buffers          180355072 bytes
              Redo Buffers                6291456 bytes
              Database mounted.
              SQL> show parameter db_uni
              
              NAME                                 TYPE        VALUE
              ------------------------------------ ----------- ------------------------------
              db_unique_name                       string      DBCLONE
              
              
              
              $ rman target /
              Recovery Manager: Release 10.2.0.5.0 - Production on Mon May 9 22:43:27 2011
              Copyright (c) 1982, 2007, Oracle.  All rights reserved.
              
              connected to target database: DB10G (DBID=142098503, not open)
              
              RMAN>  BACKUP AS COPY DEVICE TYPE DISK DATABASE FORMAT '+DG_CLONE';
              
              Starting backup at 09-MAY-11
              using target database control file instead of recovery catalog
              allocated channel: ORA_DISK_1
              channel ORA_DISK_1: sid=153 devtype=DISK
              channel ORA_DISK_1: starting datafile copy
              input datafile fno=00004 name=+DG_ORCL/db10g/datafile/users.256.749761725
              output filename=+DG_CLONE/dbclone/datafile/users.262.750725029 tag=TAG20110509T224348 recid=10 stamp=750725114
              channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:35
              channel ORA_DISK_1: starting datafile copy
              input datafile fno=00002 name=+DG_ORCL/db10g/datafile/undotbs1.258.749761723
              output filename=+DG_CLONE/dbclone/datafile/undotbs1.263.750725125 tag=TAG20110509T224348 recid=11 stamp=750725152
              channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
              channel ORA_DISK_1: starting datafile copy
              input datafile fno=00001 name=+DG_ORCL/db10g/datafile/system.259.749761723
              output filename=+DG_CLONE/dbclone/datafile/system.264.750725161 tag=TAG20110509T224348 recid=12 stamp=750725170
              channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
              channel ORA_DISK_1: starting datafile copy
              input datafile fno=00003 name=+DG_ORCL/db10g/datafile/sysaux.257.749761723
              output filename=+DG_CLONE/dbclone/datafile/sysaux.265.750725175 tag=TAG20110509T224348 recid=13 stamp=750725182
              channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
              channel ORA_DISK_1: starting datafile copy
              copying current control file
              output filename=+DG_CLONE/dbclone/controlfile/backup.266.750725191 tag=TAG20110509T224348 recid=14 stamp=750725193
              channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
              channel ORA_DISK_1: starting full datafile backupset
              channel ORA_DISK_1: specifying datafile(s) in backupset
              including current SPFILE in backupset
              channel ORA_DISK_1: starting piece 1 at 09-MAY-11
              channel ORA_DISK_1: finished piece 1 at 09-MAY-11
              piece handle=+DG_CLONE/dbclone/backupset/2011_05_09/nnsnf0_tag20110509t224348_0.267.750725195 tag=TAG20110509T224348 comment=NONE
              channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
              Finished backup at 09-MAY-11
              
              
              SQL:db10g> alter database backup controlfile to trace;
              
              Database altered.
              
              SQL:db10g>create pfile='$ORACLE_HOME/dbs/initdbclone.ora' from spfile;
              
              File created.
              
              SQL:db10g> show parameter db_un
              
              NAME                                 TYPE        VALUE
              ------------------------------------ ----------- ------------------------------
              db_unique_name                       string      DBCLONE
              
              SQL:db10g> alter system set db_unique_name=db10g scope=spfile;
              
              System altered.
              
              SQL:db10g> shutdown immediate;
              ORA-01109: database not open
              
              Database dismounted.
              ORACLE instance shut down.
              
              $ vi $ORACLE_HOME/dbs/initdbclone.ora
              *.audit_file_dest='/u01/app/oracle/admin/dbclone/adump'
              *.background_dump_dest='/u01/app/oracle/admin/dbclone/bdump'
              *.control_files='/u01/app/oracle/product/10.2.0/db_1/dbs/control_dbclone.ora' 
              *.core_dump_dest='/u01/app/oracle/admin/dbclone/cdump'
              *.db_create_file_dest='+DG_CLONE'
              *.db_name='db10g'
              *.db_recovery_file_dest='+DG_CLONE'
              *.dispatchers='(PROTOCOL=TCP) (SERVICE=dbcloneXDB)'
              *.user_dump_dest='/u01/app/oracle/admin/dbclone/udump'
              
              
              # Get list of datafiles on ASM (very useful for huge list)
              set linesize 110
              col DATAFILE_PATH for a100
              
              SQL:+ASM> select ''''||concat('+'||gname, sys_connect_by_path(aname, '/'))||''',' DATAFILE_PATH 
                   from ( select b.name gname, a.parent_index pindex, a.name aname, 
                            a.reference_index rindex , a.system_created, a.alias_directory,
                            c.type file_type
                     from v$asm_alias a, v$asm_diskgroup b, v$asm_file c
                     where a.group_number = b.group_number
                           and a.group_number = c.group_number(+)
                           and a.file_number = c.file_number(+)
                           and a.file_incarnation = c.incarnation(+)
                   ) WHERE file_type = 'DATAFILE'
              start with (mod(pindex, power(2, 24))) = 0
                          and rindex in 
                              ( select a.reference_index
                                from v$asm_alias a, v$asm_diskgroup b
                                where a.group_number = b.group_number
                                      and (mod(a.parent_index, power(2, 24))) = 0
                                      and a.name = UPPER('&DATABASENAME')
                              )
              connect by prior rindex = pindex;
              
              DATAFILE_PATH
              ----------------------------------------------------------------------------------------------------
              '+DG_CLONE/DBCLONE/DATAFILE/SYSTEM.264.750725161',
              '+DG_CLONE/DBCLONE/DATAFILE/UNDOTBS1.263.750725125',
              '+DG_CLONE/DBCLONE/DATAFILE/USERS.262.750725029',
              '+DG_CLONE/DBCLONE/DATAFILE/SYSAUX.265.750725175',
              
              $ export ORACLE_SID=db10g
              $ sqlplus / as sysdba
              
              SQL*Plus: Release 10.2.0.5.0 - Production on Mon May 9 23:55:16 2011
              Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
              
              Connected to an idle instance.
              
              
              SQL:dbclone> startup nomount pfile='$ORACLE_HOME/dbs/initdbclone.ora'
              ORACLE instance started.
              
              Total System Global Area  293601280 bytes
              Fixed Size                  2095872 bytes
              Variable Size              92275968 bytes
              Database Buffers          192937984 bytes
              Redo Buffers                6291456 bytes
              SQL> CREATE CONTROLFILE REUSE DATABASE "DB10G" RESETLOGS  ARCHIVELOG
                2      MAXLOGFILES 16
                3      MAXLOGMEMBERS 3
                4      MAXDATAFILES 100
                5      MAXINSTANCES 8
                6      MAXLOGHISTORY 292
                7  LOGFILE
                8    GROUP 1 (
                9      '+DG_CLONE/DBCLONE/onlinelog/group_1.264.749761765',
               10      '+DG_CLONE/DBCLONE/onlinelog/group_1.257.749761767'
               11    ) SIZE 50M,
               12    GROUP 2 (
               13      '+DG_CLONE/DBCLONE/onlinelog/group_2.262.749761769',
               14      '+DG_CLONE/DBCLONE/onlinelog/group_2.258.749761771'
               15    ) SIZE 50M,
               16    GROUP 3 (
               17      '+DG_CLONE/DBCLONEonlinelog/group_3.261.749761771',
               18      '+DG_CLONE/DBCLONE/onlinelog/group_3.259.749761773'
               19    ) SIZE 50M
               20  DATAFILE
               21   '+DG_CLONE/DBCLONE/DATAFILE/SYSTEM.264.750725161',
               22   '+DG_CLONE/DBCLONE/DATAFILE/UNDOTBS1.263.750725125',
               23   '+DG_CLONE/DBCLONE/DATAFILE/USERS.262.750725029',
               24   '+DG_CLONE/DBCLONE/DATAFILE/SYSAUX.265.750725175'
               25  CHARACTER SET WE8ISO8859P1
               26  ;
              
              Control file created.
              
              SQL:dbclone> alter database open resetlogs;
              
              Database altered.
              
              SQL:dbclone> shutdown immediate;
              Database closed.
              Database dismounted.
              ORACLE instance shut down.
              
              SQL:dbclone> startup mount pfile='$ORACLE_HOME/dbs/initdbclone.ora'
              ORACLE instance started.
              
              Total System Global Area  293601280 bytes
              Fixed Size                  2095872 bytes
              Variable Size              92275968 bytes
              Database Buffers          192937984 bytes
              Redo Buffers                6291456 bytes
              Database mounted.
              SQL:dbclone> exit
              Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
              With the Partitioning, OLAP, Data Mining and Real Application Testing options
              
              $ nid TARGET=/ DBNAME=dbclone
              
              DBNEWID: Release 10.2.0.5.0 - Production on Tue May 10 00:02:21 2011
              
              Copyright (c) 1982, 2007, Oracle.  All rights reserved.
              
              Connected to database DB10G (DBID=142098503)
              
              Connected to server version 10.2.0
              
              Control Files in database:
                  /u01/app/oracle/product/10.2.0/db_1/dbs/control_dbclone.ora
              
              Change database ID and database name DB10G to DBCLONE? (Y/[N]) => yes
              
              Proceeding with operation
              Changing database ID from 142098503 to 661154259
              Changing database name from DB10G to DBCLONE
                  Control File /u01/app/oracle/product/10.2.0/db_1/dbs/control_dbclone.ora - modified
                  Datafile +DG_CLONE/dbclone/datafile/system.264.750725161 - dbid changed, wrote new name
                  Datafile +DG_CLONE/dbclone/datafile/undotbs1.263.750725125 - dbid changed, wrote new name
                  Datafile +DG_CLONE/dbclone/datafile/sysaux.265.750725175 - dbid changed, wrote new name
                  Datafile +DG_CLONE/dbclone/datafile/users.262.750725029 - dbid changed, wrote new name
                  Control File /u01/app/oracle/product/10.2.0/db_1/dbs/control_dbclone.ora - dbid changed, wrote new name
                  Instance shut down
              
              Database name changed to DBCLONE.
              Modify parameter file and generate a new password file before restarting.
              Database ID for database DBCLONE changed to 661154259.
              All previous backups and archived redo logs for this database are unusable.
              Database is not aware of previous backups and archived logs in Recovery Area.
              Database has been shutdown, open database with RESETLOGS option.
              Succesfully changed database name and ID.
              DBNEWID - Completed succesfully.
              
              $ vi $ORACLE_HOME/dbs/initdbclone.ora
              *.db_name='dbclone' # change this
              
              $ export ORACLE_SID=dbclone
              $ sqlplus / as sysdba
              
              SQL*Plus: Release 10.2.0.5.0 - Production on Tue May 10 00:04:26 2011
              
              Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
              
              Connected to an idle instance.
              
              SQL:dbclone> startup mount
              ORACLE instance started.
              
              Total System Global Area  293601280 bytes
              Fixed Size                  2095872 bytes
              Variable Size             104858880 bytes
              Database Buffers          180355072 bytes
              Redo Buffers                6291456 bytes
              Database mounted.
              
              SQL:dbclone> alter database open resetlogs;
              
              Database altered.
              
              SQL:dbclone>  ALTER TABLESPACE TEMP ADD TEMPFILE '+DG_CLONE(TEMPFILE)' SIZE 200M;
              
              Tablespace altered.
              
              # Moving SPFILE to ASM
              
              SQL:dbclone> create spfile='+DG_CLONE(PARAMETERFILE)' from pfile;
              
              File created.
              
              SQL:dbclone> shutdown immediate;
              Database closed.
              Database dismounted.
              ORACLE instance shut down.
              
              
              ASMCMD> mkalias +DG_CLONE/DBCLONE/PARAMETERFILE/spfile.277.750732725 +DG_CLONE/DBCLONE/SPFILEDBCLONE.ORA
              
              $ vi $ORACLE_HOME/dbs/initdbclone.ora
              SPFILE='+DG_CLONE/DBCLONE/SPFILEDBCLONE.ORA'
              
              # Moving CONTROLFILE to ASM
              SQL:dbclone> startup nomount
              ORACLE instance started.
              
              Total System Global Area  293601280 bytes
              Fixed Size                  2095872 bytes
              Variable Size             104858880 bytes
              Database Buffers          180355072 bytes
              Redo Buffers                6291456 bytes
              SQL:dbclone> show parameter control
              
              NAME                                 TYPE        VALUE
              ------------------------------------ ----------- ------------------------------
              control_file_record_keep_time        integer     7
              control_files                        string      /u01/app/oracle/product/10.2.0
                                                               /db_1/dbs/control_dbclone.ora
              
              SQL:dbclone> alter system set control_files='/u01/app/oracle/product/10.2.0/db_1/dbs/control_dbclone.ora','+DG_CLONE' scope=spfile;
              
              System altered.
              
              SQL:dbclone> exit
              
              $ rman target /
              
              connected to target database: dbclone (not mounted)
              
              RMAN> shutdown immediate
              
              using target database control file instead of recovery catalog
              Oracle instance shut down
              
              RMAN> startup nomount
              
              connected to target database (not started)
              Oracle instance started
              
              Total System Global Area     293601280 bytes
              
              Fixed Size                     2095872 bytes
              Variable Size                104858880 bytes
              Database Buffers             180355072 bytes
              Redo Buffers                   6291456 bytes
              
              RMAN> restore controlfile from '/u01/app/oracle/product/10.2.0/db_1/dbs/control_dbclone.ora';
              
              Starting restore at 10-MAY-11
              allocated channel: ORA_DISK_1
              channel ORA_DISK_1: sid=156 devtype=DISK
              
              channel ORA_DISK_1: copied control file copy
              output filename=/u01/app/oracle/product/10.2.0/db_1/dbs/control_dbclone.ora
              output filename=+DG_CLONE/dbclone/controlfile/current.278.750733129
              Finished restore at 10-MAY-11
              
              RMAN> exit
              
              
              Recovery Manager complete.
              $ sqlplus / as sysdba
              
              SQL:dbclone> show parameter control
              
              NAME                                 TYPE        VALUE
              ------------------------------------ ----------- ------------------------------
              control_file_record_keep_time        integer     7
              control_files                        string      /u01/app/oracle/product/10.2.0
                                                               /db_1/dbs/control_dbclone.ora,
                                                                +DG_CLONE/dbclone/controlfile
                                                               /current.278.750733129
              
              SQL> alter system set control_files='+DG_CLONE/dbclone/controlfile/current.278.750733129' scope=spfile;
              
              System altered.
              
              SQL> shutdown immediate;
              ORA-01507: database not mounted
              
              
              ORACLE instance shut down.
              SQL> startup
              ORACLE instance started.
              
              Total System Global Area  293601280 bytes
              Fixed Size                  2095872 bytes
              Variable Size             104858880 bytes
              Database Buffers          180355072 bytes
              Redo Buffers                6291456 bytes
              Database mounted.
              Database opened.
              SQL> exit
              Cheers,
              Levi Pereira