100% found this document useful (1 vote)
215 views

Pro SQL Server 2022 Administration: A guide for the modern DBA 3rd Edition Peter A. Carter - Download the ebook now to never miss important content

The document provides information on how to download the book 'Pro SQL Server 2022 Administration: A Guide for the Modern DBA' by Peter A. Carter, along with links to additional SQL Server and programming resources available at ebookmass.com. It includes details about the book's content, including installation, configuration, and administration of SQL Server. The document also outlines the copyright information and offers links to related products for further exploration.

Uploaded by

lagasatahlia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
215 views

Pro SQL Server 2022 Administration: A guide for the modern DBA 3rd Edition Peter A. Carter - Download the ebook now to never miss important content

The document provides information on how to download the book 'Pro SQL Server 2022 Administration: A Guide for the Modern DBA' by Peter A. Carter, along with links to additional SQL Server and programming resources available at ebookmass.com. It includes details about the book's content, including installation, configuration, and administration of SQL Server. The document also outlines the copyright information and offers links to related products for further exploration.

Uploaded by

lagasatahlia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

Visit ebookmass.

com to download the full version and


explore more ebook or textbook

Pro SQL Server 2022 Administration: A guide for


the modern DBA 3rd Edition Peter A. Carter

_____ Click the link below to download _____


https://ebookmass.com/product/pro-sql-
server-2022-administration-a-guide-for-the-modern-dba-3rd-
edition-peter-a-carter/

Explore and download more ebook or textbook at ebookmass.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Pro SQL Server 2022 Wait Statistics: A Practical Guide to


Analyzing Performance in SQL Server and Azure SQL
Database, 3rd Edition Thomas Larock
https://ebookmass.com/product/pro-sql-server-2022-wait-statistics-a-
practical-guide-to-analyzing-performance-in-sql-server-and-azure-sql-
database-3rd-edition-thomas-larock/

Pro SQL Server 2022 Wait Statistics: A Practical Guide to


Analyzing Performance in SQL Server and Azure SQL
Database, 3rd Edition Thomas Larock
https://ebookmass.com/product/pro-sql-server-2022-wait-statistics-a-
practical-guide-to-analyzing-performance-in-sql-server-and-azure-sql-
database-3rd-edition-thomas-larock-2/

SQL Server 2022 Administration Inside Out 1st Edition


Randolph West

https://ebookmass.com/product/sql-server-2022-administration-inside-
out-1st-edition-randolph-west/

Pro T-SQL 2022 2nd Edition Elizabeth Noble

https://ebookmass.com/product/pro-t-sql-2022-2nd-edition-elizabeth-
noble/
Microsoft SQL Server 2016 a beginner's guide Sixth Edition
Petkovic

https://ebookmass.com/product/microsoft-sql-server-2016-a-beginners-
guide-sixth-edition-petkovic/

Microsoft SQL Server 2019: A Beginner’s Guide 7th Edition


| Retail Edition Dusan Petkovic

https://ebookmass.com/product/microsoft-sql-server-2019-a-beginners-
guide-7th-edition-retail-edition-dusan-petkovic/

Expert Performance Indexing in Azure SQL and SQL Server


2022, Fourth Edition: Toward Faster Results and Lower
Maintenance Both on Premises and in the Cloud Edward
Pollack
https://ebookmass.com/product/expert-performance-indexing-in-azure-
sql-and-sql-server-2022-fourth-edition-toward-faster-results-and-
lower-maintenance-both-on-premises-and-in-the-cloud-edward-pollack/

Python Mini Reference 2022: A Quick Guide to the Modern


Python Programming Language for Busy Coders (A
Hitchhiker's Guide to the Modern Programming Languages
Book 3) Harry Yoon
https://ebookmass.com/product/python-mini-reference-2022-a-quick-
guide-to-the-modern-python-programming-language-for-busy-coders-a-
hitchhikers-guide-to-the-modern-programming-languages-book-3-harry-
yoon/

Pro Oracle SQL Development: Best Practices for Writing


Advanced Queries 2nd Edition Jon Heller

https://ebookmass.com/product/pro-oracle-sql-development-best-
practices-for-writing-advanced-queries-2nd-edition-jon-heller/
Pro SQL Server 2022
Administration
A Guide for the Modern DBA

Third Edition

Peter A. Carter
Pro SQL Server 2022
Administration
A Guide for the Modern DBA
Third Edition

Peter A. Carter
Pro SQL Server 2022 Administration: A Guide for the Modern DBA
Peter A. Carter
SOUTHAMPTON, UK

ISBN-13 (pbk): 978-1-4842-8863-4 ISBN-13 (electronic): 978-1-4842-8864-1


https://doi.org/10.1007/978-1-4842-8864-1

