Install Goldengate On Oracle Rac 11.2.0.4, goldengate11.2.0.4

Source: Internet
Author: User

Install Goldengate On Oracle Rac 11.2.0.4, goldengate11.2.0.4

Installation environment:

source:OS:redhat 6.3DB:11.2.0.4 racOGG:11.2.1.0.1target:OS:redhat 6.3DB:11.2.0.4OGG:11.2.1.0.1

A single data transfer configuration from rac to a single machine. The ogg test is not put into the shared storage. We recommend that you store ogg in the production environment for shared storage to avoid spof.


Prepare (Source And Target DB ):

useradd ogg -g oinstallAdd Environment Variblevi /home/oracle/.bash_profileexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/oggConfigure Databasealter database archivelog;alter database force logging;alter database add supplemental log data;For Oracle DB versions 11.2.0.4 and 12.1.0.2 there will be a new init.ora parameter called ENABLE_GOLDENGATE_REPLICATION.  In order for some of the Oracle GoldenGate functionality to work, this parameter must be set to true.ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION = TRUE SCOPE=BOTH;Create OGG User:sqlplus / as sysdbacreate user ogg identified by ogg;grant dba to ogg;GGSCI (zbdba1) 1> edit params ./GLOBALGGSCHEMA oggCHECKPOINTTABLE ogg.checkpointInstalling the DDL objects:1、Run the @marker_setup.sql script. This script installs support for the Oracle GoldenGatemarker system, which is required for DDL support. You will be prompted for the nameof the Oracle GoldenGate schema.2、Run the @ddl_setup.sql script   Script that installs the Oracle GoldenGate DDL extraction andreplication objects. (Oracle installations)3、Run the @role_setup.sql script. This script drops and creates the role needed for DDLsynchronization. It grants DML permissions on the Oracle GoldenGate DDL objects4、Grant the role to all Oracle GoldenGate Extract users. You may need to make multiplegrants if the processes have different user names.Run the @ddl_enable.sql script to enable the DDL trigger.5、To improve the performance of the DDL trigger, make the ddl_pin script part of the databasestartup. It must be invoked with the Oracle GoldenGate DDL user name, as in:@?/rdbms/admin/dbmspool.sqlSQL> @ddl_pin oggTo improve the performance of the DDL trigger This script pins the PL/SQL package that is used by the trigger into memory. If executingthis script from SQL*Plus, connect as SYSDBA from the Oracle GoldenGate home directory.This script relies on the Oracle dmbs_shared_pool system package, so install that packagebefore using ddl_pin.


Source DB:

