ANALYZE Utility
Scans a Visual SourceSafe database for integrity, displays information and errors in a results window, and optionally fixes any errors. You can use the utility from the command line or as part of a script for unattended operation. If you are the database administrator, you should run ANALYZE (Analyze.exe) regularly (nightly, monthly, etc.) to verify that there are no problems in the database. See How to: Find and Repair Data Corruption.
Note
Each time you run ANALYZE, it requires a clean directory to store backup files. The default is the directory called Backup in the Data directory.
Under normal conditions, all users should be logged out of Visual SourceSafe before the database administrator runs ANALYZE. Unless the -X option is supplied, the utility does not run if any users are logged into the database.
Syntax
analyze [-B<folder>][-C][-D][-DB][-DC][-DF][-DW][-F][-FL][-FP][-H][-I-][-REFV6][-S][-V<number>][-X][-?] [@<response file>|<List of files>]<SourceSafe data path>
Utility Options
The following table describes options available with ANALYZE. 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.
- -B<folder>
Specifies a backup folder.
- -C
Cleans up and compresses unused space in the database. Compression removes blank space and does not compress the log files. Because compression generates a large number of files in the Backup directory, it should be used only when there is plenty of disk space available. Note that this option can be slow.
- -D
Deletes any unused files. Deletion recovers space taken up by files and projects that have been purged.
-DB
Deletes the backup folder.Warning
Create backup copies of logs before running ANALYZE with the -DB switch.
- -DC
Disable common messages.
- -DF
Disable checking for free space.
- -DW
Run Data Wizard reference checking only.
- -F
Automatically repairs inconsistencies and corruption that are detected, as long as no users are logged in. If you are running the utility with this option, you must ask users to log off first. Does not rebuild the label cache.
- -FL
Performs the same repairs as -F, but also rebuilds the label cache.
- -FP
Performs the same repairs as -F, but also removes invalidly named physical files.
- -I-
Continues without stopping for user input, which allows unattended operation. By default, ANALYZE leaves the results window on display. When the analysis is complete, the utility quits. This option is useful if you are running ANALYZE from a script.
- -REFV6
Uses classic (Analyze V6) reference checking.
- -S
Rebuilds project slowly, using a more rigorous scan for child items.
- -V<number>
Specifies the verbosity of output. Without a number specified, this option shows all errors and warnings in the lower pane of the results window
- -V1
Displays only critical errors, which is the default if no -V option is used.
- -V2
Displays critical and significant errors.
- -V3
Displays all errors.
- -V4
Displays all errors and warnings, inconsistencies, and informational notes. This option is equivalent to -V without a number.
- -X
Specifies that files are not locked during analysis. In other words, this option directs ANALYZE to run against a live database. This option cannot be used with the -C, -D, or -F option. You should not use this option unless absolutely necessary. If users must remain logged in during analysis and ANALYZE tries to access a file that is in use while in this mode, the utility quits and you will need to re-run it.
- -?, -H
Displays informational messages containing descriptions of valid options.
- full database path
Specifies the path of the Visual SourceSafe Data directory to analyze. This parameter must be the first non-option parameter specified on the utility command line. A data path, list of files, or response file must be specified.
- @response file
Specifies a file that ANALYZE produces to list problem files. This file is named Analyze.bad by default. Using this file as input directs ANALYZE to work on fewer files, which can improve performance. Another way to improve performance is to place the response file in the same path or in the same directory as Analyze.exe.
- list of files
Lists files to analyze. The list can include only log files, or complete data paths, such as C:\VSS\Data\A\AAAAAAAA.
Remarks
When you run ANALYZE, it executes in the following passes:
Checks every file in the Data directory to make sure that it is valid and not corrupt.
Checks the relationships between parents (projects) and children (files and subprojects).
Checks the relationships between shared and branched files.
Checks the files Um.dat, Rights.dat, and Names.dat and performs cleanup operations.
When you analyze a database, ANALYZE creates a file called Analyze.bad in the Backup directory and uses the file to list all corrupted files. ANALYZE also uses the Backup directory to keep the original versions of files that have been repaired.
As it runs, ANALYZE writes output to a results window that can contain two panes. The output information scrolls within a pane. All results of ANALYZE are logged to the file Analyze.log, which is placed in the Backup directory and replaced each time ANALYZE runs.
Note
You must close any open results windows before rerunning ANALYZE.
The top pane of the results window contains summary information, as shown in the next example.
Visual SourceSafe Analyze Version 8.0
Copyright (C) Microsoft Corporation. All rights reserved.
Database analysis in progress @ 7/05/05; 5:23p.
Analysis complete @ 7/05/05; 5:23p
No errors or inconsistencies found.
The example below shows the summary information provided when you run ANALYZE using the -V or -V4 option for verbose output. When you use the -V option, the information is written to the bottom pane of the results window.
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 subprojects of item 'aaaaaaaa', as given in its header, does not match the number of subprojects found on disk. The count will be adjusted.
Running ANALYZE in the order shown in the next table provides good coverage. If you still have errors after the second run, you can check the Microsoft Knowledge Base at https://www.microsoft.com/kb) articles Q152807 and Q176909 for more information.
- analyze –V4 <database path>
Indicates the first pass to locate problems before you try to fix them.
- analyze -F –V4 <database path>
Indicates a second pass in fix mode to run if errors are reported in the first pass.
analyze -F -C –V4 <database path>
Indicates a pass to run if you have "Found a DIFF" and "Found a COMMENT" errors that you want removed.Caution Since the DIFF and COMMENT messages can occur in a large number of files, you must have enough disk space available to run this compress pass on your database.
When ANALYZE fixes a file, it first creates a copy of the file in the Backup folder so that the repair can be undone if necessary. Each time ANALYZE runs, it requires that the Backup folder is either empty or does not exist. If there is sufficient disk space, it is a good practice to rename the Backup folders instead of deleting them. This history can prove very useful in troubleshooting corruption issues.
ANALYZE rebuilds the Rights.dat file, and all information about rights for individual users and projects is lost. When you run Visual SourceSafe again, each user has the read/write or read-only rights for the entire database that were assigned when that user was added to the database user list. As the database administrator, you must set rights for individual users and projects again. Alternatively, you can clear the Enable Rights and Assignments commands check box on the SourceSafe Options dialog box, Project Rights tab to use the basic read/write or read-only rights.
ANALYZE can also recreate the Status.dat and Names.dat files. To do this, rename or delete the files you want rebuilt, and run ANALYZE -F. ANALYZE recreates the Names.dat file with the spaces in long file names appearing as underscores. You then need to rename the file using Visual SourceSafe Explorer.
Examples
Analyzes and repairs the complete database and generates verbose output:
analyze -C -D -F -V4 C:\VSS\Data
Analyzes the database, but does not repair it, and creates a list of corrupted files in C:\Temp:
analyze -BC:\Temp C:\VSS\Data
Repairs any problems in the files listed in the Analyze.bad file generated by the preceding example:
analyze -F -C -D @C:\VSS\Data\Backup\Analyze.bad C:\VSS\Data
See Also
Tasks
How to: Find and Repair Data Corruption