ANALYZE 4.0 README
==================

Visual SourceSafe has always shipped with an ANALYZE utility that allows you to scan the SourceSafe database for corruption. However, the 32-bit version of ANALYZE has been updated to include a -F option that actually fixes corruptions, as well as finding them. The recommended usage is to run ANALYZE on your database (without -F) on a regular basis, such as once a week, to search for corruptions; then, if you find any corruption, use ANALYZE -F to fix the problem. It must be emphasized that the -F option works only with the 32-bit version of ANALYZE: the 16-bit version can still be used to find corruption, but cannot repair it.

Administrators can run ANALYZE manually from the command line, or as part of a script for 
unattended operation, to analyze or fix the problem.  The new ANALYZE utility is found in the WIN32 directory under the directory in which you installed Visual SourceSafe.

SYNTAX
======

The ANALYZE EXE utility uses the following syntax:

ANALYZE [-B<directory>] [-C] [-D] [-F] [-I-] [-V] [-X] [-?] [-H]
<Full Database Path | @Response File | List of Files>

The following list describes the options.

-B <directory>  Specifies a backup directory.

-C   		Cleans up and compress the database. This option can be slow.

-D   		Deletes any unused files.

-F    		Attempts to repair any inconsistencies and corruption that are detected.

-I-  		Continues without stopping for user input (allowing unattended 
		operation). By default, ANALYZE leaves the results window on 
		display. 

-V    		Produces verbose output. This output appears in the lower pane of the 
		Analyze Results window and contains detailed information on what 
		the utility attempted and accomplished.

-X    		Directs analyze to not lock files as it processes. Allows analyze to 
		run against a live database.  This option cannot be used with the -c,    
		-d, or -f options and use of this option is not recommended unless 
		absolutely necessary. 

Full DB Path    Path of the Visual SourceSafe data directory to analyze.  This 
		parameter must be the first non-switch parameter.  A data path, list 
		of files, or response file must be present on the command line.

@Response File  File produced by running analyze, containing listing of problem 
		files, named ANALYZE.BAD by default.  Using this file as input directs 			ANALYZE to work on fewer files, thereby improving performance.

List of Files   List of files to analyze. List can include only log files, or complete 
		data paths, not individual files from the database.

-?, -H    	Displays usage message containing descriptions of valid options.

Order of options is not important, but the full database path, response file, or list 
of files must be included on the command line as the first non-option item.

EXAMPLES
========

The following examples demonstrate use of the ANALYZE utility from the command line.

ANALYZE -C -D -F -V C:\VSS\DATA 
Analyzes and repairs the complete database and generates verbose output. 

ANALYZE -BC:\TEMP C:\VSS\DATA 
Analyzes the database, but does not fix it. Creates a list of corrupted files in 
C:\TEMP.

ANALYZE -F -C -D @C:\TEMP\ANALYZE.BAD
Fixes any problems in the files listed in the ANALYZE.BAD file generated by the 
preceding example. 


REMARKS
=======

The types of problems that the ANALYZE utility can correct include, among 
others, the following:

- Parent/child mismatch. Possible situations include those in which a parent 
thinks it has a child but the child disagrees, a child thinks it has a parent but the 
parent disagrees, or child and parent don't reference each other but the child 
counts are off. 

- Corrupt database files. These files include the following: NAMES.DAT (stores 
long filenames longer than 34 characters),  RIGHTS.DAT (stores relationships 
between users and project rights), STATUS.DAT (stores checkout status for 
files), UM.DAT (stores all users in a Visual SourceSafe database) , and 
VERSION.DAT (stores the version of Visual SourceSafe).

- Removing unused items from the database.

All results of Analyze/Repair are logged to the file, ANALYZE.LOG, which is placed in the 
\VSS\DATA\BACKUP directory and is replaced each time you run ANALYZE. 
When you analyze the database, ANALYZE creates a file listing all corrupted 
files.  This file is called ANALYZE.BAD and is also placed in the 
\VSS\DATA\BACKUP directory.  In addition, the original versions of files that have 
been repaired are placed in the \VSS\DATA\BACKUP directory.

Under normal conditions, all users should be logged out of Visual SourceSafe 
before Administrators run ANALYZE.  Users must be logged out to run 
ANALYZE with the -F option to repair problems.  ANALYZE does not run if any 
users are logged into Visual SourceSafe unless the -X option is supplied. 

ANALYZE writes output to a separate window it creates, Analyze Results.  This 
window contains two panes.  You must close any open results windows before 
running ANALYZE another time.

The top pane contains summary information.  For example:

Analyze Version 4.0A0
Database analysis in progress.
The Parent Project for item acctapp is corrupt and the link to the child 
file has been lost until the project is recovered.
Analysis complete.

This is the information provided in the output window when you run ANALYZE 
without using the -V option for verbose output.  When you use the -V option, the 
information provided is written to the bottom pane of the Analyze Results 
window.  The following example shows verbose output:

Started analyzing user management system.
Successfully completed analyzing the user management system.
Rebuilding corrupted project for item aaaaaaaa.
Building the project list.
Checking cross file relationships.
Checking parent/child relationships.
Validating the Security System. 
Writing a new copy of c:\vss\data\a\aaaaaaaa.
The count of children of item aaaaaaaa, as given in its header, does 
not match the number of children found on disk. The count will be 
adjusted.
The count of sub-projects of item aaaaaaaa, as given in its header, 
does not match the number of sub-projects found on disk. The count will 
be adjusted.

Note that the actual output in the Analyze Results window does not wrap; it 
scrolls within the pane.

When the RIGHTS.DAT database file is rebuilt by the ANALYZE utility, it turns 
on project security, even if security was disabled before the rebuild.  As a result, 
only the Administrator can log into Visual SourceSafe after the rebuild of 
RIGHTS.DAT.  Therefore, the Administrator must then run the SSADMIN 
program to turn off  Project Security or re-assign all user rights. 
