Udemy- Test #2 Q's Flashcards
You enable binary logging on MySQL Server with the configuration: binlog-format=ROW log-bin
Which database updates are logged on the master server to the binary log by default?
A. al updates except to the TEMPDB db
B. all updates except to the PERFORMANCE _SCHEMA db
C. all updates not involving temporary tables
D. all updates to the default db, except temporary tables
E. all tables and all databases
D. all updates to the default db, except temporary tables
You are using GTID in replication. You need to skip a transaction with the GTID of aaa-bbb-ccc-ddd-eee : 3
Which command would you execute from a Mysql prompt?
A. STOP SLAVE; SETGTID_NEXT=”aaa-bbb-ccc-ddd-eee:3”; BEGIN; COMMIT; SET GTID_NEXT=”AUTOMATIC”; START SLAVE
B. STOP SLAVE; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;
C. STOP SLAVE; BEGIN; SET GTID_IGNORE=”aaa-bbb-ccc-ddd-eee:3”; COMMIT; START SLAVE;
D. STOP SLAVE; RESET SLAVE; BEGIN; SKIP NEXT GTID; COMIMIT; START SLAVE;
E. STOP SLAVE; SETGTID_SET="aaa-bbb-ccc-ddd-eee:3"; BEGIN; COMMIT; SETGTID_NEXT="AUTOMATIC"; START SLAVE;
E. STOP SLAVE; SETGTID_SET="aaa-bbb-ccc-ddd-eee:3"; BEGIN; COMMIT; SETGTID_NEXT="AUTOMATIC"; START SLAVE;
User A issues the command:
LOCK TABLES pets READ;
Which command can User B execute against the pets table?
A. UPDATE pets…
B. SELECT… FROM pets
C. INSERRT INTO pets…
D. ALTER TABLE pets…
B. SELECT… FROM pets
When backing up a replication slave, which three should also be backed up in addition to data?
A. The master.info and relay.info files B. The relay log files C. The relay index file D. Mysql.slave_master_info table E. Mysql.slave_relay_log_info table F. Mysql.slave_worker_info table
A. The master.info and relay.info files
B. The relay log files
C. The relay index file
You want to shutdown a running Mysql Server cleanly.
Which three commands that are valid on either Windows or Linux will achieve this?
A. Shell> pkill -u mysql mysqld_safe B. Shell> service mysql safe_exit C. Shell> /etc/init.d/mysql stop D. Shell> mysqladmin -u root -p shutdown E. Mysql> STOP PROCESS mysqld; F. Shell> net stop mysql G. Shell> nmc mysql shutdown
C. Shell> /etc/init.d/mysql stop
D. Shell> mysqladmin -u root -p shutdown
F. Shell> net stop mysql
Consider the following table:
CREATE TABLE game (
id int (10) unsigned NOT NULL AUTO_INCREMENT,
keyword varchar (45) DEFAULT NULL,
date datetime NOT NULL,
PRIMARY KEY (id , date),
UNIQUE KEY keyword_idx (keyword , date)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
PARTITION BY RANGE (TO_DAYS (date) ) (
PARTITION g201301 VALUES LESS THAN (TO_DAYS (2013-01-01 00:00:00) ),
PARTITION g201302 VALUES LESS THAN (TO_DAYS (2013-02-01 00:00:00) ),
PARTITION g201303 VALUES LESS THAN (TO_DAYS (2013-03-01 00:00:00) ),
PARTITION g201304 VALUES LESS THAN (TO_DAYS (2013-04-01 00:00:00) ),
PARTITION gMORES VALUES LESS THAN (MAXVALUE) );
Which method should used to add a new g201305 partition to the table?
A. ALTER TABLE games REORGANIZE PARTITION (gMORES) INTO g01305 VAUES LESS THAN (TO_DAYS (2013-05-01 00:00:00) 0;
B. ALTER TABLE games ADD PARTITION g201350 VALUES LESS THAN (TO_DAYS (2013-05-01 00:00:00) 0;
C. ALTER TABLE games COALESCE PARTITION (gMORES) INTO g01305 VAUES LESS THAN (TO_DAYS (2013-05-01 00:00:00) 0; gMORES VALUES LESS THAN (MAXVALUE) );
A. ALTER TABLE games REORGANIZE PARTITION (gMORES) INTO g01305 VAUES LESS THAN (TO_DAYS (2013-05-01 00:00:00) 0;
Full Atomicity, Consistency, Isolation, Durability (ACID) compliance is a necessity for a new application, which heavily reads and writes data.
This requires the following config file options:
Sync_binlog=1
Innodb_flush_log_at_trx_commit=1
Innodb_doublewrite=1
However, this configuration is expected to introduce disk I/O overhead.
What three changes will reduce disk I/O overheads?
A. Use of soft links for db dir on the same physical disk
B. Use of the separate dir on the same physical disk for log files and data files
C. Placement of InnoDB log files and datadir on separate physical disks
D. Allocation of RAM to the buffer pool such that more of the data can fit in RAM
E. Use of delay_key_write=ON for batch index update
C. Placement of InnoDB log files and datadir on separate physical disks
D. Allocation of RAM to the buffer pool such that more of the data can fit in RAM
E. Use of delay_key_write=ON for batch index update
You want a record of all queries that are not using indexes.
How would you achieve this?
A. By enabling the Slow Query Log because all queries that are not using indexes will be logged automatically.
B. By enabling the Error Log because not using indexes is an error
C. By enabling the Slow Query Log and using the –log-queries-not-using-indexes option
D. By enabling the Error Log and using the –log-queries-not-
C. By enabling the Slow Query Log and using the –log-queries-not-using-indexes option
The validate_password plugin is loaded and displays the following settings in global variables:
Mysql> SHOW VARIABLES LIKE validate_password%;
Validate_password_dictionary_file
Validate_passworrd_length = 8
Validate_password_mixed_case_count = 1
Validate_password_number_count= 2
Validate_password_policy =MEDIUM
Validate_passworrd_special_char_count = 1
When attempting to set your password, you get the following error: Mysql> SET PASSWORD = PASSWORD (Hoverl@%); ERROR 1819 (HY000): Your password does not satisfy the current policy requirements What is the cause of the error?
A. The password is eight characters long, but needs to exceed validaate_password_lengt to be valid.
B. All of the MEDIUM password policy requirements have not been honored.
C. The password does not match the validate_passworrd_number_count requirement.
D. There is no dictionary file defined, so password validation cannot work as expected.
B. All of the MEDIUM password policy requirements have not been honored.
You attempt to connect to a Mysql Server by using the mysql program. However, you receive the following notice:
ERROR 2059 (HY000): Authentication plugin mysql_clear_password connot be loaded: plugin not enabled
What would you run to fix the issue?
A. The msql client with the –ignore-password-hashing option
B. The mysql_secure_installation script to update server security settings
C. The mysql client with the –enable-cleartext-plugin option
D. The mysql_upgrade script
C. The mysql client with the –enable-cleartext-plugin option
Consider the following statement on a RANGE partitioned table:
ALTER TABLE orders DROP PARTITION p1, p3;
What is the outcome of executing the above statement?
A. Only the first partition (p1) will be dropped as only one can be dropped at any time
B. All data in p1 and p3 partitions are removed, but the table definition remains unchanged
C. A syntax error will result as you cannot specify more than one partition in the same statement
D. All data in p1 and p3 partitions are removed and the table definition is changed
D. All data in p1 and p3 partitions are removed and the table definition is changed
ExplanationD
is correct.
if you execute desc ; the result will be the same.
“Desc” does not show you the full definition of the table – it will not show you partition information.
need use: show create table orders
;
You inherit a legacy database system when the previous DBA, Bob, leaves the company. You are notified that users are getting the following error: mysql> CALL film_in_stock (40, 2, @count);
ERROR 1449 (HY000): The user specified as a definer (bon@localhost) does not exist
How would you identify all stored procedures that pose the same problem?
A. Execute SELECT * FROM mysql.routines WHERE DEFINER=’bob@localhost’;
B. Execute SHOW ROUTINES WHERE DEFINER=’bob@localhost’.
C. Execute SELECT * FROM INFORMATION_SCHEMA ROUTINES WHERE DEFINER=’bob@localhost’;
D. Execute SELECT * FROM INFORMATION_SCHEMA. PROCESSLIST WHERE USER=’bob’ and HOST=’LOCALHOST’;
C. Execute SELECT * FROM INFORMATION_SCHEMA ROUTINES WHERE DEFINER=’bob@localhost’;
ROW-based replication has stopped working. You investigate the error log file and find the following entries:
2019-08-27 14:15:47 9056 [ERROR] Slave SQL: Could not execute Delete_rows event on table test.t1; Cant find record in t1, Error_code: 1032; handler error
HA_ERR_KEY_NOT_FOUND; the events master log 56_master-bin. 000003, end_log_pos 851, Error_code: 1032
2019-08-27 14:15:47 9056 [warning] Slave: Cant find record in t1 Error_code: 1032
2019-08-27 14:15:47 9056 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with “SLAVE START”. We stopped at log 56_master-bin. 000003 position 684
Why did you receive this error?
A. The slave SQL thread does not have DELETE privileges to execute on test.t1 tablets
B. The table definition on the slave -litters from the master
C. Multi-threaded replication slaves can have temporary errors occurring for cross database updates
D. The slave SQL thread attempted to remove a row from the test.t1 table, but the row did not exist
D. The slave SQL thread attempted to remove a row from the test.t1 table, but the row did not exist
Mysqldump was used to create a single schema backup;
Shell> mysqldump -u root -p sakila > sakila2013.sql
Which two commands will restore the sakila database without interfering with other running database?
A. Mysql> USE sakila; LOAD DATA INFILE ‘sakila2013.sql’;
B. Shell> mysql -u root -p sakila < sakila2013.sql
C. Shell> mysqlimport -u root -p sakila sakila2013.sql
D. Shell> mysql -u root -p-e ‘use sakila; source sakila2013.sql’
E. Shell> mysql -u root -p -silent < sakila2013.sql
B. Shell> mysql -u root -p sakila < sakila2013.sql
D. Shell> mysql -u root -p-e ‘use sakila; source sakila2013.sql’
Consider the Mysql Enterprise Audit plugin.
You are checking user accounts and attempt the following query:
Mysql> SELECT user, host, plugin FROM mysql.users;
ERROR 1146 (42S02): Table mysql.users doesnt exist
Which subset of event attributes would indicate this error in the audit.log file?
A. NAME = “Query” STATUS= “1146” SQLTEXT=”select user, host from users” />
B. NAME=”Error” STATUS=”1146” SQLTEXT=”Error 1146 (42502): Table ‘mysql.users’ doesn’t exist”/>
C. NAME =”Query” STATUS=”1146” SQLTEXT=”Error 1146 (42502): Table ‘mysql.users’ doesn’t exist
D. NAME=”Error” STATUS =”1146” SQLTEXT=”select user; host from users”/>
E. NAME= “Error” STATUS=”0” SQLTEXT = “Error 1146 (42502): Table ‘mysql.users’ doesn’t exist” />
A. NAME = “Query” STATUS= “1146” SQLTEXT=”select user, host from users” />
Which query would you use to find connections that are in the same state for longer than 100 seconds?
A. SHOW FULL PROCESSLIST WHERE Time > 100;
B. SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE STARTS < (DATE_SUB (NOW( ), INTERVAL 100 SECOND) );
C. SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE TIME > 100;
C. SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE TIME > 100;
You are using replication and the binary log files on your master server consume a lot of disk space.
Which two steps should you perform to safely remove some of the older binary log files?
A. Ensure that none of the attached slaves are using any of the binary logs you want to delete
B. Use the command PURGE BINARY LOGS and specify a binary log file name or a date and time to remove unused files
C. Execute the PURGE BINARY LOGS NOT USED command
D. Remove all of the binary log files that have a modification date earlier than today
E. Edit the .index file to remove the files you want to delete
A. Ensure that none of the attached slaves are using any of the binary logs you want to delete
B. Use the command PURGE BINARY LOGS and specify a binary log file name or a date and time to remove unused files
Which two statements are true about InnoDB auto-increment locking?
A. The auto-increment lock can be a table-level lock
B. InnoDB never uses table-level locks
C. Some settings for innodb_autoiinc_lock_mode can help reduce locking
D. InnoDB always protects auto-increment updates with a table-level lock
E. InnoDB does not use locks to enforce auto-increment uniqueness
A. The auto-increment lock can be a table-level lock
C. Some settings for innodb_autoiinc_lock_mode can help reduce locking
Consider the Mysql Enterprise Audit plugin.
A CSV file called data.csv has 100 rows of data.
The stored procedure prepare_db ( ) has 10 auditable statements.
You run the following statements in the mydb database:
Mysql> CALL prepare_db ( );
Mysql> LOAD DATA INFILE /tmp/data.cav INTO TABLE mytable;
Mysql> SHOW TABLES;
How many events are added to the audit log as a result of the preceding statements?
A. 102; top-level statements are logged, but LOAD DATA INFILE is logged as a separate event
B. 3; only the top-level statements are logged
C. 111; top-level statements and all lower-level statements are logged
D. 122; only top-level statements and stored procedure events are logged
B. 3; only the top-level statements are logged
You execute the following statement in a Microsoft Windows environment. There are no conflicts in the path name definitions.
C: > mysqld install Mysql8.0 defaults file = C : \my opts.cnf
What is the expected outcome?
A. Mysqld acts as an MSI installer and installs the Mysql 8.0 version, with the c: \my-opts.cnf as the configuration file
B. MySQL is installed as the Windows service name MySQL 8.0 and uses c: \my-opts.cnf as the configuration file
C. An error message is issued because - install is not a valid option for mysqld
D. A running MySQL 8.0 installation has its runtime configuration updated with the server variables set in c:\myy=opts.cnf
B. MySQL is installed as the Windows service name MySQL 8.0 and uses c: \my-opts.cnf as the configuration file
Consider the events_% tables in performance Schema.
Which two methods will clear or reset the collected events in the tables?
A. Using DELETE statements, for example, DELETE FROM performance_schema.events_waits_current;
B. Using the statement RESET PERFORMANCE CACHE;
C. Using the statement FLUSH PERFORMANCE CACHE;
D. Using TRUNCATE statements, for example, TRUNCATE TABLE performance_schema.events_waits_current;
E. Disabling and re-enabling all instruments
F. Restarting mysql
D. Using TRUNCATE statements, for example, TRUNCATE TABLE performance_schema.events_waits_current;
F. Restarting mysql
Explanation
Tables in the performance_schema database are views or temporary tables that use no persistent on-disk storage.
What are four capabilities of the mysql client program? (Choose four.)
A. Creating and dropping databases
B. Creating, dropping, and modifying tables and indexes
C. Shutting down the server by using the SHUTDOWN command
D. Creating and administering users
E. Displaying replication status information
A. Creating and dropping databases
B. Creating, dropping, and modifying tables and indexes
D. Creating and administering users
E. Displaying replication status information
Assume that you want to know which Mysql Server options were set to custom values.
Which two methods would you use to find out?
A. Check the configuration files in the order in which they are read by the MySQL Server and compare them with default values
B. Check the command-line options provided for the MySQL Server and compare them with default values
C. Check the output of SHOW GLOBAL VARIABLES and compare it with default values
D. Query the INFORMATION_SCHEMA.GLOBAL_VARIABLES table and compare the result with default values
C. Check the output of SHOW GLOBAL VARIABLES and compare it with default values
D. Query the INFORMATION_SCHEMA.GLOBAL_VARIABLES table and compare the result with default values
In a design situation, there are multiple character sets that can properly encode your data.
Which three should influence your choice of character set? (Choose three.)
A. Disk usage when storing data
B. Syntax when writing queries involving JOINS
C. Comparing the encoded data with similar columns on other tables
D. Memory usage when working with the data
E. character set mapping index hash size
C. Comparing the encoded data with similar columns on other tables
D. Memory usage when working with the data
E. character set mapping index hash size
Consider typical High Availability (HA) solutions that do not use shared storage.
Which three HA solutions do not use shared storage? (Choose three.)
A. Mysql Replication
B. Distributed Replicated Block Device (DRBD) and MySQL
C. Windows Cluster and MySQL
D. Solaris Cluster and MySQL
A. Mysql Replication
B. Distributed Replicated Block Device (DRBD) and MySQL
D. Solaris Cluster and MySQL (maybe… I need to check)
Which three statements are characteristic of the MEMORY storage engine? (Choose three.)
A. Each table is represented on disk as an.frm file
B. Each table has a corresponding.MYI and .MYD file
C. It can support foreign keys
D. It cannot contain text or BLOB columns
E. Table contents are not saved if the server is restarted
F. It can support transactions
A. Each table is represented on disk as an.frm file
D. It cannot contain text or BLOB columns
E. Table contents are not saved if the server is restarted
F. It can support transactions
Consider the Mysql Enterprise Audit plugin.
Which statement is true when you identify a connection event that has used external authentication?
A. The attribute “STATUS” is set to the string EXTERNAL_AUTH.
B. The attribute “PRIV_USER” coontains the username
C. The vent type that is given in the attribute “NAME” is EXTERNAL_AUTH.
D. There is no differentiation between native and external authentication events
E. External authentication is managed through external auditing logs.
E. External authentication is managed through external auditing logs.
You are having problems with connections from a specific host (192.168.1.15) not closing down correctly. You want to find the state of the threads from that host check for long-running queries.
Which statement will accomplish this?
A. SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE HOST = ‘192.168.1.15’
B. SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE HOST =’192.168.1.15’
C. SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE HOST =’192.168.1.15’
D. SELECT * FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE HOST = ‘192.168.1.15’
A. SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE HOST = ‘192.168.1.15’
Identify a performance impact when using the Performance Schema.
A. There is no impact on performance
B. There is an overhead for querying the Performance Schema but not for having it enabled
C. There is constant overhead regardless of settings and workload
D. The overhead depends on the settings of the performance schema
D. The overhead depends on the settings of the performance schema
Explanation
Performance Schema is designed to run with minimal overhead. The actual impact on server performance depends on how it is configured
Which statement is true about FLUSH LOGS command?
A. It requires the RELOAD, FILE, and DROP privileges
B. It closes and reopens all log files
C. It closes and sends binary log files to slave servers
D. It flushes dirty pages in the buffer pool to REDO logs
B. It closes and reopens all log files
You want to start monitoring statistics on the distribution of storage engines that are being used and the average sizes of tables in the various databases.
Some details are as follows:
The Mysql instance has 400 databases.
Each database on an average consists of 25-50 tables.
You use the query:
SELECT TABLE_SCHEMA, ENGINE, COUNT(*), SUM(data_length) as total_size FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE =’BASE TABLE’ GROUP BY TABLE_SCHEMA, ENGINE
Why is this query slow to execute?
A. Counting and summarizing all table pages in the InnoDB shared tablespace is time consuming
B. Collecting information requires various disk-level operations and is time consuming
C. Aggregating details from various storage engine caches for the final output is time consuming
D. Collecting information requires large numbers of locks on various INFORMATION_SCHEMA tables
B. Collecting information requires various disk-level operations and is time consuming
Which two events will cause a slave server to create a new relay log file?
A. Starting of the I/O thread
B. Execution of the FLUSH LOGS statement
C. Starting of the SQL thread
D. Reaching the slave_pending_jobs_size_max limit
E. Execution of FLUSH TABLES WITH READ LOCK
A. Starting of the I/O thread
B. Execution of the FLUSH LOGS statement
The InnoDB engine has a feature known as clustered indexes.
Which three statements are true about clustered indexes as used in InnoDB? (Choose three.)
A. A primary key must exist for creation of a cluster index
B. A primary key is used as a clustered index
C. A clustered index is a grouping of indexes from different tables into a global index for faster searching
D. If no indexes exist, a hidden clustered index is generated based on row IDs.
E. A clustered index provides direct access to a page containing row data
F. The first unique index is always used as a clustered index and not a primary key
G. A clustered index allows fulltext searching within InnoDB
B. A primary key is used as a clustered index
D. If no indexes exist, a hidden clustered index is generated based on row IDs.
E. A clustered index provides direct access to a page containing row data