• No results found

Database. Administration. The Complete. and Procedures. Guide to DBA Practices. AAddison-Wesley. Second Edition. Mullins

N/A
N/A
Protected

Academic year: 2021

Share "Database. Administration. The Complete. and Procedures. Guide to DBA Practices. AAddison-Wesley. Second Edition. Mullins"

Copied!
23
0
0

Loading.... (view fulltext now)

Full text

(1)

Administration

The

Complete

Guide

to

DBA Practices

and Procedures

Second

Edition

Craig

S. Mullins

AAddison-Wesley

UpperSaddle River,NJ • Boston • Indianapolis •San Francisco

New York•Toronto • Montreal • London• Munich• Paris •Madrid

(2)

Contents

Preface xxxi

HowtoUse This Book xxxiii

Acknowledgments xxxv About the Author xxxvii

Chapter 1 What Is a DBA? 1

WhyLearn Database Administration? 3

AUnique VantagePoint 4 DBA Salaries 4

Database Technology 6

TheManagement Discipline ofDatabase Administration 9

A Day in the Life ofaDBA 12

Evaluating a DBAJob Offer 14

(3)

Database, Data, andSystemAdministration 15

DataAdministration 15

Database Administration 19

SystemAdministration 20

DBA Tasks 20

Database Design 21

Performance Monitoring andTuning 22

Ensuring Availability 24

Database Securityand Authorization 24

Governance andRegulatory Compliance 26

BackupandRecovery 26

EnsuringDataIntegrity 27 DBMS Release Migration 29

Jack-of-All-Trades 29

The Types of DBAs 31

System DBA 31

Database Architect 32

DatabaseAnalyst 33

Data Modeler 33

Application DBA 34

Task-OrientedDBA 36

Performance Analyst 36

Data Warehouse Administrator 36

Staffing Considerations 37

HowMany DBAs? 37

DBA ReportingStructures 40

Multiplatform DBA Issues 42

ProductionversusTest 44

The Impact ofNewerTechnologyon DBA 46

(4)

Contents xi

TheInternet: From DBA to eDBA 50

The Personal DBA and the Cloud 53

NoSQL, Big Data, and the DBA 55

New Technology Impacts on DBA 56

DBA Certification 56

The Rest of the Book 58

Review 58

Bonus Question 59

Chapter 2 Creating the Database Environment 61

Definingthe Organization's DBMS Strategy 61

Choosing a DBMS 63 DBMS Architectures 68

DBMS Clustering 71

DBMSProliferation 73

Hardware Issues 73

CloudDatabaseSystems 74

Installingthe DBMS 75

DBMS Installation Basics 75

HardwareRequirements 76

Storage Requirements 76

MemoryRequirements 78

ConfiguringtheDBMS 80

Connectingthe DBMSto Supporting Infrastructure Software 81

Installation Verification 81

DBMSEnvironments 82

UpgradingDBMS Versions and Releases 82 Featuresand Complexity 87

Complexity ofthe DBMS Environment 87

Reputation ofthe DBMS Vendor 89

(5)

Organization Style 89

DBA StaffSkill Set 90

Platform Support 90

Supporting Software 91 FallbackPlanning 92

Migration Verification 92

The DBMS Upgrade Strategy 92 Database Standards and Procedures 92

DatabaseNaming Conventions 93

Other Database Standards andProcedures 96

DBMS Education 103

Summary 104 Review 104

BonusQuestion 105

Suggested Reading 105

Chapter 3 Data Modeling and Normalization 107

DataModeling Concepts 108

Entity-Relationship Diagramming 110

The Componentsofa Data Model 113 Entities 113

Attributes 115

Keys 120

Relationships 122

Discovering Entities, Attributes, and Relationships 124

Conceptual, Logical, and Physical Data Models 125 WhatIsNormalization? 128

The Normal Forms 128 FirstNormalForm 129 Second Normal Form 129

(6)

Contents xiii

A Normalized Data Model 133

Further NormalForms 134

Normalization in Practice 135

Additional Data Modeling Issues 135 Summary 136

Review 137

