This is an old revision of the document!
SQLines open source tools can help you transfer data, convert database schema (DDL), views, stored procedures, functions, packages, triggers, queries and SQL scripts from Oracle to MariaDB:
Databases:
Starting from MariaDB 10.3 there is the Oracle compatibility mode that allows MariaDB to understand a subset of Oracle's PL/SQL language. To enable this mode, run:
set sql_mode=oracle; |
This reference documents Oracle to MariaDB migration issues in the Oracle compatibility mode. For migration to the MariaDB native SQL language, see Oracle to MariaDB Migration.
CREATE VIEW and ALTER VIEW statements:
Oracle | MariaDB - Oracle Compatibility Mode | |||
1 | CREATE MATERIAZED VIEW name | Create a materiazed view | Not supported |
CREATE SEQUENCE and ALTER SEQUENCE statements:
Oracle | MariaDB - Oracle Compatibility Mode | |||
1 | CREATE SEQUENCE seqname | CREATE [OR REPLACE] SEQUENCE seqname | ||
2 | ALTER SEQUENCE seqname | ALTER SEQUENCE [IF EXISTS] seqname | ||
3 | INCREMENT BY num | Positive or negative increment, default is 1 | INCREMENT BY num | |
4 | START WITH num | Initial value | START WITH num | |
5 | MAXVALUE num | Maximum value is num | MAXVALUE num | |
NOMAXVALUE | System limit | NOMAXVALUE | ||
6 | MINVALUE num | Minimum value is num | MINVALUE num | |
NOMINVALUE | System limit | NOMINVALUE | ||
7 | CYCLE | Reuse values after reaching the limit | CYCLE | |
NOCYCLE | No reuse, this is default | NOCYCLE | ||
8 | CACHE num | Cache num values, default is 20 | CACHE num | Default is 1000 |
NOCACHE | Values are not preallocated | NOCACHE | ||
9 | ORDER | Guarantee numbers in order of requests | Option not supported, commented | |
NOORDER | No guarantee, this is default | Option not supported, removed as it is default |
Referencing sequence values:
Oracle | MariaDB - Oracle Compatibility Mode | |||
1 | seqname.CURRVAL | The current value of seqname | seqname.CURRVAL | |
2 | seqname.NEXTVAL | The next value of seqname | seqname.NEXTVAL |
DROP SEQUENCE statement:
Oracle | MariaDB - Oracle Compatibility Mode | |||
1 | DROP SEQUENCE seqname | DROP SEQUENCE [IF EXISTS] seqname |
Converting PL/SQL statements:
Oracle | MariaDB - Oracle Compatibility Mode | ||
1 | NULL; | “no-op” (no operation) | NULL; |
Flow of control statements:
Oracle | MariaDB - Oracle Compatibility Mode | ||
1 | RETURN; | Return from a stored procedure | RETURN; |
2 | RETURN exp; | Return from a user-defined function | RETURN exp; |
Predefined exceptions handlers: