UKOUG DBMS SIG 17.7.07www.go-faster.co.uk1 Materialized Views: Simple Replication? David Kurtz Go-Faster Consultancy Ltd.

Slides:



Advertisements
Similar presentations
Oracle to MySQL Database Migration SQLWays - Migration Software Presentation Copyright (c) Ispirer Systems Ltd. All Rights Reserved.
Advertisements

B3: Putting OpenEdge Auditing to Work: Dump and Load with (Almost) No Downtime David EDDY Senior Solution Consultant.
Refreshing Materialized Views
© Copyright 2010 Lead Paint Safety Association
HR7.5 Department Security Tree Tuning
1 SQL Best Coding Practice in PeopleTools 7.x David Kurtz Go-Faster Consultancy Ltd.
1 SQL Best Coding Practice in PeopleTools 7.x David Kurtz Go-Faster Consultancy Ltd.
What the Search Engines are up to Now: same ingredients different recipes Karen Blakeman RBA Information Services, UK 02 June 20141Karen Blakeman
PeopleSoft Ping David Kurtz
9 Copyright © 2004, Oracle. All rights reserved. Using DDL Statements to Create and Manage Tables.
Partition, Compress, Archive and Purge Keep Your System on the Road David Kurtz Go-Faster Consultancy Ltd.
Oracle Materialized Views for Replication COUG Presentation, Feb 20, 2014 Jane Lamont,
Go-Faster Consultancy Ltd.1 Experiences of Global Temporary Tables in Oracle 8.1 David Kurtz Go-Faster Consultancy Ltd.
1 Further Experiences of Global Temporary Tables in Oracle 8.1 David Kurtz Go-Faster Consultancy Ltd.
Data Definition Language (DDL)
Chapter 10: Designing Databases
BY LECTURER/ AISHA DAWOOD DW Lab # 3 Overview of Extraction, Transformation, and Loading.
© 2001 empolis UK1 Topic Maps, NewsML and XML: Possible Integration and Implementations. By Soelwin Oo.
Pitching for finance Social Enterprise North West February 2014.
Good Salespeople johnpc ltd: John Cunningham.
Graphing AWR Data in Excel
Collaborate08 PeopleTools 8.48/9© PeopleTools 8.48/8.49 New Database Features David Kurtz Go-Faster Consultancy Ltd.
Global Payroll Performance Optimisation - I David Kurtz Go-Faster Consultancy Ltd.
PIA Load Balancing, JVMs and Garbage Collection David Kurtz Go-Faster Consultancy Ltd.
TURKISH STATISTICAL INSTITUTE 1 /34 SQL FUNDEMANTALS (Muscat, Oman)
An introduction to SQL*Trace, TKPROF and Execution Plans
Manipulating Data Schedule: Timing Topic 60 minutes Lecture
1 Tuning with Oracle’s SQL Trace David Kurtz Go-Faster Consultancy Ltd.
Row Migration can Aggravate Contention on Cache Buffer Chains Latch David Kurtz Go-Faster Consultancy Ltd.
9 Copyright © 2004, Oracle. All rights reserved. Managing Data.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Data Replication with Materialized Views ISYS 650.
Cs3431 Transactions, Logging and Security. cs3431 Transactions: What and Why? A set of operations on a database must appear as one “unit”. Example: Consider.
Introduction to Structured Query Language (SQL)
CERN IT Department CH-1211 Genève 23 Switzerland t Streams new features in 11g Zbigniew Baranowski.
ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.
IST Databases and DBMSs Todd S. Bacastow January 2005.
IMS 4212: Distributed Databases 1 Dr. Lawrence West, Management Dept., University of Central Florida Distributed Databases Business needs.
44220: Database Design & Implementation Logical Data Modelling Ian Perry Room: C48 Tel Ext.: 7287
An Investigation of Oracle and SQL Server with respect to Integrity, and SQL Language standards Presented by: Paul Tarwireyi Supervisor: John Ebden Date:
SQL data definition using Oracle1 SQL Data Definition using Oracle.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
Data: Migrating, Distributing and Audit Tracking Michelle Ayers, Advisory Solution Consultant
Unicode Oddity. from a Unicode PeopleSoft Database SELECT emplid, name, LENGTH(name), BLENGTH(name) FROMps_personal_data WHEREemplid = '007’ ; EMPLID.
SQL Server 7.0 Maintaining Referential Integrity.
SQL data definition using Oracle1 SQL Data Definition using Oracle.
Databases and Statistical Databases Session 4 Mark Viney Australian Bureau of Statistics 5 June 2007.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
FORUM II Best Practices in Data Warehousing in Higher Education: A Framework for Higher Education Reporting April 18, 2005 Slide 1 Cornell University’s.
1 Structured Query Language (SQL). 2 Contents SQL – I SQL – II SQL – III SQL – IV.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Oracle Database 10 g Time Navigation: Human-Error Correction Magnus Lubeck DBA/Systems Analyst CERN, IT-DB Group Session id: Tammy Bednar Sr. Product.
Views In some cases, it is not desirable for all users to see the entire logical model (that is, all the actual relations stored in the database.) In some.
6 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.
A Guide to SQL, Eighth Edition Chapter Six Updating Data.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
HyperKVS Group Meeting Oracle Streams Dr. Volker Kuhr.
RDS Administration & Security Session #396 Monday, 3/17/ :45am HEUG 2003 Conference - Dallas.
Chapter 3: Relational Databases
Chapter 15 Materialized Views.
1 11g NEW FEATURES ByVIJAY. 2 AGENDA  RESULT CACHE  INVISIBLE INDEXES  READ ONLY TABLES  DDL WAIT OPTION  ADDING COLUMN TO A TABLE WITH DEFAULT VALUE.
uses of DB systems DB environment DB structure Codd’s rules current common RDBMs implementations.
Explore engage elevate Data Migration Without Tears Mike Feingold Empoint Ltd Tuesday 10th November 2015.
8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
7 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects.
Purpose, Pitfalls and Performance Implications
Purpose, Pitfalls and Performance Implications
Chapter 11 Managing Databases with SQL Server 2000
Presentation transcript:

