Upload
hathuy
View
220
Download
0
Embed Size (px)
Citation preview
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
Components of Oracle in Memory
Application components
RDBMS components
SYSTEM GLOBAL AREA
JAVA POOL
LARGE
POOL STREAMS
POOL
SHARED
POOL
REDO
BUFFER BUFFER
CACHE
Oracle
Process
Server
Process
Server
Process
Server
Process Background
Process PGA PGA PGA
PGA PGA
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
Large
Pool
Java
Pool
Redo
Buffers Fixed
SGA
Streams
Pool
SQL Server Memory Pool
Buffer Cache
Procedure Cache
Connection
Context Log Cache System
Structures CLR Hosting
Layer
Column Store Cache
SQL Server Architecture (SQLOS)
Components of SQL Server Architecture
• Non-Preemptive Scheduling
• Memory Management
Hosting Subsystems
Memory Management Non-Preemptive
Scheduling
SQLOS
Memory Nodes
Memory Clerks
Caches
Pools
Memory Objects
Scheduling Nodes
Schedulers
Tasks
Worker Threads
System Threads
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
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 Client–Database Interaction
• 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
DATABASE Data Files
USERS
User
Process
User
Process
User
Process
Client
Client
Client
Request
Queue
Database
Buffer
Cache
Response
Queue
Dispatcher
Shared
Server
Dedicated
Server
INSTANCE
SGA 1
5
6
7
2
3
4
8
SQL Server Client–Database Interaction
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
Users
User
Process
User
Process
User
Process
Client
Client
Client Database
Buffer
Cache
Data Files
Relational
Engine ODBC Storage
Engine
Open
Data
Services
Worker
Thread
Worker
Thread
Worker
Thread
Memory
Pools
Oracle Background Processes
USERS
User
Process
User
Process
User
Process
Client
Client
Client
INSTANCE
DATABASE
Automatic Storage Management
Process
Monitor
System
Monitor
Queue
Monitor
Job
Queue
Event
Monitor
Recoverer
Trace
Writer
Dispatcher
Shared
Server
Request
Queue
Response
Queue
SGA
Redo
Log
Buffer
Data Files Archive Log
Files
Control
Files
Redo Log
Files
Database
Buffer
Cache
Dedicated
Server
Database
Writer
Checkpoint
Archiver
Log
Writer
SQL Server Background Processes
Users
User
Process
User
Process
User
Process
Client
Client
Client
Relational
Engine
ODBC Storage
Engine
Data Files
Log
Files
Database
Buffer
Cache
Log
Cache
Database
Cleanup
Worker
Thread
Log
Writer
Lazy
Writer
Worker
Thread
Database
Shrinking
Open
Data
Services
Memory
Pool
Comparing Background Processes
Oracle
Process
Oracle
Identifier
SQL Server
Equivalent
Required
Process Monitor PMON SQLOS Mandatory
System Monitor SMON Database
Cleanup/Shrinking
Mandatory
Database Writers DBWn Lazywriter Mandatory
Checkpoint Process CKPT Database Checkpoint Mandatory
Recoverer RECO MS DTC Optional
Log Writer LGWR Log Writer Mandatory
Archive Processes ARCn N/A N/A
Job Queue Processes Jnnn SQL Agent Optional
Job Queue Coordinators CJQn SQL Agent Optional
Queue Monitor Processes QMNn SQL Agent Optional
Parallel Query Slave
Processes
Pnnn Worker Threads Mandatory
Dispatcher Dnnn Networker Thread Mandatory
Shared Servers Snnn Worker Threads 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