Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Webinar slides: How to Migrate from Oracle DB to MariaDB

1,212 views

Published on

Watch this webinar replay as we walk you through all you need to know to plan and execute a successful migration from Oracle database to MariaDB.
Over the years MariaDB has gained Enterprise support and maturity to run critical and complex data transaction systems. With the recent version, MariaDB has added some great new features such as SQL_Mode=Oracle compatibility, making the transition process easier than ever before.
Whether you’re planning to migrate from Oracle database to MariaDB manually or with the help of a commercial tool to automate the entire migration process, you need to know all the possible bottlenecks and methods involved in the process and the results validation.
Migrating from Oracle database to MariaDB can come with a number of benefits: lower cost of ownership, access to and use of an open source database engine, tight integration with the web, wide circle of MariaDB database professionals and more.
Find out how it could benefit your organisation!

AGENDA
- A brief introduction to the platform
- Oracle vs MariaDB
- Platform support
- Installation process
- Database access
- Backup process
- Controlling query execution
- Security
- Replication options
- Migration
- Planning and development strategy
- Assessment or preliminary check
- Data type mapping
- Migration tools
- Migration process
- Testing
- Post-migration
- Monitoring and Alerting
- Performance Management
- Backup Management
- High availability
- Upgrades
- Scaling
- Staff training

SPEAKER
Bartlomiej Oles, Senior Support Engineer at Severalnines, is a MySQL and Oracle DBA, with over 15 years experience in managing highly available production systems at IBM, Nordea Bank, Acxiom, Lufthansa, and other Fortune 500 companies. In the past five years, his focus has been on building and applying automation tools to manage multi-datacenter database environments.

