100% found this document useful (5 votes)
135 views

[FREE PDF sample] Pro SQL Server 2019 Administration: A Guide for the Modern DBA Paperback Second Edition Peter Carter ebooks

SQL

Uploaded by

ooduntslamek38
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 (5 votes)
135 views

[FREE PDF sample] Pro SQL Server 2019 Administration: A Guide for the Modern DBA Paperback Second Edition Peter Carter ebooks

SQL

Uploaded by

ooduntslamek38
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/ 40

Get ebook downloads in full at ebookmeta.

com

Pro SQL Server 2019 Administration: A Guide for


the Modern DBA Paperback Second Edition Peter
Carter

https://ebookmeta.com/product/pro-sql-
server-2019-administration-a-guide-for-the-modern-dba-
paperback-second-edition-peter-carter/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Pro SQL Server 2022 Administration: A guide for the modern


DBA 3rd Edition Peter A. Carter

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

ebookmeta.com

Pro SQL Server 2019 Wait Statistics: A Practical Guide to


Analyzing Performance in SQL Server - Second Edition
Enrico Van De Laar
https://ebookmeta.com/product/pro-sql-server-2019-wait-statistics-a-
practical-guide-to-analyzing-performance-in-sql-server-second-edition-
enrico-van-de-laar/
ebookmeta.com

SQL Server 2019 AlwaysOn: Supporting 24x7 Applications


with Continuous Uptime 3rd Edition Peter A. Carter

https://ebookmeta.com/product/sql-server-2019-alwayson-
supporting-24x7-applications-with-continuous-uptime-3rd-edition-peter-
a-carter/
ebookmeta.com

Cybersecurity: Ambient Technologies, IoT, and Industry 4.0


Implications 1st Edition Gautam Kumar (Editor)

https://ebookmeta.com/product/cybersecurity-ambient-technologies-iot-
and-industry-4-0-implications-1st-edition-gautam-kumar-editor/

ebookmeta.com
Wireless and Satellite Systems: 12th EAI International
Conference, WiSATS 2021, Virtual Event, China, July 31 –
August 2, 2021, Proceedings (Lecture ... and
Telecommunications Engineering, 410) Qing Guo (Editor)
https://ebookmeta.com/product/wireless-and-satellite-systems-12th-eai-
international-conference-wisats-2021-virtual-event-china-
july-31-august-2-2021-proceedings-lecture-and-telecommunications-
engineering-410/
ebookmeta.com

Wanted Prince Charming A H Benjamin

https://ebookmeta.com/product/wanted-prince-charming-a-h-benjamin/

ebookmeta.com

The Political Lives of Saints Christian Muslim Mediation


in Egypt 1st Edition Angie Heo

https://ebookmeta.com/product/the-political-lives-of-saints-christian-
muslim-mediation-in-egypt-1st-edition-angie-heo/

ebookmeta.com

Phenomenological Perspectives on Place, Lifeworlds and


Lived Emplacement 1st Edition David Seamon

https://ebookmeta.com/product/phenomenological-perspectives-on-place-
lifeworlds-and-lived-emplacement-1st-edition-david-seamon/

ebookmeta.com

Personal Reflections on Counseling 1st Edition Gerald


Corey

https://ebookmeta.com/product/personal-reflections-on-counseling-1st-
edition-gerald-corey/

ebookmeta.com
Tarnished Lands Omnibus 1st Edition P A Wikoff

https://ebookmeta.com/product/tarnished-lands-omnibus-1st-edition-p-a-
wikoff/

ebookmeta.com
Pro
SQL Server 2019
Administration
A Guide for the Modern DBA

Second Edition

Peter A. Carter

www.allitebooks.com
Pro SQL Server 2019
Administration
A Guide for the Modern DBA
Second Edition

Peter A. Carter

www.allitebooks.com
Pro SQL Server 2019 Administration: A Guide for the Modern DBA
Peter A. Carter
SOUTHAMPTON, UK

ISBN-13 (pbk): 978-1-4842-5088-4 ISBN-13 (electronic): 978-1-4842-5089-1


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

Copyright © 2019 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 image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street,
6th Floor, New York, NY 10013. 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 [email protected], or visit http://www.apress.com/
rights-permissions.
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 via the book’s product page, located at www.apress.com/9781484250884. For more
detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper

www.allitebooks.com
This book is dedicated to Edward Carter.

www.allitebooks.com
Table of Contents
About the Author����������������������������������������������������������������������������������������������������xix

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


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

Introduction�����������������������������������������������������������������������������������������������������������xxv

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��������������������������������������������������������������������������������������������� 17
Configuring the Operating System���������������������������������������������������������������������������������������������� 18
Setting the Power Plan���������������������������������������������������������������������������������������������������������� 18
Optimizing for Background Services������������������������������������������������������������������������������������� 18
Assigning User Rights����������������������������������������������������������������������������������������������������������� 19
Selecting Features���������������������������������������������������������������������������������������������������������������������� 22
Database Engine Service������������������������������������������������������������������������������������������������������� 23
Analysis Services������������������������������������������������������������������������������������������������������������������ 24
Machine Learning Server������������������������������������������������������������������������������������������������������ 24
Data Quality Client����������������������������������������������������������������������������������������������������������������� 25
Client Connectivity Tools�������������������������������������������������������������������������������������������������������� 25
Integration Services�������������������������������������������������������������������������������������������������������������� 25
Client Tools Backward Compatibility������������������������������������������������������������������������������������� 25
Client Tools SDK��������������������������������������������������������������������������������������������������������������������� 26

www.allitebooks.com
Table of Contents

Distributed Replay Controller������������������������������������������������������������������������������������������������� 26


Distributed Replay Client������������������������������������������������������������������������������������������������������� 26
SQL Client Connectivity SDK�������������������������������������������������������������������������������������������������� 26
Master Data Services������������������������������������������������������������������������������������������������������������ 27
Summary������������������������������������������������������������������������������������������������������������������������������������ 27

Chapter 2: GUI Installation�������������������������������������������������������������������������������������� 29


Installation Center����������������������������������������������������������������������������������������������������������������������� 29
The Planning Tab������������������������������������������������������������������������������������������������������������������� 29
The Installation Tab���������������������������������������������������������������������������������������������������������������� 31
The Maintenance Tab������������������������������������������������������������������������������������������������������������ 32
The Tools Tab������������������������������������������������������������������������������������������������������������������������� 34
The Resources Tab���������������������������������������������������������������������������������������������������������������� 35
The Advanced Tab������������������������������������������������������������������������������������������������������������������ 36
The Options Tab��������������������������������������������������������������������������������������������������������������������� 39
Installing a Stand-Alone Database Engine Instance������������������������������������������������������������������� 39
Preparation Steps������������������������������������������������������������������������������������������������������������������ 40
The Feature Selection Page��������������������������������������������������������������������������������������������������� 45
The Instance Configuration Page������������������������������������������������������������������������������������������� 48
Selecting Service Accounts��������������������������������������������������������������������������������������������������� 50
Choosing the Collation����������������������������������������������������������������������������������������������������������� 53
Provisioning Instance Security���������������������������������������������������������������������������������������������� 59
Configuring the Instance������������������������������������������������������������������������������������������������������� 61
Configuring Distributed Replay���������������������������������������������������������������������������������������������� 67
Completing the Installation���������������������������������������������������������������������������������������������������� 68
Summary������������������������������������������������������������������������������������������������������������������������������������ 70

