Monitoring
 
Monitoring
Monitoring Your PSQL Environment
PSQL is designed for ease of use and minimal administration. At times, however, you may want to monitor various conditions or resources in the PSQL environment. For example, you may need to tune portions of your application and monitor various performance aspects pertaining to the database. Or, you may have adjusted PSQL configuration settings for your business needs and want to monitor the changes from the default settings.
Monitoring is covered in the following topics:
Monitoring Database State
Monitoring Data File Fragmentation
Monitoring Performance Counters
Monitoring License Usage
Monitoring Database Access
Reviewing Message Logs
Receiving Email Notification of Messages
Monitoring Database State
You can monitor the state of your database with the Monitor tool. It allows you to oversee the following:
Active Files
MicroKernel Sessions
Resource Usage
MicroKernel Communication Statistics
SQL Active Sessions
If you are new to Monitor, or want an overview of the tool, see Monitor Overview.
Monitor Overview
Monitor is a tool that allows you to systematically observe certain activities and attributes of the database engine. It provides information useful for both database administration and application programming diagnostics. It can monitor aspects of both the MicroKernel Engine and the Relational Engine.
Monitor has two interfaces, both of which provide the same functionality:
Graphical Interface Monitor presents information in a series of tabs.
Command Line Interface Monitor uses an executable program that directs the information to a selected location.
Graphical Interface Monitor
PCC includes a Monitor tool that presents information organized into a series of tabs. The tabs can be rearranged for your convenience, with columns of data that can rearranged and sorted. It presents a snapshot of a particular moment and can be refreshed either manually or automatically.
Using GUI Monitor
Within PCC, you access Monitor from PSQL Explorer.
To access Monitor for a database engine
Use one of the following options to open the Monitor window. You can monitor multiple engines at the same time if you choose.
In PSQL Explorer, locate and open the Engines node. Right-click the database engine that you want to monitor, then click Monitor on the context menu.
Click Tools > Monitor. A dialog asks you to select a server to monitor.
To launch Monitor in a stand-alone window, such as for a third-party application, at a prompt you can use the -monitor_any parameter:
pcc.exe -monitor_any
A dialog asks you to select a server to monitor.
GUI Features
The table below the following image explains the user interface components. Click any area of the image for which you want more information.
Figure 5 Monitor User Interface
 
GUI Object
Description
Related Information
File menu
Allows you to set the refresh rate.
Window menu
Allows you to display the database window of the PCC and individual Monitor tabs, and to set preferences.
Help menu
Allows you to access the documentation and logs.
Tab Set area
Includes five tabs with grids that display information about activity occurring at that moment in the database. When you select a tab, a selection of icons that apply to that tab appear at the right of the row of tab labels.
Setting Monitor Preferences
You can set preferences for the Monitor from either Monitor itself or from PCC. In Monitor, select Window > Preferences > Monitor to open the Monitor tab of the Preferences dialog. In PCC, select Window > Preferences > PSQL > Server Monitor.
You can set two types of preferences. First, you can set the layout of the Monitor user interface, so that when you reopen Monitor, its tabs are arranged just as you left them. You can set this individually for each server that you access. Second, you can set the features for any particular grid, for example, column width, sort order, and column order. If you open that particular grid on another server, it follows the same settings. That way, you can easily compare the same grid on different servers.
Setting Refresh Options
Information in the Monitor can be refreshed automatically at a configured interval, as desired, or not at all. Be aware that refreshing too many windows at a short interval may slow performance.
Automatic refresh
1. Use the Set Automatic Refresh icon to turn on automatic refresh.
2. Either select File > Set Automatic Refresh Rate or click the Set Refresh Rate icon to open the Set Refresh Rate dialog box.
3. In the Set Refresh Rate dialog box, enter the number of second between each refresh and click OK.
Refresh as desired
Either select File > Automatic Refresh or click the Refresh icon.
No refresh
Use the Set Automatic Refresh icon to turn off automatic refresh.
Tab Functionality
Tabs can be rearranged, separated, and reaggregated for your convenience. To move a tab, put the cursor on the tab label, hold down the left mouse button, and pull the tab label where you want the tab to be.
Because of the different nature of the data on each tab, different operations can be performed on each tab. Those operations are initiated by the icons that appear at the right end of the row of tab labels. The following table describes the icons.
Table 31 GUI Icons
Icon
Meaning
Set Automatic Refresh
Toggles between automatic refresh on and automatic refresh off. See Setting Refresh Options.
Set Refresh Rate
Displays a dialog box in which you can set the number of seconds between each repopulation of the user interface with current information. See Setting Refresh Options.
Refresh
Repopulates the user interface with the current information.
Select Columns to Display
Displays a dialog box in which you can select which columns to display. Because each tab includes different columns, each dialog box includes a different list of column names. All dialog boxes include the choices Select All and Deselect All.
Hide/Show Handles
Toggles between displaying or hiding the Handle Information grid at the bottom of the tab. The Handle Information grid includes different information, depending on the tab.
The Handle Information grid also has a Select Columns to Display icon, so that you can hide or display columns as desired.
Delete Selected Session
Removes a highlighted session from the tab. This icon becomes activated only after a session is selected.
Caution: This procedure actually terminates a session, so you are interrupting someone’s work in progress. Consequently, a message asks you to confirm that you actually want to do this.
Delete All Sessions
Removes all sessions from the tab.
Caution: This procedure actually terminates all sessions, so you are interrupting work in progress. Consequently, a message asks you to confirm that you actually want to do this.
Reset the Deltas
Deletes a statistic and restarts the count at zero.
Monitoring Active Files
The Active Files tab provides information about MicroKernel files that are currently open. To select columns to monitor, see Select Columns to Display.
 
Table 32 Selectable Columns for Monitoring MicroKernel Active Files
Path
Provides the directory and all subdirectories to the location of the file.
File
Indicates the name, including suffix, of the file.
Page Size
Indicates the size in bytes of each page in the file.
Read-Only
Indicates whether the file is flagged as read-only by the operating system.
Record Locks
Indicates whether any of the active handles for the selected file have record locks. Any application can read a locked record, but only the application that placed the lock can modify or delete the record. A record lock exists only as long as the application that opened the file is updating a record. “Yes” indicates that one or more record locks are applied to the file. “No” indicates that no records are locked.
Transaction Lock
Indicates whether any of the active handles for the selected file have a transaction lock. A transactional file lock exists only as long as the application that opened the file is processing a transaction.
Physical File Size
Indicates the size of the file in kilobytes (KB). This information is particularly useful for the capacity-based license model if you want to review data in use on a file-by-file basis. See also Capacity-based License Model in PSQL User's Guide.
Monitor uses kilobytes (KB) for the size of an individual file and megabytes (MB) as the units for resource usage ( Monitoring Resource Usage). License Administrator uses gigabytes (GB) as the units because that is how data in use is associated with a key. The different contexts require units appropriate for each context.
If a file is immediately closed after you insert a large number of records, Monitor does not immediately reflect the changes in file size. For example, the statistics for Physical File Size KB are not refreshed for that file until the next time the file is opened for reading or writing.
You can view the handle information for any active file. See Hide/Show Handles. Active file handles include the following information.
Table 33 Selectable Columns for Active File Handles
Client
Indicates the name (typically the login ID of the user) or an index to the Client list of the database server.
Connection Number
Displays the network connection number of the client. If the client does not have a network connection, this field displays NA for “not applicable.”
Task Number
Displays the process-supplied task number for processes originating at the server or a Windows Client.
Site
Specifies the location of the user process (local or remote).
Network Address
Identifies the location of the calling process on the network. If the calling process is SPX, the network node/network address is preceded by S: such as S: 65666768 00000000001.
If the calling process is TCP/IP, the address is preceded by T4 for IPv4 addresses, T6 for IPv6 addresses, and T for the fully qualified domain name of a client machine. Examples:
T4: 180.150.1.24
T6: 1234:5678:0000:0000:0000:0000:9abc:def0
T: <mymachine.mydomain.mycompany>.com
Open Mode
Indicates the method the application uses to open the specified handle of the file. Valid open modes are the following:
Normal – The application that opened the file has normal shared, read/write access to it.
Accelerated – The application that opened the file has shared read/write access.
Read-only – The application that opened the file has read-only access; it cannot modify the file.
Exclusive – The application that opened the file has exclusive access. Other applications cannot open the file until the calling application closes it.
Monitor also specifies all open modes as nontransactional or shared locking when applicable.
Record Lock Type
Displays the type of record lock(s) currently held by the handle. The possible record lock types are Single, Multiple, and None.
Single-record locks enable a user to lock only one record at a time. Multiple-record locks enable a user to lock more than one record at a time.
Wait State
Indicates whether the user is waiting because of some type of lock on this handle: Waits for Record Lock, Waits for File Lock, or None.
Transaction State
Displays the state of the transaction lock currently held by the handle. The possible transaction types are Exclusive, Concurrent, or None.
Monitoring MicroKernel Sessions
The MicroKernel Sessions tab provides information about current connections to the MicroKernel Engine. To select columns to monitor, see Select Columns to Display.
 
Table 34 Selectable Columns for Monitoring MicroKernel Sessions
Session
Provides a unique identifier for the connection. A session is defined as a client ID used by the MicroKernel Engine or a connection to the Relational Engine. Client ID is defined as a 16-byte structure that combines elements provided by the application, by the client platform, and by the database engine to uniquely identify a database transaction context.
Session information reflects the sessions established through the MicroKernel Engine and through the Relational Engine. If you want to view sessions established only through the Relational Engine, see Monitoring SQL Active Sessions.
This tab allows you to delete a session or all sessions. See Delete Selected Session and Delete All Sessions.
Connection Number
Displays the network connection number of the session. If the session does not have a network connection, this field displays NA for “not applicable.”
Task Number
Displays the process-supplied task number for processes originating at the server, or from a Windows Client.
Site
Specifies the location of the session process (local or remote).
Network Address
Identifies the location of the calling process on the network. If the calling process is SPX, the network node/network address is preceded by S: such as S: 65666768 00000000001.
If the calling process is TCP/IP, the address is preceded by T4 for IPv4 addresses, T6 for IPv6 addresses, and T for the fully qualified domain name of a client machine.
Examples:
T4: 180.150.1.24
T6: 1234:5678:0000:0000:0000:0000:9abc:def0
T: <mymachine.mydomain.mycompany>.com
If multiple clients from a single machine connect by different TCP/IP addresses, each address is valid for that client. However, internally to the database engine, an address associated with a client may not be the actual address used by that client. This is because of the way the database engine identifies and manages multiple clients from the same machine. Consequently, since Monitor is reporting engine information, the tool may display an associated address instead of the actual address.
Locks Used
Indicates the number of locks the session is currently using.
Transaction State
Displays the type of transaction lock the session currently holds. The possible transaction types are Exclusive, Concurrent, or None.
Read Records
Displays the number of records read since the session first opened a file.
Inserted Records
Displays the number of records the session has inserted.
Deleted Records
Displays the number of records the session has deleted.
Updated Records
Displays the number of records the session has updated.
Disk Accesses
Indicates the number of times the session required a disk access. You will not see any information for disk accesses for files that have just been opened.
Cache Accesses
Indicates the number of times this client finds data in L1 or L2 cache in order to fulfill the request.
You can view the handle information for any MicroKernel session. See Hide/Show Handles. MicroKernel session handles include the following information.
 
Table 35 Selectable Columns for MicroKernel Session Handle Information
Path
Provides the directory and all subdirectories to the location of the file.
File
Indicates the name, including suffix, of the file.
Open Mode
Indicates the method the application uses to open the specified handle of the file. Valid open modes are:
Normal – The application that opened the file has normal shared, read/write access to it.
Accelerated – The application that opened the file has shared read/write access.
Read-only – The application that opened the file has read-only access; it cannot modify the file.
Exclusive – The application that opened the file has exclusive access. Other applications cannot open the file until the calling application closes it.
Monitor also specifies all open modes as nontransactional or shared locking when applicable.
Record Lock Type
Displays the type of record lock(s) currently held by the handle. The possible record lock types are Single, Multiple, and None.
Single-record locks enable a user to lock only one record at a time. Multiple-record locks enable a user to lock more than one record at a time.
Wait State
Indicates whether the user is waiting because of some type of lock on this handle: Waits for Record Lock, Waits for File Lock, or None.
Transaction State
Displays the state of the transaction lock currently held by the handle. The possible transaction types are Exclusive, Concurrent, or None.
Monitoring Resource Usage
The Resource Usage tab displays the resources in use by the MicroKernel since the engine was last started. To select columns to monitor, see Select Columns to Display.
The database engine dynamically controls the maximum values for some of these resources. The maximum value for User Count, Session Count, and Data In Use depends on the product license. See License Models in PSQL User's Guide.
If a resource does not apply to the type of PSQL product being monitored, “n/a” (“not applicable”) appears for each statistic. For example, User Count does not apply to PSQL Vx Server. Therefore, “n/a” appears as the Current, Peak, and Maximum value for User Count if PSQL Vx Server is being monitored. Similarly, “n/a” appears as the Maximum value for Session Count and Data in Use MB if PSQL Server is being monitored.
If you are considering using PSQL Vx Server, you need the ability to estimate Current and Peak values for Session Count and Data in Use MB. Consequently, those statistics are displayed for PSQL Server without being enforced. No notifications are sent about them regardless of their values.
 
Engine Uptime
Lists the amount of time in weeks, days, hours, and minutes that the MicroKernel engine has been running.
Engine Uptime is not a selectable column for Resource Usage. It is part of the grid title.
 
Table 36 Selectable Columns for Monitoring MicroKernel Resource Usage
Resource
Indicates the type of resource being monitored. See Resource Types for Resource Usage Monitoring.
Current
Indicates the current usage by a resource.
Peak
Indicates the the highest value for a resource since the MicroKernel was started.
Maximum
Indicates the highest allowed value for a resource.
The following table lists the types of resources for usage monitoring.
 
Table 37 Resource Types for Resource Usage Monitoring
Files
Indicates the number of files currently open by the MicroKernel. The maximum for this resource is unlimited.
Handles
Indicates the number of active handles. The MicroKernel creates a handle each time a user opens a file. A single session can have several handles for the same file. The maximum for this resource is unlimited.
Clients
Indicates the number of clients accessing the MicroKernel. A machine can have multiple clients accessing the database engine simultaneously. The engine dynamically manages the client list. The maximum for this resource is unlimited (the number of clients is limited only by the memory in the computer).
“Client” indicates a session established by a client ID (transactional engine interface) or a connection to the relational engine interface. The database engine uses various client sessions for its own internal processes, such as for accessing PSQL system files, metadata files, dbnames.cfg, and default system databases. The number of clients indicates both internal client sessions and non-internal client sessions (see Monitoring MicroKernel Sessions).
Worker Threads
Indicates the number of concurrent MicroKernel processes.
User Count
Indicates the number of concurrently connected users. The maximum value shows the maximum permitted users as granted by a license agreement.
Session Count
Indicates the number of sessions in use by the database engine. For brevity, “number of sessions in use” is also referred to “session count.” The maximum value (also called the “session count limit”) shows the maximum permitted sessions as granted by a license agreement.
Session count reflects all sessions whether established through the MicroKernel Engine or through the Relational Engine.
Messages pertaining to session count are logged to the various PSQL logging repositories. See Reviewing Message Logs.
The database engine uses various sessions for its own internal processes, such as for accessing PSQL system files, metadata files, dbnames.cfg, and default system databases. These internal sessions do not consume any session counts.
Data In Use MB
Indicates in megabytes (MB) the size of all concurrently open data files. The maximum value is the maximum permitted amount of all concurrently open data files as granted by a license agreement. The maximum is also called the “data in use limit.”
The value for data in use increases when a data file is first opened. Subsequent opens to an already open data file do not add to the total. Data in use also increases if an open file increases in size. Operations on an already open file continue to be permitted even if the size of the open file increases beyond the data in use limit.
The value for data in use decreases when a data file is closed by the final user to have the file open. Since more than one user can access the same data file, all opens must be closed before data in use decreases.
Messages pertaining to data are logged to the various PSQL logging repositories. See Reviewing Message Logs.
The database engine uses various files for its own internal processes, such as PSQL system files, metadata files, dbnames.cfg, and default databases. Files used for internal processes do not increase the value for data in use.
If a file is immediately closed after you insert a large number of records, Monitor does not immediately reflect the changes in file size. For example, the statistics for “Data in Use MB” are not refreshed for that file until the next time the file is opened for reading or writing.
Transactions
Indicates the number of transactions. The maximum for this resource is unlimited.
Locks
Indicates the number of record locks. The maximum for this resource is unlimited.
Monitoring MicroKernel Communication Statistics
The MicroKernel Communication Statistics tab displays information about communication with the MicroKernel Engine. It includes separate sections for Communications Statistics and Resource Usage Information. Communication statistics are calculated in terms of total number of occurrences processed since the database engine was started.
To select columns to monitor, see Select Columns to Display.
Engine Uptime
Lists the amount of time in weeks, days, hours, and minutes that the MicroKernel engine has been running.
Engine Uptime is not a selectable column for MicroKernel Communications Statistics. It is part of the grid title.
Communications Statistics
 
Table 38 Selectable Columns for Monitoring MicroKernel Communications Statistics
Resource
Indicates the type of resource being monitored. See Resource Types for MicroKernel Communications Statistics.
Total
Indicates the total number of occurrences processed since the database engine was started.
Delta
Indicates the number of occurrences processed since you last accessed the MicroKernel Communications Statistics tab. To restart the count of the delta number, see Reset the Deltas.
 
 
Table 39 Resource Types for MicroKernel Communications Statistics
Total Requests Processed
Indicates the number of requests the database engine has handled from workstations or remote, server-based applications.
SPX Requests Processed
Indicates the number of SPX requests the database engine has handled from clients or remote, server-based applications.
TCP/IP Requests Processed
Indicates the number of TCP/IP requests the database engine has handled from clients or remote, server-based applications.
NetBIOS Requests Processed
Indicates the number of NetBIOS requests the database engine has handled from clients or remote, server-based applications.
Connection Timeouts
Indicates the number of times Auto Reconnect has timed out when attempting to reconnect to Clients. See also Auto Reconnect Timeout.
Connection Recoveries
Indicates the number of times the Auto Reconnect feature has successfully recovered from a connection timeout.
Resource Usage Information
Resource usage information provides current, peak, and maximum values for resource occurrences.
 
Table 40 Selectable Columns for Monitoring Resource Usage Pertaining to MicroKernel Communications Statistics
Resource
Current
Indicates the current usage by a resource.
Peak
Indicates the highest value for a resource since the MicroKernel was started.
Maximum
Indicates the highest value allowed for a resource.
 
