Foxhound is the better* Database Monitor for SQL Anywhere.
*better: More thorough, more relevant, more effective.
...more Alerts, more All Clears, more details, more control in your hands.
|
[Home] | [Table of Contents] | [Previous Section] | [Next Section] |
Breck Carter
Last modified: February 12, 1998
mail to: bcarter@bcarter.com
ISQL can be run in non-interactive "batch" mode just like the other command line utilities. Not only does this make it easier to run repetitive SQL commands but it also lets you gather actual performance statistics in an output text file.
Figure 4A shows how to run ISQL in batch mode. TEST.SQL is named as the input file containing the SQL statements to execute. This example assumes the server and database are already up and running so the -c parameter only needs to provide the user id and password.
Figure 4A - Run ISQL In Batch Mode When The Server Is Already Running
|
Figure 4B shows how to run ISQL in batch mode when a standalone database needs to be started. The -c parameter now includes the DBF subparameter to specify the database file location. The -s parameter is also used to specify the database engine command line parameter.
Figure 4B - Start A Standalone Database And Run ISQL In Batch Mode
|
Figure 4C shows the TEST.SQL input command file to be run in batch mode. It includes a series of commands to create and fill a test table and search index, followed by three SELECT statements to test performance. The output of these SELECTS is captured by the ">&c:\test\isql.txt" and ">>&c:\test\isql.txt" parameters at the end of the statements.
The > operator tells ISQL to redirect the output of the SELECT to a text file, overwriting anything that might already be there. The >> operator tells ISQL to do the same but this time append the new output to the end of the file if there's already something there. The & operator tells ISQL to include performance statistics in the output.
The two SET TEMPORARY OPTION COMMAND_DELIMITER statements are used to tell ISQL to treat everything between the BEGIN and END as a single execution unit by changing the delimiter from the semicolon to a different character and then changing it back.
Figure 4C - >& And >>& Operators In The ISQL Input File TEST.SQL
|
Figure 4D shows the output captured in the text file. As you can see, this batch output is more complete than the interactive ISQL Statistics window because it includes actual I/O counts and execution times as well as execution plan estimates.
Figure 4D - Actual Performance Statistics In The ISQL Output File ISQL.TXT
|
If you look in the Help file DBENG50W.HLP you won't find much information about running ISQL in batch mode. In fact, you won't even find the correct specifications for the command line switches. Figures 4E and 4F show a rare discrepancy between what the Help says and what the program actually expects.
Figure 4E - What The Help Says About ISQL
|
Figure 4F - What ISQL Says About Itself
[Home] | [Table of Contents] | [Previous Section] | [Next Section] |