Question

In: Computer Science

MySQL Multiple Choice Answer as soon as possible 1. Which one of the following is not...

MySQL
Multiple Choice
Answer as soon as possible

1. Which one of the following is not a Replication Data Format?
(a) Row
(b) Mixed
(c) Statement
(d) Sync

2. When executing the following statement on the master:
UPDATE enormous_table SET col1 = 0;
Which replication format would be more efficient?
(Assume enormous_table is a large table with millions of rows)
(a) Statement
(b) Row
(c) Neither

3. When executing the following statement on the master:
INSERT INTO summary_table(col1, col2, sum_col3)
SELECT col1, col2, sum(col3)
FROM enormous_table
GROUP BY col1, col2;
Which replication format would be more efficient?
(Assume enormous_table is a large table with millions of rows)
(a) Statement
(b) Row
(c) Neither

4. Which one of the following is a way to detect if there is an error replicating data on the slave?
(a) Run SHOW MASTER STATUS and Look for an error description in LAST_SQL_ERROR in the results.
(b) Run SHOW MASTER STATUS and Look for an error description in INVALID_COMMAND_FOUND in the results.
(c) Run SHOW SLAVE STATUS and Look for an error description in INVALID_COMMAND_FOUND in the results.
(d) Run SHOW MASTER STATUS and Look for an error description in SYNCING = NO in the results.
(e) Run SHOW SLAVE STATUS and Look for an error description in LAST_SQL_ERROR in the results.

5. Which one of the following is the correct command to skip the next command in the binlog on the slave (this is sometimes used to skip a command that is causing a replication error)?
(a) SET GLOBAL SQL_SLAVE_SKIP = YES;
(b) SET GLOBAL SQL_SLAVE_SKIP_COMMANDS = 1;
(c) SET GLOBAL SQL_SLAVE_SKIP_ON_ERROR = YES;
(d) SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;

6. Which one of the following is the command for temporarily disabling the binlog on the master so you can run a statement without it getting replicated to the slave(s)?
(a) SET REPLICATE_TO_SLAVE = NO;
(b) SET SQL_LOG_BIN = 0;
(c) SET ENABLE_BINLOG = 0;
(d) SET DISABLE_BINLOG = YES;

Solutions

Expert Solution

Find the answers below for your questions:

1. Replication data formats available for replicating databases from master to slave are statement based, row based, mixed format based.

Statement based replication :in this method the binary log stores the SQL statements used to store the databases on the master server. The slave reads this data and reexecutes these SQL statements.

Row based replication: in this method the binary log stores the record level changes occurred at master side and the slave reads this data and manipulates it's records.

Mixed based replication: in this method the server can either choose statement based or row based replication method dynamically depending on certain conditions.

Conclusion: hence a,b,c are proper replication data formats. d is not a replication data format.

2. Given statement : update enormous_table set col1 =0

It is more efficient to use statement based replication method rather than row based due to following reasons:

a. Update statement is single statement where it can update the whole rows using one statement. If we execute the same statement in the slave then the data will exactly replicated in slave similar to slave.

b.it is said that there are millions of rows in that table hence if we use row based all these records needs to be saved in binary log and slave will fetch it and executes it. So it will be better if we go with statement based as we can log only this statement and execute it.

Hence option a is efficient

3. The insert statement specified in the question 3 groups the vaues of the table and inserts summary data.

If we go with statement based replication then when the same above statement if executed in slave may result in different output than master data as there is no order by clause in the select Statement. Hence the select statement might retrieve data in different order and stores in slave assuming there is auto increment field.

So in this case row based replication is suitable as it logs all the records and when slave executes these records , we get correct copy of data in slave.

Hence we go with option b

4. Command : SHOW MASTER STATUS is used to know the information about binary log file in master server as we want the information of a slave server.Hence options a,b,d are wrong.

For slave the command is SHOW SLAVE STATUS

As there is no invalid_command_found field returned by above command option c is wrong.

Option d is the correct one as the error message when detected will be stored in Last_SQL_Error field .

5. option d is correct one for skipping the replicated errors as per the command provided

6. For temporarily disabling the binlog on the master we use command

SET SQL_LOG_BIN=0 . If this value is 1 then it will enable to log in the binlog. By default it will be 1 .

Hence option b is correct as per the syntax and command provided.


Related Solutions

MySQL Multiple Choice Answer as soon as possible 1. Why is it important to check the...
MySQL Multiple Choice Answer as soon as possible 1. Why is it important to check the replication status regularly by running SHOW SLAVE STATUS on the slave? (a) Running SHOW SLAVE STATUS cleans up the binary and relay logs that are not in use. (b) Running SHOW SLAVE STATUS syncs all tables where the data is different from the Master and Slave. (c) Replication can have an error at any time and if you don't run SHOW SLAVE STATUS regularly...
MySQL Multiple Choice Answer as soon as possible 1. Why is it important to check the...
MySQL Multiple Choice Answer as soon as possible 1. Why is it important to check the replication status regularly by running SHOW SLAVE STATUS on the slave? (a) Running SHOW SLAVE STATUS cleans up the binary and relay logs that are not in use. (b) Running SHOW SLAVE STATUS syncs all tables where the data is different from the Master and Slave. (c) Replication can have an error at any time and if you don't run SHOW SLAVE STATUS regularly...
A question on a proficiency test is multiple choice with five possible answers, one of which...
A question on a proficiency test is multiple choice with five possible answers, one of which is correct. Assuming that all responses are random guesses, find the probability that among 13 test subjects, at least five answer the question correctly. (a) .027        (b) .099        (c) .103         (d) .053        (e).901 show how to use on a TI-84
For each question on a multiple-choice test, there are five possible answers of which exactly one...
For each question on a multiple-choice test, there are five possible answers of which exactly one is correct for each question. Assume there are 10 questions on the test and a student selects one answer for each question at random. Let X be the number of correct answers he or she gets. a) How is X distributed? (Specify the values of the corresponding parameters). b) Find P(X < 6) and P(X = 6). c) Find E(X) and V ar(X). 2....
Stuck on the following questions. Multiple choice. One answer for each. 1. The primary goal of...
Stuck on the following questions. Multiple choice. One answer for each. 1. The primary goal of a publicly-owned firm interested in serving its stockholders should be to: -Minimize the chances of losses -Maximize share price -Minimize expected EPS -Minimize shareholder wealth -Maximize expected total corporate profit 2. Which one of the following is an agency cost? -Cost of dividend payments to stockholders -Cost of interest payments to bondholders -Cost of an internal audit required by bondholders -Cost of wages for...
QUESTION 1 (10 marks) Answer the following multiple-choice questions. Indicate your choice by selecting only one...
QUESTION 1 Answer the following multiple-choice questions. Indicate your choice by selecting only one option from the four options given for each question answered. (a) Which one of the following is not considered to be an enhancing qualitative characteristic to ensure the usefulness of information that is already relevant and faithfully represented in terms of The Conceptual Framework for Financial Reporting 2018? 1) Completeness; 2) Comparability; 3) Timeliness; 4) Understandability. (b) Which one of the following is not an objective...
Can someone please answer as soon as possible _THANKS Which of the following statements about perceptual...
Can someone please answer as soon as possible _THANKS Which of the following statements about perceptual benefits conveyed by a product's packaging and labeling is false? Select one: a. The legal requirements for the conveyance of information are an important component of perceptual benefits. b. Changes in packaging and labeling can update or uphold a brand's image in consumers' minds. c. Packaging and labeling have been shown to enhance brand recognition and facilitate the formation of strong, favorable, and unique...
Please answer the multiple choice question. Only choose one answer choice. Then write an IRAC answer...
Please answer the multiple choice question. Only choose one answer choice. Then write an IRAC answer about the issue that is being tested. Peter built a small pond in front of his house for his prize koi fish. The pond was visible from the sidewalk. To keep people and animals away, Peter constructed an eight-foot high chain link fence between the sidewalk and the pond. One day, Stewie, a six-year­ old who lived next door, struggled over the fence to...
Answer the following statements as true or false, then select the correct multiple -choice answer:   1.   If...
Answer the following statements as true or false, then select the correct multiple -choice answer:   1.   If dividends are declared during the year the company would close the dividend account by debiting retained          earnings and crediting the dividend account.   2.   A company that forgets to recognize depreciation for the year understates its income and assets.   3.   Prepaid insurance expense will have a zero balance on the after closing trial balance.   4.   Retained earnings on an adjusted trial balance is the beginning retained earnings for...
Please answer as soon as possible. Q1: Which of these grants medical staff privileges to a...
Please answer as soon as possible. Q1: Which of these grants medical staff privileges to a physician in a hospital setting? The Center for Medicare and Medicaid Services (CMS) The Hospital's Graduate Education Committee The State Medical Board The Hospital Board and Medical Staff Committee Q2: Which branch of federal government contains the apparatus for resolving legal disputes over constitutional law? Q3: HRSA manages programs that manage/impact the                      of healthcare professionals. Q4: The Texas Medical Association's policy position on regulations...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT