0% found this document useful (0 votes)
81 views34 pages

Answer MySQL Certificate 1

The document contains a series of questions and answers related to MySQL features, configurations, and best practices. It covers topics such as logical backups, multi-source replication, data export methods, and security measures. Each question is followed by multiple-choice answers, with the correct options indicated for each question.

Uploaded by

Chung Cong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views34 pages

Answer MySQL Certificate 1

The document contains a series of questions and answers related to MySQL features, configurations, and best practices. It covers topics such as logical backups, multi-source replication, data export methods, and security measures. Each question is followed by multiple-choice answers, with the correct options indicated for each question.

Uploaded by

Chung Cong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

1. Which three are characteristics of logical backups?

A. In addition to databases, backups can include any related files, such as log or
configuration files.
B. They can be run only against a running MySQL server.
C. They can be performed while the MySQL server is not running.
D. They consist of exact copies of database directories and files.
E. Backup and restore granularity is available at the server level, database level,
or table level for any storage engine.
F. They are machine independent and highly portable.
G. They can be created by mysqlbackup for InnoDB tables or by file-system
commands, such as cp, scp, tar, or rsync, for MyISAM tables.

Answer: B,E,F

2. Which two statements are true about MySQL server multi-source replication?

A. It is not compatible with auto-positioning.


B. It relies on relay_log_recovery for resilient operations.
C. It needs to be re-instanced after a crash to maintain consistency.
D. It does not attempt to detect or resolve replication conflicts.
E. It uses only time-based replication conflict resolution.
F. It must use GTID replication.

Answer: E,F

3. MySQL programs look for option files in standard locations.


Which method will show the option files and the order in which they are read?

A. shell> mysqld --help --verbose


B. shell> mysqladmin --debug
C. shell> mysql --print-defaults
D. mysql> SHOW GLOBAL VARIABLES;

Answer: A

1
4. Which statement is true about the my.ini file on a Windows platform while
MySQL server is running?

A. MySQL server does not use the my.ini option file for server configuration
options.
B. The option file is read by the MySQL server service only at start up.
C. Using SET PERSIST will update the my.ini file.
D. Editing the file will immediately change the running server configuration.

5. 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 DATABASE statements.
C. It will not write CREATE TABLE statements.
D. It will not write CREATE LOGFILE GROUP statements.

6. 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 options will export data into one or more files?

A. shell> mysql --batch world_x.country world_x.countryinfo world x.location


> mydump.sql

B. 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';

C. shell> mysqlexport world_x country countryinfo location > mydump.sql

D. mysql> SELECT * INTO OUTFILE '/output/country.txt' FROM


world_x.country;

2
mysql> SELECT * INTO OUTFILE '/output/countryinfo.txt' FROM
world_x.countryinfo; mysql> SELECT * INTO OUTFILE '/output/location.txt'
FROM world_x.location;

E. shell> mysqldump world_x country countryinfo location > mydump.sql

7. How can mysql_multi be configured to allow MySQL instances to use the same
port number?

A. The instances listen on different IP addresses.


B. The instances use different user accounts unique to each instance.
C. The instances have appropriate net masks set.
D. The instances use different socket names.

8. You use the InnoDB engine and the innodb_file_per_table option is set.
You delete a significant number of rows from a large table named
FACTORY.INVENTORY.
Now you must reorganize the physical storage for table data and associated
index data for the INVENTORY table to reduce storage space and improve I/O
efficiency.
Which command will do this?

A. CHECK TABLE FACTORY. INVENTORY


B. mysqlcheck -u root -p FACTORY.INVENTORY
C. mysqldump -u root -p FACTORY INVENTORY
D. ANALYZE TABLE FACTORY.INVENTORY
E. OPTIMIZE TABLE FACTORY.INVENTORY

9. A clean shutdown was performed with innodb_fast_shutdown=0.


While you were manipulating files, all files were accidentally deleted from the
top-level data directory.
Which two files must be restored from backup to allow the DB to restart cleanly?

A. mysql.ibd
B. ib_buffer_pool
C. ibtmp1
D. undo_001
E. ibdata1
3
F. ib logfile0

4
10. Where is the default data directory located after installing MySQL using RPM
on Oracle Linux 7?

A. /usr
B. /var/lib/mysql
C. /usr/mysql
D. /usr/bin
E. /etc/my.cnf

11. Which two queries are examples of successful SQL injection attacks?

A. SELECT id, name FROM user WHERE user.id=(SELECT members.id FROM


members);
B. SELECT email,passwd FROM members
WHERE email = 'INSERT INTO members('email','passwd') VALUES
('[email protected]','secret');--';
C. SELECT user, passwd FROM members
WHERE user = '?'; INSERT INTO members('user', 'passwd') VALUES
('[email protected]','secret');--';
D. SELECT id, name FROM user WHERE id=23 OR id=32 OR 1=1;
E. SELECT id, name FROM user WHERE id=23 OR id=32 AND 1=1;
F. SELECT user, phone FROM customers WHERE name = '\; DROP TABLE
users; --';

