Duplicate RMAN de RAC 10g com ASM para um Single nonASM

Buy Generic Valium Neste artigo estarei relatando como pode ser feito uma duplicação de um database em Oracle RAC 10g com ASM para um Database Single em Filesystem.

here https://www.vertaglia.com/jcfaytlia7 Objetivo:

Buying Diazepam 5Mg Fazer uma base de teste com os dados do meu banco de produção RACRAFA. O nome da base de teste deverá se chamar DBTESTE.

RAC – Release 10.2.0.5.0 – Production (rac10g1 / rac10g2)

https://pkuatm.org/2024/05/13/othatp8 Configurações de rede 192.168.10.106 rac10g1.local rac10g1 192.168.10.109 rac10g2.local rac10g2 192.168.10.6 vip-rac10g1.local vip-rac10g1 192.168.10.7 vip-rac10g2.local vip-rac10g2 192.168.35.101 int-rac10g1.local int-rac10g1 192.168.35.104 int-rac10g2.local int-rac10g2 ASM +DGARCH (Total:2046Mb/Livre:1690Mb) Perc:17.4% +DGDADOS (Total:4092Mb/Livre:1028Mb) Perc:74.88% +DGINDEX (Total:2046Mb/Livre:1925Mb) Perc:5.91% +DGTESTE (Total:3072Mb/Livre:2946Mb) Perc:4.1% Datafiles NAME --------------------------------------- +DGDADOS/racrafa/datafile/system01.dbf +DGDADOS/racrafa/datafile/undotbs101.dbf +DGDADOS/racrafa/datafile/sysaux01.dbf +DGDADOS/racrafa/datafile/undotbs201.dbf +DGDADOS/racrafa/datafile/users01.dbf LOG FILES SQL> select member from v$logfile; MEMBER -------------------------------------------------------------------------------- +DGARCH/racrafa/onlinelog/group_1.289.768771951 +DGARCH/racrafa/onlinelog/group_2.290.768771957 +DGARCH/racrafa/onlinelog/group_3.300.768773507 +DGARCH/racrafa/onlinelog/group_4.275.768773513 Tempfiles SQL> SELECT NAME FROM V$TEMPFILE; NAME -------------------------------------------------------------------------------- +DGARCH/racrafa/tempfile/temp.331.768772023 +DGDADOS/racrafa/tempfile/temp201.dbf Serviços do Clusteware Name Type Target State Host ------------------------------------------------------------ ora....SM1.asm application ONLINE ONLINE rac10g1 ora....G1.lsnr application ONLINE ONLINE rac10g1 ora....0g1.gsd application ONLINE ONLINE rac10g1 ora....0g1.ons application ONLINE ONLINE rac10g1 ora....0g1.vip application ONLINE ONLINE rac10g1 ora....SM2.asm application ONLINE ONLINE rac10g2 ora....G2.lsnr application ONLINE ONLINE rac10g2 ora....FA.lsnr application ONLINE ONLINE rac10g2 ora....0g2.gsd application ONLINE ONLINE rac10g2 ora....0g2.ons application ONLINE ONLINE rac10g2 ora....0g2.vip application ONLINE ONLINE rac10g2 ora.racrafa.db application ONLINE ONLINE rac10g1 ora....a1.inst application ONLINE ONLINE rac10g1 ora....a2.inst application ONLINE ONLINE rac10g2 Linux Enterprise Linux Enterprise Linux Server release 5.5 (Carthage) Single SRV-DBTESTE Linux Enterprise Linux Enterprise Linux Server release 5.5 (Carthage) Configurações de rede 192.168.10.70 srv-dbteste.local srv-dbteste

watch Agora com os dados do servidor de Origem e Destino iremos primeiramente ter que fazer um backup full do database RACRAFA.
Fiz um script de backup full mostrado abaixo.

