oracle_dest

A técnica de DUPLICATE pode ser executada de diferentes modos, cabendo ao DBA decidir-se pelo modo mais adequado, levando em conta o cenário em que está contido. Neste exemplo, demonstraremos o modo “Active Database Duplication”. O Active Database Duplication é um modo de executar um duplicate database, onde não é necessário haver um backup prévio (Backup RMAN existente) para execução da tarefa, assim o RMAN duplica os database files localizado em um host origem (SOURCE HOST), diretamente de qualquer database em estado OPEN ou MOUNT, transferindo suas “image copie” ou “backup set” gerados no momento da execução da tarefa para o host destino (AUXILIARY HOST), onde serão usados para construir o database duplicado.

Antes de iniciar o passo a passo para execução do “Active Database Duplication” é importante estarmos familiarizados com as nomenclaturas dos diversos componentes envolvidas no processo de duplicate.

Source Host: Maquina origem onde portam os database files que serão duplicados.

Auxiliary Host: Maquina destino que receberá os database files do Source Host.

Source Database Instance: Instance origem no processo de duplicate (Está localizada no Source Host e pertence ao Source Database)

Auxiliary Database Instance: Instance destino no processo de duplicate (Está localizada no Auxiliary Host e pertence ao Auxiliary Database)

Source Database: Database que será duplicado (Database Origem).

Auxiliary Database: Clone do Source Database (Database Duplicado).

 

Passo a passo para execução do “Active Database Duplication”
Considere o cenário abaixo:

 

 

 

la

 

Passo 1) Preparação do ambiente para executar “Active Database Duplication”

  • Configuração da Auxiliary Database Instance.

OBS.: Em um cenário de “Active Database Duplication”, um banco de dados está sendo duplicado, o produto final desta duplicação é um clone do database target (Source Database), com isso é possível deduzir que o database target (Source Database) já existe e está funcional.

A database instance é uma estrutura de memória criada a partir de um dos arquivos de parâmetros (parameter file) pfile ou spfile, essa estrutura é responsável pelo gerenciamento dos database files. O arquivo de parâmetros (parameter file) traz consigo uma série de importantes informações tais como localização do controlfile (control_files), destino dos arquivos de auditoria (audit_file_dest) e FRA (db_recovery_file_dest), esses parâmetros possuem como valor caminho de diretórios, essas estruturas devem ser criadas no Auxiliary Host, bem como, todos os diretórios continhos em ADR BASE e ADR HOME ($ADR_BASE/diag/rdbms/{DB-name}/{SID}/). Obviamente, a mudança de nomenclatura de algum diretório pertencente a esta estrutura é uma opção do DBA, sendo condicionado pela alteração do valor dos parâmetros do parameter file (arquivo de parâmetros) e o nome do database instance (ORACLE_SID).

 

 

OBS.: Para verificar a estrutura de diretórios do ADR, basta consultar a view V$DIAG_INFO.

É necessários transferir um dos arquivos de parâmetros (parameter file), localizado no Source Host referente a Source Database Instance para o Auxiliary Host referente a Auxiliary Database Instance, nesta etapa, estamos condicionando o Oracle para que seja capaz de criar a estrutura de memória (database instance) responsável pelo gerencialmente dos database files.

Uma vez que o pfile esteja em $ORACLE_HOME/dbs no Auxiliary Host é necessário ajusta-lo, com o intuito organizacional, modificando a nomenclatura da estrutura de diretórios, substituindo o nível, cuja string é CDB1 por STBY.

Parâmetros alterados no PFILE
Ajustando estrutura de diretório do parâmetro audit_file_dest com a nomenclatura referente ao SID do Auxiliary Database
*.audit_file_dest=’/oracle/app/product/admin/CDB1/adump’
*.audit_file_dest=’/oracle/app/product/admin/STBY/adump’

Ajustando estrutura de diretório onde estará o controlfile com a nomenclatura referente ao SID do Auxiliary Database
*.control_files=’/oracle/app/product/oradata/CDB1/control01.ctl’
*.control_files=’/oracle/app/product/oradata/STBY/control01.ctl’

Ajustando estrutura de diretório onde estará a FRA com a nomenclatura referente ao SID do Auxiliary Database
*.db_recovery_file_dest=’/oracle/app/product/oradata/CDB1/FRA’
*.db_recovery_file_dest=’/oracle/app/product/oradata/STBY/FRA’

Depois de ajustado é imprescindível que esses diretórios existam no filesystem, portanto é necessário cria-los.
mkdir -p /oracle/app/product/oradata/STBY/FRA/
mkdir -p /oracle/app/product/oradata/STBY/
mkdir -p /oracle/app/product/admin/STBY/adump/

 


OBS.: É impreterível que todos os diretórios referenciados no pfile esteja criados.

