100% found this document useful (1 vote)
167 views27 pages

Session 8 9 Questions

Uploaded by

mahayhemimy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
167 views27 pages

Session 8 9 Questions

Uploaded by

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

0 CERTSTUDYGROUP

1Z0-908 - MySQL Save and Exit

8.0 commented

Align Quiz to Standard Share

1. Examine this statement, which executes successfully:

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);

i Spatial and fulltext indexes cannot be created on a


numeric column.
On a InnoDB table, a standard index (key) is BTree type
and support range access using index.
Commented by MC, 27/06/2023
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

i A, C, E are true.
F: a password can be set on a role but because it is
locked it can't be seen as a protection, being protected
with a password is characteristic of users. Anyway users
and roles are both authorization identifiers and there is
an interchangeability between them.
Commented by MC, 27/06/2023

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;

i RESET MASTER is needed to reset gtid_purged to a set


that is not a superset of the previous value.
gtid_executed is a read-only variable.
Reference: dev.mysql.com/doc/refman/8.0/en/
replication-options-gtids.html#sysvar_gtid_purged
Commented by MC, 27/06/2023
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:

-- image --

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

i A will reduce performances.


B will not improve because there is 2.5GB free space in
InnoDB Buffer Pool.
D will not change anything because binary log is
disabled. F does not change anything on the
performances.
C should optimize writing of datafiles.
E should optimize writing of datafiles if data integrity is
not a priority.
G may optimize writing of undo logs moving undo
tablespaces to memory.
Note: configuration G should not be used actually,
because if undo logs are lost or not present under the
configured path (e. g. when rebooting server), instance
will not start and should be reinitialized.
Commented by MC, 27/06/2023

5. Which statement is true about InnoDB persistent index


statistics?
A Updating index statistics is an I/O expensive operation.

B Index statistics are calculated from pages buffered in the


buffer pool for tables with InnoDB storage engine.

C Setting innodb_stats_auto_recalc=ON causes statistics to be


updated automatically when a new index is created.

D Execution plans based on transient index statistics improve


precision when innodb_stats_persistent_sample_pages is
increased.

E Increaing innodb_stats_persistent_sample_pages determines


higher pages scanning speed, at the cost of increased
memory usage.

F Tables are scanned and index statistics recalculated when an


instance is restarted.

i A true, can generate some I/O.


B not true in general.
C not true as when an index is added to an existing table,
statistics are calculated regardless of the value of
innodb_stats_auto_recalc.
D not true because is relative to persistent statistics and
not transient statistics. E not true.
F not true.
Reference: dev.mysql.com/doc/refman/8.0/en/innodb-
persistent-stats.html
Commented by MC, 27/06/2023

6. Which two are features of MySQL Enterprise Firewall?


(Choose two.)
A recording incoming SQL statements to facilitate the creation
of a whitelist of permitted commands.

B blocking of potential threats by configuring pre-approved


whitelists

C modifying SQL statement dynamically with substitutions

D automatic locking of user accounts who break your firewall

E provides stateless firewall access to TCP/3306

i Reference: dev.mysql.com/doc/refman/8.0/en/
connection-control.html
Commented by MC, 27/06/2023

7. Examine the modified output:

--image--

Seconds_Behind_Master value is steadily growing.


What are two possible causes? (Choose two.)
A The master is most probably too busy to transmit data and
the slave needs to wait for more data.

B One or more large tables do not have primary keys.

C This value shows only I/O latency and is not indicative of the
size of the transaction queue.

D The master is producing a large volume of events in parallel


but the slave is processing them serially.

E The parallel slave threads are experiencing lock contention.

i A is not true because when no event is currently being


processed on the replica, this value is 0.
B can be a possible cause, especially with RBR (Row-
based Replication).
C is not true because this value is the difference
between the current timestamp on the replica and the
original timestamp logged on the source for the event
currently being processed on the replica.
D can be a possible cause as multi-threaded applier can
not be enabled or parallelism obtainable can be
insufficient.
E should not have an impact due to group commit and
transaction dependency replication algorithms not likely
to produce that (missing a documentation reference for
this)
Reference: dev.mysql.com/doc/refman/8.0/en/
connection-control.html
Commented by MC, 27/06/2023