Chapter 3: Server Core Installation������������������������������������������������������������������������ 73


Installing an Instance������������������������������������������������������������������������������������������������������������������ 73
Required Parameters������������������������������������������������������������������������������������������������������������� 74
Role Parameter���������������������������������������������������������������������������������������������������������������������� 77
Basic Installation������������������������������������������������������������������������������������������������������������������� 77

vi
Table of Contents

Smoke Tests�������������������������������������������������������������������������������������������������������������������������� 79
Troubleshooting the Installation�������������������������������������������������������������������������������������������� 82
Optional Parameters�������������������������������������������������������������������������������������������������������������� 85
Product Update���������������������������������������������������������������������������������������������������������������������� 89
Using a Config File���������������������������������������������������������������������������������������������������������������������� 91
Automatic Installation Routines�������������������������������������������������������������������������������������������������� 95
Enhancing the Installation Routine���������������������������������������������������������������������������������������� 96
Production Readiness������������������������������������������������������������������������������������������������������������ 98
Summary���������������������������������������������������������������������������������������������������������������������������������� 100

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


Installing SQL Server on Linux�������������������������������������������������������������������������������������������������� 101
Installing SQL Server Manually�������������������������������������������������������������������������������������������� 102
Configuring SQL Server������������������������������������������������������������������������������������������������������� 105
Unattended Installation������������������������������������������������������������������������������������������������������� 108
Installing SQL Server in a Docker Container����������������������������������������������������������������������������� 111
Running a Microsoft-Supplied Docker Image���������������������������������������������������������������������� 111
Creating a Simple Docker Image for SQL Server����������������������������������������������������������������� 113
Creating a Configurable Docker Image for SQL Server�������������������������������������������������������� 119
Kubernetes Support������������������������������������������������������������������������������������������������������������� 125
Summary���������������������������������������������������������������������������������������������������������������������������������� 125

Chapter 5: Configuring the Instance��������������������������������������������������������������������� 127


Instance Configuration�������������������������������������������������������������������������������������������������������������� 127
Using sp_configure�������������������������������������������������������������������������������������������������������������� 127
Processor and Memory Configuration��������������������������������������������������������������������������������� 129
Trace Flags�������������������������������������������������������������������������������������������������������������������������� 141
Ports and Firewalls������������������������������������������������������������������������������������������������������������������� 146
Process of Communication�������������������������������������������������������������������������������������������������� 146
Ports Required by SQL Server��������������������������������������������������������������������������������������������� 148
Configuring the Port That the Instance Will Listen On��������������������������������������������������������� 149

vii
Table of Contents

System Databases�������������������������������������������������������������������������������������������������������������������� 152


mssqlsystemresource (Resource)��������������������������������������������������������������������������������������� 152
MSDB����������������������������������������������������������������������������������������������������������������������������������� 153
Master��������������������������������������������������������������������������������������������������������������������������������� 153
Model����������������������������������������������������������������������������������������������������������������������������������� 154
TempDB������������������������������������������������������������������������������������������������������������������������������� 154
Buffer Pool Extension���������������������������������������������������������������������������������������������������������������� 159
Hybrid Buffer Pool��������������������������������������������������������������������������������������������������������������������� 161
Summary���������������������������������������������������������������������������������������������������������������������������������� 162

Part II: Database Administration���������������������������������������������������������������� 163


Chapter 6: Database Configuration����������������������������������������������������������������������� 165
Data Storage����������������������������������������������������������������������������������������������������������������������������� 165
Filegroups���������������������������������������������������������������������������������������������������������������������������� 166
FILESTREAM Filegroups������������������������������������������������������������������������������������������������������ 170
Memory-Optimized Filegroups�������������������������������������������������������������������������������������������� 177
Strategies for Structured Filegroups����������������������������������������������������������������������������������� 180
Strategies for Memory-Optimized Filegroups��������������������������������������������������������������������� 182
File and Filegroup Maintenance������������������������������������������������������������������������������������������������ 183
Adding Files������������������������������������������������������������������������������������������������������������������������� 183
Expanding Files������������������������������������������������������������������������������������������������������������������� 186
Shrinking Files��������������������������������������������������������������������������������������������������������������������� 187
Database Scoped Configurations���������������������������������������������������������������������������������������������� 190
Log Maintenance���������������������������������������������������������������������������������������������������������������������� 191
Recovery Model������������������������������������������������������������������������������������������������������������������� 192
Log File Count���������������������������������������������������������������������������������������������������������������������� 193
Shrinking the Log���������������������������������������������������������������������������������������������������������������� 194
Log Fragmentation�������������������������������������������������������������������������������������������������������������� 195
Summary���������������������������������������������������������������������������������������������������������������������������������� 202

viii
Table of Contents

Chapter 7: Table Optimizations����������������������������������������������������������������������������� 205


Table Partitioning���������������������������������������������������������������������������������������������������������������������� 205
Partitioning Concepts���������������������������������������������������������������������������������������������������������� 206
Implementing Partitioning��������������������������������������������������������������������������������������������������� 209
Monitoring Partitioned Tables���������������������������������������������������������������������������������������������� 216
Sliding Windows������������������������������������������������������������������������������������������������������������������ 218
Partition Elimination������������������������������������������������������������������������������������������������������������ 221
Table Compression�������������������������������������������������������������������������������������������������������������������� 223
Row Compression���������������������������������������������������������������������������������������������������������������� 224
Page Compression��������������������������������������������������������������������������������������������������������������� 225
Columnstore Compression�������������������������������������������������������������������������������������������������� 227
Implementing Compression������������������������������������������������������������������������������������������������� 228
Memory-Optimized Tables�������������������������������������������������������������������������������������������������������� 232
Durability����������������������������������������������������������������������������������������������������������������������������� 233
Creating and Managing Memory-Optimized Tables������������������������������������������������������������� 233
Performance Profile������������������������������������������������������������������������������������������������������������� 236
Table Memory Optimization Advisor������������������������������������������������������������������������������������ 240
Natively Compiled Objects��������������������������������������������������������������������������������������������������� 241
Summary���������������������������������������������������������������������������������������������������������������������������������� 244

Chapter 8: Indexes and Statistics������������������������������������������������������������������������� 245


Clustered Indexes��������������������������������������������������������������������������������������������������������������������� 245
Tables Without a Clustered Index���������������������������������������������������������������������������������������� 246
Tables with a Clustered Index���������������������������������������������������������������������������������������������� 247
Clustering the Primary Key�������������������������������������������������������������������������������������������������� 248
Administering Clustered Indexes����������������������������������������������������������������������������������������� 249
Nonclustered Indexes��������������������������������������������������������������������������������������������������������������� 253
Covering Indexes����������������������������������������������������������������������������������������������������������������� 254
Administering Nonclustered Indexes����������������������������������������������������������������������������������� 255
Filtered Indexes������������������������������������������������������������������������������������������������������������������� 260

ix
Table of Contents

Indexes for Specialized Application������������������������������������������������������������������������������������������ 261


