DB-13: Understanding VSTs By Paul Guggenheim. Copyright © 2005 Paul Guggenheim & Associates 2 DB-13: Understanding VSTs 2 About PGA  Working in Progress.

Slides:



Advertisements
Similar presentations
Progress System Tables
Advertisements

Benchmark Series Microsoft Access 2010 Level 1
McGraw-Hill/Irwin ©2008 The McGraw-Hill Companies, All Rights Reserved TECHNOLOGY PLUG-IN T4 PROBLEM SOLVING USING EXCEL Goal Seek, Solver & Pivot Tables.
Decision Analysis Tools in Excel
User Training. Step 1 Press Ctrl-I or choose File > Login, this will open the Login window. Figure 1-1 shows the Login window. Figure 1-1 Login Window.
6 th Annual Focus Users’ Conference 6 th Annual Focus Users’ Conference Scheduling Requests and Request Reports Presented by: Sara Sayasane Presented by:
An End-User Perspective On Using NatQuery Building a Dynamic Variable T
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Chapter 9 Chapter 9: Managing Groups, Folders, Files, and Object Security.
Automating Tasks With Macros
Creating Custom Forms. 2 Design and create a custom form You can create a custom form by modifying an existing form or creating a new form. Either way,
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
TEMP-TABLE Performance Tuning & Other Important Stuff
Management Information Systems MS Access 2003 By: Mr. Imdadullah Lecturer, Department of M.I.S. College of Business Administration, KSU.
Figure 1. Hit analysis in 2002 of database-driven web applications Hits by Category in 2002 N = 73,873 Results Reporting 27% GME 26% Research 20% Bed Availability.
Access Tutorial 10 Automating Tasks with Macros
Chapter 2 Querying a Database
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
Microsoft Office 2007 Access 2007 Chapter 9 Administering a Database System.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
Module 3: Table Selection
NextGen Trustee Department Disbursements This class will cover the various methods of handling department disbursements. Whether entering them manually.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 4 – Creating New.
6 Copyright © 2004, Oracle. All rights reserved. Working with Data Blocks and Frames.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
PHP meets MySQL.
Strength. Strategy. Stability.. Progress Performance Monitoring and Tuning Dan Foreman Progress Expert BravePoint BravePoint
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
Going Mobile with OpenEdge ® Basics Paul Guggenheim Paul Guggenheim & Associates.
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
Database Systems Microsoft Access Practical #1 Creating Tables Nos 215.
Key Applications Module Lesson 21 — Access Essentials
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
Summer Computing Workshop. Introduction  Boolean Expressions – In programming, a Boolean expression is an expression that is either true or false. In.
Indexed and Relative File Processing
Progress Database Admin 1 Jeffrey A. Brown - Technical Support Consultant
Microsoft Access 2010 Chapter 10 Administering a Database System.
® Microsoft Office 2013 Access Creating a Database.
Microsoft Access. Microsoft access is a database programs that allows you to store retrieve, analyze and print information. Companies use databases for.
Advanced JSP, Taglibs and Struts
Microsoft Access 2013 ®® Tutorial 12 Managing and Securing a Database.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Lesson 4.  After a table has been created, you may need to modify it. You can make many changes to a table—or other database object—using its property.
Work with Tables and Database Records Lesson 3. NAVIGATING AMONG RECORDS Access users who prefer using the keyboard to navigate records can press keys.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Visual Basic for Application - Microsoft Access 2003 Finishing the application.
Using Progress® Analytical Tools Adam Backman White Star Software DONE-05:
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 6 1 Microsoft Office Access 2003 Tutorial 6 – Creating Custom Forms.
Access Queries and Forms. Adding a New Field  To insert a field after you have saved your table, open Access, and open the table  It is easier to add.
Nextgen Bank Reconciliation Resource Bank Reconciliation Menu Financial Management Bank Reconciliation –Import Bank Statements –Reconcile Bank Accounts.
- The PUG Challenge - Brynjar Hasle, Chemistry as Geir O. Olsen, THInc Consulting as.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
NextGen Trustee GL/Accounting This class will cover NextGen Financial Management for Trustee Offices. We will look at GL accounts, Transactions, Bank Reconciliation,
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
Working in the Forms Developer Environment
Data Virtualization Tutorial: Introduction to SQL Script
Building a User Interface with Forms
Multi-host Internet Access Portal (MIAP) Enhancement Guide
Transaction & Record Scoping
NextGen Trustee General Ledger Accounting
Presentation transcript:

DB-13: Understanding VSTs By Paul Guggenheim

Copyright © 2005 Paul Guggenheim & Associates 2 DB-13: Understanding VSTs 2 About PGA  Working in Progress since 1984 and training Progress programmers since 1986  Designed six comprehensive Progress courses covering all levels of expertise  Major consulting clients include Foxwoods Casino, Health Informatics, Bank One, Textron Fastening Systems, and American Academy of Orthopaedic Surgeons

Copyright © 2005 Paul Guggenheim & Associates 3 DB-13: Understanding VSTs 3 What are VSTs ?  VST stands for Virtual System Table.  VSTs provide 4GL access to information contained in the Progress Monitor (promon) utility.  VSTs are schema tables that are stored in memory.

Copyright © 2005 Paul Guggenheim & Associates 4 DB-13: Understanding VSTs 4 Why Use VSTs ?  VSTs may be easily integrated into existing Applications.  Some startup parameters may be updated through VSTs.  Statistical Database Performance Reporting can be easily accomplished.  The Databases can be constantly monitored from within the Application.  Additional information about locking conflicts may be provided to the end-user.

Copyright © 2005 Paul Guggenheim & Associates 5 DB-13: Understanding VSTs 5 Accessing VSTs  VSTs are metaschema tables  Automatically included in Version 9  Must enable them in Version 8 with the following command: proutil dbname –C enablevst  To look at in GUI Dictionary, select: View->Show Hidden Tables  To look at in CHUI Dictionary, enter VST table name

Copyright © 2005 Paul Guggenheim & Associates 6 DB-13: Understanding VSTs 6 Viewing VSTs  VSTs are records in the _file metaschema table  _file-number range for VSTs (9.1D): to  Two new tables were added to OpenEdge 10.  _Code-Feature  _Database-Feature  One new field is added to OpenEdge 10.  _server._server-pendconn

Copyright © 2005 Paul Guggenheim & Associates 7 DB-13: Understanding VSTs 7 VST Inquiry  In program vstinq.p, the VST schema may be viewed.

Copyright © 2005 Paul Guggenheim & Associates 8 DB-13: Understanding VSTs 8 VST Characteristics  Every VST has one field that ends in ‘id’.  This field serves as the VST’s unique index.  This field is sequentially numbered from 1.  Exception is _TxeLock where Id field is ?.

Copyright © 2005 Paul Guggenheim & Associates 9 DB-13: Understanding VSTs 9 VST Characteristics  Many VSTs pre-allocate records based upon startup parameters. For example: proserve school -n 3 -Mn 3 -L 250 -B 500 produces a –n of 4.  Progress adds an extra user for shutting down the database or promon.

Copyright © 2005 Paul Guggenheim & Associates 10 DB-13: Understanding VSTs 10 VST Characteristics  Let’s look at the _Trans table:

Copyright © 2005 Paul Guggenheim & Associates 11 DB-13: Understanding VSTs 11 VST Characteristics  The default initial values in most VST fields is unknown (?).  The –Mn value is 3.  One record for each server and the one record for the database broker is displayed.

Copyright © 2005 Paul Guggenheim & Associates 12 DB-13: Understanding VSTs 12 VST Characteristics  Let’s look at _UserLock table. It shows which locks a particular user currently holds.

Copyright © 2005 Paul Guggenheim & Associates 13 DB-13: Understanding VSTs 13 VST Characteristics  _UserLock-Id 1 is the broker, 2,3 and 4 are the servers, 5,6 and 7 are connected users and 8 is a promon session.  The formula for this table is: –n + -Mn + 2 –n + -Mn + 2 where –n is the startup number of users.  Since the –L is 250, Progress rounds it to the nearest multiple of 32 which is 256.

Copyright © 2005 Paul Guggenheim & Associates 14 DB-13: Understanding VSTs 14 VST Characteristics  The _Lock file will look like the following:

Copyright © 2005 Paul Guggenheim & Associates 15 DB-13: Understanding VSTs 15 Resolving Locking Conflicts  As a developer, you had 2 choices in resolving locking conflicts: Option 1: Let Progress handle it.

Copyright © 2005 Paul Guggenheim & Associates 16 DB-13: Understanding VSTs 16 Resolving Locking Conflicts  As a developer, you had two choices in resolving locking conflicts: Option 2: Handling locking conflicts in the procedure repeat: prompt-for student.student-id. prompt-for student.student-id. find student using student-id exclusive-lock no-wait no-error. find student using student-id exclusive-lock no-wait no-error. if available student then update sfirst-name slast-name. if available student then update sfirst-name slast-name. else if locked student then do: else if locked student then do: find student using student-id no-lock no-error. find student using student-id no-lock no-error. message "Student record is locked” skip message "Student record is locked” skip "Please wait until later." view-as alert-box. "Please wait until later." view-as alert-box. end. end. else else message "Student number does not exist" view-as alert-box. message "Student number does not exist" view-as alert-box.end.

Copyright © 2005 Paul Guggenheim & Associates 17 DB-13: Understanding VSTs 17 Resolving Locking Conflicts  Problem with Option 1:  User has to undo their transaction.  The stop key, unless trapped, forces the user to the beginning of the application.  Problem with Option 2:  User doesn’t know who has locked the record…UNTIL VSTs!

Copyright © 2005 Paul Guggenheim & Associates 18 DB-13: Understanding VSTs 18 Resolving Locking Conflicts  Adding the statements below now provides the user with additional information about who has the record locked: find first _lock where _lock-recid = integer(recid(student)) no-error. message "Student record is locked by user:" _lock-name skip "Please wait until later." view-as alert-box. "Please wait until later." view-as alert-box.

Copyright © 2005 Paul Guggenheim & Associates 19 DB-13: Understanding VSTs 19 Record Locking Inquiries  For each user, Progress provides up to 512 locked records for display and lookup.

Copyright © 2005 Paul Guggenheim & Associates 20 DB-13: Understanding VSTs 20 Record Locking Inquiries  In lockinq.p, we start with the _UserLock table to show available users in a browse.  For each user selected there is another browse that shows the locked records for that user, it’s table name, RECID and lock flags.  To accomplish this, a temp-table is built storing the RECID and chain number from the corresponding array fields in the _UserLock table.

Copyright © 2005 Paul Guggenheim & Associates 21 DB-13: Understanding VSTs 21 Record Locking Inquiries  In lockinq.p, we start with the _UserLock table to show available users in a browse.  The second query is opened using this RECID and chain number to read the _Lock record to get the table number.  The table number is then used to read the _file metaschema table to get the table name for the browse.

Copyright © 2005 Paul Guggenheim & Associates 22 DB-13: Understanding VSTs 22 Record Locking Inquiries  In lockinq.p, we start with the _UserLock table to show available users in a browse.  For each locked record selected, the table name and RECID are passed to the getfieldvalues procedure which dynamically creates a query for that record.  It then calls the procedure showtable which displays the field names and values for that locked record using the tfld temp-table.

Copyright © 2005 Paul Guggenheim & Associates 23 DB-13: Understanding VSTs 23 Record Locking Inquiries

Copyright © 2005 Paul Guggenheim & Associates 24 DB-13: Understanding VSTs 24 4GL User Disconnect  The next program, disuser.p, allows someone to disconnect a user from within the 4GL.  The program uses the _connect and _myconnection VSTs.

Copyright © 2005 Paul Guggenheim & Associates 25 DB-13: Understanding VSTs 25 4GL User Disconnect  The next program, disuser.p, allows someone to disconnect a user from within the 4GL.  The _connect table is used for the query and browse for connected users.  The _connect-usr values that are unknown and the previously disconnected users (connect-disconnect = 1) are filtered out.  The _myconnection table is used to prevent someone from disconnecting themselves.  This table was added to V9 to make it easy to identify which connection is the current session.

Copyright © 2005 Paul Guggenheim & Associates 26 DB-13: Understanding VSTs 26 4GL User Disconnect  The next program, disuser.p, allows someone to disconnect a user from within the 4GL.  The actual user disconnection is performed by the _mprshut command using a temporary command text file as standard input.  Because a disconnection may take a few seconds, a pause of 15 seconds executes before re-opening the query. The _connect-disconnect field will be 1 when the disconnected process is finished.

Copyright © 2005 Paul Guggenheim & Associates 27 DB-13: Understanding VSTs 27 DB Area Statistics  The _DBStatus and the _AreaStatus VSTs supply useful information about the database and database areas.

Copyright © 2005 Paul Guggenheim & Associates 28 DB-13: Understanding VSTs 28 DB Area Statistics  In program dbareastat.p, the size of the bi is monitored along with the total number of locks, the highest number of locks and highwater marks for database areas.  In V9, the multi-volume bi size is reported by dividing the high water mark blocks by the bi block size.

Copyright © 2005 Paul Guggenheim & Associates 29 DB-13: Understanding VSTs 29 Record Requests  Promon provides a tremendous amount of database and performance statistics.  By using VSTs, this data can be processed any way desired.

Copyright © 2005 Paul Guggenheim & Associates 30 DB-13: Understanding VSTs 30 Record Requests  For example, the program userio.p shows the amount of activity for requests vs. record reads per user and in summary.  The _UserIO table provides information on a per user basis for reading and writing to the database, before- image and after-image files. This information may be found on the Block Access screen (3) in promon.  The _ActSummary table provides summary information and some of its data may be found on the Activity screen (5) in promon.  Some useful information provided by _ActSummary is the number of checkpoints and database buffers flushed.

Copyright © 2005 Paul Guggenheim & Associates 31 DB-13: Understanding VSTs 31 Record Requests

Copyright © 2005 Paul Guggenheim & Associates 32 DB-13: Understanding VSTs 32 Table Statistics  Table statistics are available through VSTs but not through promon.  Statistics on the number of times a table was read, updated, created and deleted are kept.  Note that data that is undone does not reduce the corresponding statistic.  Unfortunately, there is nothing in VSTs that link user access to specific records in tables.  For example, to show which records were read by a given user would be useful for security or for application troubleshooting purposes.

Copyright © 2005 Paul Guggenheim & Associates 33 DB-13: Understanding VSTs 33 Table Statistics  The program tablestat.p is used show the tables with the highest number of reads.  The Refresh button may be pressed to show the latest data.  Tablestat.p uses the _TableStat VST.

Copyright © 2005 Paul Guggenheim & Associates 34 DB-13: Understanding VSTs 34 Buffer Status  One of the most important parameters to set is the database buffers parameter, –B.  Setting it too high can waste memory and could cause swapping.  Setting it too low can cause increased disk access and performance degradation.  The _BuffStatus VST can be used to measure the effectiveness of the –B parameter.

Copyright © 2005 Paul Guggenheim & Associates 35 DB-13: Understanding VSTs 35 Buffer Status  In buffstat.p, the program opens the _bfstatus record in the query and displays it to the screen when the Refresh button is pressed.  This is the same information that is shown in promon under R&D->1 (Status Displays)-> 7 (Buffer Status).

