Administer > Database Cleanup utility > Clean the database
Delete order objects
Overview
You might want to delete order objects from the database after an order has been fulfilled or canceled.
The delete statements for the objects types...
- stale_guest
- stale_non_guest
...are designed to work with an ATP inventory system. If you are not using ATP inventory, the inventory subquery must be adapted.
If you only allocate inventory during the OrderProcess command, the subquery can be removed.
If you reserve inventory on P, I, W, or N orders, update the query so that the orders with allocated inventory are not deleted.
To customize a default DBClean configuration, add a configuration to the Database Cleanup utility instead of modifying the existing one. This ensures that the changes are not lost during a fix pack installation.
Procedure
- Go to...
WC_INSTALL/bin...run...
- dbclean -object order -type typename -instancexml WC_INSTALL/instances/instance/xml/ instance.xml -db dbname -days daysold -loglevel loglevel
- dbclean -object order -instancexml WC_INSTALL/instances/instance/xml/ instance.xml -type typename -db dbname -days daysold -loglevel loglevel -dbtype oracle -dbuser user -dbpasswd password
Use host:port:sid for the database name. For example, myhost:1521:mydb.
For the -type parameter, you can specify one of the following types:
completed Indicates a completed order. canceled Indicates a canceled order. deposited Indicates an order that has been deposited. markfordelete Indicates an order that is canceled or an order that is in the trashcan. shipped Indicates a shipped order. stale_guest Indicates stale orders from guest customers. stale_non_guest Indicates stale orders by customers who are not guests. quotation Indicates a quote that is in the trashcan. For details on the syntax and parameters for the dbclean script, see Database Cleanup utility script.
- Examine the WC_INSTALL/instances/instance/logs/DBClean/DBClean. timestamp.log file.
Related concepts
Related reference
Dbclean utility script
Database Cleanup utility objects
Examples: Deleting objects