Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

iLab 4: Using Backups for Complete Recovery

Scenario and Summary

Successful database recovery relies on the database being backed. This is what enables the database to recover data that were lost due to a media failure, loss of power, or any other type of disaster. Each time the online line redoes logs filled up in a log group, the DBMS issues a log switch that will move the log writer process from the current redo log group to the next one in line. The archive background process begins archiving the data in the full online log group files to the archive log files. This is done simultaneously for each log file in the group. If media recovery is needed at the time that the database needs recovery, then the DBMS will search through the archived log files to find the ones that need to be used.

In Part 1, you will use mysqldump command to dump database, expand tables, and restore database.

In Part 2, you will use MySQL Workbench to back up, expand tables, and restore the database.

Note: Be sure that you are making screenshots and save in Lab4 Report.

Part 1: Take Dump/Backup and restore database using command line

Step 1
Taking a backup of the database

Step 2
Expand table

Step 3
Restore and recover the database

Part 2: Backup and Recovery using MySQL Workbench

Step 1
Taking a backup of the database using Export to Dump Project Folder

Step 2
Taking a backup of the database using Export to self-contained file

Step 3
Expand table

Step 4
Restore database using Import from Dump Project Folder

Step 5
Expand table

Step 6
Restore database using Import from self-contained file

iLAB STEPS

Part 1: Take Dump/Backup and Restore Database Using Command Line

Step 1: Taking a Backup of the Database

1. Go to MySQL Command line - Unicode and enter password.

2. There are several databases here now. To list them, type:
Mysql>show databases;

3. Identify required database;
You have to make database backup to be used later to restore.

4. Confirm the location of mysqldump utility on your local machine.
Usually, it is:
C:\Program Files\MySQL\MySQL Server5.6\bin

5. Go to Start - Accessories - Point to Command Prompt and right-click on Run as administrator (to be able to have all types of access on PC).

6. Set up location using cd command: type in Command prompt:
C:\user username>cd C:\ and press Enter
C:\>cd Program Files and press Enter
C:\\Program Files> cd MySQL and press Enter.
C:\Program Files\MySQL>cd MySQL Server5.6\ and press Enter.
C:\Program Files\MySQL\MySQL Server5.6>cd and press Enter.

7. Use mysqldump utility.
a) In Command prompt, type:
Mysqldump -uroot -p databasename > c:\backup file name with extension .sql
For example: "c:\mis561.sql"
Where sign > means to take output (from the left part) and put into the input (right part). All SQL instructions will be written to back-up file.
Note: The location of back-up file has to be enclosed into the double quotes.

Example:
C:\Program Files\MySQL\MySQL Server5.6\bin>Mysqldump -uroot -p databasename >c:\ backup file name with extension .sql
b) Enter password; press Enter;
c) In case of error Could not execute SELECT @@GTID_Mode, re-type with GTID options:
Mysqldump -uroot -p -set-gtid-purged=OFF databasename > "c:\backup file name with extension .sql"
d) Enter password;
Please note that c) and d) are needed only in case of error.
Save screenshot
e) To verify back-up file:
Start -All programs-Computer-Local Disk (C)-backup file.sql
Save screenshot

8. Go to MySQL Command line - Unicode Using DESCRIBE statement show the columns in the table
Mysql>describe databasename.tablename;
Save screenshot
Step 2 Expand table

1. Using ALTER command add 2 columns to the table
Mysql>ALTER table databasename.tablename
ADD col1 varchar(10);
Save screenshot

2. Using DESCRIBE statement show the columns in the table
Mysql>describe databasename.tablename;
Save screenshot

Step 3 Restore and recover the database
1. Go to Start- Accessories - Point to Command Prompt and right click on Run as administrator (to be able to have all types of access on PC)
2. Set up the location: type in Command prompt:
C:\user username>cd C:\ and press Enter
C:\>cd Program Files and press Enter
C:\\Program Files> cd MySQL and press Enter
C:\Program Files\MySQL>cd MySQL Server5.6\ and press Enter
C:\Program Files\MySQL\MySQL Server5.6>cd bin and press Enter

3. Type:
C:\Program Files\MySQL\MySQL Server5.6\bin>Mysql -uroot -p databasename < "c:\backup file name with extension .sql"
Where sign < means to take output (from the right part) and put into the output (left part). Database will be restored.

Note: The location of backup file has to be enclosed into the double quotes.
Save screenshot

4. Go to MySQL Command line - Unicode Using DESCRIBE statement show the columns in the table
Mysql>describe databasename.tablename;
Save screenshot

Part 2 Backup and Recovery using MySQL Workbench
To Backup database
1. Start MySQL Workbench
2. Connect to database and Test connection
3. Double click on Connections to connect the database; Enter Password
4. On Navigator panel under the Management click ‘Data Export', enter password
5. On Data Export screen highlight the database name and check it;
6. Click Select tables button if you want to back up the entire database;
7. There are 2 options to save backup file.

Option 1
· Export to Dump Project Folder. Choose this option and back up all tables. Click Start Export, enter password, and review created .sql files (separated for each table in database). It allows you to restore the selected tables in a future. Save screenshots.
· Close Administration - Data Export tab.
· Go to the Windows Employer, review folder dumps content. Save screenshots.

Option 2
Repeat steps 5 and 6.
· Export to Self-contained file. All tables in database will be stored in one file. Choose this option and give the unique name to the backup file to help you to identify file in a future. Click Start Export, enter password.
· Save screenshots
· When export is finished, close Administration - Data Export tab.
· Go to the Windows Employer, review folder dumps content. Save screenshots.

8. Expand table Employee by adding 2 columns. Please use Query 1 screen.
Hint: Add columns using ALTER command. Highlight query, choose Query in toolbar and click Execute current statement
- Save screenshots

9. Show new table
- Click icon Create new SQL tab for executing queries (located under the File) to display expanded table.
Hint: Use DESCRIBE statement. Highlight query, choose Query in toolbar and click Execute current statement
- Save screenshots
To Restore database

10. Click on Data Import/Restore, enter password

Option 1
a. Choose Import from Dump Project Folder and insure that the file location is correct
b. Select Schema on Select Database object to Import (only available for project folders)
c. You have an option to select which table to restore and click Start Import; enter Password
d. Save screenshot with successful completion
e. Close Administration - Data Import/Restore tab
f. Click icon Create new SQL tab for executing queries (located under the File) to display restored table.
g. Save screenshot

Option 2

11. Repeat Step 8, Step 9 and Step 10. Enter password

12. Now, restore from Import from Self-contained file
a. Choose Import from Self-contained file
b. Select file you want to restore
c. Click on Start Import; enter password;
d. Save screenshot with successful completion
e. Close Administration - Data Import/Restore tab
f. Click icon Create new SQL tab for executing queries (located under the File) to display restored table.
g. Save screenshot
This concludes the Lab for Week 4

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91592618
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question 1 complete the lab 9-5 programming challenge 1 --

Question: 1. Complete the Lab 9-5, "Programming Challenge 1 -- Going Green," of Starting Out with Programming Logic and Design. Note: You are only required to create the flowchart for this activity; however, notice how t ...

Question suppose that your uncle is a real estate agent and

Question : Suppose that your uncle is a real estate agent and he decided to have a web-site to list his available real estate properties. And use a laptop computer to show clients these properties. What hardware is neede ...

Question suppose that the head of a disk with 256 tracks

Question : Suppose that the head of a disk with 256 tracks, numbered 0 to 255, is currently serving a request at track 58. The previously served request was at a lower-numbered track (i.e., the head is currently moving f ...

Come with an app that only runs in horizontal orientation

Come with an app that only runs in horizontal orientation. It displays "This is fun!" on the top left corner of the screen with no margin either from the top or the left.

Question suppose you transferred three packets each

Question : Suppose you transferred three packets each containing 1000 bytes of data from one system to another. The entire process took 1 minute and 20 seconds. What is the data rate (bits/sec) of this transmission? Can ...

Write a program that populates an array named weekday from

Write a program that populates an array named weekday from the string SunMonTueWedThuFriSat, and then prints each day in uppercase. PERL Language

Can someone design a small program for me in java that do

Can someone design a small program for me in Java that do the following: Implement at least four classes (showing inheritance) with suitable constructors and methods to set/retrieve values of from the properties. Try to ...

You have been recently hired as a senior database

You have been recently hired as a senior database administrator. Your organization has many SQL Server databases that run various applications. Your manager has asked you to present to the junior database administrators ...

Phosphorus pentachloride decomposes according to the

Phosphorus pentachloride decomposes according to the chemical equation PCl5 (g) ---------> PCl3 (g) + Cl2 (g) Kc = 1.80 at 250 degrees C A 0.361 mol sample of PCl5(g) is injected into an empty 4.80 L reaction vessel held ...

System analysis and designbarbara singleton manager of

system analysis and design. Barbara Singleton, manager of western regional sales at the WAMAP Company, requested that the IS department develop a sales force management and tracking system that would enable her to better ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As