Conforme descrito anteriormente, a database instance é uma estrutura de memória para gerenciar o database, portanto também se faz necessários a criação da estrutura de diretórios para os datafiles, seguindo o mesmo intuito organizacional, a nomenclatura da estrutura de diretórios, também será substituída no nível, cuja string é CDB1 por STBY. Faremos o levantamento dessa estrutura (diretórios), consultando o campo NAME da view V$DATAFILE.

select NAME from v$datafile  ;   


Criação da estrutura de diretório onde estarão os datafiles.
mkdir -p /oracle/app/product/oradata/STBY/
mkdir -p /oracle/app/product/oradata/STBY/pdbseed/
mkdir -p /oracle/app/product/oradata/STBY/PDB1/

O duplicate irá depositar os datafiles nos mesmos lugares em que originalmente estão, uma vez que, a localização dos datafiles estão catalogados no controlfile, que por sua vez é um dos protagonistas em uma operação de restore. Na execução do duplicate, veremos nas logs geradas, que esta operação nada mais é que um restore/recover completo do banco de dados de forma automatizada em uma única operação. Com o intuito organizacional, iremos mudar a nomenclatura da estrutura de diretórios, trocando CDB1 por STBY, para tanto, utilizaremos dois parâmetros, db_file_name_convert e log_file_name_convert, que deve ser incluídos no pfile localizado no Auxiliary host (Lembre-se que após incluído é necessário um shutdown/startup na instance).

*.db_file_name_convert=('/oracle/app/product/oradata/CDB1/','/oracle/app/product/oradata/STBY/')
*.log_file_name_convert=('/oracle/app/product/oradata/CDB1/','/oracle/app/product/oradata/STBY/')

A versão ajustada do pfile é descrito abaixo:

  *.audit_file_dest='/oracle/app/product/admin/STBY/adump'
   *.audit_trail='db'
   *.compatible='12.1.0.2.0'
   *.control_files='/oracle/app/product/oradata/STBY/control01.ctl'
   *.db_block_size=8192
   *.db_domain=''
   *.db_name='CDB1'
   *.db_recovery_file_dest='/oracle/app/product/oradata/STBY/FRA'
   *.db_recovery_file_dest_size=4815m
   *.diagnostic_dest='/oracle/app/product'
   *.dispatchers='(PROTOCOL=TCP)  (SERVICE=CDB1XDB)'
   *.enable_pluggable_database=true
   *.log_archive_dest_1='LOCATION=/oracle/app/product/oradata/STBY/FRA'
   *.log_archive_format='%t_%s_%r.dbf'
   *.open_cursors=300
   *.pga_aggregate_target=190m
   *.processes=300
   *.remote_login_passwordfile='EXCLUSIVE'
   *.remote_os_authent=TRUE
   *.remote_os_roles=TRUE
   *.sga_target=570m
   *.undo_tablespace='UNDOTBS1'
   *.db_file_name_convert=('/oracle/app/product/oradata/CDB1/','/oracle/app/product/oradata/STBY/')
   *.log_file_name_convert=('/oracle/app/product/oradata/CDB1/','/oracle/app/product/oradata/STBY/')

 

Para finalizar a criação de todas as estruturas de diretórios, criaremos a estrutura de ADR (Automatic Diagnostics Repository).
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/trace
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/alert
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/incident
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/cdump
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/hm
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/trace/
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/incpkg
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/ir
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/lck
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/log
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/metadata
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/metadata_dgif
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/metadata_pv
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/stage
mkdir -p /oracle/app/product/diag/rdbms/cdb1/STBY/sweep

  • Configuração de conectividade entre Source x Auxiliary.

O procedimento de “Active Database Duplication”, inclui a conectividade entre Source Database Instance e Auxiliary Database Instance, uma vez que o RMAN necessita de uma integração entre as instance para executar o processo de clonagem de forma automatizada do database. É mandatório que a Auxiliary Database Instance esteja em estado nomount (status STARTED na view V$INSTANCE) quando o “Active Database Duplication” iniciar, por esta razão é necessário uma registo de serviço estático no listener (Static Service Registration), possibilitando um logon remoto com a instance em qualquer estado (DOWN, NOMOUNT, MOUNT ou OPEN).
Veja abaixo, o conteúdo do arquivo $ORACLE_HOME/network/admin/listener.ora e sua respectiva string de conexão (Entrada no TNSNAMES.ORA), o serviço estático no listener (Static Service Registration) é representado pela(as) entrada(as) em SID_LIST_LISTENER.

Source Host
$ORACLE_HOME/network/admin/listener.ora

LISTENER=
   (DESCRIPTION=
   (ADDRESS_LIST=
   (ADDRESS=(PROTOCOL=tcp)(HOST=primary)(PORT=1521))
   )
 )
SID_LIST_LISTENER=
   (SID_LIST=
   (SID_DESC=
   (GLOBAL_DBNAME=CDB1)
   (ORACLE_HOME=/oracle/app/product/12.1)
   (SID_NAME=CDB1)
   )
 )

 

$ORACLE_HOME/network/admin/tnsnames.ora

DB_SOURCE =
   (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST =  primary)(PORT = 1521))
   (CONNECT_DATA =
   (SERVER = DEDICATED)
   (sid = CDB1)
   )
   )

 

Auxiliary Host
$ORACLE_HOME/network/admin/listener.ora

   LISTENER=
   (DESCRIPTION=
   (ADDRESS_LIST=
   (ADDRESS=(PROTOCOL=tcp)(HOST=standby)(PORT=1521))
   )
 )
SID_LIST_LISTENER=
   (SID_LIST=
   (SID_DESC=
   (GLOBAL_DBNAME=CDB1)
   (ORACLE_HOME=/oracle/app/product/12.1)
   (SID_NAME=STBY)
   )
 )


$ORACLE_HOME/network/admin/tnsnames.ora

DB_AUXILIARY =
   (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST =  standby)(PORT = 1521))
   (CONNECT_DATA =
   (SERVER = DEDICATED)
   (sid = STBY)
   )
 )

Finalizado a configuração de conectividade, é necessário ajustar a autenticação do acesso remoto entre Source Database Instance e Auxiliary Database Instance, ou seja, fazer com que o RMAN se conecte com a string de conexão DB_SOURCE e DB_AUXILIARY, que deveram estar no TNSNAMES.ORA de ambos os host (SOURCE e AUXILIARY), para tanto é necessário que os arquivo de senha (Password File) estejam criados em ambos os hosts, utilizando a mesma senha para o usuário sys (Utilizaremos o usuário sys para executar o duplicate).

Para criar o arquivo de senha (Password File), utilize o comando abaixo:

orapwd  file=$ORACLE_HOME/dbs/orapw password=<ESCOLHA_UM_SENHA> entries=100  force=y  ignorecase=Y

EXEMPLO:

orapwd  file=$ORACLE_HOME/dbs/orapw password=oracle entries=100 force=y  ignorecase=Y


IMPORTANTE: Este arquivo gerado pelo utilitário orapwd deve existir em ambos os hosts e deve conter a mesma senha. Portanto utilize o mesmo comando para criar o password file.

No Source Database é possível validar a compatibilidade da senha, cruzando informações da tabela no dicionário de dados sys.user$ e o arquivo $ORACLE_HOME/dbs/orapw, veja abaixo:

Validaremos a conectividade entre as database instance (SOURCE e AUXILIARY) utilizando as string de conexão publicada em $ORACLE_HOME/network/admin/tnsnames.ora .

TESTE DE CONECTIVIDADE NO SOURCE DATABASE

TESTE DE CONECTIVIDADE NO AUXILIARY DATABASE

  • Validação de conectividade no RMAN

Uma operação de “Active Database Duplication” é feita via RMAN, envolvendo um target, que representa o Source Database e um auxiliary, que representa o auxiliary database. É importante ressaltar que esta operação não envolve um catalogo do RMAN, caso exista, somente o target.
Para validar execute o comando abaixo:

rman target sys/oracle@DB_SOURCE auxiliary  sys/oracle@DB_AUXILIARY

TESTE DE CONECTIVIDADE NO SOURCE DATABASE

TESTE DE CONECTIVIDADE NO AUXILIARY DATABASE

Passo 2) Execução do “Active Database Duplication”

A partir do Oracle Database 12c, é possível optar por dois diferentes métodos de realizar o Active Database Duplication, são eles:

  • Push-based Method: O database duplication é realizado usando “image copie”, onde o source database transfere os database files para o auxiliary, que são necessários para clonagem. É importante ressaltar que o target channel fazem a maior parte do trabalho, neste métodos, ou seja, ocorre maior degradação do desempenho no target database. Este é o tradicional e único método utilizado nas versões pre-12c.
duplicate target database to CDB1 from active  database;

 

  • Pull-based Method: O database duplication é realizado usando “backup set”, permitindo assim o uso de compressão, com isso é reduzido volume de dados o trafegados via rede (transferência dos backupset para o Auxiliary host), a transferência do backup set é feita através do Oracle Net Service. É importante ressaltar que a auxiliary channel fazem a maior parte do trabalho, evitando assim uma degradação do desempenho no target database.  Este novo método foi introduzido no oracle 12c.
duplicate target database to CDB1 from active database  using COMPRESSED BACKUPSET ; 

Importantes considerações antes de iniciar o duplicate

  • Active Database Duplicate não envolve catalogo do RMAN (Somente target).
  • Senha do password file criadas via orapwd, deve ser iguais em ambos os hosts.
  • O DB_NAME de ambos os database devem ser o mesmo ao executar o duplicate.

 

 

Executando Active Duplicate utilizando Push-based Method

