SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Advanced Goldengate Training Ⅰ www.oggers.net     2011-07-25
Agenda □Mothod of initialize data □   Handing essential DML and DML error □   Handing  Advanced  DDL  sync and DDL error □  Map and manipulating data □   Monitor and Troubleshooting Ⅰ
Initialize Data     If  your database is huge and application transcations are still ongoing ,there is little stop-time,How should you Initialize  your data?            □ Use  Keys + Handlecollsions            □Use the commit SCN
Handlecollsions □How does the Handlecollsions work?  □ Where is the drawbacks with Handlecollsions?  ●  Does your tables have any primary key or unique key? ● Is there primary key update  during initialization ? Suitable for your environment ? Ⅰ
Commit SCN ♦ Commit SCN/GoldengateCSN ♦ the common initialized mothods Via  SCN □ exp/imp    □ expdp/impdp □ Transport Tablespace with Backupset(compare                                                  Transport  Tablespace) □ Datagurd/RMAN   □ Other consistent read utility Ⅰ □
How to re-initialize a special table   □ split replicat group and merge it   □ Using transaction  CSN Filter  map hr.job, target hr.job, filter (@GETENV ("transaction", "csn") > xxx);
Agenda □Mothod of initialize data □   Handing essential DML and DML error □   Handing  Advanced  DDL  sync and DDL error □  Map and manipulating data □   Monitor and Troubleshooting Ⅰ
Non-supported data types ● ANYDATA ● ANYDATASET ● ANYTYPE ● BFILE ● BINARY_INTEGER ● MLSLABEL ● PLS_INTEGER ● TIMEZONE_ABBR ● TIMEZONE_REGION ● URITYPE ● UROWID Ⅰ
DML  replication  action □  Keys(Primary key/unique key/keycols) action ● why   to recommend to use keys?       ● How  to use keycols? □supplemental  non-key  column  action Ⅰ
Handing DML error  □ Handing replicat errors on DML operations via  REPERROR   Abort:  roll back the transaction and stop processing Discard:  log the error to the discard file and continue processing Exception: send the error for exceptions processing Ignore: ignore the error and continue processing     example: reperror default,discard     discardfile ./dirrpt/rep_hr.dsc,append,megabytes 100 Ⅰ
Use  multiple  REPERROR statements □ handing special  error-code reperror XXXX discard □ handing special  object                                                                                                                                 reperror default  ignore exclude/include objname “hr.jobs” Ⅰ
Use exception table  REPERROR (DEFAULT, EXCEPTION) MAP hr.jobs, TARGET hr.jobs, & COLMAP (USEDEFAULTS); MAP hr.jobs, TARGET hr.jobs_exception, & EXCEPTIONSONLY, & INSERTALLRECORDS & COLMAP (USEDEFAULTS, & DML_DATE = @DATENOW(), & OPTYPE = @GETENV("LASTERR", "OPTYPE"), & ERR_NUM = @GETENV("LASTERR", "DBERRNUM"), & ERR_MSG = @GETENV("LASTERR", "DBERRMSG")); Ⅰ
Agenda □Mothod of initialize data □   Handing essential DML and DML error □   Handing  Advanced  DDL  sync and DDL error □  Map and manipulating data □   Monitor and Troubleshooting Ⅰ
DDL limitations and influence  □  Disable recycle  bin and affect other database  environment □ affect data filtering, and manipulation by the data pump (passthru/nopassthru) □affect  data-definition  □Others Ⅰ Must  configure DDL synchronization?
DDL  Scope □ Mapped Objects that are specified in TABLE and MAP statements  □ Unmapped Objects that are not  specified in TABLE and MAP statements  □Other scope DDL operations that cannot be mapped are of OTHER scope,justlike the follow operations: create user,grantrole,createtablespace ,alter datafile … Ⅰ
DDL  Filter  ● exclude/include  ● mapped/unmapped/other/all filter scope ● opttype/objtype/objname filter special ddl action and object ● instr/instrwors    filter via matching Ⅰ ddl & include mapped exclude  objtype'table‘ objname"hr.jobs", & exclude INSTRWORDS  'alter add “city"', & include unmapped, objname "hr3.jobs", & include other
DDL DDLSUBST ● When may we use DDLSUBST   like as the objects on source and target have  the different  tablespace   like as the datafile on source and tarhet have  different destination    --------- DDLSUBST 'users' with 'system' include mapped objtype ‘table’ INSTRWORDS 'create   table  tablespace "users"' Ⅰ        Notice: Must be careful and the best way  is to restrict the DDL statement via DDL inclusion and exclusion options Take care of  ddl matching via instr, it’s strict matching, including space character, carriage-return character
derived object □ Notice the derived object action ●  Rename ●  CTAS ●  Index ●  Trigger □ mapderived/ nomapderived Ⅰ
DDL Other Topic □ Sequence can the sequence really be synchronized before V11.1.1.1.0? □ Password □ Add supplemental log groups ddloptionsaddtrandataretryop Ⅰ
Use  multiple  DDLERROR statements □ handing special  error-code ddlerror XXXX discard □ handing special  object                                                                                                                                 ddlerror default  ignore include OBJTYPE TABLE OBJNAME “hr1.*” Ⅰ
Agenda □Mothod of initialize data □Handing essential DML and DML error □   Handing  Advanced  DDL  sync and DDL error □  Map and manipulating data □   Monitor and Troubleshooting Ⅰ
Select  Rows □Method of select rows ● Filter select rows based on a numeric value by using basic operators  or one or more GoldenGate column-conversion functions MAP  hr.jobs,TARGET hr.jobs, FILTER (ON INSERT, job_id > 1000);  ● Where select rows based on a conditional statement MAP  hr.jobs,TARGET hr.jobs, where (job_name=@presentand= “Jerry”); Ⅰ
Map Columns □COLMAP map table-level column  map hr.jobs, target hr.jobs_add,& colmap (usedefaults,totol_salary=salary*days);   □COLMATCH     map between similarly structured tables that have different column names for the same sets of data colmatch suffix  _s  map hr.jobs, target hr.jobs, colmap(usedefaults); The column named Job_id on  source is named Job_id_s on target  Ⅰ
Data-definationsfile □data-definations file It’s used to synchronize source and target tables that have dissimilar data definitions ● DEFGEN        the tool is used to create a data-definations file defgenparamfiledirprm/defgen.prm ● SOURCEDEFS       Specifies a file that contains source data definitions created by  the DEFGEN utility Ⅰ
Convert  DML  operations □ select  dml type  ●  GETUPDATES | IGNOREUPDATES   ●  GETDELETES | IGNOREDELETES   ●  GETINSERTS | IGNOREINSERTS □ convert dml  type  ● INSERTALLRECORDS   ● INSERTUPDATES  ● INSERTDELETES ● UPDATEDELETES Ⅰ
Obtain  transaction info □  the useful  of  transaction info □   Function GETENV (“TRANSACTION”, “<return value>”) GETENV (“GGHEADER”, “<return value>”)  map hr.jobs, target hr.jobs,& colmap &   ( & usedefaults,& Op_type    = @GETENV (“GGHEADER”, “OPTYPE”),&  Indicator   = @GETENV (“GGHEADER”, “BEFOREAFTERINDICATOR”), &    commit_ts= @GETENV (“GGHEADER”, “COMMITTIMESTAMP”) &  )  Ⅰ

