MYSQL8.0 OCP考试题库(如需完整版请留言)

  大家好!今天要给大家带来的是由ORACLE公司研发的mysql8.0的认证考试试题。

  本次试题是全网最全面的试题,总共包含210道。试题的正确率在80%以上。

  对2021年12月22日至2022年1月10日前去报考mysql8.0的考生有很大的帮助。特别是考试时所遇到的题型几乎会是原题。本人于本月20日刚考过,特来为大家分享!

   1.Examine this statement, which executes successfully:
CREATE TABLE world. city (
ID int NOT NULL AUTO_ INCREMENT,
Name char (35) NOT NULL DE FAULT',
CountryCode char (3) NOT NULL DE FAULT ",
District char (20) NOT NULL DEFAULT“,
Population int NOT NULL DEFAULT‘0'
PRIMARY KEY (ID) .
KEY CountryCode (CountryCode )
) ENGINE InnoDB;
You want to improve the performance of this query:
SELECT Name
FROM world. city
WHERE Population BETWEEN 1000000 AND 2000000;
Which change enables the query to succeed while accessing fewer rows?

A:ALTER TABLE world. city ADD INDEX (Name) ;

B:ALTER TABLE world. city ADD SPATIAL INDEX (Name);

C:ALTER TABLE world. city ADD FULLTEXT INDEX (Name);

D:ALTER TABLE world. city ADD SPATIAL INDEX (Population);

E:ALTER TABLE world .city ADD INDEX (Population);

F:ALTER TABLE world. city ADD FULLTEXT INDEX (Population);

ANSWER:E

2.You encountered an insuficient privilege error in the middle of a long transaction.
The database administrator is informed and immediately grants the required privilege:
GRANT UPDATE ON world. .city TO 'user1";
How can you proceed with your transaction with the least interruption?

A:Roll back the transaction and start the transaction again in the same session.

B:Change the default database and re-execute the failed statement in your transaction.

C:Re-execute the failed statement in your transaction.

D:Close the connection, reconnect, and start the transaction again.

ANSWER:C

