Syntax for DBClean configuration and execution

To add a new configuration to the Database Cleanup utility, use the following syntax as a reference. For example, object Obj1 consists of table sample, which contains the following columns: columnA, columnB, lastupdate, and columnC. To configure the Database Cleanup utility to delete all objects with columnA> 10, and where lastupdate is n days ago:

1. Open a DB2 command prompt.

2. Type the following to configure the Cleanup utility for this table, and add a new object named "Ojb1" into cleanconf table.

db2 insert into cleanconf (objectname, type, statement, namearg, 
sequence, daysarg) values ('Obj1', 'obsolete', 'delete from sample 
where columnA > 10 and (days(CURRENT TIMESTAMP)- days(lastupdate)) > 
?', 'no', 1, 'yes')

Note: In the above command, the question mark (?) is replaced by the -days parameter from the following command line. The 'no' indicates that the name parameter is not used in the statement. The 'yes' indicates that the -days parameter is used in the statement. 'obsolete' describes the cleanup type for object Obj1. You can use other words, but use the same word in the -type argument when you invoke the Database Cleanup utility.

3. Execute the DBClean utility to clean the records that have been in existence for two days from the new table by typing the following:

./dbclean.sh -object o1 -db RAskyway -dbuser user -type obsolete -days 
2 -loglevel 1 
xxxx