MYSQL 8.0 OCP

本文分享了关于MySQL 8.0 OCP认证的原题解析,涉及InnoDB存储引擎、性能优化、备份恢复、SSL配置、GTID复制等多个方面。同时,讨论了如何通过OPTIMIZE TABLE来减少存储空间和提高I/O效率,以及如何调整MySQL实例参数以提升性能。还涵盖了MySQL Enterprise Backup的使用和查询分析,帮助读者深入理解数据库管理和性能调优。
摘要由CSDN通过智能技术生成

各位好,今天分享mysql 8.0 ocp 后续试题。

本人会一直根据考试题目更新OCP原题,有需要的朋友,可以留言。

由于制作不易,有偿分享哈!

1、You are using the InnoDB engine and the innodb_file_per_table option is set. You delete a significant number of rows of a large table named FACTORY.INVENTORY.
Which command will reorganize the physical storage of table data and associated index data for the INVENTORY table, in order to reduce storage space and improve I/O efficiency?

A、CHECK TABLE FACTORY.INVENTORY

B、ANALYZE TABLE FACTORY.INVENTORY

C、OPTIMIZE TABLE FACTORY.INVENTORY

D、mysqlcheck -u root -p FACTORY.INVENTORY

E、mysqldump -u root -p FACTORY INVENTORY

本题选C。

2、The data in this instance transient;no backup or replication will be required.It is currently under performing.
The database size is static and including indexes is 19G
Total system memory is 32G
After profiling the system,you highlight these MySQL status and global variables:
Com_rollback                   |85408355 |
Com_commit                   |1234342  |
Innodb_buffer_pool_pages_free  |163840   |
[mysqld]
Buffer_pool_size=20G
Innodb_flush_log_at_trx_commit=2
Disable-log-bin
The OS metrics indicate that disk is a bottleneck.
Other variables retain their default values.
Which two changes will provide the most benefit to the instance? 

A、Max_connections=10000
      Innodb_log_file_size=1G

B、Sync_binlog=0

C、Innodb_doublewrite=0 

D、Buffer_pool_size=24G

E、Innodb_flush_log_at_trx_commit=1

本题选CD。

3、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、Look for queries with big prolonged spikes in row activity/access graph in the times series graph.

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

C、Look for queries with low total latency times in the Latency section in the time series graph.

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

本题选D。

4、Examine the full path name of the backup image from MySQL Enterprise Backup with the --compress option:
/backup/full/mybackup/myimage.img
mysqlbackup.cnf contains this data:
[mysqlbackup]
backup-dir=/backup/full/myrestore
backup-image=/backup/full/mybackup/myimage.img uncompress
You must perform a database restore to a new machine.
which command can provision the new database in datadir as /data/MEB?

A、mysqlbackup  --defaults-file=mysqlbackup.cnf  --datadir=/data/MEB  restore-and-apply-log

B、mysqlbackup  --defaults-file=mysqlbackup.cnf  --datadir=/data/MEB  image-to-dir-and-apply-log

C、mysqlbackup  --defaults-file=mysqlbackup.cnf  --datadir=/data/MEB  apply-log-and-copy-back

D、mysqlbackup  --defaults-file=mysqlbackup.cnf  --datadir=/data/MEB  copy-back-and-apply-log

E、mysqlbackup  --defaults-file=mysqlbackup.cnf  --datadir=/data/MEB  image-to-dir

本题选D。

5、You want to check the values of the sort_buffer_size session variables of all existing connections. Which performance_schema table can you query?

A、global_variables

B、session_variables

C、variables_by_thread

D、user_variables_by_thread

本题选C。

6、Your my.cnf file contains these settings: 
[mysqld]
log_output=FILE 
slow_query_log 
long_query_time=2.01 
log_queries_not_using_indexes
You want to log queries that looked at a minimum of 5000 records and either took longer than 5 seconds to run or did not use indexes.
Which contains all the settings that you need to add to or modify the slow log configuration?

A、log_throttle_queries_not_using_indexes=5

B、long_query_time=5 log_throttle_queries_not_using_indexes=5

C、long_query_time=5

D、long_query_time=5 log_throttle_quries_not_using_indexes=5 min_examined_row_limit=5000

E、long_query_time=5 min_examined_row_limit=5000

F、min_examined_row_limit=5000

G、log_throttle_quries_not_using_indexes=5 min_examined_row_limit=5000

本题选E。

7、All mysql server instances belonging to innodb cluster have SSL configured and enabled. You must configure innodb cluster to use SSL for group communication.
Which two statements are ture?

