2. Why migrate to DBaaS?
Cost
Database management is expensive.
Moving to DBaaS reduces management
cost, moving to open source engines can
reduce costs by 90% or more.
Risks
Proprietary databases are risky.
Availability, scalability, malwares.
7. Amazon Relational Database Service (RDS)
• Database as a Service
• Fully managed database service
• Automated hardware provisioning, patching,
backup/restore, scaling
• High availability with RDS Multi-AZ, Auto-
Failover
99.95% SLA for Multi-AZ deployments
• Database monitoring and alerts
• Security
9. The Dilemma (RDS vs. EC2)
• RDS vs. EC2
• Didn’t like the idea of RDS
• Too restrictive/loss of control
• No direct access to the box
• “It’s doing my job”
• DBAs conducted a full review
with an open mind
10. The Dilemma (RDS vs. EC2)
EC2
• Pros
Flexibility w/ full access
Access to the Oracle utilities
(Dataguard, RMAN, etc.)
Similar to the way it’s managed today
• Cons
Self-deployed
High administrative overhead (all
tasks manual - self installation,
patching, backups, etc.)
RDS
• Pros
Managed Service = reduced overhead
(easy deployment, automated
patching and backups, etc.)
Multi-AZ option for HA
Parameter and Option groups
Flexible license model with BYOL
option
• Cons
Don’t have access to all the Oracle
utilities
12. Options to Migrate to RDS
• Oracle SQL Developer
Small Databases
• Oracle Data Pump
Move large Databases
• Oracle Export/Import Utilities
• Oracle SQL*Loader
• Oracle Golden Gate
• Migration and replication
• RMAN ? Dataguard Not possible
• Amazon Data Migration Services (DMS)
13. Migration Time using Oracle Data Pump
Export
Upload to
RDS
Import
Switch
Applications
• How much downtime is acceptable?
• Depending on the size of the database, the time increases
• Sometimes upload the export file is a problem
• You can use an EC2 instance to mitigate the problem
Create a Standby Database on EC2
Reduce problems to upload export file
14. … Using a EC2 pivot instance
• Standby Database on EC2
• Replication in real time
• Upload Export file from AWS
Network
• Reduce time to upload export
file
15. Migrate Process …
Step 1: Grant privileges to user on source database
Step 2: Stop all database transactions
Step 3: Check Dataguard synchronization
Step 4: Open Standby Database
Step 5: Use Export Data Pump or DBMS_DATAPUMP to create a dump
file from Database on EC2
$ expdp user1 DUMPFILE=tab1.dmp DIRECTORY=DATA_PUMP_DIR full=y
16. Step 6: Create a database link to the target DB instance (RDS) from the
Database on EC2
Migrate Process …
SQL>
create database link to_rds connect to USER2 identified by user2pwd using
'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<dns or ip address of remote
db>)(PORT=<listener port>))(CONNECT_DATA=(SID=<remoteSID>)))';
17. Migrate Process …
Step 7: Use DBMS_FILE_TRANSFER to copy the exported dump file to
the Amazon RDS instance from the Database on EC2.
SQL>
BEGIN
DBMS_FILE_TRANSFER.PUT_FILE(
source_directory_object => 'DATA_PUMP_DIR',
source_file_name => 'tab1.dmp',
destination_directory_object => 'DATA_PUMP_DIR',
destination_file_name => 'tab1_copied.dmp',
destination_database => 'to_rds'
);
END;
/
18. Step 8: Import the dump file into a database on the Amazon RDS
instance from the Database on EC2.
Migrate Process …
$ impdp rds_user@to_rds DUMPFILE=tab1_copied.dmp DIRECTORY=DATA_PUMP_DIR
full=y EXCLUDE=SCHEMA:"IN ('ORDSYS',
'ORDPLUGINS','SI_INFORMTN_SCHEMA','ORDDATA','MDSYS')"
19. Step 9: Clean up dump file from RDS instance.
Migrate Process …
SQL> select * from table(RDSADMIN.RDS_FILE_UTIL.LISTDIR('DATA_PUMP_DIR'))
order by mtime;
SQL> exec utl_file.fremove('DATA_PUMP_DIR','tab1_copied.dmp');