This document provides an overview and agenda for a webinar on migrating from Oracle DB to MariaDB. The webinar will cover why organizations are moving to open source databases, the benefits of migrating to MariaDB from Oracle, how to plan and execute the migration process, and post-migration management topics like monitoring, backups, high availability, and scaling in MariaDB. The presentation will include discussions of data type mapping, enabling PL/SQL syntax in MariaDB, available migration tools, and testing approaches.
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Migrate Oracle to MariaDB in 40 Steps
1. March 2019
How to Migrate
from
Oracle DB to MariaDB
Bart Oleś, Support Engineer
Presenter
bart@severalnines.com
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
8. Poll 1
Copyright 2019 Severalnines AB
Which of the following databases do you run in your production
environment:
● MySQL / MariaDB
● PostgreSQL
● SQLServer
● Oracle
● DB2
9. March 2019
Migrating from Oracle to
MariaDB
Bart Oleś, Support Engineer
Presenter
bart@severalnines.com
10. 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
11. Copyright 2017 Severalnines AB
Copyright 2019 Severalnines AB
A brief introduction to the platform
migration
12. 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
13. 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
14. 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
15. 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
16. 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)
17. Database access and network services
comparison
Copyright 2019 Severalnines AB
● MaxScale
● Keepalived
Works also with other
Load balancers
● HAProxy
● ProxySQL
18. 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
19. 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
20. 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.
21. 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.
22. 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
23. 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)
24. 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.
25. 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
26. 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)
27. 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)
28. 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)
30. 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
31. Poll 2
Copyright 2019 Severalnines AB
Which of the following replacements of Oracle would you consider for a migration:
● MySQL
● MariaDB
● PostgreSQL
● MongoDB
● Other
33. 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
34. 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
35. 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.
36. 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.
37. 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
41. 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
42. 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
44. 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
45. Scaling
Copyright 2019 Severalnines AB
● License cost as important aspect of scaling
● Dedicated engines and plugins for scaling
● Ease of scaling
● Automated scaling
46. 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.
47. 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?
48. 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
49. 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
51. 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