Lab 9

advertisement
1. Database Backup and Restore
NOTE: Record the Start Date timestamp in ‘Lab 9 Answer’ document for each backup.
You can find the Start Date timestamp by right clicking your database  Tasks 
Restore  Database …. It is in the ‘Backup sets to restore’ window.
a. Backup your team database (full database backup)
b. Backup your team database transaction log
c. Insert the following records into the tables
i. tblSisterCity
Sidney BC, Canada: Sidney is located at the southeast end of Vancouver Island, just north of
Victoria and adjacent to the world famous Butchart Gardens. It has a population of 11,483. Its
current mayor is Steve Price. Its website is http://www.sidney.ca/.
ii. tblCommittee:
Committee
Monthly
Budgeted
Expenditures to Committee
Name
Meeting Time
Expenditures
Date
Type
Summer
1st Monday 3 PM 5000
1000
S
Music
Festival at
the Bay
Sidney
3rd Tuesday 2 PM 1000
500
C
iii. tblSupportCommittee
City government contact
Parks and Rec. Dir.
Mission Statement
Promote Bellingham through
music events
iv. tblSisterCityCommittee
City
Top project
Sidney
Establish
relationship
Most recent
visit to city
2015-5-10
Most recent
visit from city
2015-4-24
Next visit
to city
2015-6-16
Next visit from
city
2015-7-17
d. Backup the transaction log
e. Delete the city Sidney from the tblSisterCity table (what happened? Explain why that
happened in the document titled ‘Lab 9 Answers’)
f. Delete the committee for Sidney from the tblCommittee table (what happened? Explain
why that happened in the document titled ‘Lab 9 Answers’)
g. Delete the city committee for Sidney from the tblSisterCityCommittee
h. Delete the committee for Sidney from the tblCommittee table again (what happened?
Explain why that happened in the document titled ‘Lab 9 Answers’)
i. Delete the city Sidney from the tblSisterCity table again (what happened? Explain why
that happened in the document titled ‘Lab 9 Answers’)
j. Backup the transaction log
k. Restore the deleted records so that the information for the city Sidney and the
committee for the city Sidney is restored in relevant tables. Make sure to choose the
right backups for the results
2. Index Impact Estimation
Given the following set of scripts, discuss how to improve each script’s performance using index.
Describe your strategy to improve the performance in the ‘Lab 9 Answers’ document.
--The scripts
select * from Person.Person where PersonType = 'EM';
select LastName, FirstName, PersonType from Person.Person where LastName LIKE
'%Smith%' ORDER BY LastName ;
select distinct LastName, FirstName, MiddleName from Person.Person;
3. Leave the created indexes in your database. Submit your ‘Lab 9 Answers’ document via Canvas.
Download