Microsoft SQL Server Administration



Similar documents
2. When logging is used, which severity level indicates that a device is unusable?

Administration of SQL Server

TaskCentre v4.5 MS SQL Server Trigger Tool White Paper

Mobile Device Manager Admin Guide. Reports and Alerts

Junos Pulse Instructions for Windows and Mac OS X

Implementing ifolder Server in the DMZ with ifolder Data inside the Firewall

Deployment Overview (Installation):

Licensing Windows Server 2012 for use with virtualization technologies

CXA-300-1I: Advanced Administration for Citrix XenApp 5.0 for Windows Server 2008

Caching Software Performance Test: Microsoft SQL Server Acceleration with FlashSoft Software 3.8 for Windows Server

Microsoft Certified Database Administrator (MCDBA)

Improved Data Center Power Consumption and Streamlining Management in Windows Server 2008 R2 with SP1

State of Wisconsin DET Agency Managed Virtual Services Service Offering Definition

Readme File. Purpose. Introduction to Data Integration Management. Oracle s Hyperion Data Integration Management Release 9.2.

SaaS Listing CA Cloud Service Management

Citrix XenApp 6.5 Basic Administration

State of Wisconsin. File Server Service Service Offering Definition

Welcome to Microsoft Access Basics Tutorial

BackupAssist SQL Add-on

Product Documentation. New Features Guide. Version 9.7.5/XE6

ROSS RepliWeb Operations Suite for SharePoint. SSL User Guide

Serv-U Distributed Architecture Guide

Microsoft SQL Server Configuration Guide for HP IO Accelerators

Identify Major Server Hardware Components

MaaS360 Cloud Extender

Using Sentry-go Enterprise/ASPX for Sentry-go Quick & Plus! monitors

SYSTEM MONITORING PLUG-IN FOR MICROSOFT SQL SERVER

Archiving IVTVision Video (Linux)

Optimal Payments Extension. Supporting Documentation for the Extension Package v1.1

Configuring and Integrating LDAP

Networking Best Practices

A COMPLETE GUIDE TO ORACLE BI DISCOVERER END USER LAYER (EUL)

CXA Citrix XenApp 6.5 Basic Administration

Licensing Windows Server 2012 R2 for use with virtualization technologies

Helpdesk Support Tickets & Knowledgebase

IMT Standards. Standard number A GoA IMT Standards. Effective Date: Scheduled Review: Last Reviewed: Type: Technical

Ten Steps for an Easy Install of the eg Enterprise Suite

Implementing CiscoWorks LMS

4394 Gazzetta tal-gvern ta Malta MINISTRY OF FINANCE. Value Added Tax Department. Fiscal Cash Register Specifications

ACTIVITY MONITOR Real Time Monitor Employee Activity Monitor

Configuring, Managing and Maintaining Windows Server 2008 Servers MOC-6419

1 GETTING STARTED. 5/7/2008 Chapter 1

Alexsys Team 2 Service Desk

Pexip Infinity and Cisco UCM Deployment Guide

CXA-204-1I Basic Administration for Citrix XenApp 6

TaskCentre v4.5 Send Message (SMTP) Tool White Paper

SBClient and Microsoft Windows Terminal Server (Including Citrix Server)

Restricted Document. Pulsant Technical Specification

E2E Express 3.0. Requirements

White Paper for Mobile Workforce Management and Monitoring Copyright 2014 by Patrol-IT Inc.

AvePoint High Speed Migration Supplementary Tools

Plus500CY Ltd. Statement on Privacy and Cookie Policy

GUIDANCE FOR BUSINESS ASSOCIATES

NASDAQ BookViewer 2.0 User Guide

Completing the CMDB Circle: Asset Management with Barcode Scanning

Introduction LIVE MAPS UNITY PORTAL / INSTALLATION GUIDE Savision B.V. savision.com All rights reserved.

Configuring BMC AREA LDAP Using AD domain credentials for the BMC Windows User Tool

AccessData Corporation AD Lab System Specification Guide v1.1

Configuring, Monitoring and Deploying a Private Cloud with System Center 2012 Boot Camp

Nex-Gen Web Load Balancer

CNS-205: Citrix NetScaler 11 Essentials and Networking

State of Wisconsin Division of Enterprise Technology (DET) Distributed Database Hosting Service Offering Definition (SOD)

efusion Table of Contents

April 3, Release Notes

Datasheet. PV4E Management Software Features

ASUS PC Diagnostics Guide