Bonus Question 138

Suggested Reading 138

Chapter 4 Database Design 141

From LogicalModel to Physical Database 141

TransformEntities to Tables 142

TransformAttributesto Columns 142

BuildReferential ConstraintsforAllRelationships 146 BuildPhysicalData Structures 147

DatabasePerformanceDesign 150

DesigningIndexes 150

Hashing 158

Clustering 159

InterleavingData 160

Denormalization 160

When toDenormalize 161

Prejoined Tables 164

ReportTables 164

MirrorTables 165

Split Tables 165

Combined Tables 168

Redundant Data 168

Repeating Groups 169

Derivable Data 170 Hierarchies 171

(7)

Special Physical ImplementationNeeds 173

Denormalization Summary 173 Views 175

Data Definition Language 177

TemporalData Support 177 A Temporal Example 178

Business Time andSystem Time 179

Summary 180 Review 181

Bonus Question 181

Suggested Reading 182

Chapter 5 Application Design 185

DatabaseApplication DevelopmentandSQL 186

SQL 186

Set-at-a-TimeProcessing and Relational Closure 189

Embedding SQL ina Program 191

SQLMiddleware andAPIs 192

Application Infrastructure 193

Object Orientation andSQL 199

Types of SQL 200

SQL Codingfor Performance 202

QueryingXML Data 203

DefiningTransactions 205 Transaction Guidelines 207

UnitofWork 207

TransactionProcessing Systems 207

Application Servers 209

Locking 210

Types ofLocks 212 Lock Time-outs 213

(8)

Contents XV

Deadlocks 214 LockDuration 215

Lock Escalation 219

Programming Techniques to Minimize LockingProblems 220

Locking Summary 220

BatchProcessing 221

Summary 222

Review 222

BonusQuestion 223

Suggested Reading 223

Chapter 6 Design Reviews 227 WhatIs aDesignReview? 227

RulesofEngagement 228

Design ReviewParticipants 229

Knowledge and SkillsRequired 232

Types ofDesignReviews 232

ConceptualDesignReview 233

Logical Design Review 235

Physical DesignReview 236

Organizational Design Review 237

SQL andApplication CodeDesignReview 238

Pre-Implementation DesignReview 239

Post-Implementation DesignReview 239 DesignReviewOutput 239

Additional Considerations 240

Dealingwith RemoteStaff 240

Mentorship andKnowledge Transfer 240 Summary 241

Review 241

(9)

Chapter 7 Database Change Management 243

ChangeManagementRequirements 244

TheChange Management Perspective ofthe DBA 246

Types ofChanges 247

DBMS Software 248

Hardware Configuration 248

LogicalandPhysicalDesign 248

Applications 249

PhysicalDatabase Structures 250

ImpactofChange onDatabase Structures 250

TheLimitations ofALTER 252

Database Change Scenarios 254

ComparingDatabase Structures 257

RequestingDatabase Changes 258 Standardized Change Requests 259 Communication 260

CoordinatingDatabase andApplication Changes 260

Compliance 261

DBA Scripts and ChangeManagement 262

Summary 262

Review 263

Suggested Reading 263

Chapter 8 DataAvailability 265

Defining Availability 267

IncreasedAvailability Requirements 268 Cost of Downtime 271

How MuchAvailabilityIsEnough? 273

Availability Problems 274

Loss ofthe Data Center 274

(10)

Contents xvii

LossoftheServer Hardware 276

Disk-Related Outages 278

Operating SystemFailure 279 DBMSSoftwareFailure 279

Application Problems 279

Security and Authorization Problems 280

Corruption ofData 280 Loss ofDatabase Objects 281

Loss ofData 282

DataReplication andPropagation Failures 283 SeverePerformanceProblems 283

RecoveryIssues 284 DBA Mistakes 284

Outages:Planned and Unplanned 286

Ensuring Availability 287

Perform Routine Maintenance WhileSystemsRemain

Operational 288

AutomateDBA Functions 290

ExploitHigh-AvailabilityFeatures 291

Exploit Clustering Technology 292 Database Architecture andNoSQL 296

