Workshop

The quiz and exercises are provided to help you solidify your understanding of the material covered today. Try to understand the quiz and exercise answers before continuing to tomorrow's lesson.

Quiz

1:

True or False: myisamchk can only check and repair tables.

A1: False. myisamchk can also be used to optimize tables. It can reclaim wasted space and re-sort indexes and data records.
2:What is the SQL command for repairing a table?
A2: REPAIR TABLE

Exercises

1:Write a myisamchk command that performs a table repair that attempts to fix indexes only.
A1: You should have this:
myisamchk -r -q table_name

or this:

myisamchk --recover --quick table_name

2:Write a myisamchk command that performs a table repair that attempts to fix indexes and data files.
A2: You should have this:
myisamchk -r table_name

or this:

myisamchk --recover table_name
									

3:Write a myisamchk command that reveals how much wasted space you have in a table.
A3: You should have this:
myisamchk table_name

4:Write a myisamchk command that optimizes all tables in all databases on your server. It should recover wasted space and sort indexes. (Assume that your data is in /usr/local/mysql/var/.)
A4: You should have this:
myisamchk -r -S /usr/local/mysql/var/*/*

or this:

myisamchk --recover --sort-index /usr/local/mysql/var/*/*

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.188.121