VMware View Windows XP Optimization

System Business Continuity Classification

HIPAA HITECH ACT Compliance, Review and Training Services

DTU Data Transfer Utilities Software User manual

STIOffice Integration Installation, FAQ and Troubleshooting

Serv-U Distributed Architecture Guide

Office 365, Microsoft Dynamics CRM Online, Windows Intune, and EMS Digital Partner of Record FAQ June 2015

Case Study. Sonata develops. comprehensive BI Application for a leading provider of Animal Nutrition Solutions. Ananthakrishnan

Manual. Adapter OBD v2. Software version: NEVO DiegoG Full compatibility with OBD Adapter v2 2.0B

SITE APPLICATIONS USER GUIDE:

ScaleIO Security Configuration Guide

Uninstalling and Reinstalling on a Server Computer. Medical Director / PracSoft

Cloud Services Frequently Asked Questions FAQ

HP Connected Backup Online Help. Version October 2012

Level 3 SM Ready-Access User Guide

Implementing SQL Manage Quick Guide

First Global Data Corp.

Configuring and Monitoring Network Elements

Transcription:

Micrsft SQL Server Administratin Disk & memry David Hksza http://siret.cz/hksza

Lecture Outline Query lifecycle Data strage SQL Server Memry

SELECT Query Lifecycle 1. SNI client-server cnnectin using TCP/IP (r ther prtcl) 2. SELECT statement using TDS (Tabular Data Streams) messages between TDS endpints 3. Unwrapping TDS message 4. Sending SQL Cmmand t Cmmand Parser 5. Checking Plan Cache in the Buffer Pl 6. If the plan is nt cached, passing a query tree t the Optimizer 7. Query plan passed t Query Executr 8. Passing Query Plan t Access Methds (AM) 9. Checking the existence f the required page in the Data Cache by the Buffer Manager 10. Passing the requested page(s) back t the AM 11. Passing the results set t the Relatinal Engine SQLOS credit: SQL Server 2008 Internals and Trubleshting

UDPATE Query Lifecycle 1. Identificatin f the page t update as in the SELECT lifecycle 2. The Access Methds require Write-Ahead Lgging frm the Lg Manager (part f the Transactin Manager) 3. Page changes stred in the Transactin Lg 4. The AM receive cnfirmatin and pass the request n t the Buffer Manager 5. Mdificatin f the page in cache 6. Cnfirmatin sent t the AM and the client SQLOS credit: SQL Server 2008 Internals and Trubleshting

Buffer Manager (1) Manages disk I/O functins fr bringing data and index pages int the data cache Buffer 8KB memry page all memry nt used by ther cmpnents stred in the buffer pl Free buffer list lw free buffer list lazywriter prcess Dirty pages pages mdified in cache but nt immediately written t disk durability maintained by the transactin lg flushing dirty pages wrker thread when the free buffer list is lw checkpint DBCC DROPCLEANBUFFERS flush clean pages frm cache suitable fr testing purpses sys.dm_s_buffer_descriptrs is_mdified

Buffer Manager (2) Lazywriter prcess prcess which peridically checks the size f the free buffer list ages-ut lng enugh nt used pages releases memry t OS Checkpint prcess dirty pages f cmmitted transactins are written t disk des nt remve pages frm cache ccurs autmatically r using CHECKPOINT cmmand trace flag 3502 prvides lgging - DBCC TRACEON(3502, -1) DBCC TRACEOFF(3502, -1) checkpint; EXEC xp_readerrrlg BM state can be checked using the sys.dm_s_perfrmance_cunters view

Pages 8KB header rws rw ffsets Allcatin units IN_ROW_DATA (hbt - Heap Or B-Tree) majrity f data LOB_DATA (LOB) TEXT, NTEXT, IMAGE, stred ut-rw sp_tableptin text in rw ROW_OVERFLOW_DATA (SLOB - Small-LOB) VARCHAR, VARBINARY,.NET, stred in-rw unless the rw exceeds 8KB sys.allcatin_units

Extent 8 pages 64KB Types unifrm mixed First page f a new table mixed extent New index large unifrm extents small mixed extents

Space Management (1) Glbal Allcatin Map (GAM) 1 = free extent, 0 = allcated extent cvers 64,000 extents Extent status GAM bit setting SGAM bit setting Shared Glbal Allcatin Map (SGAM) cvers 64,000 extents 1 = extent is being used as a mixed extent and has a free page, 0 = extent is nt used as a mixed extent, r it is a mixed extent and all its pages are being used Free 1 Unifrm extent (allcated) Mixed extent with free pages Full mixed extent 0 0 0 1 0 0 Page Free Space (PFS) allcatin status f each page 1B

