views:

177

answers:

4

Is it true that better concurrency can be achieved in Oracle databases than in MS SQL Server databases? In particular in an OLTP scenario, such as an ERP system?

I've overheard an SAP consultant making this claim, referring to Oracle locking techniques like row locking and multi-version read consistency and the redo log.

A: 

Sql Server has row locking, several different transaction isolation levels, and a transaction log that can be replayed.

Maybe he's referring to Access, which does not have these.

Or maybe he believes Oracle uses better defaults. He might have a better argument there, but with either DBMS if you're talking ERP you better have a DBA who knows enough about the system to keep it tuned properly.

Joel Coehoorn
+3  A: 

Out of the box, Oracle will have a higher transaction throughput but this is because it defaults to MVCC. SQL Server defaults to blocking selects on uncommitted updates but it can be changed to MVCC as well so that difference should basically go away. See Read Committed Isolation Level.

See Enabling Row Versioning-Based Isolation Levels.

When the ALLOW_SNAPSHOT_ISOLATION database option is set ON, the instance of the Microsoft SQL Server Database Engine does not generate row versions for modified data until all active transactions that have modified data in the database complete. If there are active modification transactions, SQL Server sets the state of the option to PENDING_ON. After all of the modification transactions complete, the state of the option is changed to ON. Users cannot start a snapshot transaction in that database until the option is fully ON. The database passes through a PENDING_OFF state when the database administrator sets the ALLOW_SNAPSHOT_ISOLATION option to OFF.

cletus
+1 Excellent answer!
Christian13467
I would also add that MS SQL pesimistically stores old data versions in the version store, at each change, while Oracle can create old versions on-the fly when needed. AFAIK Oracle can afford to do this because the separation of undo and redo streams in the log, allowing for a fast undo sequence, to create an image of data at the moment the reader needs it.
Remus Rusanu
+2  A: 

He/She was probably referring to the facts that:

  • In Oracle readers do not block writers and writers do not block readers
  • Oracle does not maintain a list of row locks so there is no significant overhead in locking and locks never escalate to the table level.
David Aldridge
A: 

Starting with SQL 2005 this is no longer true - you can enable snapshot isolation and your writers will not block your readers, just like in Oracle.

AlexKuznetsov