Summary 296

Review 297

Suggested Reading 298

Chapter 9 Performance Management 299

Defining Performance 299

A BasicDatabasePerformanceRoadMap 302

Monitoringversus Management 304

(11)

Preproduction PerformanceEstimation 307 Historical Trending 308

Service-LevelManagement 308

Typesof Performance Tuning 311

System Tuning 311

Database Tuning 312

Application Tuning 312

Performance TuningTools 313

DBMS Performance Basics 315

Summary 316

Review 316

BonusQuestion 317

Suggested Reading 317

Chapter 10 System Performance 319 TheLargerEnvironment 320

Interaction with the Operating System 320 AlliedAgents 321

Hardware Configuration 322

Components ofthe DBMS 324

DBMS Installation and Configuration Issues 327

Types of Configuration 327

Memory Usage 328

Data Cache Details 332

"Open"Database Objects 336 Database Logs 336

Locking and Contention 341

TheSystem Catalog 342

Other Configuration Options 343 GeneralAdvice 344

(12)

Contents xix

Summary 346

Review 346

BonusQuestion 347 Suggested Reading 347

Chapter 11 Database Performance 349

TechniquesforOptimizingDatabases 349 Partitioning 350

Raw Partition versusFile System 351

Indexing 352

Denormalization 355

Clustering 356

InterleavingData 360 FreeSpace 360

Compression 361

File Placement and Allocation 362

PageSize (Block Size) 364 DatabaseReorganization 365

DeterminingWhen toReorganize 369 Automation 371

Summary 371

Review 371

Suggested Reading 372

Chapter 12 Application Performance 373

Designing Applications for RelationalAccess 373 Relational Optimization 374

CPU andI/O Costs 376

Database Statistics 376

Query Analysis 378 Joins 379

(13)

Additional OptimizationConsiderations 391

View Access 391

QueryRewrite 392

Rule-Based Optimization 393

ReviewingAccess Paths 394

ForcingAccess Paths 398

SQLCodingandTuningforEfficiency 399

A Dozen SQLRules ofThumb 400

AdditionalSQL Tuning Tips 406

IdentifyingPoorly Performing SQL 406

Summary 407

Review 407

Suggested Reading 408

Chapter 13 Data Integrity 409

Types ofIntegrity 409

Database Structure Integrity 410

Types ofStructuralProblems 410

Managing StructuralProblems 411 SemanticData Integrity 414

Entity Integrity 416

Unique Constraints 417

Data Types 417

DefaultValues 419

Check Constraints 419

Triggers 426

Referential Integrity 433 Temporal Database Systems 444

Summary 446 Review 447

(14)

Chapter 14 Database Security 449

DataBreaches 449

DatabaseSecurityBasics 451

Database Users 455

Grantingand Revoking Authority 456

Types ofPrivileges 457

GrantingtoPUBLIC 460

Revoking Privileges 461

Label-BasedAccess Control 463

Security Reporting 465

Authorization Roles andGroups 466

Roles 466

Groups 467

Other Database SecurityMechanisms 468

Using Viewsfor Security 468

Using Stored Proceduresfor Security 470

Encryption 470

DataatRestEncryption 472 Data in TransitEncryption 472

Encryption Techniques 472

SQL Injection 473

SQL InjectionPrevention 475

Auditing 477

ExternalSecurity 478

Job SchedulingandSecurity 479 Non-DBMS DBA Security 480

DBMSFixpacks andMaintenance 480

Summary 481

Review 481

(15)

Chapter 15 Regulatory Compliance and Database

Administration 483

A CollaborativeApproach to Compliance 486

WhyShould DBAs Care aboutCompliance? 487

Metadata Management, DataQuality, and Data Governance 488

Metadata 488 Data Quality 489

Data Governance 489

Database Auditing and Data Access Tracking 490

DatabaseAuditing Techniques 493

PrivilegedUserAuditing 495

Data Masking and Obfuscation 496

Data Masking Techniques 497

Database ArchivingforLong-TermData Retention 498

TheLife Cycle ofData 499