[CDB1.oracle@primary ~]$  rman target sys/oracle@DB_SOURCE auxiliary   sys/oracle@DB_AUXILIARY
Recovery Manager: Release  12.1.0.2.0 - Production on Wed Dec 10 21:06:00 2014
Copyright (c) 1982, 2014,  Oracle and/or its affiliates.  All rights  reserved.
connected to target  database: CDB1 (DBID=831192750)
connected to auxiliary  database: CDB1 (not mounted)
RMAN> duplicate target  database to CDB1 from active database;
Starting Duplicate Db at  10-DEC-14
using target database  control file instead of recovery catalog
allocated channel:  ORA_AUX_DISK_1
channel ORA_AUX_DISK_1:  SID=22 device type=DISK
current log archived
contents of Memory Script:
{
sql clone "create spfile from  memory";
}
executing Memory Script
sql statement: create  spfile from memory
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
Oracle instance shut down
connected to auxiliary  database (not started)
Oracle instance started
Total System Global  Area     599785472 bytes
Fixed Size                     2927192 bytes
Variable Size                281019816 bytes
Database Buffers             310378496 bytes
Redo Buffers                   5459968 bytes
contents of Memory Script:
   {
   sql clone "alter system set  db_name =
   ''CDB1'' comment=
   ''Modified by RMAN duplicate''  scope=spfile";
   sql clone "alter system set  db_unique_name =
   ''CDB1'' comment=
   ''Modified by RMAN duplicate''  scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone from service  'DB_SOURCE' primary controlfile;
   alter clone database mount;
   }
   executing Memory Script
sql statement: alter system  set  db_name =  ''CDB1'' comment= ''Modified by RMAN  duplicate'' scope=spfile
sql statement: alter system  set  db_unique_name =  ''CDB1'' comment= ''Modified by RMAN  duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area     599785472 bytes
Fixed Size                     2927192 bytes
   Variable Size                281019816 bytes
   Database Buffers             310378496 bytes
   Redo Buffers                   5459968 bytes
Starting restore at  10-DEC-14
   allocated channel: ORA_AUX_DISK_1
   channel ORA_AUX_DISK_1:  SID=22 device type=DISK
channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  restoring control file
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:05
   output file  name=/oracle/app/product/oradata/STBY/control01.ctl
   Finished restore at  10-DEC-14
database mounted
contents of Memory Script:
   {
   set newname for datafile  1 to
   "/oracle/app/product/oradata/STBY/system01.dbf";
   set newname for datafile  2 to
   "/oracle/app/product/oradata/STBY/pdbseed/system01.dbf";
   set newname for datafile  3 to
   "/oracle/app/product/oradata/STBY/sysaux01.dbf";
   set newname for datafile  4 to
   "/oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf";
   set newname for datafile  5 to
   "/oracle/app/product/oradata/STBY/undotbs01.dbf";
   set newname for datafile  6 to
   "/oracle/app/product/oradata/STBY/users01.dbf";
   set newname for datafile  10 to
   "/oracle/app/product/oradata/STBY/PDB1/system01.dbf";
   set newname for datafile  11 to
   "/oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf";
   set newname for datafile  12 to
   "/oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf";
   restore
   from service   'DB_SOURCE'   clone database
   ;
   sql 'alter system archive log current';
   }
   executing Memory Script
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  10-DEC-14
   using channel  ORA_AUX_DISK_1
channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00001 to /oracle/app/product/oradata/STBY/system01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:45
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00002 to  /oracle/app/product/oradata/STBY/pdbseed/system01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:15
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00003 to /oracle/app/product/oradata/STBY/sysaux01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:36
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1: specifying  datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00004 to  /oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:25
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00005 to /oracle/app/product/oradata/STBY/undotbs01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:25
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00006 to /oracle/app/product/oradata/STBY/users01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:02
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00010 to /oracle/app/product/oradata/STBY/PDB1/system01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:15
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00011 to /oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:26
   channel ORA_AUX_DISK_1: starting  datafile backup set restore
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00012 to /oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:01
   Finished restore at  10-DEC-14
sql statement: alter system  archive log current
   current log archived
contents of Memory Script:
   {
   restore clone force from service  'DB_SOURCE'
   archivelog from scn  2579089;
   switch clone datafile all;
   }
   executing Memory Script
Starting restore at  10-DEC-14
   using channel  ORA_AUX_DISK_1
channel ORA_AUX_DISK_1:  starting archived log restore to default destination
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  restoring archived log
   archived log thread=1  sequence=208
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:01
   channel ORA_AUX_DISK_1:  starting archived log restore to default destination
   channel ORA_AUX_DISK_1:  using network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  restoring archived log
   archived log thread=1  sequence=209
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:01
   Finished restore at  10-DEC-14
