Deleting order objects
You can delete order objects from the database, after an order has been fulfilled or canceled.
Note: The delete statements for the
stale_guest and stale_non_guest object types are designed
to work with an ATP inventory system. If you are not using ATP inventory, the inventory subquery
must be adapted. If you allocate inventory during the OrderProcess command, then the subquery can be
removed. However, 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 Database Cleanup utility
configuration, add a configuration to the Database Cleanup utility instead of modifying the existing
one. This process ensures that your changes are not lost during a fix pack
installation.
Procedure
-
From the WC_installdir/bin
directory, run the following script:
-
- ./dbclean.sh -object order -type typename -instancexml WC_installdir/instances/instance_name/xml/instance_name.xml -db dbname -dbuser user -days daysold -loglevel loglevel
- dbclean -object order -type typename -instancexml WC_installdir/instances/instance_name/xml/instance_name.xml -db dbname -days daysold -loglevel loglevel
-
- ./dbclean.sh -object order -type typename -instancexml WC_installdir/instances/instance_name/xml/instance_name.xml -db dbname -days daysold -loglevel loglevel -dbtype oracle -dbuser user -dbpasswd password
- dbclean -object order -instancexml WC_installdir/instances/instance_name/xml/instance_name.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 a deposited order.
- 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.
-
- Examine the WC_installdir/instances/instance_name/logs/DBClean/DBClean.timestamp.log file.