Administer > Database Cleanup utility > Clean the database


Delete user objects

Records in the USERS database table that correspond to guest customers are populated with a timestamp value in the PREVLASTSESSION column. However, if you have migrated from WebSphere Commerce 5.1 or 5.4, some of the migrated guest customer records may have a null value in this column.

To properly run the Database Cleanup utility, ensure that each guest customer record contains a timestamp value for the PREVLASTSESSION column, since this column value is used to determine the age of the user object.

To determine if the database currently contains records that need to be populated, run the following SQL statement:

select users_id, prevlastsession from users where
prevlastsession is null and registertype = 'G'

If this SQL query returns one or more records, run the following SQL statement to populate the PREVLASTSESSION column within the USERS database table:


Procedure

  1. From the WC_INSTALL/bin directory, run the following script:

      •   ./dbclean.sh -object user -type typename -db dbname -dbuser user -days daysold -loglevel loglevel -instancexml WC_INSTALL/instances/instance/xml/ instance.xml

      • dbclean -object user -type typename -db dbname -days daysold -loglevel loglevel -instancexml WC_INSTALL/instances/instance/xml/ instance.xml

      • ./dbclean.sh -object user -type typename -db dbname -days daysold -loglevel loglevel -dbtype oracle -dbuser user -dbpasswd password -instancexml WC_INSTALL/instances/instance/xml/ instance.xml

      • dbclean -object user -type typename -db dbname -days daysold -loglevel loglevel -dbtype oracle -dbuser user -dbpasswd password -instancexml WC_INSTALL/instances/instance/xml/ instance.xml

      Use host:port:sid for the database name. For example, myhost:1521:mydb.

    Notes:

    1. For the -type parameter, you can specify guest to indicate a guest customer or registered to indicate a registered customer.

    2. For details on the syntax and parameters for the dbclean script, see Database Cleanup utility script.  

  2. Examine the WC_INSTALL/instances/instance/logs/DBClean/DBClean. timestamp.log file.


Related concepts

Database Cleanup utility

Related reference

Dbclean utility script

Database Cleanup utility objects

Examples: Deleting objects


+

Search Tips   |   Advanced Search