8. You must configure the MySQL command-line client to


provide the highest level of trust and security when
connecting to a remote MySQL Server.

Which value of --ssl-mode will do this?


A PREFERRED

B VERIFY_CA

C REQUIRED

D VERIFY_IDENTITY

i The highest level is with D


Reference: dev.mysql.com/doc/refman/8.0/en/
connection-control.html
Commented by MC, 27/06/2023

9. Consider this shell output and executed commands:

[root@oel7# ps aux | grep mysqld

mysql 2076 3.5 24.6 1386852 372572 ? Ssl 1201 001 /usr/sbin/mysqld

[root@oel7# kill -15 2076

Which statement is true about MySQL server shutdown?

A kill -15 should be avoided. Use other methods such as


mysqladmin shutdown or systemctl stop mysqld

B kill -15 and kill -9 are effectively the same forced shutdown
that risk committed transactions not written to disk

C kill -15 carries out a normal shutdown process, such as


mysqladmin shutdown

D mysqld_safe prohibits commands that would harm the


operation of the server. An error would be returned by the kill
command.

10. You wish to protect your MySQL database against SQL


injection attacks

Which method would fail to do this?


A installing and configuring the Connection Control plugin

B avoiding concatenation of SQL statements and user-supplied


values in an application

C using stored procedures for any database access

D using PREPARED STATEMENTS

i Connection Control protect against at authentication


level (works against brute force attacks), while SQL
injection works at SQL level.
Reference: dev.mysql.com/doc/refman/8.0/en/
connection-control.html
Commented by MC, 27/06/2023

11. Which two statements are true about using backups of


the binary log? (Choose two.)

A Binary logs are relatively small, and therefore, excellent for


long-term storage and disaster recovery.

B They allow for point-in-time recovery of the data.

C Binary logs can always be used to unapply unwanted schema


changes.

D Multiple binary logs can be applied in parallel for faster data


restoration.

E Multiple binary logs can be used to restore data.

i A binary logs contain only changes, not a complete


recovery solution.
B true.
C binary logs aren't a general way to unapply a change
with a binary log by itself, can only be used to apply
changes.
D false, they must be applied in correct sequence.
E true, if applied in correct sequence.
Commented by MC, 27/06/2023
12. An existing asynchronous replication setup is running
MySQL 8.

Which two steps are a part of implementing GTID


replication? (Choose two.)

A Execute this on the slave to enable GTID:


START SLAVE IO_THREAD WITH GTID;

B Enable GTID by executing this on the master and the slave:


SET GLOBAL GTID_ENABLED=on;

C On the slave, alter the MySQL master connection setting with:


ALTER channel CHANGE MASTER TO
MASTER_AUTO_POSITION = 1;

D Restart MySQL (master and slave) with these options


enabled:
--gtid_mode=ON
--log-bin
--log-slave-updates
--enforce-gtid-consistency

E Execute this on the slave to enable GTID:


RESET SLAVE; START SLAVE GTID_NEXT=AUTOMATIC;

F On the slave, alter the MySQL master connection setting with:


CHANGE MASTER TO MASTER_AUTO_POSITION = 1;

i Reference: dev.mysql.com/doc/refman/8.0/en/
replication-gtids-howto.html

13. You plan to install MySQL Server by using the RPM


download.

Which two statements are true? (Choose two.)


A You can provide the root password interactively.

B The functionality is split among several RPM package files.

C The MySQL RPM package installation supports deploying


multiple MySQL versions on the same host.

D MySQL uses the RPM relocatable installation target feature.

E You can find the root password in the error log after the first
start.

F You must manually initialize the data directory.

i A not correct: root password it is generated randomically.


B and E correct.
F not correct: it is done automatically at startup in rpm
installations.
Reference: dev.mysql.com/doc/refman/8.0/en/linux-
installation-rpm.html
Commented by MC, 27/06/2023
14. Examine this command, which executes successful:

mysqlbackup --defaults-file=/backups/server-my.cnf --
backup-dir=/backups/full copy-back

Which statement is true about the copy-back process?

A The copy-back process makes inconsistent backups.

B It restores files from the backup directory to their original


MySQL server locations.

C The copy-back process is used to overwrite a new backup


over an existing backup.

D It restores files from the data directory to their original MySQL


server locations.

i Reference: dev.mysql.com/doc/mysql-enterprise-
backup/8.0/en/backup-commands-restore.html
Commented by MC, 27/06/2023

15. Examine this command and output:

-- image --

Which two statements are true? (Choose two.)


A The lock is at the metadata object level.

B The lock is an exclusive lock.

C The lock is a row-level lock.

D The lock is a shared lock.

E The lock is at the table object level.

F The lock is an intentional lock.

i Reference: dev.mysql.com/doc/refman/8.0/en/
performance-schema-data-locks-table.html
Commented by MC, 27/06/2023

16. Which step or set of steps can be used to rotate the


error log?

A Execute SET GLOBAL max_error_count = <number of


messages at point to rotate>.

B Rename the error log file on disk, and then execute FLUSH
ERROR LOGS.

C Execute SET GLOBAL log_error = '<new error log file>'.

D Execute SET GLOBAL expire_logs_days=0 to enforce a log


rotation.

i Reference: dev.mysql.com/doc/refman/8.0/en/error-log-
rotation.html
Commented by MC, 27/06/2023

17. Which two statements are true about InnoDB data-at-


rest encryption? (Choose two.)
A It supports all indexes transparently.

B It enforces encryption from disk to memory and over network


transmission.

C It does not support the transportable tablespaces feature.

D It supports only non-blob datatypes.

E It decrypts data for use in memory.

i Reference: dev.mysql.com/doc/refman/8.0/en/innodb-
data-encryption.html, dev.mysql.com/doc/refman/8.0/en/
innodb-table-import.html
Commented by MC, 27/06/2023

18. Which two are use cases of MySQL asynchronous


replication? (Choose two.)

A It allows backup to be done on the slave without impacting


the master.

B You can scale reads by adding multiple slaves.

C You can scale writes by creating a replicated mesh.

D It guarantees near real-time replication between a master and


a slave.

E MySQL Enterprise Backup will automatically back up from an


available slave.

19. A colleague complains about slow response time on your


website.
Examine this query and output:

-- image --

What is the most likely cause for the high number of lock
waits?
A Your table accesses wait for the operating system level flush.

B You use the InnoDB storage engine and statements wait while
data is inserted.

C The Innodb Buffer pool is full.

D You use the MyISAM storage engine for most common tables.

i The status variables show that there are table locks.


B and C not likely because InnoDB uses row locks.
A is not the most likely cause on MyISAM.
D true: it's a common case
Commented by MC, 27/06/2023

20. You wish to store the username and password for a client
connection to MySQL server in a file on a local file
system.

Which is the best way to encrypt the file?

A Use the AES_ENCRYPT() MySQL function on the option file.

B Use a text editor to create a new defaults file and encrypt it


from Linux prompt.

C Use mysql_secure_installation to encrypt stored login


credentials.

D Use mysql_config_editor to create an encrypted file.

21. Examine this SQL statement:


mysql> GRANT r_read@localhost TO mark WITH ADMIN
OPTION;

Which two are true? (Choose two.)


A ADMIN OPTION allows Mark to drop the role.

B Mark can grant the privileges assigned to the


r_read@localhost role to another user.

C ADMIN OPTION causes the role to be activated by default.

D Mark must connect from localhost to activate the


r_read@localhost role.

E Mark can grant the r_read@localhost role to another user.

F Mark can revoke the r_read@localhost role from another role.

i Reference: dev.mysql.com/doc/refman/8.0/en/grant.html
Commented by MC, 29/06/2023

22. Which two statements are true about the


mysql_config_editor program? (Choose two.)

A It manages the configuration of the MySQL Firewall feature.

B It can be used to create and edit SSL certificates and log


locations.

C It provides an interface to change my.cnf files.

D It manages the configuration of user privileges for accessing


the server.

E It can move datadir to a new location.

F It manages the configuration of client programs.

G It will use [client] options by default unless you provide --


login-path.

i
Reference: dev.mysql.com/doc/refman/8.0/en/mysql-
config-editor.html
23. A user wants to connect without entering his or her
username and password on the Linux command prompt.

Which three locations can be used to store the user's


mysql credentials to satisfy this requirement? (Choose
three.)

A /etc/my.cnf file

B $HOME/.mylogin.cnf file

C $HOME/.my.cnf file

D $HOME/.mysqlrc file

E $MYSQL_HOME/my.cnf file

F $HOME/.mysql/auth/login file

G DATADIR/mysqld-auto.cnf file

i A: can be used (even if not best practice because


common for all O.S. users).
B: can be used for defining a login-path for a O.S. user.
C: can be used for a O.S. user.
D and F: not standard configuration file locations.
E and G: not client standard configuration file locations.
Reference: dev.mysql.com/doc/refman/8.0/en/option-
files.html
Commented by MC, 29/06/2023

24. Examine these statements, which execute successfully:


CREATE ROLE r_world_rd;
GRANT SELECT ON world.* TO r_world_rd;
CREATE USER john IDENTIFIED BY 'P@ssw0rd';
GRANT r_world_rd TO john;
Examine these statements issued by user John:

-- image --

What is the reason for the error?


A John needs to reconnect to the database.

B John has not activated the role.

C The statement was blocked by MySQL Firewall.

D The DBA needs to execute FLUSH PRIVILEGES.

25. What does the binlog dump thread do?

A It connects to the master and asks it to send updates


recorded in its binary logs.

B It acquires a lock on the binary log for reading each event to


be sent to the slave.

C It monitors and schedules the rotation/deletion of the binary


logs.

D It reads the relay log and executes the events contained in


them.

i Reference: dev.mysql.com/doc/refman/8.0/en/
replication-threads.html
Commented by MC, 29/06/2023

26. Which two are characteristics of snapshot-based


backups? (Choose two.)
A There is no need for InnoDB tables to perform its own
recovery when restoring from the snapshot backup.

B Snapshot backups can be used only in virtual machines.

C A separate physical copy must be made before releasing the


snapshot backup.

D Snapshot-based backups greatly reduce time during which


the database and applications are unavailable.

E The frozen file system can be cloned to another virtual


machine immediately into active service.

i Reference: dev.mysql.com/doc/mysql-backup-excerpt/
8.0/en/backup-types.html, dev.mysql.com/doc/mysql-
backup-excerpt/8.0/en/backup-methods.html
Commented by MC, 29/06/2023

27. Which two queries are examples of successful SQL


injection attacks? (Choose two.)
A SELECT id, name FROM user WHERE user.id=(SELECT
members.id FROM members);

B SELECT user, phone FROM customers WHERE name = '\;


DROP TABLE users; --';

C SELECT id, name FROM user WHERE id=23 OR id=32 OR 1=1;

D SELECT email,passwd FROM members


WHERE email = 'INSERT INTO members('email','passwd')
VALUES ('[email protected]',
'secret');--';

E SELECT user,passwd FROM members


WHERE user = '?'; INSERT INTO members('user','passwd')
VALUES
('[email protected]','secret');--';

F SELECT id, name FROM user WHERE id=23 OR id=32 AND


1=1;

i A gives error if subquery returns more than one values.


B the DROP statement does not escape out of the string
so is not executed.
C true, query returns the full set of rows.
D the INSERT statement does not escape out of the
string so is not executed.
E true, INSERT is executed.
F query does not return rows.
Commented by MC, 29/06/2023

28. Examine this command and output:

-- image --

Which two options will improve the security of the


MySQL instance? (Choose two.)
A Change the parent directory owner and group to mysql.

B Change the group ownership of the mysql directory to the


mysql user group.

C Remove the world read/execute privilege from the accounting


directory.

D Remove world read privileges from the public_key.pem file.

E Remove group read/write privileges from the private_key.pem


file.

F Remove world read privileges from the server-cert.pem


certificate file.

i A and B: the actions do not restrict access of non mysql


users to database files.
D and F: the actions do not improve security as the files
are not private.
Commented by MC, 29/06/2023

29. 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 general query log

B audit log

C slow query log

D error log

E binary log
30. Examine this MySQL client command to connect to a
remote database:

mysql -h remote.example.org -u root -p --protocol=TCP


--ssl-mode=

Which two --ssl-mode values will ensure that an X.509-


compliant certificate will be used to establish the SSL/
TLS connection to MySQL?

A VERIFY_IDENTITY

B VERIFY_CA

C PREFERRED

D REQUIRED

E DISABLED

i A and B: options do validate the X509 certificate


provided by MySQL Sever against a CA certificate.
D: option requires the certificate from MySQL Server but
don't perform this validation, anyway this might also be a
correct answer.
C and E: options don't require SSL.
Reference: dev.mysql.com/doc/refman/8.0/en/using-
encrypted-connections.html#using-encrypted-
connections-client-side-configuration
Commented by MC, 29/06/2023

31. Which three settings control global buffers shared by all


threads on a MySQL server? (Choose three.)
A key_buffer_size

B innodb_buffer_pool_size

C read_buffer_size

D sort_buffer_size

E table_open_cache

F tmp_table_size

i A and B: settings control global instance caches and


buffers managed by storage engines.
C and D: settings control buffers that are allocated per
thread.
E: setting controls table cache that works at global level.
F: setting controls aspects relative to temporary tables
created by the MEMORY or TempTable engines that are
not strictly buffers, moreover the parameter does not
control the memory space globally available for
temporary tables, instead the memory size limit is
defined at table level.
Reference: dev.mysql.com/doc/refman/8.0/en/server-
system-variables.html
Commented by MC, 29/06/2023

32. A MySQL server is monitored using MySQL Enterprise


Monitor's agentless installation.

Which three features are available with this installation


method? (Choose three.)
A MySQL Query Analysis data

B operating system memory utilization

C disk usage and disk characteristics including disk advisors


warnings

D security-related advisor warnings

E MySQL Replication monitoring

F CPU utilization

G network-related information and network characteristics

33. Examine these statements and output:

-- image --

Which statement is true?

A The user failed to define a username and the connecting


username defaulted to ''@'%'.

B The user is logged in with --user=accounting as an option.

C The user is authenticated as the anonymous proxy user ''@'%'.

D The user is authorized as the rsmith@localhost user.

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

i Reference: dev.mysql.com/doc/mysql-security-excerpt/
8.0/en/proxy-users.html
Commented by MC, 29/06/2023
34. Examine these entries from the general query log:

-- image --

All UPDATE statements reference existing rows.

Which describes the outcome of the sequence of


statements?

A Connection 25 experiences a lock wait timeout.

B All statements execute without error.

C A deadlock occurs after innodb_lock_wait_timeout seconds.

D Connection 24 experiences a lock wait timeout.

E A deadlock occurs immediately.

i Considering default values of innodb_lock_wait_timeout


and innodb_deadlock_detect.
The last statement of session 25 waits for a lock held by
session 24. After less than 3 seconds, the lock wait
timeout is still not triggered, and the last statement of
session 24 try to lock a row already locked by session
25. At that precise moment InnoDB detects that last lock
is closing the dependency chain and immediately a
deadlock condition occurs, transaction on session 24 is
rolled back and last statement of session 25 completes.
E correct response.
B not true because two transactions generate a deadlock
condition and cannot be executed both without errors.
A, C, D do not happen with default parameter values.
Reference: dev.mysql.com/doc/refman/8.0/en/innodb-
parameters.html#sysvar_innodb_lock_wait_timeout
Commented by MC, 30/06/2023
35. You encountered an insufficient 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 Change the default database and re-execute the failed


statement in your transaction.

B Close the connection, reconnect, and start the transaction


again.

C Re-execute the failed statement in your transaction.

D Roll back the transaction and start the transaction again in


the same session.

Add Blank Question

Multiple Choice True / False Short Answer

Create Questions with AI

Generate Questions

You might also like