You are on page 1of 7

A

 compassion  between  Oracle  SQL  


Server  and  MySQL  in  Transaction  
Management  handling  
Name: David power

Student number: 06371353

Lecturer: T.J. MacDonald

Date: 07/04/2010
Database  Administration:  Transaction  Management   05/05/2010  

Contents  
Introduction ........................................................................................................................................... 2  

What  is  transaction  management?........................................................................................................ 2  

Oracle..................................................................................................................................................... 2  

MySQL.................................................................................................................................................... 3  

Microsoft  SQL  Server ............................................................................................................................. 4  

How  do  they  differ? ............................................................................................................................... 4  

Where  are  they  found?...................................................................................................................... 4  

Transaction  isolation  levels................................................................................................................ 4  

Security .............................................................................................................................................. 4  

Schema  Objects ................................................................................................................................. 5  

SQL  Server  features ........................................................................................................................... 5  

Conclusions ............................................................................................................................................ 5  

References ............................................................................................................................................. 6  

1  

 
Database  Administration:  Transaction  Management   05/05/2010  

Introduction  
I   aim   to   examine   transaction   management   from   both   an   Oracle   and   MySQL   perspective   and   then  
provide  a  comparison  between  the  two.  Highlighting  any  difference  between  the  ways  the  provide  
this  important  service.  

What  is  transaction  management?  


Before   I   begin   my   comparison   I   would   like   to   discuss   transaction   management   and   the   different  
elements  that  come  together  to  form  this  service.  Firstly  what  are  transactions  and  what  issues  arise  
in  their  existence?  A  transaction  is  a  unit  of  work  handled  by  a  DBMS  that  takes  a  database  from  one  
consistent  state  to  the  next.  Transaction  management  is  the  process  of  tracking  these  transactions  
and   performing   actions   on   them   depending   on   different   external   influences   e.g.   Transactions   will  
either   fully   commit   or   not,   that   is   to   say   they   will   either   happen   or   they   won’t   by   rolling   back   all  
changes  made.  This  is  achieved  using  the  redo  log  file.  This  is  known  as  the  “All  or  nothing”  behavior.  
Two  important  elements  of  all  transactions  are  transactions  need  to  be  able  to  recover  from  failure  
and  be  isolated  from  other  transactions.  These  characteristics  are  achieved  using  ACID.  ACID  being  
present  in  both  Oracle  and  MySQL.  ACID  is  an  acronym  for  Atomicity,  which  is  the  characteristic  that  
all  transactions  must  be  atomic  that  is  they  follow  the  “all  or  nothing”  rule  and  execute  in  a  single  
instance   (they   are   not   subdivided),   this   is   important   considering   there   are   many   reasons   a  
transaction   could   fail,   hardware   failure   on   both   the   server   and   client   side,   application   failure,  
network  failure  (connection  to  the  database  is  lost)  or  database  failure  (database  runs  out  of  room  
to   store   data)   however   unlikely   considering   how   cheap   storage   has   become.   Consistency   is   the  
characteristic  that  each  transaction  should  take  the  database  from  one  consistent  state  to  another,  
rolling   back   any   transaction   that   violates   consistency   rules.   The   goal   being   the   avoidance   of   dirty  
data.  An  example  of  this  could  be,  a  table  field  states  it  only  accepts  integer  values  but  has  accepted  
a  decimal.  A  consistency  rule  may  be  to  kill  this  transaction  or  to  change  the  value  to  an  integer  (the  
latter   being   unlikely).   Isolation   is   the   characteristic   of   keeping   all   transactions   separate   from   each  
other   to   a   degree   that   they   are   unaware   of   the   existence   of   other   transactions   until   it   has  
committed.   This   includes   access   to   data   that   is   being   modified   during   that   transaction.   The   final  
characteristic   of   ACID   is   durability,   this   is   a   guarantee   that   once   a   transaction   has   committed   the  
data   handled   and   modified   is   permanent   and   will   not   be   lost   even   if   a   failure   occurs   after   the  
transaction.  This  is  often  achieved  by  using  a  transaction  log,  which  can  rewrite  transactions  if  the  
system  suffers  hardware  damage.  

Oracle  
How   does   Oracle   handle   transaction   management   in   relation   to   concurrency?   Oracle   uses   a   set   of  
concurrency   controls   to   achieve   this.   One   such   control   is   Locking.   Locks   are   a   means   of   regulating  
concurrent  access  to  a  database  and  preventing  concurrent  modification  of  a  data  structure.  Within  
Oracle  there  are  two  types  of  Locks,  Pessimistic  locking  involves  the  following;  

A  record  is  read  and  the  version  number  for  that  record  is  stored.  When  the  system  goes  to  write  
back   on   that   record   (enter   new   data   in   its   place)   the   transaction   is   filter   based   on   the   version   to  
make  sure  it's  atomic.  (That  is  to  say,  it  hasn't  been  updated  between  when  you  check  the  version  
2  

 
Database  Administration:  Transaction  Management   05/05/2010  

and  write  the  record  to  the  disk)  If  the  record  has  a  different  version  number  it  is  called  “dirty”  and  
the  transaction  is  aborted.  This  type  of  lock  is  found  where  there  is  no  dedicated  connection  to  the  
database,   it   is   more   commonly   found   in   shared   server   configuration   where   there   is   a   pool   of  
connections  available.  The  other  type  of  locking  is  called  pessimistic  locking.  This  type  is  cautious  in  
its   behavior   as   the   lock   used   locks   the   record   exclusively   for   your   transaction   until   it   is   finished.  
Pessimistic   locking   gives   better   integrity   but   can   result   in   more   deadlocks   if   an   application   is  
designed  poorly  and  uses  this  lock  type.  To  use  this  type  of  locking  type  the  server  must  be  either  
configured   as   a   dedicated   server   or   support   some   form   of   transaction   identifying,   this   is   done   by  
allocation  your  with  a  TxID   [1].  Security  is  an  important  element  of  transaction  management.  Oracle  
is   used   by   many   of   the   worlds   leading   banking   organizations   for   example   Barclay’s   iBank   system,  
which   aims   to   improve   the   security   of   simultaneous   transactions   of   a   fiscal   nature.     In   an   attempt   to  
take  advantage  of  multithreading  in  improving  transaction  execution  many  users  of  the  system  were  
able  to  access  other  peoples  bank  accounts  [2].  Ovum,  a  research  group  states  that  an  important  part  
of  transaction  management  is  to  keep  the  user  a  few  steps  removed  from  the  storage  location  of  this  
data,  they  also  specify  that  a  firewall  is  the  most  basic  and  effective  way  of  doing  this  but  that  80%  
of  all  firewall  configuration  they  have  examined  are  poorly  implemented.  Running  any  web  available  
service  behind  a  firewall  can  causes  accessibility  problems  fortunately  Oracle  supports  port  sharing  
which   enables   a   security   administrator   to   share   ports   on   the   same   firewall,   improving   accessibility  
while  keeping  the  firewall  “tight”  [3]  [5].    

MySQL  
Like  Oracle  MySQL  supports  the  four  elements  of  ACID.  Another  similarity  between  the  two  is  there  
use  of  Transaction  control  statements  but  two  differences  exist.  In  Oracle  the  user  never  needs  to  
begin   a   statement   the   “start”   statement   is   implied   but   in   MySQL   there   are   times   when   a   user   or  
system   needs   to   specify   the   start   of   a   transaction.   Also   the   syntax   differs   in   MySQL   the   string  ‘begin’  
is  used  to  start  a  transaction  while  Oracle  uses  ‘SET  TRANSACTION’.  While  not  directly  influential  to  
the  way  in  which  MySQL  handles  transaction  management  MySQl’s  license  type  plays  an  important  
role  in  defining  the  different  applications  of  MySQL.  MySQL  is  open  source,  which  provides  MySQL  
users   with   a   unique   set   of   advantages   over   Oracle   system   users.     Some   of   the   significant   pros   for  
choosing   an   open   source   system   are   as   follows.   Having   access   to   the   source   code   and   more  
importantly  having  the  right  to  modify  it  gives  several  benefits  of  its  own.  Firstly  giving  the  general  
public   access   to   the   source   code   means   there   are   many   developers   working   on   the   code   and   it   soon  
becomes   “fine   tuned”.   In   addition   to   this   there   is   no   one   person   who   can   restrict   the   way   the  
software   is   used.   The   engine   of   one   application   could   in   effect   be   taken   and   used   in   a   different  
application  at  no  cost  to  those  developers  promoting  development.   A  good  example  of  how  being  
open   source   has   been   in   MySQL’s   favor   is   in   its   extensive   use   with   other   open   source   products.   PHP  
is  a  very  popular  server  side  scripting  language  used  by  developers  worldwide  to  develop  dynamic  
websites  and  application,  Moodle  and  Blackboard  being  two  examples.  PHP  has  specially  designed  
MySQL  based  functions  to  enable  connectivity  with  their  databases.  Because  of  the  way  Open  source  
software   is   developed   it   often   means   there   is   no   single   source   of   support   if   anything   ever   goes  
wrong.   Because   of   this   MySQL   would   normally   not   be   found   running   behind   finance   systems   like  
Oracle   [6].     MySQL   is   the   only   DBMS   that   supports   all   four   of   the   transaction   Isolation   levels   and  
again   this   is   another   advantage   of   being   open   source.   Because   of   the   availability   of   source   code  

