Skip to content

Instantly share code, notes, and snippets.

@utdrmac
Created January 20, 2016 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utdrmac/4522854605420823df37 to your computer and use it in GitHub Desktop.
Save utdrmac/4522854605420823df37 to your computer and use it in GitHub Desktop.
Finding Tables for Checksum
#!/bin/bash
mysql -e "TRUNCATE TABLE percona.checksums"
pt-table-checksum --no-check-binlog-format --no-check-replication-filters --engines ndbcluster --tables $below
# Get all NDB tables
# mysql information_schema -BNe "SELECT CONCAT(table_schema,'.',table_name) FROM tables
# WHERE table_schema NOT IN ('mysql',' ndbinfo','percona','information_schema')
# AND engine = 'ndbcluster'" >/root/ndb_tables.txt
#
# Remove filtered tables
# for i in `grep replicate_ignore_table /etc/mysql/my.cnf | awk '{print $3}'`; do sed -i "/$i/d" ndb_tables.txt; done
#
# Concat to 1 line, comma-separated
# cat ndb_tables_to_checksum.txt | while read line; do echo -n "${line},"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment