March 2019
How to Migrate
from
Oracle DB to MariaDB
Bart Oleś, Support Engineer
Presenter
bart@severalnines.com
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
Copyright 2017 Severalnines AB
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
Copyright 2017 Severalnines AB
Supported Databases
Copyright 2017 Severalnines AB
Our Customers
Poll 1
Copyright 2019 Severalnines AB
Which of the following databases do you run in your production
environment:
● MySQL / MariaDB
● PostgreSQL
● SQLServer
● Oracle
● DB2
March 2019
Migrating from Oracle to
MariaDB
Bart Oleś, Support Engineer
Presenter
bart@severalnines.com
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
Copyright 2017 Severalnines AB
Copyright 2019 Severalnines AB
A brief introduction to the platform
migration
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
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
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
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
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)
Database access and network services
comparison
Copyright 2019 Severalnines AB
● MaxScale
● Keepalived
Works also with other
Load balancers
● HAProxy
● ProxySQL
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
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
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.
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.
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
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)
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.
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
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)
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)
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)
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
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
Poll 2
Copyright 2019 Severalnines AB
Which of the following replacements of Oracle would you consider for a migration:
● MySQL
● MariaDB
● PostgreSQL
● MongoDB
● Other
Copyright 2017 Severalnines AB
Copyright 2019 Severalnines AB
Migration
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
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
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.
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.
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
Migration tools
Copyright 2019 Severalnines AB
● SQLlines
● AWS conversion tools
● HVR replication
● Inspier
Testing
Copyright 2019 Severalnines AB
Copyright 2017 Severalnines AB
Copyright 2019 Severalnines AB
Post-migration
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
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
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
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
Scaling
Copyright 2019 Severalnines AB
● License cost as important aspect of scaling
● Dedicated engines and plugins for scaling
● Ease of scaling
● Automated scaling
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.
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?
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
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
Copyright 2017 Severalnines AB
Copyright 2019 Severalnines AB
Q & A
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
Additional Resources
Copyright 2019 Severalnines AB

Webinar slides: How to Migrate from Oracle DB to MariaDB

  • 1.
    March 2019 How toMigrate from Oracle DB to MariaDB Bart Oleś, Support Engineer Presenter bart@severalnines.com
  • 2.
    Copyright 2017 SeveralninesAB 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
  • 4.
  • 5.
    Copyright 2017 SeveralninesAB 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
  • 6.
    Copyright 2017 SeveralninesAB Supported Databases
  • 7.
  • 8.
    Poll 1 Copyright 2019Severalnines AB Which of the following databases do you run in your production environment: ● MySQL / MariaDB ● PostgreSQL ● SQLServer ● Oracle ● DB2
  • 9.
    March 2019 Migrating fromOracle to MariaDB Bart Oleś, Support Engineer Presenter bart@severalnines.com
  • 10.
    Agenda Copyright 2019 SeveralninesAB 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 SeveralninesAB Copyright 2019 Severalnines AB A brief introduction to the platform migration
  • 12.
    Why organizations aremoving 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 toMariaDB? 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 andadministration 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 andadministration 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 andnetwork 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 andnetwork services comparison Copyright 2019 Severalnines AB ● MaxScale ● Keepalived Works also with other Load balancers ● HAProxy ● ProxySQL
  • 18.
    Security Copyright 2019 SeveralninesAB 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 Copyright2019 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 Copyright2019 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 2019Severalnines 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 2019Severalnines 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 2019Severalnines 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 SeveralninesAB ● 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 SeveralninesAB ● 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 SeveralninesAB 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 SeveralninesAB MariaDB [test]> SELECT SYSDATE() FROM DUAL; +---------------------+ | SYSDATE() | +---------------------+ | 2019-02-27 04:11:57 | +---------------------+ 1 row in set (0.000 sec)
  • 28.
    High Availability andreplication 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)
  • 29.
    High Availability andreplication 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
  • 30.
    DR with HybridCloud ● 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 2019Severalnines AB Which of the following replacements of Oracle would you consider for a migration: ● MySQL ● MariaDB ● PostgreSQL ● MongoDB ● Other
  • 32.
    Copyright 2017 SeveralninesAB Copyright 2019 Severalnines AB Migration
  • 33.
    Planning and developmentstrategy 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 Copyright2019 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 enablePL/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 enablePL/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 enablePL/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
  • 38.
    Migration tools Copyright 2019Severalnines AB ● SQLlines ● AWS conversion tools ● HVR replication ● Inspier
  • 39.
  • 40.
    Copyright 2017 SeveralninesAB Copyright 2019 Severalnines AB Post-migration
  • 41.
    Monitoring and Alerting Copyright2019 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 Copyright2019 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
  • 43.
    Backup Management Copyright 2019Severalnines 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
  • 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 SeveralninesAB ● License cost as important aspect of scaling ● Dedicated engines and plugins for scaling ● Ease of scaling ● Automated scaling
  • 46.
    Staff training Copyright 2019Severalnines 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 2019Severalnines 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 Copyright2019 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 2019Severalnines 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
  • 50.
    Copyright 2017 SeveralninesAB Copyright 2019 Severalnines AB Q & A
  • 51.
    Additional Resources Copyright 2019Severalnines 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
  • 52.