Module 3: Instance Architecture Part 1
Overview PART 1: Configure a Database Server Memory Architecture Overview Memory Areas and Their Functions and Thread Architecture
Configuration of a Server Using Configuration Parameters to Allocate and Manage Resources Oracle Configuration Use of initialization parameters (init.ora or spfile) ALTER SYSTEM, ALTER DATABASE SQL Server Configuration Setting server properties using SQL Server Management Studio (SSMS) The role of sp_configure system stored procedure Startup parameters in SQL Server Configuration Manager
Demonstration: Configuration Parameters Demonstration: Configuration Parameters
Memory Architecture Overview Virtual Memory Relevance to DBMS Sharing Data in Memory Using Memory Intelligently to Reduce I/O and Enhance Performance
Memory Address Space Oracle Oracle Background Server PGA PGA PGA SYSTEM GLOBAL AREA JAVA POOL BUFFER CACHE REDO BUFFER SHARED POOL STREAMS POOL LARGE POOL Server PGA Server PGA Components of Oracle in Memory Application components RDBMS components Automatic Memory Management Manage both SGA and PGA Automatically sizes memory
SQL Server s Memory Pool and Oracle s SGA Oracle System Global Area (SGA) Buffer Cache Shared Pool Redo Buffers Fixed SGA Large Pool Streams Pool Java Pool SQL Server Memory Pool Column Store Cache Buffer Cache Procedure Cache Log Cache System Structures Connection Context CLR Hosting Layer
SQL Server Architecture (SQLOS) Components of SQL Server Architecture Non-Preemptive Scheduling Memory Management SQLOS Memory Management Memory Nodes Memory Clerks Caches Pools Memory Objects Non-Preemptive Scheduling Scheduling Nodes Schedulers Tasks Worker Threads System Threads Hosting Subsystems Exception Handling Resource Monitoring
Memory Address Space Comparison (Cont.) Memory Allocation in SQL Server Dynamic at Higher level (memory pool, etc.) Lower level (buffer cache, procedure cache, etc.) Few configurable parameters Memory Address Range 32-bit (x86) - legacy /IncreaseUserVA 64-bit (x64)
Demonstration: Monitoring Memory Usage via DMV s Demonstration: Monitoring Memory Usage via DMV s
and Thread-Based Architecture - memory space to protect applications Threads Execute code Allocated time on CPU Managed by Operating System Fibers are light-weight threads reduce context switching overhead Oracle uses processes in Unix and threads in Windows Both Oracle and SQL Server use threads and optionally fibers. Allocate thread assignment with CPU affinity
Review How to configure a database server Memory Address Space of a database server Memory areas inside Oracle SGA and their SQL Server equivalents - and thread-based architecture relevant to RDBMS
Module 3: Instance Architecture Part 2
Overview PART 2: Controlling Resources in SQL Server 2012 Client and RDBMS Interactions Background es/threads and Their Functions
Controlling Resources in SQL Server 2012 Resource Governor is an Enterprise Edition feature CPU and memory limits per workload Resource Governor allows for: Workload prioritization Predictable performance Preventing runaway query Accounting of resource usage
Resource Governor = Greater Control Resource Governor Performance Availability Key Components Resource Pools Workload Groups Classification
Demonstration: Using the Resource Governor Demonstration: Using the Resource Governor
Oracle Client Database Interaction Client Client User User 1 8 Dispatcher Shared Server 2 7 SGA 3 6 4 Request Queue 5 Response Queue Database Buffer Cache Client User Dedicated Server USERS INSTANCE DATABASE Data Files Oracle s two modes of interaction are: Dedicated Server uses a dedicated server process per client session Shared Server uses dispatchers and shared server processes
SQL Server Client Database Interaction Client User Open Data Services Worker Thread Database Buffer Cache Memory Pools Client User Worker Thread Client User Worker Thread Data Files Users Relational Engine ODBC Storage Engine SQL Server uses the shared server mode Functionality of the dispatcher is facilitated by the networker thread Functionality of the shared server processes by the worker threads
Oracle Background es Client Client User User INSTANCE Dispatcher Shared Server SGA Request Queue Response Queue Database Buffer Cache Redo Log Buffer Monitor System Monitor Job Queue Queue Monitor Event Monitor Client USERS User Dedicated Server Database Writer Checkpoint Archiver Log Writer Recoverer Trace Writer Automatic Storage Management DATABASE Data Files Archive Log Files Control Files Redo Log Files
SQL Server Background es Client Client User User Open Data Services Database Cleanup Worker Thread Log Writer Lazy Writer Memory Pool Database Buffer Cache Log Cache Client User Worker Thread Database Shrinking Log Files Data Files Users Relational Engine ODBC Storage Engine
Comparing Background es Oracle Oracle Identifier SQL Server Equivalent Required Monitor PMON SQLOS Mandatory System Monitor SMON Database Cleanup/Shrinking Mandatory Database Writers DBWn Lazywriter Mandatory Checkpoint CKPT Database Checkpoint Mandatory Recoverer RECO MS DTC Optional Log Writer LGWR Log Writer Mandatory Archive es ARCn N/A N/A Job Queue es Jnnn SQL Agent Optional Job Queue Coordinators CJQn SQL Agent Optional Queue Monitor es QMNn SQL Agent Optional Parallel Query Slave es Pnnn Worker Threads Mandatory Dispatcher Dnnn Networker Thread Mandatory Shared Servers Snnn Worker Threads Mandatory
Demonstration: Background es Demonstration: Background es
Review Controling resources with Resource Governor Client interaction with database server Background processes and threads and what they do