DatabaseArchiving 500

Components ofa DatabaseArchiving Solution 505 The Impactofe-Discovery on DBA 506

CloserTracking of Traditional DBA Tasks 507 Database ChangeManagement 508

Database Backup andRecovery 508

Summary 511

Review 511

SuggestedReading 512

Chapter 16 Database Backup and Recovery 515

The Importance ofBackup and Recovery 515

Preparing for Problems 516

Backup 517

FullversusIncrementalBackups 521 Database Objects andBackups 523

(16)

DBMS Control 524

ConcurrentAccess Issues 525

Backup Consistency 527

Log ArchivingandBackup 529

Determining YourBackup Schedule 531

DBMSInstanceBackup 533

Designing the DBMS Environmentfor Recovery 533 Alternate Approaches to DatabaseBackup 534

Document YourBackup Strategy 536

Database Object Definition Backups 536

Recovery 537

DeterminingRecovery Options 538

GeneralSteps for Database Object Recovery 540

Types ofRecovery 541 IndexRecovery 550

Testing YourRecoveryPlan 551

Recovering aDroppedDatabase Object 552

RecoveringBroken Blocks andPages 553

Populating Test Databases 553

Alternatives to Backup andRecovery 554

StandbyDatabases 554

Replication 555

DiskMirroring 556

Summary 557 Review 557

Suggested Reading 558

Chapter 17 Disaster Planning 559 The Need forPlanning 559

(17)

General DisasterRecovery Guidelines 563

TheRemote Site 564

The Written Plan 564

Personnel 569

Backing Upthe Database for DisasterRecovery 569

Tape Backups 570

Storage Management Backups 572

OtherApproaches 573

Some Guidelines 573 Disaster Prevention 575

Disaster and Contingency Planning Web Sites 576

Summary 576

Review 576

Suggested Reading 577

Chapter 18 Data and Storage Management 579

Storage Management Basics 579 Files andData Sets 583

File PlacementonDisk 584

Raw Partitions versusFileSystems 586

TemporaryDatabase Files 587

Space Management 587 DataPage Layouts 588

IndexPage Layouts 592 TransactionLogs 594 FragmentationandStorage 595

Storage Options 596

RAID 597

JBOD 604

(18)

Contents XXV

Network-AttachedStorage 605

TieredStorage 606

Planningforthe Future 608

Capacity Planning 608

Summary 609

Review 609

Suggested Reading 610

Chapter 19 Data Movement and Distribution 613

Loading andUnloading Data 614

The LOAD Utility 614 The UNLOAD Utility 618

MaintainingApplication TestBeds 621 EXPORT andIMPORT 622

BulkData Movement 623 ETL Software 623

Replication andPropagation 623

Messaging Software 624

Other Methods 625

Distributed Databases 626

Setting Upa Distributed Environment 627 Data DistributionStandards 629

AccessingDistributedData 630

Two-Phase COMMIT 631

DistributedPerformanceProblems 632

Summary 633

Review 634

Bonus Question 634

(19)

Chapter 20 Data Warehouse Administration 637

What Is a DataWarehouse? 637

Analytical versus Transaction Processing 638

Administering the DataWarehouse 640 Too Much Focus on Technology? 641

Data WarehouseDesign 641

DataMovement 644

Data Cleansing 645

Data WarehouseScalability 649

Data WarehousePerformance 650

Data Freshness 654

Data Content 654

Data Usage 655

Financial Chargeback 655

BackupandRecovery 656

Don't Operate in aVacuum! 657

Summary 658

Review 658

Suggested Reading 659

Chapter 21 Database Connectivity 661

Multitier, DistributedComputing 661

A Historical Look 661

Business Issues 663

What Is Client/ServerComputing? 663

Types ofClient/ServerApplications 667

Network Traffic 670

Database Gateways 671

Database Drivers 672

(20)

Contents xxvii

Databases, theInternet, and the Web 675

Internet-ConnectedDatabases 676

WebDevelopmentand Web Services 680

Summary 681

Review 682

Suggested Reading 682

Chapter 22 Metadata Management 685

