HP 3000 Manuals

Tools on the PC Client [ HP PC API User's Guide for ALLBASE/SQL and IMAGE/SQL ] MPE/iX 5.0 Documentation


HP PC API User's Guide for ALLBASE/SQL and IMAGE/SQL

Tools on the PC Client 

From your PC you can use PC API to capture ALLBASE/NET packets sent
between the PC and the database server using the HPDCRECORD and
HPSQLNETLOG environment variables.  You can use these tools with both the
ODBC and the Gupta interfaces.

If you use ODBC, you can use Dr.  DeeBee Spy to trace ODBC function
calls.  If you use Gupta, you can use Filter to capture Gupta functions
calls and Scriptor to replay the Gupta calls.

Using HPDCRECORD to Log Packets 

The HPDCRECORD tool records ALLBASE/NET messages sent and received across
the LAN and captured on the PC client.  The messages are recorded in a
compressed binary file called HPDC.LOG. This log file resides in the
directory of the application that sent the first message.  If this file
exists, trace information is appended to the file.

Use the Displog program to convert the log file to ASCII format.  After
the file is formatted, you can read or print it with any word processor.

Do the following:

   *   To begin logging, exit from Windows, and at the DOS prompt, type:

            C:> set hpdcrecord=1 

       Note that there are no spaces next to the equal sign.

   *   Run your application.  The output is written in the HPDC.LOG file.

   *   To stop logging, type:

            C:> set hpdcrecord=0 

   *   Format the HPDC.LOG file using the Displog program.  In the
       following example HPDC.TXT is the converted file.  If you do not
       specify an output file, the output is printed to the screen.

            DISPLOG HPDC.LOG HPDC.TXT

       If you want to eliminate the hex information, follow the command
       with a -n:

            DISPLOG HPDC.LOG HPDC.TXT -n

   *   Now you can read the log file with any editor.  The log file
       resides in the directory where the application is located.

       Here is an example of an HPDC.TXT file without the hex
       information:

            SEND: PC ---> host, Send Cnt# 1, length  320, at    03:14.87
                                SQLX Code: 9990  Init
            RECV: host ---> PC, Recv Cnt# 1,  length  296
                   Transmission time: 55            00.05
            SEND: PC ---> host, Send Cnt# 2, length  54, at    03:15.09
                                SQLX Code: 9992  Hello
            RECV: host ---> PC, Recv Cnt# 2,  length  296
                   Transmission time: 0            00.00
            SEND: PC ---> host, Send Cnt# 3, length  718, at    03:15.69
                                SQLX Code: 9010  Connect with Parameters
            RECV: host ---> PC, Recv Cnt# 3,  length  88
                   Transmission time: 3186            03.18
            SEND: PC ---> host, Send Cnt# 4, length  164, at    03:19.26
                                SQLX Code: 9510  Disconnect
            RECV: host ---> PC, Recv Cnt# 4,  length  88
                   Transmission time: 220            00.22
            !!!!!!!!!!!!!!!!!!!!!! End of Session 1 !!!!!!!!!!!!!!!!!!!!!!

            SEND: PC ---> host, Send Cnt# 5, length  320, at    03:26.57
                                SQLX Code: 9990  Init
            RECV: host ---> PC, Recv Cnt# 5,  length  296
                   Transmission time: 55            00.05
            SEND: PC ---> host, Send Cnt# 6, length  54, at    03:26.79
                                SQLX Code: 9992  Hello
            RECV: host ---> PC, Recv Cnt# 6,  length  296
                   Transmission time: 55            00.05
            SEND: PC ---> host, Send Cnt# 7, length  718, at    03:27.06
                                SQLX Code: 9010  Connect with Parameters
            RECV: host ---> PC, Recv Cnt# 7,  length  88
                   Transmission time: 219            00.21
            SEND: PC ---> host, Send Cnt# 8, length  122, at    03:27.56
                                SQLX Code: 8000  Set Env
            RECV: host ---> PC, Recv Cnt# 8,  length  88
                   Transmission time: 55            00.05
            SEND: PC ---> host, Send Cnt# 9, length  164, at    04:01.12
                                SQLX Code: 9510  Disconnect
            RECV: host ---> PC, Recv Cnt# 9,  length  88
                   Transmission time: 385            00.38
            !!!!!!!!!!!!!!!!!!!!!! End of Session 2 !!!!!!!!!!!!!!!!!!!!!!

Using HPSQLNETLOG to Log Packets 

The HPSQLNETLOG tool records messages sent and received across the LAN
and captured on the database server.  With this tool, you can setup a
personalized log file for each application.  On the PC client, do the
following:

   *   From outside of Windows, turn on logging with the following
       command:

            setenv HPSQLNETLOG=255

   *   Then set up the personalized logfile:

            setenv HPSQLNETLOG_NUM=nnnn 

       where nnnn is any four digit number.

       The database server log file name will be SLGnnnn in your home
       group.  If you do not specify HPSQLNETLOG_NUM, the default log
       name is HPSQLSLGB.

ODBC Tools 

Dr.  DeeBee Spy is provided with PC API to trace ODBC calls.

Tracing Calls with Dr.  DeeBee Spy.     

Dr.  DeeBee Spy traces calls to the ODBC driver.  Dr.  DeeBee Spy logs
each function call along with the input and output values.  To turn on
logging, do the following:

   1.  From the Program Manager Menu in Windows, click on RUN.

   2.  Type DRDBSP.

   3.  Choose OK.

   4.  Select the Data Source Name to trace.

   5.  Choose OK.

The Dr.  DeeBee Spy icon will appear at the bottom of the screen.  It
will flash when it is logging.

To turn off logging:

   1.  Click on the Dr.  DeeBee Spy icon.

   2.  Choose CLOSE.

The log is located in C:\WINDOWS\DRDEEBEE.LOG.

Gupta Interface Tools 

PC API provides two tools for troubleshooting the Gupta interface:
Filter and Scriptor.

Tracing Calls with Filter.     

If your application has a problem, you may want to trace the Gupta
function calls, the input parameters, and the return codes.  You can
create a trace file which can be used with Scriptor to reproduce the
problem.

To create the trace file, close the HP DB Router and rename two files:

     rename sqlapiw.dll sqlapiw.sav 
     rename filter.dll sqlapiw.dll 

Filter creates a trace file named TRLT.SCP in the directory where your
application is running.  If a TRLT.SCP file already exists, it is
appended.

To stop creating the trace file, exit the application and rename the
files back to their original names:

     rename sqlapiw.dll filter.dll 
     rename sqlapiw.sav sqlapiw.dll 

When tracing is turned on, a dialog box is displayed when the application
connects to the database.  This dialog box contains the message "Script
Recording Activated." If the dialog box does not appear, then tracing is
not turned on.

Here is an example of a TRLT.SCP file:

     CONTINUE
     SQLINI
     SQLCNC $c1 "SERVER/SYSADM/"
     * Filter Detected ERROR status = 20306
     SQLERR 20306
     *    Error text -> - Network software not loaded.
     SQLDON
     *  Time spent in Gupta:       00.00,   00% of total
     *  Time spent in App:       14.93,   00% of total

The tracing process can consume a large amount of disc space if done for
an excessive period of time.  Also, your application will run slower when
tracing is turned on.

Tracing Calls with Scriptor.     

Scriptor is used to replay Filter log files to troubleshoot problems The
TRLT.SCP file can be executed in Scriptor with little or no modification.
As commands are executed, they are displayed in the View Window along
with subsequent comments and errors.  You can enter single commands or a
set of commands in a script file.

In the example below, the user entered commands in the Single Script
Command dialog box:

[]
Figure 5-1. Script Commands in Scriptor To execute the TRLT.SCP Filter log file or any other script file, you can enter a log file name in the Path/Script Filename box. To retain the information in the View Window, you can specify a log file in the Path/Log Filename box. Using the WHAT Utility to Check Versions You can use the WHAT utility provided by Hewlett-Packard to check the versions of the PC API components. For example, to check the ALLBASE.DLL, type: C:\WINDOWS\SYSTEM> what allbase.dll


MPE/iX 5.0 Documentation