Home : DATATBL Table: Deleting Duplicate Records and Reindexing
Q13436 - FEATURE: DATATBL Table: Deleting Duplicate Records and Reindexing

OPERATING INSTRUCTIONS

You can find this new feature in Server Setup for Oracle. Ther is a new tab on the right side called maintenance with a section titled Index Repair and a button in the section named DataTBL Fix, see figure 1. Click this button to see the window shown in figure 2.

  1. Select Facilities to Operate on
    1. Check the Delete Duplicates Checkboxes
    2. OR Click the Scan Facilities button in the upper left
  2. Decide if you want the facilities detached when this operation takes place
    1. To detach the facility the program simply places a dash "-" before the FileName of the facility. This way when an interface or other program tries to find that facility it won't be able to and that way won't be able to add any records while we are deleting them
    2. You can detach facilities at the start of the whole operation ("Detach at Start" column) or just before the Re-indexing process ("Detach Before Re-indexing" column) or not at all ("Do Not Detach" column). If you are going to detach it would make the most sense to select detach at start to make sure other applications are not adding duplicates while you are trying to delete them.
  3. Click on the Run button (select from the left at the top of the window in the toolbar).
    1. The process will prompt you for an entry for the time out in secodns. This refers to how long will the application wait for the database process to finish its current function. This is of most importance during the re-indexing phase where there could be a long time from starting the re-indexing to when it finishes. A zero (0) for this entry will mean the application will not time out. This is the default for the operation and is the recommended value.
    2. When the process runs it will place updates in the Results column for each facility as it progresses through each step.
      The process grabs up a 1000 records at a time to delete, deletes them, then checks to see if the user hit the Cancel button. If not it grabs the next 1000 and deletes them, etc. It will display a message in the Results cell when each 1000 are done.
    3. when the re-index starts the Cancel button has no effect. So, if your DataTBL table has a large amount of records the application will appear to hang until the re-indexing is finished.

Figure 1 - the new tab on the Server Setup for Oracle application.

Figure 2 - The Delete Duplicate Records window.

Figure 3 - After the Scan Facilities button has been clicked

Figure 4 - Enter the Timeout for the process

Figure 5 - After clicking the Run button and the process is complete.

 

TECHINAL DETAILS

The database stores measurement data from sensors in your lab or in the field. A measurement in this case refers to a value for a certain location, type of reading and time of day.  The location and type of measurement are covered in the Variable definition you create for the required circumstances and are represented in the database by the varible ID (VarID in the database). The time of day is covered in the database as DateStamp. And the value of the measurement is referenced by the name CurValue.

For purposes of the database design a duplicate record means the DateStamp and the VarID have the same values in more than one record.

An index is a list of columns (or just one column) that is stored in a special way that allows the application to find values in it very quickly. An index can allow duplicate records or not.

It has been found that in Oracle WIMS databases the DataTBL table can accumilate duplicate records. This is allowed because the index for the table is not marked as unique (it is set as non-unique). As a result the database doesn't prohibit applicataions from adding duplicate records to it.

What this new feature does is to remove all duplicate records from the that table then recreate the index (re-index it) with the unique value set to true.

Table 1 - Sample of duplicate records (the red row is a duplicate of the one above)

Record #

Date Stamp

Var ID

Current Value

100

5/1/2011

2314

6.4

101

5/1/2011

2314

6.2

102

5/2/2011

2314

6.4

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 5/24/2011 11:05 AM.
Last Modified on 5/26/2011 3:48 PM.
Last Modified by No Author Name Available!.
Article has been viewed 3645 times.
Rated 2 out of 10 based on 6 votes.
Print Article
Email Article