KB SQL Database Administrator Guide a Guide for the Database Administrator of KB SQL
Total Page:16
File Type:pdf, Size:1020Kb
KB_SQL Database Administrator Guide A Guide for the Database Administrator of KB_SQL © 1988-2019 by Knowledge Based Systems, Inc. All rights reserved. Printed in the United States of America. No part of this manual may be reproduced in any form or by any means (including electronic storage and retrieval or translation into a foreign language) without prior agreement and written consent from KB Systems, Inc., as governed by United States and international copyright laws. The information contained in this document is subject to change without notice. KB Systems, Inc., does not warrant that this document is free of errors. If you find any problems in the documentation, please report them to us in writing. Knowledge Based Systems, Inc. 43053 Midvale Court Ashburn, Virginia 20147 KB_SQL is a registered trademark of Knowledge Based Systems, Inc. MUMPS is a registered trademark of the Massachusetts General Hospital. All other trademarks or registered trademarks are properties of their respective companies. Table of Contents Preface ................................................. vii Purpose ............................................. vii Audience ............................................ vii Conventions Used in this Manual ...................................................................... viii The Organization of this Manual ......................... ... x Additional Documentation .............................. xii Chapter 1: An Overview of the KB_SQL User Groups and Menus ............................................................................................................. 1 The Database Administrator ........................................................................... 2 The System Manager .................................................................................... 14 The User ........................................................................................................ 19 Chapter 2: Essential Globals and Routines .................................................... 21 The Essential Globals ......................................................................................... 22 The Essential Routines ................................................................................. 23 The Demonstration Globals .......................................................................... 24 Chapter 3: Configuring KB_SQL for Your Site ........................................... 25 BASE ROUTINE EDIT Option ................................................................... 27 EXPORT METHOD EDIT Option ............................................................... 33 FUNCTION EDIT Option ............................................................................ 37 IMPORT METHOD EDIT Option ............................................................... 46 KB_SQL Database Administrator’s Guide iii PSEUDO COLUMN EDIT Option .............................................................. 50 4 KB_SQL Database Administrator’s Guide SITE EDIT Option ........................................................................................ 54 START DATE EDIT Option ........................................................................ 95 REPORTS Option ......................................................................................... 97 Chapter 4: Managing Devices ............................. 101 DEVICE TYPE EDIT Option ........................... 102 LOGICAL DEVICE EDIT Option ....................... 119 REPORTS Option ..................................... 122 Supplying Input Translation Routines ..................... 124 Printing Strategies ..................................... 134 Chapter 5: Applying Security Measures .................... 141 Security for Users ..................................... 142 Security for User Groups ............................... 142 Security Levels ....................................... 143 Views and Security .................................... 147 Using the Default Security .............................. 151 Customizing Security .................................. 152 Eliminating Security ................................... 152 Integrating Security Systems ............................ 152 GROUP EDIT Option ................................. 153 USER EDIT Option ................................... 164 PUBLIC PRIVILEGES Option .......................... 171 REPORTS Option ..................................... 173 Chapter 6: Utilities ..................................... C KB_SQL Database Administrator’s Guide iii OMPILE ALL QUERIES Option ....................... 177 178 6 KB_SQL Database Administrator’s Guide EXPORT Option ...................................... 183 HALT QUERY Option ................................. 193 IMPORT Option ...................................... 194 JOB WATCH Option .................................. 197 LOCK STATUS Option ................................ 198 Calculating Table Statistics .............................. 201 STATISTICS Option .................................. 203 REPORTS Option ..................................... 211 TRANSACTION LOGS Option ......................... 213 Chapter 7: System Status ................................ 217 Chapter 8: KB_SQL’s Version Information ................ 221 Chapter 9: Transferring Data Dictionary Objects ........... 223 Transfer Objects and Methods ........................... 224 Transfer Combinations ................................. 226 The Transfer Utility .................................... 227 Chapter 10: External Interfaces ........................... 231 Running Compiled Query Routines ....................... 232 Using RUN^SQL .................................. 233 Using RUNQ^SQL ................................. 234 Using Your Own Device Selection and Device Control .... 236 Compiling SQL Statements into Routines .................. 239 Saving SQL Statements as a Query ....................... 240 Compiling a Set of Query Definitions ...................... 241 KB_SQL Database Administrator’s Guide 5 Deleting a Query Definition ............................. 242 Compiling a Set of Query Definitions ..................... 243 Compiling Statistics for a Set of Tables .................... 244 Chapter 11: Miscellaneous Interfaces ...................... 245 The SQL Routine ..................................... 246 The SQL0H Routine ................................... 254 The SQL0CHK Routine ................................ 259 The SQL0DT Routine ................................. 259 The SQL0FC Routine .................................. 264 The SQL0GI Routine .................................. 265 The SQL0RI Routine .................................. 266 The SQL0TM Routine ................................. 267 The SQL0TS Routine .................................. 268 Appendix A: Integrity Check ............................. A-1 Appendix B: The Handling of Null Values .................. B-1 Index .................................................. I-1 6 KB_SQL Database Administrator’s Guide Preface Purpose The KB_SQL Database Administrator’s Guide contains information about maintenance procedures for KB_SQL. This document is designed to help the database administrator (DBA) use the KB_SQL procedures effectively to ensure good performance and consistent operation of the system. Audience The manual is written for the database administrator of the KB_SQL system. The material is directed to those persons responsible for the smooth ongoing operation of the system. Experienced users and programmers will find this information helpful in the basic implementation of the system and for integrating the system with existing applications. We expect you to be familiar with M, the relational database model, and SQL. For those who want to increase their understanding of these topics, we have provided a list of publications in the “ Additional Documentation” section of this preface. We also suggest that you review Lesson 1: The Basics in the KB_SQL SQL Reference Guide to become familiar with the functions of the interface. KB_SQL Database Administrator’s Guide 7 Conventions Used in this Manual To help you locate and identify material easily, KB Systems uses the following style conventions throughout this manual. [key] Key names appear enclosed in square brackets. Example: To save the information you entered, type Y and press [enter]. {compile-time variables} References to compile-time replacement variables are enclosed in curly braces. The names are case sensitive. Example: {BASE} italics Italics are used to reference prompt names (entry fields) and terms that may be new to you. All notes are placed in italics. Example: The primary key of the table is defined as the set of columns that is required to retrieve a single row from the table. Windows The manual includes many illustrations of windows. Window names are highlighted by a double underline. viii KB_SQL Database Administrator’s Guide Prompt: data type (length) [key] The manual includes information about all of the system prompts. Each prompt will include the data type, length, and any special keys allowed. If the prompt is followed by a colon (Prompt:), you may enter a value for the prompt. If a prompt is followed by an equal sign (Prompt= ), it is for display purposes only. If the prompt is followed by a question mark (Prompt?), you can enter a value of YES or NO. ^GLOBAL All M global names will be prefixed by the '^' character. Tag^Routine All M routine references will appear as tag^routine. Menu Option/Menu Option/Menu Option A string