Columnstore Indexes����������������������������������������������������������������������������������������������������������� 261
Clustered Columnstore Indexes������������������������������������������������������������������������������������������� 263
Nonclustered Columnstore Indexes������������������������������������������������������������������������������������� 265
In-Memory Indexes�������������������������������������������������������������������������������������������������������������� 266
Maintaining Indexes������������������������������������������������������������������������������������������������������������������ 272
Missing Indexes������������������������������������������������������������������������������������������������������������������� 273
Index Fragmentation������������������������������������������������������������������������������������������������������������ 275
Resumable Index Operations����������������������������������������������������������������������������������������������� 280
Partitioned Indexes�������������������������������������������������������������������������������������������������������������� 283
Statistics����������������������������������������������������������������������������������������������������������������������������������� 284
Filtered Statistics����������������������������������������������������������������������������������������������������������������� 286
Incremental Statistics���������������������������������������������������������������������������������������������������������� 287
Managing Statistics������������������������������������������������������������������������������������������������������������������ 287
Summary���������������������������������������������������������������������������������������������������������������������������������� 290

Chapter 9: Database Consistency������������������������������������������������������������������������� 293


Consistency Errors�������������������������������������������������������������������������������������������������������������������� 293
Understand Consistency Errors������������������������������������������������������������������������������������������� 293
Detecting Consistency Errors���������������������������������������������������������������������������������������������� 295
System Database Corruption����������������������������������������������������������������������������������������������� 304
DBCC CHECKDB������������������������������������������������������������������������������������������������������������������������� 308
Checking for Errors�������������������������������������������������������������������������������������������������������������� 308
Fixing Errors������������������������������������������������������������������������������������������������������������������������ 313
Emergency Mode����������������������������������������������������������������������������������������������������������������� 315
Other DBCC Commands for Corruption�������������������������������������������������������������������������������� 318
Consistency Checks on VLDBs�������������������������������������������������������������������������������������������������� 323
DBCC CHECKDB with PHYSICAL_ONLY�������������������������������������������������������������������������������� 324
Backing Up WITH CHECKSUM and DBCC CHECKALLOC������������������������������������������������������� 324
Splitting the Workload��������������������������������������������������������������������������������������������������������� 324
Offloading to a Secondary Server���������������������������������������������������������������������������������������� 325
Summary���������������������������������������������������������������������������������������������������������������������������������� 325

x
Table of Contents

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


Chapter 10: SQL Server Security Model���������������������������������������������������������������� 329
Security Hierarchy��������������������������������������������������������������������������������������������������������������������� 329
Implementing Instance-Level Security������������������������������������������������������������������������������������� 332
Server Roles������������������������������������������������������������������������������������������������������������������������ 334
Logins���������������������������������������������������������������������������������������������������������������������������������� 337
Granting Permissions���������������������������������������������������������������������������������������������������������� 340
Implementing Database-Level Security������������������������������������������������������������������������������������ 341
Database Roles�������������������������������������������������������������������������������������������������������������������� 341
Schemas������������������������������������������������������������������������������������������������������������������������������ 345
Creating and Managing Contained Users���������������������������������������������������������������������������� 348
Implementing Object-Level Security����������������������������������������������������������������������������������������� 351
Server Audit������������������������������������������������������������������������������������������������������������������������������ 352
Creating a Server Audit������������������������������������������������������������������������������������������������������� 353
Creating a Server Audit Specification���������������������������������������������������������������������������������� 356
Enabling and Invoking Audits���������������������������������������������������������������������������������������������� 358
Database Audit Specifications��������������������������������������������������������������������������������������������� 359
Auditing the Audit���������������������������������������������������������������������������������������������������������������� 364
Security Reports����������������������������������������������������������������������������������������������������������������������� 365
SQL Data Discovery and Classification�������������������������������������������������������������������������������� 365
Vulnerability Assessment���������������������������������������������������������������������������������������������������� 367
Summary���������������������������������������������������������������������������������������������������������������������������������� 369

Chapter 11: Encryption����������������������������������������������������������������������������������������� 371


Encryption Hierarchy����������������������������������������������������������������������������������������������������������������� 371
Encryption Concepts������������������������������������������������������������������������������������������������������������ 371
SQL Server Encryption Concepts����������������������������������������������������������������������������������������� 372
Transparent Data Encryption����������������������������������������������������������������������������������������������������� 377
Implementing TDE��������������������������������������������������������������������������������������������������������������� 378
Managing TDE���������������������������������������������������������������������������������������������������������������������� 384

xi
Table of Contents

Managing Cell-Level Encryption����������������������������������������������������������������������������������������������� 386


Accessing Encrypted Data��������������������������������������������������������������������������������������������������� 391
Always Encrypted��������������������������������������������������������������������������������������������������������������������� 392
Implementing Always Encrypted����������������������������������������������������������������������������������������� 394
Administering Keys�������������������������������������������������������������������������������������������������������������� 403
Summary���������������������������������������������������������������������������������������������������������������������������������� 407

Chapter 12: Backups and Restores���������������������������������������������������������������������� 409


Backup Fundamentals�������������������������������������������������������������������������������������������������������������� 409
Recovery Models����������������������������������������������������������������������������������������������������������������� 409
Changing the Recovery Model��������������������������������������������������������������������������������������������� 412
Backup Types����������������������������������������������������������������������������������������������������������������������� 415
Backup Media���������������������������������������������������������������������������������������������������������������������� 416
Backup Strategies��������������������������������������������������������������������������������������������������������������������� 418
Full Backup Only������������������������������������������������������������������������������������������������������������������ 419
Full and Transaction Log Backups��������������������������������������������������������������������������������������� 419
Full, Differential, and Transaction Log Backups������������������������������������������������������������������� 420
Filegroup Backups��������������������������������������������������������������������������������������������������������������� 420
Partial Backup��������������������������������������������������������������������������������������������������������������������� 421
Backing Up a Database������������������������������������������������������������������������������������������������������������� 421
Backing Up in SQL Server Management Studio������������������������������������������������������������������ 421
Backing Up via T-SQL���������������������������������������������������������������������������������������������������������� 424
Restoring a Database���������������������������������������������������������������������������������������������������������������� 431
Restoring in SQL Server Management Studio��������������������������������������������������������������������� 431
Restoring via T-SQL������������������������������������������������������������������������������������������������������������� 436
Restoring to a Point in Time������������������������������������������������������������������������������������������������������ 441
Restoring Files and Pages�������������������������������������������������������������������������������������������������������� 445
Restoring a File������������������������������������������������������������������������������������������������������������������� 446
Restoring a Page����������������������������������������������������������������������������������������������������������������� 448
Piecemeal Restores������������������������������������������������������������������������������������������������������������������ 451
Summary���������������������������������������������������������������������������������������������������������������������������������� 454

xii
Table of Contents

Chapter 13: High Availability and Disaster Recovery Concepts��������������������������� 457


Availability Concepts����������������������������������������������������������������������������������������������������������������� 458
Level of Availability�������������������������������������������������������������������������������������������������������������� 458
Recovery Point Objective and Recovery Time Objective������������������������������������������������������ 461
Cost of Downtime���������������������������������������������������������������������������������������������������������������� 462
Classification of Standby Servers���������������������������������������������������������������������������������������� 463
High Availability and Recovery Technologies���������������������������������������������������������������������������� 464
AlwaysOn Failover Clustering���������������������������������������������������������������������������������������������� 464
AlwaysOn Availability Groups���������������������������������������������������������������������������������������������� 471
Log Shipping������������������������������������������������������������������������������������������������������������������������ 477
Combining Technologies������������������������������������������������������������������������������������������������������ 480
Summary���������������������������������������������������������������������������������������������������������������������������������� 483

Chapter 14: Implementing AlwaysOn Availability Groups������������������������������������ 485


Implementing AlwaysOn Availability Groups����������������������������������������������������������������������������� 486
Configuring SQL Server������������������������������������������������������������������������������������������������������� 492
Creating the Availability Group�������������������������������������������������������������������������������������������� 494
Availability Groups on Linux������������������������������������������������������������������������������������������������������ 508
Distributed Availability Groups�������������������������������������������������������������������������������������������������� 515
Managing AlwaysOn Availability Groups����������������������������������������������������������������������������������� 518
Failover�������������������������������������������������������������������������������������������������������������������������������� 518
Synchronizing Uncontained Objects������������������������������������������������������������������������������������ 524
Monitoring��������������������������������������������������������������������������������������������������������������������������� 525
Other Administrative Considerations����������������������������������������������������������������������������������� 528
Summary���������������������������������������������������������������������������������������������������������������������������������� 530

Chapter 15: Implementing Log Shipping�������������������������������������������������������������� 533


Implementing Log Shipping for DR������������������������������������������������������������������������������������������� 533
GUI Configuration����������������������������������������������������������������������������������������������������������������� 536
T-SQL Configuration������������������������������������������������������������������������������������������������������������� 546

xiii
Table of Contents

Log Shipping Maintenance������������������������������������������������������������������������������������������������������� 557


Failing Over Log Shipping���������������������������������������������������������������������������������������������������� 557
Switching Roles������������������������������������������������������������������������������������������������������������������� 558
Monitoring��������������������������������������������������������������������������������������������������������������������������� 564
Summary���������������������������������������������������������������������������������������������������������������������������������� 566

Chapter 16: Scaling Workloads���������������������������������������������������������������������������� 569


Database Snapshots����������������������������������������������������������������������������������������������������������������� 569
Implementing Database Snapshots������������������������������������������������������������������������������������� 572
Recovering Data from a Snapshot��������������������������������������������������������������������������������������� 576
Replication�������������������������������������������������������������������������������������������������������������������������������� 577
Replication Concepts����������������������������������������������������������������������������������������������������������� 577
Types of Replication������������������������������������������������������������������������������������������������������������ 579
Implementing Transactional Replication������������������������������������������������������������������������������ 582
Adding AlwaysOn Readable Secondary Replicas���������������������������������������������������������������������� 607
Benefits and Considerations������������������������������������������������������������������������������������������������ 608
Implementing Readable Secondaries���������������������������������������������������������������������������������� 608
Summary���������������������������������������������������������������������������������������������������������������������������������� 618

Part IV: Performance and Maintenance������������������������������������������������������ 621


Chapter 17: SQL Server Metadata������������������������������������������������������������������������� 623
Introducing Metadata Objects��������������������������������������������������������������������������������������������������� 623
Server-Level and Instance-Level Metadata������������������������������������������������������������������������������ 626
Exposing Registry Values���������������������������������������������������������������������������������������������������� 627
Exposing Service Details����������������������������������������������������������������������������������������������������� 628
Analyzing Buffer Cache Usage�������������������������������������������������������������������������������������������� 629
Metadata for Capacity Planning������������������������������������������������������������������������������������������������ 631
Exposing File Stats�������������������������������������������������������������������������������������������������������������� 631
Using File Stats for Capacity Analysis��������������������������������������������������������������������������������� 635
Metadata for Troubleshooting and Performance Tuning����������������������������������������������������������� 639
Retrieving Perfmon Counters���������������������������������������������������������������������������������������������� 639
Analyzing Waits������������������������������������������������������������������������������������������������������������������� 644

xiv
Table of Contents

Database Metadata������������������������������������������������������������������������������������������������������������������� 647


Metadata-Driven Automation���������������������������������������������������������������������������������������������������� 652
Dynamically Cycling Database Snapshots��������������������������������������������������������������������������� 652
Rebuilding Only Fragmented Indexes���������������������������������������������������������������������������������� 655
Summary���������������������������������������������������������������������������������������������������������������������������������� 657

Chapter 18: Locking and Blocking������������������������������������������������������������������������ 659


Understanding Locking������������������������������������������������������������������������������������������������������������� 659
Lock Granularity������������������������������������������������������������������������������������������������������������������ 659
Locking Behaviors for Online Maintenance������������������������������������������������������������������������� 661
Lock Compatibility��������������������������������������������������������������������������������������������������������������� 666
Lock Partitioning������������������������������������������������������������������������������������������������������������������ 667
Understanding Deadlocks��������������������������������������������������������������������������������������������������������� 668
How Deadlocks Occur��������������������������������������������������������������������������������������������������������� 668
Minimizing Deadlocks��������������������������������������������������������������������������������������������������������� 670
Understanding Transactions������������������������������������������������������������������������������������������������������ 670
Transactional Properties������������������������������������������������������������������������������������������������������ 671
Transaction with In-Memory OLTP�������������������������������������������������������������������������������������������� 681
Isolation Levels�������������������������������������������������������������������������������������������������������������������� 682
Cross-Container Transactions���������������������������������������������������������������������������������������������� 684
Retry Logic�������������������������������������������������������������������������������������������������������������������������� 686
Observing Transactions, Locks, and Deadlocks������������������������������������������������������������������������ 687
Observing Transactions������������������������������������������������������������������������������������������������������� 687
Observing Locks and Contention����������������������������������������������������������������������������������������� 691
Observing Deadlocks����������������������������������������������������������������������������������������������������������� 695
Summary���������������������������������������������������������������������������������������������������������������������������������� 696

Chapter 19: Extended Events�������������������������������������������������������������������������������� 699


Extended Events Concepts�������������������������������������������������������������������������������������������������������� 699
Packages����������������������������������������������������������������������������������������������������������������������������� 700
Events���������������������������������������������������������������������������������������������������������������������������������� 700
Targets��������������������������������������������������������������������������������������������������������������������������������� 701

xv
Other documents randomly have
different content
Once or twice during the night Terence awoke and sat up, listening to the
extraordinary clamour of wind and rain, in which, it seemed to him, a
multitude of tongues spoke softly, and the faint pad-pad of naked feet made
itself manifest. But the noise of the elements confused him, and it was not
until breakfast-time next morning that he mentioned his fancies to George,
who looked uncommonly grave as he listened.

'Let us go and find out if anything did happen,' he suggested as they rose
from their meal; for he was oppressed by an uncomfortable feeling that
trouble was in store for them. His presentiment presently grew stronger, for,
as they walked towards the marae, or open courtyard of the pah, the unusual
quiet of the long lanes surprised them, for the inhabitants were early astir as
a rule.

The court itself was deserted, save for two old men, who sat upon a seat
opposite to the open gates. George looked down upon the plain, where a
company of women and children could be seen returning from the bush
across the river. In anxious haste he turned to one of the old men.

'Where is everybody, O my father?' he inquired. 'Where is Te Karearea?'

