• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

What is SQL Server Operating System ( SQLOS)

by admin

SQLOS provides user-level operating system services (hence the name “SQLOS”) to the rest of the server. Components in the SQL Server Engine make use of the services provided by SQLOS to schedule individual or multiple tasks, allocate memory, and so forth.

In the past, scalability was the major issue in SQL Server because it supported only small or medium-sized workloads due to its engine capabilities. With this issue, Microsoft had to make massive changes to SQL server to serve the demands of the large workload

The key observation here is that DBMS and OS schedulers must work together. Either OS must have built-in support for DBMS or DBMS must have a special scheduling layer.

SQLOS

If I summarized the SQLOS:

  • Application Layer between SQL Server components and the OS.
  • Provides more refined control of resource allocation.
  • Centralizes resource allocation to provide more efficient management and accounting.
  • Abstracts the concepts of resource management from components such as the Query Engine & Query Optimizer.

SQLOS currently consists of the following components:

  • Scheduling subsystem
  • Memory management
  • Error/exception handling
  • Deadlock detection
  • Hosting external components

The SQLOS was created to centralize common low-level tasks within the SQL Server process. Having a central location for these tasks means less duplication of code within the various components of the engine, but it also offers the flexibility to adjust SQL Server to new and advanced hardware architectures without impacting the other areas of SQL Server code.

The SQLOS behaves very much like an operating system. It abstracts the concept of memory management, I/O, scheduling, etc. from the other components within the SQL engine. In this way, these components do not need to worry about managing things like NUMA and Resource Governor, they simply make resource allocation calls to the SQLOS via an API.

The SQL engine is still a process like any other process running on a Windows server. It does not have any special privileges or priority over other processes. The SQLOS does not bypass Windows, it simply manages the resources within the SQL Server process space in an efficient way for SQL Server.

SQLOS functions

The two main functions of SQLOS are scheduling and memory management. Other functions of SQLOS include the following.

  • Synchronization – This object type includes spinlocks, mutexes (mutual exclusions), and special reader/writer locks on system resources.
  • Memory brokers – Memory brokers distribute memory allocation between various components within SQL Server but don’t perform any allocations, which are handled by the Memory Manager.
  • SQL Server exception handling – Exception handling involves dealing with user errors as well as system-generated errors.
  • Deadlock detection – The deadlock detection mechanism doesn’t just involve locks but checks for any tasks holding onto resources that are mutually blocking each other. Chapter 13 covers deadlocks involving locks (by far the most common kind).
  • Extended Events – Tracking extended events is similar to the SQL Trace capability but is much more efficient because the tracking runs at a much lower level than SQL Trace. Also, because the Extended Event layer is so low and deep, many more types of events can be tracked.
  • Asynchronous I/O – The difference between asynchronous and synchronous is that part of the system is actually waiting for an unavailable resource. When SQL Server requests a synchronous I/O, the Windows kernel puts the thread on a wait queue until the resource becomes available if the resource isn’t available. For asynchronous I/O, SQL Server requests that Windows initiate an I/O. Windows starts the I/O operation and doesn’t stop the thread from running. SQL Server then places the server session in an I/O wait queue until it gets the signal from Windows that the resource is available.
  • CLR hosting – Hosting Common Language Runtime (CLR) inside the SQLOS allows managed .NET code to be used natively inside SQL Server. In SQL Server 2012, CLR hosting changed to .NET 4.0, which includes changes to memory reporting and garbage collection for AppDomains loaded by SQLOS. Memory allocations for SQLCLR can include any-page allocations inside SQLOS as well as virtual committed allocations from the Windows operating system.

Filed Under: MS SQL, oracle

Some more articles you might also be interested in …

  1. Understanding Oracle Database Quality of Service (QoS) Management
  2. Oracle Database : script to create a “CREATE SYNONYM Script”
  3. PL/SQL: Factorial Program
  4. How to Disable Oracle Net Tracing without stopping server process
  5. How to determine the required archivelog files needed for a guaranteed restore point before running flashback database
  6. Oracle Database 12c New Feature: Transaction Guard and Application Continuity
  7. How to Restore ASM Based OCR After Complete Loss of the CRS Diskgroup on Linux/UNIX
  8. What is the difference between PRIMARY Key and UNIQUE Key
  9. How to Set Timeout for WebLogic Web Service Client (JAX-WS and JAX-RPC)
  10. Troubleshooting Oracle RAC Node Evictions (Reboots) [ 11.2 and above ]

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright