際際滷

際際滷Share a Scribd company logo
Oracle - MySQL
Migration
Index
Oracle  MySQL Migration
Migration process
Schema Migration
Data Type
Trigger & SP
Schema & data Migration
蠍磯 觜蟲
Migration Process
Analyze
Understand
Match
Src/dest
Re/Design Extract src
Convert
Import Schemas Logic data
Index PartitionTest/POCValidate
Something
fails
fails
Migration 企至 讌伎 蟾?
Migration Process (analyze)
Source Database襯 覿  覓伎 伎 蟾?
1. 危危蠍 企れ 蠍磯ル  蠍磯リ讌 襴ろ碁ゼ 襷れ.
Issue Workaround Grade* Notes
Reference to external schemas in the
a different instance (db link)
10
螻牛讌 
 るジ 襭朱 覲蟆

Packages See Writing stored procedures 9 豌  貊 
Procedures See Writing stored procedures 9 豌  貊 
Unique key longer then 255 charac
ters
See Key length limitations 4
Views alias Manually added 4  覲豺 朱 豢螳
Sequences See Migration of Sequences 3
螳ロ覃 Auto Increment襦
覲
Empty schemas See empty schema definitions 2  襦 覲
2. Source Data  誤. ( 一危 企, 覿 or 讌螻 一危, etc)
3. ろる覲 碁 覲旧′煙 蟆.
4. Database Object襯 蠍  碁(觜)  碁 螳
5. Database or Application 蠍磯レ 蠍  碁(觜)  碁 螳
Migration Process (understand)
Oracle螻 MySQL 谿伎 危危.
Server
 Oracle Schema object  覓語 蟲覲
 MySQL lower_case_table_names 旧 磯 覓語 蟲覲
 Oracle 企 default螳朱 not null 覈  
 MySQL Millisecond 5.6覿 讌
 Oracle Data Type  覲讌 
MySQL sql_mode襦 讌
 Oracle varchar2 4,000Byte
MySQL varchar 65,535Byte
 Oracle System Privileges  local/external : roles
MySQL Privileges (local : no roles)
 MySQL Oracle dummy table(dual) 螻牛讌 
select 1+1 from dual (oracle)
select 1+1 (MySQL)
Migration Process (understand)
Oracle螻 MySQL 谿伎 危危.
DML & DDL
 Key length limitations
 Oracle index 觚襦伎 40%蟾讌 碁煙れ襴 螳  MySQL 覓語
 MySQL 蟆曙 primary key index 蟆曙 255蟾讌  螳(utf-8  蟆曙)
 index_large_prefix 旧朱 row format compressed 螳
 Oracle Sequence Autoincremet襦 豌
 Autoincrement Not null伎伎 覃, Primary key襦 燕伎 
 Oracle sequence 螳 蟆  
ex) SELECT MAX(id)+1 FROM tab
 MySQL 蟆曙 LAST_INSERT_ID()朱
