Download presentation
Presentation is loading. Please wait.
Published byGudrun Kaufman Modified over 6 years ago
1
Microsoft SQL Server 2014 for Oracle DBAs Module 2
11: Monitoring and performance tuning Microsoft SQL Server 2014 for Oracle DBAs Module 2 Instance architecture
2
40074A Module Overview 3: Instance architecture Background processes
3
Lesson 1: Configuring a database server
3: Instance architecture Demonstration: Configuration parameters
4
Using configuration parameters to allocate and manage resources
Server configuration 3: Instance architecture 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
5
Demonstration: Configuration parameters
3: Instance architecture In this demonstration you will see how to: Manage instance configurations through SSMS. Manage instance configurations through T-SQL scripts. Manage instance configurations through PowerShell. Demonstration Steps Right-click a SQL Server instance, and then click Properties. Click the Memory page and note the Minimum server memory and Maximum server memory property values. Click the Processors page and note the Maximum worker threads property value. Click the Connections page and note the Maximum number of concurrent connections property and the Allow remote connections to this server property.Note There are many more properties present on these pages as well as on other pages. These properties have been singled out for these examples only.To open the Query Editor in SQL Server Management Studio, click New Query. For the master database, execute the query: EXEC sp_configure 'show advanced options', 1 GO RECONFIGURE EXEC sp_configure Scroll through the list and note the values for the following configuration options: Min Server Memory Max Server Memory Max Worker Threads User Connections Remote Access Each row contains the configuration option name, the minimum and maximum allowable values for (More notes on the next slide)
6
Lesson 2: Memory architecture overview
3: Instance architecture Demonstration: Monitor and affect memory
7
Memory address space in Oracle
3: Instance architecture Oracle Process Server Process Background PGA System Global Area Java Pool Buffer Cache Redo Buffer Shared Pool Streams Pool Large Pool Components of Oracle in memory Application components RDBMS components Automatic memory management Manage both SGA and PGA Automatically sizes memory
8
SQL Server memory pool and Oracle System Global Area
3: Instance architecture Buffer Cache Shared Pool Columnstore Cache Procedure Cache Redo Buffers Fixed SGA Large Pool Streams Java Log Cache System Structures Connection Context CLR Hosting Layer Oracle System Global Area (SGA) SQL Server Memory Pool
9
SQL Server architecture
3: Instance architecture Components of SQL Server architecture Non-preemptive scheduling Memory management Memory Management Non-Preemptive Scheduling Memory Nodes Memory Clerks Caches Pools Memory Objects Scheduling Nodes Schedulers Tasks Worker Threads System Threads Hosting Subsystems SQLOS
10
Demonstration: Monitoring memory usage with dynamic management views
3: Instance architecture In this demonstration you will see how to: Review instance memory via T-SQL Demonstration Steps To open the Query Editor in SQL Server Management Studio, click New Query. For the master database, execute the query: SELECT physical_memory_kb AS PhysicalMemoryAvailable, virtual_memory_kb AS VirtualMemoryAvailable, committed_kb AS CommittedMemory, committed_target_kb AS AvailableMemory FROM sys.dm_os_sys_info This shows the amount of physical memory available, the virtual memory available to the process in user mode, the committed memory in the memory manager, and the amount of memory that can be consumed by SQL Server memory manager. In the same query window execute the query: SELECT * FROM sys.dm_os_memory_clerks Memory clerks manage the stores of memory used by the caching framework introduced in SQL Server The descriptions of the returned columns (and those of the following DMV’s) are available in Books Online. Some columns that provide useful information include: pages_kb Amount of page memory allocated virtual_memory_reserved_kb and virtual_memory_committed_kb Amount of virtual memory reserved and committed by the clerk awe_allocated_kb Amount of memory allocated by using AWE Execute the following query: (More notes on the next slide)
11
Memory address space comparison
3: Instance architecture 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) 2TB
12
Demonstration: Monitor and affect memory
3: Instance architecture In this demonstration you will see how to: View the setting for the Instance though SSMS Use the Task Manager for quick memory allocations Track memory performance though counters Demonstration Steps Select a particular SQL Server instance. Right-click the instance, click Properties, and then click Memory. You can view the dynamic or fixed memory allocated for the particular instance. In most installations the minimum memory is set at 0 bytes and the maximum memory is allocated as high as the system may allow. In addition, you can set or view the minimum memory assigned to each query. The default is 1 MB. The minimum value may be as low as 512 KB and the maximum is configurable based on available memory. Caution and testing should always be applied before changing these values in order to mitigate unexplained behavior in the system.1. Press Ctrl + Alt + Delete, or right-click the Taskbar. 2. Click the Task Manager. 3. Click the Performance tab. Options located on the Performance tab are: • CPU Usage • CPU Usage History • Memory: Shows the total and available RAM The Physical Memory Usage History column is the Working Set, or the portion of that process space that is in physical memory (as opposed to being in page file). Working Set can add up to over the physical amount of memory because there can be pages that are shared, such as processes sharing the same DLLs.When the Lock pages in memory right is granted Task Manager does NOT show the correct value for the sqlservr.exe process under the Mem Usage column. The reason for this is that the Mem Usage column does not take Locked Pages into account. For this reason, especially when you have a large amount of RAM, you may observe that the Mem Usage column has a low value, whereas the Total Server Memory Performace Counter (explained below) shows a much higher (and correct) value for memory usage. Click Start → Control Panel → System and Security → Administration Tools. Click Performance Monitor. Select the option to Add counter (the big green plus sign). Select SQLServer: MemoryManager → Total Server Memory. Total Server Memory indicates how (More notes on the next slide)
13
Lesson 3: Understanding processes and threads in the database engine
3: Instance architecture SQL Server client–database interaction
14
Process and thread architecture
3: Instance 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
15
Greater control with Resource Governor
3: Instance architecture Resource Governor Performance Availability Key Components Resource Pools Workload Groups Classification Session 1 of n User-defined classifier function Group 1 Pool 1 Internal Group Internal Pool Default Pool Default Group Group 2 Application 1 Group 3 2 Group 4 3 Pool 2
16
Oracle client–database interaction
3: Instance architecture Oracle connections Client Person System Application Layer Oracle Net Foundation Oracle Protocol Support Layer Database Server Listener (defined by listener.ora may implement TNSnames.ora Oracle Instance Oracle Protocol Storage System Data Storage Key components in the interaction of the user (client) with the database environment
17
SQL Server client–database interaction
3: Instance architecture Users User Process Relational Engine Memory Pool Database Buffer Cache ODBC Storage Log Open Data Services Database Cleanup Worker Thread Writer Lazy Shrinking Data Files Log Files Client 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
18
Lesson 4: Background processes
3: Instance architecture Demonstration: Evaluating instance resources
19
Oracle background processes
3: Instance architecture Instance SGA Process Monitor User Process System Monitor Dispatcher Job Queue Redo Log Buffer User Process Queue Monitor Shared Server Event Monitor Recoverer User Process Dedicated Server Trace Writer Checkpoint Users Database Data Files Archive Log Files Control Files Redo Log Files Automatic Storage Management
20
SQL Server background processes
3: Instance architecture Users User Process Relational Engine Memory Pool Database Buffer Cache ODBC Storage Log Open Data Services Database Cleanup Worker Thread Writer Lazy Shrinking Data Files Log Files Client
21
Comparing background processes
3: Instance architecture Oracle process Oracle identifier SQL Server equivalent Required Process Monitor System Monitor Database Writers Checkpoint Process Recoverer Log Writer Archive Processes Job Queue Processes Job Queue Coordinators Queue Monitor Processes Parallel Query Slave Processes Dispatcher Shared Servers PMON SMON DBWn CKPT RECO LGWR ARCn Jnnn CJQn QMNn Pnnn Dnnn Snnn SQLOS Database Cleanup/Shrinking Lazywriter Database Checkpoint MS DTC N/A SQL Agent Worker Threads Networker Thread Mandatory Optional
22
Demonstration: Evaluating instance resources
3: Instance architecture In this demonstration you will see how to: Use Dynamic Management Views to see processor usage. Use Activity Monitor to see real-time session usage. Associate scheduler threads to worker threads. Demonstration Steps To open the Query Editor in SQL Server Management Studio, click New Query. For the master database, execute the query: SELECT * FROM sys.dm_os_schedulers This returns data about SQL Server schedulers, which deploy workers to threads. Execute the query: SELECT * FROM sys.dm_exec_sessions Provides resource information about sessions associated with SQL Server processes. How many sessions are provided?______ Keep this tab open. Most session information (not all) can be gathered from Perfmon. However, if DBAs cannot run Perfmon, they can get the information through dynamic management views and functions. For example, you can query the sys.dm_exec_connections, sys.dm_exec_sessions, and sys.dm_exec_requests dynamic management views to obtain the resource information used by different processes.Right-click a particular SQL Server instance, and then select Activity Monitor. Right-click Activity Monitor and refresh the activity. You can see the resource usage of the processes running on that database. To view the memory consumed by various processes associated with an instance, expand the Processes bar. You can view the memory consumed by each process running on the database server. Note the number of sessions. These are fewer than the number of items seen previously while using the DMVs. Why are these different and what are they? ______________________________ _____________________________________________________1. Go back to the Activity Monitor tab. 2. Drag it down in the panel to create a split. 3. Click User Process, and then click (All). Now all of the sessions should match the tab with (More notes on the next slide)
23
© 2014 Microsoft Corporation. All rights reserved
© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.