12. Which are two of the components of MySQL InnoDB Cluster that help to
achieve database high availability?

A. MySQL Semi-Sync replication plugin is used to provide cluster consistency


B. MySQL Shell to create and administer InnoDB Clusters using the built-in
AdminAPI
C. MySQL Enterprise Backup to keep data consistent and always ready to be
used
D. MySQL Router to ensure that client requests are load balanced and routed
to the correct servers
E. MySQL X Plugin to enable MySQL to use the X Protocol to speed up and
monitor data replication

5
13. Table t is an InnoDB table.
Examine these statements and output:

select 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: BTREE
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
6
Visible: NO
Expression: NULL

Which two are true?

A. Index b_idx has a low number of unique values.


B. Table t has two viable indexes to be used for queries.
C. ANALYZE TABLE would update index statistics uniquely for the PRIMARY
index.
D. SELECT b FROM t would perform a table scan.
E. SELECT a FROM t would perform a table scan.

14. Examine this statement and output:

mysql> ANALYZE TABLE world.city


UPDATE HISTOGRAM ON Population
WITH 64 BUCKETS;

*************************** 1. row ***************************


Table: world.city
Op: histogram
Msg_type: status
Msg_text: Histogram statistics created for column 'Population'.
1 row in set (0.03 sec)

Which two are true about the histogram?

A. It provides information about the frequency of the Population values.


B. It is used by the optimizer to improve the join order.
C. It is used to filter the rows in the world.city table.
D. It contains statistics for the number of distinct values in the Population
column.
E. It is created using 64 random dives into the world.city table.

7
15. You must review configuration options for a new, large, busy reporting data
warehousing MYSQL instance.
Examine this parameter:

[mysql]
innodb_data_file_path=

Which are two configurations either of which would satisfy long-term storage
demands?

A. ibdatal1:12M
B. ibdatal:12M;ibdata2:12M: autoextend
C. ibdata1:12M;/tmp/ibdata2:12M:autoextend
D. ibdata1:12M:autoextend; ibdata2:12M:autoextend
E. ibdatal:12M;ibdata2:12M; ibdata3:12M
F. ibdatal:12M:autoextend

16. Your MySQL server was upgraded from an earlier major version.
The sales database contains three tables, one of which is the transactions table,
which has 4 million rows.
You are running low on disk space on the datadir partition and begin to
investigate.

Examine these commands and output:


mysql> show global variables like 'innodb_file%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| innodb_file_per_table | ON |
+------------------------+-------+

# ls -l | grep ib
-rw------- 1 mysql mysql 3287 Dec 12 07:54 ib_buffer_pool
-rw------- 1 mysql mysql 12582719292 Dec 12 09:50 ibdata1
-rw------- 1 mysql mysql 50331648 Dec 12 09:50 ib_logfile0
-rw------- 1 mysql mysql 50331648 Dec 11 14:05 ib_logfile1
-rw------- 1 mysql mysql 12582912 Dec 12 08:05 ibtmp1
-rw------- 1 mysql mysql 25165824 Dec 12 09:50 mysql.ibd
8
# ls -l sales/
total 544
-rw-r----- 1 mysql mysql 47550136 Dec 12 09:50 sales.ibd
-rw-r----- 1 mysql mysql 114688 Dec 11 14:33 leads.ibd

Which two statements are true?

A. Executing SET GLOBAL innodb_row_format=COMPRESSED and then ALTER


TABLE transactions will free up disk space.
B. Executing ALTER TABLE transactions will enable you to free up disk space.
C. Truncating the transactions table will free up the most disk space.
D. Truncating the sales and leads table will free up disk space.
E. The transactions table was created with innodb_file_per_table=OFF.

17. Data in an instance is transient with no backup or replication required.

 The database size is static


 Including indexes the size is 19G
 Total system memory is 32G
 It is currently under performing.

Examine these MySQL status and global variables taken after profiling:

Com_rollback | 85408355
Com_commit | 1242342
Innodb_buffer_pool_pages_free | 163840

[mysqld]
buffer_pool_size=20G
innodb_flush_log_at_trx_commit=2
disable-log-bin

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?

9
A. buffer_pool_size=24G
B. innodb_doublewrite=0
C. innodb_flush_log_at_trx_commit=1
D. max_connections=10000
E. innodb_log_file_size=1G
F. sync_binlog=0

18. Examine these statements which execute successfully:

CREATE USER 'joe'@'%' IDENTIFIED BY '*secret*';


GRANT ALL PRIVILEGES ON *.* TO 'joe'@'%';

All established connections for joe are killed.


Which are two commands either one of which will stop joe establishing access to
the MySQL instance?

A. ALTER USER 'joe'@'%' ACCOUNT LOCKB.


B. ALTER USER 'joe'@'%' IDENTIFIED BY 'invalid' PASSWORD EXPIREC.
C. ALTER USER 'joe'@'%' SET password='invalid'
D. REVOKE USAGE ON . FROM 'joe'@'%'
E. REVOKE ALL PRIVILEGES ON . FROM 'joe'@'%'
F. ALTER USER 'joe'@'%' PASSWORD HISTORY 0

20. Relevant MySQL Enterprise plugins are enabled on your installation.


You must prevent users from using a specific list of passwords.
How do you implement this on your system?
A. Register invalid password patterns by using the MySQL Firewall blacklist.
B. Specify the nonusable passwords via MySQL Enterprise Audit JSON filters.
C. Manually store the values in a file and use SHA-256 to check against the
mysql.user table.
D. Store values in the mysql.user_invalid_passwords table.
E. Set validate_password.dictionary_file=pass_dict.txt and store the
nonusable passwords in the pass_dict.txt file in your data directory.
F. You cannot save a list of nonusable passwords in MySQL.

21. Examine these settings for the mysqld instance:

connection_control_min_connection_delay=1000
10
connection_control_max_connection_delay=2000

The minimum and maximum delays must be increased to 3000 and 5000,
respectively.
Now examine this command which is invoked:

mysql> SET GLOBAL connection_control_min_connection_delay=3000;

What is the result?

A. An error is returned.
B. The minimum connection value is changed to 2000.
C. The minimum value increases to 3000 and the maximum value increases to
4000.
D. Only the minimum connection value is increased to 3000.

22. Your MySQL environment has asynchronous position based-replication with


one master and one slave.
The slave instance had a disk I/O problem, so it was stopped.
You determined that the slave relay log files were corrupted and unusable, but no
other files are damaged.
You restart MySQL Server.
How can replication be restored?

A. The relay logs from the master should be used to replace the corrupted relay
logs.
B. The slave relay logs should be deleted; execute CHANGE MASTER to adjust the
replication relay log file name, then issue START SLAVE;
C. The slave relay logs should be deleted; then execute START SLAVE;
D. The slave needs to be restored from backup.

11
23. Examine the GTID information from both master and slave:
Master:
gtids_executed:
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-321,
bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-50,
cccccccc-cccc-cccc-cccc-cccccccccccc:1234-1237

gtids_purged:
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-100,
bbbbbbbb-bbbb-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_purged:
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 GTIDs in its binary logs.
B. Replication will fail because the master has already purged transactions with
cccccccc GTIDs.
C. Replication will fail because of inconsistent numbers in cccccccc GTIDs.
D. Replication will fail because the slave has purged more aaaaaaaa transactions
than the master.
E. Replication will work.

24. Identify two ways to significantly improve data security.


A. Configure mysqld to use only local disks or attached disks and to have its own
account in the host system.
B. Configure mysqld to run as the system admin account, such as root.
C. Configure mysqld to use only networked disks.
D. Use a private network behind a firewall.
E. Configure MySQL to have only one administrative account.
12
25. Examine this command, which executes successfully:
cluster.addInstance('<user>@<host>:<port>', {recoveryMethod: 'clone'})
Which two statements are true?
A. A target instance must exist which will be provisioned with data from an
instance already in and joined to the cluster.
B. InnoDB tablespaces outside the datadir can be cloned.
C. A new instance is installed, initialized, and provisioned with data from an
instance already in and joined to the cluster.
D. It is always slower than {recoveryMethod: 'incremental'}.
E. InnoDB redo logs must not rotate for the duration of the execution; otherwise,
the recovery will fail.

26. Examine these InnoDB Cluster parameter settings:


cluster.setInstanceOption('host1:3377', 'memberWeight', 40)
cluster.setInstanceOption('host2:3377', 'memberWeight', 30)
cluster.setInstanceOption('host3:3377', 'memberWeight', 40)
cluster.setInstanceOption('host3:3377', 'exitStateAction', "ABORT_SERVER")
cluster.setOption("expelTimeout", 1)

Now examine the partial status:


"topology": {
"host1:3377": {
"address": "host1:3377",
"mode": "R/O",
"status": "ONLINE",
"version": "8.0.18"
},
"host2:3377": {
"address": "host2:3377",
"mode": "R/O"
},
"host3:3377": {
"address": "host3:3377",
"mode": "R/W",
"status": "ONLINE",
"version": "8.0.18"
}
}
13
Some time after you retrieve this status, a permanent network failure isolates
host3.
Which two statements are true?