Table 41 Resource Types for Resource Usage Pertaining to MicroKernel Communications Statistics
Communications Threads
Indicates the number of remote requests that the MicroKernel is currently processing. Local requests are not included in this statistic. For the total number of remote and local threads being processed, see Monitoring Resource Usage.
The database engine dynamically increases the number of communications threads as needed up to the maximum allowed. For Windows, Linux, and macOS, the maximum is 1024.
Worker threads are also used to process Monitor requests, so you might not see the number of current worker threads drop below one. This is normal.
Total Remote Sessions
Indicates the number of remote clients connected to the database engine. The maximum number is dynamic and displays as zero.
SPX Remote Sessions
Indicates the number of remote clients connected through the SPX protocol to the database engine.
TCP/IP Remote Sessions
Indicates the number of remote clients connected through the TCP/IP protocol to the database engine.
NetBIOS Remote Sessions
Indicates the number of remote clients connected through the NetBIOS protocol to the database engine.
Monitoring SQL Active Sessions
The SQL Active Sessions tab provides information about current connections to the Relational Engine. This tab also allows you to delete a SQL session. See Delete Selected Session. To select columns to monitor, see Select Columns to Display.
Table 42 Selectable Columns for Monitoring SQL Active Sessions
User Name
Provides the login name of the user.
Client Host Name
Identifies the name of the Client machine for the selected User Name. If unavailable, this is set to “Unknown.”
Network Address
Identifies the Client machine’s IP or SPX address for the selected User Name. If unavailable, this is set to “Unknown.”
Values displayed include IP, SPX, Shared Memory and Unknown.
Client Application
Identifies the connected application or module. If unavailable, this is set to “Unknown.”
Data Source Name
Identifies the name of the DSN referenced by the Client application.
Connection Status
Specifies the connection status for the selected User Name. A status can be any of the following:
Active – The session has files open. and that Idle means that the session has no files open.
Idle – The session has no files open.
Dying – A temporary status that indicates an active session has been deleted but has not finished processing the SQL code. At a suitable termination point, the session is no longer listed on the SQL Active Session dialog.
Unknown – Status is unavailable.
Active/Idle Period
Displays the duration of time, in milliseconds, since the connection has been active or idle.
Total ConnectionTime
Displays the duration of time, in seconds, since the connection has been established
Command Line Interface Monitor
The following topics cover the command line interface (CLI) version of Monitor, called bmon, which provides the same features:
Accessing Bmon
Configuration File Settings
Bmon Output
Accessing Bmon
The bmon command line tool runs on the Windows, Linux, macOS, and Raspbian platforms supported by PSQL. Depending on the platform, its executable program may be bmon.bat, bmon.exe, or simply bmon on Unix-based systems. On systems that support Java, the JRE components needed to run bmon are installed with PSQL. On Windows systems the tool is installed in the bin directory of the PSQL installation location. On Unix systems it is located in /usr/local/psql/bin.
Configuration File Settings
Bmon uses a configuration file for its settings. PSQL provides a default configuration file monconfig.txt. in the bin directory of the PSQL installation location. Comments document the settings in the file.
Bmon Output
Output from bmon can be directed to the console, a log file, or both. The configuration file specifies where to direct the output. An application could, for example, check the console or log file for a particular condition, and then take appropriate action.
Command Syntax
bmon -f [filepath]config_file [-runonce]
Options
-f
A required parameter to specify that a configuration file is providing input to the tool.
filepath
The path to the configuration file. If omitted, Bmon checks the local directory for the configuration file.
config_file
The name of the configuration file. The file name is of your choosing. By default, installation includes a working file named monconfig.txt in the bin directory of the PSQL installation directory, which includes comments documenting all available options.
-runonce
Optional parameter to run bmon once and exit. This parameter is particularly useful when bmon is called from a batch file. See also Running Bmon Without the Runonce Parameter.
Note: In command line environments with no stdin, such as a remote PowerShell session, bmon uses this option even if it is not specified. To run bmon more than once, use the limitrefresh setting in the bmon configuration file.
Running Bmon Without the Runonce Parameter
The runonce parameter is optional. Without it, bmon uses the settings in the specified configuration file. In the sample file monconfig.txt, the initial refresh rate is set to 5 seconds. At any time during bmon execution, you can use Q (or q) + Enter to exit manually.
If the refresh rate is zero, bmon pauses until it receives a keyboard response. The refreshrate setting in the configuration file specifies how many seconds to pause.
Refresh Options
Notes
refreshrate=5
(pause for 5 seconds and then run bmon again)
refreshrate=0
(pause until valid keyboard response received)
The value must be zero or a number 5 or higher.
Default value in the sample file monconfig.txt is 5.
limitrefresh=0
(manually stop bmon using Q or q + Enter)
limitrefresh=n
(run bmon n times and then exit)
Maximum value is 2147483647.
Default value in the sample file monconfig.txt is zero.
In sessions where stdin would be expected locally but is missing because of a remote connection, bmon exits with the warning “Interactive input failure detected.” Setting limitrefresh to 1 or higher suppresses this message.
Monitoring Data File Fragmentation
Over time in a busy database as records are created, updated, or deleted, data can become fragmented, lengthening times for file access and transaction response. This fragmentation differs from file system fragmentation on a hard disk because it occurs within the data file itself. As a developer or DBA, you may know when a file is likely to fragment from heavy use, but in some systems, you may be guessing.
Defragmenter is a tool that helps you solve this problem by finding data fragmentation and enabling you to correct it. Defragmentation rearranges records and rebuilds indexes in data files and removes unused space so that data can be efficiently accessed again. Defragmenting a file does not alter its data in any way, and records can be created, read, updated, or deleted while their files are being defragmented. You can use Defragmenter features during database engine execution with no need for down time or disruption of business operations in most cases.
Opened as a graphical tool in PSQL Control Center, Defragmenter shows data files in use, including their number of reads and writes so that you can quickly find ones under heavy use. To add files or tables to the Watch List tab, select them and then drag-and-drop, click a button, or right-click and choose the command. If you know of Btrieve files in other locations, you can browse to them and add them to be watched as well.
Defragmenter also runs as the dbdefrag tool.
The following topics cover the use of Defragmenter:
Deciding When to Defragment
When Defragmenter Cannot Be Used
Accessing Defragmenter
Defragmenter GUI
Setting Defragmenter Preferences
Setting Automatic Refresh Interval
Arranging Tabs
Defragmenter Tasks
Command Line Interface Defragmenter
See Automatic Defragmentation for information about using Defragmenter in an unattended mode.
Deciding When to Defragment
Defragmenter helps you analyze your data files for statistics that may explain loss of performance. High statistics for file size and percentage fragmented, unused, and not in order can explain loss of database performance. By defragmenting a file or table, you can reduce all four of these numbers, which are explained in more detail under the Watch List topic. Transactions generally run more quickly against a newly compacted, reindexed file, restoring efficiency, capacity, and performance.
Every database is different, so it isn’t possible to make recommendations that apply to everyone. The decision to defragment depends on your knowledge and experience with your own database and its applications. However, some general considerations are worth making:
Performance remains constant in read-only databases, but as reads and writes occur over time, analysis of watched files will show rising values for statistics. Changes in database behavior may also become noticeable, such as queries and reports running more slowly.
Bulk delete actions often greatly increase unused space in files, which can be corrected by defragmenting them.
Reads and writes continue uninterrupted during defragmentation. However, for the following reasons you may want to consider low traffic times for your defragmentation strategy:
Defragmentation uses resources that normally are fully devoted to operations on data files, so the extra demands on the engine may cause small effects on performance in high traffic periods.
Defragmenting must very briefly lock each data file it runs against. In low traffic periods, this lock may not be noticeable, but in high traffic times, clients may wait slightly for responses.
If you do not see performance improvements after defragmenting, then the problem likely lies elsewhere and requires a different diagnosis and solution.
When Defragmenter Cannot Be Used
In some cases, Defragmenter cannot be used or will be canceled by database activities of higher priority.
Defragmentation of files on clients is not currently supported. Files can be defragmented only on the local server where the tool runs.
The disk space needed to defragment a file is displayed in the analysis results. Defragmenter requires free disk space equal to the size of the file, plus a small amount for defragmenting operations. Files undergoing high write activity may require more space.
If free disk space is too low, then the engine denies attempts to start defragmentation and returns error code 126. If space becomes low on a disk volume while defragmentation is executing there, the engine cancels defragmentation of files on that volume and returns 126.
If defragmentation starts but then the disk volume where defragmentation is executing becomes full, the engine cancels defragmentation activity on that volume and returns error code 18.
Use other PCC tools to make changes to indexes and metadata, including:
Creating, modifying, or deleting indexes
Modifying a schema, such as creating, modifying, or deleting a column
Deleting databases, tables, or data files
Changing database, table, or file names
Setting or clearing owner names
Creating, modifying, or deleting bound databases
Backup Agent operations cannot be performed on a file undergoing defragmentation. To perform defragmentation, you must first exit from Backup Agent.
Continuous operations for data backup cannot be performed on a file undergoing defragmentation because their higher priority cause defragmentation to be canceled. To perform defragmentation, you must wait for these operations to finish.
Defragmentation is not currently supported for a server engine in an environment where VSS has performed backup operations
If you need to alter data file properties, such as page size, compression, or file version, use Tools > Rebuild instead of Defragmenter.
Defragmenter stops and exits automatically if it finds corrupted or erroneous records. In these cases, use Rebuild to recover the data. Freshly rebuilt files do not need defragmenting.
For DataExchange users: Defragmentation does not change the system data and key used by DataExchange. After defragmenting, you do not need to run the table synchronization and check tool dxsynctables.
Accessing Defragmenter
Defragmenter runs in three ways:
In PSQL Control Center, select Tools > Defragmenter. For details, see Defragmenter GUI.
At a command prompt, run dbdefrag. Note that this differs from defrag, the Microsoft tool for defragmenting Windows file systems. For details, see Command Line Interface Defragmenter.
The Automatic Defragmentation option can be turned on in the Performance Tuning configuration settings for a server engine. For details, see Automatic Defragmentation.
Defragmenter GUI
The following illustration shows the Defragmenter GUI. The table after the image describes the GUI objects. Click an area of the image for which you want more information.
 
GUI Object
Description
File menu
Allows you to set the refresh rate for the Watch List tab, exit Defragmenter, or exit PCC.
Window menu
Allows you to return to the PCC window or to set preferences.
Help menu
Allows you to access documentation and logs and to check the PSQL version.
 
Table 43 Defragmenter Icons
Icon
Meaning
Cancel all defragmentation
Allows you to manually stop all analysis or defragmentation. Cancellation means that any file currently being analyzed will show no new statistics. Files being defragmented but not yet finished will be unchanged. Files awaiting analysis or defragmenting will not be done.
In the upper left corner of the window, click this icon to cancel all active analysis and defragmentation operations. You do not need to select any files to use this option.
Note: You can cancel all operations from the Defragmenter window even if they were started at a command prompt, and vice versa.
Set the automatic refresh rate
Opens a dialog to set how often the Watch List tab updates progress. The value is in seconds. The default is 5.
Refresh
Allows you to manually refresh the list of items in the Files In Use, Tables, or Btrieve Files tabs. Note that setting the automatic refresh rate affects only the Watch List tab.
Add to Watch List
Enters selected items in the Watch List tab. Use Ctrl-click to add one item at a time to the selection or shift-click to select a range. You can also use Ctrl-A to select all items.
Analyze file
Gathers and displays fragmentation statistics for items selected in the Watch List tab. Use Ctrl-click to add one item at a time to the selection or shift-click to select a range. You can also use Ctrl-A to select all items. Analysis does not change the file being analyzed.
Defragment file
Starts defragmentation for items selected in the Watch List tab. Use Ctrl-click to add an item to the selection or shift-click to select a range. You can also use Ctrl-A to select all items.
Cancel defragmentation
Allows you to selectively stop analysis or defragmentation. Canceling means that files being analyzed show no new statistics. Files being defragmented but not finished are unchanged.
In the icons to the right above the Watch List, this icon becomes available when files in the Watch List are undergoing analysis or defragmentation. Selecting one or more files and clicking this icon cancels the operation for those files. Use Ctrl-click to add one item at a time to the selection or shift-click to select a range. You can also use Ctrl-A to select all items.
Remove file
Removes an item from the Watch List tab. Use Ctrl-click to add one item at a time to the selection or shift-click to select a range. You can also use Ctrl-A to select all items.
Select columns to display
Opens a dialog of check boxes to customize the columns in the Watch List tab. The default is for all columns to be displayed.
Show or Hide details
Toggles the display of the Details pane.
Defragmenter Tab Views
Defragmenter presents database tables, files, and other objects in tabs in the Defragmenter window.
Files In Use
Tables
Btrieve Files
Watch List
The tabs in the window can be rearranged. See Arranging Tabs.
Files In Use
The Files In Use tab lists items currently or recently opened by the PSQL engine. You can add files shown in this tab to the Watch List tab to monitor, analyze, and defragment. It is best practice to select only files involved in routine database execution, since they are most likely to contribute to performance issues.
In the Files In Use tab, you can sort the list by clicking the Reads/Writes column heading. Sorting the list helps to identify which files are in heaviest use and possibly more fragmented.
Tables
The Tables tab resembles PSQL Explorer, showing nodes for the server where Defragmenter is running. You can add any file shown in this tab to the Watch List tab.
Btrieve Files
The Btrieve Files tab is a file explorer for drives and directories on the file system. In addition to data files, this tab also lists items not involved in routine operations, such as dbnames.cfg and .ddf files. It is possible to add these files to the Watch List tab to analyze and defragment, but unlike data files, attempting to change them while they are in active use returns errors. These metadata objects are at low risk of fragmentation because they generally do not change in a production environment. In the rare case of their needing defragmenting, it can be done during down-time maintenance.
Watch List
Items in the Watch List tab display statistics after an Analyze or Defragment action has been applied.
Statistic
Measures
Interpretation
File size (MB)
File size in megabytes
The longer a file has been in use, the greater the amount of unused space it may contain, increasing its size.
Smaller file sizes typically take less time to defragment, unless they have a large number of indexes.
For Vx users, the larger size of fragmented files may be a concern, so defragmentation may help to stay within your license limit.
% Fragmented
Percentage of data residing in blocks separated by unused space
Transactions over time can result in pages containing no data. The more these pages are intermixed with actual data pages, the greater the fragmentation.
A lower percentage indicates fewer, larger data blocks stored closer together, allowing more rapid reads and writes.
Note: This statistic is not supported for Btrieve 6.x and 7.x files. You can analyze and successfully defragment these earlier file versions, but no measurements can be shown for these statistics.
% Unused
Percentage of unused space
Unused space is often created when a file is modified by insert, update and delete operations.
The lower this percentage, the more compact the file, allowing more rapid reads and writes.
Note: This statistic is not supported for Btrieve 6.x and 7.x files. You can analyze and successfully defragment these earlier file versions, but no measurements can be shown for these statistics.
% Not in Order
Percentage of records not stored sequentially
Inserts over time result in a widening mismatch between the logical order of pages and their physical locations, increasing the time needed to locate data.
A lower percentage generally gives higher performance for actions such as table scans on large files.
Note: In some files, the lowest possible percentage not in order may be higher than zero. Further defragmentation does not decrease this statistic because records in the file are already stored as efficiently as possible.
Last Run
Date and time of last action
Action can be Analyze or Defragment.
Status
Report from last action
Blank for newly added item. Typically notice of analysis or defragmentation completed.
Table
Logical location
Database and table or file name
Path
Physical location
File system path
Details
Under the Watch List tab, a Details pane summarizes the statistics in the Watch List columns, but with some additional information:
Time taken to defragment the item
Before and after comparisons of file size and percentage fragmented, unused, and not in order
Selecting an item in the Watch List tab displays its details. If you select more than one item, details are shown for the first one highlighted.
Setting Defragmenter Preferences
You can set preferences for Defragmenter from either the tool itself or from PSQL Control Center. In either GUI, select Window > Preferences > PSQL > Defragmenter to open the Defragmenter tab of the Preferences dialog box.
The following table shows the types of preferences you can set and what they do.
Preference
When selected...
Remember window layout.
Saves the current arrangement of Defragmenter tabs when you exit the tool, as well as the overall window size, height, and position.
Don’t warn about incompatible actions during multi-select operations.
Stops the dialog box from showing when actions will be unevenly applied to items of different types.
Don’t warn about canceling defragmentations again.
Stops the dialog box from showing a warning when you cancel an analysis or defragmentation.
If you selected the check box in the dialog to confirm canceling, this box also becomes checked. To make the confirmation dialog appear again, clear this check box.
Don’t warn about canceling all defragmentations again.
Stops the dialog box from showing a warning when you cancel all analysis and defragmentation operations.
If you selected the check box in the dialog to confirm canceling, this box also becomes checked. To make the confirmation dialog appear again, clear this check box.
Setting Automatic Refresh Interval
Information in Defragmenter can be refreshed automatically at a configured interval. The default is to refresh every 5 seconds. Be aware that refreshing too many files too often may slow performance.
Arranging Tabs
The Defragmenter tabs can be rearranged and separated for your convenience. To move a tab, drag and drop the tab label where you want the tab to be. If the setting to remember window layout is selected in the Defragmenter preferences, your tab arrangement will be kept.
Defragmenter Tasks
This topic provides steps for using features for various tasks in the Defragmenter GUI.
To set automatic refresh interval
The automatic refresh rate applies to the statistics in the Watch List tab. Refreshing of lists in the other tabs is done manually by clicking the Refresh icon or right-clicking and selecting Refresh.
1 Click File > Set Automatic Refresh Rate or click the Set the Automatic Refresh Rate icon to open the refresh rate dialog box.
2 In the dialog box, enter the number of seconds between each refresh. The value must be an integer greater than 1.
3 Click OK.
To add a file or table to the Watch List tab
Adding a file or table to the Watch List tab can be done in a number of ways:
In Defragmenter, select one or more items in the Files In Use, Tables, or Btrieve Files tabs and then click the Add to Watch List icon at upper right in the tab. Use Ctrl-click to add one item at a time to the selection or shift-click to select a range. You can also use Ctrl-A to select all items.
In Defragmenter, right-click an item in the Files In Use, Tables, or Btrieve Files tabs and select Add to Watch List.
In Defragmenter, drag and drop an item from any tab to the Watch List tab.
Items added to the Watch List tab appear at the end, after the items already there.
To analyze a file or table
Analysis reports statistics that determine which items may need defragmenting.
1 In the Watch List tab, click items to select them. Use Ctrl-click to add one item at a time to the selection or shift-click to select a range. You can also use Ctrl-A to select all items.
2 Do one of the following:
In the Watch List tab at top right, click Analyze.
Right-click the selected items and click Analyze File.
The Watch List tab reports analysis results by updating its columns. For the first item selected, the Details tab provides individual status, including the free disk space needed to defragment the file.
To defragment a file or table
1 In the Watch List tab, click items to select them. Use Ctrl-click to add one item at a time to the selection or shift-click to select a range. You can also use Ctrl-A to select all items.
2 Do one of the following:
In the Watch List tab at top right, click Defragment.
Right-click the selected items and click Defragment File.
The Watch List tab reports defragmentation results by updating its columns. For each item selected, the Details tab below provides individual status. For multiple selected items, the first one selected is shown.
To cancel analysis or defragmentation
During analysis or defragmentation, select a file in the Watch List and click the Cancel Defragmentation icon on the right. In the dialog that appears, click Yes to confirm. The Defragmenter operation continues until you click Yes.
Alternatively, you can click the Cancel All Defragmentations icon on the left. This icon stops all analysis and defragmentation activity, while the one on the right is for selected files in the Watch List that are undergoing analysis or defragmentation.
After cancellation, status for some items in the Watch List tab may be Analysis: Completed or Defrag: Completed, with new statistics, while others display Analysis:Canceled or Defrag: Canceled and blank statistics. For a canceled item, the Details tab description gives the time that passed until the moment of cancellation.
Successful cancellation means that analysis was stopped or that fragmentation in the file or table is unchanged.
Note You can cancel all operations from the Defragmenter window even if they were started at a command prompt, and vice versa.
To remove a file or table from the Watch List tab
1 In the Watch List tab, click items to select them. Use Ctrl-click to add one item at a time to the selection or shift-click to select a range. You can also use Ctrl-A to select all items.
2 Do one of the following:
In the Watch List tab at top right, click the Remove File icon .
Right-click the selected items and click Remove File.
To select columns to display
You can set every column in the Watch List tab to be shown or hidden.
1 In the Watch List tab at top right, click the Select Columns to Display icon .
2 By default, all choices are selected. Make any needed changes and click OK or click Cancel.
To hide or show details of analysis or defragmentation
You can toggle to hide or show the Details tab by clicking the Click to Hide Details icon .
Command Line Interface Defragmenter
The CLI tool dbdefrag provides the same functions as its GUI counterpart, except that there is no watch list. Defragmentation actions can be started, checked for status, or canceled from either interface.
The following table gives command line options.
Command
Description
dbdefrag files
Start defragmentation on one or more files. You may use asterisks as wildcards. Displays the number of records and keys processed. You can use Ctrl-C to cancel. In addition to path names, files can also be specified as a URI using the syntax brtv://user@host/dbname?parameters, as described under Database URIs.
dbdefrag -background files
Start defragmentation on one or more files as a background process. You may use asterisks as wildcards.
dbdefrag -cancel files
Cancel the currently running analysis or defragmentation for one or more files. You may use asterisks as wildcards. Must be executed at a separate prompt unless the defragmentation is running in the background.
dbdefrag -cancelall
Cancel all active analysis and defragmentation operations. Must be executed at a separate prompt unless the defragmentation is running in the background.
Note: You can cancel all operations from the Defragmenter command prompt even if they were started in the Defragmenter GUI window, and vice versa.
dbdefrag -status files
Show defragmentation status for one or more files. You may use asterisks as wildcards.
Displays the following for the most recently completed defragmentation:
Status: Complete
Started: yyyy-mm-dd hh:mm:ss
Finished: yyyy-mm-dd hh:mm:ss
Time taken: nh:nnm:nns
Displays the following for a defragmentation currently running:
Defragmentation status: In Progress
n out of n records processed (n%)
n out of n keys processed (n%)
Displays the following for a canceled defragmentation:
Status: Defragmentation Canceled
Time taken: nh:nnm:nns
File status remains available until the engine is restarted. After an engine restart, you can find status information in the PSQL event log (pvsw.log).
dbdefrag -analyze files
Show fragmentation statistics for one or more files. You may use asterisks as wildcards. Returns the following:
% Fragmented
% Unused
% Not in Order
File Size (MB)
Estimated disk space needed for defragmenting (MB)
Analysis does not change the file being analyzed.
dbdefrag -ignore
Ignore errors during file processing. You can add this option to any command. It is useful when you are analyzing or defragmenting multiple files. Without the -ignore option, if one of the files being analyzed or defragmented returns an error, then the error is logged and analysis and defragmentation operations stop for remaining files. If you use the -ignore option, then the error is logged and analysis and defragmentation continue on the rest of the files.
dbdefrag -help
Display the list of command options.
Using dbdefrag
The following example shows a series of steps to demonstrate use of dbdefrag on a large .mkd file.
1 Analyzing
C:\ProgramData\Actian\PSQL\Examples>dbdefrag -analyze mybtrievefile.mkd
  Fragmented: 9%
      Unused: 4%
