• Like
  • Save
Setup oracle golden gate 11g replication
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Setup oracle golden gate 11g replication

  • 2,329 views
Published

How to setup Oracle Goldengate Replication between 11gR2 RAC or Single node instances. For RAC setup the GoldenGate custom cluster service . Not part of this document

How to setup Oracle Goldengate Replication between 11gR2 RAC or Single node instances. For RAC setup the GoldenGate custom cluster service . Not part of this document

Published in Technology , Travel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,329
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Setup Oracle Golden gate 11.1 Author : Kanwar Batra Create extract datapump on source. Golden Gate pumps will be created to transfer logs to the target environment Target GoldenGate Version 11.1.1.1 OGGCORE_11.1.1_PLATFORMS_110421.2040 The doc below has been modified as per the requirement. 1. Prequisites Make sure /gg mount point is in place ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; (for 10g) ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS; (for 11g) Needed on all source and target dbs if bidirectional replication is setup.ls –ltr. Please run the above command only on Target database. Select SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK, SUPPLEMENTAL_LOG_DATA_UI from v$database; 2. Owner /Directories : On Target dbs ORACLE user owns the golden gate home. create directory ggate xx under /opt/gg mkdir opt/gg/xx xx- version of golden gate Binaries used: ggs_Solaris_sparc_ora11g_64bit.tar 3. Prepare to Install Copy binaries into the golden gate home (/opt/gg/xx) Un-tar the binaries in the same directory on source & target systems tar –xvf ggs_Solaris_sparc_ora11g_64bit.tar 3.1 Golden gate source setup create user oragg identified by <pwd> default tablespace users temporary tablespace temp quota unlimited on users quota 0 on system; grant ogg_role to oragg;
  • 2. 4. GoldenGate Target Setup Setup Target Database if it does not already exist Create the Target database from source or RMAN backup or export dump of source database CREATE BIGFILE TABLESPACE CLOUD_DAT DATAFILE '+DATADG' SIZE 20G REUSE AUTOEXTEND ON NEXT 20480K MAXSIZE unlimited LOGGING EXTENT MANAGEMENT LOCAL UNIFORM SIZE 10240K SEGMENT SPACE MANAGEMENT AUTO; CREATE BIGFILE TABLESPACE CLOUD_NDX DATAFILE '+DATADG' SIZE 30G REUSE AUTOEXTEND ON NEXT 10240M MAXSIZE unlimited LOGGING EXTENT MANAGEMENT LOCAL UNIFORM SIZE 10240K SEGMENT SPACE MANAGEMENT AUTO ; create role RO_ROLE ; create role DBENG_ROLE; create role DML_ROLE ; create role DBE_ROLE ; create role TMP_ROLE ; create role LSN_ROLE; create role BC_ROLE; CREATE USER CLOUD PROFILE DEFAULT IDENTIFIED BY CLOUD DEFAULT TABLESPACE CLOUD_DAT TEMPORARY TABLESPACE TEMP ACCOUNT UNLOCK quota unlimited on CLOUD_DAT quota 0 on system; GRANT CREATE SESSION TO CLOUD; GRANT UNLIMITED TABLESPACE TO CLOUD; GRANT CONNECT TO CLOUD; GRANT RESOURCE TO CLOUD; Grant create database link to CLOUD; CREATE USER CONNDBO PROFILE DEFAULT IDENTIFIED BY conndbo1 DEFAULT TABLESPACE CLOUD_NDX TEMPORARY TABLESPACE TEMP ACCOUNT UNLOCK quota unlimited on CLOUD_NDX quota 0 on system; GRANT CONNECT TO CONNDBO; GRANT LSN_ROLE TO CONNDBO; GRANT RESOURCE TO CONNDBO;
  • 3. CREATE USER POSNEGDBO PROFILE DEFAULT IDENTIFIED BY posnegdbo1 DEFAULT TABLESPACE CLOUD_NDX TEMPORARY TABLESPACE TEMP ACCOUNT UNLOCK quota unlimited on CLOUD_NDX quota 0 on system; GRANT CREATE SESSION TO POSNEGDBO; GRANT LSN_ROLE TO POSNEGDBO; create role ogg_role; grant connect,resource to ogg_role; grant dba to ogg_role; grant create session to ogg_role; grant create table to ogg_role; grant alter session to ogg_role; grant select any table to ogg_role; grant alter any table to ogg_role; grant select any dictionary to ogg_role; grant flashback any table to ogg_role; grant execute on dbms_flashback to ogg_role; grant execute on utl_file to ogg_role; grant insert any table to ogg_role; grant create any table to ogg_role; grant update any table to ogg_role; grant delete any table to ogg_role; grant drop any table to ogg_role; create user ggora identified by ****** default tablespace users temporary tablespace temp quota unlimited on users quota 0 on system; grant ogg_role to ggora; 5. Creating subdirectories and configuring Golden Gate Manager on Target: -bash-3.00$ cd /opt/gg/11/ export LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0.3/db/lib -bash-3.00$ ./ggsci Oracle GoldenGate Command Interpreter for Oracle Version 11.1.1.1 OGGCORE_11.1.1_PLATFORMS_110421.2040 Solaris, sparc, 64bit (optimized), Oracle 11g on Apr 22 2011 03:14:39 Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved. GGSCI (devcloud) 1> create subdirs Creating subdirectories under current directory /opt/gg/11
  • 4. Parameter files /opt/gg/11/dirprm: already exists Report files /opt/gg/11/dirrpt: already exists Checkpoint files /opt/gg/11/dirchk: already exists Process status files /opt/gg/11/dirpcs: already exists SQL script files /opt/gg/11/dirsql: already exists Database definitions files /opt/gg/11/dirdef: already exists Extract data files /opt/gg/11/dirdat: already exists Temporary files /opt/gg/11/dirtmp: already exists Veridata files /opt/gg/11/dirver: already exists Veridata Lock files /opt/gg/11/dirver/lock: already exists Veridata Out-Of-Sync files /opt/gg/11/dirver/oos: already exists Veridata Out-Of-Sync XML files /opt/gg/11/dirver/oosxml: already exists Veridata Parameter files /opt/gg/11/dirver/params: already exists Veridata Report files /opt/gg/11/dirver/report: already exists Veridata Status files /opt/gg/11/dirver/status: already exists Veridata Trace files /opt/gg/11/dirver/trace: already exists Stdout files /opt/gg/11/dirout: already exists GGSCI 1> edit params mgr PORT 2000 DYNAMICPORTLIST 2001-2100 -bash-3.00$ ./ggsci Oracle GoldenGate Command Interpreter for Oracle Version 11.1.1.1 OGGCORE_11.1.1_PLATFORMS_110421.2040 Solaris, sparc, 64bit (optimized), Oracle 11g on Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved. GGSCI (devcloud) 1> start mgr Manager started. GGSCI (devcloud) 2> info all Program Status Group Lag Time Since Chkpt MANAGER RUNNING 6. Create checkpoint table on Target: GGSCI (devcloud) 1> edit params ./GLOBALS checkpointtable ggora.chkpt save the file GGSCI (devcloud) > dblogin userid oragg password **** Successfully logged into database.
  • 5. GGSCI (devcloud) 5> add checkpointtable ggora.chkpt Successfully created checkpoint table GGORA.CHKPT. NOTE: GGORA NEEDS CREATE TABLE PRIV FOR THIS TO BE CREATED. 7. CONFIGURE EXTRACT DATAPUMP ON SOURCE: Before configuring pump make sure GG is installed on target and the subdirs have been created -bash-3.00$ pwd /opt/gg/11 -bash-3.00$ cd diroby/ -bash-3.00$ vi pstd1cld.oby -- pstd1cld info pstd1cld, detail DELETE pstd1cld ADD EXTRACT pstd1cld, EXTTRAILSOURCE ./dirdat/D1/CLOUD/r1, EXTSEQNO 0, EXTRBA 0 ADD RMTTRAIL ./dirdat/L1/CLOUD/r1, EXTRACT pstd1cld, MEGABYTES 50 info pstd1cld, detail Run the Obey file: GGSCI (devcloud) 1> obey ./diroby/ pstd1cld.oby Create the pump parameter file: /*** check if you can telnet to port listener port 1521. Once manager is up on target try to telnet to port 2000 ***/ GGSCI (devcloud) 9> edit params PSTD1CLD -- -- Data Pump parameter file -- EXTRACT pstd1cld setenv (NLS_LANG = "AMERICAN_AMERICA.AL32UTF8") PASSTHRU RMTHOST stagedb.mydomain.com, MGRPORT 2000, TCPBUFSIZE 1048576, TCPFLUSHBYTES 1048576 RMTTRAIL ./dirdat/L1/CLOUD/r1 IGNOREREPLICATES TABLE CLOUD.*; Save the file Create the Necessary Directoires On TargetDatabase: -bash-3.00$ cd /opt/gg/11/ -bash-3.00$ cd dirdat -bash-3.00$ mkdir -p L1/stgdb
  • 6. Start the mgr on target first before starting the pump on source. 8. Start EXTRACT DATAPUMP ON SOURCE : GGSCI (devcloud)1> alter pstd1cld begin now GGSCI (devcloud) 15> start pstd1cld GGSCI (devcloud) 15> stats pstd1cld Check that the trail file is created on target. It should not be 0 bytes. 9. Configure Replicat on Target: -bash-3.00$ pwd /opt/gg/11 -bash-3.00$ mkdir diroby -bash-3.00$ cd diroby -bash-3.00$ vi rstd1cld.oby Add the below line : DBLOGIN USERID ggora, PASSWORD ****** DELETE rstd1cld ADD REPLICAT rstd1cld, EXTTRAIL ./dirdat/L1/CLOUD/r1, CHECKPOINTTABLE ggora.chkpt --alter replicat <REPLICAT_NAME>, begin <YYYY-MM-DD HH:MM:SS> Run the Obey file: GGSCI (dbrac) 4> obey ./diroby/rstd1cld.oby GGSCI (devcloud) 1> info all Program Status Group Lag Time Since Chkpt MANAGER RUNNING REPLICAT STOPPED rstd1cld 00:00:00 00:05:00 Create the replicat parameter file: GGSCI (devcloud) 2> edit params rstd1cld REPLICAT rstd1cld setenv (NLS_LANG = "AMERICAN_AMERICA.AL32UTF8") USERID oragg, PASSWORD <pwd> ASSUMETARGETDEFS DISCARDFILE ./dirrpt/rstd1cld.dsc, PURGE MAP CLOUD.secgroup , TARGET CLOUD.secgroup , KEYCOLS (secid,secgroup_name)
  • 7. Create the Necessary Directoires: $ cd /opt/gg/11 $ mkdir –p /opt/gg/dirdat/ D1/CLOUD 10. Setting DB Parameters alter system set aq_tm_processes=0 scope=both; alter system set db_recovery_file_dest_size=200G scope=both; alter system set db_recovery_file_dest='+CLOUDDG' scope=both; alter system set db_writer_processes=8 scope=spfile; alter system set open_cursors=2000 scope=spfile; alter system set parallel_max_servers=32 scope=spfile; alter system set job_queue_processes=10 scope=spfile; alter system set sga_max_size=20G scope=spfile; alter system set sga_target=20G scope=spfile; alter system set pga_aggregate_target=4G scope=spfile; alter system set db_cache_size=12G scope=spfile; alter system set shared_pool_size=3G scope=spfile; set snapshot retention=30 days and snapshot interval=15 minutes execute dbms_workload_repository.modify_snapshot_settings( interval => 15,retention => 43200); grant all on CLOUD.secgroup to ogg_role; 11. Resize Redologs to accommodate expected transaction growth. Restart database after the parameters have been set. alter database add logfile group 6 size 1000M; alter database add logfile group 7 size 1000M; alter database add logfile group 8 size 1000M; select * from v$log; select * from v$logfile; Resize log groups 1 to 7 as below alter database drop logfile group 1; alter database add logfile group 1 size 1000M; Turn on archiving and Flashback database alter system set log_archive_format='%t_%s_%r.arc' scope=spfile; shut immediate; startup mount alter database archivelog; alter database flashback on;
  • 8. alter database open; check that archive and flashback logs are generated. alter system switch logfile; alter system switch logfile; alter system switch logfile; archive log list chmod –R 750 cdump chmod –R 750 trace Below Recommendation from oracle for ASM parameters : Memory_max_size=500m Memory_max_target=500m db_cache_size = 64MB shared_pool_size = 128MB large_pool = 12MB Processes = 150 12. Start the replicat on Target Before starting replicat Enable handle collisions in Replicat parameter file. GGSCI (devcloud) 1>edit params RSTD1CLD Uncomment HANDLECOLLISIONS Start replicat from csn captured during expdp or the time when expdp was started. GGSCI (devcloud) 1> START REPLICAT RSTD1CLD, aftercsn 135132783 OR GGSCI (devcloud) 4> alter extract pstd1dev begin <timestamp> Note: The time here is the time when expdp was started on the source server Use the following commands to check the status of Replicat GGSCI (devcloud) 8> info all Program Status Group Lag Time Since Chkpt MANAGER RUNNING REPLICAT RUNNING RSTD1CLD 00:00:25 00:00:01
  • 9. GGSCI (devcloud) 19> stats RSTD1CLD GGSCI (devcloud) 20> stats RSTD1CLD totalsonly * GGSCI (devcloud) 21> stats RSTD1CLD totalsonly * reportrate sec GGSCI (devcloud) 4> info RSTD1CLD, detail NOTE: ONCE LAG is 0 HANDLECOLLISIONS SHOULD BE COMMENTED IN THE REPLICAT CONFIG FILE. GGSCI (devcloud) 80> stop RSTD1CLD GGSCI (devcloud) 81> start RSTD1CLD Disclaimer: Please note this document was prepared by referencing the Oracle internal documents and based on a working deployment at a customer. You are welcome to reference this document . These opinions are mine and have not been validated by oracle. The document does not guarantee a solution it just provides my experience with goldengate. Use as is