The old Maori shook his head and showed his toothless gums. 'Nay; he is
not here, Hortoni. He is gone to fight the Pakeha.'

'Gone to fight the Pakeha!' echoed George. He looked down again. A


band of armed Maoris had issued from the bush and were crossing the river
bridge. 'Is that the Hawk returning?' he asked. 'Wake up, old man!' He gently
shook the ancient. 'Is it the Hawk who flies hither?'

The old fellow blinked drowsily in the warm sun. 'Nay; Te Karearea is
gone to drive the Pakeha into Moana. Who knows when he will return? Let
me slumber, Hortoni.'

George wheeled round upon Terence. 'The crafty rascal!' he cried


wrathfully. 'I see it all now. It was the noise of his departure that you heard in
the night, Terence. Well might he scheme that we should bind ourselves fast
with our own words. Oh, if you had but woke me! But now we have
promised, and——' He shook his fist in the direction of the bush. 'Terence,
we have been properly fooled. We are caught in a trap of our own making.'

'A parole extorted by such a piece of treachery can hardly be considered


binding,' objected Terence.

'Oh, we will keep our word, if only to shame him, if that were possible.
But let the subtle Hawk look out for himself when we do take back our
parole.'

'And may I be there to see,' finished Terence, taking his friend's arm. 'Let
us go to meet those people and learn the news.'

CHAPTER XVIII

PAEROA AT LAST

As the comrades encountered the returning warriors, who had been left as
a garrison, their leader, a young chief named Rolling Thunder, called out:
'Salutations, Hortoni! The Pakeha Eagle takes an early flight; but he is too
late to catch the Hawk, who has gone to flesh his beak and talons.'

'He will meet with a few more eagles who will make small account of his
beak and talons,' answered George grimly. 'When does he wing his way back
to his eyrie? I mean, if he ever gets the chance.'

'Not until he has scattered the fragments of the last Pakeha to the four
winds,' replied Rolling Thunder proudly, and marched off in high dudgeon at
their shouts of derisive laughter.

Just then Terence caught sight of a solitary figure disappearing into the
bush. He recognised the man as a tutua, or common fellow, named Sounding
Sea, one of the meanest and least considered Maoris in the pah, whose sly
face, destitute of scars, showed him either a coward, or singularly to have
lacked opportunity to gain the right to heraldic distinctions. Just then,
however, there was nothing out of the way in the fellow's behaviour, so
Terence thought no more about him.

'It is still very early, and I vote for exploration,' he said to George. Then
he drummed idly on the rail of the bridge, gazed down into the rushing
stream and sighed. Presently he looked up at his friend and smiled rather
wistfully. 'I was thinking. Bad habit; isn't it, old fellow? Come; make up
your mind what to do.'

'Exploration be it,' agreed George. 'Let us look for the hole into which
you so gallantly dived. Like Quintus Curtius, it may yet prove that you took
that plunge for the good of your country.'

He spoke lightly, knowing well what was passing in Terence's mind. By


tacit consent they seldom referred to home or friends, finding the subject too
painful. Terence had no near relations except his mother's sister, to whom he
was devoted; but his affection for the Haughton circle was almost as deep as
that of George, and the peppery colonel and his fine little brother-in-law held
a very warm place in his heart. Many a silent prayer went up for their own
preservation and for those they loved; for these two were brave and loyal
lads, who had not learned to forget God, and were not ashamed to show that
they maintained their trust in Him.

They easily found the hill upon which the Hau-hau rites had been
celebrated, but though they over and over again made it their base of
operations, failure met them at each attempt to discover the entrance to the
underground world.

'We shall never find it,' said George; 'for even in this short time the
undergrowth has covered the mouth of the hole. We must try from the other
end; but if we lose ourselves——'

'We can't—with this,' interposed Terence, holding up a small, but perfect


compass, made by one of England's foremost opticians. 'I stole this from the
stealers, who were examining the contents of a looted saddle-bag. The
compass had fallen to the ground unnoticed, and, as my feet are adapted to
cover much bigger things, I calmly stood over it until I got a chance to annex
it.'

'Your petty larceny is condoned by the court,' laughed George. 'I wish you
could put your foot upon a couple of good revolvers.'

'Don't move,' Terence said quickly. 'Look to your right—three or four


hundred yards away—without appearing to do so. There is a Maori watching
us.'

George looked and laughed again. Apparently there were half a dozen
Maoris, squatting upon the ground at irregular intervals, their long spears
held erect, their mats hanging down so as to conceal their bodies.

'You are looking at a row of grass-trees,' George explained. 'You are not
the first to mistake a grass-tree at a distance for a squatting native.'

'I did not say they were Maoris,' Terence replied coolly. 'There were six
grass-trees when I first noticed them, and now there appear to be seven. Aha!
Look, George. Number seven is crawling off. It is our friend Sounding Sea,
who has been spying on us. I saw him dodging into the bush this morning,
and now that I am sure of his game, I may tell you that I have suspected him
for a week past.'

'What keen eyes you have to pick the fellow out,' said George admiringly.
'In certain lights, and at a distance, the illusion of the grass-tree is perfect. It
is as well, perhaps, that we failed to find the hole, since that rascal is on our
track.'

'Well, we know where we stand now,' observed Terence, 'and the gay
Sounding Sea will find that two can play the game of spying. We will look
for Paeroa to-morrow in spite of him.'

Late next night the friends crept out of their whare, which stood near the
back of the stockade, and searched for four hours in the underground world;
but they found no trace of the missing trio.

'We must get back before dawn,' said George; 'for Sounding Sea may take
it into his head to pay us an earlier visit than usual. I don't think that Paeroa
is hidden down here. The existence of the place is known only to the
privileged few, so there would be no occasion to confine him far from the
entrance.'

'Besides, I fancy that both the chief and the wizard would fight shy of the
spot after their uncanny experience.' Terence chuckled at the recollection.
'Yes; come on. We can't afford to take risks.'

Thrice they unsuccessfully explored the underground reaches during the


next fortnight; twice they tried, and failed, to find the forest opening; and
then, suddenly, the face of the situation began to alter.

It was now three weeks since Te Karearea had set out for the front, and
sick or wounded Maoris were constantly filtering into the pah, one and all
with the same story to tell—the continued success of the chief, and the
impending annihilation of the detested Pakeha. The worst news they brought
was that of the death of old Kapua Mangu, who had been shot while
weaving a spell for the destruction of the Arawas. His head had been brought
back to the pah, and was now in the hands of the gentleman whose business
it was to preserve the grisly relic.

One night George entered their hut in a state of great agitation. His face
was pale and his eyes glittered; but for some time he sat silent, while Terence
watched him anxiously.

'Anything wrong, old fellow?' he inquired at last.

'Wrong! wrong! Ay; it is all wrong together,' burst out George. 'A devil is
loose upon the earth, and his name is Te Karearea. He—he——' His voice
faltered, and he stopped for a moment. Then, ominously calm all at once, he
resumed: 'News has come that Te Karearea and a company of his Hau-haus
stole upon the settlement at Poverty Bay at night and massacred—there's no
other word for it, for the poor people were quite unprepared—thirty-three
people. And, Terence'—he covered his eyes with his hand—'there were
women and little children among them. Your friend Major Biggs was killed,
and——' He could say no more.
For a time the two sat without further speech. They felt sick with horror;
for the picture of those helpless, anguished mothers and their babes would
obtrude itself. But at last George sprang up and shook his great shoulders, as
if throwing off some fearful oppression.

'Terence,' he said quietly, 'till now, in spite of what I knew him to be


capable of, I have had a sneaking sympathy with this ruffian, with his
misfortunes, with his aspirations. I knew that his point of view must be
different from ours. I was inclined to make allowances. But now—now——'

'I know,' Terence said in a low voice. 'It is—it is those babies.'

George's strong teeth seemed to snap together. 'Yes; and he shall answer
for them to me.' Then he went out into the night.

Next day, as they were sitting in the marae, a wounded Maori came up
and said, grinning: 'Pokeke fights at the side of Te Karearea, and he
constantly mutters "The great axe of Heora." He bade me tell you this,
Hortoni.'

George laughed contemptuously. 'This Heora is, I believe, one of their


mythical heroes,' he explained to Terence. 'When a Maori frequently repeats
the words "The great axe of Heora," he means that he is keeping his mind
fast set upon revenge. Well, this settles the locality of one of our trio.'

'Yes; and it shows the value of any statement made by Te Karearea,' put
in Terence. 'Now I have a piece of news,' he went on. 'I have discovered
something very queer about Sounding Sea.'

'What is it?' George asked, interested at once.

'About the same time every night he sneaks past our hut—his own is
almost opposite—towards the back of the pah. I followed him last night, and
he climbed the fence and dropped down on the narrow ledge between the
palisades and the edge of the precipice.'

'Go on,' urged George.


'I was close behind him; yet, when I looked over, he had disappeared. The
ledge runs about fifteen feet on each side of the point where he scaled the
fence, which touches the edge of the cliff at the angles. So, as he could not
have gone round, he must have gone over.'

'And what are you going to do?'

'We will both follow him to-night after his visit.'

Under pretence that he had been detailed by Te Karearea to see to their


comfort, Sounding Sea came to their hut at bed-time every night. This night
was no exception, for his sly face peered round the door, and he inquired,
humbly enough, if the Pakeha lords desired his services.

To throw him off his guard, George ordered him to bring a basket of food,
as they proposed to go for an early ramble in the bush on the morrow. When
the Maori returned with this, the friends were snoring on their mats; so he
placed it in a corner and withdrew, satisfied.

Five minutes later Terence stole across to Sounding Sea's whare, and
returned almost immediately. 'There,' he said, with a gleeful chuckle, and
thrust a revolver and a handful of cartridges upon his astonished friend.

'Kapua Mangu's mantle must have fallen on you, you magician,' cried
George, overjoyed. 'Where—how——?'

'It occurred to me that Sounding Sea, not being very courageous, would
have made provision for defending himself in case of a row with us,'
explained Terence; 'so I went to see. The fellow has a regular arsenal there. I
have brought away three revolvers and any number of cartridges.' He hid one
of them under his mat, along with a reserve of ammunition. Then, having
loaded their weapons, the friends stole out on the track of the spy.

In a few minutes they stood upon the three-foot ledge outside the pah,
where a pale, watery moon gave them light enough to see what they were
about. And this was as well; for movement, at the best, was dangerous, and a
slip might have been fatal.
'I thought as much,' exclaimed Terence, after poking about in the grass.
'This explains our gentleman's nocturnal trips, and I shouldn't wonder if we
were on the track of Paeroa.'

Lying on their faces, peering into the awful depths of the cañon, they
could see a strong flax ladder, securely fastened to a couple of stout pegs,
driven into the ground between them. By means of a gentle tug they
ascertained that the lower end of the ladder was free, and, before George
could anticipate him, Terence swung himself over.

'I'll jerk three times when I reach the bottom,' he said. 'Steady the thing
for me.'

Presently the signal came, and George joined his friend, who was
standing upon a narrow ledge about fifty feet below. 'Here we are,' said
Terence in greeting. 'This ledge runs in both directions. Ah, this is the way.
Look.'

A tangle of creepers, recently disturbed, guided them, and they moved


cautiously along the ledge, which sloped very gradually downwards, until
they stood some twenty feet above the river, in full view of a fine waterfall.
Thereafter was nothing but sheer cliff to the broken water below. Then while
they looked about, puzzled, Terence suddenly dragged George down behind
a shrub, and they saw a wondrous sight.

From out of the waterfall itself, right through the veil of falling water,
came Sounding Sea, shaking himself like a dog after a plunge. He climbed
upon the ledge, took a step or two upon the back track, and then, with a
gesture of annoyance, turned again and walked out of sight through, or
under, the fall.

'He has forgotten something,' said Terence. 'After him!'

Careless of risk, they passed the falling curtain and hurried on the track of
Sounding Sea, who was moving slowly through a natural tunnel, the mouth
of which gaped blackly at his pursuers. Had the Maori not lit a torch the
comrades could have done nothing but await his return.
Suddenly Terence swung back an arm and barred George's advance, for
the tunnel took a turn, widening into a cave. Peering round the angle, they
saw Sounding Sea, his torch set down, searching for something he appeared
to have dropped.
The tunnel took a turn, widening into a cave (page 194).

But there was something else. Something which brought George's teeth
together with a click, and caused Terence to clench his fists.
Stretched upon a mat, his wrists and ankles bound, and further secured by
a rope round his middle, which was attached to an iron bar let into the floor
of the cave, lay Paeroa, while a few feet from him was Kawainga, much in
the same case, save that her feet were free.

Even in that light it could be seen that the unhappy pair looked miserably
weak and ill, though scraps of food and a bowl of water showed that
starvation had not been added to their other tortures.

Terence felt the arm he held quivering in his grip. Indeed, George
restrained himself with difficulty; for the sight of the poor sufferers set his
blood aflame, and another black mark was added to the long tally against Te
Karearea.

Just then Sounding Sea spoke. 'Where is my mere, O Paeroa? It was in


my belt when I fed you.' He made a dive and drew a wooden mere from the
folds of the scanty mat upon which Paeroa lay. 'Pig!' he vociferated. 'Would
you steal my club? Were it not that Te Karearea ordered me to keep you
alive, I would dash out your traitor's brains. As it is—take this!'

He raised his heavy, sharp-angled club, dwelling upon his aim for the
downstroke, which would have smashed the shoulder-girdle and left the arm
useless for all time, when with a low growl of rage George leaped across the
intervening space and flung himself upon the cowardly ruffian.

CHAPTER XIX

PAEROA'S VENGEANCE

So utterly unexpected was the attack, that Sounding Sea went down with
a yell of terror; but, quickly recognising his adversary, he began to wriggle
and twist, clawing and spitting like an angry cat. But he could do nothing
against such a stalwart as George, and Terence, confident of this, busied
himself in cutting the bonds of the captives and gently chafing their swollen
joints, while he smiled into their wan faces, and spoke hopefully in a
language they did not understand of the good time coming for them.

But hope is translatable into any tongue, and, as Terence chatted on, the
dull eyes brightened and a responsive grin overspread Paeroa's drawn face,
while Kawainga's lips quivered, and she burst into happy, soothing tears.

This was too much for Terence. His alluring smile vanished, and he rose
and solemnly punched the head of Sounding Sea. 'I don't often hit a man
when he is down,' he remarked, returning to his patients; 'but you deserve a
taste of your own sauce.'

