MySQL 5.7-OCP-888 认证试题题目&答案解析【1-5】

题目1:

A MySQL database uses all InnoDB tables and is configured as follows:

shell>cat/ etc/ my.cnf
[mysqld]
log-bin
server-id=1

You will be setting up a replication slave by using mysqldump. You will need a consistent backup
taken from your running production server. The process should have minimal impact to active
database connections.
Which two arguments will you pass to mysqldump to achieve this?

A. --skip-opt
B. --lock-all-tables
C. --create-apply-log
D. --single-transaction
E. --master-data


题目2:

Consider the key buffer in a MySQL server. Which two statements are true about this feature?
A. It caches index blocks for MyISAM tables only.
B. It caches index blocks for all storage engine tables.
C. It is a global buffer.
D. It is set on a per-connection basis.
E. It caches index blocks for InnoDB tables only.


题目3:

You have a MySQL replication setup and you intentionally stop the SQL thread on the slave.

mysql> SHOW SLAVE STATUS\ G
...
Slave_IO_Running: Yes
Slave_SQL_Running: No

What are two reasons that you may stop the SQL thread on the slave while keeping the I/ O thread running?
A. to allow the remaining events to be processed on the slave while not receiving new events from the master
B. to allow a backup to be created under reduced load
C. to allow for point-in-time recovery on the slave
D. to prevent schema changes from propagating to the slave before they are validated
E. to prevent any transaction experiencing a deadlock


题目4:

Which three statements correctly describe MySQL InnoDB Cluster?
A. The cluster can be operated in multimaster mode with conflict detection for DML statements.
B. All MySQL client programs and connectors can be used for executing queries.
C. It provides fully synchronous replication between the nodes.
D. There is support for automatic failover when one node fails.
E. The data is automatically shared between the nodes.
F. Each query will be executed in parallel across the nodes.


题目5:

How does the InnoDB storage engine handle deadlocks when they are detected?
A. Both the affected transactions will be rolled back.
B. The affected transactions wait for innodb_lock_wait_timeout seconds, and then roll back.
C. One of the affected transactions will be rolled back, the other is allowed to proceed.
D. The transaction isolation level determines which transaction is rolled back.
E. The innodb_locks_unsafe_for_binlog setting determines which transaction is rolled back.


翻译 & 解析:

题目1:

一个 MySQL 数据库所有的 InnoDB 表配置如下:
你将使用 mysqldump 配合设置主从复制。 需要从正在运行的生产服务器获取一致的备份。 
该过程对活动数据库连接的影响应该最小。
请问当你使用 mysqldump 是将调用那两个选项来实现这个目的?

关键点在备份时对服务器的影响最小。
A --skip-opt 是 --opt 选项的反选功能,–opt 在备份的 SQL 中会考虑兼容问题,可携带建表前的删表操作、自增约束、字符集和表引擎类型的设置等。但性能上的主要差异在于 --skip-opt 的 INSERT 是每行数据一条 SQL,而 --opt 的 INSERT 语句是一行 SQL 多值插入。弃选!
B 锁住所有的表,对服务器极大。弃选!
C 选项不存在。弃选!
D dump 过程只开启一个事务,并不影响 DML 和 DDL 的执行
E –master-data 选项可以自动帮我们锁表和识别 binlog 临界文件,提高从库部署效率。和 --single-transaction 配合使用,只会在 dump 开始时一小段时间加全局读锁,可降低服务器影响。

答案:DE


题目2:

关于 MySQL服务器中的 key buffer 功能,哪两个描述是正确的?
A 它仅缓存 MyISAM 表的索引块
B.它缓存所有存储引擎表的索引块
C.这是一个全局缓冲区
D.它是基于每个连接设置的
E.它仅缓存InnoDB表的索引块

key_buffer_size 只能用于 MySIAM 引擎,署于全局缓存。
答案:AC

更新中……

本文题目参考文章:

https://blog.csdn.net/wll_1017/article/details/54134817
https://blog.csdn.net/yabingshi_tech/article/details/51074901

你可能感兴趣的:(mysql)