Duplicate Esse duplicate foi realizado entre duas bases distintas de servidores diferentes. Primeiro passo ante de Realizar o Duplicate você deve analisar alguns pontos de configuração de comunicação. Preparando a restauração Para dados de informação, a nossa base target sera a instancia IPEM e a auxiliar ser a HMLIPEM, que ainda não existe mais será criada nesse processo, portanto: • TARGET= SGISP //Origem • AUXILIARY= HMLSGI // Destino 1) Configurar TNSNAMES e LISTENER: [oracle@oradhb admin]$ cd /u01/app/oracle/product/10.2.0/db_1/network/admin tnsnames.ora listener.ora A partir do banco de Destino (HMLIPEM) edite o tnsnames.ora e crie uma chamada para o servidor de Origem (IPEM). ################################################################################ # dumpSGI = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.15.16.30)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SGISP) ) ) # ########################################## ###################################### [oracle@oradhb admin]$ tnsping dumpSGI TNS Ping Utility for Linux: Version 10.2.0.5.0 - Production on 13-FEB-2014 09:23:42 Copyright (c) 1997, 2010, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.15.16.30)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = SGISP))) OK (0 msec) [oracle@oradhb admin]$ 2) Configurar Listener: ############################################################# ########## Duplicate - dumpSGI ############################################################# (SID_DESC = (GLOBAL_DBNAME = dumpSGI) (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1) (SID_NAME = SGISP) ) ############################################################# Teste Listener Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=OraDhb)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 10.2.0.5.0 - Production Start Date 09-FEB-2014 23:10:20 Uptime 3 days 10 hr. 15 min. 23 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log Listening Endpoints Summary... . . Service "dumpSGI" has 1 instance(s). Instance "SGISP", status UNKNOWN, has 1 handler(s) for this service... 3) Diretório dos Backups Gerados Local dos backups da Origem (10.15.16.30): RMAN> show all; using target database control file instead of recovery catalog RMAN configuration parameters are: CONFIGURE RETENTION POLICY TO REDUNDANCY 15; CONFIGURE BACKUP OPTIMIZATION ON; CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/BACKUP/SGISP/SGISP_cf_%F'; CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1; CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/BACKUP/SGISP/db_%U.bkp'; CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/10.2.0/db_1/dbs/snapcf_SGISP.f'; # default RMAN> ----------------------------------- ---------------------------------------------- 4) Passo Depois de conectado rodamos o comando abaixo e vemos se a saída será EXCLUSIVE, o que significa que sua instancia aceita controle externo com password file. SQL> show parameter remote_login_password NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ remote_login_passwordfile string EXCLUSIVE SQL> 5) Realizando o backup da origem Realizaremos o Backup da instancia SGISP: (ORIGEM) 5.a) Logar no RMAN: [oracle@Orarh4 SGISP]$ rman target / Recovery Manager: Release 10.2.0.5.0 - Production on Thu Feb 13 09:34:30 2014 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: SGISP (DBID=4256028105) RMAN> 5.b) Depois rodamos o script abaixo: RMAN> run { 2> crosscheck archivelog all; 3> crosscheck backup; 4> sql 'alter system archive log current'; 5> sql 'alter system checkpoint'; 6> backup as compressed backupset full database plus archivelog delete input; 7> } No caso fiz um backupset pra ficar mais fácil de recuperar com uma única peça. Os nomes das peças geradas foram: -rw-r----- 1 oracle oinstall 716816896 Feb 11 21:34 db_ggp0cq2j_1_1.bkp -rw-r----- 1 oracle oinstall 27539095552 Feb 11 23:31 db_ghp0cq7i_1_1.bkp -rw-r----- 1 oracle oinstall 16921088 Feb 11 23:31 db_gip0d12l_1_1.bkp -rw-r----- 1 oracle oinstall 89600 Feb 11 23:31 db_gjp0d12v_1_1.bkp -rw-r----- 1 oracle oinstall 1720320 Feb 12 09:43 db_gkp0e4t9_1_1.bkp -rw-r----- 1 oracle oinstall 110215168 Feb 12 09:44 db_gmp0e4v4_1_1.bkp -rw-r----- 1 oracle oinstall 19202048 Feb 12 09:43 SGISP_cf_c-4256028105-20140212-00 -rw-r----- 1 oracle oinstall 19202048 Feb 12 09:44 SGISP_cf_c-4256028105-20140212-01 [oracle@Orarh4 IPEM]$ Obs: Os Backups gerados da base de ORIGEM ‘SGISP’(10.15.16.30) no diretório “/BACKUP/SGISP/” foram copiados para o servidor de DESTINO (10.15.16.32), no mesmo DIRETÓRIO EX: “/BACKUP/SGISP/ (HMLSGI). Esse procedimento ocorre no Oracle 10g, na versão Oracle 11g esse procedimento de cópia não é mais necessário. 6º passo: INITHMLIPEM.ORA - PFILE ----------------------------------- ------------------------------------------------ HMLSGI.__db_cache_size=134217728 HMLSGI.__java_pool_size=4194304 HMLSGI.__large_pool_size=4194304 HMLSGI.__shared_pool_size=679477248 HMLSGI.__streams_pool_size=4194304 *.audit_file_dest='/u01/app/oracle/admin/HMLSGI/adump' *.background_dump_dest='/u01/app/oracle/admin/HMLSGI/bdump' *.compatible='10.2.0.5.0' #*.control_files='+DADOS/hmlsgi/controlfile/current.471.813773199','+FRA/hmlsgi/controlfile/current.320.813773199' *.control_files='+DADOS','+FRA' *.core_dump_dest='/u01/app/oracle/admin/HMLSGI/cdump' *.db_block_size=8192 *.db_create_file_dest='+DADOS' *.db_create_online_log_dest_2='+FRA' *.db_domain='' *.db_file_multiblock_read_count=16 *.db_name='HMLSGI' *.db_recovery_file_dest='+FRA' *.db_recovery_file_dest_size=2147483648 *.dispatchers='(PROTOCOL=TCP) (SERVICE=HMLSGIXDB)' *.job_queue_processes=10 *.open_cursors=300 *.pga_aggregate_target=396361728 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=1212153856 *.undo_management='AUTO' *.undo_tablespace='UNDOTBS1' *.user_dump_dest='/u01/app/oracle/admin/HMLSGI/udump' *.db_file_name_convert = ('+DADOS/SGISP','+DADOS/HMLSGI','+FRA/SGISP','+FRA/HMLSGI') *.log_file_name_convert = ('+DADOS/SGISP','+DADOS/HMLSGI','+FRA/SGISP','+FRA/HMLSGI') ----------------------------------- ------------------------------------------------ 7º Base de Destino: Backup no Local de Destino: [oracle@oradhb SGISP]$ ll total 27785964 -rw-r----- 1 oracle oinstall 716816896 Feb 11 22:34 db_ggp0cq2j_1_1.bkp -rw-r----- 1 oracle oinstall 27539095552 Feb 12 00:31 db_ghp0cq7i_1_1.bkp -rw-r----- 1 oracle oinstall 16921088 Feb 12 00:31 db_gip0d12l_1_1.bkp -rw-r----- 1 oracle oinstall 89600 Feb 12 00:31 db_gjp0d12v_1_1.bkp -rw-r----- 1 oracle oinstall 1720320 Feb 12 10:43 db_gkp0e4t9_1_1.bkp -rw-r----- 1 oracle oinstall 110215168 Feb 12 10:44 db_gmp0e4v4_1_1.bkp -rw-r----- 1 oracle oinstall 19202048 Feb 12 10:43 SGISP_cf_c-4256028105-20140212-00 -rw-r----- 1 oracle oinstall 19202048 Feb 12 10:44 SGISP_cf_c-4256028105-20140212-01 8º Subindo a instancia de destino no modo NOMOUNT 7.a) SQL> startup nomount; 7.b) RMAN [oracle@oradhb dbs]$ rman target sys@dumpSGI AUXILIARY / Recovery Manager: Release 10.2.0.5.0 - Production on Tue Jan 22 15:08:52 2013 Copyright (c) 1982, 2007, Oracle. All rights reserved. target database Password: connected to target database: SGISP (DBID=4256028105) connected to auxiliary database: HMLSGI (not mounted) RMAN> 3) RMAN> DUPLICATE TARGET DATABASE TO HMLSGI; Processamento: ----------------------------------- ------------------------------------------------ Starting Duplicate Db at 13-FEB-14 using target database control file instead of recovery catalog allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: sid=158 devtype=DISK WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to diskgroup only. contents of Memory Script: { set until scn 11048898856583; set newname for datafile 1 to "+dados"; set newname for datafile 2 to "+dados"; set newname for datafile 3 to "+dados"; set newname for datafile 4 to "+dados"; set newname for datafile 5 to "+dados"; set newname for datafile 6 to "+dados"; set newname for datafile 7 to "+dados"; set newname for datafile 8 to "+dados"; set newname for datafile 9 to "+dados"; set newname for datafile 10 to "+dados"; set newname for datafile 11 to "+dados"; set newname for datafile 12 to "+dados"; set newname for datafile 13 to "+dados"; set newname for datafile 14 to "+dados"; set newname for datafile 15 to "+dados"; set newname for datafile 16 to "+dados"; set newname for datafile 17 to "+dados"; set newname for datafile 18 to "+dados"; set newname for datafile 19 to "+dados"; set newname for datafile 20 to "+dados"; set newname for datafile 21 to "+dados"; set newname for datafile 22 to "+dados"; set newname for datafile 23 to "+dados"; set newname for datafile 24 to "+dados"; set newname for datafile 25 to "+dados"; set newname for datafile 26 to "+dados"; set newname for datafile 27 to "+dados"; set newname for datafile 28 to "+dados"; set newname for datafile 29 to "+dados"; set newname for datafile 30 to "+dados"; set newname for datafile 31 to "+dados"; set newname for datafile 32 to "+dados"; set newname for datafile 33 to "+dados"; 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 executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting restore at 13-FEB-14 using channel ORA_AUX_DISK_1 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of Duplicate Db command at 02/13/2014 09:47:21 RMAN-03015: error occurred in stored script Memory Script RMAN-06026: some targets not found - aborting restore RMAN-06023: no backup or copy of datafile 33 found to restore RMAN-06023: no backup or copy of datafile 32 found to restore RMAN-06023: no backup or copy of datafile 31 found to restore RMAN-06023: no backup or copy of datafile 30 found to restore RMAN-06023: no backup or copy of datafile 29 found to restore RMAN-06023: no backup or copy of datafile 28 found to restore RMAN-06023: no backup or copy of datafile 27 found to restore RMAN-06023: no backup or copy of datafile 26 found to restore RMAN-06023: no backup or copy of datafile 25 found to restore RMAN-06023: no backup or copy of datafile 24 found to restore RMAN-06023: no backup or copy of datafile 23 found to restore RMAN-06023: no backup or copy of datafile 22 found to restore RMAN-06023: no backup or copy of datafile 21 found to restore RMAN-06023: no backup or copy of datafile 20 found to restore RMAN-06023: no backup or copy of datafile 19 found to restore RMAN-06023: no backup or copy of datafile 18 found to restore RMAN-06023: no backup or copy of datafile 17 found to restore RMAN-06023: no backup or copy of datafile 16 found to restore RMAN-06023: no backup or copy of datafile 15 found to restore RMAN-06023: no backup or copy of datafile 14 found to restore RMAN-06023: no backup or copy of datafile 13 found to restore RMAN-06023: no backup or copy of datafile 12 found to restore RMAN-06023: no backup or copy of datafile 11 found to restore RMAN-06023: no backup or copy of datafile 10 found to restore RMAN-06023: no backup or copy of datafile 9 found to restore RMAN-06023: no backup or copy of datafile 8 found to restore RMAN-06023: no backup or copy of datafile 7 found to restore RMAN-06023: no backup or copy of datafile 6 found to restore RMAN-06023: no backup or copy of datafile 5 found to restore RMAN-06023: no backup or copy of datafile 4 found to restore RMAN-06023: no backup or copy of datafile 3 found to restore RMAN-06023: no backup or copy of datafile 2 found to restore RMAN-06023: no backup or copy of datafile 1 found to restore RMAN>