Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

205

积分

19

好友

29

主题
1#
发表于 2016-6-25 13:23:29 | 查看: 3473| 回复: 0
【dbdao.com MySQL OCP认证专题】- MySQL 5.6 - OCP 考题讲解

76.

A MySQL replication slave is set up as follows:
Use all InnoDB tables
Receives ROW-based binary logs
Has the read-only option

The replication slave has been found in an error state.
You check the MySQL error log file and find the following entries:
2013-08-27 13:55:44 9056 [ERROR] Slave SQL: Could not execute Write_rows event on table test.tl; Duplicate entry ‘3’ for key ’PRIMARY’ , Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event’s master log 56_master-bin.000003, end_log_pas 653, Error_code: 1062
2013-08-27 13:55:44 9056 [Warning] Slave: Duplicate entry ‘3’ for key ‘PRIMARY’ Error_code: 1062
2013-08-27 13:55:44 9056 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with “SLAVE START”, We stopped at log ‘56_masterbin.000003’ position 496

What are two possible causes for this error to occur?

A.
The slave was created with mysqldump –u root –p --skip-lock-tables --all-databases > /data/data.sql
B.
The slave user does have INSERT, UPDATE, or DELETE permission and cannot execute the write_rows function.
C.
For tables with UNIQUE keys, statement-based replication must be used to maintain integrity.
D.
The root user on the slave has executed FLUSH LOGS, causing the relay-log to doublewrite.
E.
The applications have the SUPER privilege, which allows them to update rows.

答案:A, E

分析:
使用排除法进行分析,重复记录问题和FLUSH LOGS没有关系,和replication是基于statement还是row也没有关系。
When the read_only system variable is enabled, the server permits no client updates except from users who have the SUPER privilege.
Even with read_only enabled, the server permits updates performed by slave threads, if the server is a replication slave.
A中的操作,可能之后在设置slave时,CHANGE MASTER TO对应的MASTER_LOG_POS位置设置错误,则可能造成再次同步插入已有的数据。

参考:
http://dev.mysql.com/doc/refman/ ... ml#sysvar_read_only
http://dev.mysql.com/doc/refman/ ... sqldump_lock-tables
http://dev.mysql.com/doc/refman/ ... ded.html#priv_super
http://dev.mysql.com/doc/refman/ ... wto-slavebaseconfig
您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-4-20 23:53 , Processed in 0.042769 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569