Space Management (2) Index Allcatin Map (IAM) tracking extents in 4GB used by an allcatin unit can be linked IAM chain maps space allcatin fr heaps and b-trees LOB data rw-verflw data IAM page 96-byte page header cntaining inf abut what part f space the IAM maps IAM page header (8 page-pinter slts) bitmap fr extents belnging t the allcatin unit sys.system_internals_allcatin_units Inserting a new rw IAM extents fr the allcatin unit PFS free pages in identified extents

Database File Structure

Memry 32 bit system 4GB address space 2GB user mde 2GB kernel mde 4GB tuning allws t use 3GB user mde address space Windws Server 2003 /3GB in bt.ini Windws Server 2008 BCDEdit /set increaseuserva 3072 applicatin needs t be linked with /LARGEADDRESSAWARE nnpaged pl, paged pl and system PTEs (Page Table Entry) need t be mnitred Physical Address Extensin (PAE) intrduced by Intel address bus = 36 bits 64GB Windws Enterprise Windws Server 2003 /PAE in bt.ini Windws Server 2008 bcdedit /set [{ID}] pae FrceEnable applicatins must be written t be able t use AWE (Address Windwing Extensins) which allws a prcess t access memry utside f its VAS (by mapping this memry int VAS) PAE must be enabled in SQL Server by sp_cnfigure r SSMS SQL Server service needs t have Lck Pages in Memry privilege explitable by data cache nly

Memry infrmatin and rerestrictin Memry size restrictin min server memry max server memry sp_cnfigure 'max server memry', 4096; sys.dm_s_sys_inf infrmatin abut the cmputer n which SQL Server is installed including the resurces available t and cnsumed cmmitted_kb cmmitted physical memry in the memry manager cmmit_target_kb memry needed by the memry manager

Memry Architecture Memry ndes Memry divisin At least ne nde depending n using the NUMA (Nn-Unifrm Memry Access) architecture SELECT DISTINCT memry_nde_id FROM sys.dm_s_memry_clerks Memry allcatrs Memry allcatin n the memry ndes g thrugh memry allcatr rutines tied t the memry ndes Page allcatrs, Virutal memry allcatr, Shared memry allcatr Memry clerks each cnsumer allcates memry thrugh a memry clerk Can be used t track memry usage by cmpnents sys.dm_s_memry_clerks Memry brker centralized mechanism t distribute memry r cntrl the allcatins made by each cmpnent in SQL Server mnitrs the demand cnsumptin f memry by each cmpnent

Memry clerks Clerk types (cmmn caching mechanism implemented by SQLOS) bject stre simple stre, hmgeneus data (SNI pling netwrk buffers) cache stre SQLOS management f life time and visibility cntrl (plan cache) user stre cache stre + strage semantics (metadata cache) different stres use different replacing strategies and csting mechanisms

Cache sys.dm_s_memry_cache_cunters Caches are clerks Data Cache largest cache in the buffer pl sys.dm_s_buffer_descriptrs Plan Cache caching f executin plans sys.dm_exec_cached_plans DBCC FREESYSTEMCACHE (DBCC FREESYSTEMCACHE ('SQL Plans'))

Mnitring Memry Perfrmance mnitr (perfmn) DMVs useful cunters Memry bject Prcess bject Paging file SQL Server:Buffer Manager (MSSQL$NDBI039:Buffer Manager) bject sys.dm_s_perfrmance_cunters sys.dm_s_memry_clerks sys.dm_s_prcess_memry DBCC MEMORYSTATUS https://supprt.micrsft.cm/kb/907877/en-us SQL Server Prfiler

Tasks 1. Identify names f 10 bjects with the highest number f data pages (sys.allcatin_units, sys.partitins, OBJECT_NAME) 2. Create a table with rws exceeding page size and check hw ROW_OVERFLOW_DATA allcatin units are used (sys.allcatin_units, REPLICATE) 3. Create a stred prcedure returning the number f recrds in a table based n the sys.partitins view. 4. Find ut the number f dirty pages in each database n the server (verify by using the CHECKPOINT cmmand) (sys.dm_s_buffer_descriptrs). 5. Is a page set t dirty if an UPDATE changes a clumn t the same value (UPDATE t SET cl = cl)?