SlideShare a Scribd company logo
1 of 40
A M I N A D A T I A
K N O W T E C H S O L U T I O N S I N C .
W O R K I N G W I T H
O R A C L E S I N C E 1 9 8 5
E X A D A T A S I N C E 2 0 1 1
F O C U S
C U S T O M A P P L I C A T I O N D E V E L O P M E N T
Migrate to Exadata X3
Tips and Tricks
Level 3, San Polo 3403, Session 326
Thu, Apr 10, 2014 (12:15 PM - 12:45 PM)
Contact Details
 eMail => amin@knowtech.ca
 Twitter => aminadatia
 LinkedIn
 Data Architecture Professionals
 Oracle Exadata (IOUG SIG)
 Oracle Exadata Users
 Oracle User Groups
 IOUG
 ODTUG
Agenda
 Background
 Source and Target Environments
 Migration Constraints
 Data Migration Techniques
 Approach
 Non Partitioned Tables
 Partitioned Tables
 Without LOB Columns
 With LOB Columns
 Sub-Partition by Hash Tables
 Oracle Text Indexes without using TTS
 Oracle Label Security without Custom Label Tags
Environments
 SOURCE
 Oracle 10.2.0.4
 AIX
 2 Node RAC
 48 CPU per Node
 Target
 Oracle 11.2.0.3
 Exadata X3
 8 Node RAC
 32 CPU per Node
 RAM
 Patchset
 CellPatch
Downtime Constraints
 Users mostly query for the past 240 Partitions
 Some queries span 1200 Partitions
 Plan for
 480 Partitions loaded before users allowed access and ETL
loading to resume
 Estimated time was 5 hours and so 6 hours was allocated for
cold migration
 Not much prospect to drop indexes and recreate
 ETL was done for 3 days prior to migration
 Having NO INDEXES resulted in zero ETL
 At the end of the downtime => ETL would start
Source AIX Environment
 Tablespaces => 450 (9.8 TB Disk Used)
 Table Partitions distributed across all Tablespaces
 Tables (for Migration)
 Partitioned => 33 (~ 2500 Partitions/Table)
 Non Partitioned => 65 (2 Large Number of Rows)
 Oracle Text Indexes => 4
 Tables with LOBs => 4 (CLOB and BLOB)
 Oracle Label Security => ~ 280 Labels
 Network Link => 1 MBit and 10 MBit
Target X3 Environment
 Tablespaces => Same as Source
 Oracle Label Security
 Create Policy
 Create Labels and Tags
 Map New Tags to Old Tags
 Oracle Text
 Define Preferences
 Schema Definitions
 Export from Source with Rows = N
 Import into Target
Target X3 Environment
Going from Test (X2) to Production (X3)
 DataPump had a bug => Extremely Slow
 Revert to using 10g EXP
 Virtual Columns Not Recognized
 Schema Definitions (3)
 Export from X2 with (Rows = N)
 Create Oracle Text Preferences
 Create OLS Policy
 Import into X3
 Recreate Objects with Virtual Columns
Non Partitioned Tables
Non Partitioned Tables … 1
All commands Issued from Exadata
INSERT INTO <Table_Name>
SELECT /*+ PARALLEL (T1,p_Degreee) */
FROM <Source_Table>@DbLink_Pipe T1
PX Elapsed Time
12 57 minutes
24 35 minutes
W I T H N O L O B C O L U M N S
W I T H L O B C O L U M N S
S U B - P A R T I T I O N B Y H A S H A N D L O B C O L U M N
Partitioned Tables
Partitioned Tables Outcome
Hours
Table
W I T H N O L O B C O L U M N S
Partitioned Tables (No LOBs)
Partitioned Table (No LOBs) ..1
v_Step := 'Create => '||v_Q_Table||' => '||p_Table_Name;
EXECUTE IMMEDIATE
'create table '||v_Q_Table
||chr(10)||'TABLESPACE '||v_Tablespace_Name
||chr(10)||'NOLOGGING'
||chr(10)||'as select'
||chr(10)||' /*+'
||chr(10)||' parallel (a,'||p_Parallel_Source||')'
||chr(10)||' no_index ('||p_No_Index_Hint||')'
||chr(10)||' */'
||chr(10)||' * from '||p_Table_Name||'@'||p_Data_Source||' a'
||chr(10)||'where a.PartKey
||chr(10)||’ BETWEEN p_Start_Number - '||p_Offset_Start
||chr(10)||' AND p_Start_Number - '||p_Offset_End;
Partitioned Table (No LOBs) ..2
v_Step := 'Gather Stats => '||v_Q_Table;
v_Step := ‘Exchange Working Table for Partition';  If RECORDS > 0
Insert Data from Q_Table into Working Table based on Partition_Key.
v_Step := 'Create Matching Partition Indexes';
Create Index on Working Table
Exchange Working Table with Partition
Partitioned Table (No LOBs) .. 3
EXECUTE IMMEDIATE
'ALTER TABLE '||p_Table_Name
||chr(10)||' EXCHANGE PARTITION‘
||v_Partition_Name
||chr(10)||' WITH TABLE '
||v_Working_Table
||chr(10)||' INCLUDING INDEXES'
||chr(10)||' WITHOUT VALIDATION'
||chr(10)||' UPDATE GLOBAL INDEXES';
Partitioned Table (No LOBs) … 4
Parallel at Source => 2,4,8,12,24
depending on the amount of data
how many jobs were still running
Parallel at Target => usually 8
After 4 hours Resources on AIX were diverted to deal
to Tables with LOB Columns
T A B L E S W I T H L O B C O L U M N S
Partition Tables (LOBs)
Partitioned Table (LOBs) ..1
 Parallel at Source => 1,2,4,8,16,24,32
 Eventually found out that PX = 1 was best
 By the time we figured out the solution only