Published in: Internet
  • You can hardly find a student who enjoys writing a college papers. Among all the other tasks they get assigned in college, writing essays is one of the most difficult assignments. Fortunately for students, there are many offers nowadays which help to make this process easier. The best service which can help you is ⇒ www.HelpWriting.net ⇐
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Webinar slides: How to Migrate from Oracle DB to MariaDB

  1. 1. March 2019 How to Migrate from Oracle DB to MariaDB Bart Oleś, Support Engineer Presenter bart@severalnines.com
  2. 2. Copyright 2017 Severalnines AB I'm Jean-Jérôme from the Severalnines Team and I'm your host for today's webinar! Feel free to ask any questions in the Questions section of this application or via the Chat box. You can also contact me directly via the chat box or via email: info@severalnines.com during or after the webinar. Your host & some logistics
  3. 3. Copyright 2017 Severalnines AB
  4. 4. Copyright 2017 Severalnines AB Automation & Management Deployment ● Deploy a Cluster in Minutes ● On-Prem or Cloud (AWS/Azure/Google) Monitoring ● Systems View with 1 sec Resolution ● DB / OS stats & Performance Advisors ● Configurable Dashboards ● Query Analyzer ● Real-time / historical Management ● Backup Management ● Upgrades & Patching ● Security & Compliance ● Operational Reports ● Automatic Recovery & Repair ● Performance Management ● Automatic Performance Advisors
  5. 5. Copyright 2017 Severalnines AB Supported Databases
  6. 6. Copyright 2017 Severalnines AB Our Customers
  7. 7. Poll 1 Copyright 2019 Severalnines AB Which of the following databases do you run in your production environment: ● MySQL / MariaDB ● PostgreSQL ● SQLServer ● Oracle ● DB2
  8. 8. March 2019 Migrating from Oracle to MariaDB Bart Oleś, Support Engineer Presenter bart@severalnines.com
  9. 9. Agenda Copyright 2019 Severalnines AB A brief introduction to the platform migration ● Why organizations are moving to open source? ● Oracle to MariaDB - Why migrate? ● Platform support ● Installation process & administration simplicity ● Security and compliance ● Database access and network services ● PL/SQL and Popular Oracle Functions ● Backup process ● Controlling query execution ● Security ● High Availability and replication options for FREE!!! How to Migrate from Oracle to MariaDB Migration ● Planning & development strategy ● Assessment & preliminary check ● Data type mapping ● How to enable PL/SQL Syntax ● Migration tools ● Migration process ● Testing Post-migration ● Monitoring & Alerting ● Performance Management ● Backup Management ● High availability ● Upgrades ● Scaling ● Staff training ● Operational Checklist
  10. 10. Copyright 2017 Severalnines AB Copyright 2019 Severalnines AB A brief introduction to the platform migration
  11. 11. Why organizations are moving to Open Source Copyright 2019 Severalnines AB Future of Open Source by Black Duck studies ● BETTER TIME TO MARKET 90% of companies say that OSS have greatly impacted innovation and time to market. ● BETTER GROWTH POTENTIAL 80% of companies say that OSS improve margins and grow revenues. ● MORE COMPETITIVE 65% of companies say that OSS has increased their ability to compete. ● INCREASED ADOPTION 88% of companies say that they expect their Open Source adoption to increase in the next two to three years. ● FAVORED SOLUTION More than 66% of companies say that they prefer Open Source over proprietary software solutions. By 2022 - 50% of existing commercial databases will be converted to open source - 70% of new in-house applications will be developed on an open source DB
  12. 12. Why migrate to MariaDB? Copyright 2019 Severalnines AB Only Oracle Express Edition is free, but it has very limited features when compared to MariaDB. For extensive features, either Oracle Standard Edition or Oracle Enterprise Edition has to be purchased ● Open Source has matured ○ 24/7 support, SLA’s, features ● MariaDB has gained features ● Migration supporting features ○ SQL_MODE=Oracle ● Migration tools ● Automatic schema migration ● Semi-automatic procedure migration ● Migration Practice within MariaDB ● Scaling out migration projects
  13. 13. Installation process and administration simplicity Copyright 2019 Severalnines AB ● Installation process is straightforward comparing to Oracle OUI and DBCA ○ Binary packages ○ RPM packages (MariaDB replace MySQL Community in RDBMs for RedHat and Centos 7) ○ .deb packages ○ MSI packages on Windows ○ Server PKG on macOS ○ Docker image ○ Automation scripts Chef, Puppet etc. ○ Cloud providers ■ MariaDB on AWS Marketplace ■ MariaDB on RDS ■ MariaDB on Azure
  14. 14. Installation process and administration simplicity Copyright 2019 Severalnines AB ● Swiss knife: Percona Toolkit ● Monitoring: Percona PMM, VividCortex, Zabbix, Nagios ● ClusterControl (MySQL, MariaDB, Percona, MongoDB, Oracle NDB, MongoDB) ○ Backup Management ○ Monitoring and Alerting ○ Deployment and Scaling ○ Upgrades and Patching ○ Security and Compliance ○ Operational Reporting ○ Configuration Management ○ Automatic Recovery ○ Performance Management ○ Automated Performance Advisors
  15. 15. Database access and network services comparison Copyright 2019 Severalnines AB ● MariaDB shares with Oracle good support for database access ○ ODBC/JDBC drivers, access libraries for Perl/Python/PHP ● MariaDB does not have dedicated listener service ● No Oracle SCAN functionality (external load balancer is needed) ● MariaDB lack of “Oracle database networking services” ● No Transparent Application Failover (external load balancer is needed) ● Secure user access with host definition (similar to Oracle Connection Manager)
  16. 16. Database access and network services comparison Copyright 2019 Severalnines AB ● MaxScale ● Keepalived Works also with other Load balancers ● HAProxy ● ProxySQL
  17. 17. Security Copyright 2019 Severalnines AB To achieve enterprise security compliance standards, MariaDB offers built-in features like: Audit plugin Encryption of data-at-rest Certificates, TSS connection PAM Plugin
  18. 18. Controlling query execution Copyright 2019 Severalnines AB ● MariaDB used XtraDB from previous versions until 10.1 and shifted to InnoDB from version 10.2 onwards ● Other storage engines available ○ MyRocks storage engine, Spider for Partitioning ○ MariaDB ColumnStore equivalent of Oracle Database In Memory Column store
  19. 19. Controlling query execution Copyright 2019 Severalnines AB By default, MariaDB has the autocommit variable set to ON Explicitly handle transactional statements to take advantage of ROLLBACK or SAVEPOINT Same concept that Oracle uses in terms of commit/rollback/savepoint For explicit transactions, use START TRANSACTION/BEGIN; <SQL STATEMENTS>; COMMIT; syntax START TRANSACTION/BEGIN; <SQL STATEMENTS>; COMMIT; syntax.
  20. 20. Dual Table Copyright 2019 Severalnines AB ● MariaDB has dual compatibility with Oracle which is meant for compatibility of databases using a dummy table, namely DUAL ● It operates just the same as MySQL where the FROM clause is not mandatory, so the DUAL table is not necessary. ● DUAL table does not work exactly the same way as it does for Oracle, but for simple SELECT's in MariaDB, this is fine.
  21. 21. Dual Table Copyright 2019 Severalnines AB SQL> DESC DUAL; Name Null? Type ----------------------------------------- -------- ---------------------------- DUMMY VARCHAR2(1) SQL> SELECT CURRENT_TIMESTAMP FROM DUAL; CURRENT_TIMESTAMP --------------------------------------------------------------------------- 16-FEB-19 04.16.18.910331 AM +08:00
  22. 22. Dual Table Copyright 2019 Severalnines AB MariaDB [test]> DESC DUAL; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DUAL' at line 1 MariaDB [test]> SELECT CURRENT_TIMESTAMP FROM DUAL; +---------------------+ | CURRENT_TIMESTAMP | +---------------------+ | 2019-02-27 04:11:01 | +---------------------+ 1 row in set (0.000 sec)
  23. 23. SYSDATE Copyright 2019 Severalnines AB ● Oracle's SYSDATE function is almost the same as in MariaDB ● MariaDB returns date and time and it’s a function that requires () (close and open parenthesis with no arguments required. To demonstrate this below, here's Oracle and MariaDB on using SYSDATE. ● In Oracle, using plain SYSDATE just returns the date of the day without the time. But to get the time and date, use TO_CHAR to convert the date time into its desired format; whereas in MariaDB, you might not need it to get the date and the time as it returns both.
  24. 24. SYSDATE Copyright 2019 Severalnines AB ● SQL> SELECT TO_CHAR (SYSDATE, 'MM-DD-YYYY HH24:MI:SS') "NOW" FROM DUAL; NOW ------------------- 02-16-2019 04:39:00 SQL> SELECT SYSDATE FROM DUAL; SYSDATE --------- 16-FEB-19
  25. 25. SYSDATE Copyright 2019 Severalnines AB MariaDB [test]> SELECT SYSDATE() FROM DUAL; +---------------------+ | SYSDATE() | +---------------------+ | 2019-02-27 04:11:57 | +---------------------+ 1 row in set (0.000 sec)
  26. 26. TO_DATE Copyright 2019 Severalnines AB MariaDB [test]> SELECT SYSDATE() FROM DUAL; +---------------------+ | SYSDATE() | +---------------------+ | 2019-02-27 04:11:57 | +---------------------+ 1 row in set (0.000 sec)
  27. 27. High Availability and replication options for FREE!!! Copyright 2019 Severalnines AB Multi-master, Synchronous Millisecond latency • Dynamic topology changes • Quorum-based consistency • Load balancing and failover (MaxScale, ProxySQL, HAProxy) Master-slave, Multi-source • Asynchronous or semi-synchronous • Multiple replication threads • Parallel replication streams • Delayed replication (configurable)
  28. 28. High Availability and replication options for FREE!!! Copyright 2019 Severalnines AB M1 master S1 slave G1 galera G2 galera MaxScale Application Servers Application Servers Application Servers Application Servers Application Servers RW RO G3 galera MariaDB Cluster MaxScale RW RW RW Application Servers Application Servers Application Servers Application Servers Application Servers
  29. 29. DR with Hybrid Cloud ● Data on primary site and hot sites have same transactional state ○ Failover instantaneous and automatic ● 3 sites to avoid network partitioning
  30. 30. Poll 2 Copyright 2019 Severalnines AB Which of the following replacements of Oracle would you consider for a migration: ● MySQL ● MariaDB ● PostgreSQL ● MongoDB ● Other
  31. 31. Copyright 2017 Severalnines AB Copyright 2019 Severalnines AB Migration
  32. 32. Planning and development strategy Copyright 2019 Severalnines AB ● A lot of key factors that needs to be considered and addressed. ● Start with Pilot program. One application at a time. ● Migration requires proper project planning and QA. No direct migration! ○ Migration of schema ○ Migration of interfaces ○ Query and functionality analyse ○ Performance load ○ User Acceptance Tests ○ System Integration Tests ● Switchover ● Point of no return
  33. 33. Data type mapping Copyright 2019 Severalnines AB MySQL and MariaDB share the same data types available. Although there are variations as to how it is implemented. While MySQL uses the JSON data-type, MariaDB differs as it's just an alias of LONGTEXT data type. MariaDB has also a function, JSON_VALID, which can be used within the CHECK constraint expression. http://www.sqlines.com/oracle-to-mysql http://www.sqlines.com/oracle-to-mariadb
  34. 34. How to enable PL/SQL syntax in MariaDB Copyright 2019 Severalnines AB From the version 10.3++, MariaDB supports PL/SQL structures; ● SQL_MODE; Set it in the configuration file and restart the MariaDB Server; ● While running the MariaDB Server with the SQL_MODE as ORACLE: ○ The traditional MariaDB syntax for stored routines won't be available from this point on; ● The best option is to run MariaDB Server with the SQL_MODE set on the configuration file to avoid losing the feature in case of a restart.
  35. 35. How to enable PL/SQL syntax in MariaDB Copyright 2019 Severalnines AB MariaDB server when running with sql_mode=ORACLE: ○ VARCHAR2 - a synonym to VARCHAR; ○ NUMBER - a synonym to DECIMAL; ○ DATE (with time portion) - a synonym to MariaDB DATETIME; ○ RAW - a synonym to VARBINARY; ○ CLOB - a synonym to LONGTEXT; ○ BLOB - a synonym to LONGBLOB.
  36. 36. How to enable PL/SQL syntax in MariaDB Copyright 2019 Severalnines AB ● EXCEPT / INTERSECT ● Instance Add Column ● ROW OF ● Sequences ● User Defined Types ● Condition Pushdowns ● HAVING into WHERE ● and many more
  37. 37. Migration tools Copyright 2019 Severalnines AB ● SQLlines ● AWS conversion tools ● HVR replication ● Inspier
  38. 38. Testing Copyright 2019 Severalnines AB
  39. 39. Copyright 2017 Severalnines AB Copyright 2019 Severalnines AB Post-migration
  40. 40. Monitoring and Alerting Copyright 2019 Severalnines AB ● What to monitor? ○ Database I/O ○ Database transactions ○ System and Network ○ Storage ○ Backups ○ Database Load Balancer ● Hybrid Cloud Environments ● Alerting and Notifications ● Integration with other systems
  41. 41. Monitoring and Alerting Copyright 2019 Severalnines AB ● Database Monitoring Tools: ○ PMM (Percona Monitoring and Management ○ BindPlane ○ VividCortex ○ SQL Diagnostic Manager/MONyog ○ ClusterControl ● Other popular tools: ○ Prometheus ○ Graphite ○ TICK Stack From InfluxData ○ OpenTSDB ○ ELK or Elastic Stack
  42. 42. Backup Management Copyright 2019 Severalnines AB ● No backup repository built-in (lack of RMAN) ● mariadbbackup (hotbackup) ● mysqldump ● s9s - equivalent to RMAN $ s9s backup --create --backup-method=mysqldump --cluster-id=1 --nodes=10.0.0.5:3306 --backup-directory=/storage/backups Job with ID 4 registered $ s9s backup --list --cluster-id=1 --long --human-readable ID CID STATE OWNER HOSTNAME CREATED SIZE FILENAME 1 1 COMPLETED dba 10.0.0.5 07:21:39 252K mysqldump_2018-11-11_072135_mysqldb.sql.gz 1 1 COMPLETED dba 10.0.0.5 07:21:43 1014 mysqldump_2018-11-11_072135_schema.sql.gz 1 1 COMPLETED dba 10.0.0.5 07:22:03 109M mysqldump_2018-11-11_072135_data.sql.gz 1 1 COMPLETED dba 10.0.0.5 07:22:07 679 mysqldump_2018-11-11_072135_triggerseventsroutines.sql.gz 2 1 COMPLETED dba 10.0.0.5 07:30:20 252K mysqldump_2018-11-11_073016_mysqldb.sql.gz 2 1 COMPLETED dba 10.0.0.5 07:30:24 1014 mysqldump_2018-11-11_073016_schema.sql.gz 2 1 COMPLETED dba 10.0.0.5 07:30:44 109M mysqldump_2018-11-11_073016_data.sql.gz 2 1 COMPLETED dba 10.0.0.5 07:30:49 679 mysqldump_2018-11-11_073016_triggerseventsroutines.sql.gz
  43. 43. High Availability - Hybrid Replication Copyright 2019 Severalnines AB ● MariaDB Cluster is compatible with MariaDB replication: ○ MariaDB cluster can operate as MariaDB slave ○ MariaDB cluster can operate as master for MariaDB slave
  44. 44. Scaling Copyright 2019 Severalnines AB ● License cost as important aspect of scaling ● Dedicated engines and plugins for scaling ● Ease of scaling ● Automated scaling
  45. 45. Staff training Copyright 2019 Severalnines AB ● We Oracle DBA’s love certification ● MariaDB provides a certification exam for DBAs to prove their expertise ○ Proctored and administered by MariaDB ○ Tests DBAs on a variety of tasks, including basic configuration, security operations, backup and restore, and performance tuning.
  46. 46. Operational Checklist Copyright 2019 Severalnines AB ● Are queues building up? ● Slow queries? ● Tune queries in the Query Monitor. ● Are backups working? ● Reporting queries? ● Latency issues? ● Random node restarts and failures? ● Upgrade time? ● Did you test new code before putting in production?
  47. 47. Belt and Suspenders Copyright 2019 Severalnines AB Apply your backup procedures as normal: - mysqldump with "--single-transaction" - volume snapshot - xtrabackup/mariabackup You may still want to have an async slave connected to the cluster: - Reporting - Disaster Recovery http://www.severalnines.com/blog/asynchronous-replication-galera-clustermysql-server-gtid Point in time recovery http://www.severalnines.com/blog/point-time-recovery-galera-cluster MariaDB AX/TX https://severalnines.com/blog/analytics-mariadb-ax-open-source-columnar-datastore
  48. 48. Poll 3 Copyright 2019 Severalnines AB Have you any plans to migrate from Oracle database to an Open Source database? ● Yes, within the next 6 months ● Yes, within 1 year ● Yes, within 2 years ● I do not plan to migrate ● I do not have Oracle database
  49. 49. Copyright 2017 Severalnines AB Copyright 2019 Severalnines AB Q & A
  50. 50. Additional Resources Copyright 2019 Severalnines AB Blog: Migrating from Oracle database to MariaDB - what you should know Blog: Migrating from Oracle database to MariaDB - deep dive Product Page: ClusterControl for MariaDB Download: ClusterControl Contact: info@severalnines.com
  51. 51. Additional Resources Copyright 2019 Severalnines AB

×