A. The instance deployed on host3 is expelled from the cluster and must be
rejoined using cluster.addInstance('host3:3377').
B. The instance deployed on host2 is elected as the new primary instance.
C. A subsequent failure of the instance deployed on host1 provokes an outage.
D. You can choose a new primary instance by using the command
cluster.setPrimaryInstance(<host>:<port>).
E. The instance deployed on host3 will automatically rejoin the cluster when
connectivity is re-established.

27. 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 true?

A. If only some InnoDB Cluster members are enabled for SSL group
communication, and --ssl-mode=PREFERRED, communication will fall back to
unencrypted connection.
B. An InnoDB Cluster must be dissolved and created from scratch to enable SSL
for group communication.
C. SSL group communication can be enabled for a cluster, one instance at a time,
by setting group_replication_ssl_mode.
D. SSL group communication must be enabled at cluster creation time by
specifying createCluster({memberSslMode:'REQUIRED'}).
E. SSL group communication requires the use of an additional set of parameters
group_replication_recovery_*.

28. Which two methods can be used to determine whether a query uses the hash
join algorithm?
A. EXPLAIN FORMAT=TREE
B. EXPLAIN ANALYZE
C. EXPLAIN FORMAT=JSON
D. EXPLAIN FORMAT=TRADITIONAL
E. EXPLAIN without any formatting argument
14
29. Examine this query and output:
mysql> EXPLAIN ANALYZE
SELECT city.CountryCode, country.Name AS Country_Name,
city.Name, city.District, city.Population
FROM world.city
INNER JOIN world.country ON country.Code = city.CountryCode
WHERE country.Continent = 'Asia'
AND city.Population > 1000000
ORDER BY city.Population DESC\G

Output:
-> Sort: <temporary>.Population DESC (actual time=8.306..8.431 rows=125
loops=1)
-> Stream results (actual time=0.145..8.033 rows=125 loops=1)
-> Nested loop inner join (cost=241.12 rows=205) (actual time=0.141..7.787
rows=125 loops=1)
-> Filter: (world.country.Continent = 'Asia') (cost=25.40 rows=34) (actual
time=0.064..0.820 rows=51 loops=1)
-> Table scan on country (cost=25.40 rows=239) (actual
time=0.059..0.359 rows=239 loops=1)
-> Filter: (world.city.Population > 1000000) (cost=4.53 rows=6) (actual
time=0.030..0.131 rows=2 loops=51)
-> Index lookup on city using CountryCode
(CountryCode=world.country.Code) (cost=4.53 rows=18) (actual
time=0.023..0.096 rows=35 loops=51)

Which two statements are true?


A. The query returns exactly 125 rows.
B. 35 rows from the city table are included in the result.
C. The optimizer estimates that 51 rows in the country table have Continent =
'Asia'.
D. The country table is accessed as the first table, and then joined to the city
table.
E. It take more than 8 milliseconds to sort the rows.

15
30. You are planning to take a full MySQL instance backup.
Which two factors will help to determine the backup strategy?

A. the number of user accounts for the MySQL instance


B. the expected size of the backup
C. the OS super user rights
D. the location of the physical server
E. how much down time is planned

31. There are performance problems with MySQL instances.


The servers where these problems occur are monitored using MySQL Enterprise
Monitor.
How do you begin looking for problem queries using Query Analyzer?

A. Sort the “Exec” column and check for SQL queries with high Query Response
Time index (QRTi) values.
B. Sort the “Exec” column and check for SQL queries with low Query Response
Time index (QRTi) values.
C. Look for queries with big prolonged spikes in row activity/access graph in the
times series graph.
D. Look for queries with low total latency times in the Latency section in the
times series graph.

32. A MySQL server is monitored using MySQL Enterprise Monitor's agentless


installation.
Which are two of the features that are available with this installation method?
A. MySQL Replication monitoring
B. CPU utilization
C. security-related advisor warnings
D. disk usage and disk characteristics including disk advisors warnings
E. operating system memory utilization

33. Examine this partial report:

mysql> SHOW FULL PROCESSLIST;


+----+-----------------+------------------+
| Id | User | Host |
+----+-----------------+------------------+
16
| 4 | event_scheduler | localhost |
| 9 | root | localhost:51502 |
| 10 | root | localhost:51670 |

Examine this query:


SELECT SUM(m.CURRENT_NUMBER_OF_BYTES_USED) AS TOTAL
FROM performance_schema.memory_summary_by_thread_by_event_name m
INNER JOIN performance_schema.threads t
ON m.THREAD_ID = t.THREAD_ID
WHERE t.PROCESSLIST_ID = 10;

What information does this query provide?


A. total memory used across all connections associated with the user on
connection number 10
B. total memory used by thread number 10
C. total memory used by the first 10 threads
D. total memory used by the first 10 connections
E. total memory used across all connections associated with the user on thread
number 10
F. total memory used by connection number 10

34. Which two tools or statements can be used to monitor the global status of
InnoDB locking?
A. SHOW STATUS;
B. INFORMATION_SCHEMA.INNODB_METRICS
C. INFORMATION_SCHEMA.INNODB_TABLESTATS
D. SHOW ENGINE INNODB STATUS;
E. SHOW TABLE STATUS;
F. INFORMATION_SCHEMA.STATISTICS

35. Examine these statements, which execute successfully:


TRUNCATE test;
BEGIN;
INSERT INTO test(id, name) VALUES(1, "Hello");
ROLLBACK;
SELECT id FROM test;

17
Which are two of the storage engines that would return a nonempty recordset for
the test table when executing the statements?
A. NDB
B. MEMORY
C. InnoDB
D. BLACKHOLE
E. ARCHIVE

36. The languages table uses InnoDB and the countries table uses the MyISAM
storage engine.
Both tables are empty.
Examine these statements:
BEGIN;
INSERT INTO languages(lang) VALUES("Italian");
INSERT INTO countries(country) VALUES("Italy");
ROLLBACK;

What is the content of both tables after executing these statements?


A. countries has one row, languages has none.
B. Both tables are empty.
C. Both tables have one row.
D. languages has one row, countries has none.

37. Which two statements are true about MySQL Enterprise Firewall?
A. System tables named firewall_users and firewall_whitelist in the mysql
database provide persistent storage of firewall data.
B. On Windows systems, it is controlled and managed using the Windows Internet
Connection Firewall control panel.
C. It shows only notifications for blocked connections, which originated outside of
your network's primary domain.
D. Firewall functionality is dependent on SHA-256 and ANSI-specific functions
built into the mysql.firewall table.
E. It provides INFORMATION_SCHEMA tables that enable views into firewall data.

38. What is the correct syntax for using transparent data encryption with an
InnoDB table?
A. ALTER TABLE t1 SET TDE = 'ON';
B. ALTER TABLE t1 WITH ENCRYPTION USING MASTER KEY;
18
C. ALTER TABLE t1 ADD ENCRYPTED_TABLESPACE = 'Y';
D. ALTER TABLE t1 ENCRYPTION=’Y’;

39. You have configured MySQL Enterprise Transparent Data Encryption (TDE).
What command encrypts a table?

A. ALTER INSTANCE ROTATE INNODB MASTER KEY;


B. UPDATE information_schema.tables SET encryption='Y' WHERE
table_name='table';
C. ALTER TABLE <table> ENCRYPTION='Y';
D. UPDATE <table> SET ENCRYPTION = 'Y';

40. Which statement is true about displaying and retrieving data with MySQL
Enterprise Monitor Query Analyzer?

A. The Query Analyzer graph view range selector can extend to cover the same
hour over multiple days.
B. It is possible to filter a Query Analyzer view graph by database and by table.
C. It is possible to export statements included in a graph selection in CSV format.
D. The Query Analyzer can plot a CPU utilization graph for remote hosts with a
MySQL Enterprise Service Manager’s built-in Agent installation.

41. Which are two of the settings that control global buffers shared by all threads
on a MySQL server?

A. innodb_buffer_pool_size
B. read_buffer_size
C. table_open_cache
D. sort_buffer_size
E. tmp_table_size

42. Which statement enables all roles granted to all users automatically?

A. SET PERSIST activate_all_roles_on_login = ON;


B. SET ROLE ALL;
C. SET PERSIST mandatory_roles = ALL;
D. SET DEFAULT ROLE ALL TO '*@'%';

19
43. Examine this SQL statement:
UPDATE world.city
SET Population = Population * 1.1
WHERE CountryCode IN (SELECT Code FROM world.country
WHERE Continent = 'Asia');

Which set of privileges will allow Tom to execute this SQL statement?
A.
GRANT ALL PRIVILEGES ON `world`.`city` TO 'tom'@'%';
GRANT SELECT (`code`) ON `world`.`country` TO 'tom'@'%';
B.
GRANT UPDATE ON `world`.`city` TO 'tom'@'%';
GRANT SELECT ON `world`.`country` TO 'tom'@'%';
C.
GRANT UPDATE ON `world`.`city` TO 'tom'@'%';
GRANT SELECT ON `world`.* TO 'tom'@'%';
D.
GRANT UPDATE ON `world`.* TO 'tom'@'%';
GRANT ALL PRIVILEGES ON `world`.`country` TO 'tom'@'%';

44. Which are two of the requirements for a secure MySQL Server environment?

A. Minimize the number of non-MySQL Server-related processes running on the


server host.
B. Keep the entire software stack on one OS host.
C. Run MySQL server as the root user to prevent incorrect sudo settings.
D. Restrict the number of OS users that have access at the OS level.
E. Encrypt the file system to avoid needing exact file-system permissions.

