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

To delete user objects:

  1. From the WC_installdir/bin directory, type the following:

    • (DB2)

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

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

    • (Oracle)

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

      • Windows: dbclean -object user -type typename -db dbname -days daysold -loglevel loglevel -dbtype oracle -dbuser user -dbpasswd password -instancexml WC_installdir/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_installdir/instances/instance/logs/DBClean/DBClean. timestamp.log file.


 

Related Concepts


Database Cleanup utility