Schema Migration
Oracle MySQL
Package N/A
Primary key Primary key
Role N/A
Schema Schema
Sequence AUTO_INCREMENT
Snapshot N/A
Synonym N/A
Table Table
Tablespace N/A
Temporary Table Temporary Table
Trigger for each row Trigger for each row
Unique key Unique Key
View View
Schema Object Similarities
Data Types
Data Type Mapping
MySQL Oracle
BIGINT NUMBER(19,0)
BIT RAW
BLOB BLOB, RAW
CHAR CHAR
DATE DATE
DATETIME DATE
DECIMAL FLOAT(24)
DOUBLE FLOAT(24)
DOUBLE PRECISION FLOAT(24)
ENUM VARCHAR2
FLOAT FLOAT
INT NUMBER(10,0)
INTEGER NUMBER(10,0)
LONGTEXT BLOB, RAW
Data Types
Data Type Mapping
MySQL Oracle
MEDIUMBLOB BLOB, RAW
MEDIUMINT NUMBER(7,0)
MEDIUMTEXT CLOB, RAW
NUMERIC NUMBER
REAL FLOAT(24)
SET VARCHAR2
SMALLINT NUMBER(5,0)
TEXT VARCHAR2, CLOB
TIME DATE
TIMESTAMP DATE
TINYBLOB RAW
TINYINT NUMBER(3,0)
TINYTEXT VARCHAR2
VARCHAR VARCHAR2, CLOB
YEAR NUMBER
Data Types
Data Type 觜蟲  Numeric Types
MySQL Size Oracle
BIGINT 8 Bytes NUMBER(19,0)
BIT  (M+7)/8 Bytes RAW
DECIMAL(M,D)
D>0覃 M+2 bytes D=0企 M+1 bytes
M<D覃 D+2 bytes
FLOAT(24), BINARY_FLOAT
DOUBLE 8 Bytes
FLOAT(24), BINARY_FLOAT,
BINARY_DOUBLE
DLUBLE PRECION 8 Bytes FLOAT(24), BINARY_DOUBLE
FLOAT(25<=X<53) 8 Bytes FLOAT(24), BINARY_FLOAT
FLOAT(x<=24) 4 Bytes FLOAT, BINARY_FLOAT
INT 4 Bytes NUMBER(10,0)
INTEGER 4 Bytes NUMBER(10,0)
MEDIUMINT 3 Bytes NUMBER(7,0)
NUMERIC
D>0覃 M+2 bytes D=0企 M+1 bytes
M<D覃 D+2 bytes
NUMBER
REAL 8 Bytes FLOAT(24), BINARY_FLOAT
SMALLINT 2 Bytes NUMBER(5,0_
TINYINT 1 Bytes NUMBER(3,0)
Data Types
Data Type 觜蟲  Date and Time Type
MySQL Size Oracle
DATE 3 Bytes DATE
DATETIME 8 Bytes DATE
TIMESTAMP 4 Bytes DATE
TIME 3 Bytes DATE
YEAR 1 Bytes NUMBER
Data Types
Data Type 觜蟲  String Types
MySQL Size Oracle
BLOB L + 2 Bytes ~ L<2^16 RAW, BLOB
CHAR(M) M Bytes 0<=M<=255 CHAR
ENUM(V1, V2, ..)
1 OR 2 Bytes
ENUM 螳(豕 65535)
VARCHAR2
LOGBLOB L + 4 Bytes ~ L < 2 ^ 32 RAW, BLOB
LONGTEXT L + 4 Bytes ~ L < 2 ^ 32 RAW, CLOB
MEDIUMBLOB L + 3 Bytes ~ L < 2 ^ 24 RAW, BLOB
MEDIUMTEXT L + 3 Bytes ~ L < 2 ^ 24 RAW, CLOB
SET(V1, V2, ..) 1, 2, 3, 4 or 8 Bytes VARCHAR2
TEXT L + 2 Bytes ~ L < 2 ^ 16 VARCHAR, CLOB
TINYBLOB L + 1 Bytes ~ L < 2 ^ 8 RAW, BLOB
TINYTEXT L + 1 Bytes ~ L < 2 ^ 8 VARCHAR2
VARCHAR(M)
L + 1 Bytes ~ L < M
MySQL 5.0.3 伎 0<=M<=255
MySQL 5.0.3危 0<=M<=65,535
螻殊 MAX SIZE = 65,532
VARCHAR2, CLOB
Trigger & SP
Trigger
Trigger & SP
 MySQL  企 碁Μ蟇 企企 碁Μ蟇 企欧碁ゼ 螳   
襯 る Before insert  After updat襯 螳   
 Oracle 蟆曙 覃 碁Μ蟇磯ゼ ( 碁Μ蟇磯 蟲覓 碁Μ蟇  螳)
 MySQL 企 碁Μ蟇 ろ 譴 る 豌襴 覲伎
碁Μ蟇 企企 碁Μ蟇 企欧 譴 襷 ろ蟇磯   ろ 讌  蟆曙 襦る葦
 Oracle 碁Μ蟇一 ろ 覈語 碁企 覈   蟆郁骸螳 炎概伎朱 ろ 覃 蠏碁讌
朱 襦る葦
 Oracle螻 MySQL Procedure 蟲覓語 谿企 れ螻 螳   
Replace蟲覓
DO 蟲覓  MySQL DO蟲覓語 覓願 覦讌 , Oracle 蟆曙 select expr1,  into 
from dual 蟲覓語朱 覲
覲牛 De
Trigger & SP
Stored Procedure
Stored procedure
 Oracle螻 MySQL Procedure 蟲覓語 谿
 Replace蟲覓
 DO 蟲覓
 MySQL DO蟲覓語 覓願 覦讌 
- Oracle 蟆曙 select expr1,  into  from dual 蟲覓語朱 覲
 覲牛 declare 蟲覓
 覲牛 Set 蟲覓
- MySQL
DECLARE a INT; /* simple */
DECLARE a, b INT DEFAULT 5; /* complex */
- Oracle
a INT; /* simple */
a INT := 5;
b INT := 5; /* complex */
- MySQL
SET x:=1; /* simple */
SET x:=1, y:=0; /* complex */
- Oracle
x :=1; /* simple */
x :=1;
y :=0; /* complex */
Trigger & SP
Stored Procedure
Package
- MySQL
CREATE PROCEDURE p2() BEGIN
SET @a = 5; SET @b = 5;
SELECT @a, @b;
END;
- Oracle
CREATE OR REPLACE PACKAGE root.globalPkg AS
a NUMBER;
b NUMBER;
END globalPkg;
CREATE OR REPLACE PROCEDURE root.p2 AS
BEGIN
globalPkg.a := 5;
globalPkg.b := 5;
DBMS_OUTPUT.PUT_LINE(globalPkg.a || , ||
globalPkg.b); END p2;
Trigger & SP
Stored Procedure 焔
Schema & DATA
Migration Toolkit
http://downloads.mysql.com/archives/migration/
Schema & DATA
SQLyog or Workbench
http://www.webyog.com
Schema & DATA
orakit
Intelligent Converters
. MariaDB
蠍磯 觜蟲
伎豸°
 No 蟲覿 蠍磯 る狩 MySQL 觜螻
ろる蟯襴
(企, 貉 覲蟆
覈轟企)
1
企ろ
伎
企ろ伎
CREATE
讌 讌  覯 offline 豢螳襷 螳ロ
2
企ろ
伎
企ろ伎
RENAME
讌 朱讌 企  table space 煙 覲蟆 螳
3
企ろ
伎
企ろ伎
DROP
讌 讌
4 企 企 CREATE 讌 讌
5 企 企 RENAME 讌 讌
6 企 企 MOVE 讌 讌 RENAME
7 企 企 TRUNCATE 讌 讌
8 企 企 DROP 讌 讌
9 企
企 STRUCTURE
VALIDATE
讌 讌 CHECK, ANALYZE
10企 企 MONITORING 讌 N
11碁煙 碁煙 CREATE 讌 讌
12碁煙 碁煙 RENAME 讌 讌
13碁煙 碁煙 REBUILD 讌 讌
14碁煙 碁煙 DROP 讌 讌
15碁煙 碁煙 MONITORING 讌 N
16貉 企 貉 ADD 讌 讌
17貉 企 貉 DROP 讌 讌
18貉
企 貉 RENAM
E
讌 讌
19貉 企 貉 TYPE覲蟆曙 讌
20貉
企 貉 LENGTH
覲蟆
讌 讌
21貉
企 貉 DEFAULT
覲蟆
讌 讌
22蠍壱
伎 蠍磯(Recycleb
in)
讌 N
23蠍壱 DB螻糾   讌 讌 autoextend , innodb_autoextend_increment
24蠍壱
殊 襴り係(Table
Shrink)
讌 N
25蠍壱
殊 襴り係(Table
Coalesce)
讌 N
26蠍壱
殊 碁煙
REBUILD
讌 讌
DB覲伎
(貉 誤 )
1
豌伎 覦

AUDIT 讌 讌 enterprise 覯襷 plug-in 朱 讌
2
豌伎 覦

DB覲伎
TDE(Transparent Databas
e Encryption)
N column  encrypt 讌
3
豌伎 覦

DB覲伎
Transparent Tablespace E
ncryption(TTE)
N column  encrypt 讌
4
豌伎 覦

DB覲伎 覲牛誤 DBれ 螻 N ,覲牛誤 DB function 讌
5
豌伎 覦

DB覲伎 Data Security(旧) N
. MariaDB
蠍磯 觜蟲
 No 蟲覿 蠍磯 る狩 MySQL 觜螻
讌 Utility (螳覦, ,
覦煙 )
1 Utility Gui Admin Tool OEM 讌 enterprise monitor
2 Utility Interactive SQL蠍 sqlplus 讌 mysql
3 Utility DBMS Admin TOOL sqlplus 讌 mysql
4 Utility Data Loader /Unloader sql*Loader 讌 mysqlimport
5 Utility Data export/import Exp/Imp 讌 mysqldump / mysqlimport
6 Utility Connection Dispatcher Listener N
7 Utility DB Creater Dbca 讌 DBCA
8 Utility C Precompiler Pro*C 讌 MySQL++ / User Define Function (UDF's)
9 Utility Recovery Manager RMAN 讌 Zmanda Utility
10 Utility
焔 Monitor
焔ル磯 る(AWR) :1
螳 螳蟆 7 覲願
N
mysqladmin / show 覈轟 / 螳譬 碁Μ
11 Utility
焔ル磯 る(ASH) : 豕
蠏 30覿 語 覲
N
12 Utility Trace 覿 Utility Trace 覿 Utility(tkprof) N explain / profiling
13 Utility SQL Trace oradebug N profiling / status
14 Utility SQL Plan explain 讌 explain
覦煙 覦 覲糾規
1 Backup Online(Hot) Backup 讌 讌
2 Backup Offline(Cold) Backup 讌 讌
3 Backup Table Export / Import 讌 讌
4 Recovery 覿覲糾規(Time Based) 讌 N
Table Space  覿 覲糾規 innodb_force_recovery 螳 朱,
 覲糾規 binlog襯  螳ロ讌襷, 蟆 蠍磯 襷れ広 讌 
5 Recovery 覿 覲糾規(Cancel) 讌 N
6 Recovery 覿覲糾規(SCN Based) 讌 N
7 Recovery 覲糾規 讌 讌
8 Recovery Tablespace  覲糾規 讌 讌
9 Recovery Table 覲糾規 讌(Flashback Database) 讌
. MariaDB
蠍磯 觜蟲
螳覦 豸°
 No 蠍磯 る狩 MySQL 觜螻
讌 API
(JDBC, XA )
1 JDBC Driver 螻 螻
2 ODBC Driver 螻 螻
3 PHP Driver 螻 螻
4 Embedded SQL 螻(pro*C) 螻 libmysqld
5 Interface 螻(OCI) N
6 XA API 螻給 螻 XA Transaction
7 Threaded Application 讌 讌
焔ロレ  旧
(覲豌襴, )
1 Hint 蠍磯 讌 讌
2 Cost Optimizer 讌 讌
3 Parallel Select 讌 N
4 Parallel DML(Insert/update/delete) 讌 N
5 parallel DDL(create/alter table/index) 讌 N
6 ANALYZE 讌 讌
7 Estimate(Sampling) 讌 N
8 Parallel 糾覲  讌 N
9 碁煙   Load譴 糾覲  讌 N
10 Histogram 讌 N
讌 SQL(蠍磯蓋 SQL覓 )
1 SQL 譴 SQL , 覲 SQL(SQL92, SQL99讌) 讌
2 Sub-query(In-Line View) 讌 讌
3 Sub-query(Scalar) 讌 讌
4 Sub-query(=,IN,EXISTS) 讌 讌
5 Equi Join 讌 讌
6 Inner Join 讌 讌
7 Outer Join 讌 讌
8 Self Join 讌 讌
9 螻豸旧 讌 CONNECT BY ~ WITH 讌 N
10 Array Processing 讌 N
11 SELECT ~ FOR UPDATE 讌 讌
12 SELECT DISTINCT ~ 讌 讌
13 UNION 讌 讌
14 UNION ALL 讌 讌
15 INTERSECT 讌 N
16 MINUS 讌 N
17 CERATE TABLE AS SELECT ~ 讌 讌
18 VIEW襯 牛 DML 讌 讌
19 WHERE REGEXP(蠏)_LIKE Condition 讌 讌 where REGEXP condition / where NOT REGEXP dondition / where rlike condition
20 Literal/Bind SQL 讌 讌
21 WITH ~ 覓 讌 N
22 MERGE ~ 覓 讌 讌 insert into ~ ON DUPLICATE KEY UPDATE
23 Multi-Insert ~ 覓 讌 曙讌 insert into ~ values (),(),()
24 Grouping Set 蠍磯 讌 讌
25 CLOB SELECT QUERY 讌 讌
. MariaDB
蠍磯 觜蟲
 No 蠍磯 る狩 MySQL 觜螻
ろる 覦 る
(企, 碁煙 )
1 Table 讌 讌
2 Table Compression 讌 讌
3 Index-Organized Table 讌 N cluster index table
4 Stored Procedure 讌 讌
5 Stored Function 讌 讌
6 Trigger
讌
- before/after  讌
- 蟲覓 碁Μ蟇 (statement trigger)
-  碁Μ蟇 (row trigger)
- Instead of trigger
- system event trigger
- user event trigger
讌
7 View 讌 讌
8 Sequence 讌 N auto_increment
9 DB Link 讌 N only federated engine
10 Synonym 讌 N
11 Queue 讌( Advanced Queue) N
12 Monitoring View 讌 讌 information_schem / performance_schema
13 Grant/ Revoke 讌 讌
14 蠍磯蓋(Primary Key) Constraint 讌 讌
15 碁(Foreign Key) Constraint 讌 讌
16 碁(Foreign Key) Constraint ( Enable Novalidate 旧) 讌 N
17 NOT NULL Constraint 讌 讌
18 UNIQUE Constraint 讌 讌
19 CHECK Constraint 讌 讌
20 蠍磯蓋螳(Defaultれ) 讌 讌
21 Temporary Table 讌 讌
22 External Table 讌 N
23 Index(Function-Based) 讌 N
24 Index(Bitmap) 讌 N
25 Index(Reverse Key) 讌 N
26 Index Key Compression 讌 N
27 Stored Package 讌 N
28 Role 讌 讌
29 Snapshot(MATERIALIZED VIEW) 讌 N
30 User Defined Type 讌 N enum()
31 Cluster Object 讌 N NDB cluster  蟆曙一襷 讌
32 XML 讌 讌 讌 ExtractValue() , UpdateXML()
33 譯殊(Table Comment) 讌 讌
34 譯殊(Column Comment) 讌 讌
一
1 一 譬襯(覦覯) - 覯 一(RANGE) 讌 讌
2 一 譬襯(覦覯) - 襴ろ 一(LIST) 讌 讌
3 一 譬襯(覦覯) - 伎 一(HASH) 讌 讌
4 一 譬襯(覦覯) - 譟壱 一(COMPOSITE) 讌 讌
5 一 蟯襴 覈轟 - 一 豢螳(ADD) 讌 讌
7 一 蟯襴 覈轟 - 一 (DROP) 讌 讌
8 一 蟯襴 覈轟 - 一 覿(SPLIT) 讌 讌
9 一 蟯襴 覈轟 - 一 覲(MERGE) 讌 讌
10 一 蟯襴 覈轟 - 一 TRUNCATE 讌 讌
11 一 蟯襴 覈轟 - 一 RENAME 讌 讌
12 一 蟯襴 覈轟 - 一 蟲(EXCHANGE) 讌 讌
13 一 蟯襴 覈轟 - 一 MODIFY 讌 讌
14 一 蟯襴 覈轟 - 一 MOVE 讌 讌
15 一 蟯襴 - Index Partition Rebuild 讌
16 一 碁煙 - Global Index 讌 N
17 一 碁煙 - Local Index 讌 讌
. MariaDB
蠍磯 觜蟲
 No 蠍磯 る狩 MySQL 觜螻
一危 
(覓語, , 讌 )
1 CHAR 螻蠍語 覓語 . 豕 2000 byte. 讌 1~8000 byte
2 VARCHAR 螳覲蠍語 覓語 . 豕 4000 byte 讌 1~8000 length
3 VARCHAR2 螳覲蠍語 覓語 . 豕 4000 byte N
4 NCHAR 貊 螻蠍語 覓語 . 豕 2000 byte 讌 1~4000 byte
5 NVARCHAR2 貊 螻蠍語 覓語 . 豕 4000 byte N 1~4000 length
6 CLOB byte 覓語 . 豕 (4 GB - 1) * DB_BLOCK_SIZE? N TEXT , MEDIUMTEXT, LONGTEXT
7 NCLOB 貊 覓語 . 豕 (4 GB - 1) * DB_BLOCK_SIZE? N
8 LONG 覓語 . 豕2G N
9 NUMBER (p,s)  .覦 p 1~38, れ s -87~127 N INT, INTEGER, TINYINT, SMALLINT, MEDIUMINT, BIGINT
10 NUMERIC 讌 NUMERIC
11 INT 讌 INT, INTEGER, TINYINT, SMALLINT, MEDIUMINT, BIGINT
12 DECIMAL 讌 DECIMAL
13 DOUBLE PRECESION 讌
14 FLOAT 讌
15 REAL 讌 -3.40E + 38 ~ 3.40E + 38
16 SMALLINT 讌
17 DATE 讌. BC 4712 11 ~ AD 9999 12 31 讌
18 TIMESTAMP Microsecond襯  讌 讌 覿豐 襷危襦豐蟾讌 讌
19 TIMESTAMP WITH TIME ZONE N
20 TIMESTAMP WITH LOCAL TIMEZONE N
21 BLOB  伎 螳豌 . 豕 (4 GB - 1) * DB_BLOCK_SIZE? 讌 BLOB , MEDIUMBLOB , LONGBLOB
22 BFILE  伎  . 豕 4G N
23 RAW (size)  伎 . 豕 2000 byte N BLOB , MEDIUMBLOB , LONGBLOB
24 LONG RAW 螳覲蠍語  伎 . 豕 2G N BLOB , MEDIUMBLOB , LONGBLOB
25 ROWID N
. MariaDB
蠍磯 觜蟲
 No 蠍磯 る狩 MariaDB 觜螻
螻  (螻, 蠏, 蟇伎
)
1 蠏碁9 AVG AVG 蠏
2 蠏碁9 COUNT COUNT 
3 蠏碁9 MAX MAX 豕螳
4 蠏碁9 MIN MIN 豕螳
5 蠏碁9 STDDEV STDDEV 譴ク谿
6 蠏碁9 SUM SUM 螻
7 蠏碁9 VARIANCE VARIANCE 覿
8  ABS ABS 螳 |n|
9  ACOS ACOS n 貊(arc cosine)螳 覦.
10  ASIN ASIN n (arc sine)螳 覦.
11  ATAN ATAN n (arc tangent)螳 覦.
12  ATAN2 ATAN2 ATAN2(n,m) atan2(n/m)螻 螳朱, n/m (arc tangent)螳 覦.
13  CEIL CEIL n覲企  螳 譴 豕螳
14  COS COS n(朱朱  螳) 貊瑚 覦.
15  COSH N n(朱朱  螳) 螻 貊瑚(hyperbolic cosine) 覦.
16  EXP EXP 讌螳 e襯 覦朱  e n 螳
17  FLOOR FLOOR n覲企  螳 譴 豕螳
18  GREATEST GREATEST  伎 語譴 螳  螳 覦.
19  LEAST LEAST 語 EXPR 襴ろ 譴 螳  螳 覦.
20  LN LN  log螳 覦 e 讌 n
21  LOG LOG LOG(m,n) 覦 m朱  n 襦蠏 螳 覦.
22  MOD MOD m n 朱  襾語
23  POWER POWER m n
24  ROUND ROUND 覦襴
25  SIGN SIGN n 覿碁ゼ 覦.
26  SIN SIN n (sine)螳 覦.
27  SINH N n 螻′ (hyperbolic sine) 覦.
28  SQRT SQRT n 螻炎啓 覦.
29  TAN TAN n (tangent)螳 覦.
30  TANH TANH n 螻′ (hyperbolic tangent) 覦.
31  TRUNC N 語 n1  襴 朱誤 n2 危襯 .
32 覓語 ASCII ASCII 譯殊伎 char 豌 覓語 ろ 螳  10讌螳 覦.
. MariaDB
蠍磯 觜蟲
 No 蠍磯 る狩 MariaDB 觜螻
螻  (螻, 蠏, 蟇伎
)
32 覓語 ASCII ASCII 譯殊伎 char 豌 覓語 ろ 螳  10讌螳 覦.
33 覓語 CHR N 10讌 n   ろれ襯 覦. CHAR( 55 using ASCII)
34 覓語 CONCAT CONCAT char1螻 char2襯 郁屋 覦.
35 覓語 GREATEST GREATEST  覓語 譴  蟆
36 覓語 INITCAP N  覓語 譴 螳 伎 豌 蠍襯 覓語襦 襾語 覓語襦 覲 覦.
37 覓語 INSTR INSTR 覓語伎 讌 覓語螳 豌  豺襯 襦 覦.
38 覓語 INSTRB N 覓語伎  覓語襯 谿場. return 螳 谿場 豺(Byte ) DELIMITER $$
39 覓語 LEAST LEAST  覓語 譴  蟆
40 覓語 LENGTH LENGTH 語 char 蠍語企ゼ 覦
41 覓語 LENGTHB N 覓語伎 蠍語(Byte )
42 覓語 LOWER LOWER 覓語襦 覲貅譯朱 
43 覓語 LPAD LPAD 讌 襴 n朱覿 expr1 豈郁,狩ク  螻糾 expr1 豈企.
44 覓語 LTRIM LTRIM 覓語 char 譬豸′朱覿 set朱 讌 覈 覓語襯 蟇壱.
45 覓語 NLS_INITCAP N (INITCAP襷讌)螳 伎 豌 覓語襯 覓語襦, 襾語 覓語襯 覓語襦 覲 char襯 覦.
46 覓語 NLS_LOWER N 覈 覓語襯 覓語襦 覲 覦.
47 覓語 NLS_UPPER N  覓語伎 覈 覓語襦 覲 覓語伎 覦.
48 覓語 NLSSORT N  覓語伎  ろ碁 覦.
49 覓語 REPLACE REPLACE 朱誤磯 譯殊伎 豌覯讌 覓語伎, 覯讌 覓語伎 覈 碁讌 覓語企 覦蠑  蟆郁骸襯 覦.
50 覓語 RPAD RPAD 語 expr1 るジク朱 語 expr2襦 讌 覓語襯 蠍語  磯 覦覲牛 n襷 覿譴
51 覓語 RTRIM RTRIM 語 char るジ讓  覿 set朱 讌 覈 覓語襯 蟇壱.
52 覓語 SOUNDEX SOUNDEX char   螳讌 覓語伎 覦.
53 覓語 SUBSTR SUBSTR 覓語 Char position 覓語 豺襦覿 substring_length 覓語 蠍語企 覓語伎 豢豢 覦
54 覓語 SUBSTRB N 企 豺 螳 襷殊 覓語伎 豢豢.(Byte )
55 覓語 TRANSLATE N from_string 螳 覓語襯 to_string  覓語襦 豺 expr 覦.
56 覓語 TRIM TRIM 覓語企   (讓)覓語襯 蟇.
57 覓語 UPPER UPPER 覈 覓語襯 覓語襦 覲
58 讌 ADD_MONTH N 殊 date 轟 螳 integer襯  螳 覦
59 讌 EXTRACT EXTRACT 轟 讌,螳 螳企 讌 螳 朱覿 讌 讌  螳 豢豢 覦
60 讌 GREATEST GREATEST  伎 語 譴 螳  螳 覦.
61 讌 LEAST LEAST 語 EXPR 襴ろ 譴 螳  螳 覦.
62 讌 LAST_DAY LAST_DAY 企 讌螳   襷讌襷 讌襯 覦.
63 讌 MONTH_BETWEEN N 讌 螳  谿襯 蟲.
64 讌 NEXT_DAY N 企轟殊 蠍一朱 覈 殊 れ 讌襯 覲.
65 讌 ROUND ROUND 襷 覈 fmt  讌 襦 覦襴朱 讌襯 覦.
66 讌 SYSDATE SYSDATE 一危 覯伎り  OS 殊 螳 覦.
67 讌 +, - 一 +, - 一
68 讌 TRUNC N 讌襯 ,,殊 蠍一朱 覦襴狩蟇磯 .
. MariaDB
蠍磯 觜蟲
 No 蠍磯 る狩 MariaDB 觜螻
螻  (螻, 蠏, 蟇伎
)
69 覲 CHARTOROWID N CHAR, VARCHAR2, NCHAR, or NVARCHAR2 一危壱 螳朱覿 ROWID朱 覲.
70 覲 CONVERT CONVERT 覓語誤碁ゼ るジ 覓語誤碁 覓語伎 覲
71 覲 HEXTORAW N 16讌襯 raw螳朱 覲.
72 覲 RAWTOHEX N RAW 16讌 覓語襦 覲.
73 覲 ROWIDTOCHAR N rowid 螳 VARCHAR2朱 覲.
74 覲 TO_CHAR N 讌  襯 覓語企 覦蠑朱.
75 覲 TO_DATE N 覓語伎 讌襦 覦蠑朱 .str_to_date()
76 覲 TO_LOB N LONG LONG RAW螳 LOB螳朱 覲.
77 覲 TO_MULTI_BYTE N multibyte 覓語襯  single-byte 覓語襦 覲 覓語襯 覦.
78 覲 TO_NUMBER N 覓語襯 襦 覲
79 覲 TO_SINGLE_BYTE N multibyte覓語襯 蠏語  single-byte覓語襦 覲 char 覦.
80 覲 TRANSLATE N from_string 螳 覓語襯 to_string  覓語襦 豺 expr 覦
81 蠍壱 BFILENAME N 覯  ろ 覓朱Μ LOB 覦企襴 手骸 郁 BFILE locator襯 覦.
82 蠍壱 CASE CASE 譟郁唄(if) 覿蠍磯
83 蠍壱 DECODE N 譟郁唄(if) 覿蠍磯
84 蠍壱 DUMP N 讌 一危一 豺 蠍語 煙 讌 朱 覦.
85 蠍壱 NVL NVL 貎朱Μ 蟆郁骸 NULL(螻給葦朱 覦)螳 豺.
86 蠍壱 NVL2 COALESCE
讌  NULL語 覿 蠏手碓 貎朱Μ 覦 螳   .
expr1 NULL 朱, NVL2 expr2襯 覦. 襷 expr1 NULL企朱, NVL2 expr3 覦.
87 蠍壱 ROWNUM N Select ROW 螳
88 糾(Analytic Function) Ranking N 讌 Window 襯 螻壱 Functionれ企.
89 糾(Analytic Function) Windowing  覿覿讌 Window覯 伎 螳Row 襷 螻,蠏, 豕/豕螳 煙 蟲覃, Self Join 豌覯讌,襷讌襷 Row 蟲  .
90 糾(Analytic Function) Reporting N Query Partition伎  一危一 伎 螻, 蠏, 螳, ク谿,譴ク谿 螳 蟲.
91 糾(Analytic Function) LAG/LEAD  N Self-Join CurrentRow 伎,危 轟Row  Column螳 蟲 螳 .
92 糾(Analytic Function) Statistics  覿覿讌 Group Function螻朱 るゴ蟆 糾覲伎  蟯蟯螻, 蠏 煙 螻
. MariaDB
蠍磯 觜蟲 襴

 蟲
蠍磯
讌 蠍磯
覩語
蠍磯
讌 API
(JDBC, XA )
7 6 1
焔ロレ  旧
(覲豌襴, )
10 3 7
讌 SQL(蠍磯蓋 SQL覓 ) 25 20 5
ろる 覦 る
(企, 碁煙 )
34 18 16
一 17 16 1
一危 
(覓語, , 讌 )
25 13 12
螻  (螻, 蠏, 蟇伎 ) 92 55 37
豐螻
210 131 79
100% 62% 38%
螳覦豸° 伎豸°

 蟲
蠍磯
讌 蠍磯
覩語
蠍磯
ろる蟯襴
(企, 貉 覲蟆 覈轟企)
26 21 5
DB覲伎
(貉 誤 )
5 1 4
讌 Utility (螳覦, , 覦煙 ) 14 9 5
覦煙 覦 覲糾規* 9 6 3
豐螻
54 37 17
100% 69% 31%
From MSSQL to MySQL
螳.
For the Better Open Source World!!

More Related Content

From MSSQL to MySQL

  • 2. Index Oracle MySQL Migration Migration process Schema Migration Data Type Trigger & SP Schema & data Migration 蠍磯 觜蟲
  • 3. Migration Process Analyze Understand Match Src/dest Re/Design Extract src Convert Import Schemas Logic data Index PartitionTest/POCValidate Something fails fails Migration 企至 讌伎 蟾?
  • 4. Migration Process (analyze) Source Database襯 覿 覓伎 伎 蟾? 1. 危危蠍 企れ 蠍磯ル 蠍磯リ讌 襴ろ碁ゼ 襷れ. Issue Workaround Grade* Notes Reference to external schemas in the a different instance (db link) 10 螻牛讌 るジ 襭朱 覲蟆 Packages See Writing stored procedures 9 豌 貊 Procedures See Writing stored procedures 9 豌 貊 Unique key longer then 255 charac ters See Key length limitations 4 Views alias Manually added 4 覲豺 朱 豢螳 Sequences See Migration of Sequences 3 螳ロ覃 Auto Increment襦 覲 Empty schemas See empty schema definitions 2 襦 覲 2. Source Data 誤. ( 一危 企, 覿 or 讌螻 一危, etc) 3. ろる覲 碁 覲旧′煙 蟆. 4. Database Object襯 蠍 碁(觜) 碁 螳 5. Database or Application 蠍磯レ 蠍 碁(觜) 碁 螳
  • 5. Migration Process (understand) Oracle螻 MySQL 谿伎 危危. Server Oracle Schema object 覓語 蟲覲 MySQL lower_case_table_names 旧 磯 覓語 蟲覲 Oracle 企 default螳朱 not null 覈 MySQL Millisecond 5.6覿 讌 Oracle Data Type 覲讌 MySQL sql_mode襦 讌 Oracle varchar2 4,000Byte MySQL varchar 65,535Byte Oracle System Privileges local/external : roles MySQL Privileges (local : no roles) MySQL Oracle dummy table(dual) 螻牛讌 select 1+1 from dual (oracle) select 1+1 (MySQL)
  • 6. Migration Process (understand) Oracle螻 MySQL 谿伎 危危. DML & DDL Key length limitations Oracle index 觚襦伎 40%蟾讌 碁煙れ襴 螳 MySQL 覓語 MySQL 蟆曙 primary key index 蟆曙 255蟾讌 螳(utf-8 蟆曙) index_large_prefix 旧朱 row format compressed 螳 Oracle Sequence Autoincremet襦 豌 Autoincrement Not null伎伎 覃, Primary key襦 燕伎 Oracle sequence 螳 蟆 ex) SELECT MAX(id)+1 FROM tab MySQL 蟆曙 LAST_INSERT_ID()朱
  • 7. Schema Migration Oracle MySQL Package N/A Primary key Primary key Role N/A Schema Schema Sequence AUTO_INCREMENT Snapshot N/A Synonym N/A Table Table Tablespace N/A Temporary Table Temporary Table Trigger for each row Trigger for each row Unique key Unique Key View View Schema Object Similarities
  • 8. Data Types Data Type Mapping MySQL Oracle BIGINT NUMBER(19,0) BIT RAW BLOB BLOB, RAW CHAR CHAR DATE DATE DATETIME DATE DECIMAL FLOAT(24) DOUBLE FLOAT(24) DOUBLE PRECISION FLOAT(24) ENUM VARCHAR2 FLOAT FLOAT INT NUMBER(10,0) INTEGER NUMBER(10,0) LONGTEXT BLOB, RAW
  • 9. Data Types Data Type Mapping MySQL Oracle MEDIUMBLOB BLOB, RAW MEDIUMINT NUMBER(7,0) MEDIUMTEXT CLOB, RAW NUMERIC NUMBER REAL FLOAT(24) SET VARCHAR2 SMALLINT NUMBER(5,0) TEXT VARCHAR2, CLOB TIME DATE TIMESTAMP DATE TINYBLOB RAW TINYINT NUMBER(3,0) TINYTEXT VARCHAR2 VARCHAR VARCHAR2, CLOB YEAR NUMBER
  • 10. Data Types Data Type 觜蟲 Numeric Types MySQL Size Oracle BIGINT 8 Bytes NUMBER(19,0) BIT (M+7)/8 Bytes RAW DECIMAL(M,D) D>0覃 M+2 bytes D=0企 M+1 bytes M<D覃 D+2 bytes FLOAT(24), BINARY_FLOAT DOUBLE 8 Bytes FLOAT(24), BINARY_FLOAT, BINARY_DOUBLE DLUBLE PRECION 8 Bytes FLOAT(24), BINARY_DOUBLE FLOAT(25<=X<53) 8 Bytes FLOAT(24), BINARY_FLOAT FLOAT(x<=24) 4 Bytes FLOAT, BINARY_FLOAT INT 4 Bytes NUMBER(10,0) INTEGER 4 Bytes NUMBER(10,0) MEDIUMINT 3 Bytes NUMBER(7,0) NUMERIC D>0覃 M+2 bytes D=0企 M+1 bytes M<D覃 D+2 bytes NUMBER REAL 8 Bytes FLOAT(24), BINARY_FLOAT SMALLINT 2 Bytes NUMBER(5,0_ TINYINT 1 Bytes NUMBER(3,0)
  • 11. Data Types Data Type 觜蟲 Date and Time Type MySQL Size Oracle DATE 3 Bytes DATE DATETIME 8 Bytes DATE TIMESTAMP 4 Bytes DATE TIME 3 Bytes DATE YEAR 1 Bytes NUMBER
  • 12. Data Types Data Type 觜蟲 String Types MySQL Size Oracle BLOB L + 2 Bytes ~ L<2^16 RAW, BLOB CHAR(M) M Bytes 0<=M<=255 CHAR ENUM(V1, V2, ..) 1 OR 2 Bytes ENUM 螳(豕 65535) VARCHAR2 LOGBLOB L + 4 Bytes ~ L < 2 ^ 32 RAW, BLOB LONGTEXT L + 4 Bytes ~ L < 2 ^ 32 RAW, CLOB MEDIUMBLOB L + 3 Bytes ~ L < 2 ^ 24 RAW, BLOB MEDIUMTEXT L + 3 Bytes ~ L < 2 ^ 24 RAW, CLOB SET(V1, V2, ..) 1, 2, 3, 4 or 8 Bytes VARCHAR2 TEXT L + 2 Bytes ~ L < 2 ^ 16 VARCHAR, CLOB TINYBLOB L + 1 Bytes ~ L < 2 ^ 8 RAW, BLOB TINYTEXT L + 1 Bytes ~ L < 2 ^ 8 VARCHAR2 VARCHAR(M) L + 1 Bytes ~ L < M MySQL 5.0.3 伎 0<=M<=255 MySQL 5.0.3危 0<=M<=65,535 螻殊 MAX SIZE = 65,532 VARCHAR2, CLOB
  • 13. Trigger & SP Trigger Trigger & SP MySQL 企 碁Μ蟇 企企 碁Μ蟇 企欧碁ゼ 螳 襯 る Before insert After updat襯 螳 Oracle 蟆曙 覃 碁Μ蟇磯ゼ ( 碁Μ蟇磯 蟲覓 碁Μ蟇 螳) MySQL 企 碁Μ蟇 ろ 譴 る 豌襴 覲伎 碁Μ蟇 企企 碁Μ蟇 企欧 譴 襷 ろ蟇磯 ろ 讌 蟆曙 襦る葦 Oracle 碁Μ蟇一 ろ 覈語 碁企 覈 蟆郁骸螳 炎概伎朱 ろ 覃 蠏碁讌 朱 襦る葦 Oracle螻 MySQL Procedure 蟲覓語 谿企 れ螻 螳 Replace蟲覓 DO 蟲覓 MySQL DO蟲覓語 覓願 覦讌 , Oracle 蟆曙 select expr1, into from dual 蟲覓語朱 覲 覲牛 De
  • 14. Trigger & SP Stored Procedure Stored procedure Oracle螻 MySQL Procedure 蟲覓語 谿 Replace蟲覓 DO 蟲覓 MySQL DO蟲覓語 覓願 覦讌 - Oracle 蟆曙 select expr1, into from dual 蟲覓語朱 覲 覲牛 declare 蟲覓 覲牛 Set 蟲覓 - MySQL DECLARE a INT; /* simple */ DECLARE a, b INT DEFAULT 5; /* complex */ - Oracle a INT; /* simple */ a INT := 5; b INT := 5; /* complex */ - MySQL SET x:=1; /* simple */ SET x:=1, y:=0; /* complex */ - Oracle x :=1; /* simple */ x :=1; y :=0; /* complex */
  • 15. Trigger & SP Stored Procedure Package - MySQL CREATE PROCEDURE p2() BEGIN SET @a = 5; SET @b = 5; SELECT @a, @b; END; - Oracle CREATE OR REPLACE PACKAGE root.globalPkg AS a NUMBER; b NUMBER; END globalPkg; CREATE OR REPLACE PROCEDURE root.p2 AS BEGIN globalPkg.a := 5; globalPkg.b := 5; DBMS_OUTPUT.PUT_LINE(globalPkg.a || , || globalPkg.b); END p2;
  • 16. Trigger & SP Stored Procedure 焔
  • 17. Schema & DATA Migration Toolkit http://downloads.mysql.com/archives/migration/
  • 18. Schema & DATA SQLyog or Workbench http://www.webyog.com
  • 20. . MariaDB 蠍磯 觜蟲 伎豸° No 蟲覿 蠍磯 る狩 MySQL 觜螻 ろる蟯襴 (企, 貉 覲蟆 覈轟企) 1 企ろ 伎 企ろ伎 CREATE 讌 讌 覯 offline 豢螳襷 螳ロ 2 企ろ 伎 企ろ伎 RENAME 讌 朱讌 企 table space 煙 覲蟆 螳 3 企ろ 伎 企ろ伎 DROP 讌 讌 4 企 企 CREATE 讌 讌 5 企 企 RENAME 讌 讌 6 企 企 MOVE 讌 讌 RENAME 7 企 企 TRUNCATE 讌 讌 8 企 企 DROP 讌 讌 9 企 企 STRUCTURE VALIDATE 讌 讌 CHECK, ANALYZE 10企 企 MONITORING 讌 N 11碁煙 碁煙 CREATE 讌 讌 12碁煙 碁煙 RENAME 讌 讌 13碁煙 碁煙 REBUILD 讌 讌 14碁煙 碁煙 DROP 讌 讌 15碁煙 碁煙 MONITORING 讌 N 16貉 企 貉 ADD 讌 讌 17貉 企 貉 DROP 讌 讌 18貉 企 貉 RENAM E 讌 讌 19貉 企 貉 TYPE覲蟆曙 讌 20貉 企 貉 LENGTH 覲蟆 讌 讌 21貉 企 貉 DEFAULT 覲蟆 讌 讌 22蠍壱 伎 蠍磯(Recycleb in) 讌 N 23蠍壱 DB螻糾 讌 讌 autoextend , innodb_autoextend_increment 24蠍壱 殊 襴り係(Table Shrink) 讌 N 25蠍壱 殊 襴り係(Table Coalesce) 讌 N 26蠍壱 殊 碁煙 REBUILD 讌 讌 DB覲伎 (貉 誤 ) 1 豌伎 覦 AUDIT 讌 讌 enterprise 覯襷 plug-in 朱 讌 2 豌伎 覦 DB覲伎 TDE(Transparent Databas e Encryption) N column encrypt 讌 3 豌伎 覦 DB覲伎 Transparent Tablespace E ncryption(TTE) N column encrypt 讌 4 豌伎 覦 DB覲伎 覲牛誤 DBれ 螻 N ,覲牛誤 DB function 讌 5 豌伎 覦 DB覲伎 Data Security(旧) N
  • 21. . MariaDB 蠍磯 觜蟲 No 蟲覿 蠍磯 る狩 MySQL 觜螻 讌 Utility (螳覦, , 覦煙 ) 1 Utility Gui Admin Tool OEM 讌 enterprise monitor 2 Utility Interactive SQL蠍 sqlplus 讌 mysql 3 Utility DBMS Admin TOOL sqlplus 讌 mysql 4 Utility Data Loader /Unloader sql*Loader 讌 mysqlimport 5 Utility Data export/import Exp/Imp 讌 mysqldump / mysqlimport 6 Utility Connection Dispatcher Listener N 7 Utility DB Creater Dbca 讌 DBCA 8 Utility C Precompiler Pro*C 讌 MySQL++ / User Define Function (UDF's) 9 Utility Recovery Manager RMAN 讌 Zmanda Utility 10 Utility 焔 Monitor 焔ル磯 る(AWR) :1 螳 螳蟆 7 覲願 N mysqladmin / show 覈轟 / 螳譬 碁Μ 11 Utility 焔ル磯 る(ASH) : 豕 蠏 30覿 語 覲 N 12 Utility Trace 覿 Utility Trace 覿 Utility(tkprof) N explain / profiling 13 Utility SQL Trace oradebug N profiling / status 14 Utility SQL Plan explain 讌 explain 覦煙 覦 覲糾規 1 Backup Online(Hot) Backup 讌 讌 2 Backup Offline(Cold) Backup 讌 讌 3 Backup Table Export / Import 讌 讌 4 Recovery 覿覲糾規(Time Based) 讌 N Table Space 覿 覲糾規 innodb_force_recovery 螳 朱, 覲糾規 binlog襯 螳ロ讌襷, 蟆 蠍磯 襷れ広 讌 5 Recovery 覿 覲糾規(Cancel) 讌 N 6 Recovery 覿覲糾規(SCN Based) 讌 N 7 Recovery 覲糾規 讌 讌 8 Recovery Tablespace 覲糾規 讌 讌 9 Recovery Table 覲糾規 讌(Flashback Database) 讌
  • 22. . MariaDB 蠍磯 觜蟲 螳覦 豸° No 蠍磯 る狩 MySQL 觜螻 讌 API (JDBC, XA ) 1 JDBC Driver 螻 螻 2 ODBC Driver 螻 螻 3 PHP Driver 螻 螻 4 Embedded SQL 螻(pro*C) 螻 libmysqld 5 Interface 螻(OCI) N 6 XA API 螻給 螻 XA Transaction 7 Threaded Application 讌 讌 焔ロレ 旧 (覲豌襴, ) 1 Hint 蠍磯 讌 讌 2 Cost Optimizer 讌 讌 3 Parallel Select 讌 N 4 Parallel DML(Insert/update/delete) 讌 N 5 parallel DDL(create/alter table/index) 讌 N 6 ANALYZE 讌 讌 7 Estimate(Sampling) 讌 N 8 Parallel 糾覲 讌 N 9 碁煙 Load譴 糾覲 讌 N 10 Histogram 讌 N 讌 SQL(蠍磯蓋 SQL覓 ) 1 SQL 譴 SQL , 覲 SQL(SQL92, SQL99讌) 讌 2 Sub-query(In-Line View) 讌 讌 3 Sub-query(Scalar) 讌 讌 4 Sub-query(=,IN,EXISTS) 讌 讌 5 Equi Join 讌 讌 6 Inner Join 讌 讌 7 Outer Join 讌 讌 8 Self Join 讌 讌 9 螻豸旧 讌 CONNECT BY ~ WITH 讌 N 10 Array Processing 讌 N 11 SELECT ~ FOR UPDATE 讌 讌 12 SELECT DISTINCT ~ 讌 讌 13 UNION 讌 讌 14 UNION ALL 讌 讌 15 INTERSECT 讌 N 16 MINUS 讌 N 17 CERATE TABLE AS SELECT ~ 讌 讌 18 VIEW襯 牛 DML 讌 讌 19 WHERE REGEXP(蠏)_LIKE Condition 讌 讌 where REGEXP condition / where NOT REGEXP dondition / where rlike condition 20 Literal/Bind SQL 讌 讌 21 WITH ~ 覓 讌 N 22 MERGE ~ 覓 讌 讌 insert into ~ ON DUPLICATE KEY UPDATE 23 Multi-Insert ~ 覓 讌 曙讌 insert into ~ values (),(),() 24 Grouping Set 蠍磯 讌 讌 25 CLOB SELECT QUERY 讌 讌
  • 23. . MariaDB 蠍磯 觜蟲 No 蠍磯 る狩 MySQL 觜螻 ろる 覦 る (企, 碁煙 ) 1 Table 讌 讌 2 Table Compression 讌 讌 3 Index-Organized Table 讌 N cluster index table 4 Stored Procedure 讌 讌 5 Stored Function 讌 讌 6 Trigger 讌 - before/after 讌 - 蟲覓 碁Μ蟇 (statement trigger) - 碁Μ蟇 (row trigger) - Instead of trigger - system event trigger - user event trigger 讌 7 View 讌 讌 8 Sequence 讌 N auto_increment 9 DB Link 讌 N only federated engine 10 Synonym 讌 N 11 Queue 讌( Advanced Queue) N 12 Monitoring View 讌 讌 information_schem / performance_schema 13 Grant/ Revoke 讌 讌 14 蠍磯蓋(Primary Key) Constraint 讌 讌 15 碁(Foreign Key) Constraint 讌 讌 16 碁(Foreign Key) Constraint ( Enable Novalidate 旧) 讌 N 17 NOT NULL Constraint 讌 讌 18 UNIQUE Constraint 讌 讌 19 CHECK Constraint 讌 讌 20 蠍磯蓋螳(Defaultれ) 讌 讌 21 Temporary Table 讌 讌 22 External Table 讌 N 23 Index(Function-Based) 讌 N 24 Index(Bitmap) 讌 N 25 Index(Reverse Key) 讌 N 26 Index Key Compression 讌 N 27 Stored Package 讌 N 28 Role 讌 讌 29 Snapshot(MATERIALIZED VIEW) 讌 N 30 User Defined Type 讌 N enum() 31 Cluster Object 讌 N NDB cluster 蟆曙一襷 讌 32 XML 讌 讌 讌 ExtractValue() , UpdateXML() 33 譯殊(Table Comment) 讌 讌 34 譯殊(Column Comment) 讌 讌 一 1 一 譬襯(覦覯) - 覯 一(RANGE) 讌 讌 2 一 譬襯(覦覯) - 襴ろ 一(LIST) 讌 讌 3 一 譬襯(覦覯) - 伎 一(HASH) 讌 讌 4 一 譬襯(覦覯) - 譟壱 一(COMPOSITE) 讌 讌 5 一 蟯襴 覈轟 - 一 豢螳(ADD) 讌 讌 7 一 蟯襴 覈轟 - 一 (DROP) 讌 讌 8 一 蟯襴 覈轟 - 一 覿(SPLIT) 讌 讌 9 一 蟯襴 覈轟 - 一 覲(MERGE) 讌 讌 10 一 蟯襴 覈轟 - 一 TRUNCATE 讌 讌 11 一 蟯襴 覈轟 - 一 RENAME 讌 讌 12 一 蟯襴 覈轟 - 一 蟲(EXCHANGE) 讌 讌 13 一 蟯襴 覈轟 - 一 MODIFY 讌 讌 14 一 蟯襴 覈轟 - 一 MOVE 讌 讌 15 一 蟯襴 - Index Partition Rebuild 讌 16 一 碁煙 - Global Index 讌 N 17 一 碁煙 - Local Index 讌 讌
  • 24. . MariaDB 蠍磯 觜蟲 No 蠍磯 る狩 MySQL 觜螻 一危 (覓語, , 讌 ) 1 CHAR 螻蠍語 覓語 . 豕 2000 byte. 讌 1~8000 byte 2 VARCHAR 螳覲蠍語 覓語 . 豕 4000 byte 讌 1~8000 length 3 VARCHAR2 螳覲蠍語 覓語 . 豕 4000 byte N 4 NCHAR 貊 螻蠍語 覓語 . 豕 2000 byte 讌 1~4000 byte 5 NVARCHAR2 貊 螻蠍語 覓語 . 豕 4000 byte N 1~4000 length 6 CLOB byte 覓語 . 豕 (4 GB - 1) * DB_BLOCK_SIZE? N TEXT , MEDIUMTEXT, LONGTEXT 7 NCLOB 貊 覓語 . 豕 (4 GB - 1) * DB_BLOCK_SIZE? N 8 LONG 覓語 . 豕2G N 9 NUMBER (p,s) .覦 p 1~38, れ s -87~127 N INT, INTEGER, TINYINT, SMALLINT, MEDIUMINT, BIGINT 10 NUMERIC 讌 NUMERIC 11 INT 讌 INT, INTEGER, TINYINT, SMALLINT, MEDIUMINT, BIGINT 12 DECIMAL 讌 DECIMAL 13 DOUBLE PRECESION 讌 14 FLOAT 讌 15 REAL 讌 -3.40E + 38 ~ 3.40E + 38 16 SMALLINT 讌 17 DATE 讌. BC 4712 11 ~ AD 9999 12 31 讌 18 TIMESTAMP Microsecond襯 讌 讌 覿豐 襷危襦豐蟾讌 讌 19 TIMESTAMP WITH TIME ZONE N 20 TIMESTAMP WITH LOCAL TIMEZONE N 21 BLOB 伎 螳豌 . 豕 (4 GB - 1) * DB_BLOCK_SIZE? 讌 BLOB , MEDIUMBLOB , LONGBLOB 22 BFILE 伎 . 豕 4G N 23 RAW (size) 伎 . 豕 2000 byte N BLOB , MEDIUMBLOB , LONGBLOB 24 LONG RAW 螳覲蠍語 伎 . 豕 2G N BLOB , MEDIUMBLOB , LONGBLOB 25 ROWID N
  • 25. . MariaDB 蠍磯 觜蟲 No 蠍磯 る狩 MariaDB 觜螻 螻 (螻, 蠏, 蟇伎 ) 1 蠏碁9 AVG AVG 蠏 2 蠏碁9 COUNT COUNT 3 蠏碁9 MAX MAX 豕螳 4 蠏碁9 MIN MIN 豕螳 5 蠏碁9 STDDEV STDDEV 譴ク谿 6 蠏碁9 SUM SUM 螻 7 蠏碁9 VARIANCE VARIANCE 覿 8 ABS ABS 螳 |n| 9 ACOS ACOS n 貊(arc cosine)螳 覦. 10 ASIN ASIN n (arc sine)螳 覦. 11 ATAN ATAN n (arc tangent)螳 覦. 12 ATAN2 ATAN2 ATAN2(n,m) atan2(n/m)螻 螳朱, n/m (arc tangent)螳 覦. 13 CEIL CEIL n覲企 螳 譴 豕螳 14 COS COS n(朱朱 螳) 貊瑚 覦. 15 COSH N n(朱朱 螳) 螻 貊瑚(hyperbolic cosine) 覦. 16 EXP EXP 讌螳 e襯 覦朱 e n 螳 17 FLOOR FLOOR n覲企 螳 譴 豕螳 18 GREATEST GREATEST 伎 語譴 螳 螳 覦. 19 LEAST LEAST 語 EXPR 襴ろ 譴 螳 螳 覦. 20 LN LN log螳 覦 e 讌 n 21 LOG LOG LOG(m,n) 覦 m朱 n 襦蠏 螳 覦. 22 MOD MOD m n 朱 襾語 23 POWER POWER m n 24 ROUND ROUND 覦襴 25 SIGN SIGN n 覿碁ゼ 覦. 26 SIN SIN n (sine)螳 覦. 27 SINH N n 螻′ (hyperbolic sine) 覦. 28 SQRT SQRT n 螻炎啓 覦. 29 TAN TAN n (tangent)螳 覦. 30 TANH TANH n 螻′ (hyperbolic tangent) 覦. 31 TRUNC N 語 n1 襴 朱誤 n2 危襯 . 32 覓語 ASCII ASCII 譯殊伎 char 豌 覓語 ろ 螳 10讌螳 覦.
  • 26. . MariaDB 蠍磯 觜蟲 No 蠍磯 る狩 MariaDB 觜螻 螻 (螻, 蠏, 蟇伎 ) 32 覓語 ASCII ASCII 譯殊伎 char 豌 覓語 ろ 螳 10讌螳 覦. 33 覓語 CHR N 10讌 n ろれ襯 覦. CHAR( 55 using ASCII) 34 覓語 CONCAT CONCAT char1螻 char2襯 郁屋 覦. 35 覓語 GREATEST GREATEST 覓語 譴 蟆 36 覓語 INITCAP N 覓語 譴 螳 伎 豌 蠍襯 覓語襦 襾語 覓語襦 覲 覦. 37 覓語 INSTR INSTR 覓語伎 讌 覓語螳 豌 豺襯 襦 覦. 38 覓語 INSTRB N 覓語伎 覓語襯 谿場. return 螳 谿場 豺(Byte ) DELIMITER $$ 39 覓語 LEAST LEAST 覓語 譴 蟆 40 覓語 LENGTH LENGTH 語 char 蠍語企ゼ 覦 41 覓語 LENGTHB N 覓語伎 蠍語(Byte ) 42 覓語 LOWER LOWER 覓語襦 覲貅譯朱 43 覓語 LPAD LPAD 讌 襴 n朱覿 expr1 豈郁,狩ク 螻糾 expr1 豈企. 44 覓語 LTRIM LTRIM 覓語 char 譬豸′朱覿 set朱 讌 覈 覓語襯 蟇壱. 45 覓語 NLS_INITCAP N (INITCAP襷讌)螳 伎 豌 覓語襯 覓語襦, 襾語 覓語襯 覓語襦 覲 char襯 覦. 46 覓語 NLS_LOWER N 覈 覓語襯 覓語襦 覲 覦. 47 覓語 NLS_UPPER N 覓語伎 覈 覓語襦 覲 覓語伎 覦. 48 覓語 NLSSORT N 覓語伎 ろ碁 覦. 49 覓語 REPLACE REPLACE 朱誤磯 譯殊伎 豌覯讌 覓語伎, 覯讌 覓語伎 覈 碁讌 覓語企 覦蠑 蟆郁骸襯 覦. 50 覓語 RPAD RPAD 語 expr1 るジク朱 語 expr2襦 讌 覓語襯 蠍語 磯 覦覲牛 n襷 覿譴 51 覓語 RTRIM RTRIM 語 char るジ讓 覿 set朱 讌 覈 覓語襯 蟇壱. 52 覓語 SOUNDEX SOUNDEX char 螳讌 覓語伎 覦. 53 覓語 SUBSTR SUBSTR 覓語 Char position 覓語 豺襦覿 substring_length 覓語 蠍語企 覓語伎 豢豢 覦 54 覓語 SUBSTRB N 企 豺 螳 襷殊 覓語伎 豢豢.(Byte ) 55 覓語 TRANSLATE N from_string 螳 覓語襯 to_string 覓語襦 豺 expr 覦. 56 覓語 TRIM TRIM 覓語企 (讓)覓語襯 蟇. 57 覓語 UPPER UPPER 覈 覓語襯 覓語襦 覲 58 讌 ADD_MONTH N 殊 date 轟 螳 integer襯 螳 覦 59 讌 EXTRACT EXTRACT 轟 讌,螳 螳企 讌 螳 朱覿 讌 讌 螳 豢豢 覦 60 讌 GREATEST GREATEST 伎 語 譴 螳 螳 覦. 61 讌 LEAST LEAST 語 EXPR 襴ろ 譴 螳 螳 覦. 62 讌 LAST_DAY LAST_DAY 企 讌螳 襷讌襷 讌襯 覦. 63 讌 MONTH_BETWEEN N 讌 螳 谿襯 蟲. 64 讌 NEXT_DAY N 企轟殊 蠍一朱 覈 殊 れ 讌襯 覲. 65 讌 ROUND ROUND 襷 覈 fmt 讌 襦 覦襴朱 讌襯 覦. 66 讌 SYSDATE SYSDATE 一危 覯伎り OS 殊 螳 覦. 67 讌 +, - 一 +, - 一 68 讌 TRUNC N 讌襯 ,,殊 蠍一朱 覦襴狩蟇磯 .
  • 27. . MariaDB 蠍磯 觜蟲 No 蠍磯 る狩 MariaDB 觜螻 螻 (螻, 蠏, 蟇伎 ) 69 覲 CHARTOROWID N CHAR, VARCHAR2, NCHAR, or NVARCHAR2 一危壱 螳朱覿 ROWID朱 覲. 70 覲 CONVERT CONVERT 覓語誤碁ゼ るジ 覓語誤碁 覓語伎 覲 71 覲 HEXTORAW N 16讌襯 raw螳朱 覲. 72 覲 RAWTOHEX N RAW 16讌 覓語襦 覲. 73 覲 ROWIDTOCHAR N rowid 螳 VARCHAR2朱 覲. 74 覲 TO_CHAR N 讌 襯 覓語企 覦蠑朱. 75 覲 TO_DATE N 覓語伎 讌襦 覦蠑朱 .str_to_date() 76 覲 TO_LOB N LONG LONG RAW螳 LOB螳朱 覲. 77 覲 TO_MULTI_BYTE N multibyte 覓語襯 single-byte 覓語襦 覲 覓語襯 覦. 78 覲 TO_NUMBER N 覓語襯 襦 覲 79 覲 TO_SINGLE_BYTE N multibyte覓語襯 蠏語 single-byte覓語襦 覲 char 覦. 80 覲 TRANSLATE N from_string 螳 覓語襯 to_string 覓語襦 豺 expr 覦 81 蠍壱 BFILENAME N 覯 ろ 覓朱Μ LOB 覦企襴 手骸 郁 BFILE locator襯 覦. 82 蠍壱 CASE CASE 譟郁唄(if) 覿蠍磯 83 蠍壱 DECODE N 譟郁唄(if) 覿蠍磯 84 蠍壱 DUMP N 讌 一危一 豺 蠍語 煙 讌 朱 覦. 85 蠍壱 NVL NVL 貎朱Μ 蟆郁骸 NULL(螻給葦朱 覦)螳 豺. 86 蠍壱 NVL2 COALESCE 讌 NULL語 覿 蠏手碓 貎朱Μ 覦 螳 . expr1 NULL 朱, NVL2 expr2襯 覦. 襷 expr1 NULL企朱, NVL2 expr3 覦. 87 蠍壱 ROWNUM N Select ROW 螳 88 糾(Analytic Function) Ranking N 讌 Window 襯 螻壱 Functionれ企. 89 糾(Analytic Function) Windowing 覿覿讌 Window覯 伎 螳Row 襷 螻,蠏, 豕/豕螳 煙 蟲覃, Self Join 豌覯讌,襷讌襷 Row 蟲 . 90 糾(Analytic Function) Reporting N Query Partition伎 一危一 伎 螻, 蠏, 螳, ク谿,譴ク谿 螳 蟲. 91 糾(Analytic Function) LAG/LEAD N Self-Join CurrentRow 伎,危 轟Row Column螳 蟲 螳 . 92 糾(Analytic Function) Statistics 覿覿讌 Group Function螻朱 るゴ蟆 糾覲伎 蟯蟯螻, 蠏 煙 螻
  • 28. . MariaDB 蠍磯 觜蟲 襴 蟲 蠍磯 讌 蠍磯 覩語 蠍磯 讌 API (JDBC, XA ) 7 6 1 焔ロレ 旧 (覲豌襴, ) 10 3 7 讌 SQL(蠍磯蓋 SQL覓 ) 25 20 5 ろる 覦 る (企, 碁煙 ) 34 18 16 一 17 16 1 一危 (覓語, , 讌 ) 25 13 12 螻 (螻, 蠏, 蟇伎 ) 92 55 37 豐螻 210 131 79 100% 62% 38% 螳覦豸° 伎豸° 蟲 蠍磯 讌 蠍磯 覩語 蠍磯 ろる蟯襴 (企, 貉 覲蟆 覈轟企) 26 21 5 DB覲伎 (貉 誤 ) 5 1 4 讌 Utility (螳覦, , 覦煙 ) 14 9 5 覦煙 覦 覲糾規* 9 6 3 豐螻 54 37 17 100% 69% 31%
  • 30. 螳. For the Better Open Source World!!