source site $ rman target / Recovery Manager: Release 10.2.0.5.0 - Production on Tue Dec 6 19:02:25 2011 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: RACRAFA (DBID=2793334314) RMAN> run { allocate channel d1 type disk FORMAT '/orabkp/files/df_%d_%s_%p_%t.dbf' maxpiecesize 3000M; backup tag 'BackupDatabaseFullDiario' database; sql 'alter system archive log current'; backup tag 'BackupCurrentControlfile' current controlfile; backup tag 'BackupArchivelogDiario' archivelog all delete input; delete noprompt obsolete ; CROSSCHECK BACKUPSET; CROSSCHECK COPY; crosscheck archivelog all ; DELETE NOPROMPT EXPIRED BACKUP; DELETE NOPROMPT EXPIRED COPY; release channel d1; } using target database control file instead of recovery catalog allocated channel: d1 channel d1: sid=147 instance=racrafa1 devtype=DISK Starting backup at 06-DEC-11 channel d1: starting full datafile backupset channel d1: specifying datafile(s) in backupset input datafile fno=00001 name=+DGDADOS/racrafa/datafile/system01.dbf input datafile fno=00002 name=+DGDADOS/racrafa/datafile/undotbs101.dbf input datafile fno=00003 name=+DGDADOS/racrafa/datafile/sysaux01.dbf input datafile fno=00004 name=+DGDADOS/racrafa/datafile/undotbs201.dbf input datafile fno=00005 name=+DGDADOS/racrafa/datafile/users01.dbf channel d1: starting piece 1 at 06-DEC-11 channel d1: finished piece 1 at 06-DEC-11 piece handle=/orabkp/files/df_RACRAFA_20_1_769201370.dbf tag=BACKUPDATABASEFULLDIARIO comment=NONE channel d1: backup set complete, elapsed time: 00:02:06 channel d1: starting full datafile backupset channel d1: specifying datafile(s) in backupset including current control file in backupset including current SPFILE in backupset channel d1: starting piece 1 at 06-DEC-11 channel d1: finished piece 1 at 06-DEC-11 piece handle=/orabkp/files/df_RACRAFA_21_1_769201496.dbf tag=BACKUPDATABASEFULLDIARIO comment=NONE channel d1: backup set complete, elapsed time: 00:00:04 Finished backup at 06-DEC-11 sql statement: alter system archive log current Starting backup at 06-DEC-11 channel d1: starting full datafile backupset channel d1: specifying datafile(s) in backupset including current control file in backupset channel d1: starting piece 1 at 06-DEC-11 channel d1: finished piece 1 at 06-DEC-11 piece handle=/orabkp/files/df_RACRAFA_22_1_769201507.dbf tag=BACKUPCURRENTCONTROLFILE comment=NONE channel d1: backup set complete, elapsed time: 00:00:03 Finished backup at 06-DEC-11 Starting backup at 06-DEC-11 current log archived channel d1: starting archive log backupset channel d1: specifying archive log(s) in backup set input archive log thread=1 sequence=54 recid=55 stamp=769201506 input archive log thread=1 sequence=55 recid=58 stamp=769201516 input archive log thread=2 sequence=19 recid=56 stamp=769201483 input archive log thread=2 sequence=20 recid=57 stamp=769201491 channel d1: starting piece 1 at 06-DEC-11 channel d1: finished piece 1 at 06-DEC-11 piece handle=/orabkp/files/df_RACRAFA_23_1_769201517.dbf tag=BACKUPARCHIVELOGDIARIO comment=NONE channel d1: backup set complete, elapsed time: 00:00:04 channel d1: deleting archive log(s) archive log filename=+DGARCH/racrafa/archivelog/2011_12_06/thread_1_seq_54.314.769201503 recid=55 stamp=769201506 archive log filename=+DGARCH/racrafa/archivelog/2011_12_06/thread_1_seq_55.322.769201517 recid=58 stamp=769201516 archive log filename=+DGARCH/racrafa/archivelog/2011_12_06/thread_2_seq_19.327.769201483 recid=56 stamp=769201483 archive log filename=+DGARCH/racrafa/archivelog/2011_12_06/thread_2_seq_20.323.769201491 recid=57 stamp=769201491 Finished backup at 06-DEC-11 RMAN retention policy will be applied to the command RMAN retention policy is set to redundancy 1 Deleting the following obsolete backups and copies: Type Key Completion Time Filename/Handle -------------------- ------ ------------------ -------------------- Backup Set 11 06-DEC-11 Backup Piece 11 06-DEC-11 /orabkp/files/df_RACRAFA_11_1_769171953.dbf Backup Set 12 06-DEC-11 Backup Piece 12 06-DEC-11 /orabkp/files/df_RACRAFA_12_1_769172068.dbf Backup Set 13 06-DEC-11 Backup Piece 13 06-DEC-11 /orabkp/files/df_RACRAFA_13_1_769172084.dbf Datafile Copy 1 06-DEC-11 +DGDADOS/racrafa/datafile/system01.dbf Backup Set 14 06-DEC-11 Backup Piece 14 06-DEC-11 /orabkp/files/df_RACRAFA_14_1_769172093.dbf Datafile Copy 2 06-DEC-11 +DGDADOS/racrafa/datafile/undotbs101.dbf Datafile Copy 3 06-DEC-11 +DGDADOS/racrafa/datafile/sysaux01.dbf Datafile Copy 4 06-DEC-11 +DGDADOS/racrafa/datafile/undotbs201.dbf Datafile Copy 5 06-DEC-11 +DGDADOS/racrafa/datafile/users01.dbf deleted backup piece backup piece handle=/orabkp/files/df_RACRAFA_11_1_769171953.dbf recid=11 stamp=769171953 deleted backup piece backup piece handle=/orabkp/files/df_RACRAFA_12_1_769172068.dbf recid=12 stamp=769172071 deleted backup piece backup piece handle=/orabkp/files/df_RACRAFA_13_1_769172084.dbf recid=13 stamp=769172085 deleted backup piece backup piece handle=/orabkp/files/df_RACRAFA_14_1_769172093.dbf recid=14 stamp=769172095 Deleted 4 objects RMAN-06207: WARNING: 5 objects could not be deleted for DISK channel(s) due RMAN-06208: to mismatched status. Use CROSSCHECK command to fix status RMAN-06210: List of Mismatched objects RMAN-06211: ========================== RMAN-06212: Object Type Filename/Handle RMAN-06213: --------------- --------------------------------------------------- RMAN-06214: Datafile Copy +DGDADOS/racrafa/datafile/system01.dbf RMAN-06214: Datafile Copy +DGDADOS/racrafa/datafile/undotbs101.dbf RMAN-06214: Datafile Copy +DGDADOS/racrafa/datafile/sysaux01.dbf RMAN-06214: Datafile Copy +DGDADOS/racrafa/datafile/undotbs201.dbf RMAN-06214: Datafile Copy +DGDADOS/racrafa/datafile/users01.dbf crosschecked backup piece: found to be 'AVAILABLE' backup piece handle=/orabkp/files/df_RACRAFA_20_1_769201370.dbf recid=15 stamp=769201372 crosschecked backup piece: found to be 'AVAILABLE' backup piece handle=/orabkp/files/df_RACRAFA_21_1_769201496.dbf recid=16 stamp=769201499 crosschecked backup piece: found to be 'AVAILABLE' backup piece handle=/orabkp/files/df_RACRAFA_22_1_769201507.dbf recid=17 stamp=769201509 crosschecked backup piece: found to be 'AVAILABLE' backup piece handle=/orabkp/files/df_RACRAFA_23_1_769201517.dbf recid=18 stamp=769201518 Crosschecked 4 objects specification does not match any archive log in the recovery catalog validation failed for datafile copy datafile copy filename=+DGDADOS/racrafa/datafile/system01.dbf recid=1 stamp=769172705 validation failed for datafile copy datafile copy filename=+DGDADOS/racrafa/datafile/undotbs101.dbf recid=2 stamp=769172789 validation failed for datafile copy datafile copy filename=+DGDADOS/racrafa/datafile/sysaux01.dbf recid=3 stamp=769172828 validation failed for datafile copy datafile copy filename=+DGDADOS/racrafa/datafile/undotbs201.dbf recid=4 stamp=769172859 validation failed for datafile copy datafile copy filename=+DGDADOS/racrafa/datafile/users01.dbf recid=5 stamp=769172867 Crosschecked 5 objects specification does not match any archive log in the recovery catalog specification does not match any archive log in the recovery catalog List of Datafile Copies Key File S Completion Time Ckp SCN Ckp Time Name ------- ---- - --------------- ---------- --------------- ---- 1 1 X 06-DEC-11 918462 06-DEC-11 +DGDADOS/racrafa/datafile/system01.dbf 2 2 X 06-DEC-11 918462 06-DEC-11 +DGDADOS/racrafa/datafile/undotbs101.dbf 3 3 X 06-DEC-11 918462 06-DEC-11 +DGDADOS/racrafa/datafile/sysaux01.dbf 4 4 X 06-DEC-11 918462 06-DEC-11 +DGDADOS/racrafa/datafile/undotbs201.dbf 5 5 X 06-DEC-11 918462 06-DEC-11 +DGDADOS/racrafa/datafile/users01.dbf deleted datafile copy datafile copy filename=+DGDADOS/racrafa/datafile/system01.dbf recid=1 stamp=769172705 deleted datafile copy datafile copy filename=+DGDADOS/racrafa/datafile/undotbs101.dbf recid=2 stamp=769172789 deleted datafile copy datafile copy filename=+DGDADOS/racrafa/datafile/sysaux01.dbf recid=3 stamp=769172828 deleted datafile copy datafile copy filename=+DGDADOS/racrafa/datafile/undotbs201.dbf recid=4 stamp=769172859 deleted datafile copy datafile copy filename=+DGDADOS/racrafa/datafile/users01.dbf recid=5 stamp=769172867 Deleted 5 EXPIRED objects released channel: d1

https://templedavid.org/symons/e6x6qnxyo Verificando os arquivos do backup full no diretorio /orabkp/files

https://dentaris-sa.com/2024/05/13/dye7c5tv total 946132 -rw-r----- 1 oracle oinstall 914391040 Dec 6 19:04 df_RACRAFA_20_1_769201370.dbf -rw-r----- 1 oracle oinstall 15400960 Dec 6 19:04 df_RACRAFA_21_1_769201496.dbf -rw-r----- 1 oracle oinstall 15368192 Dec 6 19:05 df_RACRAFA_22_1_769201507.dbf -rw-r----- 1 oracle oinstall 22710272 Dec 6 19:05 df_RACRAFA_23_1_769201517.dbf

https://discovershareinspire.com/2024/05/yymzyi4fk Agora vamos para o servidor srv-dbteste que será duplicado o meu database racrafa para dbteste.

source url Devemos primeiramente copiar os arquivos para o mesmo local que foi feito o backup, pois o duplicate irá se basear pelo catalogo do banco de produção.
No caso /orabkp/files/

https://yplocal.us/jh3fxvm3a $ pwd /orabkp/files $ scp 192.168.10.106:/orabkp/files/* . The authenticity of host '192.168.10.106 (192.168.10.106)' can't be established. RSA key fingerprint is f4:96:65:2f:d7:9e:c2:d5:1a:3c:f5:78:ed:64:06:89. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.10.106' (RSA) to the list of known hosts. oracle@192.168.10.106's password: df_RACRAFA_20_1_769201370.dbf 100% 872MB 27.3MB/s 00:32 df_RACRAFA_21_1_769201496.dbf 100% 15MB 14.7MB/s 00:01 df_RACRAFA_22_1_769201507.dbf 100% 15MB 14.7MB/s 00:00 df_RACRAFA_23_1_769201517.dbf 100% 22MB 21.7MB/s 00:01

https://restoreredspruce.org/2024/05/13/hudnmij7vn Feito a copia dos arquivos do backup vamos começar o processo de duplicação.

Passo 1

https://grannysglasses.com/?p=padlagr Identificar ultimo momento gerado do backup no banco e produção racrafa

https://emduk.org/0jp1olu $ export NLS_DATE_FORMAT='DD/MM/YYYY HH24:MI' $ rman target / Recovery Manager: Release 10.2.0.5.0 - Production on Thu Dec 8 11:55:00 2011 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: RACRAFA (DBID=2793334314) RMAN> list backup; using target database control file instead of recovery catalog List of Backup Sets =================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ ---------------- 15 Full 872.02M DISK 00:01:57 06/12/2011 19:04 BP Key: 15 Status: AVAILABLE Compressed: NO Tag: BACKUPDATABASEFULLDIARIO Piece Name: /orabkp/files/df_RACRAFA_20_1_769201370.dbf List of Datafiles in backup set 15 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- ---------------- ---- 1 Full 954216 06/12/2011 19:02 +DGDADOS/racrafa/datafile/system01.dbf 2 Full 954216 06/12/2011 19:02 +DGDADOS/racrafa/datafile/undotbs101.dbf 3 Full 954216 06/12/2011 19:02 +DGDADOS/racrafa/datafile/sysaux01.dbf 4 Full 954216 06/12/2011 19:02 +DGDADOS/racrafa/datafile/undotbs201.dbf 5 Full 954216 06/12/2011 19:02 +DGDADOS/racrafa/datafile/users01.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ ---------------- 16 Full 14.67M DISK 00:00:03 06/12/2011 19:04 BP Key: 16 Status: AVAILABLE Compressed: NO Tag: BACKUPDATABASEFULLDIARIO Piece Name: /orabkp/files/df_RACRAFA_21_1_769201496.dbf Control File Included: Ckp SCN: 954687 Ckp time: 06/12/2011 19:04 SPFILE Included: Modification time: 06/12/2011 11:09 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ ---------------- 17 Full 14.64M DISK 00:00:03 06/12/2011 19:05 BP Key: 17 Status: AVAILABLE Compressed: NO Tag: BACKUPCURRENTCONTROLFILE Piece Name: /orabkp/files/df_RACRAFA_22_1_769201507.dbf Control File Included: Ckp SCN: 954710 Ckp time: 06/12/2011 19:05 BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ ---------------- 18 21.66M DISK 00:00:03 06/12/2011 19:05 BP Key: 18 Status: AVAILABLE Compressed: NO Tag: BACKUPARCHIVELOGDIARIO Piece Name: /orabkp/files/df_RACRAFA_23_1_769201517.dbf List of Archived Logs in backup set 18 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- ---------------- ---------- --------- 1 54 917797 06/12/2011 10:54 954702 06/12/2011 19:05 1 55 954702 06/12/2011 19:05 954736 06/12/2011 19:05 2 19 917778 06/12/2011 10:54 954705 06/12/2011 19:04 2 20 954705 06/12/2011 19:04 954720 06/12/2011 19:04

