CDR Tickets

Issue Number 3865
Summary Have CBIIT install job to keep logging tables under control
Created 2015-01-21 08:13:31
Issue Type Improvement
Submitted By Kline, Bob (NIH/NCI) [C]
Assigned To alan
Status Closed
Resolved 2015-03-30 11:10:29
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.145305
Description

It appears that Qian's scripts to keep the debug_log and command_log tables in the cdr DB from mushrooming did not survive the transition to CBIIT hosting. Please work with CBIIT to get a scheduled job installed which keeps only the most recent rows in those tables. Decide whether to archive the older rows or just drop them.

Comment entered 2015-01-22 11:56:56 by alan

I've entered a JIRA ticket for the DBA team to install a script.

See: https://tracker.nci.nih.gov/browse/DBATEAM-1548
[Corrected URL above]

Comment entered 2015-02-12 16:55:11 by alan

Update:

The script to prune all but the last 30 days was only installed on Prod but Mesgana Exum of the DBA team said they will install it on the other tiers tomorrow after truncating the logs. As we discussed, we will not try to preserve 30 days of the logs but just let them truncate them.

The original truncation on Prod was done on Jan 20, so testing will not be possible on Prod until after Feb. 19, when 30 days have elapsed after the truncation.

Comment entered 2015-02-24 11:32:33 by alan

I checked this on production and it appears to be working. The earliest entry in the debug log is now Jan 25, which means that entries older than 30 days were purged.

Comment entered 2015-02-24 11:43:04 by alan

Results on other tiers are not what I expected.

The last recorded entries in the debug_log on the other tiers are:
DEV: Feb. 18, 2015
QA: Feb 20, 2015
Stage: June 10, 2013

I'll alert the DBA team.

Comment entered 2015-03-05 15:11:51 by alan

It looks like the DBA team took care of this. Another check needs to be made on or after March 25, 2015. All tiers should then show a last recorded date of Feb 25.

Comment entered 2015-03-26 16:12:24 by alan

It looks like this is working but I miscalculated the date for prod and need to wait two more days to be 100% sure. I'll check it again on Tuesday.

Comment entered 2015-03-30 11:10:29 by alan

Testing this after the 30 days have elapsed shows that the debug_log is being pruned as desired. We don't have permissions to look at the command log, but that should have been truncated by the same script that pruned the debug_log.

Elapsed: 0:00:00.002785