Siebel System Administration Guide > Siebel Server Infrastructure Administration > Administering the Siebel File System >
Cleaning Up the Siebel File System
This topic describes how to clean up the Siebel File System by removing orphan records using the Siebel File System cleanup utility, sfscleanup . Orphan records are those that remain if a user deletes a parent record in the application that has associated child records. The child records are not deleted from the Siebel File System with the parent record and so you must remove them by using file system cleanup utility. The Siebel File System cleanup utility is named sfscleanup.exe on Microsoft Windows or sfscleanup on UNIX operating systems. This utility is located in the bin directory within the Siebel Server root directory. The sfscleanup utility processes records for every file in the file attachment directories (the att subdirectories) of the specified Siebel File System directories and performs one of several operations to each record and file, depending on the file type and on the parameters that you set. Optionally, you can run sfscleanup for a limited period of time and resume the operation again later. For descriptions of the run-time parameters that you can set when running sfscleanup , see Table 25. More information about some of the parameters follows the table. For descriptions of the file types and the associated operation performed by sfscleanup during processing, see Table 26. NOTE: In general, this book is for deployments of the current release, Siebel CRM version 8.1.1.11 or version 8.2.2.4. For customers using earlier Siebel CRM version 8.1.1.x releases, note that Siebel CRM version 8.1.1.5 is the minimum version for some of the functionality described in Table 25, such as the command-line options /Q, /I, /S and /T.
This topic is part of Administering the Siebel File System. To clean up the file attachment directory using sfscleanup
- At the command prompt, change directory to the
bin subdirectory within the Siebel Server root directory.
- Run
sfscleanup using parameters listed in Table 25, in a command like the following example:
sfscleanup /U sadmin /P pwd /F \\server1\files /X \\server1\logs\sfscleanup.log
Parameters for the sfscleanup Utility
Table 25 describes the parameters for the sfscleanup utility. More information about some of the parameters is provided after the table.
Table 25. Parameters for sfscleanup Utility
|
|
|
|
/U |
Username |
User name ID. |
Yes |
/P |
Password |
User name password. |
Yes |
/C |
ODBC_data_source |
Set this value to the ODBC data source. The default value is the setting of the environment variable SIEBEL_DATA_SOURCE. |
No |
/D |
Siebel_table_owner |
Set this value to the Siebel table owner. The default value is the setting of the environment variable SIEBEL_TABLE_OWNER. |
No |
/F |
Paths for file system directories |
Set this value to the paths for the file system directories. Whether you must append att to each directory depends on how you use the /H parameter:
- If you use /H Y, then do not append
att to each directory that you specify using /F. (The purpose of /H Y is to eliminate the need to append att .)
- If you use /H N (or omit /H), then you must append
att to each directory that you specify using /F. The utility looks both in the specified directories and in the att subdirectories to find the files to be cleaned up.
|
Yes |
/X |
Path for output file |
Set this value to the path for the output file. |
No |
/M |
Path for move directory |
Set this value to the path for the directory where discarded files are to be moved. |
No |
/N |
Y or N |
Determines whether old versions of file attachments are to be removed. To remove old versions, set this value to Y. The default value is N. |
No |
/R |
Y or N |
Set this value to Y to generate only a report file. If it is set to Y, then the report file contains only the columns File Name and File Type. The default value is N. |
No |
/H |
Y or N |
Set /H Y if you want the utility to automatically append att to each directory that you specify using /F. (Do not append att when you specify these directories.) Set /H N (or omit /H) if you do not want the utility to automatically append att to each directory that you specify using /F. (Append att when you specify these directories.) |
N |
/G |
Y or N |
Set this value to remove garbage files or non-Siebel files. The default value is N. |
No |
/Q |
Y or N |
Set /Q Y if you want the utility to perform a query by file attachment records. This parameter allows you to run the utility for a limited period of time and provides other ways to manage how the utility runs. The default value is N. NOTE: When you are using /Q Y, you can also use the parameters /I, /O, /S, and /T. Otherwise, these parameters have no effect.
|
N |
/I |
Number of file IDs |
Set /I to the number of file attachment records to query. The default value is 300. The utility processes records and files in batches based on the specified number of records. After those files have been processed, the utility processes more records and files in another batch. NOTE: This parameter has an effect only if you are using /Q Y.
|
N |
/O |
Y or N |
Use /O Y when you want the utility to use an OR clause to constrain the query row IDs, like this: (ROW_ID = 'Id1' OR ROW_ID = 'Id2' OR ...) . The default value is Y. Use /O N to instead use a clause like this: ROW_ID IN ('Id1','Id2',...) . NOTE: This parameter has an effect only if you are using /Q Y.
|
N |
/S |
Y or N |
Use /S Y to resume the previous run, from the next unprocessed record, where information about the last processed record is available in a temporary directory. The default value is N. Use /S N (or omit /S) to instead start a new run. NOTE: This parameter has an effect only if you are using /Q Y.
|
N |
/T |
Number of minutes |
Set /T to the number of minutes to run the query. When the utility reaches that time, the last processed file attachment record is noted in a temporary directory and the utility exits. Later, you can resume the previous run by using /S Y. By default, the utility runs to completion, until all of the records and files are processed. NOTE: This parameter has an effect only if you are using /Q Y.
|
N |
More Information About Some sfscleanup Parameters
The following provides more information about some of the parameters for the sfscleanup utility. The parameters are described in Table 25.
- /N. By default, old file revisions are kept. Such files are marked ANCIENT in the log, and represent old revisions of an existing attachment record. That is, their row ID matches with the database record but not the file revision number. To delete such files, set the /N parameter to Y.
- /G. If the file system contains files that were not created by the File System Manager component (alias FSMSrvr), then their deletion or move is controlled by the /G parameter. This parameter includes non-Siebel files or directories. By default these files are not deleted. The directories are not affected or moved by
sfscleanup .
- /Q. By default, the
sfscleanup utility processes all of the files in the file attachment directories in a single long-running operation. For a Siebel File System that includes a very large number of files, such an operation might affect performance or inconvenience production users.
Alternatively, the /Q parameter allows you, for example, to process files in batches based on a query of a given number or file attachment records (by using /I), to modify how the utility queries these records (by using /O), to run the utility for a specific period of time (by using /T), and to resume a run later where it left off (by using /S). For example, you might decide to run the sfscleanup utility only when most of your users are not logged in. For more information, see the descriptions in Table 25.
About the sfscleanup Log File
If you specified an output file using the /X parameter, then sfscleanup generates a log file listing the operations that were performed. The output file is a tab-delimited text file that contains the following columns:
- File Name. This column lists the name of each file that was processed.
- File Type. This column lists the type of each file that was processed. Table 26 lists the possible file types and the associated operation performed by
sfscleanup during processing. For descriptions of each operation, see Table 27.
Table 26. File Types and Associated Operations for sfscleanup Utility
|
|
|
CURRENT |
The file has a corresponding record in the file attachment database table. |
KEPT |
NEW |
The file is less than one hour old. The sfscleanup utility does not check for the file in the file attachment database table. |
KEPT |
ORPHAN |
The file does not have a corresponding record in the file attachment database table. If you used the /M parameter to set a move directory, then the operation performed is MOVED, not DELETED. |
DELETED |
INVALID |
The file (or directory) is not a file attachment. If sfscleanup tries to delete a subdirectory that is not empty, then the operation errors out. Review the files contained within the directory before deleting them. If you set the /G parameter to Y, then the operation performed is DELETED, not KEPT. |
KEPT |
ANCIENT |
The file has an associated record in the database with a different revision number. If you set the /N parameter to Y, then the operation performed is either MOVED (if you used the /M parameter to set a move directory) or DELETED, not KEPT. |
KEPT |
- Operation. This column lists the type of operation that was performed during processing. Table 27 lists the types of operation that
sfscleanup might have performed during processing.
Table 27. Operations for sfscleanup Utility
|
|
KEPT |
The file was kept. |
DELETED |
The file was deleted. |
MOVED |
The file was moved to the directory specified by the /M parameter. Files are moved if you used the /M parameter. |
KEPT_DIR |
The item was kept because it was a directory and requires manual processing. |
KEPT_ERROR |
The file was kept because an error occurred while trying to move or delete the file. |
|