Amministrazione generale > Archiviazione e replica di file > Archiviazione di file > Understanding File Vaulting > Diagnostic and Repair Tools
  
Diagnostic and Repair Tools
This section describes utilities that you can use to check and correct vaulted content files.
Verifying Content Files
Windchill includes a command line utility, WContentVerify, that checks for content files that are referenced in the database but missing in the vaults. This utility also verifies actual content file sizes with the sizes in the metadata in the database. Running the wt.fv.tools.WContentVerify command from the Windchill shell provides the details of the business object that is associated with missing or incorrectly sized files, and the results are output to an XML file in the Windchill log directory.
The command windchill wt.fv.tools.WContentVerify -usage details all the valid arguments and their effects. Running it without the -email argument specified results in no email notifications being sent. All command line arguments are optional. If no arguments are supplied, the system checks all system content for internal integrity by checking all vaults and folders for missing or incorrectly sized files. The WContentVerify utility executes multi object query in a parallel manner using task execution framework to identify the business objects of the content files in database. The parallel execution of multi object queries helps to improve the operational efficiency by checking a high number of missing content files in a vault in a short duration of time.
* 
The wt.mail.mailhost property in the wt.properties file in the codebase directory must point to a valid SMTP server.
Following are the arguments you can use and their descriptions:
Argument
Description
-user=<adminid>
User ID of the administrator user.
-password=<<adminpassword>
Password of the administrator user.
-propertyFile=<pathname>
Location of the property file of the utility.
-vaults=<vault1,vault2,...>
Only folders for the specified vaults will be checked. No spaces are allowed in or between the vault names.
Specify ALL to generate report for all master vaults.
-folders=<folder1,folder2,...>
Only specified folders will be checked. No spaces are allowed in or between the folder names.
-replicavaults=<vault1,vault2,...>
Only folders for the specified replica vaults will be checked. No spaces are allowed in or between the replica vault names.
Specify ALL to generate report for all replica and cache vaults.
-replicafolders=<folder1,folder2,...>
Only specified folders will be checked. No spaces are allowed in or between the replica folder names.
-onlyExistence
Only check and report the existence of files.
-onlyReportLatest
Report only the latest iteration of iterated documents.
-email=[DIRECT_EMAIL,EMAIL_GROUP]
Enables mail to specified users. This argument overwrites equivalent properties of the property file. You can use a value of DIRECT_EMAIL, EMAIL_GROUP, or both (comma-separated).
-listVaultsFolders
Print vault and folder names and then exit.
-listRemoteVaultsFolders
Print vault and folder names on remote sites and then exit.
-listReplicationRules
Prints all replication rules that are present on the system. This report is based on the vaults that have replication rules. Results are stored in an HTML file in the Windchill log directory.
-listPredictiveRules
Prints all predictive rules that are present on the system. This report is based on the vaults that have predictive rules. Results are stored in an HTML file in the Windchill log directory.
-usage
Print list of valid arguments and then exit.
-checkBusinessObject=<businessobject>
Prints detailed information about a business object, including the locations where it is stored and has been replicated
-checkContentItem=<filename>
Prints detailed information about a specific file, including the locations where it is stored and whether it has been replicated.
-checkPendingTransfers
Prints detailed information about the files in remote sites that have not been transferred yet.
-checkReplicationHistory=<remotesite>
Prints detailed information about the files in a remote site and the period of time that has been replicated.
-sites=<master,site1,site2,...>
Folder for the specified sites will be checked in.
-threadCount=<thread count>
Number of worker threads to run the tool. Default value is 3.
-cacheVault
Prints detailed information about the files in a cache vault. For that, you must provide name of the cache vault as an input. For multiple cache vaults, provide the names of the vaults separated by comma.
This argument can be used with -checkPendingTransfers argument to list the files in the cache vault, which are pending to sync.
-listMissingRulesForBusinessObject
Prints the missing vaulting rules for the content that is stored either in the database blob or in the master vault (set as the default target system). This argument generates an HTML report that consists of the following tables:
Database Blob- Lists all the missing vaulting rules for database.
Master (Default System Target)- Lists all the missing vaulting rules for master vault that is set as default system target.
Additionally, if WContentVerify throws any exceptions during execution, it is recommended that you run the tool with the -debug option.
Most of the command line arguments can be specified in a property file and the property file path specified on the command line with the -propertyFile argument. Alternatively, the property file can be saved as WContentVerify.properties in the Windchill codebase directory, which is the default name and place that this utility searches for.
* 
Arguments specified on the command line override property settings in the property file.
An example property file format is as follows:
# Path to the directory that will store utility's output. If not
# specified, will default to $WT_HOME/logs
OUTPUT_STORAGE_PATH=D:\\XML_Output\\

