Using the Clean Database Tool
- Last UpdatedSep 10, 2024
- 4 minute read
Cleanup/reset database
This database tool enables you to clean up data or reset data in the OSM Database.
-
The check boxes are not selectable but are used to indicate which options have been performed.
-
The button in the lower right corner will change its name according to the different options.

Guidelines
-
No backup of the data will be performed.
-
Database will be set in upgrade mode and therefore no users can be connected.
Steps
The options for cleanup and reset data in an OSM database.
Step 1. Turn on upgrade mode
This step will set the OSM database in upgrade mode. This step is mandatory.
-
Click Turn ON.

Step 2. Delete all data from main tables
This option will delete all data from certain main tables. ALL data from the selected table and its child tables will be deleted.
-
No recovery is possible (except for an import of a backup).
-
It is possible to delete data for only a given site by entering the site code.
-
If no site code is entered, then all data for selected table is deleted for all sites.
A list of tables that can be selected displays.
-
(Optional) Enter a site code.
-
Select a table and click Delete data.

-
A message box will appear to confirm the deletion. Click Yes to proceed.

When complete, a message appears at bottom of screen.

Step 3. Delete data from code tables
This operation will delete data from code tables according to a given criteria. Only codes that starts with the text COW999 will be deleted.
For example:
-
If two (2) work permit types should be removed, then add the text COW999 to the start of the existing codes.
-
If the codes are TYPE 1 and TYPE 2, then the codes should be changed to COW999TYPE 1 and COW999TYPE 2.
Guidelines
-
The space character can be added between the text COW999 and the existing code, but it is not necessary.
-
If a code cannot be deleted (since it is referred by other entities) then an Oracle error message will occur.
-
If only code tables for a site are to be deleted, then just add COW999 to the codes for the site.
A list of tables that can be selected displays.
-
Select a table and click Delete codes.

When finished, a message appears at bottom of screen.

Step 4. Reset counters on main tables
This operation will reset the counter on certain main tables.
-
A counter is defined to be the visual number of an entity, for example WP-XXXXXX.
-
The counter will be reset to 1.
A list of tables that can be selected displays.
-
Select a table and click Reset counters.
-
A message box will appear to confirm the deletion. Click Yes to proceed.
The counter for the selected table will be reset.

When complete, you will see a message at the bottom of the screen.

Step 5. Delete unused statuses
This operation will delete all statuses for a selected entity that are no longer active, meaning the Active checkbox is not selected.
-
The status must also no longer be in use. The term "in use" means that the status is no longer referred on the selected entity.
-
When a status is to be deleted the corresponding processes will also be deleted.
A list of tables that can be selected displays.
-
Select a table and click Delete statuses.

When finished, you will see a message at the bottom of the screen.

Step 6. Turn off upgrade mode
This step will turn off upgrade mode and set the OSM database back into operational mode.
-
Click Turn OFF.

You will see a message at the bottom of the screen.
