Guide to Openvms File Applications
Total Page:16
File Type:pdf, Size:1020Kb
Guide to OpenVMS File Applications Order Number: AA-PV6PD-TK April 2001 This document is intended for application programmers and designers who write programs that use OpenVMS RMS files. Revision/Update Information: This manual supersedes the Guide to OpenVMS File Applications, OpenVMS Alpha Version 7.2 and OpenVMS VAX Version 7.2 Software Version: OpenVMS Alpha Version 7.3 OpenVMS VAX Version 7.3 Compaq Computer Corporation Houston, Texas © 2001 Compaq Computer Corporation Compaq, AlphaServer, VAX, VMS, the Compaq logo Registered in U.S. and Patent and Trademark Office. Alpha, OpenVMS, PATHWORKS, DECnet, and DEC are trademarks of Compaq Information Technologies Group, L.P. in the United States and other countries. UNIX and X/Open are trademarks of The Open Group in the United States and other countries. All other product names mentioned herein may be the trademarks of their respective companies. Confidential computer software. Valid license from Compaq required for possession, use, or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information in this document is provided "as is" without warranty of any kind and is subject to change without notice. The warranties for Compaq products are set forth in the express limited warranty statements accompanying such products. Nothing herein should be construed as constituting an additional warranty. ZK4506 The Compaq OpenVMS documentation set is available on CD-ROM. This document was prepared using DECdocument, Version 3.3-1b. Contents Preface ............................................................ xiii 1 Introduction 1.1 File Concepts ............................................... 1–1 1.2 Disk Concepts .............................................. 1–3 1.2.1 Files–11 On-Disk Structure Concepts . ....................... 1–6 1.2.2 Files–11 Control Files ..................................... 1–8 1.2.2.1 Index File ............................................ 1–8 1.2.2.2 Storage Bit Map File . ................................ 1–9 1.2.2.3 Bad Block File ........................................ 1–10 1.2.2.4 Master File Directory . ................................ 1–10 1.2.2.5 Core Image File ....................................... 1–10 1.2.2.6 Volume Set List File .................................... 1–10 1.2.2.7 Continuation File ...................................... 1–10 1.2.2.8 Backup Log File ....................................... 1–10 1.2.2.9 Pending Bad Block Log File .............................. 1–10 1.2.2.10 Security Profiles File (VAX Only) . ....................... 1–11 1.2.3 Files–11 On–Disk Structure Level 1 Versus Structure Level 2 ...... 1–11 1.2.4 Physical Structures ....................................... 1–12 1.2.5 CD–ROM Concepts ....................................... 1–14 1.2.5.1 CD–ROM On-Disc Formats .............................. 1–14 1.2.5.2 Volume Structure ...................................... 1–14 1.2.5.3 Files–11 C/D—ACPs .................................... 1–15 1.2.5.4 Using DIGITAL System Identifiers on CD–ROM .............. 1–16 1.3 Magnetic Tape Concepts ...................................... 1–18 1.3.1 ANSI-Labeled Magnetic Tape ................................ 1–19 1.3.1.1 Logical Format of ANSI Magnetic Tape Volumes .............. 1–20 1.3.1.2 RMS Magnetic Tape Ancillary Control Process (MTAACP) ...... 1–20 1.3.1.3 Basic Components of the ANSI Magnetic Tape Format . ....... 1–20 1.3.1.4 Volume and File Configurations ........................... 1–23 1.3.1.5 Volume Labels ........................................ 1–27 1.3.1.5.1 VOL1 Label ....................................... 1–27 1.3.1.5.2 VOL2 Label ....................................... 1–27 1.3.1.6 Header Labels ........................................ 1–28 1.3.1.6.1 HDR1 Label ....................................... 1–28 1.3.1.6.2 HDR2 Label ....................................... 1–32 1.3.1.6.3 HDR3 Label ....................................... 1–35 1.3.1.6.4 HDR4 Label ....................................... 1–35 1.3.1.7 Trailer Labels . ........................................ 1–35 1.4 Using Command Procedures to Perform Routine File and Device Operations . ................................................ 1–35 1.5 Volume Protection . ........................................ 1–36 1.6 RMS (Record Management Services) ............................. 1–36 iii 1.6.1 File Definition Language (FDL) . ............................ 1–36 1.6.2 RMS Data Structures . .................................... 1–37 1.6.3 Record Management Services ................................ 1–37 1.7 RMS Utilities . ............................................ 1–38 1.7.1 The Analyze/RMS_File Utility . ............................ 1–38 1.7.2 The Convert Utility . .................................... 1–38 1.7.3 The Convert/Reclaim Utility ................................ 1–39 1.7.4 The Create/FDL Utility .................................... 1–40 1.7.5 The Edit/FDL Utility . .................................... 1–40 1.8 Process and System Resources for File Applications ................. 1–41 1.8.1 Memory Requirements . .................................... 1–41 1.8.2 Process Limits ........................................... 1–42 2 Choosing a File Organization 2.1 Record Concepts . ............................................ 2–1 2.1.1 Record Access Modes . .................................... 2–2 2.1.1.1 Sequential Access . .................................... 2–3 2.1.1.2 Random Access by Key Value or Relative Record Number ....... 2–6 2.1.1.3 Random Access by Record File Address . ................... 2–7 2.1.2 Record Formats .......................................... 2–8 2.1.2.1 Fixed-Length Record Format . ............................ 2–9 2.1.2.2 Variable-Length Record Format ........................... 2–9 2.1.2.3 Variable-Length with Fixed-Length Control Field (VFC) Record Format . ............................................ 2–11 2.1.2.4 Stream Record Format .................................. 2–13 2.2 File Organization Concepts .................................... 2–13 2.2.1 Sequential File Organization ................................ 2–15 2.2.2 Relative File Organization .................................. 2–17 2.2.3 Indexed File Organization .................................. 2–19 2.2.3.1 Sequentially Retrieving Indexed Records . ................... 2–19 2.2.3.2 Index Keys ........................................... 2–20 2.2.3.3 Other Key Characteristics . ............................ 2–20 2.2.3.4 Specifying Sort Order ................................... 2–24 2.2.3.5 Using Collated Keys .................................... 2–24 2.2.3.6 Summary of Indexed File Organization . ................... 2–25 3 Performance Considerations 3.1 Design Considerations ........................................ 3–1 3.1.1 Speed .................................................. 3–1 3.1.2 Space .................................................. 3–2 3.1.3 Shared Access ........................................... 3–3 3.1.4 Impact on Applications Design . ............................ 3–3 3.2 Tuning .................................................... 3–3 3.2.1 File Design Attributes . .................................... 3–4 3.2.1.1 Initial File Allocation ................................... 3–4 3.2.1.2 Contiguity ........................................... 3–4 3.2.1.3 Extending a File . .................................... 3–4 3.2.1.3.1 Auto Extend Size Selection ........................... 3–5 3.2.1.3.2 Establishing Auto Extend Default Quantities . ........... 3–6 3.2.1.3.3 Placement and Contiguity of Extends ................... 3–8 3.2.1.4 Truncating a File . .................................... 3–9 3.2.1.5 Units of I/O .......................................... 3–9 iv 3.2.1.6 Multiple Areas for Indexed Files . ....................... 3–10 3.2.1.7 Bucket Fill Factor for Indexed Files . ....................... 3–10 3.2.2 Processing Options ........................................ 3–10 3.2.2.1 Multiple Buffers ....................................... 3–11 3.2.2.2 Deferred-Write Processing ............................... 3–11 3.2.2.3 Global Buffers ........................................ 3–12 3.2.2.4 Read-Ahead and Write-Behind Processing ................... 3–13 3.3 Tuning a Sequential File ...................................... 3–13 3.3.1 Block Span Option ........................................ 3–13 3.3.2 Multiblock Size Option ..................................... 3–13 3.3.3 Number of Buffers ........................................ 3–14 3.3.4 Global Buffer Option ...................................... 3–14 3.3.5 Read-Ahead and Write-Behind Options . ....................... 3–14 3.4 Tuning a Relative File ........................................ 3–15 3.4.1 Bucket Size ............................................. 3–15 3.4.2 Number of Buffers ........................................ 3–16 3.4.3 Global Buffer Option ...................................... 3–17 3.4.4 Deferred-Write Option ..................................... 3–17 3.5 Tuning an Indexed File ....................................... 3–18 3.5.1 File Structure ............................................ 3–18 3.5.1.1 Prologs .............................................. 3–18 3.5.1.2 Primary Index Structure