Link to USGS home
Surface Water Information--Data Scripts

adapslog

Name:
adapslog - A tool to review ADAPS transaction logs.

Information:

All changes to ADAPS data, whether additions, edits, or deletes, are tracked in various log files in the database. These log files are primarily used as the means of pushing data to NWISWeb, however they have other uses as well. For example, have you ever said to yourself, "Well I know I put that data correction into ADAPS, where is it?" or have you ever seen a crazy shift and wondered, "Who put that thing in there?" The ADAPS transaction logs can tell you what happened, when, and by whom in ADAPS.

This script was written to give you an easy way to query the ADAPS transaction logs and provide the results in a reasonable report. There are other ADAPS logs not currently included in the script but the logs included should be sufficient to give you a clear picture of what happened in ADAPS. (Note that there are many other logs for the other parts of NWIS that the script could be modified to query as well.)

The following ADAPS logs are available from within the script:

  1. Location Information
  2. Site Visits
  3. Peak Discharges
  4. Data Descriptors
  5. Thresholds
  6. Measured UVs
  7. Edited UVs
  8. Computed UVs
  9. Data Corrections
  10. Shifts
  11. Ratings
  12. Daily Values

The following options are available from within the script:
- output can be sent to the screen or a printer
- the script can run against the entire database or just one station
- changes to things at the DD level (items 4-11 in the list above) can be done on all DDs at a station or just a single DD
- the script can be run on a specific transaction date range or on the entire logs

Note: in general there are 30 days of transactions available in the log files, but this is governed by a cron job that automatically deletes old transaction log entries and the actual period of the logs can very widely from NWIS machine to NWIS machine.

Example report (from daily values log):

For a detailed legend of this table, look up "dv_log" at http://wwwnwis.er.usgs.gov/dbms/4.5/ad-dd.html

SITE_ID         DD_#    STAT_CD WY      ACTION  DATE/TIME_OF_ACTION     USER_ID
01010000        6       00003   2004    U       31-jul-2005 01:57:09    jnielsen
01010000        6       00011   2000    U       08-aug-2005 18:52:00    jnielsen
01010000        8       00011   2000    U       08-aug-2005 18:52:01    jnielsen
01010000        6       00011   2001    U       08-aug-2005 18:52:01    jnielsen
01010000        8       00011   2001    U       08-aug-2005 18:52:03    jnielsen
SITE_ID         DD_#    STAT_CD WY      ACTION  DATE/TIME_OF_ACTION     USER_ID

The content of each of the log tables is fairly easy to determine, but the details are available by looking at the ADAPS "data dictionary" for the current database at http://wwwnwis.er.usgs.gov/dbms/index.html. One key column in all the tables is the "ACTION" column which tracks the action on that item. The options are I - insert, U - update, and D - delete. Only the last action on a given item is tracked. For example, if a rating is added and then deleted the log file will only show the delete action.

Script Language:
ksh

Requirements:

Original Author(s): Brian Loving, Kansas WSC

Note the original author is noted on this page for the purposes of giving credit only. Please address questions/comments to OSW (GS-W OSW Scripts@usgs.gov).

Known Problems/Limitations/Need Improvements:

Installation:
This script is part of the OSW Scripts Installation package and should be installed as part of that package. Users needing the script outside of the package should send email to GS-W OSW Scripts@usgs.gov.

NWIS 5.00 OSW Scripts package installation instructions:
http://water.usgs.gov/usgs/osw/adaps/OSW_scripts_pkg.5.00.html

Latest Version Release Notes:

Version 5.00: Included as part of OSW Scripts package for NWIS 5.00+
-updated for NWIS 5.00+ releases (not compatible with NWIS 4.11 or prior)

Back to Scripts
[an error occurred while processing this directive]