SlideShare ist ein Scribd-Unternehmen logo
1 von 63
Downloaden Sie, um offline zu lesen
© 2016 Pythian 1
Migrating and Running DBs
on Amazon RDS for Oracle
MARIS ELSINS
Lead Database Consultant
© 2016 Pythian 2
Maris Elsins
Lead Database Consultant
At Pythian since 2011
Located in Riga, Latvia
Oracle [Apps] DBA since 2005
Speaker at conferences since 2007
@MarisDBA elsins@pythian.com
http://bit.ly/getMOSPatchV2
© 2016 Pythian 3
Migrating and Running DBs on
Amazon RDS for Oracle
Mining AWR V2: Trend Analysis
Today: 17:55, Hall 9
© 2016 Pythian 4
© 2016 Pythian 5
ABOUT PYTHIAN
Pythian’s 400+ IT professionals
help companies adopt and
manage disruptive technologies
to better compete
© 2016 Pythian 6
Systems currently
managed by Pythian
EXPERIENCED
Pythian experts
in 35 countries
GLOBAL
Millennia of experience
gathered and shared
over 19 years
EXPERTS
11,800 2400
© 2016 Pythian 7
• Intro...
• Sizing...
• Migrating...
• Running and Monitoring...
• When things go bad...
AGENDA
© 2016 Pythian 8
… these are just few of my
observations
• Why Cloud?
• Choosing between cloud vendors
• Terminology
• Complete pricing guide
• The right way to do anything
I mean it!
NOT ON AGENDA
© 2016 Pythian 9
DISCLAIMER
OK, YOU CAUGHT ME ...
I may have a few “Ouch!” slides in
the presentation, that probably will
make you think Oracle RDS is no
good.
It's not the intention.
I honestly think Oracle RDS is a
great service for the appropriate
workload, and if it's done right.
© 2016 Pythian 10
BEFORE WE START ...
Can I comment or ask questions
during the presentation?
Photo by Day Donaldson / CC BY 2.0
© 2016 Pythian 11
INTRODUCTION
... to RDS for Oracle
© 2016 Pythian 12
AWS RDS FOR ORACLE
INTRODUCTION - REGIONS
https://aws.amazon.com/about-aws/global-infrastructure/
© 2016 Pythian 13
INTRODUCTION
WHAT IS RDS
• Relational Database Service
• PaaS (DBaaS)
• Managed by AWS
– Setup / Provisioning
– Backups
– Maintenance / Patching
– Alerting
– DR
– ...
• SSH Access / SQL*Net connectivity
© 2016 Pythian 14
• 11gR2:
– 11.2.0.2.v3 - 11.2.0.2.v7
– 11.2.0.3.v1 - 11.2.0.3.v4
– 11.2.0.4.v1 - 11.2.0.4.v9
• 12cR1:
– 12.1.0.1.v1 - 12.1.0.1.v6
– 12.1.0.2.v1 - 12.1.0.2.v5
• Engine versions differ by included patches
– PSU / DST / GG / + critical one-offs
INTRODUCTION
DB ENGINES
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.PatchComposition.html
What if I need a specific
one-off?
© 2016 Pythian 15
INTRODUCTION
DATABASE EDITIONS
https://aws.amazon.com/rds/oracle/details/
Edition License Included Bring Your Own License
SE One ✓ ✓
SE Two ✓ ✓
SE ✓
EE ✓
© 2016 Pythian 16
INTRODUCTION
LICENSING
• Two important sources:
– Licensing Oracle Software in the Cloud Computing Environment
– Virtual Cores by Amazon EC2 and RDS DB Instance Type
• Virtual cores != Virtual CPUs (vCPUs)
– vCPU is actually a HyperThread
• Core Factor of 0.5 applies to "Virtual cores"
• Max sizing for SE:
– SE: 16 Virtual Cores | 32 vCPU
– SE: One/Two: 8 Virtual Cores | 16 vCPU
© 2016 Pythian 17
INTRODUCTION
LICENSING EXAMPLE
• Oracle EE
• 16 vCPU = 8 virtual cores
• 8 virtual cores * 0.5 (core factor) = 4 Licences
© 2016 Pythian 18
INTRODUCTION
INSTANCE CLASSES AND TYPES
https://aws.amazon.com/rds/oracle/details/
• Instance Classes (available for RDS)
– Standard - Latest Generation (db.m4.{type})
– Standard - Previous Generation (db.m3.{type})
– Memory Optimized - Current Generation (db.r3.{type})
– Micro instances (db.t1.{type})
• Types: micro - small - ... - xlarge - ... - 10xlarge
– vCPUs: 1 - 40
– Memory: 1 - 160 GiB
– PIOPS-Optimized: Yes / No
– Network Performance: Low to Moderate - 10 Gigabit
Pay attention to these
when choosing the
storage type!
© 2016 Pythian 19
INTRODUCTION
STORAGE TYPES
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html
Magnetic General Purpose SSD Provisioned IOPS
• Spinning disks
• Previous gen / obsolete
• Pay per Use + Size
• ~ 100 IOPS
• 1MiB IO size
• SSD
• Cheap & Low Latency
• 3 IOPS * 1GiB
• Pay per Size
• Up to 160 MiB/s
• Accounted IO size = 32K
• Burstable
• SSD
• Expensive & Low
Latency
• 10 IOPS * 1GiB
• Pay per Size + PIOPS
• Up to 500 MiB/s (or
320MiB/s ???)
• Accounted IO size = 32K
This is super - complicated, read this!
The documentation
is not very clear
PIOPS =
Provisioned IO per Second
© 2016 Pythian 20
• P-IOPS
• GP-SSD
• Magnetic
INTRODUCTION
STORAGE - WHAT ABOUT COST OF 120G AND 1200 IOPS?
https://calculator.s3.amazonaws.com/index.html
My favourite :)
Burstable!
No IOPS
guarantee
© 2016 Pythian 21
INTRODUCTION
STORAGE-RELATED LIMITATIONS
https://calculator.s3.amazonaws.com/index.html
• Different limits apply based on
– Instance Type
– Storage Type
– Storage Size
– PIOPS
• For example:
– EBS Throughput (Mbps) per Instance
– EBS Throughput (Mbps) per EBS Volume
– Max IOPS per Instance
– Max IOPS per Volume
– PIOPS you reserved and paid for
– IOPS differ depending on the size of the IO
I guess I'll have to do some
real benchmarking !
© 2016 Pythian 22
INTRODUCTION
OPTION GROUPS - OPTIONS
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.html
Option Option ID
Oracle Application Express APEX, APEX-DEV
Oracle Enterprise Manager OEM, OEM_AGENT
Oracle Label Security OLS
Oracle Native Network Encryption NATIVE_NETWORK_ENCRYPTION
Oracle SSL SSL
Oracle Statspack STATSPACK
Oracle Time Zone Timezone
Oracle Transparent Data Encryption TDE
Oracle UTL_MAIL UTL_MAIL
Oracle XML DB XMLDB
© 2016 Pythian 23
• Option group
– Defines the set of enabled options
– can be assigned to multiple RDS instances
• Default options groups:
– “default:oracle-ee-11-2” and “default:oracle-ee-12-1”
– has no options enabled by default
– Can't be modified
• Separate PROD, QA, TEST, …
INTRODUCTION
OPTION GROUPS
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.html
© 2016 Pythian 24
INTRODUCTION
PARAMETER GROUPS
• Parameter Groups
– Defines the init parameters
• Remember, you don't have access to “/ as sysdba”
• How do I run “alter system …”
– Can be assigned to multiple instances
– Some parameters are derived from instance settings
• i.e. DB_NAME={DbName}
• Default parameter groups can't be changed
– Even modifiable settings require reboot.
– We used a workaround in few cases - a logon trigger
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.html
© 2016 Pythian 25
• MEMORY_TARGET = {DBInstanceClassMemory*3/4}
– AMM means hugepages are not used
– Swapping is possible
AWS RDS FOR ORACLE
SOME PARAMETERS I FOUND INTERESTING …
Swap usage MB
Connection pool
misconfiguration
Ouch !
© 2016 Pythian 26
• DB_FILE_MULTIBLOCK_READ_COUNT not set (128)
– IO size up to 1MiB issues by the DB
AWS RDS FOR ORACLE
SOME PARAMETERS I FOUND INTERESTING …
Ouch !
A single 1MiB-IO (128 data blocks) from the DB ...
… Is handled by 4 256K-IOs on SSD and ...
… Is accounted as 32 32K-IOs by AWS
Used for IOPS calculation
By AWS
© 2016 Pythian 27
• UNDO_RETENTION not set (the default is 900 seconds)
• We're using parameter group “default.oracle-ee-11.2”
AWS RDS FOR ORACLE
SOME PARAMETERS I FOUND INTERESTING …
Ouch !
• Suddenly:
– “expdp … consistent=y”
– ORA-31693: Table data object "XYZ"."BLAH_BLAH" failed to
load/unload and is being skipped due to error:
ORA-02354: error in exporting/importing data
ORA-01555: snapshot too old: rollback segment number 82 with name
"_SYSSMU82_540458409$" too small
© 2016 Pythian 28
SIZING...
the Oracle RDS
© 2016 Pythian 29
SIZING IT CORRECTLY
IT'S NOT VERY SIMPLE...
• Instance size (CPU / RAM) is
Important:
– Size it too big - cost-efficiency reduces
– Size it too small - performance suffers
• Storage size (GB / IOPS) is Important:
– Size it too big - cost-efficiency reduces
– Size it too small - performance suffers
© 2016 Pythian 30
• How to check the current usage?
– sar - CPU/RAM/IO ?
• 10 minute intervals for past workloads
• Difficult to derive IOPS info
– SGA sizing
– iostat ?
– data from storage?
• What if it's not 1-to-1 move to RDS?
– 1DB with 20+ schemas -> 4 RDS instances?
SIZING IT CORRECTLY
TOOLS
Peak load?
© 2016 Pythian 31
• CPU is simple
– sar 1 99999 > cpu_usage.lst
• Provides CPU usage % for every issue
– ASH ?
• Probably still not granular enough (binary indicator)
• Good to for deriving the proportions of CPU usage
– v$sesstat / v$sysstat could be sampled too
• … we didn't go this way ...
SIZING IT CORRECTLY
CPU IS SIMPLE
© 2016 Pythian 32
SIZING IT CORRECTLY
CPU DISTRIBUTION AMONG SCHEMAS
• Using ASH to derive max CPU usage per hour by
schema
– (but again it ignores “spikes”)
select username, avg(CPUTIME_S), avg(DBTIME_S), avg(CPUTIME_PCT_OF_4CPU), avg(DBTIME_PCT_OF_4CPU),
min(CPUTIME_S), min(DBTIME_S), min(CPUTIME_PCT_OF_4CPU), min(DBTIME_PCT_OF_4CPU),
max(CPUTIME_S), max(DBTIME_S), max(CPUTIME_PCT_OF_4CPU), max(DBTIME_PCT_OF_4CPU)
from (select d.sample_time, u.username, 14400 AVAILABLE_TIME, CPUTIME_S, DBTIME_S,
round(CPUTIME_S/14400*100,1) CPUTIME_PCT_OF_4CPU, round(DBTIME_S/14400*100,1) DBTIME_PCT_OF_4CPU
from (select snap_id, trunc(min(sample_time),'HH24') sample_time, user_id,
10*count(decode(event,null,1,null)) CPUTIME_S, 10*count(*) DBTIME_S
from dba_hist_active_sess_history
where sample_time>= trunc(sysdate-31)
group by snap_id, user_id) d,
dba_users u
where d.user_id=u.user_id)
group by username order by 1;
© 2016 Pythian 33
SIZING IT CORRECTLY
CPU DISTRIBUTION AMONG SCHEMAS
© 2016 Pythian 34
• IO is not simple
– Differently-sized IO done by database
• 8K to 1024K
• … 1 to 32 RDS-IOs per 1 DB-IO
– Identifying spikes is difficult
• AWR (DBA_HIST_IOSTAT_DETAIL)
• SMALL_READ_MEGABYTES / LARGE_READ_MEGABYTES
• SMALL_READ_REQS / LARGE_READ_REQS
SIZING IT CORRECTLY
IO IS NOT SIMPLE
Peak load?
© 2016 Pythian 35
SIZING IT CORRECTLY
IO IS NOT SIMPLE
• Sampling ASM statistics:
– asm_metrics.pl by Bertrand Drouvot
– https://bdrouvot.wordpress.com/2013/10/04/...
• 1-second sampling:
23:00:03 Kby Avg AvgBy/ Kby Avg AvgBy/
23:00:03 DBINST DG Reads/s Read/s ms/Read Read Writes/s Write/s ms/Write Write
23:00:03 ----------- ----------- ------- ------- ------- ------ ------ ------- -------- ------
23:00:03 INST1 146 1360 9.1 9539 435 5578 25.5 13131
23:00:03 INST1 DATA 146 1360 9.1 9539 171 4096 61.7 24528
23:00:03 INST1 RECO 0 0 0.0 0 6 216 86.3 36864
23:00:03 INST1 REDO 0 0 0.0 0 258 1266 0.2 5025
23:00:03 INST2 245 2104 8.3 8794 2109 23955 97.5 11631
23:00:03 INST2 DATA 245 2104 8.3 8794 1998 21648 102.7 11095
23:00:03 INST2 RECO 0 0 0.0 0 3 1968 116.9 671744
23:00:03 INST2 REDO 0 0 0.0 0 108 339 0.1 3214
© 2016 Pythian 36
$ cat process.sh
DG=$2
FILE=$1
grep $2 $1 | awk '{RIO=0; WIO=0; IO=0; if ($7>32768) RIO=($5-($4*32))/32; if ($11>32768)
RIO=($9-($8*32))/32;IO=$4+$8+RIO+WIO; print $1,$2,$4,$5,$7,$8,$9,$11,RIO,WIO,IO;}' | awk '{if ($1==PREV_TIM)
{IO+=$11} else {print PREV_TIM,IO; IO=$11; PREV_TIM=$1}}'| cut -c 1-7,9- | awk '{if ($1==PREV_TIM) {IO+=$2} else
{AVGIOPS=IO/10; print PREV_TIM,AVGIOPS; IO=$2; PREV_TIM=$1}}'
$ process.sh asm_metrics_per_second_20150309_2300.txt DATA
23:00:0 4965.02
23:00:1 18455.1
23:00:2 14806.9
23:00:3 1460.35
23:00:4 1002.33
23:00:5 1600.22
SIZING IT CORRECTLY
IO IS NOT SIMPLE
© 2016 Pythian 37
SIZING IT CORRECTLY
IO IS NOT SIMPLE
What happens to the
spikes if you provision
less IOPS?
© 2016 Pythian 38
• Choose the instance and the storage type based on
– Max IOPS
– HDD size
– Max CPU usage
– RAM requirement
• Workloads vary too much
– getting it exactly right may be tricky
– But at least you shouldn't size it much too large
• Benchmark / Load Test
SIZING IT CORRECTLY
IO IS NOT SIMPLE
https://aws.amazon.com/rds/oracle/details/, http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html
© 2016 Pythian 39
MIGRATING ...
to Oracle RDS
© 2016 Pythian 40
MIGRATING TO ORACLE RDS
MIGRATION OPTIONS
• Offline options:
– Oracle Data Pump
– Oracle Export/Import Utilities
– Oracle SQL*Loader
– Oracle Materialized Views
• Additional options (logical replication):
– Data Migration Service (DMS)
– Oracle GoldenGate (GG)
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Procedural.Importing.html
© 2016 Pythian 41
$ expdp system/***@SOURCE DUMPFILE=data.dmp DIRECTORY=DATA_PUMP_DIR LOGFILE=data.log
flashback_time=systimestamp schemas=USER1
$ sqlplus SYS@SOURCE as sysdba
SQL> create database link TARGET connect to oracle_master identified by * using 'TARGET';
SQL> exec DBMS_FILE_TRANSFER.PUT_FILE(source_directory_object => 'DATA_PUMP_DIR',
source_file_name => 'data.dmp', destination_directory_object => 'DATA_PUMP_DIR',
destination_file_name => 'data.dmp', destination_database => 'TARGET')
$ impdp oracle_master/***@TARGET DUMPFILE=data.dmp DIRECTORY=DATA_PUMP_DIR
LOGFILE=data_imp_1.log
$ sqlplus oracle_master@TARGET
SQL> exec utl_file.fremove('DATA_PUMP_DIR','data.dmp');
SQL> exec utl_file.fremove('DATA_PUMP_DIR','data_imp_1.log');
MIGRATING TO ORACLE RDS
ORACLE DATA PUMP
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Procedural.Importing.html
Make sure you have
enough space on your
RDS instance!
© 2016 Pythian 42
MIGRATING TO ORACLE RDS
ORACLE GOLDENGATE
• Option A
• Option B
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.OracleGoldenGate.html
© 2016 Pythian 43
• Simple version of Logical Replication
– Also capable of converting between different types of DBs
– Schema migration in a few clicks
• New tool (announced on 15 Mar 2016)
• A few limitations
– Unclarity about the initial load
– Lack of "SCN"
– Can't adjust the migration task after starting it
– DDL is not captured
– Some data types not supported
• It should be good enough for simple cases
MIGRATING TO ORACLE RDS
DMS (DATA MIGRATION SERVICE)
http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html#CHAP_Source.Oracle.Configuration
© 2016 Pythian 44
RUNNING AND MONITORING...
© 2016 Pythian 45
RUNNING AND MONITORING...
LIFE WITHOUT "SYSDBA"
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.CommonDBATasks.html
• Only SQL*Net Connectivity
• Master Username
– Limited set of privileges
• Common DBA Tasks for Oracle DB Instances
– Review them carefully, and prepare !
– Some tasks are done differently ...
• killing a session
• exec rdsadmin.rdsadmin_util.kill(..., ..., ...);
• Creating an AWR report
• DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_TEXT
– RDSADMIN.RDSADMIN_UTIL
© 2016 Pythian 46
• No host access
– Prevents setting up some types of monitoring
• Cron jobs
• Certain 3rd party monitoring agents
• What's available?
– Cloudwatch monitoring + alerts
• 1 minute interval / difficult to correlate different metrics
– Enhanced monitoring (no alerts)
• 1s - 60s monitoring interval
– OEM Option (11g DB Control / Database Express 12c )
– OEM_AGENT Option !! (Announced Sep, 2016)
– Custom monitoring over SQL*Net (Avail)
RUNNING AND MONITORING...
MONITORING
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.CommonDBATasks.html
© 2016 Pythian 47
RUNNING AND MONITORING...
Monitoring - CloudWatch RDS / Monitoring
Correlating graphs is
difficult
© 2016 Pythian 48
RUNNING AND MONITORING...
Monitoring - CloudWatch RDS / Create Alarm
Not always simple to
integrate with ticketing
systems
© 2016 Pythian 49
RUNNING AND MONITORING...
Monitoring - Enhanced Monitoring
© 2016 Pythian 50
RUNNING AND MONITORING...
Monitoring - 11g Database Control
© 2016 Pythian 51
RUNNING AND MONITORING...
Monitoring - 12c Database Express
© 2016 Pythian 52
RUNNING AND MONITORING...
Monitoring - OEM_AGENT
I haven't tried this yet, but
knowing the DB Express 12 is
more limited than DB Control -
It's a good thing we have it
now!
Standalone EM 12c CC is
required!
© 2016 Pythian 53
WHEN THINGS WENT BAD…
A few issues that I faced
© 2016 Pythian 54
AWS RDS FOR ORACLE
EXAMPLE 1: LATENCY ISSUES
• In the middle of the migration project
– One database was moved to Oracle RDS
– Another interfacing system remained on-premise
• A batch job runs a LOT SLOWER
– Tracing reveals row-by-row processing between 2 DBs
– A local DB <-> RDS
– Latency issue, each network round-trip took a lot longer.
https://calculator.s3.amazonaws.com/index.html
© 2016 Pythian 55
AWS RDS FOR ORACLE
EXAMPLE 2: ACCESS TO DATA
• A tiny OBIEE Database (40G)
– Db.m4.xlarge
– 4 vCPU + 16G RAM
• The problem
– IO slowness
– Beyond point where IOPS is reasonable to increase to
• The Solution
– Upgrade to Db.r3.xlarge (memory optimized)
– 4vCPU + 30.5 RAM
– Set parameter _serial_direct_reads=never
https://calculator.s3.amazonaws.com/index.html
© 2016 Pythian 56
• A sudden execution plan change for a popular query
•
AWS RDS FOR ORACLE
EXAMPLE 3: A QUERY PLAN CHANGE
https://calculator.s3.amazonaws.com/index.html
© 2016 Pythian 57
-- Create the procedure that will be used to collect the execution plans
create or replace procedure PERF.XXSTABILITY_CAPTURE_PLANS is
cur sys_refcursor;
cursor clist is with raw_sqlids as (select sql_id from v$sqlarea
where sql_id in (select sql_id from v$active_session_history
where sample_time>=sysdate-1/24 and sql_plan_hash_value>0
and machine like '%-hesvc-app0%')
and plan_hash_value>0 and executions>2
union
select sql_id from v$sqlarea
where sql_id in (select sql_id from v$open_cursor where
sid in (select sid from v$session where machine like '%-hesvc-app0%'))
and plan_hash_value>0 and executions>2 and parsing_schema_name not in
('ANONYMOUS','APEX_030200','APEX_040000','APEX_SSO','APPQOSSYS',
'CTXSYS','DBSNMP','DIP','EXFSYS','FLOWS_FILES','MDSYS','OLAPSYS','ORACLE_OCM','ORDDATA','ORDPLUGINS','ORDSYS','OUTLN','OWBSYS
','SI_INFORMTN_SCHEMA','SQLTXADMIN','SQLTXPLAIN','SYS','SYSMAN','SYSTEM','TRCANLZR','WMSYS','XDB','XS$NULL')),
sqlids as (select distinct ''''||sql_id||'''' sql_id, trunc((rownum-1)/200) rn from raw_sqlids)
select listagg(s.sql_id,',') within group (order by s.sql_id) as sql_id_filter from sqlids s group by s.rn;
c clist%rowtype;
BEGIN
for c in clist loop
OPEN cur FOR SELECT VALUE(P) FROM table(dbms_sqltune.select_cursor_cache(basic_filter=>'sql_id
in('||c.sql_id_filter||')', attribute_list=>'ALL')) P;
DBMS_SQLTUNE.LOAD_SQLSET(load_option=>'MERGE',sqlset_name => 'XXSTABILITY_EXECUTION_PLANS', populate_cursor => cur);
CLOSE cur;
end loop;
Commit;
END;
/
AWS RDS FOR ORACLE
EXAMPLE 3: PRESERVING GOOD EXECUTION PLANS
© 2016 Pythian 58
-- Create the Scheduler Job which will run on every hour's 47th minute
Begin
Dbms_scheduler.create_job
(job_name => 'COLLECT_XXSTABILITY_PLANS',
job_type => 'STORED_PROCEDURE',
job_action => 'PERF.XXSTABILITY_CAPTURE_PLANS',
start_date => SYSDATE,
repeat_interval => 'FREQ=HOURLY; INTERVAL=1; BYMINUTE=47;',
enabled => TRUE);
End;
/
-- Loading the baseline from SELECT_SQLSET for a specific sql_id and plan
VARIABLE cnt NUMBER
EXECUTE :cnt := DBMS_SPM.LOAD_PLANS_FROM_SQLSET( -
sqlset_name => 'XXSTABILITY_EXECUTION_PLANS', -
basic_filter => 'sql_id=''dtzsc12fbbjk2'' and plan_hash_value=2896891279');
AWS RDS FOR ORACLE
EXAMPLE 3: PRESERVING EXECUTION PLANS
© 2016 Pythian 59
AWS RDS FOR ORACLE
EXAMPLE 4: COMBINED MAINTENANCE
• Combined maintenance - 30 minutes allocated
– Take a snapshot
– Change the instance size
• Oops!
– Snapshot takes just few seconds
• … before it's copied to S3
– “Creating Snapshot” for 45 minutes
https://calculator.s3.amazonaws.com/index.html
© 2016 Pythian 60
SUMMARY
© 2016 Pythian 61
• Simple to use, but not suitable for massive workloads
– Consider Oracle DB on EC2
• Difficult to size (especially storage)
– Load testing and Benchmarking
– 3000 IOPS or less -> Use gp2 (General Purpose SSD) volumes
• Get the config right from the beginning
– Changing certain things require downtime
• Practice being an Oracle RDS DBA
– Some things are different
SUMMARY
Oracle RDS
© 2016 Pythian 62
•
SUMMARY
Beware of the most
dangerous checkbox
in your career.
© 2016 Pythian 63
THANK YOU
@MarisDBA
Elsins@pythian.com

Weitere ähnliche Inhalte

Was ist angesagt?

PgQ Generic high-performance queue for PostgreSQL
PgQ Generic high-performance queue for PostgreSQLPgQ Generic high-performance queue for PostgreSQL
PgQ Generic high-performance queue for PostgreSQL
elliando dias
 
Kubernetes Operators And The Redis Enterprise Journey: Michal Rabinowitch
Kubernetes Operators And The Redis Enterprise Journey: Michal RabinowitchKubernetes Operators And The Redis Enterprise Journey: Michal Rabinowitch
Kubernetes Operators And The Redis Enterprise Journey: Michal Rabinowitch
Redis Labs
 

Was ist angesagt? (20)

Deep Dive on Amazon Aurora
Deep Dive on Amazon AuroraDeep Dive on Amazon Aurora
Deep Dive on Amazon Aurora
 
Cloud Native PostgreSQL
Cloud Native PostgreSQLCloud Native PostgreSQL
Cloud Native PostgreSQL
 
Oracle Databases on AWS - Getting the Best Out of RDS and EC2
Oracle Databases on AWS - Getting the Best Out of RDS and EC2Oracle Databases on AWS - Getting the Best Out of RDS and EC2
Oracle Databases on AWS - Getting the Best Out of RDS and EC2
 
Open shift 4 infra deep dive
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep dive
 
PgQ Generic high-performance queue for PostgreSQL
PgQ Generic high-performance queue for PostgreSQLPgQ Generic high-performance queue for PostgreSQL
PgQ Generic high-performance queue for PostgreSQL
 
Cost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSCost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWS
 
Oracle Database Migration to Oracle Cloud Infrastructure
Oracle Database Migration to Oracle Cloud InfrastructureOracle Database Migration to Oracle Cloud Infrastructure
Oracle Database Migration to Oracle Cloud Infrastructure
 
Kubernetes Operators And The Redis Enterprise Journey: Michal Rabinowitch
Kubernetes Operators And The Redis Enterprise Journey: Michal RabinowitchKubernetes Operators And The Redis Enterprise Journey: Michal Rabinowitch
Kubernetes Operators And The Redis Enterprise Journey: Michal Rabinowitch
 
Ceph QoS: How to support QoS in distributed storage system - Taewoong Kim
Ceph QoS: How to support QoS in distributed storage system - Taewoong KimCeph QoS: How to support QoS in distributed storage system - Taewoong Kim
Ceph QoS: How to support QoS in distributed storage system - Taewoong Kim
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized WorldPostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized World
 
Ceph Performance and Sizing Guide
Ceph Performance and Sizing GuideCeph Performance and Sizing Guide
Ceph Performance and Sizing Guide
 
Monitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheusMonitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheus
 
Getting started with MariaDB with Docker
Getting started with MariaDB with DockerGetting started with MariaDB with Docker
Getting started with MariaDB with Docker
 
Oracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLONOracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLON
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
 
Migrating Oracle to PostgreSQL
Migrating Oracle to PostgreSQLMigrating Oracle to PostgreSQL
Migrating Oracle to PostgreSQL
 
Hardening Kafka Replication
Hardening Kafka Replication Hardening Kafka Replication
Hardening Kafka Replication
 
From airflow to google cloud composer
From airflow to google cloud composerFrom airflow to google cloud composer
From airflow to google cloud composer
 
Navigating Disaster Recovery in Kubernetes and CNCF Crossplane
Navigating Disaster Recovery in Kubernetes and CNCF Crossplane Navigating Disaster Recovery in Kubernetes and CNCF Crossplane
Navigating Disaster Recovery in Kubernetes and CNCF Crossplane
 
GoldenGateテクニカルセミナー4「テクニカルコンサルタントが語るOracle GoldenGate現場で使える極意」(2016/5/11)
GoldenGateテクニカルセミナー4「テクニカルコンサルタントが語るOracle GoldenGate現場で使える極意」(2016/5/11)GoldenGateテクニカルセミナー4「テクニカルコンサルタントが語るOracle GoldenGate現場で使える極意」(2016/5/11)
GoldenGateテクニカルセミナー4「テクニカルコンサルタントが語るOracle GoldenGate現場で使える極意」(2016/5/11)
 

Ähnlich wie Migrating and Running DBs on Amazon RDS for Oracle

Ähnlich wie Migrating and Running DBs on Amazon RDS for Oracle (20)

SQL Server on AWS
SQL Server on AWSSQL Server on AWS
SQL Server on AWS
 
SQL Server on AWS
SQL Server on AWSSQL Server on AWS
SQL Server on AWS
 
Running Oracle EBS in the cloud (UKOUG APPS16 edition)
Running Oracle EBS in the cloud (UKOUG APPS16 edition)Running Oracle EBS in the cloud (UKOUG APPS16 edition)
Running Oracle EBS in the cloud (UKOUG APPS16 edition)
 
Running Oracle EBS in the cloud (DOAG TECH17 edition)
Running Oracle EBS in the cloud (DOAG TECH17 edition)Running Oracle EBS in the cloud (DOAG TECH17 edition)
Running Oracle EBS in the cloud (DOAG TECH17 edition)
 
MySQL and MariaDB
MySQL and MariaDBMySQL and MariaDB
MySQL and MariaDB
 
AWS Webcast - Best Practices for Deploying SAP Workloads on AWS
AWS Webcast - Best Practices for Deploying SAP Workloads on AWSAWS Webcast - Best Practices for Deploying SAP Workloads on AWS
AWS Webcast - Best Practices for Deploying SAP Workloads on AWS
 
Introduction to Database Services
Introduction to Database ServicesIntroduction to Database Services
Introduction to Database Services
 
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
[Pgday.Seoul 2018]  AWS Cloud 환경에서 PostgreSQL 구축하기[Pgday.Seoul 2018]  AWS Cloud 환경에서 PostgreSQL 구축하기
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
 
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
 
Deep Dive On Amazon Redshift
Deep Dive On Amazon RedshiftDeep Dive On Amazon Redshift
Deep Dive On Amazon Redshift
 
AWS Activate webinar - Scalable databases for fast growing startups
AWS Activate webinar - Scalable databases for fast growing startupsAWS Activate webinar - Scalable databases for fast growing startups
AWS Activate webinar - Scalable databases for fast growing startups
 
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
 
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
 
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
 
Amazon Relational Database Service – How is it different to what you do today ?
Amazon Relational Database Service – How is it different to what you do today ?Amazon Relational Database Service – How is it different to what you do today ?
Amazon Relational Database Service – How is it different to what you do today ?
 
MySQL and MariaDB
MySQL and MariaDBMySQL and MariaDB
MySQL and MariaDB
 
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web Services
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web ServicesAWS March 2016 Webinar Series - Managed Database Services on Amazon Web Services
AWS March 2016 Webinar Series - Managed Database Services on Amazon Web Services
 
Getting Started with Managed Database Services on AWS - September 2016 Webina...
Getting Started with Managed Database Services on AWS - September 2016 Webina...Getting Started with Managed Database Services on AWS - September 2016 Webina...
Getting Started with Managed Database Services on AWS - September 2016 Webina...
 
Open Source Databases on the Cloud - Peter Dachnowicz
Open Source Databases on the Cloud - Peter DachnowiczOpen Source Databases on the Cloud - Peter Dachnowicz
Open Source Databases on the Cloud - Peter Dachnowicz
 

Mehr von Maris Elsins

Mehr von Maris Elsins (18)

An AWS DMS Replication Journey from Oracle to Aurora MySQL
An AWS DMS Replication Journey from Oracle to Aurora MySQLAn AWS DMS Replication Journey from Oracle to Aurora MySQL
An AWS DMS Replication Journey from Oracle to Aurora MySQL
 
Mining AWR V2 - Trend Analysis
Mining AWR V2 - Trend AnalysisMining AWR V2 - Trend Analysis
Mining AWR V2 - Trend Analysis
 
DB12c: All You Need to Know About the Resource Manager
DB12c: All You Need to Know About the Resource ManagerDB12c: All You Need to Know About the Resource Manager
DB12c: All You Need to Know About the Resource Manager
 
C15LV: Ins and Outs of Concurrent Processing Configuration in Oracle e-Busine...
C15LV: Ins and Outs of Concurrent Processing Configuration in Oracle e-Busine...C15LV: Ins and Outs of Concurrent Processing Configuration in Oracle e-Busine...
C15LV: Ins and Outs of Concurrent Processing Configuration in Oracle e-Busine...
 
Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...
Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...
Mining the AWR: Alternative Methods for Identification of the Top SQLs (inclu...
 
Database as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance PlatformDatabase as a Service on the Oracle Database Appliance Platform
Database as a Service on the Oracle Database Appliance Platform
 
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan InstabilityLVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
 
OUG Harmony 2012 - Using SQL Plan Baselines for Performance Testing
OUG Harmony 2012 -  Using SQL Plan Baselines for Performance TestingOUG Harmony 2012 -  Using SQL Plan Baselines for Performance Testing
OUG Harmony 2012 - Using SQL Plan Baselines for Performance Testing
 
LVOUG meetup #4 - Case Study 10g to 11g
LVOUG meetup #4 - Case Study 10g to 11gLVOUG meetup #4 - Case Study 10g to 11g
LVOUG meetup #4 - Case Study 10g to 11g
 
Surviving the Crisis With the Help of Oracle Database Resource Manager
Surviving the Crisis With the Help of Oracle Database Resource ManagerSurviving the Crisis With the Help of Oracle Database Resource Manager
Surviving the Crisis With the Help of Oracle Database Resource Manager
 
Concurrent Processing Performance Analysis for Apps DBAs
Concurrent Processing Performance Analysis for Apps DBAsConcurrent Processing Performance Analysis for Apps DBAs
Concurrent Processing Performance Analysis for Apps DBAs
 
Simplify Consolidation with Oracle Database 12c
Simplify Consolidation with Oracle Database 12cSimplify Consolidation with Oracle Database 12c
Simplify Consolidation with Oracle Database 12c
 
10 ways to improve your rman script
10 ways to improve your rman script10 ways to improve your rman script
10 ways to improve your rman script
 
Wildcard13 - warmup slides for the "Roundtable discussion with Oracle Profess...
Wildcard13 - warmup slides for the "Roundtable discussion with Oracle Profess...Wildcard13 - warmup slides for the "Roundtable discussion with Oracle Profess...
Wildcard13 - warmup slides for the "Roundtable discussion with Oracle Profess...
 
Whitepaper: Running Oracle e-Business Suite Database on Oracle Database Appli...
Whitepaper: Running Oracle e-Business Suite Database on Oracle Database Appli...Whitepaper: Running Oracle e-Business Suite Database on Oracle Database Appli...
Whitepaper: Running Oracle e-Business Suite Database on Oracle Database Appli...
 
Running E-Business Suite Database on Oracle Database Appliance
Running E-Business Suite Database on Oracle Database ApplianceRunning E-Business Suite Database on Oracle Database Appliance
Running E-Business Suite Database on Oracle Database Appliance
 
Internals of concurent managers
Internals of concurent managersInternals of concurent managers
Internals of concurent managers
 
Using SQL Plan Management for Performance Testing
Using SQL Plan Management for Performance TestingUsing SQL Plan Management for Performance Testing
Using SQL Plan Management for Performance Testing
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

Migrating and Running DBs on Amazon RDS for Oracle

  • 1. © 2016 Pythian 1 Migrating and Running DBs on Amazon RDS for Oracle MARIS ELSINS Lead Database Consultant
  • 2. © 2016 Pythian 2 Maris Elsins Lead Database Consultant At Pythian since 2011 Located in Riga, Latvia Oracle [Apps] DBA since 2005 Speaker at conferences since 2007 @MarisDBA elsins@pythian.com http://bit.ly/getMOSPatchV2
  • 3. © 2016 Pythian 3 Migrating and Running DBs on Amazon RDS for Oracle Mining AWR V2: Trend Analysis Today: 17:55, Hall 9
  • 5. © 2016 Pythian 5 ABOUT PYTHIAN Pythian’s 400+ IT professionals help companies adopt and manage disruptive technologies to better compete
  • 6. © 2016 Pythian 6 Systems currently managed by Pythian EXPERIENCED Pythian experts in 35 countries GLOBAL Millennia of experience gathered and shared over 19 years EXPERTS 11,800 2400
  • 7. © 2016 Pythian 7 • Intro... • Sizing... • Migrating... • Running and Monitoring... • When things go bad... AGENDA
  • 8. © 2016 Pythian 8 … these are just few of my observations • Why Cloud? • Choosing between cloud vendors • Terminology • Complete pricing guide • The right way to do anything I mean it! NOT ON AGENDA
  • 9. © 2016 Pythian 9 DISCLAIMER OK, YOU CAUGHT ME ... I may have a few “Ouch!” slides in the presentation, that probably will make you think Oracle RDS is no good. It's not the intention. I honestly think Oracle RDS is a great service for the appropriate workload, and if it's done right.
  • 10. © 2016 Pythian 10 BEFORE WE START ... Can I comment or ask questions during the presentation? Photo by Day Donaldson / CC BY 2.0
  • 11. © 2016 Pythian 11 INTRODUCTION ... to RDS for Oracle
  • 12. © 2016 Pythian 12 AWS RDS FOR ORACLE INTRODUCTION - REGIONS https://aws.amazon.com/about-aws/global-infrastructure/
  • 13. © 2016 Pythian 13 INTRODUCTION WHAT IS RDS • Relational Database Service • PaaS (DBaaS) • Managed by AWS – Setup / Provisioning – Backups – Maintenance / Patching – Alerting – DR – ... • SSH Access / SQL*Net connectivity
  • 14. © 2016 Pythian 14 • 11gR2: – 11.2.0.2.v3 - 11.2.0.2.v7 – 11.2.0.3.v1 - 11.2.0.3.v4 – 11.2.0.4.v1 - 11.2.0.4.v9 • 12cR1: – 12.1.0.1.v1 - 12.1.0.1.v6 – 12.1.0.2.v1 - 12.1.0.2.v5 • Engine versions differ by included patches – PSU / DST / GG / + critical one-offs INTRODUCTION DB ENGINES http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.PatchComposition.html What if I need a specific one-off?
  • 15. © 2016 Pythian 15 INTRODUCTION DATABASE EDITIONS https://aws.amazon.com/rds/oracle/details/ Edition License Included Bring Your Own License SE One ✓ ✓ SE Two ✓ ✓ SE ✓ EE ✓
  • 16. © 2016 Pythian 16 INTRODUCTION LICENSING • Two important sources: – Licensing Oracle Software in the Cloud Computing Environment – Virtual Cores by Amazon EC2 and RDS DB Instance Type • Virtual cores != Virtual CPUs (vCPUs) – vCPU is actually a HyperThread • Core Factor of 0.5 applies to "Virtual cores" • Max sizing for SE: – SE: 16 Virtual Cores | 32 vCPU – SE: One/Two: 8 Virtual Cores | 16 vCPU
  • 17. © 2016 Pythian 17 INTRODUCTION LICENSING EXAMPLE • Oracle EE • 16 vCPU = 8 virtual cores • 8 virtual cores * 0.5 (core factor) = 4 Licences
  • 18. © 2016 Pythian 18 INTRODUCTION INSTANCE CLASSES AND TYPES https://aws.amazon.com/rds/oracle/details/ • Instance Classes (available for RDS) – Standard - Latest Generation (db.m4.{type}) – Standard - Previous Generation (db.m3.{type}) – Memory Optimized - Current Generation (db.r3.{type}) – Micro instances (db.t1.{type}) • Types: micro - small - ... - xlarge - ... - 10xlarge – vCPUs: 1 - 40 – Memory: 1 - 160 GiB – PIOPS-Optimized: Yes / No – Network Performance: Low to Moderate - 10 Gigabit Pay attention to these when choosing the storage type!
  • 19. © 2016 Pythian 19 INTRODUCTION STORAGE TYPES http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html Magnetic General Purpose SSD Provisioned IOPS • Spinning disks • Previous gen / obsolete • Pay per Use + Size • ~ 100 IOPS • 1MiB IO size • SSD • Cheap & Low Latency • 3 IOPS * 1GiB • Pay per Size • Up to 160 MiB/s • Accounted IO size = 32K • Burstable • SSD • Expensive & Low Latency • 10 IOPS * 1GiB • Pay per Size + PIOPS • Up to 500 MiB/s (or 320MiB/s ???) • Accounted IO size = 32K This is super - complicated, read this! The documentation is not very clear PIOPS = Provisioned IO per Second
  • 20. © 2016 Pythian 20 • P-IOPS • GP-SSD • Magnetic INTRODUCTION STORAGE - WHAT ABOUT COST OF 120G AND 1200 IOPS? https://calculator.s3.amazonaws.com/index.html My favourite :) Burstable! No IOPS guarantee
  • 21. © 2016 Pythian 21 INTRODUCTION STORAGE-RELATED LIMITATIONS https://calculator.s3.amazonaws.com/index.html • Different limits apply based on – Instance Type – Storage Type – Storage Size – PIOPS • For example: – EBS Throughput (Mbps) per Instance – EBS Throughput (Mbps) per EBS Volume – Max IOPS per Instance – Max IOPS per Volume – PIOPS you reserved and paid for – IOPS differ depending on the size of the IO I guess I'll have to do some real benchmarking !
  • 22. © 2016 Pythian 22 INTRODUCTION OPTION GROUPS - OPTIONS http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.html Option Option ID Oracle Application Express APEX, APEX-DEV Oracle Enterprise Manager OEM, OEM_AGENT Oracle Label Security OLS Oracle Native Network Encryption NATIVE_NETWORK_ENCRYPTION Oracle SSL SSL Oracle Statspack STATSPACK Oracle Time Zone Timezone Oracle Transparent Data Encryption TDE Oracle UTL_MAIL UTL_MAIL Oracle XML DB XMLDB
  • 23. © 2016 Pythian 23 • Option group – Defines the set of enabled options – can be assigned to multiple RDS instances • Default options groups: – “default:oracle-ee-11-2” and “default:oracle-ee-12-1” – has no options enabled by default – Can't be modified • Separate PROD, QA, TEST, … INTRODUCTION OPTION GROUPS http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.html
  • 24. © 2016 Pythian 24 INTRODUCTION PARAMETER GROUPS • Parameter Groups – Defines the init parameters • Remember, you don't have access to “/ as sysdba” • How do I run “alter system …” – Can be assigned to multiple instances – Some parameters are derived from instance settings • i.e. DB_NAME={DbName} • Default parameter groups can't be changed – Even modifiable settings require reboot. – We used a workaround in few cases - a logon trigger http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.html
  • 25. © 2016 Pythian 25 • MEMORY_TARGET = {DBInstanceClassMemory*3/4} – AMM means hugepages are not used – Swapping is possible AWS RDS FOR ORACLE SOME PARAMETERS I FOUND INTERESTING … Swap usage MB Connection pool misconfiguration Ouch !
  • 26. © 2016 Pythian 26 • DB_FILE_MULTIBLOCK_READ_COUNT not set (128) – IO size up to 1MiB issues by the DB AWS RDS FOR ORACLE SOME PARAMETERS I FOUND INTERESTING … Ouch ! A single 1MiB-IO (128 data blocks) from the DB ... … Is handled by 4 256K-IOs on SSD and ... … Is accounted as 32 32K-IOs by AWS Used for IOPS calculation By AWS
  • 27. © 2016 Pythian 27 • UNDO_RETENTION not set (the default is 900 seconds) • We're using parameter group “default.oracle-ee-11.2” AWS RDS FOR ORACLE SOME PARAMETERS I FOUND INTERESTING … Ouch ! • Suddenly: – “expdp … consistent=y” – ORA-31693: Table data object "XYZ"."BLAH_BLAH" failed to load/unload and is being skipped due to error: ORA-02354: error in exporting/importing data ORA-01555: snapshot too old: rollback segment number 82 with name "_SYSSMU82_540458409$" too small
  • 28. © 2016 Pythian 28 SIZING... the Oracle RDS
  • 29. © 2016 Pythian 29 SIZING IT CORRECTLY IT'S NOT VERY SIMPLE... • Instance size (CPU / RAM) is Important: – Size it too big - cost-efficiency reduces – Size it too small - performance suffers • Storage size (GB / IOPS) is Important: – Size it too big - cost-efficiency reduces – Size it too small - performance suffers
  • 30. © 2016 Pythian 30 • How to check the current usage? – sar - CPU/RAM/IO ? • 10 minute intervals for past workloads • Difficult to derive IOPS info – SGA sizing – iostat ? – data from storage? • What if it's not 1-to-1 move to RDS? – 1DB with 20+ schemas -> 4 RDS instances? SIZING IT CORRECTLY TOOLS Peak load?
  • 31. © 2016 Pythian 31 • CPU is simple – sar 1 99999 > cpu_usage.lst • Provides CPU usage % for every issue – ASH ? • Probably still not granular enough (binary indicator) • Good to for deriving the proportions of CPU usage – v$sesstat / v$sysstat could be sampled too • … we didn't go this way ... SIZING IT CORRECTLY CPU IS SIMPLE
  • 32. © 2016 Pythian 32 SIZING IT CORRECTLY CPU DISTRIBUTION AMONG SCHEMAS • Using ASH to derive max CPU usage per hour by schema – (but again it ignores “spikes”) select username, avg(CPUTIME_S), avg(DBTIME_S), avg(CPUTIME_PCT_OF_4CPU), avg(DBTIME_PCT_OF_4CPU), min(CPUTIME_S), min(DBTIME_S), min(CPUTIME_PCT_OF_4CPU), min(DBTIME_PCT_OF_4CPU), max(CPUTIME_S), max(DBTIME_S), max(CPUTIME_PCT_OF_4CPU), max(DBTIME_PCT_OF_4CPU) from (select d.sample_time, u.username, 14400 AVAILABLE_TIME, CPUTIME_S, DBTIME_S, round(CPUTIME_S/14400*100,1) CPUTIME_PCT_OF_4CPU, round(DBTIME_S/14400*100,1) DBTIME_PCT_OF_4CPU from (select snap_id, trunc(min(sample_time),'HH24') sample_time, user_id, 10*count(decode(event,null,1,null)) CPUTIME_S, 10*count(*) DBTIME_S from dba_hist_active_sess_history where sample_time>= trunc(sysdate-31) group by snap_id, user_id) d, dba_users u where d.user_id=u.user_id) group by username order by 1;
  • 33. © 2016 Pythian 33 SIZING IT CORRECTLY CPU DISTRIBUTION AMONG SCHEMAS
  • 34. © 2016 Pythian 34 • IO is not simple – Differently-sized IO done by database • 8K to 1024K • … 1 to 32 RDS-IOs per 1 DB-IO – Identifying spikes is difficult • AWR (DBA_HIST_IOSTAT_DETAIL) • SMALL_READ_MEGABYTES / LARGE_READ_MEGABYTES • SMALL_READ_REQS / LARGE_READ_REQS SIZING IT CORRECTLY IO IS NOT SIMPLE Peak load?
  • 35. © 2016 Pythian 35 SIZING IT CORRECTLY IO IS NOT SIMPLE • Sampling ASM statistics: – asm_metrics.pl by Bertrand Drouvot – https://bdrouvot.wordpress.com/2013/10/04/... • 1-second sampling: 23:00:03 Kby Avg AvgBy/ Kby Avg AvgBy/ 23:00:03 DBINST DG Reads/s Read/s ms/Read Read Writes/s Write/s ms/Write Write 23:00:03 ----------- ----------- ------- ------- ------- ------ ------ ------- -------- ------ 23:00:03 INST1 146 1360 9.1 9539 435 5578 25.5 13131 23:00:03 INST1 DATA 146 1360 9.1 9539 171 4096 61.7 24528 23:00:03 INST1 RECO 0 0 0.0 0 6 216 86.3 36864 23:00:03 INST1 REDO 0 0 0.0 0 258 1266 0.2 5025 23:00:03 INST2 245 2104 8.3 8794 2109 23955 97.5 11631 23:00:03 INST2 DATA 245 2104 8.3 8794 1998 21648 102.7 11095 23:00:03 INST2 RECO 0 0 0.0 0 3 1968 116.9 671744 23:00:03 INST2 REDO 0 0 0.0 0 108 339 0.1 3214
  • 36. © 2016 Pythian 36 $ cat process.sh DG=$2 FILE=$1 grep $2 $1 | awk '{RIO=0; WIO=0; IO=0; if ($7>32768) RIO=($5-($4*32))/32; if ($11>32768) RIO=($9-($8*32))/32;IO=$4+$8+RIO+WIO; print $1,$2,$4,$5,$7,$8,$9,$11,RIO,WIO,IO;}' | awk '{if ($1==PREV_TIM) {IO+=$11} else {print PREV_TIM,IO; IO=$11; PREV_TIM=$1}}'| cut -c 1-7,9- | awk '{if ($1==PREV_TIM) {IO+=$2} else {AVGIOPS=IO/10; print PREV_TIM,AVGIOPS; IO=$2; PREV_TIM=$1}}' $ process.sh asm_metrics_per_second_20150309_2300.txt DATA 23:00:0 4965.02 23:00:1 18455.1 23:00:2 14806.9 23:00:3 1460.35 23:00:4 1002.33 23:00:5 1600.22 SIZING IT CORRECTLY IO IS NOT SIMPLE
  • 37. © 2016 Pythian 37 SIZING IT CORRECTLY IO IS NOT SIMPLE What happens to the spikes if you provision less IOPS?
  • 38. © 2016 Pythian 38 • Choose the instance and the storage type based on – Max IOPS – HDD size – Max CPU usage – RAM requirement • Workloads vary too much – getting it exactly right may be tricky – But at least you shouldn't size it much too large • Benchmark / Load Test SIZING IT CORRECTLY IO IS NOT SIMPLE https://aws.amazon.com/rds/oracle/details/, http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html
  • 39. © 2016 Pythian 39 MIGRATING ... to Oracle RDS
  • 40. © 2016 Pythian 40 MIGRATING TO ORACLE RDS MIGRATION OPTIONS • Offline options: – Oracle Data Pump – Oracle Export/Import Utilities – Oracle SQL*Loader – Oracle Materialized Views • Additional options (logical replication): – Data Migration Service (DMS) – Oracle GoldenGate (GG) http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Procedural.Importing.html
  • 41. © 2016 Pythian 41 $ expdp system/***@SOURCE DUMPFILE=data.dmp DIRECTORY=DATA_PUMP_DIR LOGFILE=data.log flashback_time=systimestamp schemas=USER1 $ sqlplus SYS@SOURCE as sysdba SQL> create database link TARGET connect to oracle_master identified by * using 'TARGET'; SQL> exec DBMS_FILE_TRANSFER.PUT_FILE(source_directory_object => 'DATA_PUMP_DIR', source_file_name => 'data.dmp', destination_directory_object => 'DATA_PUMP_DIR', destination_file_name => 'data.dmp', destination_database => 'TARGET') $ impdp oracle_master/***@TARGET DUMPFILE=data.dmp DIRECTORY=DATA_PUMP_DIR LOGFILE=data_imp_1.log $ sqlplus oracle_master@TARGET SQL> exec utl_file.fremove('DATA_PUMP_DIR','data.dmp'); SQL> exec utl_file.fremove('DATA_PUMP_DIR','data_imp_1.log'); MIGRATING TO ORACLE RDS ORACLE DATA PUMP http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Oracle.Procedural.Importing.html Make sure you have enough space on your RDS instance!
  • 42. © 2016 Pythian 42 MIGRATING TO ORACLE RDS ORACLE GOLDENGATE • Option A • Option B http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.OracleGoldenGate.html
  • 43. © 2016 Pythian 43 • Simple version of Logical Replication – Also capable of converting between different types of DBs – Schema migration in a few clicks • New tool (announced on 15 Mar 2016) • A few limitations – Unclarity about the initial load – Lack of "SCN" – Can't adjust the migration task after starting it – DDL is not captured – Some data types not supported • It should be good enough for simple cases MIGRATING TO ORACLE RDS DMS (DATA MIGRATION SERVICE) http://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html#CHAP_Source.Oracle.Configuration
  • 44. © 2016 Pythian 44 RUNNING AND MONITORING...
  • 45. © 2016 Pythian 45 RUNNING AND MONITORING... LIFE WITHOUT "SYSDBA" http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.CommonDBATasks.html • Only SQL*Net Connectivity • Master Username – Limited set of privileges • Common DBA Tasks for Oracle DB Instances – Review them carefully, and prepare ! – Some tasks are done differently ... • killing a session • exec rdsadmin.rdsadmin_util.kill(..., ..., ...); • Creating an AWR report • DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_TEXT – RDSADMIN.RDSADMIN_UTIL
  • 46. © 2016 Pythian 46 • No host access – Prevents setting up some types of monitoring • Cron jobs • Certain 3rd party monitoring agents • What's available? – Cloudwatch monitoring + alerts • 1 minute interval / difficult to correlate different metrics – Enhanced monitoring (no alerts) • 1s - 60s monitoring interval – OEM Option (11g DB Control / Database Express 12c ) – OEM_AGENT Option !! (Announced Sep, 2016) – Custom monitoring over SQL*Net (Avail) RUNNING AND MONITORING... MONITORING http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.CommonDBATasks.html
  • 47. © 2016 Pythian 47 RUNNING AND MONITORING... Monitoring - CloudWatch RDS / Monitoring Correlating graphs is difficult
  • 48. © 2016 Pythian 48 RUNNING AND MONITORING... Monitoring - CloudWatch RDS / Create Alarm Not always simple to integrate with ticketing systems
  • 49. © 2016 Pythian 49 RUNNING AND MONITORING... Monitoring - Enhanced Monitoring
  • 50. © 2016 Pythian 50 RUNNING AND MONITORING... Monitoring - 11g Database Control
  • 51. © 2016 Pythian 51 RUNNING AND MONITORING... Monitoring - 12c Database Express
  • 52. © 2016 Pythian 52 RUNNING AND MONITORING... Monitoring - OEM_AGENT I haven't tried this yet, but knowing the DB Express 12 is more limited than DB Control - It's a good thing we have it now! Standalone EM 12c CC is required!
  • 53. © 2016 Pythian 53 WHEN THINGS WENT BAD… A few issues that I faced
  • 54. © 2016 Pythian 54 AWS RDS FOR ORACLE EXAMPLE 1: LATENCY ISSUES • In the middle of the migration project – One database was moved to Oracle RDS – Another interfacing system remained on-premise • A batch job runs a LOT SLOWER – Tracing reveals row-by-row processing between 2 DBs – A local DB <-> RDS – Latency issue, each network round-trip took a lot longer. https://calculator.s3.amazonaws.com/index.html
  • 55. © 2016 Pythian 55 AWS RDS FOR ORACLE EXAMPLE 2: ACCESS TO DATA • A tiny OBIEE Database (40G) – Db.m4.xlarge – 4 vCPU + 16G RAM • The problem – IO slowness – Beyond point where IOPS is reasonable to increase to • The Solution – Upgrade to Db.r3.xlarge (memory optimized) – 4vCPU + 30.5 RAM – Set parameter _serial_direct_reads=never https://calculator.s3.amazonaws.com/index.html
  • 56. © 2016 Pythian 56 • A sudden execution plan change for a popular query • AWS RDS FOR ORACLE EXAMPLE 3: A QUERY PLAN CHANGE https://calculator.s3.amazonaws.com/index.html
  • 57. © 2016 Pythian 57 -- Create the procedure that will be used to collect the execution plans create or replace procedure PERF.XXSTABILITY_CAPTURE_PLANS is cur sys_refcursor; cursor clist is with raw_sqlids as (select sql_id from v$sqlarea where sql_id in (select sql_id from v$active_session_history where sample_time>=sysdate-1/24 and sql_plan_hash_value>0 and machine like '%-hesvc-app0%') and plan_hash_value>0 and executions>2 union select sql_id from v$sqlarea where sql_id in (select sql_id from v$open_cursor where sid in (select sid from v$session where machine like '%-hesvc-app0%')) and plan_hash_value>0 and executions>2 and parsing_schema_name not in ('ANONYMOUS','APEX_030200','APEX_040000','APEX_SSO','APPQOSSYS', 'CTXSYS','DBSNMP','DIP','EXFSYS','FLOWS_FILES','MDSYS','OLAPSYS','ORACLE_OCM','ORDDATA','ORDPLUGINS','ORDSYS','OUTLN','OWBSYS ','SI_INFORMTN_SCHEMA','SQLTXADMIN','SQLTXPLAIN','SYS','SYSMAN','SYSTEM','TRCANLZR','WMSYS','XDB','XS$NULL')), sqlids as (select distinct ''''||sql_id||'''' sql_id, trunc((rownum-1)/200) rn from raw_sqlids) select listagg(s.sql_id,',') within group (order by s.sql_id) as sql_id_filter from sqlids s group by s.rn; c clist%rowtype; BEGIN for c in clist loop OPEN cur FOR SELECT VALUE(P) FROM table(dbms_sqltune.select_cursor_cache(basic_filter=>'sql_id in('||c.sql_id_filter||')', attribute_list=>'ALL')) P; DBMS_SQLTUNE.LOAD_SQLSET(load_option=>'MERGE',sqlset_name => 'XXSTABILITY_EXECUTION_PLANS', populate_cursor => cur); CLOSE cur; end loop; Commit; END; / AWS RDS FOR ORACLE EXAMPLE 3: PRESERVING GOOD EXECUTION PLANS
  • 58. © 2016 Pythian 58 -- Create the Scheduler Job which will run on every hour's 47th minute Begin Dbms_scheduler.create_job (job_name => 'COLLECT_XXSTABILITY_PLANS', job_type => 'STORED_PROCEDURE', job_action => 'PERF.XXSTABILITY_CAPTURE_PLANS', start_date => SYSDATE, repeat_interval => 'FREQ=HOURLY; INTERVAL=1; BYMINUTE=47;', enabled => TRUE); End; / -- Loading the baseline from SELECT_SQLSET for a specific sql_id and plan VARIABLE cnt NUMBER EXECUTE :cnt := DBMS_SPM.LOAD_PLANS_FROM_SQLSET( - sqlset_name => 'XXSTABILITY_EXECUTION_PLANS', - basic_filter => 'sql_id=''dtzsc12fbbjk2'' and plan_hash_value=2896891279'); AWS RDS FOR ORACLE EXAMPLE 3: PRESERVING EXECUTION PLANS
  • 59. © 2016 Pythian 59 AWS RDS FOR ORACLE EXAMPLE 4: COMBINED MAINTENANCE • Combined maintenance - 30 minutes allocated – Take a snapshot – Change the instance size • Oops! – Snapshot takes just few seconds • … before it's copied to S3 – “Creating Snapshot” for 45 minutes https://calculator.s3.amazonaws.com/index.html
  • 60. © 2016 Pythian 60 SUMMARY
  • 61. © 2016 Pythian 61 • Simple to use, but not suitable for massive workloads – Consider Oracle DB on EC2 • Difficult to size (especially storage) – Load testing and Benchmarking – 3000 IOPS or less -> Use gp2 (General Purpose SSD) volumes • Get the config right from the beginning – Changing certain things require downtime • Practice being an Oracle RDS DBA – Some things are different SUMMARY Oracle RDS
  • 62. © 2016 Pythian 62 • SUMMARY Beware of the most dangerous checkbox in your career.
  • 63. © 2016 Pythian 63 THANK YOU @MarisDBA Elsins@pythian.com