Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Microsoft C# Professional Projects - Premier Press.pdf
Скачиваний:
177
Добавлен:
24.05.2014
Размер:
14.65 Mб
Скачать

ADMINISTERING THE APPLICATION

Chapter 24

557

 

 

 

 

FIGURE 24-4 The Select Source Tables and Views screen of the DTS Import/Export Wizard

7.Check the dtDepartedFlights table and click on Next. The Save, schedule, and replicate package screen will appear.

8.To run the DTS task immediately, click on Next. The Completing the DTS Import/Export screen will appear.

9.Click on Finish to run the DTS task.

While the DTS task executes successfully, the Execute Package dialog box is open. When the task is complete, a dialog box appears signifying the successful execution of the DTS task. Click on OK to close the dialog box and then click on Done to close the Execute Package dialog box.

After you copy data from the dtDepartedFlights table, you can delete the data in this table from the SkyShark database.

Examining Database Logs

Every activity in SQL Server is logged in a log file. You can examine these log files on a periodic basis to track all activities on the database and identify any errors that SQL Server might encounter. To view the SQL Server log files, follow these steps:

1.In Enterprise Manager, double-click on Management under the entry for the SQL Server for which you want to view log files.

558Project 4 CREATING AN AIRLINE RESERVATION PORTAL

2.Under Management, click on SQL Server Logs. The SQL Server logs appear in the right pane, as shown in Figure 24-5.

FIGURE 24-5

 

 

Y

 

L

 

F

 

M

 

A

 

E

 

T

 

 

Viewing the SQL Server log files

 

3.To view any log file, double-click on the log file. The information logs in the log file that you select will appear. You can view these entries to detect any error in your databases.

Scheduling Database Maintenance Tasks

Having examined how to back up databases and analyze SQL Server log files, you can examine how to create scheduled database maintenance tasks so that the process of backing up databases is automated. To create a maintenance task for the SkyShark database, follow these steps:

1.Right-click on the name of the database in Enterprise Manager and select the Maintenance Plan menu option from the All Tasks menu. The Database Maintenance Plan Wizard will be launched.

2.On the Welcome screen of the wizard, click on Next. The Select Databases screen of the wizard will appear. Notice that the SkyShark database is already selected.

Team-Fly®

ADMINISTERING THE APPLICATION

Chapter 24

559

 

 

 

 

3.Click on Next until you reach the Specify the Database Backup Plan screen.

4.On the Specify the Database Backup Plan screen, click on Change to specify a schedule for backing up databases. The Edit Recurring Job Schedule screen will appear.

5.On the Edit Recurring Job Schedule screen, specify the schedule to back up databases. For example, I have created a schedule to back up the database daily at 12:00 A.M., as shown in Figure 24-6.

FIGURE 24-6 Specifying a schedule to back up databases

6.Click on OK.The Specify the Database Backup Plan screen will reappear. Click on Next to continue.

7.Click on Next until you reach the Completing the Database Maintenance Plan Wizard screen.

8.On the Completing the Database Maintenance Plan Wizard screen, specify a name for the maintenance plan or retain the default name and click on Finish.

The maintenance tasks that you schedule are listed in the Database Maintenance Plans section of Enterprise Manager as shown in Figure 24-7.