MS SQL Server vs Oracle

Thilina Harsha
JRC Tech Drive
Published in
4 min readOct 22, 2019

--

The most important thing about today’s businesses is its customers, sales, stock, etc. data. There is no secret that businesses cannot function without data nowadays. There are many different database management systems available out there. Some DBMS examples include Microsoft Access, MySQL, PostgreSQL, Mongo DB, Oracle, and MSSQL. MS SQL Server and Oracle are two of the most and widely used databases. There are many similarities and differences between these two database management systems. This article mainly focuses on comparing the key features and functions of MS SQL and Oracle databases.

Used Language in MS SQL and Oracle

Both MS SQL and Oracle use a version of Structured Query Language (SQL). Transact SQL or T-SQL use in MS SQL. This is an extension of originally developed SQL by Sybase. Oracle uses Procedural Language/SQL (PL/SQL). Both are different variations of SQL and these two have different capabilities and syntax. How these languages handle variables, functions and stored procedures are the main differences between these languages. MS SQL provides options to group procedures into packages, but PL/SQL in Oracle provides this option.

Handling Transaction Control

Another major difference between MS SQL and Oracle is the Transaction Control. MS SQL will by default execute and commit each task or command individually. Hence, it will be not easy or impossible to roll back transactions if any error occurred in the process. “Begin Transaction” command is used at the beginning of a transaction for properly group statements. Meanwhile, the “Commit” statement is used at the end of the group statement. The changed data writes to the disk and ends the transaction in Commit statement. In the transaction, any changes made within the transaction block will be discarded in the Rollback. But, with proper error handling, the rollback command can allow some protection against data corruption.

In Oracle, each new database connection is treated as a new transaction. Until the transaction committed, the transaction can be rolled back, and all the changes are made on the system memory. Because of that, in the rollback, all the changes in the statement can be undone. After the commit is done, essentially the next command initiates a new transaction. This helps to control errors easily and provide flexibility.

Organization of Database Objects

MS SQL organizes all the objects like tables, procedures, and views by database names. And, MS SQL databases have unshared and private disk files on a computer. Users are assigned to login and grant access to the selected database and its objects. But in Oracle, the database objects are grouped by using schemas. Schemas are a subset collection of database objects. All the database objects can be shared with all users and schemas. Schemas and tables access can be limited via roles and permissions.

Platform Support

MS SQL Server and Oracle have different opinions on platform support. Microsoft ensures MS SQL server only runs on Windows platforms until the latest versions. In 2016, Microsoft has announced that MS SQL server runs on Linux platforms. Further, they released MS SQL Server 2017 version for Linux platforms or Docker containers. But, Oracle has a huge platform support advantage when it compares to MS SQL Server. Because Oracle supports more than 50 platforms, it specifically separates the operating system created to run the Oracle system as efficient and reliable as much as possible, including Oracle Linux. Additionally, Oracle runs on Microsoft Windows as well.

Concurrency

Concurrency is one of the main advantages compared to a spreadsheet in the database. The servers sort out the changes to maintain integrity when users are reading and wring data to a database. MS SQL Server and Oracle handle these concurrent processes in many different ways. Oracle allows reading during the writer process, while the SQL Server holds new reads until the writer completes it. Oracle writers do not block the readers and readers do not block the writers. That’s the reason that Oracle runs much quicker than the SQL Server.

Triggers

Microsoft SQL Server and Oracle have implemented triggers in different ways. Oracle has implemented before and after triggers. But in MS SQL Server, it only allows after triggers. Before triggers helps to check availability, but in SQL server it takes unnecessary work to check availability. Therefore, it greatly reduces the usefulness of triggers in MS SQL Server.

The standard edition of both database prices is more or less similar for keeping up with the competition. But, there is a big difference between the enterprise editions. The Oracle Enterprise Edition is the highest licensing priced database for its massive scalability and efficiency. However, some versions of Oracle are free for development purposes and in certain cases, Oracle embraces the open-source community. Further, Oracle Express Edition can be used for low demand database applications. Microsoft also provides a free SQL Server Express version to gain a competitive advantage in the market.

Other differences between the two databases are as follows;

In a nutshell, MS SQL Server is ideal for database beginners and small or medium scale data management companies, while Oracle is suitable for those managing larger amounts of data. But, if half of the big companies use Oracle systems, then the rest of the companies use MS SQL. On a high-level note, there is not much difference between these two database systems. But there is a difference between the underlying architecture and the syntax.

--

--