SQL Performance (MOSC)

MOSC Banner

mysql flush table for export causing the metadata lock and replication lagging issue

Hi there,

Currently using mysql innodb cluster

every night , the cronjob for restic backup for DB will run as below script :

backupDb() {

    tag="db-pn-schema-$sysdate"

    echo "Backing up $PNDB schema" >> $RESTIC_LOG

    mysqldump -u$MYSQL_USER -p$MYSQL_PASSWORD --set-gtid-purged=OFF --no-data --routines --triggers --single-transaction --databases $PNDB > $DB_BASE_DIR/$PNDB-schema.sql

    echo "SFTP..." >> $RESTIC_LOG

    $RESTIC_PATH -r $RESTIC_DB_DATA_REPOSITORY backup --tag $tag --verbose $DB_BASE_DIR/$PNDB-schema.sql >> $RESTIC_LOG


    tag="db-shp-schema-$sysdate"

    echo "Backing up $SHPDB schema" >> $RESTIC_LOG

    mysqldump -u$MYSQL_USER -p$MYSQL_PASSWORD --set-gtid-purged=OFF --no-data --routines --triggers --single-transaction --databases $SHPDB > $DB_BASE_DIR/$SHPDB-schema.sql

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center