Help for Foxhound 1.3738b
Table of Contents [RisingRoad]
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
Customizing the Setup
Running Foxhound as a Service
Connecting to Target Databases
Backup and Restore
SQL Anywhere is a trademark of Sybase, Inc.
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 and Vista SP1.
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.
IE 8: Tools - Internet Options - Security - Local intranet - Custom level... - Scripting - Active scripting - check "Enable"
6. SQL Anywhere 32-bit version 18.104.22.1686 or later for Foxhound - Foxhound works with target databases using 5.5 to 11 of SQL Anywhere including 64-bit versions, but the Foxhound engine itself needs the x86 version of SQL Anywhere 22.214.171.1246 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 and Vista:
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 are the default settings for Windows XP and Vista:
SET FOXHOUND1=C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1\ SET FOXHOUND1=C:\ProgramData\RisingRoad\Foxhound\
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:
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
- 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:
- Home Page:
Here's how to do the same thing with Internet Explorer:
- Internet Options
- Home Page
By default the Foxhound batch files are installed in this folder:
C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1
Here are the two most commonly-used batch files; each of these starts the Foxhound engine in the same manner, and then launches the Foxhound client using either FireFox or Internet Explorer:
You can customize those batch files, or create new ones as you see fit. Each one contains the following commands to start the Foxhound Engine:
"%SQLANY11%\Bin32\dbspawn.exe" -f -q "%SQLANY11%\Bin32\dbeng11.exe" -n foxhound1 -qi -x none -xs http(port=80;maxsize=0;to=600;kto=600) foxhound1.db -n f
Here is a description of each part of those commands:
Note: The Foxhound application resides inside the foxhound.db database file, and that database must be run on its own engine (dbeng11.exe or dbsrv11.exe). In other words, you cannot start the foxhound.db database on an engine that is already running some other database, and you cannot start another database on an engine that is already running Foxhound. You can run other databases on the same computer, of course; they just need their own engine(s).
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:
-o "C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1\foxhound1_debug.txt"
-xs "http(log=C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1\foxhound1_http_log.txt;lf=@T - @I - @U - @R - @L - @W - @E;lsize=1M;dbn=f;port=8080;maxsize=0;to=600;kto=600)"
"C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1\foxhound1.db"
Here is a description of those parameters:
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:
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:
GRANT CONNECT TO FOXHOUND IDENTIFIED BY SQL;
GRANT RESOURCE TO FOXHOUND;
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.)
GRANT CONNECT TO FOXHOUND IDENTIFIED BY SQL;
CREATE PROCEDURE FOXHOUND.rroad_connection_properties()
CREATE PROCEDURE FOXHOUND.rroad_engine_properties()
CREATE PROCEDURE FOXHOUND.rroad_database_properties(d INTEGER)
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
- 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 126.96.36.1990
(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
- 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:
C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1 -- the default Foxhound folder created by the Foxhound installation
\backup -- the backup subfolder
\generation1 -- the oldest backup subfolder, deleted before a new backup is created
\generation2 -- the previous backup subfolder, renamed to "generation1" before a new backup is created
\generation3 -- the latest backup subfolder, renamed to "generation2" and recreated before a new backup is created.
Here is how to perform a full restore from a backup:
C:\Documents and Settings\All Users\Application Data\RisingRoad\Foxhound1\
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.