datafile 1 switched to  datafile copy
   input datafile copy  RECID=10 STAMP=865977054 file  name=/oracle/app/product/oradata/STBY/system01.dbf
   datafile 2 switched to  datafile copy
   input datafile copy  RECID=11 STAMP=865977054 file  name=/oracle/app/product/oradata/STBY/pdbseed/system01.dbf
   datafile 3 switched to  datafile copy
   input datafile copy  RECID=12 STAMP=865977054 file  name=/oracle/app/product/oradata/STBY/sysaux01.dbf
   datafile 4 switched to  datafile copy
   input datafile copy  RECID=13 STAMP=865977054 file  name=/oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf
   datafile 5 switched to  datafile copy
   input datafile copy  RECID=14 STAMP=865977054 file  name=/oracle/app/product/oradata/STBY/undotbs01.dbf
   datafile 6 switched to  datafile copy
   input datafile copy  RECID=15 STAMP=865977054 file name=/oracle/app/product/oradata/STBY/users01.dbf
   datafile 10 switched to  datafile copy
   input datafile copy  RECID=16 STAMP=865977054 file name=/oracle/app/product/oradata/STBY/PDB1/system01.dbf
   datafile 11 switched to  datafile copy
   input datafile copy  RECID=17 STAMP=865977054 file  name=/oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf
   datafile 12 switched to  datafile copy
   input datafile copy  RECID=18 STAMP=865977054 file name=/oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf
contents of Memory Script:
   {
   set until scn  2579391;
   recover
   clone database
   delete archivelog
   ;
   }
   executing Memory Script
executing command: SET  until clause
Starting recover at 10-DEC-14
   using channel  ORA_AUX_DISK_1
starting media recovery
archived log for thread 1  with sequence 208 is already on disk as file  
/oracle/app/product/oradata/STBY/FRA/1_208_857475310.dbf
   archived log for thread 1  with sequence 209 is already on disk as file  
/oracle/app/product/oradata/STBY/FRA/1_209_857475310.dbf
   archived log file  name=/oracle/app/product/oradata/STBY/FRA/1_208_857475310.dbf thread=1  sequence=208
   archived log file  name=/oracle/app/product/oradata/STBY/FRA/1_209_857475310.dbf thread=1  sequence=209
   media recovery complete,  elapsed time: 00:00:01
   Finished recover at  10-DEC-14
   Oracle instance started
Total System Global  Area     599785472 bytes
Fixed Size                     2927192 bytes
   Variable Size                281019816 bytes
   Database Buffers             310378496 bytes
   Redo Buffers                   5459968 bytes
contents of Memory Script:
   {
   sql clone "alter system set  db_name =
   ''CDB1'' comment=
   ''Reset to original value by RMAN''  scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   }
   executing Memory Script
sql statement: alter system  set  db_name =  ''CDB1'' comment= ''Reset to original value  by RMAN'' scope=spfile
sql statement: alter system  reset  db_unique_name scope=spfile
   Oracle instance started
Total System Global  Area     599785472 bytes
Fixed Size                     2927192 bytes
   Variable Size                281019816 bytes
   Database Buffers             310378496 bytes
   Redo Buffers                   5459968 bytes
   sql statement: CREATE  CONTROLFILE REUSE SET DATABASE "CDB1" RESETLOGS ARCHIVELOG
   MAXLOGFILES     16
   MAXLOGMEMBERS      3
   MAXDATAFILES     1024
   MAXINSTANCES     8
   MAXLOGHISTORY      292
   LOGFILE
   GROUP    1 ( '/oracle/app/product/oradata/STBY/redo01.log' ) SIZE 50 M  REUSE,
   GROUP    2 ( '/oracle/app/product/oradata/STBY/redo02.log' ) SIZE 50 M  REUSE,
   GROUP    3 ( '/oracle/app/product/oradata/STBY/redo03.log' ) SIZE 50 M  REUSE
   DATAFILE
   '/oracle/app/product/oradata/STBY/system01.dbf',
   '/oracle/app/product/oradata/STBY/pdbseed/system01.dbf',
   '/oracle/app/product/oradata/STBY/PDB1/system01.dbf'
   CHARACTER SET WE8MSWIN1252

contents of Memory Script:
   {
   set newname for tempfile  1 to
   "/oracle/app/product/oradata/STBY/temp01.dbf";
   set newname for tempfile  2 to
   "/oracle/app/product/oradata/STBY/pdbseed/temp01.dbf";
   set newname for tempfile  3 to
   "/oracle/app/product/oradata/STBY/PDB1/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy   "/oracle/app/product/oradata/STBY/sysaux01.dbf",
   "/oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf",
   "/oracle/app/product/oradata/STBY/undotbs01.dbf",
   "/oracle/app/product/oradata/STBY/users01.dbf",
   "/oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf",
   "/oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf";
   switch clone datafile all;
   }
   executing Memory Script
executing command: SET  NEWNAME
executing command: SET  NEWNAME
executing command: SET  NEWNAME
renamed tempfile 1 to  /oracle/app/product/oradata/STBY/temp01.dbf in control file
   renamed tempfile 2 to  /oracle/app/product/oradata/STBY/pdbseed/temp01.dbf in control file
   renamed tempfile 3 to  /oracle/app/product/oradata/STBY/PDB1/temp01.dbf in control file
cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/sysaux01.dbf RECID=1 STAMP=865977082
   cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf RECID=2  STAMP=865977082
   cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/undotbs01.dbf RECID=3 STAMP=865977082
   cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/users01.dbf RECID=4 STAMP=865977082
   cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf RECID=5 STAMP=865977082
   cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf RECID=6  STAMP=865977082
datafile 3 switched to  datafile copy
   input datafile copy RECID=1  STAMP=865977082 file name=/oracle/app/product/oradata/STBY/sysaux01.dbf
   datafile 4 switched to  datafile copy
   input datafile copy RECID=2  STAMP=865977082 file name=/oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf
   datafile 5 switched to  datafile copy
   input datafile copy RECID=3  STAMP=865977082 file name=/oracle/app/product/oradata/STBY/undotbs01.dbf
   datafile 6 switched to  datafile copy
   input datafile copy RECID=4  STAMP=865977082 file name=/oracle/app/product/oradata/STBY/users01.dbf
   datafile 11 switched to  datafile copy
   input datafile copy RECID=5  STAMP=865977082 file name=/oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf
   datafile 12 switched to  datafile copy
   input datafile copy RECID=6  STAMP=865977082 file  name=/oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf
contents of Memory Script:
   {
   Alter clone database open resetlogs;
   }
   executing Memory Script
database opened
contents of Memory Script:
   {
   sql clone "alter pluggable database all  open";
   }
   executing Memory Script
sql statement: alter  pluggable database all open
   Cannot remove created  server parameter file
   Finished Duplicate Db at  10-DEC-14
RMAN>

 

 

 

Executando Active Duplicate utilizando Pull-based Method

 

 

[CDB1.oracle@primary ~]$  rman target sys/oracle@DB_SOURCE auxiliary   sys/oracle@DB_AUXILIARY
Recovery Manager: Release  12.1.0.2.0 - Production on Wed Dec 10 21:17:30 2014
Copyright (c) 1982, 2014,  Oracle and/or its affiliates.  All rights  reserved.
connected to target  database: CDB1 (DBID=831192750)
   connected to auxiliary  database: CDB1 (not mounted)
RMAN> duplicate target  database to CDB1 from active database using COMPRESSED BACKUPSET ;
Starting Duplicate Db at  10-DEC-14
   using target database  control file instead of recovery catalog
   allocated channel:  ORA_AUX_DISK_1
   channel ORA_AUX_DISK_1:  SID=23 device type=DISK
   current log archived
contents of Memory Script:
   {
   sql clone "alter system set  db_name =
   ''CDB1'' comment=
   ''Modified by RMAN duplicate''  scope=spfile";
   sql clone "alter system set  db_unique_name =
   ''CDB1'' comment=
   ''Modified by RMAN duplicate''  scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone from service  'DB_SOURCE' using compressed backupset
   primary controlfile;
   alter clone database mount;
   }
   executing Memory Script
sql statement: alter system  set  db_name =  ''CDB1'' comment= ''Modified by RMAN  duplicate'' scope=spfile
sql statement: alter system  set  db_unique_name =  ''CDB1'' comment= ''Modified by RMAN  duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global  Area     599785472 bytes
Fixed Size                     2927192 bytes
   Variable Size                281019816 bytes
   Database Buffers             310378496 bytes
   Redo Buffers                   5459968 bytes
Starting restore at  10-DEC-14
   allocated channel:  ORA_AUX_DISK_1
   channel ORA_AUX_DISK_1:  SID=22 device type=DISK
channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  restoring control file
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:03
   output file  name=/oracle/app/product/oradata/STBY/control01.ctl
   Finished restore at  10-DEC-14
database mounted
contents of Memory Script:
   {
   set newname for datafile  1 to
   "/oracle/app/product/oradata/STBY/system01.dbf";
   set newname for datafile  2 to
   "/oracle/app/product/oradata/STBY/pdbseed/system01.dbf";
   set newname for datafile  3 to
   "/oracle/app/product/oradata/STBY/sysaux01.dbf";
   set newname for datafile  4 to
   "/oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf";
   set newname for datafile  5 to
   "/oracle/app/product/oradata/STBY/undotbs01.dbf";
   set newname for datafile  6 to
   "/oracle/app/product/oradata/STBY/users01.dbf";
   set newname for datafile  10 to
   "/oracle/app/product/oradata/STBY/PDB1/system01.dbf";
   set newname for datafile  11 to
   "/oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf";
   set newname for datafile  12 to
   "/oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf";
   restore
   from service   'DB_SOURCE'   using compressed  backupset
   clone database
   ;
   sql 'alter system archive log current';
   }
   executing Memory Script
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  10-DEC-14
   using channel  ORA_AUX_DISK_1
channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00001 to /oracle/app/product/oradata/STBY/system01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:01:05
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00002 to  /oracle/app/product/oradata/STBY/pdbseed/system01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:25
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00003 to /oracle/app/product/oradata/STBY/sysaux01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:55
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00004 to  /oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:45
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00005 to /oracle/app/product/oradata/STBY/undotbs01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:25
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00006 to /oracle/app/product/oradata/STBY/users01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:02
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00010 to /oracle/app/product/oradata/STBY/PDB1/system01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:25
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00011 to /oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:45
   channel ORA_AUX_DISK_1:  starting datafile backup set restore
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  specifying datafile(s) to restore from backup set
   channel ORA_AUX_DISK_1:  restoring datafile 00012 to /oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:01
   Finished restore at  10-DEC-14
