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

If you attach a file with a record and then delete that record

If you attach a file and then change the URL type without deleting the record

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’:

Open command prompt and change the directory to the bin sub directory with in the Siebel Server directory

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.

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.

Steps to run Siebel DBCHCK utility:

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.

Verify that there is no Siebel Remote or EIM operation running on Siebel server

Go to command prompt and use the following command to run the utilityPrompt>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

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.