Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #!/bin/bash
  2. (/usr/local/bin/db2log | \
  3. mk-query-digest --fingerprints \
  4. --filter '$event->{user} !~ m/^(bi|memonic)$/') 2>&1 | \
  5. mail -s "MySQL slow logs" root
  6.  
  7. # Rotate slow logs. Will move them into the backup table slow_log_backup. If
  8. # that table exists it's overwritten with the primary slow log.
  9. # So with this strategy we can still access yesterday's slow log by querying
  10. # slow_log_backup.
  11. mysql mysql -e 'CALL rds_rotate_slow_log'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement