Clean up Siebel File System – Sfscleanup Utility

Clean up Siebel File System is one of major server maintenance activities. Over the time, Siebel file system becomes loaded with lots of invalid and orphan files. If you don’t clean up such files, it may impact on performance of Siebel application and also block hard disk space unnecessarily. To clean up such invalid and orphan files, Oracle provides an utility ‘Sfscleanup’. Here we will discus how to use sfscleanup utility to clean up Siebel file system.

But why files become invalid and orphan?

Well! there could be many reasons, like

  1. If you attach a file with a record and then delete that record
  2. If you attach a file and then change the URL type without deleting the record
  3. If you attach a file against a record and then without deleting that record, attach another file with the same record

How to run Siebel file system cleanup utility ‘Sfscleanup’?

Before running this utility, make sure you have SIEBEL_REPOSITORY environment variable set properly because sfscleanup utility refers environment variable to execute properly. To set SIEBEL_REPOSITORY environment variable correctly, you cloud run another utility ‘siebenv.bat’. We will discus about ‘seibenv’ utility in another article. Sfscleanup utility is located in ‘bin’ sub directory within Siebel server root directory. This utility processes each and every file in the file attachment directory.

Steps to clean up Siebel file system directory using ‘Sfscleanup’:Sfscleanup Siebel Utility

  1. Open command prompt and change the directory to the bin sub directory with in the Siebel Server directory
  2. Run sfscleanup.exe using below parameters

Prompt>sfscleanup /U <User ID> /P <Password> /C <ODBC Data Source> /D <Siebel Table Owner> /F <Path of the Siebel File System Directory> /X <Path of output file, mainly log file> /M <Path to move invalid file>

It would look like:
sfscleanup /U sadmin /P sadmin /C TECHONESTOP /D SIEBEL /F D:\sba81\FS /X D:\sba81\siebsrvr\log\sfscleanup.log /M D:\sba81\siebsrvr\log

Parameter Value Description Required
/U Username Username Id Yes
/P Password Password of the given user Yes
/C ODBC data source name Set this value to ODBC data source if SIEBEL_DATA_SOURCE environment variable is not set properly No if SIEBEL_DATA_SOURCE is set
/D Siebel table owner Set this value to Siebel table owner if SIEBEL_TABLE_OWNER environment variable is not set properly No if SIEBEL_TABLE_OWNER is set
/F Path of the Siebel file system directory Set this value to Siebel file system directory, do not append ‘att’ to the path directory Yes
/X Path of the output file Set this value to the path of out put file, mainly log file No
/M Path to move invalid files Set this value to the path where invalid/orphan files will be moved No
/N Remove older file versions * Set this value to ‘Y’ if you want to delete older version of file attachment. By default Siebel will keep these files marked as ‘ANCIENT’ No
/G Remove garbage file Set this value to ‘Y’ if you want to delete non siebel files from Siebel file system No
/R Generate report file Set this value to ‘Y’ if you want to generate report with File name and File Type No

 

Older version file means that corresponding attachment record exists in Siebel database but not the file revision number.

If you want to know more about Sfscleanup parameters, refer Cleaning Up the Siebel File System provided by Oracle.

Output file, generated by /X parameter, looks like below. It has three parameters – file name, file type and file operation.

sfscleanup utility

File Name:

This column contains the name of each file that was processed during the execution of Sfscleanup utility

File Type:

This column lists the type of each file that was processed. Below we have listed down all file types and associated operations that this utility performs to clean up Siebel file system.

File Type Description File Operation
CURRENT This file is valid file, it has corresponding record in file attachment table. KEPT
NEW This file is less than one hour old and sfscleanup utility does not check such file in file attachment table. KEPT
ANCIENT This file has corresponding attachment record in database but file version does not match KEPT if /N or /M parameter is not used

  • If /N parameter is set to ‘Y’, operation will be DELETED
  • If /M parameter is set to ‘Y’, operation will be MOVED
INVALID This file or directory is not a valid attachment. KEPT if /G parameter is not set to ‘Y’, otherwise DELETED
ORPHAN This file does not have corresponding record in File attachment table DELETED if /M parameter if not set to any value, otherwise MOVED

File Operation:

This column lists the type of operation performed on each file.

Operation Type Description
KEPT File is not deleted
DELETED File is deleted from file system
MOVED File is moved to the directory specified by /M parameter. Files will only be moved to the directory if the /M parameter is used.
KEPT_DIR Its a directory, not a file and need manual intervention to delete it
KEPT_ERROR File is kept as an error occurred during delete or move operation

 

Except Sfscleanup, there are another two important utilities ‘Sfspartition‘ and ‘Sfsutl‘ for Siebel file system. We will discuss these in our next article.

Now it’s time for action! Go and Clean Up Siebel File System!

Do you have any question? Please feel free to comment below.

Keep in touch, follow TechOneStop on Facebook / Twitter / LinkedIn / Goolge+.

<< DBCHCK Utility

Error: Invoking service 'Context Service', method 'GetRowSetData' at step 'Get Context Row Set' (SBL-BPR-00162) (SBL-DAT-00215)".
Highlight required fields in Siebel Open UI

Leave a Reply