3  

 
Database  Administration:  Transaction  Management   05/05/2010  

there  are  many  developers  contributing  to  the  development  of  MySQL.  One  of  these  companies  is  
Innobase   Oy   who   developed   InnoDB,   which   is   a   very   popular   transactional   storage   engine   for  
MySQL.   Security,   Oracle   users   three   parameters   when   authenticating   users,   users   name,   password  
and  an  additional  parameter.  This  is  normally  an  IP  address,  hostname  or  domain  name.  MySQL  uses  
a   hierarchical   system   for   assigning   privileges,   which   works   through   inheritance.   Privileges   granted   at  
a   high   level   are   passed   down   to   lower   levels.   MySQL   also   categorizes   privileges   into   three   groups.  
Global,   per-­‐host,   database   level,   table   specific   and   column   specific   privilege   granting.   MySQL   does  
not  support  roles,  which  means  to  assign  the  same  set  of  privileges  to  each  user  the  administrator  
must  make  identical  accounts  which  takes  time  [7].    

Microsoft  SQL  Server  


Microsoft’s   SQL   server   runs   on   Windows   servers   and   communicates   with   ASP   .NET   and   IIS   web  
server   technology   with   ease,   similar   to   a   typical   LAMP   server   (Linux,   apache   MySQL   and   PHP).    
Security:   SQL   server   has   been   certified   by   the   (US)   federal   government's   C2-­‐level   security  
certification,  which  is  for  database  technologies  the  best  possible  certificate  to  receive.  The  problem  
for  SQL  Server  is  its  platform  dependence.  It  must  run  on  Windows,  which  does  hot  have  the  same  
level  of  security  as  its  database  engine.  This  results  in  simple.  The  security  being  implemented  is  only  
as  strong  as  its  weakest  application  and  in  this  case  that’s  quite  weak  [8].  Like  MySQL  and  Oracle  SQL  
server   makes   similar   use   of   transaction   control   statements   while   the   syntax   it   looks   similar   to  
MySQL.  

How  do  they  differ?  

Where  are  they  found?  


Oracle  is  a  larger  organization  with  suitably  large  business  contracts  with  companies  like  Barkley  as  a  
result  the  security  technologies  Oracle  products  provide  are  significantly  more  advanced  than  those  
of   MySQL.   An   example   of   on   of   these   technologies   is   the   use   of   RSA   SecurID,   enVision   and   RSA  
Database  Security  Manager.   RSA’s   envision   suit   intelligently   monitors   the   activity   of   users   and  builds  
a   profile.   If   this   users   activities   differ   from   those   stored   in   the   profile   system   administrators   are  
notified   [4].  These  advanced  technologies  offer  levels  of  security  that  MySQL  cannot  compete  with.  
MySQL   is   more   suited   to   running   web-­‐based   application   and   does   so   successfully,   providing   data  
persistence  for  Facebook,  Google  and  Wikipedia.    

Transaction  isolation  levels  


It  is  important  to  be  aware  that  not  all  DMBS  support  all  the  same  isolation  levels  especially  when  
porting  code  between  different  types.  MySQL  supports  all  four  levels  but  SQL  Server  only  supports  
Read  Committed,  Oracle  supports  Read  Committed  and  Serializable.  

Security  
Oracle  and  SQL  Server  use  two  authentication  parameters,  these  being  a  username  and  password.  
MySQL  uses  an  additional  third  parameter,  either  an  IP  address  or  host  name.  Oracle  supports  Roles,  
which   allows   a   user   to   be   defined   as   an   admin   by   clicking   one   button.     MySQL   does   not   support   this  

