Keep Your Database Humming by Running DBSweepOrphaned data can slow database performance but, with DataNet Quality System's DBSweep utility, you can easily clean this data away and keep your database fast and efficient.
Orphaned data, by which is meant data that has been disassociated from all accessible data, is sometimes created during an archive or deletion. It is recommended that DBSweep, a utility included with WinSPC, be run once a month to clean out this orphaned data. DBSweep can be used with any of the database servers recommended for WinSPC and does not require exclusive database access, meaning that WinSPC can continue to be used while the utility is running. The procedure for using DBSweep is:
- Backup the database which you are going to run DBSweep against.
- On any WinSPC client machine, from the Utility folder in the WinSPC shared folder, copy DBSweep.exe to the WinSPC program folder. (The WinSPC shared folder, sometimes referred to as the remote folder, is the folder used to install WinSPC on additional client machines. The WinSPC program folder is the folder WinSPC was installed in. The default location for this folder is C:\Program Files\DQS\WinSPC.)
- Double-click the DBSweep.exe copy. This causes the Database Sweep dialog box to appear.

- Under Database, accept the Main default if the database against which you want to run DBSweep is your main WinSPC database or, if the database against which you want to run DBSweep is an archived database, select Archive and then browse to and select the archived database.
- Under Items to Sweep, uncheck the check box for any item you don't want deleted. Most of these items are self-explanatory. The first one, however, may not be. It refers to all orphans in the Parts branch of the Administrator window but does not include attribute, variable or tag values. Note that, depending on the database against which you are running DBSweep, one or more of these items may be greyed, as is the case for the Delete Old Plant Monitor Data item in the above picture.
- Under Options:
- Check the Display log file at end of sweep check box if you want a log of the deleted items displayed once DBSweep finishes. The log file will consist of everything that appears in the dialog box's text area as the sweep occurs and, if the Display SQL statements check box is checked, the SQL statements run as part of the sweep.
- Check the Display SQL Statements check box if you want the SQL statements run as part of the sweep displayed in the log file. You may want to do this to facilitate later diagnostic efforts. (Note: Checking this check box does not cause the SQL statements to be displayed in the text area as the sweep is occurring.)
- Click the Begin Sweep button.
- In the DATA LOSS POSSIBLE warning that appears, click Yes if you've already backed up your database. Otherwise, click No, backup your database and then restart this procedure.

Depending on the size of your database and the number of orphaned items, the sweep may take a considerable amount of time.
- If, after initiating the sweep, you want to abort it, click the Abort button and then click OK in the Confirm prompt that appears. (Note: The Begin Sweep button changes to the Abort button upon initiation of the sweep.)
- Once the sweep is complete, click the Exit button.
- If you want to view the log file, you can find it in the same installation folder into which you copied the DBSweep.exe file earlier. The name of the log file is: DBSweepLog.txt.
|