Weitere ähnliche Inhalte

Was ist angesagt?

Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
DataWorks Summit
 
Spark & Spark Streaming Internals - Nov 15 (1)
Spark & Spark Streaming Internals - Nov 15 (1)Spark & Spark Streaming Internals - Nov 15 (1)
Spark & Spark Streaming Internals - Nov 15 (1)
Akhil Das
 

Was ist angesagt? (20)

Frustration-Reduced Spark: DataFrames and the Spark Time-Series Library
Frustration-Reduced Spark: DataFrames and the Spark Time-Series LibraryFrustration-Reduced Spark: DataFrames and the Spark Time-Series Library
Frustration-Reduced Spark: DataFrames and the Spark Time-Series Library
 
Horizontally Scalable Relational Databases with Spark: Spark Summit East talk...
Horizontally Scalable Relational Databases with Spark: Spark Summit East talk...Horizontally Scalable Relational Databases with Spark: Spark Summit East talk...
Horizontally Scalable Relational Databases with Spark: Spark Summit East talk...
 
Apache Spark & Streaming
Apache Spark & StreamingApache Spark & Streaming
Apache Spark & Streaming
 
Tuning and Debugging in Apache Spark
Tuning and Debugging in Apache SparkTuning and Debugging in Apache Spark
Tuning and Debugging in Apache Spark
 
