IBM Verify

IBM Verify

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

AAC OAUTH2 expired and orphan cleanup with DB2 procedure and admin task 

yesterday

We have AAC that creates a large number of OAUTH2 tokens which expire and need to be removed from the OAUTH20_TOKEN_CACHE and OAUTH20_TOKEN_EXTRA_ATTRIBUTE tables. 

Additionally collecting statistics from the database so that they can be ingested into our logging platform with a JSON formatted file holding all the necessary values including TOTAL_APP_COMMITS and current OAUTH20 row counts. Using UTL_FILE.PUT_LINE as that allows for the file to be appended to.

The daily tasks we run at 2am to perform a runstats, and to cleanup any orphaned OAUTH20_TOKEN_EXTRA_ATTRIBUTE rows.

Lastly using the DB2 ADMIN_TASK means that host based crontab is not used and the scheduling it performed by the database itself so it accurately starts every 2 minutes.

Statistics
0 Favorited
1 Views
1 Files
0 Shares
1 Downloads
Attachment(s)
txt file
aac_db2_maintenace.sql.txt   8 KB   1 version
Uploaded - Thu July 24, 2025