暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

mysql-ocp

Jerome Q 2024-01-09
229


Q1 . Examine this command, which executes successfully:

mysqlbackup --user=dba --password --port=3306 --with-timestamp --backup-dir=/export/backups backup-and-apply-log

Which statement is true?

A) The backup accesses the MySQL server files by using a pre-existing connection.

B) The database server is put into a read-only state for the duration of the backup.

C) An offline backup of InnoDB tables is taken.

D) The backup can be impacted when DDL operations run during the backup.

参考答案: D

A) 备份通过使用预先存在的连接来访问 MySQL 服务器文件。

B) 在备份期间,数据库服务器处于只读状态。

C) 对 InnoDB 表进行离线备份。

D) 在备份期间运行 DDL 操作时,备份可能会受到影响。


Q2.You reconfigure and start a slave that was not replicating for several days. The configuration file and CHANGE MASTER command are correct. Examine the

GTID information from both master

and slave:

Master:

Gtids_ executed: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-321,

bbbbbbbb-bbbb-bbbb-bbbbbbbbbbbb:1-50,

Cccccccc-cccc-cccc-cccc-cccccccccccc:1234- 1237

Gtids_purged: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1- 100,

bbbbbbbb-bbbb-bbbb-bbbbbbbbbbbb:1- 10,

cccccccc-cccc-cccc-cccc-cccccccccccc:1234- 1237

Slave:

Gtids_ executed: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1- 160,

cccccccc-cccc-cccc-cccc-cccccccccccc:1234- 1237

Gtids_ executed: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-70,

cccccccc-cccc-cccc-cccc-cccccccccccc:1234- 1237

Which statement is true?

A)Replication will fail because the master does not have the required transaction with bbbbbbbb- bbbb- bbbb- bbbb- bbbbbbbbbbbb GTIDs in its binary logs.

B)Replication will fail because the master has already purged transactions with cccccccc-cccc-cccc-cccc-cccccccccc GTIDs.

C) Replication will fail because of inconsistent numbers in cccccccc- cccc- cccc- cccc- cccccccccccc GTIDs.

D) Replication will fail because the slave has purged more aaaaaaaa- aaaa- aaaa- aaaa- aaaaaaaaaaaa transactions than the

master.

F)Replication will work.

参考答案: A



Q3 .Which two authentication plugins require the plain text client plugin for authentication to work?

A) Windows Native authentication

B) PAM authentication (可插入身份验证模块)

C) LDAP SASL authentication

D) LDAP authentication (轻量级目录访问协议)

E)SHA256 authentication

F) MySQL Native Password

参考答案: BD



Q4.You want to log only the changes made to the database objects and data on the MySQL system. Which log will do this by default?

A) error log

B) slow query log

C) general query log

D)binary log

E)audit log 审计日志:跟踪的、读、写、修改等操作类型,并存储格式设置为 JSON 或 XML 等。

参考答案: D



Q5 .You have an installation of MySQL 8 on Oracle Linux. Consider the outputs:

Mysql> SHOW GLOBAL VARIABLES WHERE Varisble_name='tmpdir' OR Variable_name = 'tmp_table_size';

+------------------ +----------- +

| Variable_name |Value |

+------------------------ +----- +

|tmp_ tabe_size | 16777216 |

|tmpdir | /tmp | 放排序、临时表等工作产生的文件

+------------------- +---------- +

Shell> cd/ var/ lib/mysql

Shell>ls - 1|grep temp

Drwxr-x---.2 mysql mysql 4096 Dec 11 14:05 #innodb_temp

Which statement is true about disk temporary tables for this installation?

A) Temporary tables are created in tmpdir only if configured to use MyISAM。

B) Temporary tables are created in tmpdir only after they reach tmp_ table_ size.

C) Temporary tables will use the InnoDB temporary tablespace located in datadir.

D) Only internal temporary tables from the optimizer will be created in tmpdir.

E) Temporary tables will use the InnoDB temporary tablespace located in / tmp.

参考答案: C



Q6 .Which two actions will secure a MySQL server from network-based attacks?

A) Use MySQL Router to proxy connections to the MySQL server.

B) Place the MySQL instance behind a firewall. -------

C)Use network file system (NFS) for storing data.

D)Change the listening port to 3307.

E) Allow connections from the application server only. ----------

参考答案: BE



Q7 . Examine the command, which execute successfully:

shell> mysqld --initialize-insecure

Which statement is true?

A) The installation creates a temporary test environment with data in the / tmp directory.

B) The installation is created without enforcing or generating SSL certificates.

C) The root password is created in the error log in plain text.

D) The root password is not created allowing easy access from the same host.

参考答案: D



Q8. Examine this command:

shell> mysqldump --no-create-info --all-databases --result-file=dump.sql

Which statement is true?

A)It will not write CREATE TABLESPACE statements.

B)It will not write CREATE LOGFILE GROUP statements.

C)It will not write “CREATE TABLE statements.”

D)It will not write CREATE DATABASE statements.

参考答案: C


Q9 . The mysqld instance has the connection control plugin enabled with these settings:

Connection_control_min_connection_delay= 1 0 0 0

Connection_control_max_connection_delay= 2 0 0 0

The minimum and maximum delays need to be increased to 3000 and 5000, respectively. A command is executed:

Mysql> SET GLOBAL connection_control_min_connection_delay=3000;

What is the result?

A)The minimum connection value is changed to 2000.

B)Only the minimum connection value is increased to 3000.

C) The minimum value increases to 3000 and the maximum value increases to 4000.

D)An error is returned. ----

参考答案: D



Q10.You must export data from a set of tables in the world_x database. Examine this set of tables:

Tables ( country, countryinfo, location)

Which two option will export data into one or more files?

A)mysql> CLONE LOCAL DATA DIRECTORY = '/ var/ lib/mysql/world_x/country';

mysql> CLONE LOCAL DATA DIRECTORY = '/var/lib/mysql/world_x/countryinfo';

mysql> CLONE LOCAL DATA DIRECTORY = '/var/lib/mysql/world_x/location';

B)mysql> SELECT * INTO OUTFILE '/output/contry.txt' FROM world_x.country;

mysql> SELECT * INTO OUTFILE ' / output/ contryinfo.txt' FROM world_ x.countryinfo;

mysql> SELECT * INTO OUTFILE '/output/ location.txt' FROM world_ x.location;

C) shell> mysqlexport world_ x country countryinfo location > mydump. sql

D) shell> mysql --batch world_x.country world_x.countryinfo world_x.location > mydump.sql

E) shell> mysqldump world_ x country countryinfo location > mydump. sql

参考答案: BE



Q11. Examine this command and output:

Mysql>SELECT * FROM performance_schema.table_IO_waits_summary_by_table WHERE COUNT STAAR >0\G

![](assets/2023-07-28-14-21-54.png)

Which two are true?

A) The longest I/O wait was for writes.

B)I/O distribution is approximately 50/50 read/write.

C)22902028 rows were deleted.

D) Average read times are approximately three times faster than writes.

E)The I/O average time is 532728.

参考答案: CD



Q12. A developer accidentally dropped the InnoDB table Customers from the Company database. There is a datadir copy from two days ago in the dbbackup directory.

Which set of steps would restore only the missing table?

A) Stop the MySQL Server process, and execute:

mysqlbackup --datadir=/var/lib/mysql --backup-dir=/dbbackup --include-tables='Company\.Customers' copy-back

Start the mysqld process.

B)Stop the MySQL Server process and restart it with the command: mysqld --basedir=/usr/local/mysql --datadir=/var/lib/mysql Run mysqldump on this table and restore the dump file.

C)Stop the MySQL Server process and restart it with the command: mysqld --basedir=/usr/local/mysql --datadir=/dbbackup Run mysqldump on this table and restore the dump file.

D) Stop the MySQL Server process, copy the Customers.ibd file from the dbbackup directory, and start the mysqld process.

参考答案: C




Q13. There has been an accidental deletion of data in one of your MySQL databases.

You determine that all entries in the binary log file after position 1797 must be replayed. Examine this partial command:

mysqlbinlog binlog.000008 --start-position= 1798

Which operation will complete the command?

A) -write-to-remote-server must be added to the command line to update the database tables.

B)It can be piped into the MySQL Server via the command line client.

C) You must use --stop-position= 1797 to avoid the DELETE statement that caused the initial problem.

D) No changes required. It automatically updates the MySQL Server with the data.

参考答案: B





You are having performance issues with MySQL instances. Those servers are monitored with MySQL Enterprise Monitor.

Using Query Analyzer, where do you begin to look for problem queries?

A) Sort the "Exec" column and check for SQL queries with low Query Response Time index (QRTi) values.

B) Look for queries with low total latency times in the Latency section in the times series graph.

C) Sort the "Exec" column and check for SQL queries with high Query Response Time index (QRTi) values.

D) Look for queries with big prolonged spikes in row activity/access graph in the times series graph.

参考答案: A























mysqlcheck 命令是用来检查、修复、分析和优化 MySQL 数据库中的表的工具。在执行 mysqlcheck 命令时,有一些选项可以影响是否会对表进行锁定操作。

具体来说,mysqlcheck 命令有以下几个常用的选项:

--check:用于检查表是否有错误。这个选项通常不会锁定表,因为只是进行检查而不做修改。

--repair:用于修复表中的错误。这个选项可能需要锁定表,因为修复错误可能需要对表进行修改。

--analyze:用于分析表,更新统计信息,以便优化查询性能。这个选项通常不会锁定表。

--optimize:用于优化表,重新组织表以释放碎片空间并提高性能。这个选项可能需要锁定表。

在执行 mysqlcheck 命令时,是否会锁定表取决于多个因素,包括表的存储引擎、数据库的运行状态以及命令行中使用的选项。一般情况下,如果需要对表进行写操作(比如修复、优化),则可能需要锁定表,而只读操作(比如检查、分析)通常不会引起表锁定。






「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论