'Quite right,' agreed George. 'Wait here, Terence, while I get my flask.
When I return, we can settle what to do.'

He was back in a very short time, and the flask, which he had not opened
since he left Sydney, came in usefully now; for the strong spirit, dashed with
water, soon restored Paeroa and Kawainga, who sat up and began to talk.

'I did what I could, Hortoni,' Paeroa said sadly. 'Had you met me by the
fork that day all would have been well. As it is, I have still one word of the
white-haired chief to you. Te Karearea took the other. Here it is.'

Like all the Hau-haus, he wore his hair long, and now he pulled from the
tangled locks a soiled piece of paper, which he held out to George, who took
it and read aloud:

'We ar~ on your t~ack. Try ~~~~~~scape ~nd meet us. Y~~rs—M.
Cra~sto~n.'

Here and there the pencilled letters were obliterated; but the meaning was
clear enough. The question was—had Te Karearea driven back, or
annihilated the relief force? And this, of course, Paeroa could not tell.

'I wonder what was in the note which Te Karearea took,' said George.

'Paeroa has made a mistake,' commented Terence. 'Colonel Cranstoun is


not white-haired, unless he has changed since I saw him.'
'Well, there is no use worrying over a mistake,' said George.

'Oh, of course not,' agreed Terence, looking curiously at his friend. He


had his own idea as to the identity of the writer of the missing note, and
thought that George's ignorance was bliss, in so far as it saved him from
much anxiety.

Briefly, Paeroa's story was that, on the march to rejoin the main body, he
had stolen away at the risk of his life, worked round to the rear of the Arawa
contingent, and presented himself at the British camp, where he found
Colonel Cranstoun and others, to whom he told the story of George's
adventures as far as he knew them. He was ignorant of the capture of
Terence, so he could not remove the impression which existed that the
Irishman had been killed while endeavouring to deliver Captain Westrupp's
note. Promising to do all he could for George, Paeroa departed with two
short letters in his care. He failed, as we know, to communicate with George
on the day of the fight with the Arawas; but, just before the skirmish, while
plotting with Kawainga to deliver the letters unobserved, the two were
suddenly overpowered by a strong guard of Hau-haus, and conveyed to the
pah. There they were kept in close confinement, and eventually transferred
to the cave under the waterfall, Sounding Sea being appointed their gaoler.
The mean and vicious Hau-hau had amplified the chief's instructions, and
gratified his own malevolent nature by inflicting upon the prisoners as many
hardships as he dared, short of actually murdering them, so that their
existence since the departure of Te Karearea had been wretched indeed.

'What is to be done now?' queried George, when Paeroa's story had come
to an end.

Terence drew his revolver and turned to face Sounding Sea. 'Let him
know, George,' he said grimly, 'that, unless he tells the whole truth, there will
be a new arrival in Reinga within a minute.'

'Stop!' shrieked Sounding Sea in English. 'I will tell all. I was to keep
these two here until Te Karearea's return. I have cared for them and fed
them. Mercy, great lords!'
'We shall soon find out whether he has told the truth,' said George
gravely. 'We must leave him here, of course—and you two must also be
content to wait here a little longer.'

Paeroa stood up shakily, endeavouring to throw out his chest. 'Hope is a


good medicine,' he said bravely. 'By the time Hortoni needs my arm it will
be strong enough to strike a blow for him.'

As he spoke, Kawainga uttered a weak, wailing cry. George and Terence


wheeled, but Paeroa, his hollow eyes gleaming, staggered past them, and
hurled his wasted body full atop of Sounding Sea.

Unperceived by the men, the villain had wormed his way close to
Kawainga, intending to finish her with one stroke of his club; but the girl's
scream spoiled the murderous ruffian's scheme.

Sounding Sea, never a strong man, had grown weak and flabby in
consequence of his idle, dissolute life; but, nevertheless, Paeroa had his work
cut out for him, and the Englishmen, though anxious to let him have the
credit of saving his sweetheart's life, were prepared to interfere should the
contest go against him. They thought, of course, that Paeroa meant simply to
secure the fellow, and hold him while they adjusted the slipped ropes.

But Paeroa had no such intention. Wrought up to a pitch of fury at the


recollection of his wrongs at this coward's hands, and mad with rage at the
attempt upon the life of his betrothed, his strength was unnatural. For one
instant he came uppermost in the struggle; but it was enough. Glaring wildly
about him, he saw and scooped the wooden club from the ground, and,
without waiting to fasten his grip upon the handle, brought the triangular
edge smashing down upon the upturned face of Sounding Sea. The force of
the blow spent itself upon the temple, and with a deep groan the Hau-hau fell
back, killed outright by that terrible stroke.

'Ha!' Paeroa gasped, floundering to his feet and shaking the bloodstained
club. 'Ha! I have slain a taipo. The strength of ATUA was in me.' Then he
lurched forward like a drunken man, and crashed down at Kawainga's feet.
Horrified, George and Terence gazed at the swift, awful scene. It is no
light matter to see a man slain before your eyes. Moved by a common
impulse, they reverently lifted the dead man and carried him to one side,
while Kawainga fussed and crooned over Paeroa.

'If any one is aware of his visits here, and knows that he was employed to
watch us——' began George; but Terence struck in:

'We are armed now, and with revolvers, not to speak of your greenstone
club. By the way, why didn't you bring it with you?'

'I did,' answered George, clapping his hand to his side. But the loop in his
belt was empty. The mere was gone.

Startled, George looked about the cave; but nowhere could he find the
club.

'I fear it has dropped into the river as I came down the ladder,' he said.
'Wait here, if you don't mind, Terence, and I will go and see if I have left it in
our hut. No; let me go, for if I meet any one, my knowledge of the language
will get me past him, whereas you might be stopped.'

'Bring back the basket of food with you,' Terence called after him as he
hurried away.

As he rapidly ascended the ladder, George became conscious of an


extraordinary commotion in the pah. Shouts and cries, wailing of teteres,
even gun-shots, disturbed the quiet night, and, wondering what had
happened, he scaled the palisades and sped to his whare.

A glance all round told him that the club was not there, so, snatching up
the basket of food, he was about to set off again, when from the confusion of
sounds in the direction of the marae, one detached itself, clear and high:

'Rongo pai! Rongo pai!' (Good tidings! Good tidings!) 'Salutations, O


Hawk of the Mountain! O Slayer of the Pakeha, hail!'

Without an instant's pause George turned and ran, scaling the stockade,
and dashing down the flax-ladder at perilous speed.
'Come!' he shouted, when he had gained the entrance to the cave. 'Out of
this for your lives. Te Karearea has returned!'

CHAPTER XX

A BID FOR LIBERTY

'Up with you!' said George, holding the swaying ladder. 'Wait on top till
we join you. What a good thing I had my flask.'

It was. The strong spirit nerved the invalids to the effort they were
obliged to make, and in a few minutes the four of them were standing on the
ledge outside the pah, and by means of the ladder easily scaled the palisades.

The clamour still continued, and George and Terence swiftly piloted their
exhausted friends to the fence behind their hut. Here the ladder came into
play again, and they made for the underground world, George explaining its
peculiarities to Paeroa as they sped along.