What Is Metadata? 685

From Data toKnowledge andBeyond 686

MetadataStrategy 687

Data Warehousing and Metadata 688

Types of Metadata 689

RepositoriesandData Dictionaries 691 Repository Benefits 693

Repository Challenges 693

Data Dictionaries 695 Summary 696

Review 696

SuggestedReading 697

Chapter 23 DBA Tools 699

Typesand Benefits of DBA Tools 699

DataModelingandDesign 700 Database Change Management 701

Table Editors 707

Performance Management 708

Backup andRecovery 714

Database Utilities 715

Data Protection, Governance, Risk, andCompliance Tools 716

(21)

Programming andDevelopmentTools 724

Miscellaneous Tools 726

ExamineNativeDBATools 728

Evaluating DBATool Vendors 729

Homegrown DBA Tools 732

Summary 733

Review 733

Chapter 24 DBA Rules of Thumb 735

Write DownEverything 735

Keep Everything 736

Automate! 737

Share YourKnowledge 739

Analyze, Simplify, andFocus 741

Don't Panic! 742

MeasureTwice, Cut Once 743

Understand the Business, NotJust the Technology 743

Don't Become aHermit 745

Use All of the Resources atYourDisposal 745

Keep Up-to-Date 746

Invest inYourself 747

Summary 748

Final Exam 748

Appendix A Database Fundamentals 753 What IsaDatabase? 753

WhyUseaDBMS? 754

Advantages of UsingaDBMS 755

(22)

Contents xxix

Appendix B The DBMS Vendors 761 TheBigThree 762

The Second Tier 763

Other Significant Players 763

Open-SourceDBMS Offerings 764

Nonrelational DBMS Vendors 765 NoSQL DBMSVendors 765

Object-OrientedDBMS Vendors 766

PC-Based DBMS Vendors 766

Appendix C DBATool Vendors 769 The MajorVendors 769

OtherDBA Tool Vendors 770

DataModelingTool Vendors 771

RepositoryVendors 772

Data Movement and BusinessIntelligenceVendors 773

Appendix D DBA Web Resources 775

Usenet Newsgroups 775

Mailing Lists 776

WebSites, Blogs, and Portals 778 Vendor Web Sites 778

Magazine Web Sites 778 Consultant Web Sites 779

Blogs 780

Database Portals 781 Other Web Sites 782

Appendix E Sample DBA Job Posting 785

Job Posting 785

(23)

Bibliography 793

Database Management and Database Systems 793

DataAdministration, DataModeling, andDatabaseDesign 799 Database Security, Protection, andCompliance 802

DataWarehousing 804

SQL 805

Object Orientation and Database Management 807

Operating Systems 807

RelatedTopics 808 DB2 812

IMS 813

MySQL 813 Oracle 814

SQL Server 815

Sybase 816

Other Database Systems 817

Glossary 819

Figure

Table Editors 707

References

Related documents

Stephen Matthews, Partner – Moscow, Igor Gorchakov, Partner – Moscow, Mona Vaswani, Partner – London, Richard Smith, Partner – London, Jeffrey Sullivan, Partner – London,

Super-premium market segment is highly influenced by market and technology changes on razor functionality and design.. Key Highlights from Profit and Loss Forecast

At “sales organization/division” level, you can define which division should be used for accessing condition records and which should be used for accessing the customer master

Hiding around with steak n application online at the entire interview process is terrible customer service occurring over what does that our food restaurant chains with!.

Tidak terdapat fungsi mendorong kohesi sosial, karena dalam pemberitaan IIMS 2013 di otomotifnet.com, menyajikan seluruh berita (58 berita) hanya menggunakan satu

Exa 8.10 1 to calculate THD of output voltage and its distortion factor 2 to calculate THD of output current and its dis- tortion factor 3 load power and avg dc source current

As a complement of planimetry obtained by procedures as photogrammetry or terrestrial laser scanning (TLS), complete architectural surveys using non- destructive techniques are

Courts have held that nearly any securities violation, occurring within or outside the United States borders, and having a real impact on investors or markets in the United