Not in Order: 100%
   File Size: 713 MB
2 Defragmenting
C:\ProgramData\Actian\PSQL\Examples>dbdefrag mybtrievefile.mkd
1125 out of 1195242 records processed (0%)
87021 out of 1195242 records processed (7%)
170910 out of 1195242 records processed (14%)
255393 out of 1195242 records processed (21%)
339805 out of 1195242 records processed (28%)
404202 out of 1195242 records processed (33%)
487928 out of 1195242 records processed (40%)
572585 out of 1195242 records processed (47%)
655802 out of 1195242 records processed (54%)
716472 out of 1195242 records processed (59%)
800406 out of 1195242 records processed (66%)
883729 out of 1195242 records processed (73%)
947475 out of 1195242 records processed (79%)
1032061 out of 1195242 records processed (86%)
1116015 out of 1195242 records processed (93%)
1185831 out of 1195242 records processed (99%)
1195242 out of 1195242 records processed (100%)
1 out of 2 keys processed (50%)
2 out of 2 keys processed (100%)
Defragmentation complete.
Time taken: 0h:24m:57s
3 Checking Status from Another Prompt or When Running in Background
C:\ProgramData\Actian\PSQL\Examples>dbdefrag -status mybtrievefile.mkd
Defragmentation status: In Progress
1053373 out of 1195242 records processed (88%)
0 out of 2 keys processed (0%)
4 Checking Status After Defragmenting
C:\ProgramData\Actian\PSQL\Examples>dbdefrag -status mybtrievefile.mkd
    Status: Complete
   Started: 2014-08-08 11:08:28
  Finished: 2014-08-08 11:33:25
Time taken: 0h:24m:57s
5 Analyzing Again
C:\ProgramData\Actian\PSQL\Examples>dbdefrag -analyze mybtrievefile.mkd
  Fragmented: 0%
      Unused: 0%
Not in Order: 27%
   File Size: 682 MB
Monitoring Performance Counters
PSQL Server for Windows provides performance counters for use with the Windows Performance Monitor. (The PSQL performance counters are supported only on Windows Vista or later Windows operating systems.) The performance counters measure state or activity of the database engine, which allows you to analyze performance of your application. Windows Performance Monitor requests the current value of the performance counters at specified time intervals.
PSQL provides data only for display by the Performance Monitor and cannot modify the counter properties. Performance Monitor controls the following:
The display of data is in three formats: line graph (default), histogram, and as a text report.
The display fields are labeled Last, Average, Minimum, and Maximum.
The scaling of values for display. PSQL provides a default scale for each counter. Performance Monitor allows you to change the scaling of individual counters. See To Change a Counter Scale.
The counter values reflect all calls into the database engine regardless of their source. That is, the MicroKernel Engine, Relational Engine, native Btrieve applications, utilities, and so forth, all contribute to the counter values. Counter values are collected for all files. Counters on a per-file basis are not currently supported.
Note that the use of performance counters is an advanced feature intended primarily for application developers and other technical staff. Refer to the Microsoft documentation for details about the Windows Performance Monitor and on the use of counters in general.
Registration During Installation
By default, the PSQL installation registers the PSQL performance counters with Performance Monitor. The counters are available for use after installation completes.
Note that response to customer needs may result in additional PSQL collector sets or counters being installed that are not discussed in this chapter. If so, refer to the description of the collector set or counter provided in Windows Performance Monitor. See Add Sets or Individual Counters To Monitor.
Data Collector Sets
A data collector set organizes multiple counters into a single component that can be used to review or log performance. PSQL provides the following data collector sets:
PSQL MicroKernel Btrieve Operations
PSQL MicroKernel Cache
PSQL MicroKernel I/O
PSQL MicroKernel Locks and Waits
PSQL MicroKernel Transactions
PSQL Page Server Activity
PSQL MicroKernel Btrieve Operations
These counters are useful for characterizing the behavior of client applications in terms of the Btrieve API. The counters report the types of operations being processed by the database engine at a given point in time.
See also Btrieve API Operations in Btrieve API Guide.
 
Table 44 Counters for MicroKernel Btrieve Operations  
Counter
Description
Typical Use
Btrieve Close Operations per Second
The number of Btrieve Close operations per Second
To provide insight into client application behavior. As a first step in troubleshooting issues, you may find it helpful to analyze behavior in terms of Btrieve operations.
Btrieve Get/Step Operations per Second
The number of Btrieve Get and Step operations per second.
See Btrieve API Operations in Btrieve API Guide for the various Get and Step operations.
Btrieve Open Operations per Second
The number of Btrieve Open operations per Second
Btrieve Records Deleted per Second
The number of Btrieve records deleted per second
Btrieve Records Inserted per Second
The number of Btrieve records inserted per second
Btrieve Records Updated per Second
The number of Btrieve records updated per second
Change Operations per Second
The number of Btrieve operations that modify the data files per second
Operations per Second
The number of Btrieve operations executed per second
PSQL MicroKernel Cache
The database engine uses a two-level memory cache system to increase performance of data operations. The two caches are called Level 1 (L1) Cache and Level 2 (L2) Cache.
The more frequently the engine must read a page from disk to complete a user request, the lower the performance. These counters can be used collectively to view how successfully the database engine avoids disk reads and to determine if any changes need to be made to the cache size settings.
The best performance occurs when all data is stored in the L1 Cache. Because of the sizes of data files, however, the L1 cache cannot always hold all of the data pages, so the database engine also uses a second level cache. Pages in the L2 Cache are stored in a compressed format, allowing for more pages to fit in memory. Consequently, it is lower performing that the L1 Cache, but higher performing than the database engine reading the pages from disk.
See also To calculate the ideal size of the database memory cache.
 
Table 45 Counters for MicroKernel Cache  
Counter
Description
Typical Use
Cache Hit Ratio
The percentage of recent cache accesses that resulted in a hit from either the Level 1 or Level 2 Cache.
 
L1 Cache Discards/sec
The number of pages discarded from the Level 1 Cache per second in order to make room for a new page. Only occurs when the Level 1 Cache is full. Does not include pages moved from the Level 1 to the Level 2 Cache.
 
Level 1 Cache Dirty Percentage
The percentage of the Level 1 Cache in use that contains dirty pages
To help determine if heavily accessed pages are continuously being forced out of the cache, which may adversely affect performance.
Dirty pages, ones with changes that have not been written to disk, may only reside in the L1 Cache. Under heavy write loads, the L1 Cache may predominately contain dirty pages. This forces pages out of the L1 Cache and into the L2 Cache, if configured, or out of the L1 Cache entirely.
The database engine writes dirty pages to disk at scheduled intervals or when the L1 Cache gets close to full. Frequently writing pages to disk may also adversely affect performance.
It may benefit performance to adjust the L1 Cache size so that the percentage of dirty pages is not always high. See also Cache Allocation Size.
Level 1 Cache Hits per Second
The number of Level 1 Cache hits per second
To help determine how successfully the database engine finds requested pages in L1 Cache. A higher rate of hits-to-misses indicates that the engine is finding pages in L1 Cache rather than needing to access the L2 Cache or physical storage.
Level 1 Cache Hit Ratio
The percentage of recent Level 1 Cache accesses that resulted in a hit.
Level 1 Cache Misses per Second
The number of Level 1 Cache misses per second
Level 1 Cache Usage Percent
The percentage of Level 1 Cache currently in use
To aid in adjusting the size of the L1 Cache to fit your application(s). For example, applications that use small or predominately read-only data files may not fill up the L1 Cache as configured by default. The unused memory is not available to the operating system or to other applications.
You can change the L1 Cache size to release the memory back to the operating system. Conversely, if you want to have an entire database in memory, you can monitor this value to know when the setting is as desired.
Level 2 Cache Hits per Second
The number of Level 2 Cache hits per second
To help determine how successfully the database engine finds requested pages in L2 Cache. A higher rate of hits-to-misses indicates that the engine is finding pages in L2 Cache rather than needing to access physical storage.
Level 2 Cache Hit Ratio
The percentage of recent Level 2 Cache accesses that resulted in a hit.
Level 2 Cache Misses per Second
The number of Level 2 Cache misses per second
Level 2 Cache Size
The current size of the Level 2 Cache in bytes
To help determine the size of the optional L2 Cache.
The L2 Cache is one component of the setting for Max MicroKernel Memory Usage. That setting specifies the maximum proportion of total physical memory that the database engine is allowed to consume, which includes L1 Cache, L2 Cache, and all miscellaneous memory usage by the database engine.
If the setting for Max MicroKernel Memory Usage is non-zero, the L2 Cache sizes itself to stay within the memory limit of the setting. The L2 Cache monitors memory consumption of the system and resizes itself as needed. The memory used by the L2 Cache may also be swapped out by the operating system.
Level 2 Cache Usage
The amount of the Level 2 Cache currently in use in bytes
Level 2 Cache Size Relative to Memory
Level 2 Cache size presented as a percentage of total system memory
To show what percentage of the total system memory the L2 Cache is using.
Level 2 Cache Usage Percent
The percentage of Level 2 Cache currently in use
To show what percentage of the Level 2 Cache is currently being used.
PSQL MicroKernel I/O
The counters in this set are useful for understanding the interactions of the database engine and data read and written to physical storage. The pages reported by the counters are data file pages. These counters do not report data for pages in files used for archival logging or for transaction logging.
See also Pages in PSQL Programmer's Guide.
Table 46 Counters for MicroKernel Input/Output 
Counter
Description
Typical Use
Pages Read per Second
The number of pages read from disk per second
To determine the interaction of the database engine and data read and written to physical storage.
Pages Written per Second
The number of pages written to disk per second
PSQL MicroKernel Locks and Waits
Client requests may be delayed by waiting for a resource to become available. These counters give insight into the types of database resources on which a client request may have to wait until the resource is available. As such, these counters may provide insight into the behavior of the database engine when multiple clients access it. A value close to or equal to the number of clients may indicate collisions for the same resources. Any corrective actions that can be done to alleviate these collisions may improve responsiveness.
The counters Waits on Page Buffers and Waits on Page Reads are waits on a global resource. All of the other counters in this grouping apply to multiple clients, but each client may be waiting on resources that differ from client to client.
See also Data Integrity and Supporting Multiple Clients, both in PSQL Programmer's Guide.
 
Table 47 Counters for MicroKernel Locks and Waits  
Counter
Description
Typical Use
Client Record Locks
The number of records explicitly locked by clients
To provide insight into the work load of client applications.
Waits on Active Reader Lock
The number of clients waiting on the Active Reader Lock. Multiple clients may hold the Active Reader Lock at the same time; however, the Active Reader Lock and the Active Writer Lock are exclusive. Consequently, a single client that holds the Active Reader Lock prevents any client from obtaining the Active Writer Lock. A single client that holds the Active Writer Lock prevents multiple clients from obtaining the Active Reader Lock. Each file has its own reader (and writer) lock.
See also Waits on Active Writer Lock counter.
Waits on Active Writer Lock
The number of clients waiting on the Active Writer Lock. Only one client may hold the Active Writer Lock for a file at a time. Each file has its own writer (and reader) lock.
See also Waits on Active Reader Lock counter.
Waits on File Locks
The number of clients currently waiting on a file lock
Waits on Page Buffers
The number of clients waiting on a page buffer to become available. If a page is not available to service a request, the request blocks until the MicroKernel is able to make a page available.
To indicate whether or not the database engine has a page buffer available in the cache. Use this value along with the memory cache counters to decide if the caches are sized appropriately for the work load. Increasing the cache size will increase the total number of available pages, which can reduce the waits on page buffers.
Three things may cause this value to spike when pages are not in cache:
A data file was recently opened.
First time or infrequent access of a data page.
The caches may be too small to contain all of the pages frequently accessed and modified.
The spike for the first two items cannot be avoided because of accessing a file for the first time. The third item can be avoided by using a larger cache. If the caches are full and the cache misses are high, it is possible that the caches may be too small to contain all the pages frequently accessed and modified.
Waits on Page Locks
The number of clients currently waiting on page locks
To provide insight into the work load of client applications.
Waits on Page Reads
The number of clients waiting to read a page from disk. If a client is already in the process of reading the page, other clients must wait for the in-progress read to complete.
To help determine the number of clients trying to read the same page of the same file at the same time.
Waits on Record Locks
The number of clients currently waiting on record locks
To provide insight into the work load of client applications.
PSQL MicroKernel Transactions
These counters are useful for understanding the behavior of client applications in terms of transactions. For example, a few long-lasting transactions that involve many changes cause a different behavior than many short-lived transactions.
See also Begin Transaction (19 or 1019), End Transaction (20), and Abort Transaction (21) in Btrieve API Guide, and MicroKernel Engine Fundamentals in PSQL Programmer's Guide.
 
Table 48 Counters for MicroKernel Transactions  
Counter
Description
Typical Use
System Transactions in Progress
The number of system transactions in progress. A system transaction is a special type of transaction that prepares data file changes then persists the changes to the file.
To help determine if system transactions are occurring too frequently or not often enough.
The database engine writes changes to the data files during a system transaction. The frequency at which a system transaction occurs is determined by two server data integrity configuration properties – Initiation Time Limit and Operation Bundle Limit. The server also automatically adjusts the frequency when the amount of free space in the L1 Cache is low.
In general, running the system transaction too frequently or not often enough adversely affects performance. Typically, you will notice that the number of page writes per second may increase, the number of Btrieve operations that modify records may decrease, and the number of clients waiting on the Active Writer Lock may increase. It may take experimentation to determine an ideal interval for a particular work load.
Transaction Commits per Second
The number of commits executed per second
To determine the number of application transaction commits. See also End Transaction (20) in Btrieve API Guide.
PSQL Page Server Activity
The counters in this set provide statistics on the page server.
Table 49 Counters for Page Server Activity 
Counter
Description
Page Server Pass-Thru Operations/sec
The number of pass-through operations received by the page server per second from cache engines.
Page Server Page Requests/sec
The number of requests for a data file page received by the page server per second from cache engines.
Page Server Invalid Page List Requests/sec
The number of requests for an invalid page list received per second from cache engines.
Page Server Invalid Page List Piggy-backs/sec
The number of invalid page lists piggy-backed by the page server per second on responses to other cache engine requests.
Page Server Invalid Page List Length
The current length of the page server invalid page list.
Page Server Invalid Page List Adds/sec
The number of committed pages added to the page server invalid page list per second, counting duplicates.
Page Server Invalid Page List Removals/sec
The number of entries removed from the page server invalid page list per second.
Page Server Level 1 Cache Hits/sec
The number of Level 1 Cache hits by the page server per second.
Page Server Level 1 Cache Misses/sec
The number of Level 1 Cache misses by the page server per second.
Page Server Level 1 Cache Hit Ratio
The percentage of recent Level 1 Cache accesses by the page server that resulted in a hit.
Page Server Level 2 Cache Hits/sec
The number of Level 2 Cache hits by the page server per second.
Page Server Level 2 Cache Misses/sec
The number of Level 2 Cache misses by the page server per second.
Page Server Level 2 Cache Hit Ratio
The percentage of recent Level 2 Cache accesses by the page server that resulted in a hit.
Page Server Cache Hit Ratio
The percentage of recent cache accesses by the page server that resulted in a hit from either the Level 1 or Level 2 Cache.
Page Server Level 1 Cache Usage Percent
The percentage of the Level 1 Cache currently in use only by the page server.
Page Server Level 2 Cache Usage Percent
The percentage of the Level 2 Cache currently in use only by the page server.
PSQL Cache Engine Activity
The counters in this set provide statistics on PSQL cache engines.
Table 50 Counters for Cache Engine Activity 
Counter
Description
Cache Engine Pass-Through Ops/sec
The number of pass-through operations requested by the cache engine per second.
Cache Engine Local Ops/sec
The number of local operations performed by the cache engine per second.
Cache Engine Page Requests/sec
The number of data file pages requested by the cache engine per second.
Cache Engine Page Invalidations/sec
The number of pages invalidated by this cache engine per second.
Cache Engine FCR Invalidations/sec
The number of FCRs invalidated by this cache engine per second.
Cache Engine Level 1 Cache Usage Percent
The percentage of the Level 1 Cache currently in use only by the cache engine.
Cache Engine Level 1 Cache Hits/sec
The number of Level 1 Cache hits by the cache engine per second.
Cache Engine Level 1 Cache Misses/sec
The number of Level 1 Cache misses by the cache engine per second.
Cache Engine Level 1 Cache Hit Ratio
The percentage of recent Level 1 Cache accesses by the cache engine server that resulted in a hit.
Cache Engine Level 2 Cache Usage Percent
The percentage of the Level 2 Cache currently in use only by the cache engine.
Cache Engine Level 2 Cache Hits/sec
The number of Level 2 Cache hits by the cache engine per second.
Cache Engine Level 2 Cache Misses/sec
The number of Level 2 Cache misses by the cache engine per second.
Cache Engine Level 2 Cache Hit Ratio
The percentage of recent Level 2 Cache accesses by the cache engine that resulted in a hit.
Cache Engine Cache Hit Ratio
The percentage of recent cache accesses by the cache engine server that resulted in a hit from either the Level 1 or Level 2 Cache.
Using Windows Performance Monitor
This topic provides some rudimentary instructions on using Windows Performance Monitor to get started with the PSQL performance counters. See the Microsoft document for complete details on using Windows Performance Monitor.
The following steps assume that the PSQL performance counters have been registered with Windows Performance Monitor by the PSQL installation.
Display PSQL Data Collector Sets
1 Start Windows Performance Monitor. The steps vary depending on the operating system, but generally the tool can be started from Control Panel > Administrative Tools. You may also try the command perfmon in the Run window (Start > Run).
2 In the tree on the left, click Performance Monitor, then click the plus sign on the right.
3 In the Available Counters group, scroll to the PSQL data collector sets.
Add Sets or Individual Counters To Monitor
1 Do one of the following:
To add an entire set, click the desired set in the Available Counters group.
To add individual counters, expand the desired set and click the desired counters.
To view a description of the counter, ensure that the Show description option is selected.
2 Click Add, then OK.
To Change a Counter Scale
1 Right-click the desired counter, then click Properties.
2 On the Data tab, click the Scale list, then click the desired value.
You may need to adjust the Scale to display two or more counters on the same graph that have vastly different ranges. The counter value is multiplied by the Scale value before the data is graphed. For example, assume that one counter outputs values of 53 and 99, and a second counter outputs 578 and 784. You may want to set the Scale for the first counter to 10 so that its output is 530 and 990. This lets you look at the data from both counters more comparably (530, 990, 578, and 784).
3 Click OK.
Note that the scale on the display changes from its original value (“1” in this example) to the new value (“10” in this example):
4 On the Graph tab, set the desired values for Maximum and Minimum of the Vertical scale.
You may want to change the vertical scale if what is being graphed is very small (or very large) so you can easily see when the values change. For example, if the counter values are always under 20, you may want to change the vertical scale to be Maximum 20 and Minimum 0.
5 Click OK.
Monitoring License Usage
The PSQL products use different license models depending on the product. PSQL Server and Workgroup are licensed under a concurrent user count license. PSQL Vx Server is licensed under a capacity-based license.
User Count License
The user count license model works well for traditional client-server applications in which many users or devices constantly add, update, and delete records from distinct individual desktops. Each product key specifies a licensed user count. A user count allows the specified number of concurrent connections to the PSQL database engine. Users are counted by network address.
Capacity-based License
A capacity-based model shifts the emphasis from how many users to how much work the database server processes. The model is based on capacity to accommodate license enforcement in service bureau, software-as-a-service, or other multiplexed environments. For example, each instance of PSQL Vx Server has capacity limits on both the number of sessions in use and the data in use.
Much of the monitoring pertaining to license usage involves user count, number of sessions, or data in use. For example, you may want to determine the current value, increase the current value, or better determine your capacity needs.
The four primary utilities used to monitor license usage are Monitor (see Monitoring Resource Usage), Capacity Usage Viewer, License Administrator, and Notification Viewer.
Capacity Usage Viewer
PCC provides Capacity Usage Viewer to monitor concurrent sessions and data usage for all database engines. This is especially useful when you are considering migrating from PSQL Server to PSQL Vx Server, because of the difference in the way those two editions are licensed.
Capacity Usage Viewer includes two graphs, one for the number of concurrent sessions and one for the amount of data. Each graph includes a usage level bar, a heavy horizontal line across the graph, to help you determine what volume of usage is normal and what volume is uncommon for your business. The Capacity Usage Viewer also displays peak usage statistics.
The graphs use the peak values that are recorded each day. For any day on which the engine is not used, they use a value of zero. They require a minimum of two days’ data to be generated. Otherwise, Capacity Usage Viewer displays an error message.
This section contains the following topics:
To access Capacity Usage Viewer
Capacity Usage Viewer GUI
Zooming
To access Capacity Usage Viewer
In PCC PSQL Explorer, right-click the engine you want to examine and select Capacity Usage Viewer.
Capacity Usage Viewer GUI
The following image shows the Capacity Usage Viewer. The table below the following image describes its features. Click an area of the image for which you want more information.
Figure 6 Capacity Usage Viewer User Interface
 
GUI Object
Description
Title Bar
Identifies the engine you selected.
Statistical Indicators
Displays meaningful statistics and enables you to select what you want to display in the graphs. See Statistical Indicators.
Time Designation
Displays starting and ending dates of the period for the data displayed in the graphs.
Session Usage Graph
Displays, graphically, the number of sessions that occurred concurrently during the selected time period.
Data Usage Graph
Displays, graphically, the amount of data used during the selected time period.
Usage Level Bars
Enables you to determine how often your usage exceeds a selected level. When selected, they appear across each graph at a default level that is 90% of peak usage. The number at the left of each usage level bar identifies its level (amount of data or number of sessions). You can move the usage level bar to whatever level you need, either by using the spin boxes or by dragging with the cursor. The two usage level bars are independent of each other.
Zoom Instructions
Describes the general procedures for zooming in and out of a graph. For detailed procedures, see Zooming.
Export Button
Enables you to export the data to a .CSV file, if you find it useful to save the data for additional analysis. The Export button opens a Browse for Folder dialog, where you can select a location for data storage.
Figure 7 Statistical Indicators
 
GUI Object
Description
Period
Enables you to select the time period for the data you want the graphs to display. When the window opens, the graphs display, by default, the data from the period that was selected when the window was last closed. You can select a different time period:
All
Last week
Last 30 days
Last 90 days
Last 180 days
You can also select a time period by zooming the graphs. When you zoom a graph, the Period drop-down menu displays Custom as the selected time period.
Peak Statistics Group Box
Contains fields that display statistics for maximum use of data and maximum number of concurrent sessions during the time period displayed in the graphs.
Peak Sessions
Displays the greatest number of concurrent sessions that occurred during the time period displayed in the Session Usage graph.
Peak Sessions Date
Displays the date on which the greatest number of concurrent sessions occurred. If that number of sessions occurred more on more than one day, the most recent date is displayed.
Peak Data (GB)
Displays the maximum amount of data, in gigabytes, used at one time during the time period displayed in the Data Usage graph.
Peak Data Date
Displays the date on which the maximum amount of data was used. If that amount of data was used on more than one day, the most recent date is displayed.
Show Usage Level Bars
Displays or hides usage level bars across the graphs, depending on whether it is checked or not.
Usage Statistics Group Box
Contains spin boxes for moving the usage level bars up and down and fields that display the statistics that result from moving the usage level bars.
Sessions
Sets the value at which to position the usage level bar in the Session Usage graph.
Days Exceeded
Displays the number of days on which the number of concurrent session in use was greater than the level at which the usage level bar is set.
Data (GB)
Sets the value at which to position the usage level bar in the Data Usage graph.
Days Exceeded
Displays the number of days on which the amount of data in use was greater than the level at which the usage level bar is set.
Zooming
If you need to view a particular time period besides the selections provided in the Period pull-down menu, you can select and zoom a segment of a graph. When you zoom one graph, the other zooms simultaneously. The two graphs are always set to the same period.
To zoom a graph
1 Place the cursor at the start of the period you want to display.
2 With your left mouse button pressed, drag the cursor to the end of the period you want to display. In the graph, a rectangular black outline appears around the selected part of the graph. As you move the cursor, the rectangle enlarges accordingly.
 
3 Release the mouse button. The graph is rerendered to display the period you selected. The Period field displays the setting Custom.
4 Repeat the process to zoom further.
5 To zoom out, place the cursor anywhere in the graph and, with your left mouse button pressed, drag the cursor from right to left. The graph returns to its original period, that is, the period it displayed when the window opened.
License Administrator
License Administrator is the tool used to manage keys for licensing. It is fully documented in License Administration in PSQL User's Guide. The following is a summary of common monitoring tasks that you can conduct with the tool, with links to PSQL User's Guide.
 