'You will be safe enough if you do not wander far from the entrance,' he
assured the Maori. 'We will manage to visit you before long.'

They left the basket of food and the flask with the refugees, and, still
hurrying, for every minute was precious now, reached the shelter of their
whare without encountering any of the Hau-haus.

'Have you found your club?' Terence asked, carefully bestowing


cartridges in his various pockets.

'No,' George answered gloomily. 'I must have dropped it last night
between the fence and the underground world. The strange part of it is that I
should not have missed it till just now.'
'The thing is always generating mysteries,' grumbled Terence. 'I hope we
shall find it, though; for it may make all the difference between life and
death to us.'

'You are right,' said George, who seemed much upset. 'Of course I do not
agree with you that there is anything supernatural about the club; but still—
but still——'

Terence's eyes grew round. 'You don't agree with me! Why, you old
humbug, when did I say that the thing had any supernatural power?'

'You talked of the English lack of imagination,' George replied stiffly.

Terence laughed. 'The most wonderful thing about that blessed club is
that it has twice brought you and me to the brink of a dispute. I really believe
—— Hullo! Here he is.'

Unheard and unannounced, as usual, Te Karearea had entered. A grim


smile, quickly suppressed, parted his thin lips for an instant, and he bent a
frowning gaze upon George, who, angered out of himself at the loss of his
mere and the memories which the sight of the chief recalled, had sprung to
his feet and was glaring defiantly at the intruder.

'Salutations, friends!' said Te Karearea coldly. 'You did not meet me at the
gate, so I have come to——' He interrupted himself, his furtive eyes
gleaming. 'Where is the mere of TUMATATJENGA, Hortoni? It hangs not at
your side.'

George made no answer; for it was important to ascertain whether the


chief had come straight from the marae, or had already visited the hut and
discovered their absence. Familiar with his friend's lightest change of
expression, Terence knew that the storm was ready to break, and dropped his
hand lightly upon the revolver in his coat pocket, through which he covered
the chief. If treachery were intended, it was as well to be prepared.

'Speak, Hortoni!' Te Karearea's tone was imperative to the point of


insolence. His scarred face looked terrible under his malignant scowl.
There was a steely glint in George's eyes, and his nostrils quivered; but
his voice was fairly calm as he answered: 'A man may do as he likes with his
own. If I have smashed the mere among the rocks, or thrown it into the river,
what is it to you? You chatter like a parrot, and with as little sense. Leave us.
We wish to sleep.'

But Te Karearea had sense enough, and whatever black design he had in
his mind when he entered the hut, he put it away for the time, until he should
discover the truth about the mere. So, to the surprise of his hearers, instead
of flying into a rage, he grinned genially at them.

'You are right, Hortoni,' he said. 'It is only children who talk when they
are tired, and quarrel till they fall asleep. I, too, am weary and would rest.
Perhaps you will be in a better mind to-morrow, and will show me the mere
of TUMATAUENGA. I will go, since you have nothing to say to me.
Unless, indeed, you wish to renew your parole,' he finished with a sneer.

A sudden, inexplicable impulse swayed George.

'Stay, O Hawk of the Mountain,' he said, and all appearance of anger left
him. 'For a moon past you have kept us here by means of a trick. You caught
us in a trap of our own making. Now shall there be no more tricks, and, lest
you go away again in the night, leaving us fast here, I tell you to your face—
you yourself and none other—we take back our word.'

For once in his life Te Karearea had received a setback. His usual
coolness deserted him, and his ready tongue tripped as he asked if he had
heard aright.

'Does this mean that you will try to escape, Hortoni?' he inquired, when
both George and Terence had repeated their decision. He moved backwards
towards the door as if he feared an immediate attack.

'Why not?' George answered coolly. 'We have told you that we do not
wish to stay here, yet you will not let us go. Now we will go whether you
will allow us or not.'

But Te Karearea had recovered his equanimity. 'When?' he inquired, with


an air of great simplicity.
George laughed. 'It is enough for you to know that we will go.'

'When the gates of Reinga are shut, why seek to open them, Hortoni?
Take time to think,' suggested the chief.

'It is time to act,' retorted George, and Terence, informed of his friend's
sudden resolution, nodded assent.

Te Karearea was puzzled. Sly and designing himself, he could appreciate


straightforwardness in others; yet he could not believe that his captives
would have taken such a stand unless there was something underlying their
conduct of which he was ignorant. Meantime, confident of his ability to
prevent their escape, he temporised.

'Nevertheless, I give you time for thought, my friends,' he said. Then,


being a superb actor, he stopped on the threshold. 'If you will, I can set my
young men to look for your mere in the morning, Hortoni,' he suggested
graciously.

'Have I said that it was lost?' George countered quickly. 'But, if it were,
did your young men find it when it dragged itself from your hand and flew
into the sea? Have you yet to learn, O Te Karearea, that my God has given
me the mere to stand between me and death?'

Te Karearea was silenced. Muttering a charm, he slid through the door,


which presently was blocked outside. Terence put his ear to the wall and
could hear the shuffling of naked feet, as if a number of men were
dispersing. He turned to his friend.

'If the mere had been in your belt, George, I believe that the chief would
have taken chances and attacked you to gain possession of it. He had a dozen
men outside. But its absence puzzled him. Am I far wrong in saying that,
either by its presence or its absence, the greenstone club is for ever coming
between you and death?'

'Even as I said to Te Karearea,' agreed George. 'Yes; old Te Kaihuia's gift


was nothing short of a providence. What are we to do now? I had no idea of
taking back our parole so suddenly; but something seemed to force me to do
it. You don't object?'
'I should say not. The sooner we are out of here the better. I didn't like the
look in the Hawk's eyes.'

'I hope we shall be out of it before dawn,' said George. 'When the chief
once realises that the mere is gone, things will happen quickly. You may be
sure it was not simply for the pleasure of greeting us that he came here to-
night. He was in a black mood, and I suspect, if the truth were known, he has
been well hammered by our people.'

'More power to them!' cried Terence. 'You are right, George; it is time to
quit. I am not sure whether the chief takes us seriously; but he has left a
guard at the door.'

'Only one?' asked George, and Terence nodded. 'I have a plan in the
rough,' he went on, looking at his watch. 'It is just eleven. The sentry will
probably be changed at two or three o'clock. We will divide that time
between watching and resting. If we are quiet, sentry number one will give a
good account of us. Then, an hour or so later——'

'We must dispose of number two.' Terence filled in the pause.

'I am afraid so,' said George regretfully. 'Our lives hang in the balance,
and the lives of many others as well. We will avoid extreme measures if
possible. I wish I had my club. The very sight of it would frighten the fellow
into submission.'

Terence looked up at the roof and grinned. 'I am waiting to see if your
genii, taipos, taniwhas, or whoever are the slaves of the greenstone club, will
bring it back to you the instant you express a wish,' he said. 'There is a
smack of Aladdin and his lamp about the thing. Well, what next?'

'We must scale the fence behind the whare,' answered George, smiling.
'The sentries are stationed at intervals along the platform, and we must
manage to dodge the nearest. We'll manage it—we must.'

'I'll take the first watch,' said Terence.

'No; I will, in case there is any talking to be done. I wish that we had
another basket of food. It may go hard with us in the bush. Lie down and

You might also like