Wayfair Use Case: The four R's of Metrics Delivery
Wayfair Use Case: The four R's of Metrics DeliveryWayfair Use Case: The four R's of Metrics Delivery
Wayfair Use Case: The four R's of Metrics Delivery
 
Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
Modus operandi of Spark Streaming - Recipes for Running your Streaming Applic...
 
Spark & Spark Streaming Internals - Nov 15 (1)
Spark & Spark Streaming Internals - Nov 15 (1)Spark & Spark Streaming Internals - Nov 15 (1)
Spark & Spark Streaming Internals - Nov 15 (1)
 
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
 
DTCC '14 Spark Runtime Internals
DTCC '14 Spark Runtime InternalsDTCC '14 Spark Runtime Internals
DTCC '14 Spark Runtime Internals
 
Apache Spark with Scala
Apache Spark with ScalaApache Spark with Scala
Apache Spark with Scala
 
SQL on everything, in memory
SQL on everything, in memorySQL on everything, in memory
SQL on everything, in memory
 
Matlab netcdf guide
Matlab netcdf guideMatlab netcdf guide
Matlab netcdf guide
 
Best Practices for Building and Deploying Data Pipelines in Apache Spark
Best Practices for Building and Deploying Data Pipelines in Apache SparkBest Practices for Building and Deploying Data Pipelines in Apache Spark
Best Practices for Building and Deploying Data Pipelines in Apache Spark
 
Updates from Cassandra Summit 2016 & SASI Indexes
Updates from Cassandra Summit 2016 & SASI IndexesUpdates from Cassandra Summit 2016 & SASI Indexes
Updates from Cassandra Summit 2016 & SASI Indexes
 
Using Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into CassandraUsing Spark to Load Oracle Data into Cassandra
Using Spark to Load Oracle Data into Cassandra
 
Apache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLabApache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLab
Apache Spark - Key-Value RDD | Big Data Hadoop Spark Tutorial | CloudxLab
 
Spark rdd vs data frame vs dataset
Spark rdd vs data frame vs datasetSpark rdd vs data frame vs dataset
Spark rdd vs data frame vs dataset
 
Don’t optimize my queries, optimize my data!
Don’t optimize my queries, optimize my data!Don’t optimize my queries, optimize my data!
Don’t optimize my queries, optimize my data!
 
Apache Spark overview
Apache Spark overviewApache Spark overview
Apache Spark overview
 
Introduction to spark
Introduction to sparkIntroduction to spark
Introduction to spark
 

Andere mochten auch

Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
Enkitec
 
Case study_mediswitch golden gate implementation
Case study_mediswitch golden gate implementationCase study_mediswitch golden gate implementation
Case study_mediswitch golden gate implementation
Ishtiaq Khan
 
OOUG: Oracle transaction locking
OOUG: Oracle transaction lockingOOUG: Oracle transaction locking
OOUG: Oracle transaction locking
Kyle Hailey
 
Oracle GoldenGate Demo and Data Integration Concepts
Oracle GoldenGate Demo and Data Integration ConceptsOracle GoldenGate Demo and Data Integration Concepts
Oracle GoldenGate Demo and Data Integration Concepts
Fumiko Yamashita
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Aaron Shilo
 

Andere mochten auch (20)

Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail Files
 
Oracle Goldengate training by Vipin Mishra
Oracle Goldengate training by Vipin Mishra Oracle Goldengate training by Vipin Mishra
Oracle Goldengate training by Vipin Mishra
 
How many ways to monitor oracle golden gate-Collaborate 14
How many ways to monitor oracle golden gate-Collaborate 14How many ways to monitor oracle golden gate-Collaborate 14
How many ways to monitor oracle golden gate-Collaborate 14
 
Extreme Replication - Performance Tuning Oracle GoldenGate
Extreme Replication - Performance Tuning Oracle GoldenGateExtreme Replication - Performance Tuning Oracle GoldenGate
Extreme Replication - Performance Tuning Oracle GoldenGate
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
 
Oracle GoldenGate
Oracle GoldenGate Oracle GoldenGate
Oracle GoldenGate
 
GoldenGate Fundamentals Student Guide Version 10.4
GoldenGate Fundamentals Student Guide Version 10.4 GoldenGate Fundamentals Student Guide Version 10.4
GoldenGate Fundamentals Student Guide Version 10.4
 