3.Examine these commands, which execute successfully on the ic1 host:
mysqlsh> dba. createCluster(cluster1", fmemberWeight:35})
mysqlsh> var mycluster = dba. getCluster ()
mysqlsh> mycluster . addInstance( ic@ic2", {memberWeight:25})
mysq|sh> mycluster .addInstance( ic@ic3', {memberWeight:50})
Now examine this configuration setting, which is the same on all nodes:
group_ replication_ consistency=BEFORE_ ON_ PRIMARY_ FAILOVER
Which statement is true if primary node ic1 fails?

A:Node ic2 becomes the new primary and existing transactions are considered stale and rolled back.

B:Node ic3 becomes the new primary and existing transactions are considered stale and rolled back.

C:Node ic3 becomes the new primary and is ignored until any backlog of transactions is completed.

D:Only two nodes remain so the election process is uncertain and must be done manually.

E:Node ic2 becomes the new primary and is ignored until any backlog of transactions is completed.

ANSWER:C

4.Identify two ways to significantly improve data security.

A:Configure mysqld to run as the system admin account, such as root.

B:Use a private network behind a firewall.

C:Configure mysqld to use only networked disks.

D:Configure MySQL to have only one administrative account.

E:Configure mysqld to use only local disks or attached disks and to have its own account in the host

ANSWER:B/D

5.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.

ANSWER:B/E

6.Examine this statement, which executes successfully:
CREATE TABLE employess(
emp_ no int unsigned NOT NULL,
Birth_ date date NOT NULL,
First_ name varchar(14) NOT NULL,
Last_ name varhar(16) NOT NULL,
Hire_ date date NOT ULL,
PRIMARY KEY(emp_ _no)
)ENGIN=InnoDB;
Now examine this query:
SEECR emp_ no,first_ name ,last_ name, bitrh_ date
FRON employees
WHERE MONTH(birth)date)=4;
You must add an index that can reduce the number of rows processed by the query. Which two statements can do this?

A:ALTER TABLE employees ADD INDEX ((MONTH(birth_ datl));

B:ALTER TABLE employees ADD INDEX (birth_ date);

C:ALTER TABLE employees ADD COLUMN birth_ month tinyint unsigned GENERATED ALWAYS AS (MONTH(birth_ _date)) VIRTUAL NOT NULL, ADD INDEX (birth_ month);

D:ALTER TABLE employees ADD INDEX (birth_ month);

E:ALTER TABLE employees ADD INDEX ((CAST(bith_ date->>'$ .month' AS unsigne)d));

F:ALTER TABLE employees ADD COLUMN birth_ month tinyint unsigned GENERATED ALWAYS AS (birth_ date->> $month) VIRTUAL NOT NULL, ADD INDEX (birth_ month);

ANSWER:A/C

7.The languages table uses MyISAM and the countries table uses the InnoDB storage engine.
Both tables are empty.
Examine these statements:
BEGIN;
INSERT INTO languages(lang) VALUES ('Italian");
INSERT INTO countries(country) VALUES(Italy");
ROLL .BACK;
What is the content of both tables after executing these statements?

A:countries has one row, languages has none.

B:Both tables have one row.

C:Both tables are empty.

D: languages has one row, coutries has none.

ANSWER:D

8.You recently upgraded your MYSQL installation to MYSQL8.0 Examine this client error.
Error 2059 (HY000);authentication plugin 'caching_ _sha2_ password' cannot be
Loaded: /usr/local/mysqbplugin/caching_ _sha2_ password .so: cannot open shared object file: No such or directory
Which option will allow this client to connect to MYSQL Server?

A:[mysqld] default_ authentication_ plugin=sha256_ password

B:[mysqld] default_ authentication_ plugin=caching. _sha2_ password

C:ALTER USER user IDENTIFIED WITH mysql_ native_ password BY 'password";

D:ALTER USER user IDENTIFIED WITH caching_ sha2_ password

E:ALTER USER user IDENTIFIED WITH sha256_ password

F:[mysqld] default_ authentication_ plugin=mysql_ native_ password

ANSWER:C

9.You want to dump all databases with names that start with ''db''.Which command will achieve this?

A:mysqldump --include-tables=db. % --result-fle=all _db_ _backup.sql

B:mysqldump -include-databases=db --result-file=all _db_ _backup.sql

C:mysqldump --include-databases=db% --result-file=all_ _db_ backup.sql

D:mysqldump> all_ _db_ backup.sql

ANSWER:D

10.Which three settings control global buffers shared by all threads on a MySQL server?

A:tmp_ table_ size

B: innodb_ buffer_ pool_ size

C:table_ _open_ cache

D:sort_ buffer__ size

E:key . _buffer_ size

ANSWER:B/C/E

11.

Examine this command and output:

Mysql>SELECT *
        FROM performance_schema.table_10_waits_summary_by_table
       WHERE COUNT_STAAR >0\G
********************************2.row **************************************
        OBJECT_TYPE:TABLE
OBJECT_SCHEMA:test
OBJECT_NAME:demo_test
CONUNT_STAR:61567093
SUM_TIMER_WAIT:59009007572922
MIN_TIMER_WAIT:395922
AVG_TIMER_WAIT:958095
MAX_TIMER_WAIT:558852005358
COUNT_READ:38665056
SUM_TIMER_READ:20598719962188
MIN_TIMER_READ:395922
AVG_TIMER_READ:532728
MAX_TIMER_READ:558852005358
COUNT_WRITE:22902028
SUM_TIMER_WRITE:38410287610743
MIN_TIMER_WRITE:1130688
AVG_TIMER_WRITE:1677006
MAX_TIMER_WRITE:17205682920
    COUNT_FETCH:38665056
SUM_TIMER_FETCH:20598719962188
MIN_TIMER_FETCH:395922
AVG_TIMER_FETCH:532728
MAX_TIMER_FETCH:558852005358
 .....
 COUNT_DELETE:22902028
SUM_TIMER_DELETE:38410287610743
MIN_TIMER_DELETE:1130688
AVG_TIMER_DELETE:1677006
MAX_TIMER_DELETE:17205682920
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.

ANSWER:C/D

12.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.

ANSWER:C

13.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.

ANSWER:B

14.Table t is an InnoDB table.
Examine these statements and output:
Selet count(1) from t;
+------------+
| count(1)    |
+------------+
|      72    |
+------------+
Mysql show indexes from t\G
***************************1.row***************************
            Table: t
     Non_unique:0
Key_name:PRIMARY
Seq_in_index: 1
Column_name: a
Collation:A
Cardinality: 72
Sub_part:NULL
Packed:NULL
Null:
Index_type:STREE
Comment:
Index_comment:
Visible:YES
Expression:NULL
***************************2.row***************************
            Table: t
     Non_unique:1
Key_name:b_idx
Seq_in_index: 1
Column_name: b
Collation:A
Cardinality: 1
Sub_part:NULL
Packed:NULL
Null:YES
Index_type:BTREE
Comment:
Index_comment:
Visible:NO
Expression:NULL
2 row in set (0.00 sec)
Which two are true?

A:ANALYZE TABLE t would update index statistics uniquely for the PRIMARY index.

B:Table t has two viable indexes to be used for queries.

C:SELECT b from t would perform a table scan.

D:Index b_idx has a low number of unique values. 

E:SELECT a FROM t would perform a table scan. 

ANSWER:C/D

后续剩余的试题我会在明日继续更新!

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 23
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 23
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

一洋。。

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

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

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

打赏作者

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

抵扣说明:

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

余额充值