(rac12c1) 10> ADD SCHEMATRANDATA scott ALLCOLS============================================================Somente no source=============================================================1) Configurar o extract. Ele e responsavel pela extracao dos dados que serao replicados e vai gerar os trailfiles localmente. GGSCI (rac12c1) 1> dblogin userid dbagate, password aaa123 GGSCI (rac12c1) 2> add extract extract1, tranlog, begin now GGSCI (rac12c1) 3> add exttrail /oracle/app/oracle/product/11.2.0/gghome/dirdat/lt, extract extract1, megabytes 50 GGSCI (rac12c1) 4> add rmttrail /oracle/app/oracle/product/11.2.0/gghome/dirdat/rt, extract extract1, megabytes 50 GGSCI (rac12c1) 5> edit params extract1 extract extract1 userid dbagate@GGPRD, password aaa123 EXTTRAIL /oracle/app/oracle/product/11.2.0/gghome/dirdat/lt TRANLOGOPTIONS EXCLUDEUSER DBAGATE GETTRUNCATES ddl include mapped objname scott.*; table SCOTT.*; GGSCI (rac12c1) 6> info extract extract1, detail2) Configurar o datapump. Ele e responsavel pela envio dos trailfiles para o servidor remoto. GGSCI (rac12c1) 7> ADD EXTRACT dtpump1, EXTTRAILSOURCE /oracle/app/oracle/product/11.2.0/gghome/dirdat/lt, BEGIN now GGSCI (rac12c1) 8> ADD RMTTRAIL /oracle/app/oracle/product/11.2.0/gghome/dirdat/rt, EXTRACT dtpump1, megabytes 50 GGSCI (rac12c1) 9> edit params dtpump1 EXTRACT dtpump1 RMTHOST 192.168.1.32, mgrport 7809 RMTTRAIL /oracle/app/oracle/product/11.2.0/gghome/dirdat/rt PASSTHRU GETTRUNCATES TABLE SCOTT.*; GGSCI (rac12c1) 10> info all============================================================Somente no target=============================================================1) Adicionar o replicat ./ggsci GGSCI (rac12c2) 1> dblogin userid dbagate; password aaa123 GGSCI (rac12c2) 2> add replicat replic1, exttrail /oracle/app/oracle/product/11.2.0/gghome/dirdat/rt, begin now, CHECKPOINTTABLE dbagate.checkpoint, GGSCI (rac12c2) 3> edit params replic1 REPLICAT replic1 ASSUMETARGETDEFS GETTRUNCATES HANDLECOLLISIONS USERID dbagate, PASSWORD aaa123 discardfile /oracle/app/oracle/product/11.2.0/gghome/dircrd/replic1_discard.txt, append, megabytes 50 MAP SCOTT.*, TARGET SCOTT.*; DDL INCLUDE ALL DDLERROR DEFAULT IGNORE RETRYOP MAXRETRIES 10 RETRYDELAY 30 GGSCI (rac12c2) 4> info all============================================================Iniciar os servicos do SOURCE============================================================= ./ggsci GGSCI (rac12c1) 1> dblogin userid dbagate; password aaa123 GGSCI (rac12c1) 2> start er * GGSCI (rac12c1) 3> info all GGSCI (rac12c1) 4> info extract extract1, detail GGSCI (rac12c1) 5> info extract dtpump1, detail GGSCI (rac12c1) 6> stats extract extract1============================================================Migrar o schema do source para o target - INITIAL LOAD=============================================================Nesse ponto iremos executar a carga inicial (INITIAL LOAD) no target. Essa etapa pode ser feita de varias formas. Poderiamos somente criar a estrutura de tabelas no target e fazer um INITIAL LOAD via GoldenGate mesmo. Ou fazer via EXPDP/IMPDP.Eu prefiro sempre fazer via EXPDP/IMPDP. Entao e essa forma que vamos utilizar.1) Identificando o scn SELECT TO_CHAR(CURRENT_SCN) FROM V$DATABASE; No nosso exemplo, o SCN sera esse: 970349 2) Executar o EXPDP com FLASHBACK_SCN no source expdp \"/ as sysdba\" directory=EXPDP_DIR DUMPFILE=SCOTT_%U.dmp LOGFILE=scott.log owner=scott filesize=8192m FLASHBACK_SCN=9703493) Realizar o IMPDP no target impdp \"/ as sysdba\" directory=EXPDP_DIR dumpfile=SCOTT_1.dmp logfile=impdp.log SCHEMAS='SCOTT'============================================================Somente no target=============================================================1) Iniciar o replicat. Esse processo e o responsavel por ler e aplicar os trailfiles enviados pelo processo datapump do source. ./ggsci GGSCI (rac12c2) 1> dblogin userid dbagate; password aaa123 GGSCI (rac12c2) 2> start er * Importante: Caso queira iniciar a partir do SCN (eu acho mais seguro) GGSCI (rac12c2) 2> start replicat replic1, ATCSN 970349 GGSCI (rac12c2) 3> info all GGSCI (rac12c2) 4> info replicat replic1, detail GGSCI (rac12c2) 5> stats REPLICAT replic1, total, hourly, reportrate min Agora meus queridos, basta executar os testes na origem e ver a magica acontecer no destino.Lembre-se que esse e um cenario simples, porem um cenario maior acaba seguindo os mesmos passos. Consulte o manual, sao opcoes diversas para replicacao.Espero que gostem.AbracoMario