Copyright © 2005 Paul Guggenheim & Associates 36 DB-13: Understanding VSTs 36 Buffer Status  In buffstat.p, the program opens the _bfstatus record in the query and displays it to the screen when the Refresh button is pressed.  With the –B set at 500, notice that the total buffers is 502.  One extra buffer is for the Database Master Block.  The 2 nd block included is called the Index Anchor Block and is not used in V9.

Copyright © 2005 Paul Guggenheim & Associates 37 DB-13: Understanding VSTs 37 Buffer Status  If a long report is run, such as: for each registration: end. then the unused buffers become filled from the report.

Copyright © 2005 Paul Guggenheim & Associates 38 DB-13: Understanding VSTs 38 Setting Read Only Buffers  Question: How do we prevent all the buffers being used up by a report? Answer: Set the read only buffers on the client.  Two ways to do this: 1.At startup using the –Bp parameter 2.Updating the _MyConn-NumSeqBuffers field in the _MyConnection VST.

Copyright © 2005 Paul Guggenheim & Associates 39 DB-13: Understanding VSTs 39 Setting Read Only Buffers  Read only buffers (ROBs) are new to V9. The –Bp parameter specifies the number of read-only blocks a client may have.  ROBs are part of the total –B buffer pool, so that the remaining buffers are available for modified buffers.  Once a client has ROBs allocated to them, a large report’s records will stay confined to the ROBs.

Copyright © 2005 Paul Guggenheim & Associates 40 DB-13: Understanding VSTs 40 Setting Read Only Buffers  We will start a session with a –Bp = 64.  We will run a series of reports from the editor: for each student no-lock for each registration no-lock  The used buffers increases slightly, but then remains fixed.

Copyright © 2005 Paul Guggenheim & Associates 41 DB-13: Understanding VSTs 41 Setting Read Only Buffers  Next, we run updrobuf.p, and set the read only buffers equal to 0.  We then run the reports and notice that the used buffers equal to the total buffers.  The used buffers is a high water mark. It will not go down even though the buffers may be re-used.

Copyright © 2005 Paul Guggenheim & Associates 42 DB-13: Understanding VSTs 42 Customizing PRO*Tools Toolbar  A convenient place to put the VST programs you created is on the PRO*Tools Toolbar.

Copyright © 2005 Paul Guggenheim & Associates 43 DB-13: Understanding VSTs 43 Customizing PRO*Tools Toolbar  It is fairly easy to add your own tools to this toolbar.  Right-mouse-click on the toolbar and select Menu Bar. A pull-down menu bar will appear on the toolbar.  Select File->Customize… then press the Add button to add your program.  Select Run Persistent, Display on palette and supply an image.  Select “yes” to override protools.dat so that your tools will show up on every session.

Copyright © 2005 Paul Guggenheim & Associates 44 DB-13: Understanding VSTs 44 Customizing PRO*Tools Toolbar  Make sure that the PROPATH environment variable contains the directory where your VST programs are located.  Two include files are required in order to be compatible with the PRO*Tools toolbar.  _adetool.i – contains a single internal procedure called ADEPersistent, which prevents the Progress Editor from removing the instance when running other programs.  _runonce.i – prevents multiple instances of the tool to be run at the same time.

Copyright © 2005 Paul Guggenheim & Associates 45 DB-13: Understanding VSTs 45 Customizing PRO*Tools Toolbar  Each option also contains its own dynamic window and is parented to the PGA toolbar window.

Copyright © 2005 Paul Guggenheim & Associates 46 DB-13: Understanding VSTs 46 Acknowledgements  I would like to thank Dan Foreman for writing the Virtual System Tables Guide. It was very helpful in creating this presentation.

Copyright © 2005 Paul Guggenheim & Associates 47 DB-13: Understanding VSTs 47 Summary  VSTs provide 4GL access to information contained in promon.  Many useful reports and tools may be created.