45. Examine this statement and response:

SET GLOBAL join_buffer_size = 1024*1024;


Query OK, 0 rows affected (0.00 sec)

Which two are true?

20
A. All connections will use the original join_buffer_size value after MySQL Server
restarts.
B. All connections will use the new join_buffer_size value after MySQL Server
restarts.
C. Only new connections will use the new join_buffer_size value.
D. All connections will use the new join_buffer_size value.
E. Only the current connection will use the new join_buffer_size value.

47. Which two statements are true about the data dictionary object cache?

A. Character set and collation information is not cached.


B. All dictionary caches are hard coded in size and cannot be modified.
C. If the dictionary object cache becomes full, MySQL server will be unable to
create any more tables/objects.
D. The dictionary object caches use a Least Recently Used (LRU) algorithm to
manage entries in each cache.
E. The tablespace_definition_cache variable defines the number of entries in the
dictionary object cache.

48. Which three are types of information stored in the MySQL data dictionary?

A. Performance metrics
B. access control lists
C. stored procedure definitions
D. view definitions
E. server configuration rollback
F. server runtime configuration
G. InnoDB buffer pool LRU management data

49. You are investigating performance problems in a MySQL database where all
data fits in memory. You determine that SELECTs from one table are the main
cause for poor response times. Which two actions are likely to fix the problem?

A. Minimize current OS activity on the server host.


B. Alter the table to use column definitions with a smaller storage footprint.
C. Create suitable table indexes that target the slow queries.
D. Investigate InnoDB mutexes for contention.
E. Convert to non-transactional storage engine to avoid locking overhead.
21
50.
What is the cause for the high number of lock waits?

mysql> show global status like 'Table_lock%';


+-----------------------+--------+
| Variable_name | Value |
+-----------------------+--------+
| Table_locks_immediate | 53148 |
| Table_locks_waited | 17716 |
+-----------------------+--------+

A. You use the InnoDB storage engine for most common tables.
B. The InnoDB buffer pool is full.
C. You use the MyISAM storage engine for most common tables.
D. Your table accesses wait for OS flush.
E. You use transactions extensively.

51.
Examine this command, which executes successfully:

$ mysqlbackup --user=mysqlbackup --password --host=127.0.0.1 \


--backup-image=/backups/my.mbi \
--backup-dir=/backup-tmp backup-to-image

Which two statements are true?

A. The backup operation will finish only when apply-log is executed.


B. The backup operation will finish only when backup-and-apply-log is executed.
C. The --backup-dir option holds temporary output, status, and metadata files.
D. A raw backup is created.
E. A single-file backup is created.

22
52. Examine this partial output for InnoDB Cluster status:

"topology": {
"host1:3377": {
"address": "host1:3377",
"mode": "R/W",
[...]
"status": "ONLINE",
"version": "8.0.18"
},
"host2:3377": {
"address": "host2:3377",
"mode": "R/O",
[...]
"status": "(MISSING)"
},
"host3:3377": {
"address": "host3:3377",
"mode": "R/O",
[...]
"status": "ONLINE",
"version": "8.0.18"
}
}

Which statement is true about the instance deployed on host2?

A. It has been expelled from the cluster because of a transaction error.


B. It can rejoin the cluster by using the command
dba.rebootClusterFromCompleteOutage().
C. It can rejoin the cluster by using the command
cluster.addInstance('<user>@host3:3377').
D. It has been removed from the cluster by using the command STOP
GROUP_REPLICATION;.
E. It can be recovered from a donor instance on host3 by cloning using the
command cluster.rejoinInstance('<user>@host3:3377').

23
53. A valid raw backup of the shop.customers MyISAM table was taken.
You must restore the table.

You begin with these steps:

1. Confirm that secure_file_priv='/var/tmp'


2. mysql> DROP TABLE shop.customers;
3. shell> cp /backup/customers.MY* /var/lib/mysql/shop/

Which two actions are required to complete the restore?

A. mysql> IMPORT TABLE FROM /var/tmp/customers.sdi


B. mysql> IMPORT TABLE FROM /var/lib/mysql/shop/customers.sdi
C. shell> cp /backup/customers.sdi /var/tmp
D. shell> cp /backup/customers.sdi /var/lib/mysql/shop/
E. mysql> ALTER TABLE shop.customers IMPORT TABLESPACE
F. mysql> ALTER TABLE shop.customers DISCARD TABLESPACE

54. Which two statements are true about raw binary backups?

A. They are converted to a highly compressible binary format.


B. The resulting files are easily human readable.
C. They are faster than logical backups because the process is a simple file or file
system copy.
D. They are required to obtain FIPS security compliance.
E. The data format is identical to how MySQL stores the data on disk.

55. Examine this parameter setting:


audit_log=FORCE_LOG_PERMANENT
What effect does this have on auditing?

A. It will force the load of the audit plugin even in case of errors at server start.
B. It prevents the audit plugin from being removed from the running server.
C. It prevents the audit log from being removed or rotated.
D. It causes the audit log to be created if it does not exist.

56. Examine this statement:


24
mysql> DROP ROLE r_role1, r_role2;
Which two are true?

A. It fails if you do not have the ADMIN OPTION of the roles r_role1 and r_role2.
B. It fails if any of the roles is specified in the mandatory_roles variable.
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 at least one of the roles does not exist.
F. You must revoke all privileges from r_role1 and r_role2 before dropping the
roles.

57. Examine this statement, which executes successfully:


CREATE USER [email protected] IDENTIFIED BY 'p@SSw0rd' REQUIRE NONE
PASSWORD EXPIRE;
Which two are true?

A. Mary cannot query data until she changes her password.


B. Mary must connect using the username '[email protected]'.
C. Mary requires no password to connect to the MySQL server.
D. Mary cannot connect to the MySQL server until the DBA resets her password.
E. Mary must connect from the client machine 192.0.2.100.

58. Which two are valid uses for binary logs on a MySQL instance?

A. point-in-time recovery
B. replication
C. audit of all queries
D. recording the order in which queries are issued
E. logging the duration and locks for all queries

59. You plan to add this parameter to the configuration:


innodb_directories='/innodb_extras'
Which statement is true?

A. It defines all InnoDB tablespace options relative to a starting parent directory.


B. It adds more temporary workspace in addition to the innodb_tmpdir location.
25
C. It allows scanning of other locations to discover more InnoDB tablespaces.
D. It is not necessary because innodb_data_home_dir is already defined.
E. It moves all InnoDB tablespaces to the /innodb_extras directory to enable a
new innodb_data_home_dir to be defined.

60. Examine these commands, which execute successfully on the ic1 host
mysqlsh> dba.createCluster('cluster1', {memberWeight:35})
mysqlsh> var mycluster = dba.getCluster()
mysqlsh> mycluster.addInstance('ic@ic2', {memberWeight:25})
mysqlsh> 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
Primary node ic1 fails.

Which statement is true?

A. Node ic2 becomes the new primary and is ignored until any backlog of
transactions is completed.
B. Node ic2 becomes the new primary and current transactions are considered
stale and rolled back.
C. Only two nodes remain so the election process is uncertain and must be done
manually.
D. Node ic3 becomes the new primary and current transactions are considered
stale and rolled back.
E. Node ic3 becomes the new primary and is ignored until any backlog of
transactions is completed.

61. Which statement is true?

A. The cluster status is equivalent to status: OK_PARTIAL as one or more


members are unavailable.
B. The cluster status reports that there are enough members for a quorum but
there is no redundancy.
C. The cluster lost its quorum as mymysql02 node status is MISSING.
D. The cluster lost its quorum as statusText says Cluster is NOT tolerant to any
failures. 1 member is not active.

26
62. 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. audit log
C. slow query log
D. binary log
E. general query log

27
Thi lượt 2

28. You must store connection parameters for connecting a Linux-based MySQL
client to a remote Windows-based MySQL server listening on port 3309.
Which are three of the methods that can be used to configure user, host, and
database parameters?

A. Configure.my.cnf.
B. Use the usermod program to store static user information.
C. Embed login information into the SSH tunnel definition.
D. Configure environment variables.
E. Execute the mysqladmin command to configure the user connection.
F. Execute myagi config editor to configure the user connection.
G. Configure-/.ssh/config for public key authentication.

33. Your my.cnt 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. Olog throttle queries_not_using_indexes-5


B. Omin examined row_limit-5000
C. Olong query time-S
min examined row limit-5000
D. Olog throttle queries not_using_indexes-5
min examined row limit-5000
E. Olong query times log throttle queries_not_using_indexes-5
F. Olong query time-5
log throttle queries_not using indexes-5.
min examined cow Limit-5000
28
G. long query_time-S

35. Which three methods are part of a 'scale up' approach to capacity planning?

A. adding a replication slave


B. adding additional MySQL servers to the current host
C. adding more storage to your disk array
D. adding more CPU power
E. adding more RAM
F. sharding the server into a parallel server farm
G. adding a new node to InnoDB Cluster

39. Which two are characteristics of snapshot-based backups?

A. Snapshot backups can be used only in virtual machines.


B. Snapshot-based backups greatly reduce time during which the database and
applications are unavailable.
C. The frozen file system can be cloned to another virtual machine immediately
into active service.
D. There is no need for InnoDB tables to perform its own recovery when restoring
from the snapshot backup.
E. A separate physical copy must be made before releasing the snapshot backup.

40. Which are two of the actions that will secure a MySQL server from network-
based attacks?

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


B. Construct a perimeter network to allow public traffic
C. Use network file system (NFS) for storing data.
D. Change the listening port to 3307.
E. Allow connections from the application server only.

42. Which three are types of information stored in the MySQL data dictionary?

A. Performance metrics
B. access control lists
C. stored procedure definitions
29
D. view definitions
E. server configuration rollback
F. server runtime configuration
G. InnoDB buffer pool LRU management data

44.Binary log events for the mydb1 schema must be copied to a different schema
name mydb2.
Which command will do this?

A. mysqlbinlog --database=mydb1 --database=mydb2 | mysql


B. mysqlbinlog --rewrite-db='mydb1->mydb2' | mysql
C. mysqlbinlog --rewrite-db='mydb1' --rewrite-db='mydb2' | mysql
D. mysqlbinlog --read-from-remote-server --raw | sed 's/mydb1/mydb2/g' | mysql

46. A clean shutdown was performed with innodb_fast_shutdown=0.


While you were manipulating files, all files were accidentally deleted from the
top-level data directory.
Which two files must be restored from backup to allow the DB to restart cleanly?

A. mysql.ibd
B. ib_buffer_pool
C. ibtmp1
D. undo_001
E. ibdata1
F. ib logfile0

66. 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?


30
A. No changes required. It automatically updates the MySQL Server with the data.
B. It can be piped into the MySQL Server via the command-line client.
C. --write-to-remote-server must be added to the command line to update the
database tables.
D. You must use --stop-position=1797 to avoid the DELETE statement that caused
the initial problem.

72. Examine these statements and output:

mysql> GRANT PROXY ON accounting@localhost TO ''@'%';

mysql> SELECT USER(), CURRENT_USER(), @@proxy_user;


+-------------------+-----------------------+-------------+
| USER() | CURRENT_USER() | @@proxy_user|
+-------------------+-----------------------+-------------+
| rsmith@localhost | accounting@localhost | ''@'%' |
+-------------------+-----------------------+-------------+

Which statement is true?

A. The user is authorized as the accounting@localhost user.


B. The user is authorized as the rsmith@localhost user.
C. The user is authenticated as the anonymous proxy user ''@'%'.
D. The user is logged in with --user=accounting as an option.
E. The user failed to define a username and the connecting username defaulted
to ''@'%'.

31
1. Examine this statement, which executes successfully:

You want to improve the performance of this query:

Which change enables the query to succeed while accessing fewer rows?
A. ALTER TABLE world.city ADD SPATIAL INDEX (Name);
B. ALTER TABLE world.city ADD SPATIAL INDEX (Population);
C. ALTER TABLE world.city ADD INDEX (Population);
D. ALTER TABLE world.city ADD INDEX (Name);
E. ALTER TABLE world.city ADD FULLTEXT INDEX (Name);
F. ALTER TABLE world.city ADD FULLTEXT INDEX (Population);

Answer: C

2. Which three are characteristics of a newly created role? (Choose three.)

A. It can be dropped using the DROP ROLE statement.


B. It is stored in the mysql.role table.
C. It is created as a locked account.
D. It can be renamed using the RENAME ROLE statement.
E. It can be granted to user accounts.
F. It can be protected with a password.

Answer: A,C,E

32
3. You have configured GTID-based asynchronous replication with one master and
one slave.
A user accidentally updated some data on the slave.
To fix this, you stopped replication and successfully reverted the accidental
changes.
Examine the current GTID information:

You must fix GTID sets on the slave to avoid replicating unwanted transactions in
case of failover.
Which set of actions would allow the slave to continue replicating without
erroneous transactions?
A. RESET MASTER;
SET GLOBAL gtid_purged=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-10167;

B. SET GLOBAL gtid_purged=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-


2312,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-9;
SET GLOBAL gtid_executed=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-10167;

C. RESET SLAVE;
SET GLOBAL gtid_purged=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-3820;
SET GLOBAL gtid_executed=aaaaaaaa-aaaa-aaaa-aaaa—aaaaaaaaaaaa:1-10300;

D. RESET MASTER;
SET GLOBAL gtid_purged-aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-2312;
SET GLOBAL gtid_executed=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-10167;

E. RESET SLAVE;
SET GLOBAL gtid_purged=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-10167;

Answer: D

33
4. The data in this instance is 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:

The OS metrics indicate that disk is a bottleneck.


Other variables retain their default values.
Which three changes will provide the most benefit to the instance? (Choose
three.)

A. innodb_flush_log_at_trx_commit=1
B. buffer_pool_size=24G
C. innodb_log_file_size=1G
D. sync_binlog=0
E. innodb_doublewrite=0
F. max_connections=10000
G. innodb_undo_directory=/dev/shm

Answer: A,C,F

34

You might also like