MANAGERGGSCI (zbdba1) 1>  create subdirsGGSCI (zbdba1) 22> view param mgrport 7839DYNAMICPORTLIST 7840-7914USERID OGG,PASSWORD oggAUTORESTART EXTRACT *, RETRIES 5, WAITMINUTES 3PURGEOLDEXTRACTS ./DIRDAT/*,MINKEEPDAYS 3PURGEDDLHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10,FREQUENCYMINUTES 30PURGEMARKERHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10LAGREPORTHOURS 1LAGINFOMINUTES 30LAGCRITICALMINUTES 45
<pre name="code" class="html">GGSCI (zbdba1) 3> dblogin userid ogg,password ogg;Successfully logged into database.GGSCI (zbdba1) 1> add trandata zbdba.*
EXTRACTadd extract ext1, tranlog, threads 2, begin nowadd exttrail/ogg/dirdat/sa extract ext1add rmttrail./dirdat/sa, extract ext1
When Using asm, we need to emphasize that Oracle provides a new asm api in Oracle 10.2.0.5, Oracle 11.2.0.2, and later versions, the extract process can directly use the database server to access redo and archive logs. After using this API, extract will obtain a read buffer up to 4 mb. The larger the read buffer, the easier it is to improve the Extract process for environments with a high redo volume. You can use the DBLOGREADERBUFSIZE option of TRANLOGOPTIONS to specify the read buffer size. 

In this solution, you only need to add the following parameters to the extraction process:

TRANLOGOPTIONS DBLOGREADER
Solutions of other versions:
Specifies the asm user password and archiving path

TRANLOGOPTIONS ASMUSER sys@asm1, ASMPASSWORD oracleTRANLOGOPTIONS ALTARCHIVELOGDEST primary instance test1 /opt/oracle/arch, ALTARCHIVELOGDEST primary instance test2 /opt/oracle/arch

Configure tnsnames. ora

ASM1 =  (DESCRIPTION =    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.52)(PORT = 1521))    (CONNECT_DATA =      (SERVER = DEDICATED)      (SERVICE_NAME = +ASM)      (INSTANCE_NAME= +ASM1)    )  )
In addition, nfs ing is required for archiving two nodes.

Here, the database version is 11.2.0.4, so solution 1 is used.

EXTRACT EXT1setenv ( NLS_LANG = AMERICAN_AMERICA.ZHS16GBK )setenv (ORACLE_SID= "test1")USERID ogg,PASSWORD oggTRANLOGOPTIONS DBLOGREADERDDL &INCLUDE MAPPED OBJTYPE 'TABLE' &INCLUDE MAPPED OBJTYPE 'IDNEX' &INCLUDE MAPPED OBJTYPE 'SEQUENCE' &INCLUDE MAPPED OBJTYPE 'VIEW' &INCLUDE MAPPED OBJTYPE 'PROCEDURE' &INCLUDE MAPPED OBJTYPE 'FUNCTION' &INCLUDE MAPPED OBJTYPE 'PACKAGE' &INCLUDE MAPPED OBJTYPE 'MATERIALIZED VIEW' &EXCLUDE OPTYPE COMMENTDDLOPTIONS ADDTRANDATA NOCROSSRENAME REPORTREPORTCOUNT EVERY 1 MINUTES,RATEDISCARDFILE ./dirrpt/EXTSA.DSC,APPEND,MEGABYTES 1024THREADOPTIONS MAXCOMMITPROPAGATIONDELAY 60000 IOLATENCY 60000DBOPTIONS ALLOWUNUSEDCOLUMNWARNLONGTRANS 2H,CHECKINTERVAL 3Mexttrail ./dirdat/saFETCHOPTIONS NOUSESNAPSHOT,FETCHPKUPDATECOLS,MISSINGROW REPORTtable zbdba.*;

datapumpGGSCI (zbdba1) 4>> add extract ext2,exttrailsource /ogg/dirdat/saEXTRACT added. ADD EXTTRAIL ./dirdat/sa, EXTRACT EXT2GGGSCI (zbdba1) 4> add rmttrail  /ogg/dirdat/sa, extract ext2RMTTRAIL added.GGSCI (zbdba1) 2>  view param ext2EXTRACT EXT2passthruRMTHOST 192.168.56.61,MGRPORT 7839,COMPRESSRMTTRAIL ./dirdat/satable zbdba.*;

Target DB:

GGSCI (zbdba2) 1>  create subdirsGGSCI (zbdba2) 42> view param mgrport 7839DYNAMICPORTLIST 7840-7914USERID OGG,PASSWORD oggAUTORESTART REPLICAT *, RETRIES 5, WAITMINUTES 3PURGEOLDEXTRACTS ./dirdat/*,MINKEEPDAYS 3PURGEDDLHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10,FREQUENCYMINUTES 30PURGEMARKERHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10LAGREPORTHOURS 1LAGINFOMINUTES 30LAGCRITICALMINUTES 45 Create Replicat GGSCI (zbdba2) 1>  view param ./GLOBALSGGSCHEMA oggCHECKPOINTTABLE ogg.checkpointGGSCI (zbdba2) 1> dblogin userid ogg,password oggGGSCI (zbdba2) 2> add checkpointtable  ogg.checkpointSuccessfully created checkpoint table OGG.CHECKPOINT.GGSCI (zbdba2) 2>  add replicat rep1,exttrail /ogg/dirdat/sa, checkpointtable ogg.checkpointREPLICAT added.GGSCI (zbdba2) 19> edit param rep1REPLICAT rep1ASSUMETARGETDEFSUSERID ogg, PASSWORD oggdiscardfile ./dirdat/rep1_discard.txt,append,megabytes 5DDL INCLUDE MAPPEDDDLOPTIONS REPORTBATCHSQLDBOPTIONS DEFERREFCONSTDBOPTIONS LOBWRITESIZE 102400HANDLECOLLISIONSDDLERROR DEFAULT DISCARD RETRYOP MAXRETRIES 5 RETRYDELAY 20--grouptransops 1--maxtransops 1APPLYNOOPUPDATESMAP zbdba.*, TARGET zbdba.*;start managerGGSCI (zbdba2) 23> info allProgram     Status      Group       Lag at Chkpt  Time Since ChkptMANAGER     RUNNING                                          REPLICAT    STOPPED     REP1        00:00:00      00:00:03  

Test Data (Source and Target DB ):

create tablepsace zbdab datafile '/opt/oracle/oradata/zbdba.dbf' size 100m;create zbdba identified by oracle default tablespace zbdba;grant dba to zbbda;On Source DB:User data pump:expdp zbdba/oracle DIRECTORY=dumpdir           DUMPFILE=zbdba.dmp LOGFILE=zbdba.log           SCHEMAS=zbdba JOB_NAME=exp_zbdba_schemascp data to target DBOn Target DB:impdp zbdba/oracle DIRECTORY=dumpdir           DUMPFILE=zbdba.dmp SCHEMAS=zbdba           JOB_NAME=imp_zbdba_schema GGSCI (ogg2) 24> start rep1Sending START request to MANAGER ...REPLICAT REP1 startingGGSCI (ogg2) 26> info allProgram     Status      Group       Lag at Chkpt  Time Since ChkptMANAGER     RUNNING                                          REPLICAT    RUNNING     REP1        00:00:00      00:00:07  On Source DB:create table test as select * from dba_objects;Monitor OGG(Source And Target DB):tail -100f ggserr.log 








Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.