Oracle vs. Microsoft SQL Server: Why Oracle wins

Original Article : http://searchoracle.techtarget.com/tip/Oracle-vs-SQL-Server-Why-Oracle-wins
A brief comparison between Oracle and SQL Server. Oracle comes out leaps and bound ahead in this comparison.
Platform dependancy
SQL Server is only operable on the Windows platform, a major limitation for it to be an enterprise solution. Oracle is available on multiple platforms such as Windows, all flavors of Unix from vendors such as IBM, Sun, Digital, HP, Sequent, etc. and VAX-VMS, as well as MVS. The multi-platform nature of Oracle makes it a true enterprise solution.
Locking and concurrency
SQL Server has no multi-version consistency model, which means that “writers block readers and readers block writers” to ensure data integrity. In contrast, with Oracle, the rule is “readers don’t block writers and writers don’t block readers.” This is possible without compromising data integrity because Oracle will dynamically re-create a read-consistent image for a reader of any requested data that has been changed but not yet committed. In other words, the reader will see the data as it was before the writer began changing it (until the writer commits). SQL Server’s locking scheme is much simpler (less mature) and will result in a lot of delays/waits in a heavy OLTP environment.
Also, SQL Server will escalate row locks to page level locks when too many rows on a page are locked. This locks rows which are uninvolved in any updates for no good reason.
Performance and tuning

  1. In SQL Server, the DBA has no “real” control over sorting and cache memory allocation. The memory allocation is decided only globally in the server properties memory folder, and that applies for ALL memory and not CACHING, SORTING, etc.
  2. All pages (blocks) are always 8k and all extents are always 8 pages (64k). This means you have no way to specify larger extents to ensure contiguous space for large objects.
  3. No range partioning of large tables and indexes. In Oracle, a large 100 GB table can be seamlessly partitioned at the database level into range partitions. For example, an invoice table can be partitioned into monthly partitions. Such partitioned tables and partitioned indexes give performance and maintenance benefits and are transparent to the application.
  4. There is no partitioning in SQL Server.
  5. There are no bitmap indexes in SQL Server.
  6. There are no reverse key indexes in SQL Server.
  7. There are no function-based indexes in SQL Server.
  8. There is no star query optimization in SQL Server.

Object types
Here are some object types missing in SQL Server that exist in Oracle.

  1. You cannot declare public or private synonyms.
  2. There is no such thing as independent sequence objects.
  3. There are no packages; i.e., collections of procedures and functions.
  4. No “before” event triggers (only “after” event triggers) and no row triggers (only statement).
  5. No object types like in PL/SQL.

PL/SQL versus T-SQL

  1. In T-SQL there are significant extensions to the ANSI SQL-92 standard which means converting applications to a different database later will be a code challenge re-write. The INNER JOIN, LEFT OUTER, RIGHT OUTER JOIN syntax differs from the classic JOIN.
  2. No Java database engine as in Oracle.
  3. Stored procedures in SQL Server are not compiled until executed (which means overhead, late binding and finding errors at execution time only!).
  4. No ability to read/write from external files from a stored procedure.
  5. PL/SQL has many DBMS system packages, where T-SQL relies only on a limited number of extended and system stored procedures in the master database.
  6. PL/SQL is better in error exception handling, and there is no such thing as exceptions in T-SQL (T-SQL uses @@error — not elegant!).
  7. T-SQL does not have the MINUS operator, that makes finding schema differences more difficult in SQL Server.
  8. In SQL Server there is no “dead connection detection”. Clients who lose their connection may still hold locks until a DBA is notified to kill their server side processes.
  9. In SQL Server there is no such thing as SQL*NET aliases/service names! This means applications have to hard code the actual server name into their apps, making it difficult to move databases later to load balance across servers.

Clustering technology
In clustering technology, Oracle is light years ahead, since SQL Server has nothing like Oracle Parallel Server/RAC — two instances acting on the same data in active-active configurations. And with the new version of Parallel Server in Oracle 9i, renamed as the Oracle Real Application Clusters, there is diskless contention handling of read-read, read-write, write-read, and write-write contention between the instances. This diskless contention handling is called Cache Fusion, and it means for the first time, any application can be placed in a cluster without any changes, and it scales upwards by just adding another machine to the cluster. Microsoft has nothing like this.
Reliability

  1. In SQL Server Standard Edition there is no ability to mirror the transaction log files. In Enterprise Edition there is a log shipping process that is not so reliable.
  2. If the logs fill up the disk, the database will crash hard.
  3. Sometimes this requires the server itself to be rebooted.

Summary
SQL Server is clearly positioned between Microsoft Access and Oracle in terms of functionality, performance and scalability. It is a good workgroup-level solution, a very quick time to market solution, and is very simple to use and administer. Oracle is much more advanced and has more to offer for larger applications with both OLTP and data warehouse applications. Its new clustering features are ideal for Application Service Providers (ASPs) on the Internet, who can now start with a cluster of two small servers and grow by just adding a server when they need to.
 

Category: Database

Tags:

2 comments

  1. Most of these feature are already covered by SQL Server 2008/R2. You wrote your article based on a 10+ years solution (SQL2000).

    1. The original article was written on SearchOracle. Though I would be biased towards Oracle, since my primary role as a DBA is administering Oracle. I love SQL Server though. Nothing beats SQL Server when it comes ease to administer. I have copied large tables across databases in matter of minutes. When the same job in Oracle would take a few hours.

      Having said that. Technologies like Oracle RAC still keeps Oracle as the no.1 RDBMS in the world. There is so many things Oracle is better at. I know SQL server has similar offerings but they are not as efficient as Oracle. I think Windows is primarily to be blamed for SQL Server’s shortcomings, specially things like memory management. I am running an entire network of ATM’s and point-of-sales application on a Sun v240 server running ORacle 10g with only 8gb of RAM. This includes backup jobs, application batch jobs and other complex scripts. The entire thing alhamdulillah works like a charm. In contrast we have a similar configuration server server for another of our applications and we have a tough time managing it. But hey, maybe its my skills as an SQL DBA to be blamed :)) Nevertheless I love databases. I love Oracle and SQL Server both. DB2 is a completely different issue though.. HAhaha

Leave a Reply

Article by: Shadab Mohammad