sql statement: alter system  archive log current
   current log archived
contents of Memory Script:
   {
   restore clone force from service  'DB_SOURCE' using compressed backupset
   archivelog from scn  2579627;
   switch clone datafile all;
   }
   executing Memory Script
Starting restore at  10-DEC-14
   using channel  ORA_AUX_DISK_1
channel ORA_AUX_DISK_1:  starting archived log restore to default destination
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  restoring archived log
   archived log thread=1  sequence=211
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:01
   channel ORA_AUX_DISK_1:  starting archived log restore to default destination
   channel ORA_AUX_DISK_1:  using compressed network backup set from service DB_SOURCE
   channel ORA_AUX_DISK_1:  restoring archived log
   archived log thread=1  sequence=212
   channel ORA_AUX_DISK_1:  restore complete, elapsed time: 00:00:01
   Finished restore at  10-DEC-14
datafile 1 switched to  datafile copy
   input datafile copy  RECID=10 STAMP=865977799 file  name=/oracle/app/product/oradata/STBY/system01.dbf
   datafile 2 switched to  datafile copy
   input datafile copy  RECID=11 STAMP=865977799 file  name=/oracle/app/product/oradata/STBY/pdbseed/system01.dbf
   datafile 3 switched to  datafile copy
   input datafile copy  RECID=12 STAMP=865977799 file name=/oracle/app/product/oradata/STBY/sysaux01.dbf
   datafile 4 switched to  datafile copy
   input datafile copy  RECID=13 STAMP=865977799 file  name=/oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf
   datafile 5 switched to  datafile copy
   input datafile copy  RECID=14 STAMP=865977799 file name=/oracle/app/product/oradata/STBY/undotbs01.dbf
   datafile 6 switched to  datafile copy
   input datafile copy  RECID=15 STAMP=865977799 file name=/oracle/app/product/oradata/STBY/users01.dbf
   datafile 10 switched to  datafile copy
   input datafile copy  RECID=16 STAMP=865977799 file  name=/oracle/app/product/oradata/STBY/PDB1/system01.dbf
   datafile 11 switched to  datafile copy
   input datafile copy  RECID=17 STAMP=865977799 file  name=/oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf
   datafile 12 switched to  datafile copy
   input datafile copy  RECID=18 STAMP=865977799 file  name=/oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf
contents of Memory Script:
   {
   set until scn  2579891;
   recover
   clone database
   delete archivelog
   ;
   }
   executing Memory Script
executing command: SET  until clause
Starting recover at  10-DEC-14
   using channel  ORA_AUX_DISK_1
starting media recovery
archived log for thread 1  with sequence 211 is already on disk as file  
/oracle/app/product/oradata/STBY/FRA/1_211_857475310.dbf
   archived log for thread 1  with sequence 212 is already on disk as file  
/oracle/app/product/oradata/STBY/FRA/1_212_857475310.dbf
   archived log file  name=/oracle/app/product/oradata/STBY/FRA/1_211_857475310.dbf thread=1  sequence=211
   archived log file  name=/oracle/app/product/oradata/STBY/FRA/1_212_857475310.dbf thread=1  sequence=212
   media recovery complete,  elapsed time: 00:00:00
   Finished recover at  10-DEC-14
   Oracle instance started
Total System Global  Area     599785472 bytes
Fixed Size                     2927192 bytes
   Variable Size                281019816 bytes
   Database Buffers             310378496 bytes
   Redo Buffers                   5459968 bytes
contents of Memory Script:
   {
   sql clone "alter system set  db_name =
   ''CDB1'' comment=
   ''Reset to original value by RMAN''  scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   }
   executing Memory Script
sql statement: alter system  set  db_name =  ''CDB1'' comment= ''Reset to original value  by RMAN'' scope=spfile
sql statement: alter system  reset  db_unique_name scope=spfile
   Oracle instance started
Total System Global  Area     599785472 bytes
Fixed Size                     2927192 bytes
   Variable Size                281019816 bytes
   Database Buffers             310378496 bytes
   Redo Buffers                   5459968 bytes
   sql statement: CREATE  CONTROLFILE REUSE SET DATABASE "CDB1" RESETLOGS ARCHIVELOG
   MAXLOGFILES     16
   MAXLOGMEMBERS      3
   MAXDATAFILES     1024
   MAXINSTANCES     8
   MAXLOGHISTORY      292
   LOGFILE
   GROUP    1 ( '/oracle/app/product/oradata/STBY/redo01.log' ) SIZE 50 M  REUSE,
   GROUP    2 ( '/oracle/app/product/oradata/STBY/redo02.log' ) SIZE 50 M  REUSE,
   GROUP    3 ( '/oracle/app/product/oradata/STBY/redo03.log' ) SIZE 50 M  REUSE
   DATAFILE
   '/oracle/app/product/oradata/STBY/system01.dbf',
   '/oracle/app/product/oradata/STBY/pdbseed/system01.dbf',
   '/oracle/app/product/oradata/STBY/PDB1/system01.dbf'
   CHARACTER SET WE8MSWIN1252

