DEC DB MS Database Maintenance and Performance Guide

*HyperReader

CONTENTS

  Title Page

  Copyright Page

  Preface

  1      Introduction
    1.1 Database Maintenance
    1.2 Evaluating and Improving Performance
    1.3 The Sample Database

  Part 1:  Maintenance

  2      Monitoring A Database
    2.1 Listing Active User Information
    2.2 The DEC DBMS Monitor
      2.2.1      Starting the Monitor
      2.2.2      Changing the Monitor Characteristics
      2.2.3      Stopping the Monitor
      2.2.4      How the Monitor Works

  3      Opening and Closing a Database
    3.1 Opening a Database
      3.1.1      Using the DBO/OPEN Command
      3.1.2      Binding to a Database
    3.2 Closing a Database

  4      Backing Up and Restoring a Database
    4.1 Backing Up a Database
      4.1.1      Using the Single-Threaded Backup Utility
        4.1.1.1      Full Backups
        4.1.1.2      Complete Incremental Backups
        4.1.1.3      Area Incremental Backups
        4.1.1.4      Adding Checksums to the Database Backup File
        4.1.1.5      Verifying the Database
        4.1.1.6      Backing Up a Database Directly to Tape
      4.1.2      Using the Multithreaded Backup Utility
        4.1.2.1      Full Backups
        4.1.2.2      By-Area Backups
        4.1.2.3      Incremental Backups
        4.1.2.4      Backing Up to Multiple Tapes
        4.1.2.5      Specifying Tape Header Characteristics
        4.1.2.6      Checking for Device Errors
      4.1.3      Backup Modes
        4.1.3.1      Offline Backup
        4.1.3.2      Online Backup
    4.2 Restoring a Database
      4.2.1      Restore Types
        4.2.1.1      Full Restores
        4.2.1.2      By-Area Restores
        4.2.1.3      By-Page Restores
        4.2.1.4      Complete Incremental Restores
        4.2.1.5      Area Incremental Restores
      4.2.2      Using the Single-Threaded Restore Utility
        4.2.2.1      Adding Snapshots During a Single-Threaded Restore
      4.2.3      Using the Multithreaded Restore Utility
        4.2.3.1      Assigning Threads for Multithreaded Restore
        4.2.3.2      Checking Tape Characteristics
      4.2.4      Modifying Database Characteristics When Restoring
        4.2.4.1      Modifying After-Image Journaling Characteristics
        4.2.4.2      Modifying SPAM Threshold Values
        4.2.4.3      Modifying Blocks Per Page
        4.2.4.4      Moving Database Files
        4.2.4.5      Moving CDD/Repository Instance Information
    4.3 Backup and Recovery Strategies
      4.3.1      General Description or Rules of a Strategy
        4.3.1.1      Protecting Backup Media
        4.3.1.2      Database Backups and OpenVMS File Operations
        4.3.1.3      Maximizing Your Storage Configurations
        4.3.1.4      Choosing Backup to Tape or Disk
        4.3.1.5      Volatility of Data Determines Frequency of Backups
      4.3.2      Speeding Up Backups
      4.3.3      Specific Backup Examples
        4.3.3.1      Case for Typical Multiuser Environment
        4.3.3.2      Case for Small Single-User Database
        4.3.3.3      Case for Large 7x24 Database

  5      Journaling and Recovery
    5.1 Journaling Before-Images
      5.1.1      Recovery-Unit Journal Files
      5.1.2      Using the /RECOVER_JOURNAL Qualifier
      5.1.3      Defining the DBM$RUJ Logical Name
      5.1.4      Disabling Recovery-Unit Journaling
      5.1.5      The Automatic Recovery Procedure
      5.1.6      Improving Performance of the Automatic Recovery Procedure
    5.2 Journaling After-Images
      5.2.1      After-Image Journal Files
      5.2.2      After-Image Journal Management
        5.2.2.1      Choosing Fixed-Size or Extensible Journal Files
        5.2.2.2      Additional Considerations for Devising a Journaling Strategy
      5.2.3      Enabling Journaling and Creating .AIJ Files
      5.2.4      Modifying AIJ Characteristics
        5.2.4.1      Setting the Size of the After-Image Journal Allocation
        5.2.4.2      Setting the Extension Size for a Single Extensible Journal File
      5.2.5      Placement of .AIJ Files
      5.2.6      Backing Up AIJ Files
        5.2.6.1      Backing Up Multiple Fixed-Size .AIJ Files
        5.2.6.2      Backing Up a Single, Extensible After-Image Journal File
        5.2.6.3      No-Quiet Point Backup of Extensible .AIJ File
        5.2.6.4      Continuous Backup of an Extensible .AIJ File
        5.2.6.5      Trade-Offs Between Accumulating Multiple .AIJ Files and Using Regular Incremental Backup and Restore Operat
        5.2.6.6      Fast Commit, Checkpointing, After-Image Journaling, and Backing Up .AIJ Files
      5.2.7      After-Image Journal Optimization of .AIJ Files
      5.2.8      Shadowing AIJ Disk When Using Fast Commit
    5.3 After-Image Journal Recovery
      5.3.1      How the DBO/RECOVER Command Works
      5.3.2      DBO/RECOVER Online by Area
      5.3.3      Online Recovery By Page
      5.3.4      Automatic AIJ Recovery
      5.3.5      Restore and AIJ Recovery Using One Command
      5.3.6      Handling DBO/RECOVER Failures

  6      Modifying a Database
    6.1 Changing Database Metadata
      6.1.1      Adding Definitions to a Schema and Storage Schema
      6.1.2      Deleting Definitions from a Schema or Storage Schema
      6.1.3      Modifying Existing Schema and Storage Schema Definitions
      6.1.4      Modifying, Adding, and Deleting a Subschema
      6.1.5      Modifying, Adding, and Deleting a Security Schema
      6.1.6      Example of Adding Definitions to the PARTS Schema and Storage Schema
    6.2 Changing the Metadata and the Accompanying Supporting Structures
      6.2.1      Beginning and Ending a DRU Session
      6.2.2      Getting Help in DRU
      6.2.3      Creating a Change File
      6.2.4      Opening and Closing a Change File
      6.2.5      Defining Changes
        6.2.5.1      Reloading Areas
          6.2.5.1.1       Reload Algorithm
          6.2.5.1.2       VIA Trees, Set Trees, and Sequence Trees
          6.2.5.1.3       Reload Syntax
          6.2.5.1.4       RELOAD Syntax Discussion
          6.2.5.1.5       Using RELOAD from DRU
          6.2.5.1.6       Using the Default Reload Sequence
          6.2.5.1.7       Creating a User-Defined Reload Sequence
        6.2.5.2      Modifying Record Placement
        6.2.5.3      Moving Some Records to New Areas
        6.2.5.4      Effect of MOVE TO AREA Clauses on Schemas
        6.2.5.5      Removing Areas from a Record WITHIN Clause
        6.2.5.6      Changing Set Insertion and Retention Modes to AUTOMATIC MANDATORY or AUTOMATIC FIXED
        6.2.5.7      Specifying That Duplicates Are Not Allowed on Sorted Sets
        6.2.5.8      Changing Sort Keys and Sort Order on Sorted Sets
        6.2.5.9      Changing Set ORDER and MODE Clauses
        6.2.5.10     Changing B-Tree Characteristics
        6.2.5.11     Removing Data Items from a Database
        6.2.5.12     Changing Data Type and Data Length
        6.2.5.13     Changing the Allocation Mode
        6.2.5.14     Removing the DEFAULT Clause
      6.2.6      Analyzing the Changes
      6.2.7      Executing Changes
      6.2.8      Releasing Restructured Areas
      6.2.9      Reintegrate Metadata
      6.2.10     Replacing Subschemas in Databases Using the Run-Time Only Version of DEC DBMS
      6.2.11     Using the Initialization File
      6.2.12     Removing Changes from a Change File
      6.2.13     Displaying Information About Records, Sets, and Changes
      6.2.14     Defining the DRU Environment
      6.2.15     Creating Macros
      6.2.16     Editing Within DRU
    6.3 Changing the Physical Database Characteristics
      6.3.1      Changing Database Locking Characteristics
      6.3.2      Changing Buffer Specifications
      6.3.3      Controlling Batch Writes
      6.3.4      Using Asynchronous Prefetch
      6.3.5      Controlling After-Image Journaling
      6.3.6      Controlling Snapshots
        6.3.6.1      Allowing and Enabling Snapshots
        6.3.6.2      Using the Different Snapshot Modes
        6.3.6.3      Monitoring Snapshot Activity
        6.3.6.4      Changing Snapshot File Sizes
      6.3.7      Increasing Space Allocation and Extension Values
      6.3.8      Expanding the CALC Range of an Area
      6.3.9      Modifying SPAM Threshold Values
      6.3.10     Updating CDD/Repository Instance Information
      6.3.11     Changing the Maximum Number of Database Users
      6.3.12     Changing the Maximum Number of Nodes for VMScluster Users
      6.3.13     Changing the Default Placement of the Recovery-Unit Journal File
      6.3.14     Changing the Open Mode of the Database

  7      Deleting Databases and Updating CDD/Repository Information
    7.1 Deleting a Database
    7.2 Deleting a Schema
    7.3 Deleting a Storage Schema or a Subschema
    7.4 Deleting a Security Schema
    7.5 Deleting Database Instance Information

  8      Internal Representation of the Database
    8.1 Database Storage Page Structure
      8.1.1      Page Header
      8.1.2      Line Index
      8.1.3      Free Space
    8.2 Storage Segment Structure
      8.2.1      User-Stored and SYSTEM Records
      8.2.2      Index Node Records
      8.2.3      Fragmented Storage Records
    8.3 Database Storage Page with Snapshots
      8.3.1      Transaction Sequence Number
      8.3.2      Page Tail
      8.3.3      Comparison of Live Page and Snapshot Page Dumps
      8.3.4      Page Tail on Snapshot Page
    8.4 Space Area Management (SPAM) Page Structure

  9      Verifying and Altering a Database
    9.1 Verifying the Integrity of a Database
      9.1.1      Example of Database Corruption
      9.1.2      Causes of Database Corruption
    9.2 Using DBALTER
      9.2.1      Binding to a Database
      9.2.2      Clearing a Corruption Flag
      9.2.3      Selecting the Area Page for Altering
      9.2.4      Displaying Page Contents
      9.2.5      Changing Page Contents
      9.2.6      Moving Database Files
      9.2.7      Moving Data
      9.2.8      Clearing an Inconsistent Flag
      9.2.9      Changing the Radix
      9.2.10     Verifying Alterations
      9.2.11     Keeping an Audit Trail of Alterations
      9.2.12     Completing Transactions
      9.2.13     Exiting from the DBALTER Utility
      9.2.14     Getting Online Information About DBALTER Commands

  10     Handling Bugcheck Dumps
    10.1 Types of Bugcheck Dumps
      10.1.1     Locations of Bugcheck Dump Files
      10.1.2     Defining the DBM$BUGCHECKDIR Logical Name
    10.2 When to Report a Bugcheck Dump
      10.2.1     Examining a Bugcheck Dump
      10.2.2     Contents of a Bugcheck Dump
    10.3 Submitting an SPR

  11     Using Database Dumps
    11.1 The DBO/DUMP Database Command
    11.2 The DBO/DUMP/AFTER_JOURNAL Command
    11.3 The DBO/DUMP/RECOVER_JOURNAL Command
    11.4 The DBO/DUMP/BACKUP Command
    11.5 The DBO/DUMP/BACKUP/MULTITHREAD Command

  12     Managing the Two-Phase Commit Environment
    12.1 Handling Unexpected System Failures
      12.1.1     Failure Before Voting
      12.1.2     Failure After Voting
      12.1.3     Failure After Voting with Coordinator Unavailable
    12.2 Resolving Blocked Participants
      12.2.1     Blocked Transaction Participant Scenario
      12.2.2     Identifying Blocked Participants
      12.2.3     Manually Resolve Blocked Participants
    12.3 Restoring a Database Containing Blocked Participants
    12.4 Managing Distributed Deadlock Situations
      12.4.1     Identifying a Distributed Deadlock Situation
      12.4.2     Resolving a Distributed Deadlock Situation

  Part 2:  Performance

  13     Performance Tuning Overview
    13.1 Utilities and Tools to Evaluate Database Performance
      13.1.1     Analyzing Space Usage
      13.1.2     Displaying Lock Activity
        13.1.2.1     Using the DBO/SHOW LOCKS Utility
      13.1.3     Displaying Database Statistics
      13.1.4     Dumping Database Information
      13.1.5     Operating System Utilities
    13.2 VMScluster Performance Considerations
    13.3 Establishing a Context
    13.4 Using a Test Database
      13.4.1     Make Changes One at a Time
      13.4.2     Develop Unload/Load Procedures
    13.5 Changing Operating System Parameters
    13.6 Sample Performance Evaluation Procedure
    13.7 Sample List of Performance-Related Database Changes
    13.8 Making Performance Changes in Order of Difficulty
    13.9 Tuning Local and Global Buffers

  14     Analyzing Record Storage Problems
    14.1 Using the DBO/ANALYZE Command
    14.2 Interpreting DBO/ANALYZE Output
      14.2.1     The Report Heading
      14.2.2     Storage Area Space Utilization Histogram
      14.2.3     Structuring Records in an Area
        14.2.3.1     Volatile Storage Area
        14.2.3.2     Static Storage Area
      14.2.4     Record Type Summary Analysis
        14.2.4.1     Average Length in Bytes
        14.2.4.2     Percentage of Fragmented Records
        14.2.4.3     Percentage of Total Space and Used Space
      14.2.5     Set Analysis
        14.2.5.1     Members and Clustered Reads
        14.2.5.2     Experimenting with Buffer Configurations
      14.2.6     Index Sets
        14.2.6.1     Nodes
        14.2.6.2     Index Levels
      14.2.7     Set Histograms

  15     Using Database Statistics
    15.1 Selecting a Display Mode
    15.2 Selecting a Display Page
    15.3 Selecting a Display Format
      15.3.1     Graph Display Format
      15.3.2     Numbers Display Format
      15.3.3     Time Plot
    15.4 Getting Online Help
    15.5 Interpreting Database Statistics
    15.6 Understanding the Display Pages
      15.6.1     Summary I/O Statistics
      15.6.2     Summary Locking Statistics
      15.6.3     PIO Statistics
        15.6.3.1     PIO Statistics-Writes
        15.6.3.2     PIO Statistics-Data Fetches
        15.6.3.3     PIO Statistics-SPAM Fetches
      15.6.4     Asynchronous PIO Statistics
      15.6.5     I/O Stall Time
      15.6.6     Database Verb Statistics
      15.6.7     Index Statistics
      15.6.8     AIJ Statistics
        15.6.8.1     AIJ Statistics Display Screen
        15.6.8.2     AIJ Information Screen
      15.6.9     Checkpoint Statistics
      15.6.10    Record Statistics
      15.6.11    Snapshot Statistics
      15.6.12    Virtual Memory Usage Statistics
      15.6.13    Transaction Durations
      15.6.14    I/O Statistics by File
      15.6.15    Per-Process Information
        15.6.15.1    Stall Messages
        15.6.15.2    Active User Stall Messages
        15.6.15.3    Process Accounting
        15.6.15.4    DBR Activity
        15.6.15.5    Defined Logicals
        15.6.15.6    Lock Timeout and Lock Deadlock
      15.6.16    Lock Statistics for One Lock Type
      15.6.17    Lock Statistics for One Statistics Field
    15.7 Writing Statistics to a File
    15.8 Formatted Binary Output

  16     Using DECtrace with DEC DBMS Applications
    16.1 Overview of DECtrace
    16.2 How to Collect Event Data for DEC DBMS
      16.2.1     Describing DEC DBMS Events and Items
      16.2.2     Creating a Selection
      16.2.3     Scheduling Data Collection
      16.2.4     Registration IDs
    16.3 How to Create a Report Based on Collected Data
      16.3.1     Formatting and Merging Data Files
      16.3.2     Generating a Report
      16.3.3     Creating a Customized Report
    16.4 DEC DBMS Database Relations
      16.4.1     DEC DBMS Performance Class Database Relations