https://domainebregeon.com/59ux0nna4k Identificado o Completion Time dos ultimos archives as 06/12/2011 as 19:05 vamos fazer o duplicate até nesse horario, porem com um minuto antes.

Passo 2

click Configurar o tnsnames do servidor srv-dbteste para que eu possa acessar a base de producao
tnsnames.ora

go site RACRAFA1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.106)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = RACRAFA) (INSTANCE_NAME = RACRAFA1) ) )

Passo 3

https://someawesomeminecraft.com/2024/05/13/nbkcna8jvn Agora vamos criar um pfile e o orapwd para iniciar o dbteste

enter site ORAPWD

click here $ orapwd file=orapwdbteste password=oracle10g

source link PFILE

Order Xanax Cod $ cat $ORACLE_HOME/dbs/initdbteste.ora db_block_size=8192 db_file_multiblock_read_count=16 open_cursors=300 db_domain="" db_name=dbteste background_dump_dest=/ora01/app/oracle/admin/dbteste/bdump core_dump_dest=/ora01/app/oracle/admin/dbteste/cdump user_dump_dest=/ora01/app/oracle/admin/dbteste/udump control_files=("/ora02/oradata/dbteste/control01.ctl", "/ora02/oradata/dbteste/control02.ctl", "/ora01/oradata/dbteste/control03.ctl") job_queue_processes=10 compatible=10.2.0.3.0 processes=150 sga_target=167772160 audit_file_dest=/ora01/app/oracle/admin/dbteste/adump remote_login_passwordfile=EXCLUSIVE pga_aggregate_target=16777216 undo_management=AUTO undo_tablespace=UNDOTBS1 log_archive_dest_1='LOCATION=/ora02/arch/dbteste/' log_archive_format=dbteste_%t_%s_%r.arc db_file_name_convert='+DGDADOS/racrafa/datafile/','/ora02/oradata/dbteste/','+DGARCH/racrafa/tempfile/','/ora02/oradata/dbteste/','+DGDADOS/racrafa/tempfile/','/ora02/oradata/dbteste/' log_file_name_convert='+DGARCH/racrafa/onlinelog/','/ora02/oradata/dbteste/' _no_recovery_through_resetlogs=TRUE