Oracle GoldenGate and Baseball - 5 Keys for Moving to the Cloud
Oracle GoldenGate and Baseball - 5 Keys for Moving to the CloudOracle GoldenGate and Baseball - 5 Keys for Moving to the Cloud
Oracle GoldenGate and Baseball - 5 Keys for Moving to the Cloud
 
Case study_mediswitch golden gate implementation
Case study_mediswitch golden gate implementationCase study_mediswitch golden gate implementation
Case study_mediswitch golden gate implementation
 
Doag data replication with oracle golden gate: Looking behind the scenes
Doag data replication with oracle golden gate: Looking behind the scenesDoag data replication with oracle golden gate: Looking behind the scenes
Doag data replication with oracle golden gate: Looking behind the scenes
 
Enable GoldenGate Monitoring with OEM 12c/JAgent
Enable GoldenGate Monitoring with OEM 12c/JAgentEnable GoldenGate Monitoring with OEM 12c/JAgent
Enable GoldenGate Monitoring with OEM 12c/JAgent
 
Oracle GoldenGate DB2 to Oracle11gR2 Configuration
Oracle GoldenGate DB2 to Oracle11gR2 ConfigurationOracle GoldenGate DB2 to Oracle11gR2 Configuration
Oracle GoldenGate DB2 to Oracle11gR2 Configuration
 
Sql DML
Sql DMLSql DML
Sql DML
 
OOUG: Oracle transaction locking
OOUG: Oracle transaction lockingOOUG: Oracle transaction locking
OOUG: Oracle transaction locking
 
Oracle GoldenGate Demo and Data Integration Concepts
Oracle GoldenGate Demo and Data Integration ConceptsOracle GoldenGate Demo and Data Integration Concepts
Oracle GoldenGate Demo and Data Integration Concepts
 
Oracle Database Performance Tuning Concept
Oracle Database Performance Tuning ConceptOracle Database Performance Tuning Concept
Oracle Database Performance Tuning Concept
 
Replacing Oracle CDC with Oracle GoldenGate
Replacing Oracle CDC with Oracle GoldenGateReplacing Oracle CDC with Oracle GoldenGate
Replacing Oracle CDC with Oracle GoldenGate
 
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR usesEarl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
 
Oracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL OptionOracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL Option
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 

Ähnlich wie Advanced goldengate training ⅰ

Oracle 12 c new-features
Oracle 12 c new-featuresOracle 12 c new-features
Oracle 12 c new-features
Navneet Upneja
 
What SQL should actually be...
What SQL should actually be...What SQL should actually be...
What SQL should actually be...
Open Academy
 
NoSQL Solutions - a comparative study
NoSQL Solutions - a comparative studyNoSQL Solutions - a comparative study
NoSQL Solutions - a comparative study
Guillaume Lefranc
 

Ähnlich wie Advanced goldengate training ⅰ (20)

SQL LECTURE.pptx
SQL LECTURE.pptxSQL LECTURE.pptx
SQL LECTURE.pptx
 
Oracle 12 c new-features
Oracle 12 c new-featuresOracle 12 c new-features
Oracle 12 c new-features
 
Spark Structured APIs
Spark Structured APIsSpark Structured APIs
Spark Structured APIs
 
Migrating data into Drupal using the migrate module
Migrating data into Drupal using the migrate moduleMigrating data into Drupal using the migrate module
Migrating data into Drupal using the migrate module
 
Replacing ActiveRecord With DataMapper
Replacing ActiveRecord With DataMapperReplacing ActiveRecord With DataMapper
Replacing ActiveRecord With DataMapper
 
Etl confessions pg conf us 2017
Etl confessions   pg conf us 2017Etl confessions   pg conf us 2017
Etl confessions pg conf us 2017
 
PL/SQL Fundamentals I
PL/SQL Fundamentals IPL/SQL Fundamentals I
PL/SQL Fundamentals I
 
Data Warehousing 101(and a video)
Data Warehousing 101(and a video)Data Warehousing 101(and a video)
Data Warehousing 101(and a video)
 
Object Oriented Programming using C++ - Part 5
Object Oriented Programming using C++ - Part 5Object Oriented Programming using C++ - Part 5
Object Oriented Programming using C++ - Part 5
 
