重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2955|回复: 2
打印 上一主题 下一主题

1z0-883 第一题

[复制链接]
跳转到指定楼层
楼主
发表于 2014-12-22 11:07:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
QUESTION NO: 1  
A simple master-to-slave replication is currently being used. The following information is extracted from the SHOW SLAVE STATUS output:
 
 
Last_SQL_Error: Error 'Duplicate entry '8' for key 'PRIMARY' ' on query. Default database: 'mydb'. Query: 'insert into mytable VALUES ('8' , 'George') '
 
Skip_Counter: 0
 
Retrieved _Gtid_Set: 38f32e23480a7-32a1-c323f78067fd37821: 1-8 Auto _Position: 1
 
You execute a “SHOW CREATE TABLE mytable” on the slave:
 
 
 
CREATE TABLE ‘mytable’ (
 
‘ID’ int(11) NOT NULL DEFAULT ‘0’,
 
‘name’ char(10) DEFAULT NULL, PRIMARY KEY (‘ID’)
)
 
 
 http://
The table mytable on the slave contains the following:
 
 
 


 
 
 
You have issued a STOP SLAVE command. One or more statements are required before you can issue a START SLAVE command to resolve the duplicate key error.
 
 
Which statement should be used?
 
 
一个简单的主机到从复制当前正在使用。以下信息由SHOW SLAVE STATUS输出中提取:
 
A.  SET GLOBAL SQL_SKIP_SLAVE_COUNTER=1
B.  SET GTID_NEXT=”CONSISTENCY”; BEGIN; COMMIT;
SET GTID_NEXT=” AUTOMATIC’;
C.  SET GLOBAL enforce_gtid_consistency=ON
D. SET GTID_EXECUTED=”38f32e23480a7-32a1-c323f78067fd37821 : 9”; E. SET GTID_NEXT=”38f32e23480a7-32a1-c323f78067fd37821 : 9”; BEGIN; COMMIT;
SET GTID_NEXT=”AUTOMATIC”;
 
 

[此贴子已经被作者于2014-12-22 11:40:54编辑过]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

沙发
 楼主| 发表于 2014-12-22 11:15:29 | 只看该作者
一个简单的 主机到从机复制环境被应用,show slave status 显示出来以下信息。Last_SQL_Error: Error 'Duplicate entry '8' for key 'PRIMARY' ' on query. Default database: 'mydb'. Query: 'insert into mytable VALUES ('8' , 'George') '
 
Skip_Counter: 0
 
Retrieved _Gtid_Set: 38f32e23480a7-32a1-c323f78067fd37821: 1-8 Auto _Position: 1
你执行“show create table mytable” on the slave ;
CREATE TABLE ‘mytable’ (
 
‘ID’ int(11) NOT NULL DEFAULT ‘0’,
 
‘name’ char(10) DEFAULT NULL, PRIMARY KEY (‘ID’)

)


你执行一个 stop 从机的命令,你需要执行哪个 一个或多个语句需要在你start slave 命令来解决复制键的错误。



[此贴子已经被作者于2014-12-22 11:41:12编辑过]
回复 支持 反对

使用道具 举报

板凳
 楼主| 发表于 2014-12-22 11:15:46 | 只看该作者
Answer: A 
Explanation:题目A 应该是sql_slave_skip_counter 这个参数。
sql_slave_skip_counter
System Variable Name sql_slave_skip_counter
Variable Scope Global
Dynamic Variable Yes
Permitted Values
Type numeric
The number of events from the master that a slave server should skip.
This option is incompatible with GTID-based replication, and must not be set to a nonzero value when --
gtid-mode=ON. In MySQL 5.6.10 and later, trying to do so is specifically disallowed. (Bug #15833516)
If you need to skip transactions when employing GTIDs, use gtid_executed from the master instead.
See Injecting empty transactions, for information about how to do this.
Important
If skipping the number of events specified by setting this variable would cause
the slave to begin in the middle of an event group, the slave continues to skip
until it finds the beginning of the next event group and begins from that point. For
more information, see Section 13.4.2.4, “SET GLOBAL sql_slave_skip_counter

Syntax”.
[此贴子已经被作者于2014-12-22 11:41:37编辑过]
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-24 20:28 , Processed in 0.098262 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表