Copyright © 2023 by Peter A. Carter


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Jonathan Gennick
Development Editor: Laura Berendson
Coordinating Editor: Jill Balzano
Cover designed by eStudioCalamar
Cover Photo by Anton Maksimov 5642.su on Unsplash
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza,
Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@
springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole
member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc
is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub (https://github.com/Apress). For more detailed information, please visit http://www.
apress.com/source-code.
Printed on acid-free paper
For Terri. My inspiration, my rock.
Table of Contents
About the Author����������������������������������������������������������������������������������������������������xix

About the Technical Reviewer��������������������������������������������������������������������������������xxi


Acknowledgments������������������������������������������������������������������������������������������������xxiii

Part I: Installation and Configuration������������������������������������������������������������� 1


Chapter 1: Planning the Deployment������������������������������������������������������������������������ 3
Editions and License Models�������������������������������������������������������������������������������������������������������� 3
Hardware Considerations�������������������������������������������������������������������������������������������������������������� 6
Specifying Strategic Minimum Requirements������������������������������������������������������������������������� 7
Storage������������������������������������������������������������������������������������������������������������������������������������ 7
Operating Systems Considerations��������������������������������������������������������������������������������������������� 18
Configuring the Operating System���������������������������������������������������������������������������������������� 19
Selecting Features���������������������������������������������������������������������������������������������������������������������� 24
Instance Features������������������������������������������������������������������������������������������������������������������ 25
Shared Features�������������������������������������������������������������������������������������������������������������������� 27
Summary������������������������������������������������������������������������������������������������������������������������������������ 29

Chapter 2: GUI Installation�������������������������������������������������������������������������������������� 31


Obtaining SQL Server Media������������������������������������������������������������������������������������������������������� 31
Installation Center����������������������������������������������������������������������������������������������������������������������� 32
The Planning Tab������������������������������������������������������������������������������������������������������������������� 33
The Installation Tab���������������������������������������������������������������������������������������������������������������� 34
The Maintenance Tab������������������������������������������������������������������������������������������������������������ 36
The Tools Tab������������������������������������������������������������������������������������������������������������������������� 37
The Resources Tab���������������������������������������������������������������������������������������������������������������� 38
The Advanced Tab������������������������������������������������������������������������������������������������������������������ 39
The Options Tab��������������������������������������������������������������������������������������������������������������������� 41
v
Table of Contents

Installing a Stand-Alone Database Engine Instance������������������������������������������������������������������� 42


Preparation Steps������������������������������������������������������������������������������������������������������������������ 42
The Feature Selection Page��������������������������������������������������������������������������������������������������� 49
The Instance Configuration Page������������������������������������������������������������������������������������������� 50
Selecting Service Accounts��������������������������������������������������������������������������������������������������� 52
Choosing the Collation����������������������������������������������������������������������������������������������������������� 55
Provisioning Instance Security���������������������������������������������������������������������������������������������� 62
Configuring the Instance������������������������������������������������������������������������������������������������������� 64
Configuring SQL Server Extension for Azure������������������������������������������������������������������������� 70
Completing the Installation���������������������������������������������������������������������������������������������������� 71
Summary������������������������������������������������������������������������������������������������������������������������������������ 73

Chapter 3: Server Core Installation������������������������������������������������������������������������ 75


Installing an Instance������������������������������������������������������������������������������������������������������������������ 75
Required Parameters������������������������������������������������������������������������������������������������������������� 76
Role Parameter���������������������������������������������������������������������������������������������������������������������� 79
Basic Installation������������������������������������������������������������������������������������������������������������������� 80
Smoke Tests�������������������������������������������������������������������������������������������������������������������������� 81
Troubleshooting the Installation�������������������������������������������������������������������������������������������� 84
Optional Parameters�������������������������������������������������������������������������������������������������������������� 87
Product Update���������������������������������������������������������������������������������������������������������������������� 91
Using a Config File���������������������������������������������������������������������������������������������������������������������� 93
Automatic Installation Routines�������������������������������������������������������������������������������������������������� 97
Enhancing the Installation Routine���������������������������������������������������������������������������������������� 99
Production Readiness���������������������������������������������������������������������������������������������������������� 100
Summary���������������������������������������������������������������������������������������������������������������������������������� 102

Chapter 4: Installation on Heterogeneous Operating Systems����������������������������� 105


Installing SQL Server on Linux�������������������������������������������������������������������������������������������������� 105
Installing SQL Server Manually�������������������������������������������������������������������������������������������� 106
Configuring SQL Server������������������������������������������������������������������������������������������������������� 109
Unattended Installation������������������������������������������������������������������������������������������������������� 113

vi
Table of Contents

Installing and Managing SQL Server in a Docker Container����������������������������������������������������� 116


Running a Microsoft-Supplied Docker Image���������������������������������������������������������������������� 117
Working with Containers����������������������������������������������������������������������������������������������������� 118
Creating Custom SQL Server Containers���������������������������������������������������������������������������������� 120
Creating a Simple Docker Image for SQL Server����������������������������������������������������������������� 121
Create a Configurable Docker Image for SQL Server����������������������������������������������������������� 126
Summary���������������������������������������������������������������������������������������������������������������������������������� 133

Chapter 5: Configuring the Instance��������������������������������������������������������������������� 135


Instance Configuration�������������������������������������������������������������������������������������������������������������� 135
Using sp_configure�������������������������������������������������������������������������������������������������������������� 135
Processor and Memory Configuration��������������������������������������������������������������������������������� 137
Trace Flags�������������������������������������������������������������������������������������������������������������������������� 150
Ports and Firewalls������������������������������������������������������������������������������������������������������������������� 155
Process of Communication�������������������������������������������������������������������������������������������������� 155
Ports Required by SQL Server��������������������������������������������������������������������������������������������� 156
Configuring the Port That the Instance Will Listen On��������������������������������������������������������� 158
System Databases�������������������������������������������������������������������������������������������������������������������� 161
mssqlsystemresource (Resource)��������������������������������������������������������������������������������������� 161
MSDB����������������������������������������������������������������������������������������������������������������������������������� 161
Master��������������������������������������������������������������������������������������������������������������������������������� 162
Model����������������������������������������������������������������������������������������������������������������������������������� 163
TempDB������������������������������������������������������������������������������������������������������������������������������� 163
Optimizing TempDB������������������������������������������������������������������������������������������������������������� 165
Buffer Pool Extension���������������������������������������������������������������������������������������������������������������� 168
Hybrid Buffer Pool��������������������������������������������������������������������������������������������������������������������� 170
Summary���������������������������������������������������������������������������������������������������������������������������������� 170

vii
Table of Contents

Part II: Database Administration���������������������������������������������������������������� 173


Chapter 6: Database Configuration����������������������������������������������������������������������� 175
Data Storage����������������������������������������������������������������������������������������������������������������������������� 175
Filegroups���������������������������������������������������������������������������������������������������������������������������� 176
FILESTREAM Filegroups������������������������������������������������������������������������������������������������������ 180
Memory-Optimized Filegroups�������������������������������������������������������������������������������������������� 187
Strategies for Structured Filegroups����������������������������������������������������������������������������������� 190
Strategies for Memory-Optimized Filegroups��������������������������������������������������������������������� 193
File and Filegroup Maintenance������������������������������������������������������������������������������������������������ 194
Adding Files������������������������������������������������������������������������������������������������������������������������� 194
Expanding Files������������������������������������������������������������������������������������������������������������������� 197
Shrinking Files��������������������������������������������������������������������������������������������������������������������� 198
Database Scoped Configurations���������������������������������������������������������������������������������������������� 201
Log Maintenance���������������������������������������������������������������������������������������������������������������������� 204
Recovery Model������������������������������������������������������������������������������������������������������������������� 206
Log File Count���������������������������������������������������������������������������������������������������������������������� 207
Shrinking the Log���������������������������������������������������������������������������������������������������������������� 207
Log Fragmentation�������������������������������������������������������������������������������������������������������������� 208
Summary���������������������������������������������������������������������������������������������������������������������������������� 216

Chapter 7: Table Optimizations����������������������������������������������������������������������������� 219


Table Partitioning���������������������������������������������������������������������������������������������������������������������� 219
Partitioning Concepts���������������������������������������������������������������������������������������������������������� 220
Implementing Partitioning��������������������������������������������������������������������������������������������������� 223
Monitoring Partitioned Tables���������������������������������������������������������������������������������������������� 230
Sliding Windows������������������������������������������������������������������������������������������������������������������ 233
Partition Elimination������������������������������������������������������������������������������������������������������������ 236
Table Compression�������������������������������������������������������������������������������������������������������������������� 238
Row Compression���������������������������������������������������������������������������������������������������������������� 239
Page Compression��������������������������������������������������������������������������������������������������������������� 240
Columnstore Compression�������������������������������������������������������������������������������������������������� 242

viii
Table of Contents

XML Compression���������������������������������������������������������������������������������������������������������������� 243


Implementing Compression������������������������������������������������������������������������������������������������� 244
Memory-Optimized Tables�������������������������������������������������������������������������������������������������������� 248
Durability����������������������������������������������������������������������������������������������������������������������������� 249
Creating and Managing Memory-Optimized Tables������������������������������������������������������������� 249
Performance Profile������������������������������������������������������������������������������������������������������������� 252
Table Memory Optimization Advisor������������������������������������������������������������������������������������ 256
Natively Compiled Objects��������������������������������������������������������������������������������������������������� 257
Summary���������������������������������������������������������������������������������������������������������������������������������� 260

Chapter 8: Indexes and Statistics������������������������������������������������������������������������� 263


Clustered Indexes��������������������������������������������������������������������������������������������������������������������� 263
Tables Without a Clustered Index���������������������������������������������������������������������������������������� 264
Tables with a Clustered Index���������������������������������������������������������������������������������������������� 265
Clustering the Primary Key�������������������������������������������������������������������������������������������������� 266
Administering Clustered Indexes����������������������������������������������������������������������������������������� 267
Nonclustered Indexes��������������������������������������������������������������������������������������������������������������� 271
Covering Indexes����������������������������������������������������������������������������������������������������������������� 272
Administering Nonclustered Indexes����������������������������������������������������������������������������������� 273
Filtered Indexes������������������������������������������������������������������������������������������������������������������� 279
Indexes for Specialized Application������������������������������������������������������������������������������������������ 279
Columnstore Indexes����������������������������������������������������������������������������������������������������������� 280
Clustered Columnstore Indexes������������������������������������������������������������������������������������������� 281
Nonclustered Columnstore Indexes������������������������������������������������������������������������������������� 284
In-Memory Indexes�������������������������������������������������������������������������������������������������������������� 285
Maintaining Indexes������������������������������������������������������������������������������������������������������������������ 291
Missing Indexes������������������������������������������������������������������������������������������������������������������� 292
Index Fragmentation������������������������������������������������������������������������������������������������������������ 294
Resumable Index Operations����������������������������������������������������������������������������������������������� 299
Partitioned Indexes�������������������������������������������������������������������������������������������������������������� 302

ix
Table of Contents

Statistics����������������������������������������������������������������������������������������������������������������������������������� 304
Filtered Statistics����������������������������������������������������������������������������������������������������������������� 306
Incremental Statistics���������������������������������������������������������������������������������������������������������� 307
Managing Statistics������������������������������������������������������������������������������������������������������������� 307
Managing Cardinality����������������������������������������������������������������������������������������������������������� 310
Summary���������������������������������������������������������������������������������������������������������������������������������� 312

Chapter 9: Database Consistency������������������������������������������������������������������������� 315


Consistency Errors�������������������������������������������������������������������������������������������������������������������� 315
Understand Consistency Errors������������������������������������������������������������������������������������������� 315
Detecting Consistency Errors���������������������������������������������������������������������������������������������� 317
System Database Corruption����������������������������������������������������������������������������������������������� 327
DBCC CHECKDB������������������������������������������������������������������������������������������������������������������������� 330
Checking for Errors�������������������������������������������������������������������������������������������������������������� 330
Fixing Errors������������������������������������������������������������������������������������������������������������������������ 336
Emergency Mode����������������������������������������������������������������������������������������������������������������� 339
Other DBCC Commands for Corruption�������������������������������������������������������������������������������� 341
Consistency Checks on VLDBs�������������������������������������������������������������������������������������������������� 346
DBCC CHECKDB with PHYSICAL_ONLY�������������������������������������������������������������������������������� 346
Backing Up WITH CHECKSUM and DBCC CHECKALLOC������������������������������������������������������� 347
Splitting the Workload��������������������������������������������������������������������������������������������������������� 347
Offloading to a Secondary Server���������������������������������������������������������������������������������������� 348
Summary���������������������������������������������������������������������������������������������������������������������������������� 348

Part III: Security, Resilience, and Scaling Workloads��������������������������������� 351


Chapter 10: SQL Server Security Model���������������������������������������������������������������� 353
Security Hierarchy��������������������������������������������������������������������������������������������������������������������� 353
Implementing Instance-Level Security�������������������������������������������������������������������������������� 357
Implementing Database-Level Security������������������������������������������������������������������������������������ 368
Database Roles�������������������������������������������������������������������������������������������������������������������� 368
Schemas������������������������������������������������������������������������������������������������������������������������������ 372

x
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Table of Contents

Creating and Managing Contained Users���������������������������������������������������������������������������� 375


Implementing Object-Level Security����������������������������������������������������������������������������������������� 379
Summary���������������������������������������������������������������������������������������������������������������������������������� 380

Chapter 11: Auditing and Ledger�������������������������������������������������������������������������� 381


Ledger��������������������������������������������������������������������������������������������������������������������������������������� 381
Append-Only Ledger Tables������������������������������������������������������������������������������������������������� 382
Ledger Database����������������������������������������������������������������������������������������������������������������� 384
Database Ledger and Digest Management������������������������������������������������������������������������� 387
Server Audit������������������������������������������������������������������������������������������������������������������������������ 392
Creating a Server Audit������������������������������������������������������������������������������������������������������� 392
Creating a Server Audit Specification���������������������������������������������������������������������������������� 396
Enabling and Invoking Audits���������������������������������������������������������������������������������������������� 398
Updateable Ledger Tables��������������������������������������������������������������������������������������������������� 399
Database Audit Specifications��������������������������������������������������������������������������������������������� 407
Auditing the Audit���������������������������������������������������������������������������������������������������������������� 412
Summary���������������������������������������������������������������������������������������������������������������������������������� 413

Chapter 12: Encryption����������������������������������������������������������������������������������������� 415


Encryption Hierarchy����������������������������������������������������������������������������������������������������������������� 415
Encryption Concepts������������������������������������������������������������������������������������������������������������ 415
SQL Server Encryption Concepts����������������������������������������������������������������������������������������� 416
Transparent Data Encryption����������������������������������������������������������������������������������������������������� 421
Implementing TDE��������������������������������������������������������������������������������������������������������������� 422
Managing TDE���������������������������������������������������������������������������������������������������������������������� 428
Migrating an Encrypted Database��������������������������������������������������������������������������������������� 429
Managing Cell-Level Encryption����������������������������������������������������������������������������������������������� 430
Accessing Encrypted Data��������������������������������������������������������������������������������������������������� 435
Always Encrypted��������������������������������������������������������������������������������������������������������������������� 437
Implementing Always Encrypted����������������������������������������������������������������������������������������� 439
Administering Keys�������������������������������������������������������������������������������������������������������������� 446
Summary���������������������������������������������������������������������������������������������������������������������������������� 451

xi
Table of Contents

Chapter 13: Backups and Restores���������������������������������������������������������������������� 453


Backup Fundamentals�������������������������������������������������������������������������������������������������������������� 453
Recovery Models����������������������������������������������������������������������������������������������������������������� 453
Changing the Recovery Model��������������������������������������������������������������������������������������������� 456
Backup Types����������������������������������������������������������������������������������������������������������������������� 459
Backup Media���������������������������������������������������������������������������������������������������������������������� 460
Backup Strategies��������������������������������������������������������������������������������������������������������������������� 462
Full Backup Only������������������������������������������������������������������������������������������������������������������ 463
Full and Transaction Log Backups��������������������������������������������������������������������������������������� 463
Full, Differential, and Transaction Log Backups������������������������������������������������������������������� 464
Filegroup Backups��������������������������������������������������������������������������������������������������������������� 464
Partial Backup��������������������������������������������������������������������������������������������������������������������� 465
Backing Up a Database������������������������������������������������������������������������������������������������������������� 465
Backing Up in SQL Server Management Studio������������������������������������������������������������������ 465
Backing Up via T-SQL���������������������������������������������������������������������������������������������������������� 468
Restoring a Database���������������������������������������������������������������������������������������������������������������� 475
Restoring in SQL Server Management Studio��������������������������������������������������������������������� 475
Restoring via T-SQL������������������������������������������������������������������������������������������������������������� 480
Restoring to a Point in Time������������������������������������������������������������������������������������������������������ 486
Restoring Files and Pages�������������������������������������������������������������������������������������������������������� 490
Restoring a File������������������������������������������������������������������������������������������������������������������� 490
Restoring a Page����������������������������������������������������������������������������������������������������������������� 492
Piecemeal Restores������������������������������������������������������������������������������������������������������������������ 495
Accelerated Database Recovery����������������������������������������������������������������������������������������������� 498
Summary���������������������������������������������������������������������������������������������������������������������������������� 501

Chapter 14: High Availability and Disaster Recovery Concepts��������������������������� 505


Availability Concepts����������������������������������������������������������������������������������������������������������������� 506
Level of Availability�������������������������������������������������������������������������������������������������������������� 506
Recovery Point Objective and Recovery Time Objective������������������������������������������������������ 509
Cost of Downtime���������������������������������������������������������������������������������������������������������������� 511
Classification of Standby Servers���������������������������������������������������������������������������������������� 512

xii
Table of Contents

High Availability and Recovery Technologies���������������������������������������������������������������������������� 513


AlwaysOn Failover Clustering���������������������������������������������������������������������������������������������� 513
AlwaysOn Availability Groups���������������������������������������������������������������������������������������������� 520
Log Shipping������������������������������������������������������������������������������������������������������������������������ 526
Combining Technologies������������������������������������������������������������������������������������������������������ 529
Summary���������������������������������������������������������������������������������������������������������������������������������� 532

Chapter 15: Implementing AlwaysOn Availability Groups������������������������������������ 533


Implementing AlwaysOn Availability Groups����������������������������������������������������������������������������� 534
Configuring SQL Server������������������������������������������������������������������������������������������������������� 540
Creating the Availability Group�������������������������������������������������������������������������������������������� 542
Availability Groups On Linux������������������������������������������������������������������������������������������������������ 557
Contained Availability Group����������������������������������������������������������������������������������������������������� 564
Distributed Availability Groups�������������������������������������������������������������������������������������������������� 570
Managing AlwaysOn Availability Groups����������������������������������������������������������������������������������� 573
Failover�������������������������������������������������������������������������������������������������������������������������������� 573
Synchronizing Uncontained Objects������������������������������������������������������������������������������������ 579
Monitoring��������������������������������������������������������������������������������������������������������������������������� 580
Other Administrative Considerations����������������������������������������������������������������������������������� 583
Summary���������������������������������������������������������������������������������������������������������������������������������� 585

Chapter 16: Implementing Log Shipping�������������������������������������������������������������� 587


Implementing Log Shipping for DR������������������������������������������������������������������������������������������� 587
GUI Configuration����������������������������������������������������������������������������������������������������������������� 590
T-SQL Configuration������������������������������������������������������������������������������������������������������������� 601
Log Shipping Maintenance������������������������������������������������������������������������������������������������������� 613
Failing Over Log Shipping���������������������������������������������������������������������������������������������������� 613
Switching Roles������������������������������������������������������������������������������������������������������������������� 614
Monitoring��������������������������������������������������������������������������������������������������������������������������� 620
Summary���������������������������������������������������������������������������������������������������������������������������������� 623

xiii
Table of Contents

Chapter 17: Scaling Workloads���������������������������������������������������������������������������� 625


Database Snapshots����������������������������������������������������������������������������������������������������������������� 625
Implementing Database Snapshots������������������������������������������������������������������������������������� 628
Recovering Data from a Snapshot��������������������������������������������������������������������������������������� 632
Replication�������������������������������������������������������������������������������������������������������������������������������� 633
Replication Concepts����������������������������������������������������������������������������������������������������������� 633
Types of Replication������������������������������������������������������������������������������������������������������������ 635
Implementing Transactional Replication������������������������������������������������������������������������������ 638
AlwaysOn Readable Secondary Replicas���������������������������������������������������������������������������������� 663
Benefits and Considerations������������������������������������������������������������������������������������������������ 663
Implementing Readable Secondaries���������������������������������������������������������������������������������� 664
Summary���������������������������������������������������������������������������������������������������������������������������������� 675

Part IV: Performance and Maintenance������������������������������������������������������ 677


Chapter 18: SQL Server Metadata������������������������������������������������������������������������� 679
Introducing Metadata Objects��������������������������������������������������������������������������������������������������� 679
Server-Level and Instance-Level Metadata������������������������������������������������������������������������������ 683
Exposing Registry Values���������������������������������������������������������������������������������������������������� 683
Exposing Service Details����������������������������������������������������������������������������������������������������� 684
Analyzing Buffer Cache Usage�������������������������������������������������������������������������������������������� 685
Metadata for Capacity Planning������������������������������������������������������������������������������������������������ 687
Exposing File Stats�������������������������������������������������������������������������������������������������������������� 687
Using File Stats for Capacity Analysis��������������������������������������������������������������������������������� 691
Metadata for Troubleshooting and Performance Tuning����������������������������������������������������������� 695
Retrieving Perfmon Counters���������������������������������������������������������������������������������������������� 695
Analyzing Waits������������������������������������������������������������������������������������������������������������������� 700
Database Metadata������������������������������������������������������������������������������������������������������������������� 704
Metadata-Driven Automation���������������������������������������������������������������������������������������������������� 708
Dynamically Cycling Database Snapshots��������������������������������������������������������������������������� 709
Rebuilding Only Fragmented Indexes���������������������������������������������������������������������������������� 712
Summary���������������������������������������������������������������������������������������������������������������������������������� 713

xiv
Table of Contents

Chapter 19: Locking and Blocking������������������������������������������������������������������������ 715


Understanding Locking������������������������������������������������������������������������������������������������������������� 715
Lock Granularity������������������������������������������������������������������������������������������������������������������ 715
Locking Behaviors for Online Maintenance������������������������������������������������������������������������� 717
Lock Compatibility��������������������������������������������������������������������������������������������������������������� 722
Lock Partitioning������������������������������������������������������������������������������������������������������������������ 723
Understanding Deadlocks��������������������������������������������������������������������������������������������������������� 724
How Deadlocks Occur��������������������������������������������������������������������������������������������������������� 724
Minimizing Deadlocks��������������������������������������������������������������������������������������������������������� 726
Understanding Transactions������������������������������������������������������������������������������������������������������ 726
Transactional Properties������������������������������������������������������������������������������������������������������ 727
Transaction with In-Memory OLTP�������������������������������������������������������������������������������������������� 738
Isolation Levels�������������������������������������������������������������������������������������������������������������������� 738
Cross-Container Transactions���������������������������������������������������������������������������������������������� 740
Retry Logic�������������������������������������������������������������������������������������������������������������������������� 742
Observing Transactions, Locks, and Deadlocks������������������������������������������������������������������������ 743
Observing Transactions������������������������������������������������������������������������������������������������������� 743
Observing Locks and Contention����������������������������������������������������������������������������������������� 747
Observing Deadlocks����������������������������������������������������������������������������������������������������������� 752
Summary���������������������������������������������������������������������������������������������������������������������������������� 753

Chapter 20: Extended Events�������������������������������������������������������������������������������� 755


Extended Events Concepts�������������������������������������������������������������������������������������������������������� 755
Packages����������������������������������������������������������������������������������������������������������������������������� 755
Events���������������������������������������������������������������������������������������������������������������������������������� 756
Targets��������������������������������������������������������������������������������������������������������������������������������� 757
Actions��������������������������������������������������������������������������������������������������������������������������������� 757
Predicates���������������������������������������������������������������������������������������������������������������������������� 758
Types and Maps������������������������������������������������������������������������������������������������������������������� 758
Sessions������������������������������������������������������������������������������������������������������������������������������ 760

xv
Table of Contents

Creating an Event Session�������������������������������������������������������������������������������������������������������� 760


Using the New Session Dialog Box�������������������������������������������������������������������������������������� 763
Using T-SQL������������������������������������������������������������������������������������������������������������������������� 770
Viewing the Collected Data������������������������������������������������������������������������������������������������������� 773
Analyzing Data with Data Viewer����������������������������������������������������������������������������������������� 774
Analyzing Data with T-SQL�������������������������������������������������������������������������������������������������� 779
Correlating Extended Events with Operating System Data������������������������������������������������������� 783
Correlating Events with Perfmon Data�������������������������������������������������������������������������������� 783
Integrating Event Sessions with Operating System–Level Events�������������������������������������� 785
Summary���������������������������������������������������������������������������������������������������������������������������������� 792

Chapter 21: Monitoring and Managing a Hybrid Environment����������������������������� 795


Hybrid Management������������������������������������������������������������������������������������������������������������������ 795
Environmental Health and SQL Best Practice Assessment�������������������������������������������������� 797
Microsoft Defender�������������������������������������������������������������������������������������������������������������� 811
Summary���������������������������������������������������������������������������������������������������������������������������������� 820

Chapter 22: Query Store��������������������������������������������������������������������������������������� 823


Enabling and Configuring Query Store�������������������������������������������������������������������������������������� 823
Working with Query Store Data������������������������������������������������������������������������������������������������� 829
Query Store Reports������������������������������������������������������������������������������������������������������������ 831
Query Store T-SQL Objects�������������������������������������������������������������������������������������������������� 836
Resolving Issues with Query Store������������������������������������������������������������������������������������������� 841
Query Store Hints���������������������������������������������������������������������������������������������������������������������� 842
Summary���������������������������������������������������������������������������������������������������������������������������������� 845

Chapter 23: Automating Maintenance Routines��������������������������������������������������� 847


SQL Server Agent���������������������������������������������������������������������������������������������������������������������� 847
SQL Server Agent Concepts������������������������������������������������������������������������������������������������� 848
SQL Server Agent Security�������������������������������������������������������������������������������������������������� 852
Creating SQL Server Agent Jobs������������������������������������������������������������������������������������������ 855
Monitoring and Managing Jobs������������������������������������������������������������������������������������������� 885
Creating Alerts��������������������������������������������������������������������������������������������������������������������� 888

xvi
Table of Contents

Multiserver Jobs����������������������������������������������������������������������������������������������������������������������� 891


Configuring the MSX and TSX Servers�������������������������������������������������������������������������������� 892
Creating Master Jobs���������������������������������������������������������������������������������������������������������� 897
Managing Target Servers����������������������������������������������������������������������������������������������������� 899
Summary���������������������������������������������������������������������������������������������������������������������������������� 903

Chapter 24: Policy-Based Management���������������������������������������������������������������� 905


PBM Concepts��������������������������������������������������������������������������������������������������������������������������� 905
Facets���������������������������������������������������������������������������������������������������������������������������������� 905
Conditions���������������������������������������������������������������������������������������������������������������������������� 906
Targets��������������������������������������������������������������������������������������������������������������������������������� 906
Policies�������������������������������������������������������������������������������������������������������������������������������� 907
Evaluation Modes���������������������������������������������������������������������������������������������������������������� 907
Central Management Servers��������������������������������������������������������������������������������������������������� 909
Creating Policies����������������������������������������������������������������������������������������������������������������������� 916
Creating Simple Policies������������������������������������������������������������������������������������������������������ 916
Creating an Advanced Policy����������������������������������������������������������������������������������������������� 925
Managing Policies��������������������������������������������������������������������������������������������������������������������� 928
Importing and Exporting Policies����������������������������������������������������������������������������������������� 929
Enterprise Management with Policies��������������������������������������������������������������������������������� 930
Evaluating Policies with PowerShell����������������������������������������������������������������������������������� 932
Summary���������������������������������������������������������������������������������������������������������������������������������� 933

Chapter 25: Resource Governor���������������������������������������������������������������������������� 935


Resource Governor Concepts���������������������������������������������������������������������������������������������������� 935
Resource Pool���������������������������������������������������������������������������������������������������������������������� 935
Workload Group������������������������������������������������������������������������������������������������������������������� 937
Classifier Function��������������������������������������������������������������������������������������������������������������� 938
Implementing Resource Governor��������������������������������������������������������������������������������������������� 938
Creating Resource Pools����������������������������������������������������������������������������������������������������� 938
Creating Workload Groups��������������������������������������������������������������������������������������������������� 942
Creating a Classifier Function��������������������������������������������������������������������������������������������� 946
Testing the Classifier Function�������������������������������������������������������������������������������������������� 950
xvii
Table of Contents

Monitoring Resource Governor������������������������������������������������������������������������������������������������� 951


Monitoring with Performance Monitor�������������������������������������������������������������������������������� 951
Monitoring with DMVs��������������������������������������������������������������������������������������������������������� 955
Summary���������������������������������������������������������������������������������������������������������������������������������� 964

Index��������������������������������������������������������������������������������������������������������������������� 965

xviii
About the Author
Peter Carter is a SQL Server expert with over 15 years of
experience in developing, administering, and architecting
SQL Server platforms and data-tier applications. He was
awarded an MCC by Microsoft in 2011 to sit alongside his
array of MCTS, MCITP, MCSA, and MCSE certifications in
SQL Server from version 2005 onward. Peter has written
a number of books across a variety of SQL Server topics,
including security, high availability, and automation.

xix
About the Technical Reviewer
Ian Stirk is a freelance SQL Server consultant based in
London. In addition to his day job, he is an author, creator
of software utilities, and technical reviewer who regularly
writes book reviews for www.i-programmer.info.
He covers every aspect of SQL Server/Azure SQL and has
special interest in performance and scalability. If you require
help with your SQL Server systems, feel free to contact him
at ian_stirk@yahoo.com or www.linkedin.com/in/
ian-stirk-bb9a31.

xxi
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Other documents randomly have
different content
gave evidence as to the due execution of the codicil. The instrument was
admitted to probate. It developed, however, that there was another paper, a
dissolution of partnership, signed on the same day by the same witnesses.
The result was, that the charming widow was found guilty of perjury.

Mr. Meeson’s Will


The following description of this famous will is taken from the Green
Bag:
“In ‘Mr. Meeson’s Will,’ Rider Haggard tells of a fiendish publisher and
a lone island and a tattooed will. It is the particular delight of this issuer of
books, though he largely sends forth works of a religious cast, to crush all
the originality out of his authors and turn them into literary hacks, so that
they may become dreary drudges in his vast establishment, sinking even
their names in numbers, and losing every atom of individuality and every
symptom of spirit. He makes a shamelessly cruel contract with the heroine,
who writes novels; and the hero, his nephew, protests and is driven out of
the concern. But he is driven into love with the reciprocating maker of
manuscript. Then the heroine embarks for distant lands; and it happens, to
the great good fortune of the inventor of the story, that the publisher sails on
board the same vessel. The vessel is wrecked and these two are cast on a
desert island, where they manage to get along after the style of ‘Robinson
Crusoe’ with variations. But the publisher, upset in body and mind by these
experiences, dies, pursued by ghastly visions of the suffering authors he has
driven to desperation.
“Yet these very visions make him see the error of his ways, and prompt
him to do justice. It is plain to him that he must set all things right by
making a will in favor of the nephew whom he had disinherited. But how to
carry out the plan on this spot is the question. At last a happy thought
strikes the lady. The will shall be tattoed across her shoulders, and this is
done, though she endures no end of agony, and faints away when the job is
over.
“Of course she is rescued by a passing vessel, rejoins her lover, and
seeks to establish his rights. For this purpose the will must be probated, and
the law requires the original will to be filed in the office. But the Registrar,
touched by ‘Beauty in distress,’ allows a photograph of the will to be filed.
The will is contested by the other heirs, but after an exciting trial, described
at length in the story, victory perches on the shoulders of the lady.
“This is the real climax of the story, but we are carried on through the
ringing of the marriage bells, to learn that they lived happy ever after.”

His Request Disregarded


Horace Walpole writes that a certain testator who was apprehensive that
his will would not be upheld, prefaced that document with these words:
“In the name of God, Amen! I am of sound mind. This is my last will
and testament, and I desire the courts not to trouble themselves to make
another for me.”
His request seems not to have been taken in his favor, for the courts did
make another will for him.
In ancient Greece, it was quite usual to introduce into wills the most
formidable imprecations on those who should attempt to violate the wishes
of the testator; in modern times pecuniary penalties, instead of curses, are
more in favor with distrustful will-makers.

Jerome on Wills
Mr. Jerome K. Jerome, after months of study, inspired by a
determination to get to the bottom of Stage law, mentions among the few
points on which he is at all clear, the following:
That if a man dies without leaving a will, then all his property goes to
the nearest villain.
But that if a man dies and leaves a will, then all his property goes to
whoever can get possession of that will.

Must not Remarry


“Iris,” in one of Pinero’s plays of the same name, is a beautiful young
widow of twenty-one. She finds herself much hampered by the terms of her
husband’s will, which deprives her of its benefits if she remarries. Such a
provision is in law perfectly legal and its use much indulged in by dying
husbands, but whether wisely or justly is a matter of serious doubt.
“The Thunderbolt”
Pinero’s latest play, “The Thunderbolt,” is a study of the manners and
respectability of the middle-class of England. The play was not received
with favor in London, but has been granted a hearing by the “New Theatre”
of New York, and by competent judges is said to be the masterpiece of its
author.
The play is based on a stolen will: the first act shows a family gathered
around the bier of Edward Mortimore, who had accumulated wealth in the
brewing of beer, which, during his life, was regarded by his family as rather
a disreputable business. There is absent from the gathering, only one
interested person, and that is an illegitimate daughter, Helen Thornhill, who
is an art student in Paris. Helen arrives and is much surprised that her father
has not remembered her, for the announcement is made that he left no will;
and she wishes that “every ill that’s conceivable” should come upon the
heads of those who will inherit. It quickly develops, however, that the father
did leave a will, in these words:
“I leave everything I die possessed of to Helen Thornhill, spinster,
absolutely, and she is to be my sole executrix.”
A confession discloses the fact that the will has been destroyed by
Phyllis, wife of Thaddeus, a brother of the testator. Helen refuses to bring
disgrace on the family by a prosecution, and a compromise is effected, by
which she receives a substantial portion of the estate.

Dickens a Will-maker
Dickens was a great will-maker. We know that if Dick Swiveller had
been a steadier youth he would have inherited more than one hundred and
fifty pounds a year from his Aunt Rebecca. The loyal-hearted lover, Mr.
Barkis, made Peggotty his residuary legatee. The litigation in Jarndyce v.
Jarndyce arose out of a disputed will. The various wills left by old Harmon
in “Our Mutual Friend” bring about no end of complications, there being at
least three wills in existence at one time, and each one believed by the
person discovering it to be the final will.
Mr. George W. E. Russell says that perhaps Dickens’s best piece of will-
making is given in the case of Mr. Spenlow, who, being a practitioner in
Doctors’ Commons, spoke about his own will with “a serenity, a
tranquillity, a calm sunset air” which quite affected David Copperfield; and
then shattered all poor David’s hopes by dying intestate.
Perplexities of Poor Cecilia
All the perplexities and distresses of poor Cecilia, in Frances Burney’s
“Memoirs of an Heiress,” grew out of a clause in her uncle’s will, imposing
the condition that if she married, her husband should take her family name
of Beverly. Poor Cecilia! What doubts and difficulties beset her by reason
of this unfortunate provision; and too, it gives the authoress an excellent
opportunity to harrow up the reader on account of these delicate
uncertainties and distresses.

Olivia’s Will
It was suggested to Olivia in “Twelfth Night,” that her graces would go
to the grave and no copy be held; she responds:
“O, Sir, I will not be so hard hearted; I will give out divers schedules of
my beauty; It shall be inventoried, and every particle and utensil labelled to
my will; as, item, two lips indifferent red; item, two gray eyes with lids to
them; item, one neck, one chin, and so forth.”
Portia and Nerissa
In the “Merchant of Venice” Portia is much concerned over the will of
her father with reference to the caskets:
“Portia. But this reasoning is not in the fashion to choose me a husband.
—O me! the word choose! I may neither choose whom I would, nor refuse
whom I dislike; so is the will of a living daughter curbed by the will of a
dead father.—Is it not hard, Nerissa, that I cannot choose one, nor refuse
none?
“Nerissa. Your father was ever virtuous, and holy men at their death
have good inspirations; therefore, the lottery, that he hath devised in these
three chests of gold, silver, and lead (whereof who chooses his meaning,
chooses you) will, no doubt, never be chosen by any rightly, but one whom
you shall rightly love. But what warmth is there in your affection towards
any of these princely suitors that are already come?”

Will of Nicholas Gimcrack


The will of Nicholas Gimcrack, Esq., is a curious document, and reflects
the mind of the worthy virtuoso, and in it his various follies, littlenesses and
quaint humors are contained in an orderly and distinct fashion. This will
appears in the Tatler, Vol. IV, No. 216, and is here written, minus certain
parts which are of no great concern:
“THE WILL OF A VIRTUOSO
“I Nicholas Gimcrack, being in sound Health of Mind, but in great
Weakness of Body, do by this my Last Will and Testament bequeath my
worldly Goods and Chattels in Manner follows:

“Imprimis, To my dear Wife,


One Box of Butterflies,
One Drawer of Shells,
A Female Skeleton,
A dried Cockatrice.

“Item, To my Daughter Elizabeth,


My Receipt for preserving dead Caterpillars,
As also my preparations of Winter May-Dew, and Embrio Pickle.

“Item, To my little Daughter Fanny,


Three Crocodiles’ Eggs.
And upon the Birth of her first Child, if she marries with her
Mother’s Consent,
The Nest of a Humming-Bird.

“Item, To my eldest Brother, as an Acknowledgment for the


Lands he has vested in my Son Charles, I bequeath
My last Year’s Collection of Grasshoppers.

“Item, To his Daughter, Susanna, being his only Child, I bequeath my English Weeds
pasted on Royal Paper,
With my large Folio of Indian Cabbage.

* * * * * * *
“Having fully provided for my Nephew Isaac, by making over to him
some years since

A Horned Scarabæus,
The Skin of a Rattle-Snake, and
The Mummy of an Egyptian King,
I make no further Provision for him in this my Will.
“My eldest son John having spoken disrespectfully of his little sister,
whom I keep by me in Spirits of Wine, and in many other instances behaved
himself undutifully towards me, I do disinherit, and wholly cut off from any
Part of this my Personal Estate, by giving him a single Cockle-Shell.
“To my Second Son Charles, I give and bequeath all my Flowers, Plants,
Minerals, Mosses, Shells, Pebbles, Fossils, Beetles, Butterflies, Caterpillars,
Grasshoppers, and Vermin, not above specified: As also all my Monsters,
both wet and dry, making the said Charles whole and sole Executor of this
my Last Will and Testament, he paying or causing to be paid the aforesaid
Legacies within the space of Six Months after my Decease. And I do hereby
revoke all other Wills whatsoever by me formerly made.”

Eustace Budgell
Pope was an excellent satirist; he writes:

“Let Budgell charge lone Grub Street on my quill,


And write whate’er he please,—except my will.”

Eustace Budgell was born at St. Thomas near Exeter, England, in 1685,
and died in 1737. He was an essayist and miscellaneous writer, and a friend
and kinsman of Joseph Addison, who was for a time Secretary of State for
Ireland: he accompanied Addison to Ireland as Clerk, and later became
under Secretary of State: he was, however, forced to resign his post, and
returned to England.
Budgell is said to have lost a fortune in the notorious scheme known to
history as the “South Sea Bubble.” He published the Bee, a periodical
which brought him into considerable notoriety. He studied law and was
called to the bar, but attained little success. By the will of Dr. Matthew
Tindal, who died in 1733, he was left a legacy of 2000 Guineas: it was
claimed that Budgell himself inserted this legacy in the will, which was
successfully disputed by the heirs to the Tindal Estate: his prospects and
future being ruined, he fell into disgrace and debt, and determined upon
self-destruction. Accordingly, 1737, he took a boat at Summerset Stairs,
after filling his pockets with stones, and drowned himself in the Thames.
On his desk was found a slip of paper on which were written these words:
“What Cato did and Addison approved cannot be wrong.”
Will of a Child
In “Little Women,” by Louisa M. Alcott, we find Amy’s will, and it is a
pretty reflection of the sweet and ingenuous spirit of a child. And humanity
would be the happier for it if we could take with us into maturer years, the
open hand and the self-forgetfulness of childhood.
Amy decided to follow the example of her Aunt March in will-making,
though it cost her many a pang to part with her little treasures. Here is the
paper Laurie was asked to read:

“MY LAST WILL AND TESTAMENT


“I, Amy Curtis March, being in my sane mind, do give and bequeethe all
my earthly property—viz. to wit:—namely
“To my father, my best pictures, sketches, maps, and works of art,
including frames. Also my $100, to do what he likes with.
“To my mother, all my clothes, except the blue apron with pockets,—
also my likeness, and my medal, with much love.
“To my dear sister Margaret, I give my turquoise ring (if I get it), also
my green box with the doves on it, also my piece of real lace for her neck,
and my sketch of her as a memorial of her ‘little girl.’
“To Jo I leave my breast-pin, the one mended with sealing wax, also my
bronze inkstand—she lost the cover—and my most precious plaster rabbit,
because I am sorry I burnt up her story.
“To Beth (if she lives after me) I give my dolls and the little bureau, my
fan, my linen collars and my new slippers if she can wear them being thin
when she gets well. And I herewith also leave her my regret that I ever
made fun of old Joanna.
“To my friend and neighbor Theodore Laurence I bequeethe my paper
marshay portfolio, my clay model of a horse though he did say it hadn’t any
neck. Also in return for his great kindness in the hour of affliction any one
of my artistic works he likes, Noter Dame is the best.
“To our venerable benefactor Mr. Laurence I leave my purple box with a
looking glass in the cover which will be nice for his pens and remind him of
the departed girl who thanks him for his favors to her family, specially
Beth.
“I wish my favorite playmate Kitty Bryant to have the blue silk apron
and my gold-bead ring with a kiss.
“To Hannah I give the bandbox she wanted and all the patchwork I leave
hoping she ‘will remember me, when it you see.’
“And now having disposed of my most valuable property I hope all will
be satisfied and not blame the dead. I forgive every one, and trust we may
all meet when the trump shall sound. Amen.
“To this will and testament I set my hand and seal on this 20th day of
Nov. Anni Domino 1861.
“Amy Curtis March.

Estelle Valnor,
“Witnesses:
Theodore Laurence.

“Postscript: I wish all my curls cut off, and given round to my friends. I
forgot it; but I want it done, though it will spoil my looks.”

The Will of Don Quixote


“I feel, good sirs,” said Don Quixote, “that death advances fast upon me.
Let us then be serious, and bring me a confessor, and a notary to draw up
my will, for a man in my state must not trifle with his soul. Let the notary
be sent for, I beseech you, while my friend here, the priest, is taking my
confession.”
The priest, having listened to his dying friend’s confession, came out of
the room and told them that the good Alonzo Quixano was near his end, and
certainly in his right senses; he therefore advised them to go in, as it was
full time that his will should be made. These tidings gave a terrible stab to
the overcharged hearts of the two ladies and his faithful squire, whose eyes
overflowed with weeping, and whose bosoms had well-nigh burst with a
thousand sighs and groans; for, indeed, it must be owned, as we have
somewhere observed, that whether in the character of Alonzo Quixano the
Good, or in the capacity of Don Quixote de la Mancha, the poor gentleman
had always exhibited marks of a peaceable temper and agreeable demeanor,
for which he was beloved, not only by his own family, but also by all those
who had the pleasure of his acquaintance.
The notary entering the apartment with the rest of the company, wrote
the preamble of the will, in which Don Quixote disposed of his soul in all
the necessary Christian forms; then proceeding to the legacies, he said:
“Item: Whereas, Sancho Panza, whom, in my madness, I made my
squire, has in his hands a certain sum of money for my use; and, as divers
accounts, disbursements, and pecuniary transactions have passed between
us, it is my will that he shall not be charged or brought to account for the
said money; but, if there be any overplus after he has deducted the payment
of what I owe him, the said overplus, which must be a mere trifle, shall be
his own, and much good may it do him; and as, during my disorder, I
contributed to his being made governor of an island, I would now, while I
enjoy my perfect senses, confer upon him, were it in my power, a whole
kingdom, which he richly deserves for the innocency of his heart and the
fidelity of his service.”
Then turning to the disconsolate squire, “Forgive me, friend,” said he,
“for having been the cause of thy appearing in the eye of the world a
madman like myself, by drawing thee into my erroneous notions concerning
the existence and adventures of knights-errant.”
“Gentlemen,” said Don Quixote, “let us proceed fair and softly. I was
mad, I am now sane; I was Don Quixote de la Mancha; I am now, as
formerly styled, Alonzo Quixano the Good. And may my repentance and
sincerity restore me to the esteem you once had for me. Now let the notary
proceed.
“Item: I bequeath to Antonia Quixano, my niece, here present, all my
estate, real and personal, after the payment of all my debts and legacies; and
the first to be discharged shall be the wages due to my housekeeper for the
time she has been in my service, and twenty ducats besides for a suit of
mourning.
“I appoint for my executors signor the priest and signor bachelor
Sampson Carrasco, here present.
“Item: It is also my will that, if Antonia Quixano, my niece, should be
inclined to marry, it shall be only with a man who, upon the strictest
inquiry, shall be found to know nothing of books of chivalry; and, in case it
appear that he is acquainted with such books, and that my niece,
notwithstanding, will and doth marry him, then shall she forfeit all I have
bequeathed her, which my executors may dispose of in pious uses as they
think proper.
“And, finally, I beseech the said gentlemen, my executors, that if haply
they should come to the knowledge of the author of a certain history
dispersed abroad, entitled, ‘The Second Part of the Achievements of Don
Quixote de la Mancha,’ that they will, in my name, most earnestly entreat
him to forgive me for having been the innocent cause of his writing such a
number of absurdities as that performance contains; for I quit this life with
some scruples of conscience arising from that consideration.”
The will being thus concluded, he was seized with a fainting-fit, and
stretched himself at full length in the bed, so that all the company were
alarmed and ran to his assistance. During three days which he lived after the
will was signed and sealed, he frequently fainted, and the whole family was
in confusion. Nevertheless, the niece ate her victuals, the housekeeper drank
to the repose of his soul, and even Sancho cherished his little carcass; for
the prospect of succession either dispels or moderates that affliction which
an heir ought to feel at the death of the testator.
At last Don Quixote expired, after having received all the sacraments,
and in the strongest terms, pathetically enforced, expressed his abomination
against all books of chivalry; and the notary observed, that in all the books
of that kind which he had perused, he had never read of any knight-errant
who died quietly in his bed as a good Christian, like Don Quixote; who,
amidst the tears and lamentations of all present, gave up the ghost, or, in
other words, departed this life. The curate was no sooner certified of his
decease, than he desired the notary to make out a testimonial, declaring that
Alonzo Quixano the Good, commonly called Don Quixote de la Mancha,
had taken his departure from this life, and died of a natural death; that no
other author, different from Cid Hamet Benengeli, should falsely pretend to
raise him from the dead, and write endless histories of his achievements.
This was the end of that extraordinary gentleman of La Mancha, whose
birthplace Cid Hamet was careful to conceal, that all the towns and villages
of that province might contend for the honor of having produced him, as did
the seven cities of Greece for the glory of giving birth to Homer. The
lamentations of Sancho, the niece and the housekeeper, are not here given,
nor the new epitaphs on the tomb of the deceased knight, except the
following one, composed by Sampson Carrasco:
“A doughty gentleman lies here,
A stranger all his life to fear;
Nor in his death could Death prevail,
In that last hour, to make him quail.

“He for the world but little cared;


And at his feats the world was scared;
A crazy man his life he passed,
But in his senses died at last.”

WILLS IN POETRY OR RHYME


The disposition of one’s worldly possessions by a testamentary
document in poetry or rhyme, appears incongruous, yet there are numerous
documents of this nature: a brief, but striking example of such, by an
attorney named Smithers who resided in London, follows:

“As to all my wordly goods, now or to be in store,


I give them to my beloved wife, and hers forevermore.
I give all freely; I no limit fix;
This is my will, and she’s executrix.”

Will of Mother Hubbard’s Dog

“This wonderful dog


Was Dame Hubbard’s delight;
He could dance, he could sing,
He could read, he could write.

“She went to the druggist


To get him a pill;
And when she came back,
He was writing his will.

“So she gave him rich dainties


Whenever he fed;
And put up a monument
When he was dead.”

On Tremont Street, in the busy heart of Boston, is the beautiful little


“burying ground,” called the “Granary”; Paul Revere, John Quincy Adams,
John Hancock, and other distinguished citizens of New England rest here
under trees which have shaded their graves for more than a century. There is
also shown the visitor the grave of “Mother Goose,” the alleged author of
the Mother Goose Rhymes. It may be iconoclastic to shatter a legend, but
the truth is, the Mother Goose Rhymes had been jingling for a century and
more before this good lady was born; it appears that in ancient times, the
goose was a famous story-teller for children, and the Goose Melodies are an
adaptation from the French. The monument in the “Granary” is erected to
Mary Goose, wife of Isaac Goose; it would seem that her claim to fame
rests entirely upon her recitation of the Hubbard Melodies to such an extent
that her son-in-law, Thomas Fleet, who was a printer, issued a special
edition for her.

Piers Plowman
Piers Plowman, in the fourteenth century, thus made his will:

“And I wish ere I wend, now to write out my will.


In God’s name, amen! lo! I make it myself.
May God have my soul who hath saved and deserved it,
Let the kirk have my carrion and keep well my bones.”

Will of Paul Scarron


The will of Paul Scarron, which he chose to write in verse, is not a
particularly attractive production. It consists of about two hundred lines; the
following may be taken as a specimen:

“Premièrement je donne et je légue


A ma femme, qui n’est point bégue,
Pouvoir de se remarier,
De crainte d’un plus grand désordre.
Mais pour moi je crois que cet ordre,
De ma dernière volonté
Sera celui le mieux exécuté.”

As is well known, Scarron was a French author and playwright. In 1652


he married the beautiful Francine d’Aubigne, afterward Madame de
Maintenon. He died on October 6, 1660.
François Villon
François Villon is an unique character in history, romance and poetry. He
died about 1484. “The Poems of Master François Villon of Paris done into
English Verse by John Payne,” contain his two chief compositions entitled,
“The Lesser Testament,” and “The Greater Testament”: they are satires of
considerable merit and length, and a verse from the first and two from the
last will suffice to show their character and his style.
From the first:

“Item, my gloves and silken hood


My friend Jacques Cardon, I declare,
Shall have in fair free gift for good;
Also the acorns willows bear
And every day a capon fair
Or goose; likewise a tenfold vat
Of chalk-white wine, besides a pair
Of lawsuits, lest he wax too fat.”

From the last:

“The Register of Wills from me


Shall have no quid nor quod, I trow:
But every penny of his fee
To Tricot, the young priest, shall go;
To whose expense gladly eno’
I’d drink, though it my nightcap cost:
If but he knew the dice to throw,
Of Perette’s Den I’d make him host.”

“EPITAPH

“Here lies and slumbers in this place


One whom Love wreaked his ire upon:
A scholar, poor of goods and grace,
That hight of old François Villon:
Acre or furrow had he none.
’Tis known his all he gave away;
Bread, tables, tressels, all are gone.
Gallants, of him this Roundel say.”
Will of Sir Thomas Denny
Thomas Denny (son and heir of Sir Edmond Denny of England, one of
the King’s Exchequer), 10th May, 1527, wrote his will in manner following:
“ ... My body to be buried in the parish church of Cheshunt, where I
dwell, and I will that a stone be laid on me, and that a picture of Death be
made in the stone, with scrolls in his hand bearing this writing thereon:

“As I am so shalle ye be,


Pray for me of yr Charity,
With a Paternoster and an Ave,
For the rest of the soul of Thomas Denny.”

Then follow sundry bequests and legacies.

In Latin Verse
There is on record the following history of a versified will. It is that of
François Joseph Terrasse Desbillons, born at Chäteauneuf, in Berry, in
1711, who became a Jesuit, and, after the suppression of the order in
France, principal of the College of Mannheim. He was so remarkable for
the elegance and purity with which he wrote in Latin that he obtained the
sobriquet of “The last of the Romans.” Owing, perhaps, to this facility, he
wrote his will in Latin verse. The sight of it in this singular form somewhat
startled his executors; but as all the necessary formalities had been
observed, no difficulty occurred, and it was carried out in entire conformity
with his wishes, without any interference on the part of the law.

A Will in Rhyme
Another poetic will, that of John Hedges, late of Finchley, Middlesex,
was proved in an English court on July 5, 1737, and is worthy of a place
among quaint and eccentric wills. It reads as follows:
“This fifth of May,
Being airy and gay,
To trip not inclined,
But of vigorous mind,
And my body in health,
I’ll dispose of my wealth;
And of all I’m to leave
On this side the grave,
To some one or other,
I think to my brother.

“But because I presaw


That my brother-in-law
I did not take care,
Would come in for a share,
Which I noways intended,
Till their manners were mended—
And of that there’s no sign.

“I do therefore enjoin,
And strictly command,
As witness my hand,
That nought I have got
Be brought to hotch-pot.

“And I give and devise,


Much as in me lies,
To the son of my mother,
My own dear brother,
To have and to hold
All my silver and gold,
As the affectionate pledges
Of his brother,
“John Hedges.”

Will of William Hickington


William Hickington, who died in the year 1770, wrote his will in rhyme,
as follows:
“This is my last will,
I insist on it still;
To sneer on and welcome,
And e’en laugh your fill.

I, William Hickington,
Poet of Pocklington,
Do give and bequeath,
As free as I breathe,
To thee, Mary Jarum,
The Queen of my Harum,
My cash and my cattle,
With every chattel,
To have and to hold,
Come heat or come cold,
Sans hindrance or strife,
Though thou art not my wife.
As witness my hand,
Just here as I stand,
The twelfth of July,
In the year Seventy.
“Wm. Hickington.”

This will was admitted to probate at the Deanery Court in the City of
York, England, 1770.

Will of Will Jackett


This will was proved at Doctors’ Commons, London, on July 17, 1789,
and runs as follows:
“I give and bequeath,
When I’m laid underneath,
To my two loving sisters most dear,
The whole of my store,
Were it twice as much more,
Which God’s goodness has given me here.

“And that none may prevent


This my will and intent,
Or occasion the least of law-racket,
With a solemn appeal
I confirm, sign, and seal
This the true act and deed of Will Jackett.”

Mr. William Jackett, it appears, was a faithful and trustworthy as well as


a thrifty fellow, for he remained for thirty years in the service of Messrs.
Fuller and Vaughan as manager of their business. He resided in the parish of
St. Mary, Islington.

Will of an Irish Schoolmaster


The following is the will of Pat O’Kelly, an Irish schoolmaster, who
wrote, on the leaf of a copybook which he had just finished ruling (thus
exemplifying the ruling passion strong in death), the lines here transcribed:

“I, having neither kith nor kin,


Bequeath all I have named herein
To Harriet my dearest wife,
To have and hold as hers for life.
While in good health, and sound in mind,
This codicil I’ve undersigned.”

Rather Sacrilegious
The spirit of sacrilege is shown in an old quatrain to be found in the
books:
“In the name of God, Amen:
My featherbed to my wife, Jen;
Also my carpenter’s saw and hammer;
Until she marries; then, God damn her!”

Will of William Ruffell, Esq.


William Ruffell of Shimpling, Suffolk, England, was a gentleman of an
ancient and highly respectable family; he is said to have been a good
specimen of an old-fashioned gentleman farmer. His will, which was
written in 1803, is as follows:
“As this life must soon end, and my frame will decay,
And my soul to some far-distant clime wing its way,
Ere that time arrives, now I free am from cares,
I thus wish to settle my worldly affairs,
A course right and proper men of sense will agree.
I am now strong and hearty, my age forty-three;
I make this my last will, as I think ’tis quite time,
It conveys all I wish, though ’tis written in rhyme.
To employ an attorney I ne’er was inclin’d,
They are pests to society, sharks of mankind.
To avoid that base tribe my own will I now draw,
May I ever escape coming under their paw.
To Ezra Dalton, my nephew, I give all my land,
With the old Gothic cottage that thereon doth stand;
’Tis near Shimpling great road, in which I now dwell,
It looks like a chapel or hermit’s old cell,
With my furniture, plate, and linen likewise,
And securities, money, with what may arise.
’Tis my wish and desire that he should enjoy these,
And pray let him take even my skin, if he please.
To my loving, kind sister I give and bequeath,
For her tender regard, when this world I shall leave,
If she choose to accept it, my rump-bone may take,
And tip it with silver, a whistle to make.
My brother-in-law is a strange-tempered dog;
He’s as fierce as a tiger, in manners a hog;
A petty tyrant at home, his frowns how they dread;
Two ideas at once never entered his head.
So proud and so covetous, moreover so mean,
I dislike to look at him, the fellow is so lean.
He ne’er behaved well, and, though very unwilling,
Yet I feel that I must cut him off with a shilling.
My executors, too, should be men of good fame;
I appoint Edmund Ruffell, of Cockfield, by name
In his old easy chair, with short pipe and snuff,
What matter his whims, he is honest enough;
With Samuel Seely, of Alpheton Lion,
I like his strong beer, and his word can rely on.
When Death’s iron hand gives the last fatal blow,
And my shattered old frame in the dust must lie low,
Without funeral pomp let my remains be conveyed
To Brent Eleigh churchyard, near my father be laid.
Thi itt ith h d th b l
This, written with my own hand, there can be no appeal,
I now therefore at once set my hand and my seal,
As being my last will; I to this fully agree,
This eighteenth day of March, eighteen hundred and three.”

Two English Wills


The following is a copy of the will of the late Mr. Joshua West, of the
Six Clerks’ Office, Chancery Lane, dated December 13, 1804:

“Perhaps I died not worth a groat;


But should I die worth something more,
Then I give that, and my best coat,
And all my manuscripts in store,
To those who shall the goodness have
To cause my poor remains to rest
Within a decent shell and grave.
This is the will of Joshua West.
“Joshua West.

“Witnessed R. Mills.
J. A. Berry.
John Baines.”
Mr. West died possessed of property, and some valuable manuscripts,
which were conveyed by the above will.
The following will in rhyme was written by William Hunnis, a
gentleman of the chapel under Edward VI., and afterwards Chapel Master
to Queen Elizabeth:
“To God my soule I do bequeathe, because it is his owen,
My body to be layd in grave, where to my friends best knowen;
Executors I will none make, thereby great stryfe may grow,
Because the goods that I shall leave wyll not pay all I owe.”

Will of James Bigsby


The following is a curious testamentary paper of a North Essex laborer,
who resided at Manningtree, England:
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookmass.com

You might also like