SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Migrate from Oracle to Aurora PostgreSQL:
Best Practices, Design Patterns, & Setup
Mahesh Pakala
Solutions Architect
Amazon Web Services
G P S C T 4 0 6
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
• Introduction
• Planning Phase
• DB Freedom Migrations
• Source Server Setup/Config Recommendations
• Oracle Database: Source
• Oracle Key Parameter Setup/Config Recommendations
• AWS Database Migration Service (AWS DMS) Process
• DMS - Oracle RAC, ASM configurations
• PostgreSQL Database : Target
• Key Parameter Setup/Config Recommendations
• Design Guidelines
• Summary
+
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Workload Qualification Framework (WQF)
• The WQF includes self-service tools, a questionnaire, and design review
guidance that solutions architects, partners, and consultants can use to
classify workloads to determine the ease of migration, staff-hour
consumption and to which appropriate AWS Service to migrate
• There are two main types of database workloads
Category Workload type Ease of
migration
Staff-hour
consumption
Category 1 ODBC/JDBC workload Easy Light
Category 2 Light Oracle feature workload Easy Medium
Category 3 Heavy Oracle feature workload Hard Heavy
Category 4 Oracle specific application
framework
Difficult N/A
Category 5 OCI workloads (Non-portable,
high-risk or lift-and-shift )
Hard Heavy
• Online Transaction Processing (OLTP): Many
small/fast transactions and queries via indexes that
return few rows
• Data Warehouse (DW): Interactive and long-running
queries that scan millions of rows and batched
updates
• WQF classifies OLTP and DW workloads into five
categories:
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Planning : Schema Migration Complexity
Factors Wt Comment
Tables 0.5 Non Partitioned tables are converted automatically, Datatype and character set
issues
Materialized Views /
Triggers
3 Only Fully refreshed MV supported / Rewrite the logic
Partitions 0.1 Create child partitions Manually. Apply Partitioning arch with help of functions / trig
PL/SQL Packages 15 Packages with >= procedures or functions, review, or rewrite the logic
PL /SQL Procedures 4 Review or rewrite logic
LOB 1 Special Handling
DB
NAme
TA
B
MV DBL
INK
PRC PKG TRG TOTAL
WT
PRO 40 0 327
FACTORS SMALL MEDIUM LARGE TOTAL
WT
Complexity 1-500 500-
1000
1000-
2000
2000+
Redo /GB /
Hr
0-4 4-10 10-20 20+
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Source: Oracle DB setup
• Server setup
• Infrastructure security
• Network I/O rates, transfers, and read/write ratios
• Database
• Oracle account access for the replicate user
• Archive logging
• Supplemental logging
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Source server preparation
• Based on observability (data-driven)
• Observe workload and resource usage
• Analyze results
• Identify software and hardware components in use
• Study in-use components for tunables
• Quantify expected speed-up
• Tune, including experimental, the highest value targets
• Example methodology: USE Method
• Utilization, Saturation, & Errors
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Source server metrics
• CPU utilization
• Memory use
• Kernel statistics and run queue information
• Disks I/O rates, transfers, and read/write ratios
• Free space on file systems
• Disk adapters
• Paging space and paging rates
• Network I/O rates, transfers, and read/write ratios
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Network traffic I/O
• Network sniffer
• # ifconfig –a
• The primary Ethernet network interface is eth0. To find details of a
specific interface, for example eth0, you can use
• # ifconfig eth0
• /proc/net/dev, netstat, mii-tool – port speeds
• netstat –s or netstat –su and look for either “udpInOverflows”, “packet
receive errors” or “fragments dropped” – If you observe a consistent
increase in metrics that indicates an issue
• NIC Version : ethtool –driver eth0 - Port/packet speeds setup
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tracepath for jumbo frames
In this example, the path MTU is 1500
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DMS methods to read Oracle logs
• Oracle LogMiner
• Utility provided by Oracle, provides methods of querying
logged changes made to an Oracle database, principally
though SQL commands referencing data in Oracle redo logs.
• BinaryReader
• Binary Reader is a proprietary redo log parser for parsing the
Oracle redo logs.
• BinaryReader provides greatly improved performance and
reduces the load on the Oracle server when compared to
LogMiner
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Captures change data from operational system(s) as it occurs
• Delivers change data when you need it, where you need it
• Offers several tradeoffs between timely change delivery vs. source
system overhead (sync, async hotlog, async autolog, and so on)
• Assumes complete change management responsibility
• Captures all change data along with transaction information – See all
changes a given transaction made and who made them
• Transactional consistency for changes across multiple source tables is
guaranteed
• Transparently coordinates sharing of change data across users and
applications
What is Change Data Capture (CDC) ?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Oracle source environment
• Full load replication
• Creates files or tables at the target endpoint, automatically defines the
metadata that is required at the target, and populates the tables with data
from the source
• Change processing / Change Data Capture (CDC)
• Captures changes in the source data or metadata as they occur and applies
them to the target endpoint as soon as possible in near- real time
• Full load plus CDC
• Replication is log based
• Which means that it reads only the changes. This reduces the impact on the
source endpoints
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Database Migration Service (AWS DMS)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Reading redo from ASM
• Oracle permissions required
• Binary Reader and the "Copy redo logs to temporary folder" options
• Deleting the processed redo logs from temp folder
• Oracle ASM access permissions
• Setting up file share if the "direct access" option was chosen
• Configuring the "Copy to temp folder" option in replicate
• Accessible from ALL RAC nodes
• Multiple tasks using the same temporary folder may lead to
conflicts
• One task needing to access a redo log that another task has already deleted
• One replicate task access the same temp folder
• Different sub folders for different tasks
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Advantages of Binary Reader with AWS DMS
• Migrations with high volume changes
• LogMiner has I/O or CPU impact on Oracle DB Server
• Binary Reader has less chance of having I/O or CPU impact
• Supports CDC for LOBS in Oracle version 12c
• LogMiner does not
• Supports Oracle transparent data encryption (TDE)
• Supports HCC compression types for both FULL LOAD and
CONTINUOUS REPLICATION (CDC)
• QUERY HIGH, ARCHIVE HIGH & ARCHIVE LOW
• Supports QUERY LOW compression type only for FULL LOAD
• Better performance and reduces load on Oracle than LogMiner
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Encryption tips
AWS DMS TDE Tablespace TDE Column
Binary Reader Yes Yes
LogMiner Yes Yes
• BinaryReader supports CDC for LOBS in Oracle version 12c, but
NOT LogMiner
• To replicate encrypted columns in tables, need to specify the
Oracle Wallet encryption keys and their values
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Target: Security infrastructure
• Is the cluster on VPC?
• Is it launched to a private subnet?
• Are security groups restricted only to specific IPs?
• Have you used a non-standard port?
• Are audit logs enabled?
• IAM ownerships are in place to secure snapshots?
• Is the cluster encrypted? Using HSM or AWS Key Management Service
(AWS KMS)?
• Are clients forced to use SSL?
• Are Amazon CloudWatch alarms in place?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Target: PostgreSQL DB setup
• Disable
• DB instance backups (set BACKUP_RETENTION to 0)
• Multi-AZ – To avoid latency due to sync replication
• SYNCHRONOUS_COMMIT BUT not FSYNC
• Do NOT Disable AUTOVACUUM
• Do NOT Modify VACUUM_FREEZE_MIN_AGE
• VACUUM ANALYZE after initial load to keep latest statistics
• Adjust the logging default to be more VERBOSE
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Target : PostgreSQL DB setup
• SHARED_BUFFERS
• EFFECTIVE_CACHE_SIZE
• PG_BUFFERCACHE
• MAX_CONNECTIONS
• Hard Limit
• MAX_WAL_SIZE
• Effects checkpoint ( exceed maxl _wal_size or timing)
• WAL_LEVEL = LOGICAL; MAX_REPLICATION_SLOTS >= 1;
• MAX_WAL_SENDERS >=1; WAL_SENDER_TIMEOUT = 0
• Not adjustable in Aurora PostgreSQL; only Amazon RDS PostgreSQL
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Target : PostgreSQL DB Setup
• Increase
• WAL_BUFFER, MAINTENANCE_WORK_MEM
• checkpoint_segments from 16(256M) to 256(256*16=4096=4G) at least, even
1024
• checkpoint_timeout to 1800 (default is 300).
• Not adjustable in Aurora PostgreSQL but only in RDS PostgreSQL.
• Maintenance Work Mem
• Free mem / max connections
• Remove FK
• Remove Cross reference tables
• AWS Reports to identify unused objects
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Design guidelines
• Partitioning
• Prior PostgreSQL 10: Inheritance (Parent / Child Tables)
• From PostgreSQL 10: Declarative Partitioning (Create Table Partition Name)
• Oracle has Hash, Range, List, Composite <> PostgreSQL has Only List and Range
• Exchange / Split Partitioning not available
• Materialized Views
• FAST REFRESH : Not Available
• Automatic incremental refresh - NA
• Temporary tables are dropped after every SESSION and RECREATED
• Multiple Session cannot access the temp table
• Parameters
• Random_page_cost =1 (4 was the default : Index Scan if you are having table scan)
• Set ON - Log_connections, log_disconnections, log_lock_waits, huge_pages
• Shared_preload_libraries=‘pg_stat_statements,auto_explain.pgaudit’
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Creating a list partitioned table : 5 Step Process
1. Create the parent table:
CREATE TABLE SYSTEM_LOGS
(EVENT_NO NUMERIC NOT NULL,
EVENT_DATE DATE NOT NULL,
EVENT_STR VARCHAR(500),
ERROR_CODE VARCHAR(10));
2. Create child tables (“partitions”) with check constraints:
#CREATE TABLE SYSTEM_LOGS_WARNING (
CHECK (ERROR_CODE IN('err1', 'err2', 'err3')))
INHERITS (SYSTEM_LOGS);
#CREATE TABLE SYSTEM_LOGS_CRITICAL (
CHECK (ERROR_CODE IN('err4', 'err5', 'err6')))
INHERITS (SYSTEM_LOGS);
3. Create indexes on each of the child tables (“partitions”):
#CREATE INDEX IDX_SYSTEM_LOGS_WARNING ON
SYSTEM_LOGS_WARNING(ERROR_CODE);
#CREATE INDEX IDX_SYSTEM_LOGS_CRITICAL ON
SYSTEM_LOGS_CRITICAL(ERROR_CODE);
4. Create a function to redirect data inserted into the Parent Table:
CREATE OR REPLACE FUNCTION SYSTEM_LOGS_ERR_CODE_INS()
RETURNS TRIGGER AS
$$
BEGIN
IF (NEW.ERROR_CODE IN('err1', 'err2', 'err3')) THEN
INSERT INTO SYSTEM_LOGS_WARNING VALUES (NEW.*);
ELSIF (NEW.ERROR_CODE IN('err4', 'err5', 'err6')) THEN
INSERT INTO SYSTEM_LOGS_CRITICAL VALUES (NEW.*);
ELSE
RAISE EXCEPTION 'Value out of range, check
SYSTEM_LOGS_ERR_CODE_INS () Function!';
END IF;
RETURN NULL;
END;
$$
LANGUAGE plpgsql;
5. Attach the trigger function created above to log to the table:
CREATE TRIGGER SYSTEM_LOGS_ERR_TRIG
BEFORE INSERT ON SYSTEM_LOGS
FOR EACH ROW EXECUTE PROCEDURE SYSTEM_LOGS_ERR_CODE_INS();
6. Insert data directly into the parent table:
demo=# INSERT INTO SYSTEM_LOGS VALUES(1, '2015-05-15', 'a...', 'err1');
demo=# INSERT INTO SYSTEM_LOGS VALUES(2, '2016-06-16', 'b...', 'err3');
demo=# INSERT INTO SYSTEM_LOGS VALUES(3, '2017-07-17', 'c...', 'err6');
7. View results from across all the different child tables:
demo=# SELECT * FROM SYSTEM_LOGS;
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Design Guideline : Materialized ViewOracle PostgreSQL
Create Materialized
View
CREATE MATERIALIZED VIEW mv1 AS SELECT * FROM
employees
CREATE MATERIALIZED VIEW mv1 AS SELECT * FROM
employees
Manual refresh of a
Materialized View
DBMS_MVIEW.REFRESH('mv1', 'cf');
The--cf parameter configured the refresh method: c is complete
and f is fast
REFRESH MATERIALIZED VIEW mv1;
Online refresh of a
Materialized View
CREATE MATERIALIZED VIEW mv1 REFRESH FAST ON COMMIT
AS SELECT * FROM employees;
- Supports automatic incremental refresh
- Supports DML on the MV
Create a trigger that will initiate a refresh after every DML
command on the underlying tables:
CREATE OR REPLACE FUNCTION refresh_mv1()
returns trigger language plpgsql
as $$
begin
REFRESH MATERIALIZED VIEW mv1;
return null;
end $$;
CREATE TRIGGER refresh_ mv1
after insert or update or delete or truncate
on employees for each statement
cron job ->
execute procedure
refresh_mv1();
Automatic
incremental refresh of
a Materialized View
CREATE MATERIALIZED VIEW LOG ON employees…
INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW mv1 REFRESH FAST AS SELECT *
FROM employees;
Not Supported
DML on Materialized
View data
Supported Not Supported
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Design guidelines
• Sequence Cache 20
• Oracle Sessions are contiguous
• PG : caches per session - Session A starts 1 and session B 120
• UNDO segments – ORA-01555 (Primary Key Filtering)
• Triggers - Oracle : After : DML / DDL/ DB ops
When
Fired
Database Event Row-Level Trigger
(FOR EACH ROW)
Statement-Level Trigger
(FOR EACH STATEMENT)
BEFORE INSERT, UPDATE, DELETE Tables and foreign
tables
Tables, views, and foreign
tables
TRUNCATE - Tables
AFTER INSERT, UPDATE, DELETE Tables and foreign
tables
Tables, views, and foreign
tables
TRUNCATE - Tables
INSTEAD OF INSERT, UPDATE, DELETE Views --
TRUNCATE -- --
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Truncation and Performance of LOBS
• If max LOB size <=64 KB, we
read the LOBs in array mode
with default array size set to
1000
• If max LOB > 64 KB, we read
LOB in array mode :
• If LOB size <= 64KB, we migrate and
move on
• If LOB size > 64KB, we use GetData()
method for CLOBs and OCILobRead2
for BLOBs
• Check if LOB value is null. If
not null, send a signal to
lookup the LOB from source
• We then use OCILobRead2 to
read the first chunk of “full
lob chunk size” source
(default chunk size is 64 KB),
and send to the target. Then
we read the next chunk and
send to target and so on,
until the LOB is completely
read.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Customer data center AWS
Internet
Oracle to PostgreSQL migration using AWS DMS
VPN
AWS SCT
Migration agents
(DW)
Same AWS account & region
AWS DMS
Replication
instance
AWS DMS
Replication
instance
EC2 instance
web app
server
EC2 instance
web app
server
1
3
4
5
2
DX
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DMS best practices
• Improving performance of an AWS DMS migration
• Load multiple tables in parallel
• Remove bottlenecks on the target
• Use multiple tasks
• Improving LOB performance
• Optimizing change processing
• Determining the optimum size for a replication instance
• Reducing load on your source database
• Ongoing replication
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Comparison of RDS & Aurora
Category RDS Aurora
Performance Good performance 5x faster for MySQL
3x faster for PostgreSQL
Scalability Up to 5 read replicas
Lag measured in seconds
Up to 15 read replicas
Lag measured in milliseconds
Failover Around 60 seconds Less than 30 seconds
Storage Scales up to 16 TB Scales up to 64 TB. Auto-scales in 10 GB increments.
High Availability Multi-AZ is available Writes 6 copies to 3 AZs
Backup Takes daily snapshot during
backup window & captures
transaction logs
Continuous, asynchronous backup to S3 (no backup
windows)
Instance Types M3, M4, R3, T2 R3, R4, T2 for MySQL
R4 for PostgreSQL
Innovations with Aurora Fast Database Cloning
Fast DDL
Advanced Auditing
Performance Insights (Preview)
Parallel Query (Preview)
Serverless (Preview)
Multi-Master (coming)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Alexa + Performance Insights
New integration between Alexa & Performance
Insights can be your assistant DBA
Uses the Performance Insights API to identify
bottlenecks in Amazon RDS
Get actionable suggestions such as on-demand
scaling, DBA notifications & paging
Go to the Slalom booth (#1438) to see a live demo
and learn more!
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Mahesh Pakala
pakalam@amazon.com
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Extras
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS SCT guidance
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS SCT helps with converting tables, views, &
code
Sequences
User-defined types
Synonyms
Packages
Stored procedures
Functions
Triggers
Schemas
Tables
Indexes
Views
Sort and distribution
keys

Mais conteúdo relacionado

Mais procurados

Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Atlanta ...
Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Atlanta ...Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Atlanta ...
Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Atlanta ...Amazon Web Services
 
Migrating Databases to the Cloud with AWS Database Migration Service (DAT207)...
Migrating Databases to the Cloud with AWS Database Migration Service (DAT207)...Migrating Databases to the Cloud with AWS Database Migration Service (DAT207)...
Migrating Databases to the Cloud with AWS Database Migration Service (DAT207)...Amazon Web Services
 
The Microsoft Well Architected Framework For Data Analytics
The Microsoft Well Architected Framework For Data AnalyticsThe Microsoft Well Architected Framework For Data Analytics
The Microsoft Well Architected Framework For Data AnalyticsStephanie Locke
 
Heterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCTHeterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCTAmazon Web Services
 
Database Migration Using AWS DMS and AWS SCT (GPSCT307) - AWS re:Invent 2018
Database Migration Using AWS DMS and AWS SCT (GPSCT307) - AWS re:Invent 2018Database Migration Using AWS DMS and AWS SCT (GPSCT307) - AWS re:Invent 2018
Database Migration Using AWS DMS and AWS SCT (GPSCT307) - AWS re:Invent 2018Amazon Web Services
 
Build Data Lakes & Analytics on AWS: Patterns & Best Practices
Build Data Lakes & Analytics on AWS: Patterns & Best PracticesBuild Data Lakes & Analytics on AWS: Patterns & Best Practices
Build Data Lakes & Analytics on AWS: Patterns & Best PracticesAmazon Web Services
 
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...Amazon Web Services
 
Getting Started with AWS Database Migration Service
Getting Started with AWS Database Migration ServiceGetting Started with AWS Database Migration Service
Getting Started with AWS Database Migration ServiceAmazon Web Services
 
Migrating to Amazon RDS with Database Migration Service
Migrating to Amazon RDS with Database Migration ServiceMigrating to Amazon RDS with Database Migration Service
Migrating to Amazon RDS with Database Migration ServiceAmazon Web Services
 
Snowflake Data Science and AI/ML at Scale
Snowflake Data Science and AI/ML at ScaleSnowflake Data Science and AI/ML at Scale
Snowflake Data Science and AI/ML at ScaleAdam Doyle
 
Speed up data preparation for ML pipelines on AWS
Speed up data preparation for ML pipelines on AWSSpeed up data preparation for ML pipelines on AWS
Speed up data preparation for ML pipelines on AWSData Science Milan
 
An Overview of Best Practices for Large Scale Migrations - AWS Transformation...
An Overview of Best Practices for Large Scale Migrations - AWS Transformation...An Overview of Best Practices for Large Scale Migrations - AWS Transformation...
An Overview of Best Practices for Large Scale Migrations - AWS Transformation...Amazon Web Services
 
Migrating Your Databases to AWS - Tools and Services.pdf
Migrating Your Databases to AWS -  Tools and Services.pdfMigrating Your Databases to AWS -  Tools and Services.pdf
Migrating Your Databases to AWS - Tools and Services.pdfAmazon Web Services
 

Mais procurados (20)

Building-a-Data-Lake-on-AWS
Building-a-Data-Lake-on-AWSBuilding-a-Data-Lake-on-AWS
Building-a-Data-Lake-on-AWS
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
 
Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Atlanta ...
Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Atlanta ...Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Atlanta ...
Migrating Databases to the Cloud: Introduction to AWS DMS - SRV215 - Atlanta ...
 
Migrating Databases to the Cloud with AWS Database Migration Service (DAT207)...
Migrating Databases to the Cloud with AWS Database Migration Service (DAT207)...Migrating Databases to the Cloud with AWS Database Migration Service (DAT207)...
Migrating Databases to the Cloud with AWS Database Migration Service (DAT207)...
 
The Microsoft Well Architected Framework For Data Analytics
The Microsoft Well Architected Framework For Data AnalyticsThe Microsoft Well Architected Framework For Data Analytics
The Microsoft Well Architected Framework For Data Analytics
 
Heterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCTHeterogenous Migration with DMS & SCT
Heterogenous Migration with DMS & SCT
 
Database Migration Using AWS DMS and AWS SCT (GPSCT307) - AWS re:Invent 2018
Database Migration Using AWS DMS and AWS SCT (GPSCT307) - AWS re:Invent 2018Database Migration Using AWS DMS and AWS SCT (GPSCT307) - AWS re:Invent 2018
Database Migration Using AWS DMS and AWS SCT (GPSCT307) - AWS re:Invent 2018
 
Aurora Deep Dive | AWS Floor28
Aurora Deep Dive | AWS Floor28Aurora Deep Dive | AWS Floor28
Aurora Deep Dive | AWS Floor28
 
Build Data Lakes & Analytics on AWS: Patterns & Best Practices
Build Data Lakes & Analytics on AWS: Patterns & Best PracticesBuild Data Lakes & Analytics on AWS: Patterns & Best Practices
Build Data Lakes & Analytics on AWS: Patterns & Best Practices
 
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
 
Getting Started with AWS Database Migration Service
Getting Started with AWS Database Migration ServiceGetting Started with AWS Database Migration Service
Getting Started with AWS Database Migration Service
 
Migrating to Amazon RDS with Database Migration Service
Migrating to Amazon RDS with Database Migration ServiceMigrating to Amazon RDS with Database Migration Service
Migrating to Amazon RDS with Database Migration Service
 
Introduction to Amazon Aurora
Introduction to Amazon AuroraIntroduction to Amazon Aurora
Introduction to Amazon Aurora
 
Snowflake Data Science and AI/ML at Scale
Snowflake Data Science and AI/ML at ScaleSnowflake Data Science and AI/ML at Scale
Snowflake Data Science and AI/ML at Scale
 
Introduction to Amazon Athena
Introduction to Amazon AthenaIntroduction to Amazon Athena
Introduction to Amazon Athena
 
Amazon Aurora: Under the Hood
Amazon Aurora: Under the HoodAmazon Aurora: Under the Hood
Amazon Aurora: Under the Hood
 
AWS Big Data Platform
AWS Big Data PlatformAWS Big Data Platform
AWS Big Data Platform
 
Speed up data preparation for ML pipelines on AWS
Speed up data preparation for ML pipelines on AWSSpeed up data preparation for ML pipelines on AWS
Speed up data preparation for ML pipelines on AWS
 
An Overview of Best Practices for Large Scale Migrations - AWS Transformation...
An Overview of Best Practices for Large Scale Migrations - AWS Transformation...An Overview of Best Practices for Large Scale Migrations - AWS Transformation...
An Overview of Best Practices for Large Scale Migrations - AWS Transformation...
 
Migrating Your Databases to AWS - Tools and Services.pdf
Migrating Your Databases to AWS -  Tools and Services.pdfMigrating Your Databases to AWS -  Tools and Services.pdf
Migrating Your Databases to AWS - Tools and Services.pdf
 

Semelhante a Migrate Oracle to Aurora PostgreSQL Best Practices

Oracle & SQL Server on the Cloud: Database Week SF
Oracle & SQL Server on the Cloud: Database Week SFOracle & SQL Server on the Cloud: Database Week SF
Oracle & SQL Server on the Cloud: Database Week SFAmazon Web Services
 
Oracle & SQL Server on the Cloud: Database Week San Francisco
Oracle & SQL Server on the Cloud: Database Week San FranciscoOracle & SQL Server on the Cloud: Database Week San Francisco
Oracle & SQL Server on the Cloud: Database Week San FranciscoAmazon Web Services
 
Oracle and SQL Server on the Cloud - Bill Baldwin
Oracle and SQL Server on the Cloud - Bill BaldwinOracle and SQL Server on the Cloud - Bill Baldwin
Oracle and SQL Server on the Cloud - Bill BaldwinAmazon Web Services
 
Relational Database Services on AWS - Bill Baldwin, Gareth Eagar
Relational Database Services on AWS - Bill Baldwin, Gareth EagarRelational Database Services on AWS - Bill Baldwin, Gareth Eagar
Relational Database Services on AWS - Bill Baldwin, Gareth EagarAmazon Web Services
 
Oracle and SQL Server on the Cloud
Oracle and SQL Server on the CloudOracle and SQL Server on the Cloud
Oracle and SQL Server on the CloudAmazon Web Services
 
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Web Services
 
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...Cloudera, Inc.
 
(ISM303) Migrating Your Enterprise Data Warehouse To Amazon Redshift
(ISM303) Migrating Your Enterprise Data Warehouse To Amazon Redshift(ISM303) Migrating Your Enterprise Data Warehouse To Amazon Redshift
(ISM303) Migrating Your Enterprise Data Warehouse To Amazon RedshiftAmazon Web Services
 
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...Amazon Web Services
 
ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...
ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...
ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...Amazon Web Services
 
Which Database is Right for My Workload?
Which Database is Right for My Workload?Which Database is Right for My Workload?
Which Database is Right for My Workload?Amazon Web Services
 
Which Database is Right for My Workload: Database Week SF
Which Database is Right for My Workload: Database Week SFWhich Database is Right for My Workload: Database Week SF
Which Database is Right for My Workload: Database Week SFAmazon Web Services
 

Semelhante a Migrate Oracle to Aurora PostgreSQL Best Practices (20)

Oracle & SQL Server on the Cloud: Database Week SF
Oracle & SQL Server on the Cloud: Database Week SFOracle & SQL Server on the Cloud: Database Week SF
Oracle & SQL Server on the Cloud: Database Week SF
 
Oracle & SQL Server on the Cloud: Database Week San Francisco
Oracle & SQL Server on the Cloud: Database Week San FranciscoOracle & SQL Server on the Cloud: Database Week San Francisco
Oracle & SQL Server on the Cloud: Database Week San Francisco
 
Oracle and SQL Server on the Cloud - Bill Baldwin
Oracle and SQL Server on the Cloud - Bill BaldwinOracle and SQL Server on the Cloud - Bill Baldwin
Oracle and SQL Server on the Cloud - Bill Baldwin
 
Relational Database Services on AWS - Bill Baldwin, Gareth Eagar
Relational Database Services on AWS - Bill Baldwin, Gareth EagarRelational Database Services on AWS - Bill Baldwin, Gareth Eagar
Relational Database Services on AWS - Bill Baldwin, Gareth Eagar
 
Oracle and SQL Server on the Cloud
Oracle and SQL Server on the CloudOracle and SQL Server on the Cloud
Oracle and SQL Server on the Cloud
 
SQL Server on AWS
SQL Server on AWSSQL Server on AWS
SQL Server on AWS
 
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
Amazon Redshift 與 Amazon Redshift Spectrum 幫您建立現代化資料倉儲 (Level 300)
 
SQL Server on AWS
SQL Server on AWSSQL Server on AWS
SQL Server on AWS
 
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
 
SQL Server on AWS
SQL Server on AWSSQL Server on AWS
SQL Server on AWS
 
Oracle on AWS
Oracle on AWSOracle on AWS
Oracle on AWS
 
Oracle on AWS
Oracle on AWSOracle on AWS
Oracle on AWS
 
(ISM303) Migrating Your Enterprise Data Warehouse To Amazon Redshift
(ISM303) Migrating Your Enterprise Data Warehouse To Amazon Redshift(ISM303) Migrating Your Enterprise Data Warehouse To Amazon Redshift
(ISM303) Migrating Your Enterprise Data Warehouse To Amazon Redshift
 
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...
Best Practices for Running Oracle Databases on Amazon RDS (DAT317) - AWS re:I...
 
PostgreSQL
PostgreSQLPostgreSQL
PostgreSQL
 
PASS Summit 2020
PASS Summit 2020PASS Summit 2020
PASS Summit 2020
 
ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...
ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...
ENT305 Migrating Your Databases to AWS: Deep Dive on Amazon Relational Databa...
 
PostgreSQL
PostgreSQL PostgreSQL
PostgreSQL
 
Which Database is Right for My Workload?
Which Database is Right for My Workload?Which Database is Right for My Workload?
Which Database is Right for My Workload?
 
Which Database is Right for My Workload: Database Week SF
Which Database is Right for My Workload: Database Week SFWhich Database is Right for My Workload: Database Week SF
Which Database is Right for My Workload: Database Week SF
 

Mais de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Mais de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Migrate Oracle to Aurora PostgreSQL Best Practices

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & Setup Mahesh Pakala Solutions Architect Amazon Web Services G P S C T 4 0 6
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Agenda • Introduction • Planning Phase • DB Freedom Migrations • Source Server Setup/Config Recommendations • Oracle Database: Source • Oracle Key Parameter Setup/Config Recommendations • AWS Database Migration Service (AWS DMS) Process • DMS - Oracle RAC, ASM configurations • PostgreSQL Database : Target • Key Parameter Setup/Config Recommendations • Design Guidelines • Summary +
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Workload Qualification Framework (WQF) • The WQF includes self-service tools, a questionnaire, and design review guidance that solutions architects, partners, and consultants can use to classify workloads to determine the ease of migration, staff-hour consumption and to which appropriate AWS Service to migrate • There are two main types of database workloads Category Workload type Ease of migration Staff-hour consumption Category 1 ODBC/JDBC workload Easy Light Category 2 Light Oracle feature workload Easy Medium Category 3 Heavy Oracle feature workload Hard Heavy Category 4 Oracle specific application framework Difficult N/A Category 5 OCI workloads (Non-portable, high-risk or lift-and-shift ) Hard Heavy • Online Transaction Processing (OLTP): Many small/fast transactions and queries via indexes that return few rows • Data Warehouse (DW): Interactive and long-running queries that scan millions of rows and batched updates • WQF classifies OLTP and DW workloads into five categories:
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Planning : Schema Migration Complexity Factors Wt Comment Tables 0.5 Non Partitioned tables are converted automatically, Datatype and character set issues Materialized Views / Triggers 3 Only Fully refreshed MV supported / Rewrite the logic Partitions 0.1 Create child partitions Manually. Apply Partitioning arch with help of functions / trig PL/SQL Packages 15 Packages with >= procedures or functions, review, or rewrite the logic PL /SQL Procedures 4 Review or rewrite logic LOB 1 Special Handling DB NAme TA B MV DBL INK PRC PKG TRG TOTAL WT PRO 40 0 327 FACTORS SMALL MEDIUM LARGE TOTAL WT Complexity 1-500 500- 1000 1000- 2000 2000+ Redo /GB / Hr 0-4 4-10 10-20 20+
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Source: Oracle DB setup • Server setup • Infrastructure security • Network I/O rates, transfers, and read/write ratios • Database • Oracle account access for the replicate user • Archive logging • Supplemental logging
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Source server preparation • Based on observability (data-driven) • Observe workload and resource usage • Analyze results • Identify software and hardware components in use • Study in-use components for tunables • Quantify expected speed-up • Tune, including experimental, the highest value targets • Example methodology: USE Method • Utilization, Saturation, & Errors
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Source server metrics • CPU utilization • Memory use • Kernel statistics and run queue information • Disks I/O rates, transfers, and read/write ratios • Free space on file systems • Disk adapters • Paging space and paging rates • Network I/O rates, transfers, and read/write ratios
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Network traffic I/O • Network sniffer • # ifconfig –a • The primary Ethernet network interface is eth0. To find details of a specific interface, for example eth0, you can use • # ifconfig eth0 • /proc/net/dev, netstat, mii-tool – port speeds • netstat –s or netstat –su and look for either “udpInOverflows”, “packet receive errors” or “fragments dropped” – If you observe a consistent increase in metrics that indicates an issue • NIC Version : ethtool –driver eth0 - Port/packet speeds setup
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Tracepath for jumbo frames In this example, the path MTU is 1500
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DMS methods to read Oracle logs • Oracle LogMiner • Utility provided by Oracle, provides methods of querying logged changes made to an Oracle database, principally though SQL commands referencing data in Oracle redo logs. • BinaryReader • Binary Reader is a proprietary redo log parser for parsing the Oracle redo logs. • BinaryReader provides greatly improved performance and reduces the load on the Oracle server when compared to LogMiner
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Captures change data from operational system(s) as it occurs • Delivers change data when you need it, where you need it • Offers several tradeoffs between timely change delivery vs. source system overhead (sync, async hotlog, async autolog, and so on) • Assumes complete change management responsibility • Captures all change data along with transaction information – See all changes a given transaction made and who made them • Transactional consistency for changes across multiple source tables is guaranteed • Transparently coordinates sharing of change data across users and applications What is Change Data Capture (CDC) ?
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Oracle source environment • Full load replication • Creates files or tables at the target endpoint, automatically defines the metadata that is required at the target, and populates the tables with data from the source • Change processing / Change Data Capture (CDC) • Captures changes in the source data or metadata as they occur and applies them to the target endpoint as soon as possible in near- real time • Full load plus CDC • Replication is log based • Which means that it reads only the changes. This reduces the impact on the source endpoints
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Database Migration Service (AWS DMS)
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Reading redo from ASM • Oracle permissions required • Binary Reader and the "Copy redo logs to temporary folder" options • Deleting the processed redo logs from temp folder • Oracle ASM access permissions • Setting up file share if the "direct access" option was chosen • Configuring the "Copy to temp folder" option in replicate • Accessible from ALL RAC nodes • Multiple tasks using the same temporary folder may lead to conflicts • One task needing to access a redo log that another task has already deleted • One replicate task access the same temp folder • Different sub folders for different tasks
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Advantages of Binary Reader with AWS DMS • Migrations with high volume changes • LogMiner has I/O or CPU impact on Oracle DB Server • Binary Reader has less chance of having I/O or CPU impact • Supports CDC for LOBS in Oracle version 12c • LogMiner does not • Supports Oracle transparent data encryption (TDE) • Supports HCC compression types for both FULL LOAD and CONTINUOUS REPLICATION (CDC) • QUERY HIGH, ARCHIVE HIGH & ARCHIVE LOW • Supports QUERY LOW compression type only for FULL LOAD • Better performance and reduces load on Oracle than LogMiner
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Encryption tips AWS DMS TDE Tablespace TDE Column Binary Reader Yes Yes LogMiner Yes Yes • BinaryReader supports CDC for LOBS in Oracle version 12c, but NOT LogMiner • To replicate encrypted columns in tables, need to specify the Oracle Wallet encryption keys and their values
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Target: Security infrastructure • Is the cluster on VPC? • Is it launched to a private subnet? • Are security groups restricted only to specific IPs? • Have you used a non-standard port? • Are audit logs enabled? • IAM ownerships are in place to secure snapshots? • Is the cluster encrypted? Using HSM or AWS Key Management Service (AWS KMS)? • Are clients forced to use SSL? • Are Amazon CloudWatch alarms in place?
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Target: PostgreSQL DB setup • Disable • DB instance backups (set BACKUP_RETENTION to 0) • Multi-AZ – To avoid latency due to sync replication • SYNCHRONOUS_COMMIT BUT not FSYNC • Do NOT Disable AUTOVACUUM • Do NOT Modify VACUUM_FREEZE_MIN_AGE • VACUUM ANALYZE after initial load to keep latest statistics • Adjust the logging default to be more VERBOSE
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Target : PostgreSQL DB setup • SHARED_BUFFERS • EFFECTIVE_CACHE_SIZE • PG_BUFFERCACHE • MAX_CONNECTIONS • Hard Limit • MAX_WAL_SIZE • Effects checkpoint ( exceed maxl _wal_size or timing) • WAL_LEVEL = LOGICAL; MAX_REPLICATION_SLOTS >= 1; • MAX_WAL_SENDERS >=1; WAL_SENDER_TIMEOUT = 0 • Not adjustable in Aurora PostgreSQL; only Amazon RDS PostgreSQL
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Target : PostgreSQL DB Setup • Increase • WAL_BUFFER, MAINTENANCE_WORK_MEM • checkpoint_segments from 16(256M) to 256(256*16=4096=4G) at least, even 1024 • checkpoint_timeout to 1800 (default is 300). • Not adjustable in Aurora PostgreSQL but only in RDS PostgreSQL. • Maintenance Work Mem • Free mem / max connections • Remove FK • Remove Cross reference tables • AWS Reports to identify unused objects
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Design guidelines • Partitioning • Prior PostgreSQL 10: Inheritance (Parent / Child Tables) • From PostgreSQL 10: Declarative Partitioning (Create Table Partition Name) • Oracle has Hash, Range, List, Composite <> PostgreSQL has Only List and Range • Exchange / Split Partitioning not available • Materialized Views • FAST REFRESH : Not Available • Automatic incremental refresh - NA • Temporary tables are dropped after every SESSION and RECREATED • Multiple Session cannot access the temp table • Parameters • Random_page_cost =1 (4 was the default : Index Scan if you are having table scan) • Set ON - Log_connections, log_disconnections, log_lock_waits, huge_pages • Shared_preload_libraries=‘pg_stat_statements,auto_explain.pgaudit’
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Creating a list partitioned table : 5 Step Process 1. Create the parent table: CREATE TABLE SYSTEM_LOGS (EVENT_NO NUMERIC NOT NULL, EVENT_DATE DATE NOT NULL, EVENT_STR VARCHAR(500), ERROR_CODE VARCHAR(10)); 2. Create child tables (“partitions”) with check constraints: #CREATE TABLE SYSTEM_LOGS_WARNING ( CHECK (ERROR_CODE IN('err1', 'err2', 'err3'))) INHERITS (SYSTEM_LOGS); #CREATE TABLE SYSTEM_LOGS_CRITICAL ( CHECK (ERROR_CODE IN('err4', 'err5', 'err6'))) INHERITS (SYSTEM_LOGS); 3. Create indexes on each of the child tables (“partitions”): #CREATE INDEX IDX_SYSTEM_LOGS_WARNING ON SYSTEM_LOGS_WARNING(ERROR_CODE); #CREATE INDEX IDX_SYSTEM_LOGS_CRITICAL ON SYSTEM_LOGS_CRITICAL(ERROR_CODE); 4. Create a function to redirect data inserted into the Parent Table: CREATE OR REPLACE FUNCTION SYSTEM_LOGS_ERR_CODE_INS() RETURNS TRIGGER AS $$ BEGIN IF (NEW.ERROR_CODE IN('err1', 'err2', 'err3')) THEN INSERT INTO SYSTEM_LOGS_WARNING VALUES (NEW.*); ELSIF (NEW.ERROR_CODE IN('err4', 'err5', 'err6')) THEN INSERT INTO SYSTEM_LOGS_CRITICAL VALUES (NEW.*); ELSE RAISE EXCEPTION 'Value out of range, check SYSTEM_LOGS_ERR_CODE_INS () Function!'; END IF; RETURN NULL; END; $$ LANGUAGE plpgsql; 5. Attach the trigger function created above to log to the table: CREATE TRIGGER SYSTEM_LOGS_ERR_TRIG BEFORE INSERT ON SYSTEM_LOGS FOR EACH ROW EXECUTE PROCEDURE SYSTEM_LOGS_ERR_CODE_INS(); 6. Insert data directly into the parent table: demo=# INSERT INTO SYSTEM_LOGS VALUES(1, '2015-05-15', 'a...', 'err1'); demo=# INSERT INTO SYSTEM_LOGS VALUES(2, '2016-06-16', 'b...', 'err3'); demo=# INSERT INTO SYSTEM_LOGS VALUES(3, '2017-07-17', 'c...', 'err6'); 7. View results from across all the different child tables: demo=# SELECT * FROM SYSTEM_LOGS;
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Design Guideline : Materialized ViewOracle PostgreSQL Create Materialized View CREATE MATERIALIZED VIEW mv1 AS SELECT * FROM employees CREATE MATERIALIZED VIEW mv1 AS SELECT * FROM employees Manual refresh of a Materialized View DBMS_MVIEW.REFRESH('mv1', 'cf'); The--cf parameter configured the refresh method: c is complete and f is fast REFRESH MATERIALIZED VIEW mv1; Online refresh of a Materialized View CREATE MATERIALIZED VIEW mv1 REFRESH FAST ON COMMIT AS SELECT * FROM employees; - Supports automatic incremental refresh - Supports DML on the MV Create a trigger that will initiate a refresh after every DML command on the underlying tables: CREATE OR REPLACE FUNCTION refresh_mv1() returns trigger language plpgsql as $$ begin REFRESH MATERIALIZED VIEW mv1; return null; end $$; CREATE TRIGGER refresh_ mv1 after insert or update or delete or truncate on employees for each statement cron job -> execute procedure refresh_mv1(); Automatic incremental refresh of a Materialized View CREATE MATERIALIZED VIEW LOG ON employees… INCLUDING NEW VALUES; CREATE MATERIALIZED VIEW mv1 REFRESH FAST AS SELECT * FROM employees; Not Supported DML on Materialized View data Supported Not Supported
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Design guidelines • Sequence Cache 20 • Oracle Sessions are contiguous • PG : caches per session - Session A starts 1 and session B 120 • UNDO segments – ORA-01555 (Primary Key Filtering) • Triggers - Oracle : After : DML / DDL/ DB ops When Fired Database Event Row-Level Trigger (FOR EACH ROW) Statement-Level Trigger (FOR EACH STATEMENT) BEFORE INSERT, UPDATE, DELETE Tables and foreign tables Tables, views, and foreign tables TRUNCATE - Tables AFTER INSERT, UPDATE, DELETE Tables and foreign tables Tables, views, and foreign tables TRUNCATE - Tables INSTEAD OF INSERT, UPDATE, DELETE Views -- TRUNCATE -- --
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Truncation and Performance of LOBS • If max LOB size <=64 KB, we read the LOBs in array mode with default array size set to 1000 • If max LOB > 64 KB, we read LOB in array mode : • If LOB size <= 64KB, we migrate and move on • If LOB size > 64KB, we use GetData() method for CLOBs and OCILobRead2 for BLOBs • Check if LOB value is null. If not null, send a signal to lookup the LOB from source • We then use OCILobRead2 to read the first chunk of “full lob chunk size” source (default chunk size is 64 KB), and send to the target. Then we read the next chunk and send to target and so on, until the LOB is completely read.
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Customer data center AWS Internet Oracle to PostgreSQL migration using AWS DMS VPN AWS SCT Migration agents (DW) Same AWS account & region AWS DMS Replication instance AWS DMS Replication instance EC2 instance web app server EC2 instance web app server 1 3 4 5 2 DX
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DMS best practices • Improving performance of an AWS DMS migration • Load multiple tables in parallel • Remove bottlenecks on the target • Use multiple tasks • Improving LOB performance • Optimizing change processing • Determining the optimum size for a replication instance • Reducing load on your source database • Ongoing replication
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Comparison of RDS & Aurora Category RDS Aurora Performance Good performance 5x faster for MySQL 3x faster for PostgreSQL Scalability Up to 5 read replicas Lag measured in seconds Up to 15 read replicas Lag measured in milliseconds Failover Around 60 seconds Less than 30 seconds Storage Scales up to 16 TB Scales up to 64 TB. Auto-scales in 10 GB increments. High Availability Multi-AZ is available Writes 6 copies to 3 AZs Backup Takes daily snapshot during backup window & captures transaction logs Continuous, asynchronous backup to S3 (no backup windows) Instance Types M3, M4, R3, T2 R3, R4, T2 for MySQL R4 for PostgreSQL Innovations with Aurora Fast Database Cloning Fast DDL Advanced Auditing Performance Insights (Preview) Parallel Query (Preview) Serverless (Preview) Multi-Master (coming)
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Alexa + Performance Insights New integration between Alexa & Performance Insights can be your assistant DBA Uses the Performance Insights API to identify bottlenecks in Amazon RDS Get actionable suggestions such as on-demand scaling, DBA notifications & paging Go to the Slalom booth (#1438) to see a live demo and learn more!
  • 31. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Mahesh Pakala pakalam@amazon.com
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Extras
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SCT guidance
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SCT helps with converting tables, views, & code Sequences User-defined types Synonyms Packages Stored procedures Functions Triggers Schemas Tables Indexes Views Sort and distribution keys