Table 51 Summary of License Usage Monitoring with License Administrator
Item to Monitor
Using the Graphical User Interface
Using the Command Line Interface
License information
(All license information for an authorized key, such as the product, product key, status of a key), platform to which the license applies, license type, user count, session count, data in use, expiration date of a license, vendor software that installed the license, and application to which the license applies)
User count
(The number of allowed concurrent connections to the PSQL database engine permitted by a product key)
Session count limit
(The maximum permitted number of concurrent sessions as granted by a license agreement)
Data in use limit
(The maximum permitted total size of all concurrently open data files as granted by a license agreement)
Number of authorizations remaining for a key
Monitoring Database Access
Actian Corporation provides a companion product for PSQL called AuditMaster that is used to monitor access at the database level. AuditMaster allows you to monitor changes to mission-critical data for auditing purposes, such as the following:
Who accessed a record or performed a change.
What access or change occurred, when, and where originated.
How the change was made.
AuditMaster provides a detailed audit trail and offers query and alert capabilities.
For product details, refer to AuditMaster User’s Guide included with AuditMaster. You can also find the guide on the Actian PSQL website.
Reviewing Message Logs
PSQL provides various logging repositories for messages to assist you with troubleshooting. The logging falls into two broad categories:
All messages. These messages include status, error, warning, and information messages. They can originate from any PSQL component, including the license administration components.
Licensing messages. These messages alert you about licensing issues and provide troubleshooting information. They originate from license administration components.
The following table summarizes the repositories.
Table 52 PSQL Message Logging Repositories
Repository
Written To By
License administration components
License administration components (Windows)
All PSQL components (Linux, macOS, and Raspbian)
All PSQL components (Windows)
Licensing Messages
Several of the logging repositories emphasize licensing messages. If a key is determined to be invalid, the key changes state from active to failed validation. The database engine functions normally for a certain number of days so that you have ample time to correct the validation failures.
If you do not correct the failures before the number of days ends, the key changes state again to disabled. The key is no longer valid and the database engine cannot access data files.
Because you need to attend to a failed validation in a timely manner, the state change of the key is brought to your attention as soon as possible. For example, a message is logged to all of the message repositories. The most evident of these is PSQL Notification Viewer. (License Administrator also displays the state of keys, which you can check at any time by initiating a validation action. See License Administration in PSQL User's Guide.)
Change in State of Key
The following table explains the type of message returned based on the change in state of the key.
Table 53 Message Type Based on Change in State of Key
Message Type
Change in State of Key
Scenario
 
From
To
 
Warning
Active
Failed Validation
A validation action detects that the key has failed validation. For example, the machine signature cannot be determined, no longer matches the key, or one or more licensing components cannot be loaded.
The database engine functions normally for a certain number of days so that you have ample time to correct the validation failures.
Warning
Disabled
Failed Validation
Only some of the conditions that resulted in a disabled key have been corrected, but at least one condition still needs to be addressed.
Because the key has changed state to failed validation, the database engine functions normally for a certain number of days so that you can correct the remaining validation failures.
Error
Failed Validation
Disabled
The number of days provided to correct the failed validation have expired. The conditions causing the failed validation were not corrected before the expiration. The key is no longer valid and the database engine cannot access data files.
Information
Failed Validation
Active
The conditions that caused the failed validation is corrected. The key is valid and the database engine has all functionality.
Information
Disabled
Active
The condition(s) that disabled the key is corrected. The key is valid and the database engine has all functionality.
Note that no messages are logged for keys in the expired state (which applies only to temporary keys) or the inactive state (which applies to keys still registered on the machine from previous versions of PSQL).
Logging Frequency
The following table lists the frequency with which licensing messages are logged for particular actions.
Table 54 Logging Frequency of Messages By Initiating Action
Initiating Action
Logging Frequency
Logging Repository1
Key changes state as described in Table 53
Immediately
Notification Viewer
Operating System Event Log
PSQL Event Log
Key remains in failed validation state
Once a day reminder
Notification Viewer
Operating System Event Log
PSQL Event Log
A validation action invoked programmatically through API call
See To Display Remaining Authorizations in PSQL User's Guide, PvValidateLicenses() in Distributed Tuning Interface Guide, and ValidateLicenses in Distributed Tuning Objects Guide.
Immediately
Operating System Event Log
PSQL Event Log
Warning or error messages originating from the PSQL licensing server
Immediately
Operating System Event Log
PSQL Event Log
1Message logging follows a one-way hierarchy: any licensing message logged to Notification Viewer is also logged to the Operating System Event Log and to the PSQL Event Log. Similarly, any licensing message logged to the Operating System Event Log is also logged to the PSQL Event Log.
Notification Viewer
Notification Viewer is tool for displaying messages logged by the licensing components. Its purpose is to inform you of noteworthy licensing messages (see Table 54) in a noticeable but unobtrusive manner.
By default, Notification Viewer is installed with PSQL Server, 32- and 64-bit, on Windows, Linux, and macOS and with PSQL Workgroup. Also by default on Windows platforms, Notification Viewer restarts when you restart Windows.
On Windows platforms, the executable is named notifyviewer.exe. It provides a single running instance for a user. An attempt to start Notification Viewer when it is already running brings the GUI to the front of the application displays.
On Linux, macOS, and Raspbian, the tool is a shell script named notifyviewer. Each time the shell script executes it starts another instance of Notification Viewer. If you restart the operating system, you must restart Notification Viewer. The shell script is not automatically executed upon restart.
Command Line Options
You can specify how you want the tool to start with the following command line options.
Option
Meaning
(no option)
If you start the tool without specifying an option, the GUI opens and a tray icon appears if the operating system supports a system tray.
-tray
Starts the tool with the GUI hidden and displays a tray icon. If the operating system does not support a system tray, the GUI opens instead of remaining hidden.
Notification Viewer provides two interfaces: system tray icons and a graphical user interface.
System Tray Icons Interface
By default on Windows, Notification Viewer starts with the GUI hidden and displays its system tray icon. On Linux and macOS, Notification Viewer starts as a GUI and displays its system tray icon if the distribution supports a system tray. After starting, the tool begins monitoring licensing messages.
If Notification Viewer detects unread messages, the tray icon visibly changes to indicate unread messages. See Tray Icons.
Notification Viewer also displays two types of tooltips. The mouse-over tooltip displays the number of important unread messages (if any), the total number of unread messages, or the name of the tool if all messages have been read. A balloon tooltip displays when Notification Viewer detects messages that need to be brought to your attention. On Windows, the balloon tooltip remains visible until you dismiss it directly or perform a keyboard or mouse operation. On Linux and macOS, you must click the balloon tool tip to dismiss it.
Popup Menu
The popup menu for the tray icon contains two menu items: Open which opens the GUI, and Exit which closes the tool. Right-click the tray icon to display the menu.
Tray Icons
The following table explains the meaning of the tray icons.
Icon
Meaning
Notification Viewer is running and monitoring licensing messages. This icon indicates a normal condition in which all messages have been read.
Notification Viewer contains unread messages.
This icon remains visible until all unread messages are read. See Left panel.
Graphical User Interface
You can open Notification Viewer GUI by double-clicking the tray icon or by right-clicking the tray icon and clicking Open. By default on Linux and macOS, Notification Viewer starts as a GUI and displays its system tray icon. If you want to change the startup behavior, pass the -tray option to the notifyviewer shell script. If the Linux or macOS distribution does not support a system tray, Notification Viewer displays the GUI but no system tray icon. In that case, start Notification Viewer by running the shell script.
When the GUI is visible, unread messages are immediately added to the GUI. In addition, the tray icon tooltip is shown and the icon changes to indicate unread messages.
PSQL tracks which records in the notification file are read or unread for each user. That is, each user displaying the GUI sees all of the messages, but whether a particular message is read or unread varies by user.
If a system tray is not supported by an operating system, the Close command for Notification Viewer terminates the tool. If a system tray is supported, then closing hides the GUI and the tray icon becomes the only visual indication that the tool is still running.
Toolbar and Panels
The Notification Viewer GUI provides a toolbar and two main panels as shown in Figure 8.
Figure 8 Notification Viewer GUI
 
GUI Element
Description
Toolbar
Provides two options:
Show only unread messages (toggle on, toggle off)
Mark all messages as read
Left panel
Contains a scrollable list of messages. They are sorted with the latest messages on top and arranged in three groups: Today, Previous 7 days, and Older. You can expand and collapse each group.
Each message shows an image for the type of information, a caption string, the message date and a brief description. All text is in a bold typeface if the message is unread.
To “read” a message: click (select) the message. Once selected, the typeface for the message changes to a regular typeface.
Right panel
Shows the message details, which provide a full description of the message, and when applicable, suggestions to resolve any issues.
Operating System Event Log
The PSQL license administration components write messages to the operating system event log on Windows platforms. All PSQL components write messages to the operating system event log on Linux, macOS, and Raspbian distributions.
Windows Platforms Event Logs
Windows operating systems provide a method to log events categorized as Application, Security, or System. PSQL logs licensing messages only to the Windows Application Event Log. The messages are a subset of the licensing messages written to pvsw.log.
Any licensing message categorized as an error or warning is logged. This includes messages that result from a change in the state of a key as well as other warning and error messages (see Table 54). In addition, certain information messages are logged, such as those listed in Table 53.
Viewing Event Logs
Windows operating systems provide a graphical user interface tool called Event Viewer to view and manipulate event logs. It can be accessed through the Windows PC Settings or Control Panel or by executing the command eventvwr.msc from a command interface.
PSQL displays the following for an event.
Date and Time – date and time the event occurred
Source – Pervasive SQL
Category – Product Keys
Type/Level – level of the event: Information, Warning, or Error
Event ID – 1000
User – N/A
Computer – name of the computer
In addition, the Keyword column displays “Classic” and the Log column displays “Application.” Event Viewer allows you to display additional columns, but PSQL provides no data for them.
Linux, macOS, and Raspbian Distribution Event Logs
On Linux, macOS, and Raspbian distributions, all PSQL components write messages to the standard logging system, syslog. By default on Linux and Raspbian, syslog writes to the file /var/log/messages and on macOS to the file /var/log/system.log. Optionally, for SQL Connection Manager only, you can also log messages to the event.log file.
Event.log File and Bti.ini
Bti.ini is a PSQL configuration file used on Linux, macOS, and Raspbian distributions. By default, the file is located in /usr/local/psql/etc.
The file lets you configure settings for the SQL Connection Manager (the SQLManager section in the .ini file). One of the settings, LogEvent, determines the type of event messages logged to the event.log file. By default, event.log is located in /usr/local/psql/bin.
Bti.ini Parameters for SQLManager Section
Description
MgrPort
Sets the port number used by the SQL Connection Manager. The default is 1583.
MgrUseTransport
Sets the type of protocol used by the SQL Connection Manager. This must be set to TCP.
LogEvent=msg_type
Specifies one of the following values for msg_type to indicate the type of messages logged to event.log (the default is 1):
0 – no logging
1 – errors only
2 – errors plus warnings
3 – errors plus warnings plus information messages
4 – errors plus warnings plus information messages plus connect.log
InstallDirectory=/usr/local/psql
Activates the connection log: /usr/local/psql/connect.log
PSQL Event Log (pvsw.log)
On Windows platforms, all PSQL components write status, error, warning, and information messages to the PSQL event log. On Linux, macOS, and Raspbian distributions, PSQL does not use an exclusive event log. Instead, all PSQL components write messages to the standard logging system, syslog. See Linux, macOS, and Raspbian Distribution Event Logs.
The PSQL event log is called pvsw.log. By default it is located in application_data_directory\psql\logs. All PSQL components on Windows platforms write to this log file. If two or more applications using the PSQL database engine are running on the same machine, they share pvsw.log.
Pvsw.log Fields
The contents of pvsw.log consists of text messages in a format described in Table 55.
Table 55 Pvsw.log Fields 
Field
Contents
Date
Automatic date stamp in mm/dd/yyyy format.
Time
Automatic time stamp in hh:mm:ss format. Also indicates AM or PM.
Component
File name of component returning the error (prefix only, no extension).
Process
Instance ID of the component, which is the process ID of the component.
Process Name
Path and name of the component, truncated to the last 15 characters.
Computer Name
Name assigned to the machine hosting the process, truncated to the first 15 characters.
Type
A single character: I for Information, W for Warning, or E for Error.
Message
The message text which may be either a string retrieved from a resource associated with the calling component or a text string passed directly from the calling component.
Some message text may contain numeric values, which may be in decimal or hexadecimal format. The characters “0x” precede any hexadecimal values to distinguish them from decimal values.
Some message text may also contain information specific to an OEM application, such as a link to a vendor’s Web site and troubleshooting information.
An entry may be followed by binary data in standard hexadecimal format. There is no limit to the length of the binary data.
Pvsw.log Example Entry
The following shows an example of the type of data contained in pvsw.log.
Date
Time
Component
Process
Process Name
5/10/2011
9:53:06 AM
LicenseMgr
9048
NTDBSMGR.EXE
Computer Name
Type Category
Message
USRegion2Svr
W
License failed validation. Remaining Days: 14
Receiving Email Notification of Messages
PSQL does not include email notification of event messages because products from other vendors that provide such functionality are readily available. This section identifies some of those products. Also discussed is the event log content to monitor for events pertaining to PSQL licensing and product keys.
Products That Provide Email Notification of Monitored Events
The following table is a partial list of products that can provide email notification of events in the operating system event log. The products are listed alphabetically. Actian Corporation does not endorse one product over another. Since the products listed are from other vendors, the products and the discussion about them may vary from what is presented here.
Note that such products typically require either an agent to be installed or a remote access mechanism like Windows Management Instrumentation (WMI) or secure shell (SSH) to be enabled.
Table 56 Products That Provide Email Notification of Monitored Events
Product
Cost
Platform
Discussion
Hyperic
www.hyperic.com
Contact Hyperic
Windows
Requires installing an agent on the monitored machine and opening a firewall port for the agent.
Linux, macOS, and Raspbian
Requires enabling SSH on the monitored machine and opening a firewall port for SSH.
Nagios
www.nagios.org/
Free
Windows and Linux
Requires installing an agent on the monitored machine and opening a firewall port for the agent.
Spiceworks
www.spiceworks.com
Free
Windows
Requires enabling remote WMI on the monitored machine and opening a firewall port for remote WMI.
Linux
Requires enabling SSH on the monitored machine and opening a firewall port for SSH.
System Center Configuration Manager (SCCM)
www.microsoft.com
Contact Microsoft
Windows
Requires either an agent or enabling remote WMI on the monitored machine. The firewall is automatically adjusted when WMI is enabled. If an agent is used, also requires opening a firewall port for the agent. This product is available only for Windows operating systems.
ZenOSS
www.zenoss.com
Contact ZenOSS
Windows
Requires installing an agent on the monitored machine and opening a firewall port for the agent.
Linux, macOS, and Raspbian
Requires enabling SSH on the monitored machine and opening a firewall port for SSH.
Event Log Content to Monitor for License Event Messages
All of the products in Table 56 have the ability to identify content in the operating system event log. The identification methods differ between Windows platforms and Linux, macOS, and Raspbian distributions. The intent of this information is not to discuss the specific monitoring methods of each product. Refer to the vendor documentation for product details.
Windows Platforms
The following table identifies the properties in the operating system event log specific to PSQL licensing. Configure your monitoring product to send email notifications based on the values of those properties.
Operating System Event Log Property
Value to Monitor
Source
Pervasive SQL
Category
Product Keys
Type
Warning, Error
Examples
Suppose that you want to receive email notifications for all PSQL licensing event messages that are warnings or errors. Configure your product to monitor the following conditions.
Source=“Pervasive SQL”
Category=“Product Keys”
Type=“Warning” | Type= “Error”
Linux, macOS, and Raspbian Distributions
The Linux, macOS, and Raspbian syslog does not contain the same properties as the Windows operating system event log. You must configure the notification product to identify events and strings in the syslog. Based on events and string comparisons, the product can then initiate the desired action, such as send an email notification.
Note that all messages – whether licensing related or not – written to the syslog by the PSQL database engine contain the string mkded. The following list identifies some of the strings in the syslog specific to PSQL licensing. One way to monitor the syslog is to configure a string comparison based on content that contains mkded and one of the following strings:
disabled
failed validation
for key
validation of key
capacity for session count
capacity for data in use
user count