A、Configuring SSL group communication also configures SSL distributed recovery.

B、SSL group communication requires the use of an additional set of parameters group_replication_recovery_*.

C、If only some innoDB cluster members are enabled for SSL group communication, and
--ssl-mode=PREFERED, communication will fail back to unencrypted connection. 

D、An existing innoDB cluster must be dissolved and created form scratch to enable SSL for group communication.

E、SSL group communication can be enabled for an existing cluster,one instance at time,
by setting group_replication_ssl_mode. 

F、SSL group communication must be enable at cluster creation time 
by pecifying createCluster{{membersslmode:’REQUIRED’}}

本题选DF。

8、Which two are true about differences between logical and physical upgrades of MySQL databases?

A、Post-upgrade table storage requirements after physical upgrades are usually smaller than that after logical upgrades.

B、Physical upgrades leave data in place, whereas logical upgrades require data to be restored from mysqldump-type backups taken before the upgrades.

C、Physical upgrades are much faster because they do not require restarting the mysqld process.

D、Physical upgrades are performed for current instances on bare metal deployments, whereas logical upgrades are used for virtual machines or containerized instances.

E、Logical upgrades are much faster because they do not require starting the mysqld process.

F、Post-upgrade table storage requirements after logical upgrades are usually smaller than that after physical upgrades.

本题选BF。

9、An existing asynchronous replication setup is running MySQL 8. 
Which two steps are a part of implementing GTID replication?

A、On the slave, alter the MySQL master connection setting with: 
CHANGE MASTER TO MASTER_AUTO_POSITION = 1;

B、Execute this on the slave to enable GTID: 
RESET SLAVE; START SLAVE GTID_NEXT = AUTOMATIC;

C、Enable GTID by executing this on the master and the slave: 
SET GLOBAL GTID_ENABLED = on;

D、Restart MySQL (master and slave) with these options enabled:
--gtid_mode=ON
--log-bin
--log-slave-updates
--enforce-gtid-consistency

E、On the slave, alter the MySQL master connection setting with: 
ALTER channel CHANGE MASTER TO MASTER_AUTO_POSITION = 1;

F、Execute this on the slave to enable GTID: START SLAVE IO_THREAD WITH GTID;

本题选AD。

10、Examine this statement:
mysql> DROP ROLE r_role1, r_role2; 
Which two are true?

A、It fails if at least one of the roles does not exist.

B、You must revoke all privileges from r_role1 and r_role2 before dropping the roles.

C、Existing connections can continue to use the roles' privileges until they reconnect.

D、You must revoke r_role1 and r_role2 from all users and other roles before dropping the roles.

E、It fails if you do not have the ADMIN OPTION of the roles r_role1 and r_role2.

F、It fails if any of the roles is specified in the mandatory_roles variable. 

本题选AF。

今日共分享10题,后续会在下一次空余时间更新。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
MySQL 8.0 OCP(1Z0-908)是MySQL数据库管理的认证考试。在这个考试中,性能优化是一个重要的考点。sys.statement_analysis视图是MySQL 8.0中提供的一个系统性能视图,用于查看规范化后的SQL语句的汇总统计信息。这个视图类似于MySQL Enterprise Monitor的“查询分析”视图,可以帮助用户分析查询的性能问题。 sys.statement_analysis视图提供了多个有用的列来帮助你分析SQL语句的性能。其中一列是max_latency,表示SQL语句在执行过程中的最大等待时间。默认情况下,输出结果按照max_latency降序排序,这可以帮助你快速找到执行时间最长的SQL语句。 除了max_latency之外,sys.statement_analysis视图还提供了其他列,如call_count(SQL语句被调用的次数),rows_sent(返回的行数),rows_examined(扫描的行数)等等。这些统计信息可以帮助你分析SQL语句的执行效率,并找出潜在的优化机会。 通过分析sys.statement_analysis视图的输出结果,你可以了解到哪些SQL语句在数据库中执行的时间最长,从而进行性能优化。你可以使用这些信息来优化查询语句的索引,重写查询语句,或者进行其他的优化措施,以提升数据库的性能。 总结起来,MySQL 8.0 OCP考试涵盖了性能优化的知识,而sys.statement_analysis视图是MySQL 8.0中用于分析SQL语句性能的一个重要工具。通过分析这个视图的输出结果,你可以找到执行时间最长的SQL语句,并进行相应的优化措施,以提升数据库的性能。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一洋。。

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值