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

DBCHCK utility – check Siebel database health

Siebel comes with many out of box utilities to perform various activities like database health checkup, file system clean up, cfgmerge. DBCHCK utility is one of such utilities that helps to verify current state of Siebel database and it’s health.Siebel DBCHCK Utility

Recently on the last step of Siebel incremental repository merge, we faced an error ‘DATAIMP-ERR-1124: Unable to import table‘ though the merge process was successfully completed. So to find out the reason behind this error, we decided to validate Siebel database and seed data using DBCHCK utility. According to utility, it was the problem with seed data import. We were not interested in fixing seed data related issues, so ignored this but the detail report, generated by DBCHCK was really impressive and elaborated.

You can use this utility to compare physical database schema with repository to make sure that both are in sync. It also validates data integrity including primary keys, foreign keys, list of values. 

Read more about Siebel Incremental Repository Merge – errors that we faced.

Steps to run Siebel DBCHCK utility:

  1. Delete the dictionary cache file (diccache.dat) from the <Siebel Server>\bin directory before running DBCHCK utility. It ensures that the utility validates against the Siebel repository that you have specified. It will create a new diccache.dat file before running integrity check.
  2. Verify that there is no Siebel Remote or EIM operation running on Siebel server
  3. Go to command prompt and use the following command to run the utility
    Prompt>dbchck /S <ODBC_DATASOURCE> /U <USERNAME> /P <PASSWORD> /T <TABLE OWNER> /R <REPOSITORY> /L <LOGFILE> /D <CHECK_AGAINST_DICTIONARY> /A <ALL_TABLES>
    /S ODBC name for database
    /U Username to login to database
    /P User password to login to database
    /T Table owner
    /R Siebel repository name
    /L log file name
    /D Tables against dictionary only
    /A Specify table name or keep it blank to check all tab
  4. Review the log file generated by the utility for any discrepancy. You can ignore certain errors or warnings but there are few discrepancies that must be fixed. To know more about discrepancies generated by this utility, you could read the article ‘Validating the Siebel Schema‘ provided by Oracle.

Note: According to Siebel best practices, we should validate database health every time we upgrade Siebel application or perform repository merge.

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

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

<< Sfscleanup Utility