# true/false Enable sending of summary email after a run of the utility
# The wt.properties setting of wt.mail.mailhost is required
EMAIL_GROUP.enabled=true

# Comma separated windchill usernames. Everyone on this list receives
# email notification of a completed utility execution. No spaces allowed.
EMAIL_GROUP.list=testUser1,testUser2

# Enable sending emails to modifiers of the files that have been detected to have
# errors
DIRECT_EMAIL.enabled=true

# Subject of emails sent to modifiers of files that have been detected to have
# errors
DIRECT_EMAIL.mailSubject=Direct Email Report

# Opening line(s) of emails sent to modifiers of files that have been detected to
# have errors
DIRECT_EMAIL.body=First line of Direct Email Report

# Valid windchill username that will be set as the originator of the email
# notification
DIRECT_EMAIL.replyTo=testUser3

# Valid values are html or text. Determines whether the modifiers receive a text
# or html email
DIRECT_EMAIL.format=html

# The maximum number of errors permissible for direct email to be sent.
# If the total number of errors is greater than this number,
# no direct emails will be sent, default is 2000
DIRECT_EMAIL.limit=1500

# Must be one of All or onlyReportLatest . Reports errors either in all
# iterations or the last iteration of iterated objects, default is All.
REPORT_DOCUMENTS_FILTER=All
Detecting and Resolving Multiple Primary Content Files
The WMultiPrimaryDetect command line utility detects and corrects a data issue where multiple primary content files have been associated with one FormatContentHolder object. WMultiPrimaryDetect is run from the Windchill shell with the command windchill wt.fv.tools.WMultiPrimaryDetect, passing suitable parameters as required. If no parameters are supplied, the tool runs in the diagnosis mode.
Running this tool in the default mode outputs an XML file, multiPrimaryDiagnosis_<YYYYMMDD_HHMM>.xml, which lists all of the incorrect FormatContentHolders and their multiple primary content items. The tool requires that a Windchill method server instance is up and running.
Following are the arguments you can use and their descriptions:
Argument
Description
-user=<adminid>
User ID of the administrator user.
-password=<adminpassword>
Password of the administrator user.
-fix
Operate in repair mode. If you use this argument, you must also specify the -inputFile parameter. If any content files are deleted, a copy of the content file is made in the <WT_HOME>/logs/ContentItems directory.
* 
The content files in vaults are not deleted; only the entries for them in the database are deleted.
-inputFile=<input full path and filename>
Use the specified XML file to delete primary content items. The XML file used as an input is the same XML file which was generated by running the tool in the diagnosis mode (which is the default mode). You must update the diagnostic file to change a value of the deleteThisItem field to Y for the content items whose database entries are to be deleted.
* 
The content files in vaults are not deleted, only the entries for them in the database are deleted.
-outputPath=<output pathname>
Use the directory path specified in outputPath parameter to save the XML output files.
* 
By default, a file with the name of the timestamp of the log is created within the <WT_HOME>/logs directory and the XML file is saved there. If this argument is specified and a path is supplied, the specified path will be used instead.
-confirmBeforeDelete=<Y/N>
Ask user for confirmation before deleting each file. The default value is Y.
-usage
Print list of valid arguments and then exit.
To operate in repair mode, this utility requires an input file that specifies files which are to be deleted. The XML file used as an input is the same XML file which has been generated by running the tool in the diagnosis mode (which is the default mode), but which you have updated to change the value of the deleteThisItem field to Y for the content items that are to be deleted.
* 
Modifying the XML file in any other manner may lead to inconsistent results.
Also, note that at least one primary content item per ContentHolder must exist. If all of the content items for a ContentHolder have been marked for deletion in the XML file, the tool will print an error message (in an errorMessage field in the XML file) for all content items for that ContentHolder, not delete any of them, and continue processing the rest of the XML file. The errorMessage field is optional and not present for objects that were successfully deleted.
When you run the tool in repair mode, a results XML file is generated which is stored in the same directory as the input file. The file name is formatted in the following way: multiPrimaryResults_<YYYYMMDD_HHMM>.xml. The format of this XML file is very similar to the multiPrimaryDiagnosis report, except that the deleteThisItem field is replaced with an itemDeleted field. This field has a value Y for content items that were deleted.
A copy of the deleted content file is saved as the original file name. If there is more than one file with the same name, a numbered suffix, such as _1, _2, and so on, is added. The saved name is also stored in the multiPrimaryResults XML file.
* 
In the WMultiPrimaryDetect tool, logging can be controlled by enabling the logger wt.fv.tools in log4jMethodServer.properties file.