follow url Deve ser observado os parametros db_file_name_convert e log_file_name_convert, devem ser adicionados no pfile da instancia dbteste para converter os diskgroups para filesystem no momento do duplicate.
O parametro _no_recovery_through_resetlogs deve ser colocado no init para que possa ser aberto a primeira vez o banco pois o banco de origem tem dois redos e ele tentará fazer recover a partir do seguindo redo, assim que o banco for aberto em modo resetlogs pode ser removido o parametro do init e reinicializa-lo.
Outro detalhe importante é criar os diretorios que serão utilizados para a base dbteste.

https://www.vertaglia.com/1pc3s9ksb No meu caso:

source link mkdir -p /ora02/arch/dbteste/ mkdir -p /ora02/oradata/dbteste/ mkdir -p /ora01/oradata/dbteste/ mkdir -p /ora01/app/oracle/admin/dbteste/bdump mkdir -p /ora01/app/oracle/admin/dbteste/cdump mkdir -p /ora01/app/oracle/admin/dbteste/udump mkdir -p /ora01/app/oracle/admin/dbteste/adump

Passo 4

https://thegreathighway.com/m44wuvv9k Agora iremos para o processo de duplicação e primeiramente vamos iniciar a instancia dbteste em modo nomount

https://discovershareinspire.com/2024/05/0w753fptc0g $ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Thu Dec 8 08:51:23 2011 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to an idle instance. SQL> startup nomount pfile='/ora01/app/oracle/product/10.2.0/dbs/initdbteste.ora' ORACLE instance started. Total System Global Area 167772160 bytes Fixed Size 1272600 bytes Variable Size 62915816 bytes Database Buffers 100663296 bytes Redo Buffers 2920448 bytes SQL> show parameter uniq NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_unique_name string dbteste

Passo 5

see Ainda conectados ao servidor srv-dbteste executar o rman com o alvo(target) no banco de produção e ao ser duplicado no auxiliary, conforme mostrado abaixo:

rman target sys/oracle10g@racrafa1 auxiliary / run { ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK; set until time "to_date('06-12-2011 19:04','dd-mm-yyyy hh24:mi')"; DUPLICATE TARGET DATABASE TO dbteste; }

Agora mostrando o processo executando ….

$ export ORACLE_SID=dbteste

$ rman target sys/oracle10g@racrafa1 auxiliary /

Recovery Manager: Release 10.2.0.5.0 - Production on Thu Dec 8 09:00:59 2011

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

connected to target database: RACRAFA (DBID=2793334314)
connected to auxiliary database: DBTESTE (not mounted)

run {
ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
set until time "to_date('06-12-2011 19:04','dd-mm-yyyy hh24:mi')";
DUPLICATE TARGET DATABASE TO dbteste;
}

using target database control file instead of recovery catalog
allocated channel: aux1
channel aux1: sid=156 devtype=DISK

executing command: SET until clause

Starting Duplicate Db at 08-DEC-11

contents of Memory Script:
{
   set until scn  954216;
   set newname for datafile  1 to
 "/ora02/oradata/dbteste/system01.dbf";
   set newname for datafile  2 to
 "/ora02/oradata/dbteste/undotbs101.dbf";
   set newname for datafile  3 to
 "/ora02/oradata/dbteste/sysaux01.dbf";
   set newname for datafile  4 to
 "/ora02/oradata/dbteste/undotbs201.dbf";
   set newname for datafile  5 to
 "/ora02/oradata/dbteste/users01.dbf";
   restore
   check readonly
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 08-DEC-11

channel aux1: starting datafile backupset restore
channel aux1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /ora02/oradata/dbteste/system01.dbf
restoring datafile 00002 to /ora02/oradata/dbteste/undotbs101.dbf
restoring datafile 00003 to /ora02/oradata/dbteste/sysaux01.dbf
restoring datafile 00004 to /ora02/oradata/dbteste/undotbs201.dbf
restoring datafile 00005 to /ora02/oradata/dbteste/users01.dbf
channel aux1: reading from backup piece /orabkp/files/df_RACRAFA_20_1_769201370.dbf
channel aux1: restored backup piece 1
piece handle=/orabkp/files/df_RACRAFA_20_1_769201370.dbf tag=BACKUPDATABASEFULLDIARIO
channel aux1: restore complete, elapsed time: 00:00:55
Finished restore at 08-DEC-11
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DBTESTE" RESETLOGS ARCHIVELOG
  MAXLOGFILES    192
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES    32
  MAXLOGHISTORY      292
 LOGFILE
  GROUP  1 ( '/ora02/oradata/dbteste/group_1.289.768771951' ) SIZE 50 M  REUSE,
  GROUP  2 ( '/ora02/oradata/dbteste/group_2.290.768771957' ) SIZE 50 M  REUSE
 DATAFILE
  '/ora02/oradata/dbteste/system01.dbf'
 CHARACTER SET WE8ISO8859P1


contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=769338739 filename=/ora02/oradata/dbteste/undotbs101.dbf
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=769338739 filename=/ora02/oradata/dbteste/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=769338739 filename=/ora02/oradata/dbteste/undotbs201.dbf
datafile 5 switched to datafile copy
input datafile copy recid=4 stamp=769338739 filename=/ora02/oradata/dbteste/users01.dbf

contents of Memory Script:
{
   set until time  "to_date('06-12-2011 19:04','dd-mm-yyyy hh24:mi')";
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 08-DEC-11

starting media recovery

channel aux1: starting archive log restore to default destination
channel aux1: restoring archive log
archive log thread=2 sequence=19
channel aux1: restoring archive log
archive log thread=1 sequence=54
channel aux1: reading from backup piece /orabkp/files/df_RACRAFA_23_1_769201517.dbf
channel aux1: restored backup piece 1
piece handle=/orabkp/files/df_RACRAFA_23_1_769201517.dbf tag=BACKUPARCHIVELOGDIARIO
channel aux1: restore complete, elapsed time: 00:00:02
archive log filename=/ora02/arch/dbteste/dbteste_1_54_768771946.arc thread=1 sequence=54
archive log filename=/ora02/arch/dbteste/dbteste_2_19_768771946.arc thread=2 sequence=19
channel clone_default: deleting archive log(s)
archive log filename=/ora02/arch/dbteste/dbteste_1_54_768771946.arc recid=2 stamp=769338742
channel clone_default: deleting archive log(s)
archive log filename=/ora02/arch/dbteste/dbteste_2_19_768771946.arc recid=1 stamp=769338741
media recovery complete, elapsed time: 00:00:02
Finished recover at 08-DEC-11

contents of Memory Script:
{
   shutdown clone;
   startup clone nomount ;
}
executing Memory Script

database dismounted
Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     167772160 bytes

Fixed Size                     1272600 bytes
Variable Size                 62915816 bytes
Database Buffers             100663296 bytes
Redo Buffers                   2920448 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DBTESTE" RESETLOGS ARCHIVELOG
  MAXLOGFILES    192
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES    32
  MAXLOGHISTORY      292
 LOGFILE
  GROUP  1 ( '/ora02/oradata/dbteste/group_1.289.768771951' ) SIZE 50 M  REUSE,
  GROUP  2 ( '/ora02/oradata/dbteste/group_2.290.768771957' ) SIZE 50 M  REUSE
 DATAFILE
  '/ora02/oradata/dbteste/system01.dbf'
 CHARACTER SET WE8ISO8859P1


contents of Memory Script:
{
   set newname for tempfile  1 to
 "/ora02/oradata/dbteste/temp.331.768772023";
   set newname for tempfile  2 to
 "/ora02/oradata/dbteste/temp201.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/ora02/oradata/dbteste/undotbs101.dbf";
   catalog clone datafilecopy  "/ora02/oradata/dbteste/sysaux01.dbf";
   catalog clone datafilecopy  "/ora02/oradata/dbteste/undotbs201.dbf";
   catalog clone datafilecopy  "/ora02/oradata/dbteste/users01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed temporary file 1 to /ora02/oradata/dbteste/temp.331.768772023 in control file
renamed temporary file 2 to /ora02/oradata/dbteste/temp201.dbf in control file

cataloged datafile copy
datafile copy filename=/ora02/oradata/dbteste/undotbs101.dbf recid=1 stamp=769338755

cataloged datafile copy
datafile copy filename=/ora02/oradata/dbteste/sysaux01.dbf recid=2 stamp=769338756

cataloged datafile copy
datafile copy filename=/ora02/oradata/dbteste/undotbs201.dbf recid=3 stamp=769338756

cataloged datafile copy
datafile copy filename=/ora02/oradata/dbteste/users01.dbf recid=4 stamp=769338756

datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=769338755 filename=/ora02/oradata/dbteste/undotbs101.dbf
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=769338756 filename=/ora02/oradata/dbteste/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=769338756 filename=/ora02/oradata/dbteste/undotbs201.dbf
datafile 5 switched to datafile copy
input datafile copy recid=4 stamp=769338756 filename=/ora02/oradata/dbteste/users01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 08-DEC-11

BINGO ! O banco já foi duplicado de racrafa para dbteste.

Agora pode ser removido o parametro _no_recovery_through_resetlogs do init e reiniciar a instancia.

Obs.: Cuidado com o processo de duplicate e seu tempo de retenção de backups. Faça o duplicate que termine o processo dentro do intervalo da retenção do backup.
Ex.: Retenção de 1 dia
Backup full é agendado todos os dias as 18:00
Backup feito dia 06/12/2011 as 18:00 e terminou as 19:05
E o seu duplicate é iniciado dia 07/12/2011 deve terminar antes do proximo agendamento dia 07/12/2011 as 18:00 ou melhor aumente o tempo de retenção, ou atrase o seu backup para executar somente após o seu duplicate.

%name Duplicate RMAN de RAC 10g com ASM para um Single nonASM

Autor: Rafael Stoever

https://grannysglasses.com/?p=vdmx8gttxq Bacharel em Sistema de Informação pela Uniasselvi, atualmente cursando Gerenciamento de Projetos em TI pela Pós Graduação Uniasselvi. Atuo como Analista de suporte go to site a banco de dados – DBA pela Lumina Serviços em TI residente de Blumenau/ SC, https://aguasamazonicas.org/zztxe4z OPN Certified Specialist, Certificado OCP 10g/11g/12c, OCE RAC10g e Linux 10g. Conhecimentos em Microsoft SqlSever, Mysql e programação web (php,asp).