PostgreSQL Database Slides
PostgreSQL Database SlidesPostgreSQL Database Slides
PostgreSQL Database Slides
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
Writing powerful stored procedures in PL/SQL
Writing powerful stored procedures in PL/SQLWriting powerful stored procedures in PL/SQL
Writing powerful stored procedures in PL/SQL
 
What SQL should actually be...
What SQL should actually be...What SQL should actually be...
What SQL should actually be...
 
Really Big Elephants: PostgreSQL DW
Really Big Elephants: PostgreSQL DWReally Big Elephants: PostgreSQL DW
Really Big Elephants: PostgreSQL DW
 
Introduction to mysql part 3
Introduction to mysql part 3Introduction to mysql part 3
Introduction to mysql part 3
 
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scalaAutomate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
 
Dirty Data? Clean it up! - Rocky Mountain DataCon 2016
Dirty Data? Clean it up! - Rocky Mountain DataCon 2016Dirty Data? Clean it up! - Rocky Mountain DataCon 2016
Dirty Data? Clean it up! - Rocky Mountain DataCon 2016
 
NoSQL Solutions - a comparative study
NoSQL Solutions - a comparative studyNoSQL Solutions - a comparative study
NoSQL Solutions - a comparative study
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancements
 

Advanced goldengate training ⅰ

  • 1. Advanced Goldengate Training Ⅰ www.oggers.net 2011-07-25
  • 2. Agenda □Mothod of initialize data □ Handing essential DML and DML error □ Handing Advanced DDL sync and DDL error □ Map and manipulating data □ Monitor and Troubleshooting Ⅰ
  • 3. Initialize Data If your database is huge and application transcations are still ongoing ,there is little stop-time,How should you Initialize your data? □ Use Keys + Handlecollsions □Use the commit SCN
  • 4. Handlecollsions □How does the Handlecollsions work? □ Where is the drawbacks with Handlecollsions? ● Does your tables have any primary key or unique key? ● Is there primary key update during initialization ? Suitable for your environment ? Ⅰ
  • 5. Commit SCN ♦ Commit SCN/GoldengateCSN ♦ the common initialized mothods Via SCN □ exp/imp □ expdp/impdp □ Transport Tablespace with Backupset(compare Transport Tablespace) □ Datagurd/RMAN □ Other consistent read utility Ⅰ □
  • 6. How to re-initialize a special table □ split replicat group and merge it □ Using transaction CSN Filter map hr.job, target hr.job, filter (@GETENV ("transaction", "csn") > xxx);
  • 7. Agenda □Mothod of initialize data □ Handing essential DML and DML error □ Handing Advanced DDL sync and DDL error □ Map and manipulating data □ Monitor and Troubleshooting Ⅰ
  • 8. Non-supported data types ● ANYDATA ● ANYDATASET ● ANYTYPE ● BFILE ● BINARY_INTEGER ● MLSLABEL ● PLS_INTEGER ● TIMEZONE_ABBR ● TIMEZONE_REGION ● URITYPE ● UROWID Ⅰ
  • 9. DML replication action □ Keys(Primary key/unique key/keycols) action ● why to recommend to use keys? ● How to use keycols? □supplemental non-key column action Ⅰ
  • 10. Handing DML error □ Handing replicat errors on DML operations via REPERROR Abort: roll back the transaction and stop processing Discard: log the error to the discard file and continue processing Exception: send the error for exceptions processing Ignore: ignore the error and continue processing example: reperror default,discard discardfile ./dirrpt/rep_hr.dsc,append,megabytes 100 Ⅰ
  • 11. Use multiple REPERROR statements □ handing special error-code reperror XXXX discard □ handing special object reperror default ignore exclude/include objname “hr.jobs” Ⅰ
  • 12. Use exception table REPERROR (DEFAULT, EXCEPTION) MAP hr.jobs, TARGET hr.jobs, & COLMAP (USEDEFAULTS); MAP hr.jobs, TARGET hr.jobs_exception, & EXCEPTIONSONLY, & INSERTALLRECORDS & COLMAP (USEDEFAULTS, & DML_DATE = @DATENOW(), & OPTYPE = @GETENV("LASTERR", "OPTYPE"), & ERR_NUM = @GETENV("LASTERR", "DBERRNUM"), & ERR_MSG = @GETENV("LASTERR", "DBERRMSG")); Ⅰ
  • 13. Agenda □Mothod of initialize data □ Handing essential DML and DML error □ Handing Advanced DDL sync and DDL error □ Map and manipulating data □ Monitor and Troubleshooting Ⅰ
  • 14. DDL limitations and influence □ Disable recycle bin and affect other database environment □ affect data filtering, and manipulation by the data pump (passthru/nopassthru) □affect data-definition □Others Ⅰ Must configure DDL synchronization?
  • 15. DDL Scope □ Mapped Objects that are specified in TABLE and MAP statements □ Unmapped Objects that are not specified in TABLE and MAP statements □Other scope DDL operations that cannot be mapped are of OTHER scope,justlike the follow operations: create user,grantrole,createtablespace ,alter datafile … Ⅰ
  • 16. DDL Filter ● exclude/include ● mapped/unmapped/other/all filter scope ● opttype/objtype/objname filter special ddl action and object ● instr/instrwors filter via matching Ⅰ ddl & include mapped exclude objtype'table‘ objname"hr.jobs", & exclude INSTRWORDS 'alter add “city"', & include unmapped, objname "hr3.jobs", & include other
  • 17. DDL DDLSUBST ● When may we use DDLSUBST like as the objects on source and target have the different tablespace like as the datafile on source and tarhet have different destination --------- DDLSUBST 'users' with 'system' include mapped objtype ‘table’ INSTRWORDS 'create table tablespace "users"' Ⅰ Notice: Must be careful and the best way is to restrict the DDL statement via DDL inclusion and exclusion options Take care of ddl matching via instr, it’s strict matching, including space character, carriage-return character
  • 18. derived object □ Notice the derived object action ● Rename ● CTAS ● Index ● Trigger □ mapderived/ nomapderived Ⅰ
  • 19. DDL Other Topic □ Sequence can the sequence really be synchronized before V11.1.1.1.0? □ Password □ Add supplemental log groups ddloptionsaddtrandataretryop Ⅰ
  • 20. Use multiple DDLERROR statements □ handing special error-code ddlerror XXXX discard □ handing special object ddlerror default ignore include OBJTYPE TABLE OBJNAME “hr1.*” Ⅰ
  • 21. Agenda □Mothod of initialize data □Handing essential DML and DML error □ Handing Advanced DDL sync and DDL error □ Map and manipulating data □ Monitor and Troubleshooting Ⅰ
  • 22. Select Rows □Method of select rows ● Filter select rows based on a numeric value by using basic operators or one or more GoldenGate column-conversion functions MAP hr.jobs,TARGET hr.jobs, FILTER (ON INSERT, job_id > 1000); ● Where select rows based on a conditional statement MAP hr.jobs,TARGET hr.jobs, where (job_name=@presentand= “Jerry”); Ⅰ
  • 23. Map Columns □COLMAP map table-level column map hr.jobs, target hr.jobs_add,& colmap (usedefaults,totol_salary=salary*days); □COLMATCH map between similarly structured tables that have different column names for the same sets of data colmatch suffix _s map hr.jobs, target hr.jobs, colmap(usedefaults); The column named Job_id on source is named Job_id_s on target Ⅰ
  • 24. Data-definationsfile □data-definations file It’s used to synchronize source and target tables that have dissimilar data definitions ● DEFGEN the tool is used to create a data-definations file defgenparamfiledirprm/defgen.prm ● SOURCEDEFS Specifies a file that contains source data definitions created by the DEFGEN utility Ⅰ
  • 25. Convert DML operations □ select dml type ● GETUPDATES | IGNOREUPDATES ● GETDELETES | IGNOREDELETES ● GETINSERTS | IGNOREINSERTS □ convert dml type ● INSERTALLRECORDS ● INSERTUPDATES ● INSERTDELETES ● UPDATEDELETES Ⅰ
  • 26. Obtain transaction info □ the useful of transaction info □ Function GETENV (“TRANSACTION”, “<return value>”) GETENV (“GGHEADER”, “<return value>”) map hr.jobs, target hr.jobs,& colmap & ( & usedefaults,& Op_type = @GETENV (“GGHEADER”, “OPTYPE”),& Indicator = @GETENV (“GGHEADER”, “BEFOREAFTERINDICATOR”), & commit_ts= @GETENV (“GGHEADER”, “COMMITTIMESTAMP”) & ) Ⅰ