4  

 
Database  Administration:  Transaction  Management   05/05/2010  

which   means   administrators   often   use   the   same   administrator   accounts,   which   is   bad   when   auditing  
security  [7].  

Schema  Objects  
There  are  several  differences  between  oracle  and  MySQL  in  relation  to  Schema  objects  (logical  data  
storage  structure)  

Oracle MySQL
Package N/A
Role N/A
Snapshot N/A
Synonym N/A
Tablespace N/A
SQL  Server  features  
Some  of  the  differences  I  have  found  between  SQL  server  and  MySQL  are  as  follows;  

SQL Server MySQL


Trigger Support N/A
User Defined functions N/A
Cursor Support N/A
Stored Procedure support N/A
Full Join Support N/A
 
One  of  the  biggest  differences  between  Oracle  and  SQL  server  is  community,  it  is  easier  to  find  
solutions  to  problems  faster  using  SQL  Server  support  sites  than  it  is  with  Oracle  related  sites.  
This  is  down  to  the  fact  that  the  SQL  Server  development  team  is  more  open  about  how  their  
product  works.  

Conclusions  
The  three  different  DBMS  providers  I  have  looked  at  (Oracle,  MySQL  and  SQL  Server)  provide  three  
similar  products  but  there  are  distinct  differences  between  them.  Oracle  seems  to  have  conquered  
the   high-­‐end   finance   market   with   its   advanced   security   features   provide   through   their   partnership  
with  RSA.  MySQL  provides  a  low  cost  DBMS  option,  which  is  suitable  for  test  and  small  to  medium  
OLTP  implantations  but  its  modular  design  and  lack  of  developer  support  makes  a  less  likely  solution  
for   large   organizations   that   absolutely   require   support.   Microsoft’s   SQL   Server   is   possibly   Oracles  
biggest  competitor.  In  terms  of  pricing  the  following  list  ranks  the  three  different  DBMS,  the  number  
one  slot  being  the  most  expensive.  
1. Oracle  database    
2. Microsoft  SQL  Server    
3. MySQL  
Finally,   when   it   comes   to   features   SQL   Server   and   Oracle   surpass   MySQL.   While   the   features  
provided  by  SQL  Server  over  MySQL  may  be  trivial  the  additional  features  Oracle  offers  given  good  
reason  to  choose  Oracle  over  MySQL.  
5  

 
Database  Administration:  Transaction  Management   05/05/2010  

References  
[1]  Optimistic  and  pessimistic  locking  –  [internet]  Available  here:  
http://stackoverflow.com/questions/129329/optimistic-­‐vs-­‐pessimistic-­‐locking  

[2]  Oracle  security  –  [Internet]  available  here:  


http://www.oracle.com/technology/deploy/security/database-­‐security/index.html  

[3]  Transaction  security  in  oracle–  [Internet]  Available  here:  http://www.information-­‐


age.com/article-­‐archive/301491/secure-­‐transactions.thtml  

[4]  RSA  and  Oracle  the  technologies  they  provide  –  [Internet]  Available  here:  
http://www.rsa.com/node.aspx?id=3353  

[5]  Connecting  to  oracle  behind  a  firewall  –  [Internet]  Available  here:  


http://it.toolbox.com/wiki/index.php/Connect_Oracle_Behind_a_Firewall  

[6]  Advantages  of  using  open  source  software  –  [Internet]  Available  here:  
http://eu.conecta.it/paper/Advantages_open_source_soft.html  

[7]  MySQL  vs.  Oracle  –  [Internet]  Available  here:  


http://download.oracle.com/docs/cd/E12151_01/doc.150/e12155/oracle_mysql_compared.htm#i1
026116  

[8]  SQL  Server,  an  examination  –  [Internet]  Available  here:  


http://searchsqlserver.techtarget.com/news/1124761/Face-­‐off-­‐Oracle-­‐vs-­‐SQL-­‐Server  

[9]  Oracle  and  SQL  Server  –  [Internet]  Available  here:  http://www.infoworld.com/d/data-­‐


management/real-­‐difference-­‐between-­‐sql-­‐server-­‐and-­‐oracle-­‐755?page=0,0  

6