MYSQL8.0OCP考试题库(如需完整版请留⾔)
⼤家好!今天要给⼤家带来的是由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
mysql下载哪个版本好2022MAX_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 sta
rt 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
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论