Oracle Database MySQL 5.6 Database Administrator — Question 7
You are using CTIDS in replication. You need to skip a transaction with the CTID of aaa-bbb-ccc-ddd-eee : 3 on a slave.
Which command would you execute from a Mysql prompt?
Answer options
- A. STOP SLAVE; SETGTID_NEXT="aaa-bbb-ccc-ddd-eee: 3"; BEGIN; COMMIT; SET GTID_NEXT="AUTOMATIC"; START SLAVE
- B. STOP SLAVE; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;
- C. STOP SLAVE; BEGIN; SET GTID_IGNORE="aaa-bbb-ccc-ddd-eee: 3"; COMMIT; START SLAVE;
- D. STOP SLAVE; RESET SLAVE; BEGIN; SKIP NEXT GTID; COMMIT; START SLAVE;
Correct answer: B
Explanation
The correct answer is B because it uses the SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1 command, which effectively skips the next transaction in the replication stream. The other options either attempt to set GTID values or manipulate the slave in a way that does not specifically skip the transaction as required.