<ul><li>Technical Integration Department </li></ul><ul><li>System Analysis & Training Group </li></ul><ul><li>Jerry Yang <...
<ul><li>Introduction </li></ul><ul><li>Operating Environment  </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Me...
<ul><li>Introduction </li></ul><ul><li>Operating Environment  </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Me...
Introduction <ul><li>What Is It ? </li></ul><ul><li>Why Analyze Architecture ? </li></ul><ul><ul><li>Processing Procedures...
<ul><li>DBMS – Database Management Systems </li></ul>Introduction Application Programs/Queries Software to Process Queries...
<ul><li>Introduction </li></ul><ul><li>Operating Environment   </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>M...
<ul><li>Service Manager </li></ul><ul><li>Enterprise Manager </li></ul><ul><li>Query Analyzer </li></ul><ul><li>SQL Server...
<ul><li>Service Manager </li></ul><ul><li>Enterprise Manager </li></ul><ul><li>Query Analyzer </li></ul><ul><li>SQL Server...
<ul><li>Service Manager </li></ul>Operating Environment
<ul><li>Enterprise Manager </li></ul>Operating Environment
<ul><li>Enterprise Manager (Continued) </li></ul>Operating Environment
<ul><li>Query Analyzer </li></ul>Operating Environment
<ul><li>Query Analyzer (Continued) </li></ul>Operating Environment
<ul><li>Introduction </li></ul><ul><li>Operating Environment  </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Me...
The SQL Server Engine <ul><li>SQL Server Architecture </li></ul><ul><ul><li>Net-Library </li></ul></ul><ul><ul><li>User Mo...
The SQL Server Engine <ul><li>SQL Server Architecture </li></ul><ul><ul><li>Net-Library </li></ul></ul><ul><ul><li>User Mo...
The SQL Server Engine <ul><li>SQL Server Architecture (Continued) </li></ul>
The SQL Server Engine <ul><li>Net-Library </li></ul><ul><ul><li>Functionality </li></ul></ul><ul><ul><ul><li>An abstractio...
The SQL Server Engine <ul><li>Net-Library (Continued) </li></ul><ul><ul><li>Primary Net-Libraries </li></ul></ul><ul><ul><...
The SQL Server Engine <ul><li>Net-Library (Continued) </li></ul><ul><ul><li>Operating Environment </li></ul></ul>
The SQL Server Engine <ul><li>Net-Library (Continued) </li></ul><ul><ul><li>Operating Environment </li></ul></ul>
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Functionality </li></ul></ul><ul><ul><ul><li>Compris...
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>ODS </li></ul></ul>( O pen  D ata  S ervices)
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>ODS (Continued) </li></ul></ul><ul><ul><ul><li>Funct...
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Command Parser </li></ul></ul>
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Command Parser (Continued) </li></ul></ul><ul><ul><u...
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Optimizer </li></ul></ul>
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Optimizer (Continued) </li></ul></ul><ul><ul><ul><li...
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>SQL Manager </li></ul></ul>
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>SQL Manager (Continued) </li></ul></ul><ul><ul><ul><...
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Expression Manager </li></ul></ul>
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Expression Manager (Continued) </li></ul></ul><ul><u...
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Query Executor </li></ul></ul><ul><ul><ul><li>Functi...
The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Functionality </li></ul></ul><ul><ul><ul><li>Comprises ...
The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Access Methods Manager </li></ul></ul>
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Access Methods Manager (Continued) </li></ul></ul><u...
The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Page Manager & Text Manager </li></ul></ul>
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Page Manager & Text Manager (Continued) </li></ul></...
The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Buffer Manager </li></ul></ul>
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Buffer Manager  (Continued) </li></ul></ul><ul><ul><...
The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Transaction Manager </li></ul></ul>
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Transaction Manager (Continued) </li></ul></ul><ul><...
The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Lock Manager </li></ul></ul>
The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Lock Manager (Continued) </li></ul></ul><ul><ul><ul>...
The SQL Server Engine <ul><li>Relational / Storage Engines & DBMS  </li></ul>
<ul><li>Introduction </li></ul><ul><li>Operating Environment  </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Me...
<ul><li>Memory Pools </li></ul><ul><ul><li>What Is Memory Pools ? </li></ul></ul><ul><ul><li>Why Use It ? </li></ul></ul><...
<ul><li>Buffer Manager </li></ul><ul><li>In-Memory Pages Access - Hashing </li></ul><ul><ul><li>Hash Lists </li></ul></ul>...
<ul><li>Buffer Sweeper - Lazywriter </li></ul><ul><ul><li>Buffer Pool Management </li></ul></ul><ul><ul><li>Reference Coun...
<ul><li>Introduction </li></ul><ul><li>Operating Environment  </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Me...
<ul><li>Corporations of Managers </li></ul><ul><ul><li>Transaction Manager </li></ul></ul><ul><ul><li>Buffer Manager </li>...
<ul><li>Transaction Logging </li></ul><ul><ul><li>Definition </li></ul></ul><ul><ul><ul><li>Transaction log is a set of fi...
<ul><li>Recovery </li></ul><ul><ul><li>Checkpoint </li></ul></ul><ul><ul><ul><li>Database-by-database Basis </li></ul></ul...
<ul><li>Recovery (Continued) </li></ul><ul><ul><li>Recovery Algorithm </li></ul></ul><ul><ul><ul><li>Phase 1: Analysis </l...
<ul><li>Recovery (Continued) </li></ul>Transaction Logging And Recovery
<ul><li>Introduction </li></ul><ul><li>Operating Environment  </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Me...
Summary <ul><li>What Do You Need to Know Today…  </li></ul>Query Executer
<ul><li>Fundamentals of Database Systems </li></ul><ul><ul><li>Author: Elmasri / Navathe </li></ul></ul><ul><ul><li>Publis...
Any Question?
Upcoming SlideShare
Loading in …5
×

SQL Server 2000 Research Series - Architecture Overview

1,319 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,319
On SlideShare
0
From Embeds
0
Number of Embeds
547
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

SQL Server 2000 Research Series - Architecture Overview

  1. 1. <ul><li>Technical Integration Department </li></ul><ul><li>System Analysis & Training Group </li></ul><ul><li>Jerry Yang </li></ul><ul><li>August 25, 2005 </li></ul>SQL Server 2000 Research Series Architecture Overview
  2. 2. <ul><li>Introduction </li></ul><ul><li>Operating Environment </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Memory Management </li></ul><ul><li>Transaction Logging And Recovery </li></ul><ul><li>Summary </li></ul>Agenda
  3. 3. <ul><li>Introduction </li></ul><ul><li>Operating Environment </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Memory Management </li></ul><ul><li>Transaction Logging And Recovery </li></ul><ul><li>Summary </li></ul>Architectural Overview
  4. 4. Introduction <ul><li>What Is It ? </li></ul><ul><li>Why Analyze Architecture ? </li></ul><ul><ul><li>Processing Procedures </li></ul></ul><ul><ul><li>Performance Issues </li></ul></ul><ul><ul><ul><li>Hardware Deploy </li></ul></ul></ul><ul><ul><ul><li>Software Implementation </li></ul></ul></ul><ul><li>How Should We Proceed ? </li></ul><ul><ul><li>DBMS Structure </li></ul></ul><ul><ul><li>SQL Server Components </li></ul></ul><ul><ul><li>Relationships </li></ul></ul>
  5. 5. <ul><li>DBMS – Database Management Systems </li></ul>Introduction Application Programs/Queries Software to Process Queries/Programs Software to Access Stored Data Users/Programmers DATABASE SYSTEM DBMS SOFTWARE Stored Database Definition (Meta-Data) Stored Database
  6. 6. <ul><li>Introduction </li></ul><ul><li>Operating Environment </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Memory Management </li></ul><ul><li>Transaction Logging And Recovery </li></ul><ul><li>Summary </li></ul>Architectural Overview
  7. 7. <ul><li>Service Manager </li></ul><ul><li>Enterprise Manager </li></ul><ul><li>Query Analyzer </li></ul><ul><li>SQL Server Profiler </li></ul><ul><li>DTS - Data Transformation Services </li></ul><ul><li>Client Network Utility </li></ul>Operating Environment
  8. 8. <ul><li>Service Manager </li></ul><ul><li>Enterprise Manager </li></ul><ul><li>Query Analyzer </li></ul><ul><li>SQL Server Profiler </li></ul><ul><li>DTS - Data Transformation Services </li></ul><ul><li>Client Network Utility </li></ul>Operating Environment
  9. 9. <ul><li>Service Manager </li></ul>Operating Environment
  10. 10. <ul><li>Enterprise Manager </li></ul>Operating Environment
  11. 11. <ul><li>Enterprise Manager (Continued) </li></ul>Operating Environment
  12. 12. <ul><li>Query Analyzer </li></ul>Operating Environment
  13. 13. <ul><li>Query Analyzer (Continued) </li></ul>Operating Environment
  14. 14. <ul><li>Introduction </li></ul><ul><li>Operating Environment </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Memory Management </li></ul><ul><li>Transaction Logging And Recovery </li></ul><ul><li>Summary </li></ul>Architectural Overview
  15. 15. The SQL Server Engine <ul><li>SQL Server Architecture </li></ul><ul><ul><li>Net-Library </li></ul></ul><ul><ul><li>User Mode Scheduler </li></ul></ul><ul><ul><li>Relational Engine </li></ul></ul><ul><ul><li>OLE & Non-OLE DB Communication </li></ul></ul><ul><ul><li>Storage Engine </li></ul></ul><ul><ul><li>I/O Manager </li></ul></ul><ul><ul><li>Win 32 API </li></ul></ul>
  16. 16. The SQL Server Engine <ul><li>SQL Server Architecture </li></ul><ul><ul><li>Net-Library </li></ul></ul><ul><ul><li>User Mode Scheduler </li></ul></ul><ul><ul><li>Relational Engine </li></ul></ul><ul><ul><li>OLE & Non-OLE DB Communication </li></ul></ul><ul><ul><li>Storage Engine </li></ul></ul><ul><ul><li>I/O Manager </li></ul></ul><ul><ul><li>Win 32 API </li></ul></ul>
  17. 17. The SQL Server Engine <ul><li>SQL Server Architecture (Continued) </li></ul>
  18. 18. The SQL Server Engine <ul><li>Net-Library </li></ul><ul><ul><li>Functionality </li></ul></ul><ul><ul><ul><li>An abstraction layer enables SQL Server to read from and write to many different network protocols. </li></ul></ul></ul><ul><ul><li>Advantage </li></ul></ul><ul><ul><ul><li>Support many network protocols without having to change the core server code. </li></ul></ul></ul>
  19. 19. The SQL Server Engine <ul><li>Net-Library (Continued) </li></ul><ul><ul><li>Primary Net-Libraries </li></ul></ul><ul><ul><ul><li>Members </li></ul></ul></ul><ul><ul><ul><ul><li>OLE DB Provider for SQL Server </li></ul></ul></ul></ul><ul><ul><ul><ul><li>SQL Server ODBC Driver </li></ul></ul></ul></ul><ul><ul><ul><li>Super Socket & Shared Memory </li></ul></ul></ul><ul><ul><ul><ul><li>Inter-computer Connection </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Local Connection </li></ul></ul></ul></ul><ul><ul><li>Secondary Net-Libraries </li></ul></ul><ul><ul><ul><li>Members </li></ul></ul></ul><ul><ul><ul><ul><li>TCP/IP </li></ul></ul></ul></ul><ul><ul><ul><ul><li>IPX/SPX </li></ul></ul></ul></ul><ul><ul><ul><ul><li>ETC. </li></ul></ul></ul></ul>
  20. 20. The SQL Server Engine <ul><li>Net-Library (Continued) </li></ul><ul><ul><li>Operating Environment </li></ul></ul>
  21. 21. The SQL Server Engine <ul><li>Net-Library (Continued) </li></ul><ul><ul><li>Operating Environment </li></ul></ul>
  22. 22. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Functionality </li></ul></ul><ul><ul><ul><li>Comprises all the components necessary to parse and optimize any query. </li></ul></ul></ul><ul><ul><ul><li>Manages the execution of queries as it requests data from the storage engine in terms of OLE DB row sets and then processes the row sets returned. </li></ul></ul></ul>
  23. 23. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>ODS </li></ul></ul>( O pen D ata S ervices)
  24. 24. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>ODS (Continued) </li></ul></ul><ul><ul><ul><li>Functionality </li></ul></ul></ul><ul><ul><ul><ul><li>An interface between server Net-Library and server-based applications. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Connection Handler: </li></ul></ul></ul></ul><ul><ul><ul><ul><li><1> . Listens for new connection </li></ul></ul></ul></ul><ul><ul><ul><ul><li><2> . Cleans up failed connections </li></ul></ul></ul></ul><ul><ul><ul><ul><li><3> . Acknowledges cancellations of commands </li></ul></ul></ul></ul><ul><ul><ul><ul><li><4> . Returns result sets, messages, status values to the client </li></ul></ul></ul></ul>
  25. 25. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Command Parser </li></ul></ul>
  26. 26. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Command Parser (Continued) </li></ul></ul><ul><ul><ul><li>Functionality </li></ul></ul></ul><ul><ul><ul><ul><li>Handles language events raised by ODS. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Command Syntax Checker </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Error Raiser & Identifier </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Command Translator – Internal Format (Query Tree) </li></ul></ul></ul></ul><ul><ul><ul><li>Note </li></ul></ul></ul><ul><ul><ul><ul><li>The only one can access the source of the statement. </li></ul></ul></ul></ul>
  27. 27. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Optimizer </li></ul></ul>
  28. 28. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Optimizer (Continued) </li></ul></ul><ul><ul><ul><li>Functionality </li></ul></ul></ul><ul><ul><ul><ul><li>Takes the Query Tree from the Command Parser and prepared it for execution. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Execution Plan Generation </li></ul></ul></ul></ul><ul><ul><ul><ul><li><1> . Normalization </li></ul></ul></ul></ul><ul><ul><ul><ul><li><2> . Hardware Part: Memory, CPU, I/O, ETC. </li></ul></ul></ul></ul><ul><ul><ul><ul><li><3> . Table Part: Table, Column, Index, ETC. </li></ul></ul></ul></ul>
  29. 29. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>SQL Manager </li></ul></ul>
  30. 30. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>SQL Manager (Continued) </li></ul></ul><ul><ul><ul><li>Functionality </li></ul></ul></ul><ul><ul><ul><ul><li>Be responsible for everything having to do with managing stored procedures and their plans. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Recompilation – Based on changes in the object’s schema </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Caching of procedure plan management </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Auto-parameterized Query </li></ul></ul></ul></ul><ul><ul><ul><ul><li>SELECT * FROM Customer </li></ul></ul></ul></ul><ul><ul><ul><ul><li>WHERE Customer_ID = ‘1234567’ </li></ul></ul></ul></ul><ul><ul><ul><ul><li>SELECT * FROM Customer </li></ul></ul></ul></ul><ul><ul><ul><ul><li>WHERE Customer_ID = @param </li></ul></ul></ul></ul>
  31. 31. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Expression Manager </li></ul></ul>
  32. 32. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Expression Manager (Continued) </li></ul></ul><ul><ul><ul><li>Functionality </li></ul></ul></ul><ul><ul><ul><ul><li>Handles computation, comparison, and data movement. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>SELECT @var_Salary = Salary * 0.9 </li></ul></ul></ul></ul><ul><ul><ul><ul><li>FROM Employee </li></ul></ul></ul></ul><ul><ul><ul><ul><li>WHERE Employee_No = ‘013456’ </li></ul></ul></ul></ul>
  33. 33. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Query Executor </li></ul></ul><ul><ul><ul><li>Functionality </li></ul></ul></ul><ul><ul><ul><ul><li>Runs Execution Plan </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Interacts with Storage Engine </li></ul></ul></ul></ul><ul><ul><ul><ul><li><1> . Modifies Data </li></ul></ul></ul></ul><ul><ul><ul><ul><li><2> . Retrieves Data </li></ul></ul></ul></ul><ul><ul><ul><ul><li><3> . Manages Transaction </li></ul></ul></ul></ul><ul><ul><ul><ul><li><4> . Handles Locking </li></ul></ul></ul></ul>
  34. 34. The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Functionality </li></ul></ul><ul><ul><ul><li>Comprises the components needed to actually access and modify data on disk. </li></ul></ul></ul>
  35. 35. The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Access Methods Manager </li></ul></ul>
  36. 36. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Access Methods Manager (Continued) </li></ul></ul><ul><ul><ul><li>Functionality </li></ul></ul></ul><ul><ul><ul><ul><li>Sets up and requests scans of data pages / index pages and prepared the OLE (Object Linking and Embedding) DB row sets to return to the Relational Engine. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Requester: Access Methods Manager </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Executer: Row Operations Manager & Index Manager </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Queries, Updates, and Deletes </li></ul></ul></ul></ul>
  37. 37. The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Page Manager & Text Manager </li></ul></ul>
  38. 38. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Page Manager & Text Manager (Continued) </li></ul></ul><ul><ul><ul><li>Functionality </li></ul></ul></ul><ul><ul><ul><ul><li>The Page Manager and Text Manager cooperate to manage a collection of pages as named database. </li></ul></ul></ul></ul><ul><ul><ul><li>Type of Disk Pages </li></ul></ul></ul><ul><ul><ul><ul><li>Data Pages </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Text / Image Pages </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Index Pages </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Page Free Space (PFS) Pages </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Global Allocation Map (GAM) Pages </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Index Allocation Map (IAM) Pages </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Bulk Changed Map Pages </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Differential Changed Map Pages </li></ul></ul></ul></ul>For three kinds of datatypes storage: (1).text (2).ntext (3).image All user data, except for text, ntext, and image datatypes.
  39. 39. The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Buffer Manager </li></ul></ul>
  40. 40. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Buffer Manager (Continued) </li></ul></ul><ul><ul><ul><li>Functionality </li></ul></ul></ul><ul><ul><ul><ul><li>Handles the in-memory version of each physical disk page and provides all other modules access to it. </li></ul></ul></ul></ul><ul><ul><ul><li>Note </li></ul></ul></ul><ul><ul><ul><ul><li>When a page is needed for a process, it must exist in memory in the buffer pool. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>If the page isn’t there, a physical I / O is performed to get it. </li></ul></ul></ul></ul>
  41. 41. The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Transaction Manager </li></ul></ul>
  42. 42. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Transaction Manager (Continued) </li></ul></ul><ul><ul><ul><li>Functionality </li></ul></ul></ul><ul><ul><ul><ul><li>Guarantees the consistency and recoverability of SQL Server databases. </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Coordinates the following items: </li></ul></ul></ul></ul><ul><ul><ul><ul><li><1> . Log Manager </li></ul></ul></ul></ul><ul><ul><ul><ul><li><2> . Buffer Manager </li></ul></ul></ul></ul><ul><ul><ul><ul><li><3> . Lock Manager </li></ul></ul></ul></ul><ul><ul><ul><ul><li><4> . Recovery Module </li></ul></ul></ul></ul><ul><ul><ul><li>Note </li></ul></ul></ul><ul><ul><ul><ul><li>SUSPENDED! </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Chapter: Transaction Logging And Recovery </li></ul></ul></ul></ul>
  43. 43. The SQL Server Engine <ul><li>Storage Engine </li></ul><ul><ul><li>Lock Manager </li></ul></ul>
  44. 44. The SQL Server Engine <ul><li>Relational Engine </li></ul><ul><ul><li>Lock Manager (Continued) </li></ul></ul><ul><ul><ul><li>Functionality </li></ul></ul></ul><ul><ul><ul><ul><li>Guards data and the internal resources that make it possible for many users to simultaneously access the database and not be severely affected by others’ uses. </li></ul></ul></ul></ul><ul><ul><ul><li>Two Separate Locking Systems </li></ul></ul></ul><ul><ul><ul><ul><li>Locking System I – Fully Shared Data Table </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Locking System II – Restricted System Data </li></ul></ul></ul></ul>
  45. 45. The SQL Server Engine <ul><li>Relational / Storage Engines & DBMS </li></ul>
  46. 46. <ul><li>Introduction </li></ul><ul><li>Operating Environment </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Memory Management </li></ul><ul><li>Transaction Logging And Recovery </li></ul><ul><li>Summary </li></ul>Architectural Overview
  47. 47. <ul><li>Memory Pools </li></ul><ul><ul><li>What Is Memory Pools ? </li></ul></ul><ul><ul><li>Why Use It ? </li></ul></ul><ul><ul><li>Pool Types </li></ul></ul><ul><ul><ul><li>Buffer Pool </li></ul></ul></ul><ul><ul><ul><ul><li>4 ~ 10 MB </li></ul></ul></ul></ul><ul><ul><ul><ul><li>1 Buffer = 1 Page (8 KB) </li></ul></ul></ul></ul><ul><ul><ul><li>Operating System Memory </li></ul></ul></ul><ul><ul><ul><ul><li>MAX – 4 ~ 10 MB </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Need Memory Size > 8 KB </li></ul></ul></ul></ul>Memory Management
  48. 48. <ul><li>Buffer Manager </li></ul><ul><li>In-Memory Pages Access - Hashing </li></ul><ul><ul><li>Hash Lists </li></ul></ul><ul><ul><li>Hash Buckets </li></ul></ul><ul><ul><ul><li>A Hash Bucket is a structure in memory that contains an array of pointers to the buffer page. </li></ul></ul></ul><ul><ul><li>Hashing Function </li></ul></ul><ul><ul><ul><li>Hashing is a technique that uniformly maps a key via a hash function across a set of Hash Buckets. </li></ul></ul></ul>Memory Management
  49. 49. <ul><li>Buffer Sweeper - Lazywriter </li></ul><ul><ul><li>Buffer Pool Management </li></ul></ul><ul><ul><li>Reference Count </li></ul></ul><ul><ul><ul><li>Data / Index Pages </li></ul></ul></ul><ul><ul><ul><li>Expensive Pages </li></ul></ul></ul><ul><ul><ul><ul><li>Ex: Stored Procedure Plans </li></ul></ul></ul></ul><ul><ul><li>Free List </li></ul></ul>Memory Management
  50. 50. <ul><li>Introduction </li></ul><ul><li>Operating Environment </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Memory Management </li></ul><ul><li>Transaction Logging And Recovery </li></ul><ul><li>Summary </li></ul>Architectural Overview
  51. 51. <ul><li>Corporations of Managers </li></ul><ul><ul><li>Transaction Manager </li></ul></ul><ul><ul><li>Buffer Manager </li></ul></ul><ul><ul><li>Log Manager </li></ul></ul><ul><ul><li>Lock Manager </li></ul></ul><ul><ul><li>Recovery Module </li></ul></ul>Transaction Logging And Recovery
  52. 52. <ul><li>Transaction Logging </li></ul><ul><ul><li>Definition </li></ul></ul><ul><ul><ul><li>Transaction log is a set of files associated with a database at the time the database is created or altered. </li></ul></ul></ul><ul><ul><li>LSN </li></ul></ul><ul><ul><ul><li>Log Sequence Number </li></ul></ul></ul>Transaction Logging And Recovery
  53. 53. <ul><li>Recovery </li></ul><ul><ul><li>Checkpoint </li></ul></ul><ul><ul><ul><li>Database-by-database Basis </li></ul></ul></ul><ul><ul><ul><li>All committed transactions are written to the database. </li></ul></ul></ul><ul><ul><ul><li>Triggered Conditions </li></ul></ul></ul><ul><ul><ul><ul><li>Database Owner Issues A Ckeckpoint Command </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Log Is Getting Full (more than 70% of capacity) </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Long Recovery Time Is Estimated </li></ul></ul></ul></ul>Transaction Logging And Recovery
  54. 54. <ul><li>Recovery (Continued) </li></ul><ul><ul><li>Recovery Algorithm </li></ul></ul><ul><ul><ul><li>Phase 1: Analysis </li></ul></ul></ul><ul><ul><ul><li>Phase 2: Redo (rollforward) </li></ul></ul></ul><ul><ul><ul><li>Phase 3: Undo (rollback) </li></ul></ul></ul>Transaction Logging And Recovery
  55. 55. <ul><li>Recovery (Continued) </li></ul>Transaction Logging And Recovery
  56. 56. <ul><li>Introduction </li></ul><ul><li>Operating Environment </li></ul><ul><li>The SQL Server Engine </li></ul><ul><li>Memory Management </li></ul><ul><li>Transaction Logging And Recovery </li></ul><ul><li>Summary </li></ul>Architectural Overview
  57. 57. Summary <ul><li>What Do You Need to Know Today… </li></ul>Query Executer
  58. 58. <ul><li>Fundamentals of Database Systems </li></ul><ul><ul><li>Author: Elmasri / Navathe </li></ul></ul><ul><ul><li>Publisher: Addison-Wesley Publishing </li></ul></ul><ul><ul><li>Company </li></ul></ul><ul><li>Inside of Microsoft SQL Server 2000 </li></ul><ul><ul><li>Author: Kalen Delaney </li></ul></ul><ul><ul><li>Publisher: Microsoft Press </li></ul></ul>Reference
  59. 59. Any Question?

×