contents of Memory Script:
   {
   set newname for tempfile  1 to
   "/oracle/app/product/oradata/STBY/temp01.dbf";
   set newname for tempfile  2 to
   "/oracle/app/product/oradata/STBY/pdbseed/temp01.dbf";
   set newname for tempfile  3 to
   "/oracle/app/product/oradata/STBY/PDB1/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy   "/oracle/app/product/oradata/STBY/sysaux01.dbf",
   "/oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf",
   "/oracle/app/product/oradata/STBY/undotbs01.dbf",
   "/oracle/app/product/oradata/STBY/users01.dbf",
   "/oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf",
   "/oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf";
   switch clone datafile all;
   }
   executing Memory Script
executing command: SET  NEWNAME
executing command: SET  NEWNAME
executing command: SET  NEWNAME
renamed tempfile 1 to  /oracle/app/product/oradata/STBY/temp01.dbf in control file
   renamed tempfile 2 to  /oracle/app/product/oradata/STBY/pdbseed/temp01.dbf in control file
   renamed tempfile 3 to  /oracle/app/product/oradata/STBY/PDB1/temp01.dbf in control file
cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/sysaux01.dbf RECID=1 STAMP=865977822
   cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf RECID=2  STAMP=865977822
   cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/undotbs01.dbf RECID=3 STAMP=865977822
   cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/users01.dbf RECID=4 STAMP=865977822
   cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf RECID=5 STAMP=865977822
   cataloged datafile copy
   datafile copy file  name=/oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf RECID=6  STAMP=865977822
datafile 3 switched to  datafile copy
   input datafile copy RECID=1  STAMP=865977822 file name=/oracle/app/product/oradata/STBY/sysaux01.dbf
   datafile 4 switched to  datafile copy
   input datafile copy RECID=2  STAMP=865977822 file name=/oracle/app/product/oradata/STBY/pdbseed/sysaux01.dbf
   datafile 5 switched to  datafile copy
   input datafile copy RECID=3  STAMP=865977822 file name=/oracle/app/product/oradata/STBY/undotbs01.dbf
   datafile 6 switched to  datafile copy
   input datafile copy RECID=4  STAMP=865977822 file name=/oracle/app/product/oradata/STBY/users01.dbf
   datafile 11 switched to  datafile copy
   input datafile copy RECID=5  STAMP=865977822 file name=/oracle/app/product/oradata/STBY/PDB1/sysaux01.dbf
   datafile 12 switched to  datafile copy
   input datafile copy RECID=6  STAMP=865977822 file  name=/oracle/app/product/oradata/STBY/PDB1/PDB1_users01.dbf
contents of Memory Script:
   {
   Alter clone database open resetlogs;
   }
   executing Memory Script
database opened
contents of Memory Script:
   {
   sql clone "alter pluggable database all  open";
   }
   executing Memory Script
sql statement: alter  pluggable database all open
   Finished Duplicate Db at  10-DEC-14
RMAN>

É importante ressaltar que o produto final da operação de active database duplicate, é um database duplicado, ou seja, não é produzido um banco de dados idêntico ao source database, obviamente isso pode gerar uma certa confusão, uma vez que em muitas oportunidade referimos essa operação como clonagem, contudo, perceba que em um certo momento da operação, o controlfile é recriado, provocando assim uma alteração no DBID.

Essa troca é necessária em caso de utilização de um catalogo de recuperação do RMAN, não é possível registrar dois databases com um mesmo DBID. Caso o intuito do duplicate seja criar um standby database, obviamente o DBID não seria alterado, não existindo a recriação do controlfile.

 

 

 

 

Carlos H. Y. Furushima é um especialista em banco de dados relacional, trabalhando como consultor de TI, atuando principalmente como o Oracle Database Administrator (DBA Oracle). Tem uma vasta experiência e conhecimento em “Performance, diagnostic and tuning”, “High Availability”, “Backup & Recovery” e “Exadata”. Ele também está entusiasmado com sistema operacional Linux/Unix, onde contribui com o desenvolvimento do código do kernel Linux em parceria com a comunidade “GNU Linux”, com criação e revisão de novas funcionalidades, melhorias e correções de bugs. Recentemente, Furushima divide seu tempo com consultoria especializada em banco de dados Oracle e estudos sobre “Oracle Internals”, com o objetivo de descobrir e entender os benefícios do bancos de dados Oracle em plataforma Linux/Unix. Siga Furushima em seu blog http://dbafurushima.com.br/.