The MON-ExplorerLDB is an optional database tier that can be implemented to improve performance when processing large result sets.
When an Explorer GUI command script is executed, the data is usually returned directly to a window in a grid format. If the result set contains a large amount of data, the local database interface can dramatically improve performance when loading, sorting, or processing within the grid.
When using the standard two-tier interface (no database component), the GUI command script contains all the processing statements – Monitor host control statement, rules, and GUI scripting language – and the resulting data goes directly to the grid.
Two-tier example
When the local database interface is used, the Monitor host control statements and rules are contained within scripts managed by the ExplorerLDB Manager. These scripts both interface with the host to get the resulting data (either by executing Monitor jobs or downloading files produced on the host by Monitor jobs) and with the MySQL database to load tables in the Explorer Local Database. The Explorer GUI command script to access the data from the Local Database table communicates directly with the MySQL database server using query commands.
Three-tier example
There are more steps involved in the three-tier example, so unless performance is an issue, the two-tier example is much simpler.
For example, if the Explorer GUI is used to produce a list of all data sets in all pools on a system, the result could be hundreds of thousands or millions of records. There may not be enough memory on the workstation to present the entire list in the display window, and the viewing process would be extremely slow and may take several minutes or longer to present the results. In this scenario a local database would be required to alleviate the performance and resource issues and be able to process the entire result set in a timely manner — usually a matter of seconds.
Launch the MON-ExplorerLDB Manager
The ExpLocalDBMgr.exe application allows the user to manage MON-ExplorerLDB configurations. The MON-ExplorerLDB installer (explocaldb_setup.exe) places the ExpLocalDBMgr.exe and explocaldb.exe applications in the program files directory (usually C:\Program Files) in the DTS\ExpLocalDB folder. The installer also creates a folder (DTS\explocaldb) in the user's Application Data folder to contain the configuration, log, and temporary working files.
There are two ways to launch the MON-ExplorerLDB Manager utility:
-
From the Explorer GUI application menu: select the Options menu item, then choose Local DB Mgr.
-
Or, double-click the desktop icon named ExpLocalDBMgr placed during setup. The following screen is displayed using either method.
When starting the MON-ExplorerLDB manager application you will be presented with a list of configurations. Several sample configuration scripts are included when you install MON-ExplorerLDB. These scripts can be modified or deleted if not needed. For each script in the list the Name, Status, Schedule, Next Run, Last Run, and Last Result information is provided.
-
Name — The name of the script. This is a user-defined string value used to identify the configuration.
Menu items
-
New — Create and edit a new configuration.
-
Edit — Edit the selected configuration.
-
Delete — Delete the selected configuration.
-
Schedule — Create a new or edit an existing schedule for a configuration.
-
Run — Run the selected scheduled configuration now.
-
Logs — View the output logs for the selected configuration.
-
Refresh — Refresh the configuration list.
-
Debug — Run the selected configuration with debug output and display the results in a console window.
Define MON-ExplorerLDB entries
The process for defining a MON-ExplorerLDB script is as follows:
-
Select Edit or New to open a configuration window -
Edit Source configuration -
Edit Destination configuration -
Define Command Input
- select Edit or New to open a configuration window
- edit Source configuration
- edit Destination configuration
- define Command Input
Click on the script row to highlight, then click the Edit menu option, or right-click for a list of menu options.
|
|
Source configuration
Edit Configuration (Source):
|
|
The Edit configuration window consists of two fields at the top of the window and two tabs, one to configure the Source (DIF) parameters and the second to configure the Destination (MySQL) parameters. The fields at the top of the window are:
-
Name — Identifier for configuration.
-
Type — DIF record type in source data.
DIFREC_CSVwill be the more commonly used option for database efficiency; requires DIF release 5.1.7 or higher.
The Source tab contains the following fields:
-
Host — DNS name or IP address of host running DIF.
-
Port — Port on which DIF is listening (see DIFINIT member in the DTS PARMLIB dataset for the TCPIP port number).
-
TSO Username — TSO logon id used to login to host.
-
TSO Password — TSO password used to login to host.
-
DIF Function —
DIFCMD(Monitor snapshot task) orDOWNLOAD(download existing host data set from snapshot). -
Download Data Set — If DIF Function is
DOWNLOAD, the host data set to download. -
Download Member — If DIF Function is
DOWNLOAD, the host data set member to download (leave blank for non-PDS). -
Command Input — If DIF Function is
DIFCMD, the command input which includes the Monitor control statements and rules to be executed.
DOWNLOAD, refer to the MON-Snapshot User's Guide, Reports chapter in the section on Building Records to be downloaded into the Explorer Local Database.Destination configuration
Edit Configuration (Destination):
|
|
The Destination tab contains the following fields:
-
Host — DNS name or IP address of host running MySQL (typically
localhostif MySQL server resides on a local PC; otherwise remote server IP address). -
Port — Port on which MySQL is listening (typically
3306). -
MySQL Username — Used to login to MySQL.
-
MySQL Password — Used to login to MySQL — do not modify.
-
Database — MySQL database (schema) to use — do not modify.
-
Table — MySQL table to insert records, usually same as the script/task entry name for simplicity.
-
Method — Method used to insert records (typically
LOAD_DATA). -
Insert Buffer — If Method is
INSERT, the number of records to buffer for each insert (0 means one insert statement per record).
New scripts can be added using this utility by clicking the New menu item. It is recommended that new scripts be cloned from existing scripts for simplicity.
Command Input
The Command Input window within the Source Configuration panel is
used to specify Monitor host job control statements and rules. When
adding or editing new scripts, the Command Input section of the script
manager window is similar to existing Explorer GUI scripts that use
the two-tier method and Monitor control statements and rules can be
cloned from them with one exception — the DEFREC TYPE
statement for the ExplorerLDB scripts contains different values. For a
comprehensive description of Monitor control statements and rules
language statements, refer to the MON-Snapshot
User's Guide.
Following is the Monitor statements contained within the Command Input section of the Pool Info script. This section contains the Monitor control statements and rule statements (shown as code):
#DDNAME=TEMPPDS MEMBER=SYSIN
RULES(LIST) NAME(MONRULE) RECORD(SCHEMA) POOL(MON PRODUCT) INCLUDE(ENVS(ENDPOOL))
#DDNAME=TEMPPDS MEMBER=MONRULE DEFRULE MESSAGE
SET USRFLDN1 = &POOL_RESPTIME/100
SET USRFLDN2 = &REMAINDER*2
DO IF USRFLDN2 GE 100
THEN SET USRFLDN1 = &USRFLDN1+1
END
ISSUE WRITEREC(R1)
DEFREC R1 TYPE(* CSV GRID FAST)
FIELD &POOL_NAME HEADER("POOL") KEY(POOLNAME)
FIELD &POOL_FREESPC HEADER("FREE %")
FIELD &USRFLDN1 HEADER("RESP TIME")
FIELD &POOL_TOTALCYL HEADER("TOTAL CYL")
FIELD &POOL_TOTALTRK HEADER("TOTAL TRK")
FIELD &POOL_FREECYL HEADER("FREE CYL")
FIELD &POOL_FREETRK HEADER("FREE TRK")
FIELD &POOL_NVOL HEADER("VOLUMES")
FIELD &YYYYMMDD:CURDATE HEADER("DATE")
FIELD &CURTIME HEADER("TIME")//SYSPRINT DD DUMMY
//RUN EXEC PGM=&PROG,PARM='&P'
//SYSPRINT DD SUBSYS=(IPIO),
// DCB=(LRECL=121,RECFM=F,BLKSIZE=121,DSORG=PS)
//SYSIN DD DSN=*.INIT.SYSIN,DISP=OLD
The following statements are contained within the MON-Explorer GUI Pool Information script:
#DDNAME=temppds MEMBER=sysin
RULES(NAME(MONRULES) LIST) POOL(MON PRODUCT) RECORD(SCHEMA) INCLUDE(ENVS(ENDPOOL))
WAIT(%wait%)
INCLUDE(VOLSER(%volser%)) INCLUDE(POOL(%pool%))
#DDNAME=TEMPPDS MEMBER=MONRULES DEFRULE MESSAGE
SET USRFLDN1 = &POOL_RESPTIME/100
SET USRFLDN2 = &REMAINDER*2
DO IF USRFLDN2 GE 100
THEN SET USRFLDN1 = &USRFLDN1+1
END
ISSUE WRITEREC(R1)
DEFREC R1 TYPE(POOL GRID FAST)
FIELD &POOL_NAME HEADER("POOL") KEY(POOLNAME)
FIELD &POOL_FREESPC HEADER("FREE %")
FIELD &USRFLDN1 HEADER("RESP TIME")
FIELD &POOL_TOTALCYL HEADER("TOTAL CYL")
FIELD &POOL_TOTALTRK HEADER("TOTAL TRK")
FIELD &POOL_FREECYL HEADER("FREE CYL")
FIELD &POOL_FREETRK HEADER("FREE TRK")
FIELD &POOL_NVOL HEADER("VOLUMES")
The Monitor control and rule statements are almost identical in each of the scripts. The primary difference is that the Pool Information script has additional scripting language statements (not shown here) and prompts for additional criteria and the Pool Info script uses the CSV option on the record description to improve database loading performance.
If the number of pools and volumes on a system is relatively small, the Pool Information script referenced by executing the following from the MON-Explorer GUI folder list is adequate to display the result set:
However, if the system contains a very large number of volumes, the MON-ExplorerLDB facility can greatly reduce the time in which it takes to present the results in the grid window. Once the Pool Info script has executed and the database table is loaded (refer to the sections entitled Schedule MON-ExplorerLDB Tasks and Run a MON-ExplorerLDB Task), execute the following from the MON-Explorer GUI folder list to display the result set (the script contains SQL query statements):
query.useLocalDB := True;
query.useGridMode := True;
query.SQL := 'Select * from pool_info';
query.entityType := 'Pool';
query.keyColMap := 'volser=Volume Ser;poolname=Pool Name';
query.Submit;
Schedule MON-ExplorerLDB tasks
Schedule the scripts.
Click on the script row to highlight, then click the Schedule menu option, or right-click and select Schedule. The Windows Schedule Manager window will open and display a screen similar to the following.
|
|
On the Task tab be sure to check the box at the bottom to enable the task and click Apply.
You will be prompted to enter and confirm your Windows logon password.
|
|
Select the Schedule tab to specify the frequency.
|
|
The Advanced button can be used to further quantify the schedule if the task needs to be run more often than once daily (for example, hourly).
|
|
Click OK to complete the scheduling.
The Settings tab contains an option to wake the computer to run a scheduled task. If the task may be scheduled to run while the computer is asleep, check this option and then click Apply.
The current schedule information will be updated and displayed in the Configuration screen:
-
Status — The scheduling status of the configuration (for example, 'Ready', 'Running', 'Disabled', 'Has not run').
-
Schedule — The current execution schedule of the configuration.
-
Next Run — The next time the configuration is scheduled to run.
-
Last Run — The last time the configuration ran.
-
Last Result — The return code (in hex) of the last configuration execution. A value other than
0x0indicates an error in the last execution.
After a script has been scheduled to run, the results of the last execution will be displayed in the main window, or click the Refresh menu item to update the Last Run and Last Result columns. If the Last Result contains a value other than zeros, an error has occurred. Refer to the section entitled Logs and Debugging for problem determination.
Run a MON-ExplorerLDB task
Once a script has been scheduled, it can be run on demand by highlighting the line and either clicking Run from the main menu bar, or right-click and select Run from the list of menu items.
|
|
After the script runs, click the Refresh menu item to update the Last Run and Last Result columns. If the Last Result contains a value other than zeros, an error has occurred. Refer to the section entitled Logs and Debugging for problem determination.
When the scripts run successfully, the MON-ExplorerLDB is populated with records into the specified table name and can be accessed from the Explorer GUI using query scripts. Refer to the Command and SQL Query Scripts section for information on coding MySQL query statements.
Logs and debugging
Each time a task is run, a log is produced with information about the success or failure of the execution. Following is an example of a successful execution. If error messages are contained in the log file, the file can be emailed to DTS support staff for problem determination. The log files that are produced can be located in the following path:
C:\Documents and Settings\user\Application Data\DTS\explocaldb\logs
The file has an extension name of .log; however it is just a text file that can be viewed with any text editor or viewer.
|
|
If additional log information is needed for debugging, other parameters can be specified by clicking the Debug menu option and optionally changing the value specified after the -logLevel statement in the Debug window.
|
|
-logLevel
Description: set message logging threshold
Values: TRACE | DEBUG | INFO | WARN | ERROR | FATAL | ALL
Default: INFO
-consoleLog
Description: log messages to command window console
Values: TRUE | FALSE
Default: FALSE
When running a script from the Debug window, a command window will open and the log messages will be displayed in the command window if -consoleLog is set to TRUE. If -consoleLog is set to FALSE or not specified, the log messages will be written to the log file only.