one table was left to do
 Submitted 45 jobs on each source node
 using parallel = 1 at source
 Each job took about 15 minutes
Partitioned Table (LOBs) ..2
Partitioned Table (LOBs) ..3
v_Begin INTEGER := 210;
BEGIN
FOR I in 1..45
LOOP
v_Start := v_Begin + (I - 1);
v_End := v_Start;
v_Job_Name := 'M_B1_'||v_Start||'_'||v_End;
v_Job_Action :=
'BEGIN'
||chr(10)
||'MIGRATION.DIRECT_EXCHANGE(''‘
||p_Partition_LOB_Table
||'''',12,''a'',1,8,'
||v_Start||','||v_End||','''||v_Source||''');'
||chr(10)||'END;';
Partitioned Table (LOBs) ..4
BEGIN
DBMS_SCHEDULER.CREATE_JOB
( job_name => v_Job_Name
,job_type => 'PLSQL_BLOCK'
,job_action => v_Job_Action
,start_date => SYSTIMESTAMP
,enabled => TRUE
);
DBMS_SCHEDULER.SET_ATTRIBUTE
( name => v_Job_Name
,attribute => 'instance_stickiness'
,value => FALSE
);
END;
END LOOP;
Partition Exchange
Partition Exchange .. 2
 Worked fine except for continuous ETL …
 TABLE gets LOCKED for the EXCHANGE
 If the duration was “small” (less than 2 minutes)
then there was not a noticeable impact on the
ETL process
 32 SubPartition Exchange approach did not work
well
Migration Summary
Object Type Estimate
Partitions
Completed/Total
Actual
Partitions within
6 Hour Downtime
Actual Time
Non Partitioned Tables (65) 30 minutes 12 minutes
Partitioned Tables
Non LOB Columns (30)
480/2500 26 Tables
completed
1 Table 880
2 Tables 440
1 Table 200
8 Hours
11 Hours
20 Hours
Partitioned Tables
CLOB Column Tables (2 Tables)
1 Table 480/2500
1 Table 40/1800
1000
160
11 Hours
15 Hours
Sub Partitioned (32) Table
BLOB Column
28/1200 16 8 Days!!
Sub Partition Exchange
Sub Partition Exchange .. 1
 Table with
 Range Partition on two columns
 32 Sub Partitions by Hash on third column
 Getting the Hash Value and finding the subpartition
seemed to slow down the exchange
 Simple insert from Exchange Table also had the
same kind of issue. Worse than Sub Partition
Exchange
 Insert using Sorted by
(ORA_HASH(HashKey,31,0)+1) significantly
improved performance
Sub Partition Exchange .. 2
INSERT INTO HASH_LOB_TABLE
SELECT /*+ NO_INDEX(A) */
* FROM Q_TABLE A
ORDER BY
A.PartKey_Keep
,(ORA_HASH(A.<hashkey>,31,0) + 1);
Sub Partition Exchange … 3
Time per Record
Not much good for
Simultaneous ETL
Sub Partition Exchange … 4
Relative Insert Time/ Record
W I T H O U T T R A N S P O R T A B L E T A B L E S P A C E S
Oracle Text Index
Oracle Text Environment
 Tables with Text Indexes
 Multi-lingual Documents stored on File System (2 Tables)
 Generated XML from Data (2 Tables)
 Transportable Tablespaces Method for migrating
was estimated to take 20 days
 New data could not be loaded until TTS was
completed
Document Indexing
 Using High Degree Parallel (32,64,96)
 One Partition Data could be indexed in about 30 – 60 minutes
 This was less than the time it took to move the files to the new
file system
 Indexing routine checked the status of the file move
 Indexing Started when File move was completed
 For Highlighting Search Items, the Text Query goes
against the Text Document stored on the file system
and so the files needed to be moved
Sync Indexing
 Using CTX_USER_PENDING to get the Partition to be
SYNCed did not work well => 18 minutes to return
Partition Names
 Write a View => Less than 1 second
 CTXSYS.DR$PENDING (Parallel 2)
 CTXSYS.DR$INDEX
 CTXSYS.DR$INDEX_PARTITION (Parallel 2)
 Loop through Partitions found “PENDING”
 Job runs every 10 seconds
 Parallel Degree usually
 Text 8 (used 16,24,32,64)
 XML 16 (used 4,8,16,24,32,64,96)
Optimize Indexing
 SYNC_INDEX is with Parallel (4,8,16,32,64,96)
 OPTIMIZE_INDEX – Parallel 1
 SYNC_INDEX get Locked out
 CTX_DDL.LOCK_NOWAIT did not resolve the problem
 Optimize done via DBMS_SCHEDULER Job
 Wrote View to exclude Partitions from SYNC_INDEX
which were part of the Optimize Index Job
 Optimize done on Previous Partitions and it takes about
3 Hours to gain 60% - 85% tokens reduction
 Impact on Switch Log Frequency (+ 100/hour)
XML Document Indexing
 Using High Degree Parallel (16,32,64)
 One Partition Data could be indexed in about 30 minutes
 This was about the time it took to generate the XML
 XML generation could only be done once the underlying tables
had the data migrated
 Build XML routine checked for all the data tables for
the day had been migrated
 Indexing routine checked the status of the XML
Build
 Indexing Started when XML Build was completed
W I T H O U T C U S T O M L A B E L T A G S
Oracle Label Security
Setup OLS Metadata
 Create Label Policy
 Create Labels from Source
 Define Mapping between OLD => NEW Tags
 Use CASE/DECODE to convert during Migration of
Table
 WHEN <Label_Tag> = Old Value THEN <New-Label_Tag>
 ELSE <not_matched_tag>
 Issues =>
 Updating Label_Tag after activating OLS on the Table was
painstakingly slow
Questions??
E N J O Y T H E R E S T O F T H E C O N F E R E N C E
Thank you!!

More Related Content

What's hot

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...Spark Summit
 
Gelly in Apache Flink Bay Area Meetup
Gelly in Apache Flink Bay Area MeetupGelly in Apache Flink Bay Area Meetup
Gelly in Apache Flink Bay Area MeetupVasia Kalavri
 
Flink Forward Europe 2019 - Berlin
Flink Forward Europe 2019 - BerlinFlink Forward Europe 2019 - Berlin
Flink Forward Europe 2019 - BerlinDavid Morin
 
OVH-Change Data Capture in production with Apache Flink - Meetup Rennes 2019-...
OVH-Change Data Capture in production with Apache Flink - Meetup Rennes 2019-...OVH-Change Data Capture in production with Apache Flink - Meetup Rennes 2019-...
OVH-Change Data Capture in production with Apache Flink - Meetup Rennes 2019-...Yann Pauly
 
Tuning and Debugging in Apache Spark
Tuning and Debugging in Apache SparkTuning and Debugging in Apache Spark
Tuning and Debugging in Apache SparkPatrick Wendell
 
Using Spark's RDD APIs for complex, custom applications
Using Spark's RDD APIs for complex, custom applicationsUsing Spark's RDD APIs for complex, custom applications
Using Spark's RDD APIs for complex, custom applicationsTejas Patil
 
Sasi, cassandra on the full text search ride At Voxxed Day Belgrade 2016
Sasi, cassandra on the full text search ride At  Voxxed Day Belgrade 2016Sasi, cassandra on the full text search ride At  Voxxed Day Belgrade 2016
Sasi, cassandra on the full text search ride At Voxxed Day Belgrade 2016Duyhai Doan
 
Streaming SQL Foundations: Why I ❤ Streams+Tables
Streaming SQL Foundations: Why I ❤ Streams+TablesStreaming SQL Foundations: Why I ❤ Streams+Tables
Streaming SQL Foundations: Why I ❤ Streams+TablesC4Media
 
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018Codemotion
 
Michael Häusler – Everyday flink
Michael Häusler – Everyday flinkMichael Häusler – Everyday flink
Michael Häusler – Everyday flinkFlink Forward
 
Spark Cassandra 2016
Spark Cassandra 2016Spark Cassandra 2016
Spark Cassandra 2016Duyhai Doan
 
Apache Spark for Library Developers with William Benton and Erik Erlandson
 Apache Spark for Library Developers with William Benton and Erik Erlandson Apache Spark for Library Developers with William Benton and Erik Erlandson
Apache Spark for Library Developers with William Benton and Erik ErlandsonDatabricks
 
Asymmetry in Large-Scale Graph Analysis, Explained
Asymmetry in Large-Scale Graph Analysis, ExplainedAsymmetry in Large-Scale Graph Analysis, Explained
Asymmetry in Large-Scale Graph Analysis, ExplainedVasia Kalavri
 

What's hot (20)

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...
 
Gelly in Apache Flink Bay Area Meetup
Gelly in Apache Flink Bay Area MeetupGelly in Apache Flink Bay Area Meetup
Gelly in Apache Flink Bay Area Meetup
 
Flink Forward Europe 2019 - Berlin
Flink Forward Europe 2019 - BerlinFlink Forward Europe 2019 - Berlin
Flink Forward Europe 2019 - Berlin
 
Apache spark Intro
Apache spark IntroApache spark Intro
Apache spark Intro
 
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي   R program د.هديل القفيديمحاضرة برنامج التحليل الكمي   R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
 
OVH-Change Data Capture in production with Apache Flink - Meetup Rennes 2019-...
OVH-Change Data Capture in production with Apache Flink - Meetup Rennes 2019-...OVH-Change Data Capture in production with Apache Flink - Meetup Rennes 2019-...
OVH-Change Data Capture in production with Apache Flink - Meetup Rennes 2019-...
 
Tuning and Debugging in Apache Spark
Tuning and Debugging in Apache SparkTuning and Debugging in Apache Spark
Tuning and Debugging in Apache Spark
 
Using Spark's RDD APIs for complex, custom applications
Using Spark's RDD APIs for complex, custom applicationsUsing Spark's RDD APIs for complex, custom applications
Using Spark's RDD APIs for complex, custom applications
 
Getting Started with R
Getting Started with RGetting Started with R
Getting Started with R
 
Sasi, cassandra on the full text search ride At Voxxed Day Belgrade 2016
Sasi, cassandra on the full text search ride At  Voxxed Day Belgrade 2016Sasi, cassandra on the full text search ride At  Voxxed Day Belgrade 2016
Sasi, cassandra on the full text search ride At Voxxed Day Belgrade 2016
 
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي   R program د.هديل القفيديمحاضرة برنامج التحليل الكمي   R program د.هديل القفيدي
محاضرة برنامج التحليل الكمي R program د.هديل القفيدي
 
TiReX: Tiled Regular eXpression matching architecture
TiReX: Tiled Regular eXpression matching architectureTiReX: Tiled Regular eXpression matching architecture
TiReX: Tiled Regular eXpression matching architecture
 
Streaming SQL Foundations: Why I ❤ Streams+Tables
Streaming SQL Foundations: Why I ❤ Streams+TablesStreaming SQL Foundations: Why I ❤ Streams+Tables
Streaming SQL Foundations: Why I ❤ Streams+Tables
 
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018
Managing your Black Friday Logs - Antonio Bonuccelli - Codemotion Rome 2018
 
Michael Häusler – Everyday flink
Michael Häusler – Everyday flinkMichael Häusler – Everyday flink
Michael Häusler – Everyday flink
 
Spark Cassandra 2016
Spark Cassandra 2016Spark Cassandra 2016
Spark Cassandra 2016
 
Apache Spark for Library Developers with William Benton and Erik Erlandson
 Apache Spark for Library Developers with William Benton and Erik Erlandson Apache Spark for Library Developers with William Benton and Erik Erlandson
Apache Spark for Library Developers with William Benton and Erik Erlandson
 
Asymmetry in Large-Scale Graph Analysis, Explained
Asymmetry in Large-Scale Graph Analysis, ExplainedAsymmetry in Large-Scale Graph Analysis, Explained
Asymmetry in Large-Scale Graph Analysis, Explained
 
R Introduction
R IntroductionR Introduction
R Introduction
 
From Trill to Quill and Beyond
From Trill to Quill and BeyondFrom Trill to Quill and Beyond
From Trill to Quill and Beyond
 

Similar to Migrate 10TB to Exadata Tips and Tricks (Presentation)

L1 - Recap.pdf
L1 - Recap.pdfL1 - Recap.pdf
L1 - Recap.pdfIfat Nix
 
The life of a query (oracle edition)
The life of a query (oracle edition)The life of a query (oracle edition)
The life of a query (oracle edition)maclean liu
 
Most useful queries
Most useful queriesMost useful queries
Most useful queriesSam Depp
 
Data-and-Compute-Intensive processing Use Case: Lucene Domain Index
Data-and-Compute-Intensive processing Use Case: Lucene Domain IndexData-and-Compute-Intensive processing Use Case: Lucene Domain Index
Data-and-Compute-Intensive processing Use Case: Lucene Domain IndexMarcelo Ochoa
 
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...Citus Data
 
SQL commands in database management system
SQL commands in database management systemSQL commands in database management system
SQL commands in database management systemDarkstorm8
 
Data Warehousing with Amazon Redshift
Data Warehousing with Amazon RedshiftData Warehousing with Amazon Redshift
Data Warehousing with Amazon RedshiftAmazon Web Services
 
19. algorithms and-complexity
19. algorithms and-complexity19. algorithms and-complexity
19. algorithms and-complexityshowkat27
 
Db2 migration -_tips,_tricks,_and_pitfalls
Db2 migration -_tips,_tricks,_and_pitfallsDb2 migration -_tips,_tricks,_and_pitfalls
Db2 migration -_tips,_tricks,_and_pitfallssam2sung2
 
Scaling an invoicing SaaS from zero to over 350k customers
Scaling an invoicing SaaS from zero to over 350k customersScaling an invoicing SaaS from zero to over 350k customers
Scaling an invoicing SaaS from zero to over 350k customersSpeck&Tech
 
从 Oracle 合并到 my sql npr 实例分析
从 Oracle 合并到 my sql   npr 实例分析从 Oracle 合并到 my sql   npr 实例分析
从 Oracle 合并到 my sql npr 实例分析YUCHENG HU
 
Python tutorialfeb152012
Python tutorialfeb152012Python tutorialfeb152012
Python tutorialfeb152012Shani729
 
[Www.pkbulk.blogspot.com]dbms13
[Www.pkbulk.blogspot.com]dbms13[Www.pkbulk.blogspot.com]dbms13
[Www.pkbulk.blogspot.com]dbms13AnusAhmad
 
9.Sorting & Searching
9.Sorting & Searching9.Sorting & Searching
9.Sorting & SearchingMandeep Singh
 
Data Warehousing in the Era of Big Data
Data Warehousing in the Era of Big DataData Warehousing in the Era of Big Data
Data Warehousing in the Era of Big DataAmazon Web Services
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architectureAjeet Singh
 

Similar to Migrate 10TB to Exadata Tips and Tricks (Presentation) (20)

L1 - Recap.pdf
L1 - Recap.pdfL1 - Recap.pdf
L1 - Recap.pdf
 
The life of a query (oracle edition)
The life of a query (oracle edition)The life of a query (oracle edition)
The life of a query (oracle edition)
 
Most useful queries
Most useful queriesMost useful queries
Most useful queries
 
Data-and-Compute-Intensive processing Use Case: Lucene Domain Index
Data-and-Compute-Intensive processing Use Case: Lucene Domain IndexData-and-Compute-Intensive processing Use Case: Lucene Domain Index
Data-and-Compute-Intensive processing Use Case: Lucene Domain Index
 
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...
 
Deep Dive on Amazon Redshift
Deep Dive on Amazon RedshiftDeep Dive on Amazon Redshift
Deep Dive on Amazon Redshift
 
SQL commands in database management system
SQL commands in database management systemSQL commands in database management system
SQL commands in database management system
 
Data Warehousing with Amazon Redshift
Data Warehousing with Amazon RedshiftData Warehousing with Amazon Redshift
Data Warehousing with Amazon Redshift
 
19. algorithms and-complexity
19. algorithms and-complexity19. algorithms and-complexity
19. algorithms and-complexity
 
Db2 migration -_tips,_tricks,_and_pitfalls
Db2 migration -_tips,_tricks,_and_pitfallsDb2 migration -_tips,_tricks,_and_pitfalls
Db2 migration -_tips,_tricks,_and_pitfalls
 
Scaling an invoicing SaaS from zero to over 350k customers
Scaling an invoicing SaaS from zero to over 350k customersScaling an invoicing SaaS from zero to over 350k customers
Scaling an invoicing SaaS from zero to over 350k customers
 
Deep Dive on Amazon Redshift
Deep Dive on Amazon RedshiftDeep Dive on Amazon Redshift
Deep Dive on Amazon Redshift
 
从 Oracle 合并到 my sql npr 实例分析
从 Oracle 合并到 my sql   npr 实例分析从 Oracle 合并到 my sql   npr 实例分析
从 Oracle 合并到 my sql npr 实例分析
 
Python tutorialfeb152012
Python tutorialfeb152012Python tutorialfeb152012
Python tutorialfeb152012
 
[Www.pkbulk.blogspot.com]dbms13
[Www.pkbulk.blogspot.com]dbms13[Www.pkbulk.blogspot.com]dbms13
[Www.pkbulk.blogspot.com]dbms13
 
9.Sorting & Searching
9.Sorting & Searching9.Sorting & Searching
9.Sorting & Searching
 
Deep Dive on Amazon Redshift
Deep Dive on Amazon RedshiftDeep Dive on Amazon Redshift
Deep Dive on Amazon Redshift
 
Data Warehousing in the Era of Big Data
Data Warehousing in the Era of Big DataData Warehousing in the Era of Big Data
Data Warehousing in the Era of Big Data
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
 
Deep Dive on Amazon Redshift
Deep Dive on Amazon RedshiftDeep Dive on Amazon Redshift
Deep Dive on Amazon Redshift
 

Recently uploaded

一比一原版纽卡斯尔大学毕业证成绩单如何办理
一比一原版纽卡斯尔大学毕业证成绩单如何办理一比一原版纽卡斯尔大学毕业证成绩单如何办理
一比一原版纽卡斯尔大学毕业证成绩单如何办理cyebo
 
NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...
NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...
NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...Amil baba
 
Generative AI for Trailblazers_ Unlock the Future of AI.pdf
Generative AI for Trailblazers_ Unlock the Future of AI.pdfGenerative AI for Trailblazers_ Unlock the Future of AI.pdf
Generative AI for Trailblazers_ Unlock the Future of AI.pdfEmmanuel Dauda
 
2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group MeetingAlison Pitt
 
一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理pyhepag
 
Easy and simple project file on mp online
Easy and simple project file on mp onlineEasy and simple project file on mp online
Easy and simple project file on mp onlinebalibahu1313
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...ssuserf63bd7
 
Heaps & its operation -Max Heap, Min Heap
Heaps & its operation -Max Heap, Min  HeapHeaps & its operation -Max Heap, Min  Heap
Heaps & its operation -Max Heap, Min Heapaashikalamichhane
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxStephen266013
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshareraiaryan448
 
Formulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfFormulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfRobertoOcampo24
 
How I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prisonHow I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prisonPayment Village
 
社内勉強会資料  Mamba - A new era or ephemeral
社内勉強会資料   Mamba - A new era or ephemeral社内勉強会資料   Mamba - A new era or ephemeral
社内勉強会資料  Mamba - A new era or ephemeralNABLAS株式会社
 
edited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdfedited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdfgreat91
 
Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)Jon Hansen
 
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证ppy8zfkfm
 
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam DunksNOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam Dunksgmuir1066
 

Recently uploaded (20)

一比一原版纽卡斯尔大学毕业证成绩单如何办理
一比一原版纽卡斯尔大学毕业证成绩单如何办理一比一原版纽卡斯尔大学毕业证成绩单如何办理
一比一原版纽卡斯尔大学毕业证成绩单如何办理
 
NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...
NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...
NO1 Best Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialist I...
 
Generative AI for Trailblazers_ Unlock the Future of AI.pdf
Generative AI for Trailblazers_ Unlock the Future of AI.pdfGenerative AI for Trailblazers_ Unlock the Future of AI.pdf
Generative AI for Trailblazers_ Unlock the Future of AI.pdf
 
2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting
 
Abortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotec
Abortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotecAbortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotec
Abortion pills in Dammam Saudi Arabia// +966572737505 // buy cytotec
 
一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理
 
Easy and simple project file on mp online
Easy and simple project file on mp onlineEasy and simple project file on mp online
Easy and simple project file on mp online
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
 
Heaps & its operation -Max Heap, Min Heap
Heaps & its operation -Max Heap, Min  HeapHeaps & its operation -Max Heap, Min  Heap
Heaps & its operation -Max Heap, Min Heap
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptx
 
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotecAbortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
Abortion pills in Riyadh Saudi Arabia (+966572737505 buy cytotec
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshare
 
Formulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfFormulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdf
 
How I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prisonHow I opened a fake bank account and didn't go to prison
How I opened a fake bank account and didn't go to prison
 
社内勉強会資料  Mamba - A new era or ephemeral
社内勉強会資料   Mamba - A new era or ephemeral社内勉強会資料   Mamba - A new era or ephemeral
社内勉強会資料  Mamba - A new era or ephemeral
 
edited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdfedited gordis ebook sixth edition david d.pdf
edited gordis ebook sixth edition david d.pdf
 
Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)
 
123.docx. .
123.docx.                                 .123.docx.                                 .
123.docx. .
 
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
 
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam DunksNOAM AAUG Adobe Summit 2024: Summit Slam Dunks
NOAM AAUG Adobe Summit 2024: Summit Slam Dunks
 

Migrate 10TB to Exadata Tips and Tricks (Presentation)

  • 1. A M I N A D A T I A K N O W T E C H S O L U T I O N S I N C . W O R K I N G W I T H O R A C L E S I N C E 1 9 8 5 E X A D A T A S I N C E 2 0 1 1 F O C U S C U S T O M A P P L I C A T I O N D E V E L O P M E N T Migrate to Exadata X3 Tips and Tricks Level 3, San Polo 3403, Session 326 Thu, Apr 10, 2014 (12:15 PM - 12:45 PM)
  • 2. Contact Details  eMail => amin@knowtech.ca  Twitter => aminadatia  LinkedIn  Data Architecture Professionals  Oracle Exadata (IOUG SIG)  Oracle Exadata Users  Oracle User Groups  IOUG  ODTUG
  • 3. Agenda  Background  Source and Target Environments  Migration Constraints  Data Migration Techniques  Approach  Non Partitioned Tables  Partitioned Tables  Without LOB Columns  With LOB Columns  Sub-Partition by Hash Tables  Oracle Text Indexes without using TTS  Oracle Label Security without Custom Label Tags
  • 4. Environments  SOURCE  Oracle 10.2.0.4  AIX  2 Node RAC  48 CPU per Node  Target  Oracle 11.2.0.3  Exadata X3  8 Node RAC  32 CPU per Node  RAM  Patchset  CellPatch
  • 5. Downtime Constraints  Users mostly query for the past 240 Partitions  Some queries span 1200 Partitions  Plan for  480 Partitions loaded before users allowed access and ETL loading to resume  Estimated time was 5 hours and so 6 hours was allocated for cold migration  Not much prospect to drop indexes and recreate  ETL was done for 3 days prior to migration  Having NO INDEXES resulted in zero ETL  At the end of the downtime => ETL would start
  • 6. Source AIX Environment  Tablespaces => 450 (9.8 TB Disk Used)  Table Partitions distributed across all Tablespaces  Tables (for Migration)  Partitioned => 33 (~ 2500 Partitions/Table)  Non Partitioned => 65 (2 Large Number of Rows)  Oracle Text Indexes => 4  Tables with LOBs => 4 (CLOB and BLOB)  Oracle Label Security => ~ 280 Labels  Network Link => 1 MBit and 10 MBit
  • 7. Target X3 Environment  Tablespaces => Same as Source  Oracle Label Security  Create Policy  Create Labels and Tags  Map New Tags to Old Tags  Oracle Text  Define Preferences  Schema Definitions  Export from Source with Rows = N  Import into Target
  • 8. Target X3 Environment Going from Test (X2) to Production (X3)  DataPump had a bug => Extremely Slow  Revert to using 10g EXP  Virtual Columns Not Recognized  Schema Definitions (3)  Export from X2 with (Rows = N)  Create Oracle Text Preferences  Create OLS Policy  Import into X3  Recreate Objects with Virtual Columns
  • 10. Non Partitioned Tables … 1 All commands Issued from Exadata INSERT INTO <Table_Name> SELECT /*+ PARALLEL (T1,p_Degreee) */ FROM <Source_Table>@DbLink_Pipe T1 PX Elapsed Time 12 57 minutes 24 35 minutes
  • 11. W I T H N O L O B C O L U M N S W I T H L O B C O L U M N S S U B - P A R T I T I O N B Y H A S H A N D L O B C O L U M N Partitioned Tables
  • 13. W I T H N O L O B C O L U M N S Partitioned Tables (No LOBs)
  • 14. Partitioned Table (No LOBs) ..1 v_Step := 'Create => '||v_Q_Table||' => '||p_Table_Name; EXECUTE IMMEDIATE 'create table '||v_Q_Table ||chr(10)||'TABLESPACE '||v_Tablespace_Name ||chr(10)||'NOLOGGING' ||chr(10)||'as select' ||chr(10)||' /*+' ||chr(10)||' parallel (a,'||p_Parallel_Source||')' ||chr(10)||' no_index ('||p_No_Index_Hint||')' ||chr(10)||' */' ||chr(10)||' * from '||p_Table_Name||'@'||p_Data_Source||' a' ||chr(10)||'where a.PartKey ||chr(10)||’ BETWEEN p_Start_Number - '||p_Offset_Start ||chr(10)||' AND p_Start_Number - '||p_Offset_End;
  • 15. Partitioned Table (No LOBs) ..2 v_Step := 'Gather Stats => '||v_Q_Table; v_Step := ‘Exchange Working Table for Partition';  If RECORDS > 0 Insert Data from Q_Table into Working Table based on Partition_Key. v_Step := 'Create Matching Partition Indexes'; Create Index on Working Table Exchange Working Table with Partition
  • 16. Partitioned Table (No LOBs) .. 3 EXECUTE IMMEDIATE 'ALTER TABLE '||p_Table_Name ||chr(10)||' EXCHANGE PARTITION‘ ||v_Partition_Name ||chr(10)||' WITH TABLE ' ||v_Working_Table ||chr(10)||' INCLUDING INDEXES' ||chr(10)||' WITHOUT VALIDATION' ||chr(10)||' UPDATE GLOBAL INDEXES';
  • 17. Partitioned Table (No LOBs) … 4 Parallel at Source => 2,4,8,12,24 depending on the amount of data how many jobs were still running Parallel at Target => usually 8 After 4 hours Resources on AIX were diverted to deal to Tables with LOB Columns
  • 18. T A B L E S W I T H L O B C O L U M N S Partition Tables (LOBs)
  • 19. Partitioned Table (LOBs) ..1  Parallel at Source => 1,2,4,8,16,24,32  Eventually found out that PX = 1 was best  By the time we figured out the solution only one table was left to do  Submitted 45 jobs on each source node  using parallel = 1 at source  Each job took about 15 minutes
  • 21. Partitioned Table (LOBs) ..3 v_Begin INTEGER := 210; BEGIN FOR I in 1..45 LOOP v_Start := v_Begin + (I - 1); v_End := v_Start; v_Job_Name := 'M_B1_'||v_Start||'_'||v_End; v_Job_Action := 'BEGIN' ||chr(10) ||'MIGRATION.DIRECT_EXCHANGE(''‘ ||p_Partition_LOB_Table ||'''',12,''a'',1,8,' ||v_Start||','||v_End||','''||v_Source||''');' ||chr(10)||'END;';
  • 22. Partitioned Table (LOBs) ..4 BEGIN DBMS_SCHEDULER.CREATE_JOB ( job_name => v_Job_Name ,job_type => 'PLSQL_BLOCK' ,job_action => v_Job_Action ,start_date => SYSTIMESTAMP ,enabled => TRUE ); DBMS_SCHEDULER.SET_ATTRIBUTE ( name => v_Job_Name ,attribute => 'instance_stickiness' ,value => FALSE ); END; END LOOP;
  • 24. Partition Exchange .. 2  Worked fine except for continuous ETL …  TABLE gets LOCKED for the EXCHANGE  If the duration was “small” (less than 2 minutes) then there was not a noticeable impact on the ETL process  32 SubPartition Exchange approach did not work well
  • 25. Migration Summary Object Type Estimate Partitions Completed/Total Actual Partitions within 6 Hour Downtime Actual Time Non Partitioned Tables (65) 30 minutes 12 minutes Partitioned Tables Non LOB Columns (30) 480/2500 26 Tables completed 1 Table 880 2 Tables 440 1 Table 200 8 Hours 11 Hours 20 Hours Partitioned Tables CLOB Column Tables (2 Tables) 1 Table 480/2500 1 Table 40/1800 1000 160 11 Hours 15 Hours Sub Partitioned (32) Table BLOB Column 28/1200 16 8 Days!!
  • 27. Sub Partition Exchange .. 1  Table with  Range Partition on two columns  32 Sub Partitions by Hash on third column  Getting the Hash Value and finding the subpartition seemed to slow down the exchange  Simple insert from Exchange Table also had the same kind of issue. Worse than Sub Partition Exchange  Insert using Sorted by (ORA_HASH(HashKey,31,0)+1) significantly improved performance
  • 28. Sub Partition Exchange .. 2 INSERT INTO HASH_LOB_TABLE SELECT /*+ NO_INDEX(A) */ * FROM Q_TABLE A ORDER BY A.PartKey_Keep ,(ORA_HASH(A.<hashkey>,31,0) + 1);
  • 29. Sub Partition Exchange … 3 Time per Record Not much good for Simultaneous ETL
  • 30. Sub Partition Exchange … 4 Relative Insert Time/ Record
  • 31. W I T H O U T T R A N S P O R T A B L E T A B L E S P A C E S Oracle Text Index
  • 32. Oracle Text Environment  Tables with Text Indexes  Multi-lingual Documents stored on File System (2 Tables)  Generated XML from Data (2 Tables)  Transportable Tablespaces Method for migrating was estimated to take 20 days  New data could not be loaded until TTS was completed
  • 33. Document Indexing  Using High Degree Parallel (32,64,96)  One Partition Data could be indexed in about 30 – 60 minutes  This was less than the time it took to move the files to the new file system  Indexing routine checked the status of the file move  Indexing Started when File move was completed  For Highlighting Search Items, the Text Query goes against the Text Document stored on the file system and so the files needed to be moved
  • 34. Sync Indexing  Using CTX_USER_PENDING to get the Partition to be SYNCed did not work well => 18 minutes to return Partition Names  Write a View => Less than 1 second  CTXSYS.DR$PENDING (Parallel 2)  CTXSYS.DR$INDEX  CTXSYS.DR$INDEX_PARTITION (Parallel 2)  Loop through Partitions found “PENDING”  Job runs every 10 seconds  Parallel Degree usually  Text 8 (used 16,24,32,64)  XML 16 (used 4,8,16,24,32,64,96)
  • 35. Optimize Indexing  SYNC_INDEX is with Parallel (4,8,16,32,64,96)  OPTIMIZE_INDEX – Parallel 1  SYNC_INDEX get Locked out  CTX_DDL.LOCK_NOWAIT did not resolve the problem  Optimize done via DBMS_SCHEDULER Job  Wrote View to exclude Partitions from SYNC_INDEX which were part of the Optimize Index Job  Optimize done on Previous Partitions and it takes about 3 Hours to gain 60% - 85% tokens reduction  Impact on Switch Log Frequency (+ 100/hour)
  • 36. XML Document Indexing  Using High Degree Parallel (16,32,64)  One Partition Data could be indexed in about 30 minutes  This was about the time it took to generate the XML  XML generation could only be done once the underlying tables had the data migrated  Build XML routine checked for all the data tables for the day had been migrated  Indexing routine checked the status of the XML Build  Indexing Started when XML Build was completed
  • 37. W I T H O U T C U S T O M L A B E L T A G S Oracle Label Security
  • 38. Setup OLS Metadata  Create Label Policy  Create Labels from Source  Define Mapping between OLD => NEW Tags  Use CASE/DECODE to convert during Migration of Table  WHEN <Label_Tag> = Old Value THEN <New-Label_Tag>  ELSE <not_matched_tag>  Issues =>  Updating Label_Tag after activating OLS on the Table was painstakingly slow
  • 40. E N J O Y T H E R E S T O F T H E C O N F E R E N C E Thank you!!