Sie sind auf Seite 1von 24

Module 3: Instance Architecture Part 1

Overview
PART 1:

Configure a Database Server


Memory Architecture Overview Memory Areas and Their Functions Process 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 Process
PGA

Background Process

PGA

Server Process

PGA

SYSTEM GLOBAL AREA


JAVA POOL
BUFFER CACHE REDO BUFFER

SHARED POOL

STREAMS POOL

LARGE POOL

Server Process

PGA

Server Process

PGA

Components of Oracle in Memory Application components RDBMS components

Automatic Memory Management Manage both SGA and PGA Automatically sizes memory

SQL Servers Memory Pool and Oracles 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 Hosting Subsystems Exception Handling

Non-Preemptive Scheduling
Scheduling Nodes Schedulers Tasks Worker Threads System Threads 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 DMVs

Demonstration:

Monitoring Memory Usage via DMVs

Process and Thread-Based Architecture


Process - 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

Process- 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 Processes/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 ClientDatabase Interaction


User Process 1 8 Dispatcher 2 7

SGA
3 4

Client

Request Queue Database Buffer Cache

Client

User Process

Shared Server

5 6 Response Queue

Client

User Process USERS

Dedicated Server
INSTANCE

DATABASE

Data Files

Oracles 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 ClientDatabase Interaction


Memory Pools

Client

User Process

Open Data Services

Worker Thread

Database Buffer Cache

User Process
Client

Worker Thread

Client

User Process

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 Processes


User Process

INSTANCE

SGA
Request Queue

Process Monitor

Client
Dispatcher

Database Buffer Cache


Redo Log Buffer

System Monitor Job Queue Queue Monitor

User Process

Client

Shared Server

Response Queue

Event Monitor

User Process

Dedicated Server

Database Writer Checkpoint

Archiver
Log Writer

Recoverer Trace Writer

Client

USERS

Automatic Storage Management

DATABASE
Data Files Archive Log Files Control Files Redo Log Files

SQL Server Background Processes


Memory Pool

Client

User Process

Database Cleanup Worker Thread Log Writer Lazy Writer Worker Thread Database Shrinking

Database Buffer Cache

User Process
Client

Open Data Services

Log Cache

User Process
Client

Log Files Data Files

Users

Relational Engine

ODBC

Storage Engine

Comparing Background Processes


Oracle Process Oracle Identifier SQL Server Equivalent Required

Process Monitor
System Monitor Database Writers

PMON
SMON DBWn

SQLOS
Database Cleanup/Shrinking Lazywriter

Mandatory
Mandatory Mandatory

Checkpoint Process
Recoverer Log Writer Archive Processes Job Queue Processes Job Queue Coordinators

CKPT
RECO LGWR ARCn Jnnn CJQn

Database Checkpoint
MS DTC Log Writer N/A SQL Agent SQL Agent

Mandatory
Optional Mandatory N/A Optional Optional

Queue Monitor Processes


Parallel Query Slave Processes Dispatcher Shared Servers

QMNn
Pnnn Dnnn Snnn

SQL Agent
Worker Threads Networker Thread Worker Threads

Optional
Mandatory Mandatory Mandatory

Demonstration: Background Processes

Demonstration:
Background Processes

Review
Controling resources with Resource Governor

Client interaction with database server


Background processes and threads and what they do

Das könnte Ihnen auch gefallen