Help for Foxhound 1.1.3832a

Table of Contents    [RisingRoad]


Introduction and Setup

Foxhound is two products in one: it is both a database monitor and a schema troubleshooter for SQL Anywhere.

A database monitor is a computer program that measures the activity of a database management system and displays those measurements in a meaningful way, so that you can easily see that everything's OK or quickly learn about problems and threats to performance and availability. A monitor can also send email alerts when something goes wrong.

A schema troubleshooter is a computer program that performs a static analysis of the tables, columns, indexes, foreign key relationships and other objects in the database, displays those objects in a way that's easy to understand and easy to navigate, together with various facts, figures and curiosities which may be problems that need attention.

Foxhound Design Decisions

Foxhound Highlights

Requirements

Foxhound Setup

Customizing the Setup

Running Foxhound as a Service

Connecting to Target Databases

Backup and Restore

Controlling Growth

SQL Anywhere is a trademark of Sybase, Inc.


Foxhound Design Decisions    [Top]


Foxhound Highlights    [Top]


Requirements    [Top]

1. Windows - Foxhound works with target databases running on other operating systems but the Foxhound engine itself only runs on Windows, and has been tested on Microsoft Windows XP SP3, Vista SP1 and Windows 7.

2. ODBC - Foxhound itself uses ODBC to connect to your target databases. You don't necessarily need ODBC installed on the servers running your target databases, and you can specify DSN-less connections for Foxhound by using the "String" tab on the main menu page.

3. Firefox or IE - The Foxhound client has been tested using Mozilla Firefox 3 and Microsoft Internet Explorer 8.

4. JavaScript - Foxhound needs "JavaScript" or "Active scripting" to be enabled in the browser; here's how:

Firefox 3: Tools - Options - Content - check "Enable JavaScript"

IE 8: Tools - Internet Options - Security - Local intranet - Custom level... - Scripting - Active scripting - check "Enable"

5. SQL Anywhere version 5.5.5.2787 through version 12 for target databases - If you have any target databases running on SQL Anywhere 5.5, you may have to upgrade them to 5.5.5.2787 for Foxhound to work properly with them.

6. SQL Anywhere 32-bit version 11.0.1.2276 or later for Foxhound - Foxhound works with target databases using 5.5 to 12 of SQL Anywhere including 64-bit versions, but the Foxhound engine itself needs the x86 version of SQL Anywhere 11.0.1.2276 or later to run.

7. SQLANY11 - The delivered *.bat files expect that the SQLANY11 environment variable points to SQL Anywhere 11. If that is not the case you may have to modify the *.bat files. Here is the default setting on Windows XP, Vista and Windows 7:

SET SQLANY11=C:\Program Files\SQL Anywhere 11

8. FOXHOUND1 - The delivered *.bat files expect that the FOXHOUND1 environment variable will be created by the Foxhound installation (which will happen by default). If that is not the case you may have to modify the *.bat files. Here is the default setting for Windows XP:

SET FOXHOUND1=C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1\
and for Windows Vista and Windows 7 it is this:
SET FOXHOUND1=C:\ProgramData\RisingRoad\Foxhound\

9. Disk space - When re-installing or upgrading Foxhound, 60% or more extra disk space may be required during the post-setup process. The "60% or more" figure applies to the amount of disk space occupied by the existing Foxhound installation, not the total used disk space on the drive.


Foxhound Setup    [Top]

Foxhound consists of server and client components.

The Foxhound server (or "engine") runs as a single SQL Anywhere database in a Version 11 engine configured to run as an HTTP (web) server.

The Foxhound client is browser based, with the default URL being this:

http://localhost/

The standard Foxhound installation creates Windows Start menu shortcuts to batch files that start both the Foxhound engine and the Foxhound client on the same computer:

Start - All Programs

- Foxhound

- Start Foxhound via Firefox

- or -

- Start Foxhound via IE

You can make Foxhound part of the home page row in Firefox. For example, here's how to set the Firefox home page tabs to Google and Foxhound:

Tools

- Options

- Main

- Startup

- Home Page:

http://www.google.com/|http://localhost/

Here's how to do the same thing with Internet Explorer:

Tools

- Internet Options

- General

- Home Page

http://www.google.com/
http://localhost/


Customizing the Setup    [Top]

By default the Foxhound batch files are installed in this location on Windows XP:

C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1
and on Vista and Windows 7 it is here:
C:\ProgramData\RisingRoad\Foxhound1
These are the command files which start Foxhound:
$backup_foxhound1.bat
$start_foxhound1_engine.bat
$start_foxhound1_firefox.bat
$start_foxhound1_firefox_debug.bat
$start_foxhound1_ie.bat
$start_foxhound1_ie_debug.bat

You can customize those batch files, or create new ones as you see fit. Each one contains the following command or a variation thereof: CD /D "%FOXHOUND1%" "%SQLANY11%\Bin32\dbspawn.exe"^ -f^ "%SQLANY11%\Bin32\dbsrv11.exe"^ -c 25p^ -ch 50p^ -cr-^ -gk all^ -gn 120^ -n foxhound1^ -o foxhound1_debug.txt^ -oe foxhound1_debug_startup.txt^ -on 10M^ -qn^ -sb 0^ -x tcpip^ -xd^ -xs http(port=80;maxsize=0;to=600;kto=600)^ foxhound1.db^ -n f

Here is a description of each part of those commands:

\\\\\


Running Foxhound as a Service    [Top]

Foxhound is often used to monitor heavily-loaded target databases, and in such an environment some care must be taken to ensure Foxhound's own CPU and disk requirements don't adversely affect overall performance. The simplest solution is to run the Foxhound engine on its own computer that is:

A centrally-located Foxhound engine often implies remote client access across the LAN or WAN as well as the need for easy administration. All these requirements can be met by running Foxhound as a Windows service using the dbsrv11.exe network server.

You can use Sybase Central or the dbsvc.exe utility to create Windows service; both techniques are described in the SQL Anywhere 11 Help.

Note: If you run Foxhound as a service, you may have to create ODBC DSNs as System DSNs instead of User DSNs if you want them to appear on the Foxhound Menu page.

Here is an example of the command line parameters for running Foxhound as a service on Windows 7:

-c 25p
-ch 50p
-cr-
-gk all
-gn 120
-n foxhound1
-oe "C:\ProgramData\RisingRoad\Foxhound1\foxhound1_debug_startup.txt"
-sb 0
-x tcpip
-xd
-xs "http(log=C:\ProgramData\RisingRoad\Foxhound1\foxhound1_http_log.txt;lf=@T - @I - @U - @R - @L - @W - @E;lsize=1M;dbn=f;port=80;maxsize=0;to=600;kto=600)" 
"C:\ProgramData\RisingRoad\Foxhound1\foxhound1.db"
-n f

Here is a description of those parameters:


Connecting to Target Databases    [Top]

Foxhound uses ODBC to connect to the target databases. If you have an ODBC DSN, you can choose it on the DSN tab of the Foxhound Menu page.

If you don't have a DSN, or don't want to use one, you can specify a DSN-less connection by specifying the connection string on the String tab of the Menu page. The main difference between using the String tab and setting up a DSN in the ODBC Administrator is that the String tab needs to know what driver to use, as in:

DRIVER=SQL Anywhere 11;

For best results, Foxhound needs DBA privileges when it connects to the target database. Without DBA privileges, the Foxhound schema display will be unable to show DBSPACE information in the Facts & Figures section.

For next-best results, Foxhound needs the RESOURCE privilege. Without it, the Foxhound Monitor will not be able to create the following procedures on the target database:

rroad_connection_properties

rroad_database_properties

rroad_engine_properties

Without those procedures, Monitor performance will suffer, especially if the target database has a lot of connections. The Foxhound Monitor page displays SPs OK: YYY if finds the three procedures, and SPs OK: NNN if it doesn't.

Note: If you want to monitor a secondary (read only) database in a high availability environment, start a monitor session on the primary (updatable) database first so the procedures described above can be stored on the primary and then reach the secondary database via the high availability synchronization process. Foxhound can't send the procedures directly to the secondary database because it's read only.

Here is how you can let Foxhound create those procedures without giving it DBA privileges:

  1. Create a user id to be used by Foxhound on the target database; e.g.:

    GRANT CONNECT TO FOXHOUND IDENTIFIED BY SQL;

  2. Give that user id the RESOURCE privilege:

    GRANT RESOURCE TO FOXHOUND;

  3. If the Foxhound Monitor is already connected to the target database, click on Stop Sampling, then Start Sampling.

  4. Check to make sure "SPs OK: YYY" appears on the Foxhound Monitor page.

If you don't want to let Foxhound to have either RESOURCE or DBA privileges, but you are willing to install those three procedures on the target database yourself, here's how:

(Note: If you choose to use this method, you will have to repeat these steps for each target database you wish to monitor, and again each time you upgrade to a new version or build of Foxhound.)
  1. Create a user id to be used by Foxhound on the target database; e.g.:

    GRANT CONNECT TO FOXHOUND IDENTIFIED BY SQL;

  2. Find the following three text files in the Foxhound folder (which defaults to C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1):

    rroad_connection_properties.sql

    rroad_database_properties.sql

    rroad_engine_properties.sql

  3. Edit each file to specify the user id you chose in step 1; e.g., change {OWNER} to FOXHOUND:

    CREATE PROCEDURE FOXHOUND.rroad_connection_properties()

    CREATE PROCEDURE FOXHOUND.rroad_engine_properties()

    CREATE PROCEDURE FOXHOUND.rroad_database_properties(d INTEGER)

  4. Use dbisql to run those files against the target database.

  5. If the Foxhound Monitor is already connected to the target database, click on Stop Sampling, then Start Sampling.

  6. Check to make sure "SPs OK: YYY" appears on the Foxhound Monitor page.


Backup and Restore    [Top]

It is a good idea to take regular backups of the Foxhound database, for two reasons: To protect against loss, and to control the growth of the Foxhound transaction log file.

Foxhound doesn't take backups automatically, but it does come with a backup batch file called $backup_foxhound1.bat which can be run manually or according to a regular schedule.

Here is how to run the backup manually using the shortcuts created by the Foxhound installation:

Start - All Programs

- Foxhound

- Tools

- Backup Foxhound Database

Here is what the output looks like:

C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1\backup
>"C:\Program Files\SQL Anywhere 11\Bin32\dbbackup.exe" -c "ENG=foxhound1;DBN=f;U
ID=BACKER;PWD=SQL" -o generation3\backup_log.txt -x -y generation3
SQL Anywhere Backup Utility Version 11.0.1.2250
(15565 of 15554 pages, 100% complete)
Transaction log truncated
Database backup completed

You can also use the Windows Scheduled Tasks feature to run the backup on a regular schedule:

Start - All Programs

- Accessories

- System Tools

- Scheduled Tasks

Doubleclick on "Add Scheduled Task"

Follow the instructions to launch C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1\$backup_foxhound1.bat on a regular basis.

Here is a description of the tasks performed by $backup_foxhound1.bat:

Here is how to perform a full restore from a backup:


Controlling Growth    [Top]

The Foxhound Monitor process will cause the Foxhound database and transaction log files to grow in size. This growth can be quite rapid, as much as several gigabytes per day, if target databases have hundreds or thousands of connections.

Foxhound transaction log growth can be controlled by regularly using the backup process described in the previous section. That backup process deletes old backup copies of the transaction log as well as deleting and restarting the current transaction log.

Foxhound automatically controls database file growth with an internal purge process that runs every hour. By default the purge process deletes data when it reaches 1 month old. You can speed up or slow down this process by changing the "Purge sample data:" setting on the Foxhound Options page.

[Top]



























































[Top]