Abstract In a broader view, database is a means of storing information and will also allow retrieving that information from it. In simplest terms, a relational database is an object that presents information in the form of tables with rows and columns which are subset of object. Database is a collection of objects, in our case tables, which holds same type of data and is related to each other according to certain similar characteristics. Data in a table is stored in the form of rows and columns, so we can say that table can be related to another table or object using common keys or concepts, and the ability to retrieve the stored information from a table is the basis for the term relational database. A Database Management System (DBMS) handles the way data is stored, maintained, and retrieved. In the last two decades information processing changed the way the business runs and the way the information is being processed to get profit out of it. As part of the information processing there are two RDBMS technologies which gained the up most priority are Microsoft SQL Server and Oracle. Both are relational in nature and each has their own advantages and disadvantages. Keywords: Database, Relational, Table, Information processing
SQL SERVER VS ORACLE 3
Contents Abstract ......................................................................................................................................................... 2 Microsoft SQL Server Vs Oracle ................................................................................................................ 4 Microsoft SQL Server ................................................................................................................................... 7 Background: .............................................................................................................................................. 7 Overview: .................................................................................................................................................. 8 Description: ............................................................................................................................................. 10 Oracle .......................................................................................................................................................... 12 Background: ............................................................................................................................................ 12 Overview: ................................................................................................................................................ 12 Description: ............................................................................................................................................. 14 Differences between SQL Server and Oracle ............................................................................................. 19 Similarities between SQL Server and Oracle ............................................................................................. 22 Advantages and Disadvantages of SQL Server and Oracle ........................................................................ 24 Academic Honesty Policy ........................................................................................................................... 27 References ................................................................................................................................................... 29
SQL SERVER VS ORACLE 4
Microsoft SQL Server Vs Oracle Since the introduction in 1980s, relational database management systems (RDBMS) have become the default standard database type for a variety of industries/organizations. As their name implies, these database systems are based on a relational model that organizes data into different groups of tables referred to as relations. Two RDBMS technologies which ruled the roof during 80s, 90s and in 21st century are Oracle and Microsoft SQL Server. It is very difficult to compare these two technologies as the architecture of both technologies is different and the way they handle different scenarios are different. Organizations decide which technology to use based on their budgets and the quantity of data to be stored, processed and maintained.
SQL Server is a database product from Microsoft Corporation which is established by Bill Gates, where as the Oracle is product from Oracle Corporation, led by Larry Ellison. During their journey to success there are many RDBMS technologies came to existence like MySQL, Teradata, Sybase etc. but these two have become the market leaders of database technologies for more than two decades. The main advantage for these two technologies to rule the database world is their reach the customer policy which enables customers to buy based on their need not just they have to buy a whole of the RDBMS bundles. In the last two decades the storing of information has become very critical for the organizations to run smoothly and also to take advantage of the data over their competitors.
SQL SERVER VS ORACLE 5
Perhaps, the clearest contrast between the two RDBMS is the language they use to process data. But both frameworks utilize an adaptation of Structured Query Language, or SQL, MS SQL Server uses Transact SQL, or T-SQL, which is an augmentation of SQL initially created by Sybase and utilized by Microsoft, whereas Oracle utilizes PL/SQL, or Procedural Language/SQL. Both are distinctive "flavors" or lingos of SQL and both have their own syntax and structure to support. The principle distinction between the two languages is the way they handle variables, stored procedures and built-in functions. PL/SQL can group all the procedures to the package bundle, which isn't possible in MS SQL Server. In my view as a database administrator and developer, PL/SQL is complex and potentially powerful to use, while T-SQL is significantly more basic and very easy to use.
Another difference between Oracle and MS SQL Server is transaction control. A transaction is defined as a set of tasks that should be treated as a single unit of operation. For instance, a collection of SQL queries altering records that all must be updated at the same time, where a failure to alter any single record among the set should result in none of the records being updated after the completion of the transaction. By default, MS SQL Server will commit each statement separately, and it will be very difficult to rollback the alteration or modification if any slips are experienced along the way. To make all the transactions as single unit we need to include all the statements that starts with BEGIN TRANSACTION" and to finish the processing of all statements we need to issue a COMMIT statement at the end. Inside a transaction, ROLLBACK will discard any modifications made inside the transaction statement. At the point when properly utilized the ROLLBACK takes into consideration some level of security against SQL SERVER VS ORACLE 6
information corruption. After a COMMIT is issued, it is impractical to move back any more distant than the COMMIT charge.
Another significant difference between SQL Server and Oracle is the way how it organizes the database objects. MS SQL Server organizes all objects, such as tables, views, and procedures, functions by database names rather than schema names. Users are assigned to a login based on the roles and based on the permissions assigned to the role users will access the different database objects. In contrast, Oracle groups all the database objects by schema names aka special names as per their requirement, these objects are a subset of database object and all sub set of objects are shared among all users based on their permissions. Even though it is all shared, each user can be limited to certain schemas and tables via roles and permissions.
SQL SERVER VS ORACLE 7
Microsoft SQL Server
Background: Prior to SQL Server 7.0, Microsoft initially developed SQL Server (a database product that understands the SQL language) with support from Sybase Corporation to make it work on the IBM OS/2 platform. When Microsoft and IBM joint collaboration split due to some unforeseen reasons, Microsoft discarded OS/2 while developing a network based operating system known as Windows NT Advanced Server. During this time Microsoft decided to get into an enterprise level database market, so they have decided to develop a database that works on Windows NT itself. Microsoft bought the code base for MS SQL Server from Sybase. Microsoft, Sybase and Ashton-Tate originally worked together to develop the first version of SQL Server named SQL Server 1.0 for OS/2 which was about 1989, it was essentially the same as Sybase SQL Server 3.0 on Unix, VMS, etc.
After Microsoft and Sybase end the partnership, Microsoft developed its own SQL Server version which explicitly runs on windows operating system namely Windows NT. The resulting product was Microsoft SQL Server 4.2 for a while this ran fine. Once after Microsoft and Sybase separated, Sybase developed its own database engine to run on Windows NT which is commonly known as Sybase System 10 and now System 11, and simultaneously Microsoft developed SQL Server 6.0then SQL Server 6.5, which also ran on top of Windows NT. Later Microsoft developed SQL Server 7.0 which runs on Windows NT as well as on Windows 95 and Windows 98. Microsoft developed SQL Server 7.0 and SQL Server 2000 using base code from Sybase and included some modifications and required extensions to the Sybase code base. By the SQL SERVER VS ORACLE 8
year 2005, all the legacy code that was brought from Sybase was completely rewritten for SQL Server 2005 and from SQL Server 2008 Microsoft have developed their own code for all the functionalities.
Overview: SQL Server is a client / server Relational Database Management System (RDBMS) which has been developed by Microsoft and is made up several different client and server programs that make up the entire product. Main components of this relational database management system are: 1. Database Engine 2. Analysis service 3. Integration service 4. Reporting Service 5. Replication 6. Notification Service 7. Full Text Service 8. Service Broker Below figure shows the details like how these components are interconnected. SQL SERVER VS ORACLE 9
Fig: Architecture of SQL Server (Source: http://technet.microsoft.com/en-us/library/ms166352(v=sql.90).aspx)
Important part of the SQL Server is the database engine, which is responsible for data processing like storing, processing and retrieving. Another core service in SQL Server is analysis service, which actually used to rapidly analyse the business data and provides data mining, online analytical processing. Integration service is a kind of ETL (Extraction, Transform, and Loading) which is used to build Business Intelligence Solutions. Integration Services is a very useful means for building organization-level data warehouses and data transformations solutions using the SQL Server database suite. Integration Service is used to solve complex business problems by implementing functions like copying files, sending e-mail messages in response to events that are designed as per the business requirements, updating the existing data warehouse.
Replication is a combination of technologies for distributing data and database related objects from one database to another database, also for synchronizing the databases to make data consistent across databases. Using replication, one can distribute data to different locations and SQL SERVER VS ORACLE 10
to remote databases or servers over different network. Reporting Services (SSRS) is a server-side reporting platform to be used for data reporting by using regular database and multidimensional data sources like OLAP. Notification Services is used for developing applications that generate and send notifications based on the certain events. Full-Text Search is used to search unstructured data for plain, character-based data, in multiple fields in multiple tables at the same time. Service broker service is used for messaging and Queuing. This particular service is very useful for the application developers who want to process data between different databases.
Description: As discussed Database Engine is the heart of the entire SQL Server suite. Till now, Microsoft released a dozen versions of SQL Server, starting from SQL Server 6.0 to SQL Server 2014. Microsoft offers these versions in different categories based on the features that it supports and cost of the bundle and variety of other needs. Enterprise Version: It is specifically designed for very large enterprises with complex data requirements which include data mining and Web-enabled databases. This is the only version which includes all features that are available in that particular release. Standard Version: This version is targeted toward small and mid size organizations. It supports data warehousing and some type of e-commerce applications. Workgroup Version: For small organizations. It does not put any limit on size or user limits and so it can be used as the backend database for small Web servers Express Version: It is free of cost and anybody can use for the developing or learning purpose. But it only supports very little features. It is mostly used by the people who want to get the first feel of the SQL Server. SQL SERVER VS ORACLE 11
Below screenshots shows different services after the install of SQL Server,
Below is the screen shot that shows how to connect to a SQL Instance.
Recent years Microsoft spent much time in developing In-memory databases as a result they have come up with SQL Server 2014, which supports very high amounts of data processing. Different versions of SQL Server are found on the below link: http://sqlserverbuilds.blogspot.com/ Below link gives details related to cloud based database product pricing, http://www.microsoft.com/en-us/server-cloud/products/sql-server/buy.aspx SQL SERVER VS ORACLE 12
Oracle
Background: Larry Ellison co-founded Oracle Corporation in 1977 with his co-workers Bob Miner and Ed Oates under the name Software Development Laboratories (SDL) on the shores of Redwood, California. As per the Oracle 30 th anniversary magazine it was given that Ellison took inspiration from a research paper published by Edgar F. Codd on relational database management systems (RDBMS) named "A Relational Model of Data for Large Shared Data Banks in 1970. He then realized that the concept was not yet developed and felt the demand for the DBMS technologies. They started to develop a system that should be compatible with System R, but failed to do so as IBM did not give them access to DBMS error codes. Later SDL changed its name to Relational Software, Inc (RSI) in 1979; again they changed to Oracle Systems Corporation in 1982 to align to its flagship product Oracle Database. In 1995, Oracle Systems Corporation changed its name to Oracle Corporation and officially named as Oracle. Ellison attributes Oracles success to the fact that most of the systems are implemented using C programming language because of this it is easy to port different systems.
Overview: Oracle Database (referred as Oracle RDBMS or simply as Oracle) is an object-relational database management system produced and marketed by Oracle Corporation. Oracle offers strong consistency check means every transaction is considered as single unit of operation, it follows a rule all-or-nothing, so we can say a transaction successful only when all the tasks SQL SERVER VS ORACLE 13
intended in the transaction are successful, even one task fails it will rollback all the modifications done as part of the transaction.
An Oracle database system is identified by a system identifier or SID - comprises at least one instance of the application, along with required data storage to further process the other database related tasks. An Oracle instance is identified by an instantiation number or activation id that comprises an operating-system processes as well as memory-processes that interact with the data storage. These processes include PMON (process monitor), SMON (system monitor) which are very critical for the Oracle instance startup and also in the case of instance recovery aka data recovery in case of any instance corruption. Along with above processes we have other processes which are place a critical role in the proper working of Oracle instance. SGA is called System Global Area is a shared memory. All users in the databases share the information in this area. This SGA and background processes like PMON and SMON etc, constitutes the Oracle Instance. There is another memory called PGA (Process Global Area) which is called non-shared memory.
Fig: Oracle SGA memory SQL SERVER VS ORACLE 14
Background processes that play a critical role in the running of Oracle Database/Instance or smooth running of applications are listed below. Database Writer (DBWn): Responsible for cleaning dirty buffers from memory. Log Writer (LGWR): Responsible for redo log buffer management Checkpoint (CKPT): Reduces the time required for instance recovery. Archiver (ARCn): Automatically saves the copies of redo logs. Recover (RECO): Used in resolving issues distributed transactions Dispatcher (Dnnn) & Shared Server (Snnn) Birds view of the all the necessary process:
Description: Oracle architecture is divided into physical and logical structures to understand its operation. In logical structure we can see the how the database will be divided into logical units: SQL SERVER VS ORACLE 15
From the above figure we can see that the database is collection of objects like table spaces for system processes and user processes. Each tablespace is divided into segments, which in turn divided into extents, which is a continuous unit of memory structures. Each extent is a collection of blocks, which is the small amount of memory storage. From physical structure we can visualize how each of the background process and other processes like database files interact to make the Oracle work. Below figure show the physical structure of the Oracle Instance:
SQL SERVER VS ORACLE 16
Oracle follows an OMF file structure. OMF means Oracle Managed File system. It is a standard that Oracle by default follows in order to run smooth. OMF is used to simplify functions of oracle creation, clean up etc. Advantages of OMF are, To automate the cleanup of the file system when database objects are dropped. Standardized naming of database files to reduce the confusion in maintenance To increase the portability since file specifications are not needed. Reduce the wasting disk space. Data files, control file and redo log files follow the OMF architecture, so when somebody creates an oracle database, these files will automatically go to default locations and follow the standard naming format. In this control file is heart of the entire Oracle instance, it contains Database name Database creation time stamp Database files locations, name Redo log locations Tablespace name Current log sequence number RMAN backup information SQL SERVER VS ORACLE 17
During start up background processes reads the control file for the information required to start the Oracle Instance. If any discrepancies between the data in control file and actual physical file makes Oracle instance to crash. Then in that case we need to use control file recovery first to recover the Oracle instance. There are many versions of Oracle software released by Oracle Corporation, below are the details, Oracle v2 : 2.3 Oracle v3 : 3.1.3 Oracle v4 : 4.1.4.0-4.1.4.4 Oracle v5 : 5.0.22, 5.1.17, 5.1.22 Oracle v6 : 6.0.17-6.0.36 (no OPS code), 6.0.37 (with OPS) Oracle7: 7.0.127.3.4 Oracle8 Database: 8.0.38.0.6 Oracle8i Database Release 1: 8.1.5.08.1.5.1 Oracle8i Database Release 2: 8.1.6.08.1.6.3 Oracle8i Database Release 3: 8.1.7.08.1.7.4 Oracle9i Database Release 1: 9.0.1.09.0.1.5 Oracle9i Database Release 2: 9.2.0.19.2.0.8 Oracle Database 10g Release 1: 10.1.0.210.1.0.5 Oracle Database 10g Release 2: 10.2.0.110.2.0.5 Oracle Database 11g Release 1: 11.1.0.611.1.0.7 Oracle Database 11g Release 2: 11.2.0.111.2.0.4 Oracle Database 12c Release 1: 12.1 SQL SERVER VS ORACLE 18
Oracle Database 12c Release 1: 12.1.0.2 Among the above versions 10g is the very successful and industry accepted mode. Apart from this Oracles RAC (Real Application Cluster ) is the leader in high availability technique that are implemented by any other competitor.
SQL SERVER VS ORACLE 19
Differences between SQL Server and Oracle Even though both SQL Server and Oracle are relational database system, they have their own unique feature which differentiates them in some way. Microsoft SQL Server Oracle Operating Systems Windows AIX,Linux,HP- UX,Solaris,Windows Implementation language C++ C & C++ Supported Programming language .Net Java PHP Python Ruby Visual Basic C C# C++ Clojure Cobol Eiffel Erlang Fortran Groovy Haskell Java JavaScript Lisp Objective C OCaml Perl PHP Python R Ruby Scala Tcl Visual Basic Programming language T-SQL PL/SQL Partitioning Methods Files
SQL SERVER VS ORACLE 20
Conceptual differences between SQL Server and Oracle
SQL Server Database owner, DBO Group/Role Non-unique index T-SQL stored procedure Trigger
Oracle Schema Role Index PL/SQL procedure PL/SQL function BEFORE trigger After trigger Sequence
Difference is data types, SQL Server Oracle INTEGER NUMBER(10) SMALLINT NUMBER(6) TINYINT NUMBER(3) REAL FLOAT FLOAT FLOAT BIT NUMBER(1) VARCHAR(n) VARCHAR2(n) TEXT CLOB IMAGE BLOB BINARY(n) RAW(n) or BLOB
SQL Server supports high availability like log shipping, mirroring, replication, clusters. Oracle supports Data guard and RAC (Real Application Cluster). Licensing:
SQL SERVER VS ORACLE 21
Oracle: Publically available download from otn.oracle.com No such thing as evaluation editions in oracle licensed via the honor system service packs but we requires license Patches but we requires license SQL Server: 120 or 180 day evaluation versions are available from www.microsoft.com/sqlserver CD-KEY is mandatory After evaluation period, DB engine stops working Even Service packs available for free from Microsoft.com We can download hot fixes for free from Microsoft.com
SQL SERVER VS ORACLE 22
Similarities between SQL Server and Oracle Name Microsoft SQL Server Oracle Describe Microsofts relational DBMS Widely used RDBMS License Type commercial commercial DBaaS Not supporting Not supporting Database Type Relational DBMS Relational DBMS Secondary indexes yes yes SQL yes yes Access methods OLE DB Tabular Data Stream (TDS) ADO.NET JDBC ODBC ODP.NET Oracle Call Interface (OCI) JDBC ODBC Programming languages .Net Java PHP Python Ruby Visual Basic Java PHP Python Ruby Visual Basic SQL SERVER VS ORACLE 23
Triggers yes yes Partitioning tables can be distributed across several files (horizontal partitioning) horizontal partitioning Replication yes, but depending on the SQL-Server Edition Master-master replication Master-slave replication Map Reduce algorithm no no Foreign keys yes yes Transaction concepts ACID ACID Concurrency yes yes Durability yes yes User concepts Users with fine-grained authorization concept Users with fine- grained authorization concept
SQL SERVER VS ORACLE 24
Advantages and Disadvantages of SQL Server and Oracle SQL Server Advantages: Among the different RDBMS available in the market, Microsoft SQL Server is a stable, reliable, fast, extremely popular and affordable database engine. Microsoft SQL Server presents an advantage of best value propositions on the market with a low cost and highly favourable price and the performance. As SQL Server is tightly integrated with Windows server, the security is highly appreciated. This tight integration of security allows a quick installation of database engine. Since 2002, Microsofts SQL Server has recorded very less vulnerabilities. It is the most secure of any of the major database platforms. Till 2010, SQL Server has reported only a few vulnerabilities just 49 from 2002 through June 2010 of any database. SQL Server Management Studio utility is used to perform most of the activities related to manage, backup, restore and Maintenance plans and backups can easily be configured using this utility, theres no need for custom scripts.
Disadvantages: One of the major disadvantages of Microsoft SQL Server is that the licensing are costly. In SQL Server 2008, SQL Server Standard Edition costs $7,171 per processor where as SQL Server Datacenter edition is $54,990 per processor. SQL SERVER VS ORACLE 25
Limited Compatibility issues because Microsoft SQL Server is only designed to run on Windows-based servers whereas most of the developers try to run their applications on UNIX. Because of this reason most of the application developers will not opt for SQL Server. Advantages of Oracle: Customer Support Available: Oracle customer support is more flexible and to get a solution for a problem we can get it at a free of cost means purchasing license will entitle us to avail this support. Runs on heterogeneous platforms: Oracles biggest advantage is it heterogeneous platform compatibility. Scalable: It is very easy to extend the Oracle systems capacity to meet the ad-hoc demands to long term demands. Stable: Oracles versions are mostly stable and are widely accepted by the industry. Fastest for large datasets: Oracle support large datasets as compared to its competitors like Microsoft SQL Server and other RDBMS that available.
Disadvantages: Can be Very expensive: One of the biggest disadvantages of Oracle software is its pricing. As compared to SQL Server license cost it is more than 5-8 times costlier. Requires trained administrator: To work on Oracle organizations need a trained administrator and it is not possible by developers. Training a resource in SQL SERVER VS ORACLE 26
administration of the Oracle is costlier and to retain the administrator organizations have to spend more money.
SQL SERVER VS ORACLE 27
Academic Honesty Policy As a student of University of Houston Clear Lake I must abide by the Academic Honesty Policy. It is the cornerstone of the academic integrity of the university. It is a set of policies which details how a student at UHCL must behave and follow in all the activities and tasks that are carried out at the institution. These policies are designed for each and every student as well as faculty to make the university better place to learn and share knowledge. Academics Honesty Policies clearly defines responsibilities that are supposed to be carried by each student and also faculty member of the institution to maintain the good academic environment. Student responsibilities are to behave and maintain complete honesty in all the tasks that are assigned to grade students knowledge. Also report any such incidents to faculty members or an academic dean. Faculty members main responsibility is to make sure that the student is actually following the academic honesty policy and help student to understand the honesty policy. As a student I must complete all my assignments and tasks on my own by following below principles: 1. I am not supposed to acquire information that is completed by other student or by any other resource. 2. I am not authorized to provide any kind of information to any student unless otherwise the instructor asked to do so. Also revealing the contents of an examination prior to the examination time is not permitted. 3. I am not encouraged to follow any kind of plagiarism like copying others work; copying others ideas/ copy righted information without acknowledging the source of the work. SQL SERVER VS ORACLE 28
4. I am not supposed to commit any kind of conspiracy which deals with the academic honesty. 5. I am not supposed to fabricate any kind of information like modifying false information to make it right, changing answers, representing for others during examination etc. 6. I am not supposed to manipulate or modify or try to get a credit for others work which are forms of information abuse. 7. Failure to report any incident to the instructor also a violation of the honesty policy. I completely understand that all of the above rules/policies must be followed by me to complete any kind of assignment or task given by the instructor without fail and I also completely aware that any kind of academic policy violation will lead to severe punishments like Disciplinary Suspension or Disciplinary Expulsion.
I will be honest in all my academic activities and will not tolerate dishonesty.