UKOUG DBMS SIG www.go-faster.co.uk1 Materialized Views: Simple Replication? David Kurtz Go-Faster Consultancy Ltd.

UKOUG DBMS SIG www.go-faster.co.uk2 Oracle Database Specialist –Independent consultant System Performance tuning –PeopleSoft ERP –Oracle RDBMS UK Oracle User Group –PeopleSoft Director Book – Who Am I?

UKOUG DBMS SIG www.go-faster.co.uk3 Agenda Simple Replication using Materialized Views –Database Links –Limitations Aspects of the application (PeopleSoft) Workarounds

UKOUG DBMS SIG www.go-faster.co.uk4 Resources If you can’t hear me say so now. Please feel free to ask questions as we go along. The presentation will be available from – in the librarywww.ukoug.org –

UKOUG DBMS SIG www.go-faster.co.uk5 Initial Scenario HRMS CRMEPM Assentia l Data Stage

UKOUG DBMS SIG www.go-faster.co.uk6 Initial Scenario Extract from HR and CRM to EPM –Via Assential Data Stage Table by Table replication by SQL Capability to transform data Limited Capability to handle long columns –Performance Bottleneck Taking too much of batch window which was needed for other batch processing

UKOUG DBMS SIG www.go-faster.co.uk7 Materialized Views – v- Streams Materialized Views –Used to be called snapshots –Old stable technology –Database links between databases –Also used for query rewrite Not discussed in this presentation Streams –Introduced 9i –Supplemental logging shipped to target database. –No support for Longs in Oracle 9i PeopleTools 8.45 Lots of LONG columns

UKOUG DBMS SIG www.go-faster.co.uk8 The Plan Eliminate Assential (as far as possible) –Some complex transitions remain –Implement incremental refresh for all MVs Incremental refresh every midnight

UKOUG DBMS SIG www.go-faster.co.uk9 Problem 1: Long Columns Long Columns –Assential works in blocks of 2000 characters We discovered truncated data in long columns –Replicate up to 32Kb with MVs workaround to go across DB links. –Oracle 10g Streams would provide a total solution.

UKOUG DBMS SIG www.go-faster.co.uk10 Problem 2:Primary Keys PeopleSoft doesn’t use database enforced Referential Integrity –No primary keys, only unique constraints Can usually add primary key constraints using existing unique indexes –Can get Nullable date columns in unique key Can’t add a primary key constraint

UKOUG DBMS SIG www.go-faster.co.uk11 MVs Source Table MVL Target MV Target MV Refresh

UKOUG DBMS SIG www.go-faster.co.uk12 MV Replication Choice No Primary Key –ROWID based replication –No inherited indexes or keys –You may need to create unique indexes on MV –What happens if you reorganise the table? Primary Key –Replication by primary key –MVs and MV logs inherit primary keys –Effect of Truncate command?

UKOUG DBMS SIG www.go-faster.co.uk13 Effect of TRUNCATE Primary Key replication –Rows not removed from MV by fast refresh –No error raised –Need to do complete refresh Demo mv1.sqlmv1.sql ROWID replication –ORA during fast refresh –materialized view log on younger than last refresh –Need to do complete refresh. Demo mv2.sqlmv2.sql

UKOUG DBMS SIG www.go-faster.co.uk14 MVs with Long Columns Source Table MVL Target MV Target MV Long Table Long Table View MV Refresh Trigger

UKOUG DBMS SIG www.go-faster.co.uk15 MVs with Long Columns This solution would occasionally lock up –Distributed Xaction Lock Visible in DBA_WAITERS –Unrelated statements –Every 2 or 3 weeks –Never reproduced outside production system –Kill a session created by the MV refresh process

UKOUG DBMS SIG www.go-faster.co.uk16 Distributed Transaction Lock MV Refresh Process SELECT /*+ */ "A2"."APPLID", "A2"."APP_DT", "A2"."APPLIC_PURGE_DT",... "A2".“XX_PRIOR_RECR", "A2"."JOB_CAT", "A2".“XX_GRAD_OR_STANDRD" FROM "SYSADM"."PS_APPLICANT_DATA" "A2", (SELECT /*+ */ DISTINCT "A3"."APPLID" "APPLID", "A3"."APP_DT" "APP_DT“ FROM "SYSADM"."MLOG$_PS_APPLICANT_D ATA" "A3" WHERE "A3"."SNAPTIME$$" > :1 AND "A3"."DMLTYPE$$" <> :"SYS_B_0") "A1" WHERE "A2"."APPLID" = "A1"."APPLID" AND "A2"."APP_DT" = "A1"."APP_DT" Long Query in Trigger SELECT "A1"."COMMENTS" FROM "SYSADM"."PS_ABS_HIST_DET" "A1" WHERE "A1"."EMPLID" = :b5 AND "A1"."EMPL_RCD" = :b4 AND "A1"."BEGIN_DT" = :b3 AND "A1"."ABSENCE_TYPE" = :b2 AND "A1"."COMMENT_DT" = :b1

UKOUG DBMS SIG www.go-faster.co.uk17 Distributed Transaction Lock When Oracle performs a distributed SQL statement it reserves an entry in the rollback segment for the 2-phase commit processing. The entry is held until the statement is committed, even if the statement is a query. The commit in the MV refresh does not release it –So we put query of long into autonomous transaction in a PL/SQL packaged function

UKOUG DBMS SIG www.go-faster.co.uk18 Irony We never tested the fix to the locking problem –Interim workaround was simply not to replicate long columns Disabled trigger on MV –Change in customer personnel removed need to replicate long columns

UKOUG DBMS SIG www.go-faster.co.uk19 More Irony Can replace LONGs with BLOBs and CLOBs in PeopleTools 8.48 –Default in HR and Financials 9.0 –Most people moving to this release on Oracle RDBMS are also moving to Oracle 10g –In Oracle 10g, I would probably have chosen to implement Streams.

UKOUG DBMS SIG www.go-faster.co.uk20 Questions?