Hands-On Microsoft SQL Server 2008 Integration Services part 24 ppt

10 238 0
Hands-On Microsoft SQL Server 2008 Integration Services part 24 ppt

Đang tải... (xem toàn văn)

Thông tin tài liệu

208 Hands-On Microsoft SQL Server 2008 Integration Services Transfer Master Stored Procedures Task The Transfer Master Stored Procedures task copies user-defined stored procedures that are stored in the master database of the source SQL Server instance to the master database of the destination SQL Server instance. Following are the steps you would take to configure this task: 1. Specify the name and the description for the task in the General page of the editor window. 2. Specify the source and destination connections using the SMO Connection Manager. Figure 5-27 Configuration options for the Transfer Logins task Chapter 5: Integration Services Control Flow Tasks 209 3. Choose to copy all or specific stored procedures defined in the master database in the TransferAllStoredProcedures field. You can select the stored procedures from the list in the StoredProceduresList field if you choose to transfer only the specific stored procedures (see Figure 5-28). 4. Finally, you can choose to fail the task or overwrite the stored procedures or skip over the stored procedures that already exist at the destination. 5. The Expressions page can be used to modify any property at run time using property expressions. Figure 5-28 Configuration options for Transfer Master Stored Procedures task 210 Hands-On Microsoft SQL Server 2008 Integration Services Transfer SQL Server Objects Task The Transfer SQL Server Objects task transfers SQL Server objects such as Schema, Tables, Primary Keys, and so on, along with other types of objects from the source SQL Server instance to the destination SQL Server instance. Following are the steps you perform to configure the options for this task: 1. Specify the name and the description for the task in the General page of the editor window. 2. In the Objects page, configure source connection and the destination connection using the SMO Connection Manager. Choose the source database and the destination database from the list provided in the database fields of the relevant connections. 3. All the remaining options are binary options for which you select True or False to indicate the acceptance for the option or otherwise. For the options that you don’t want to apply to all the objects, select False as a choice. The default is False in all the options. 4. In the Destination Copy Options section, indicate whether you want the task to copy all objects or specific objects. If you select False, the ObjectsToCopy field becomes available for you to choose the objects you want to copy. When you expand this field, you will see a list of objects categorized based on the type of object. For each of the object types in the category list, you can choose either to copy all the objects of that type or to select from the collection provided in the List field. The object types you can choose here are Tables, Views, Stored Procedures, User Defined Functions, Defaults, User Defined Data Types, Partition Functions, Partition Schemes, SQL Assemblies, User Defined Aggregates, User Defined Types, XML Schema, and Schema (see Figure 5-29). 5. In the Destination section, you can choose to drop objects at the destination server before the transfer, determine whether the extended properties are to be transferred, choose to copy a schema or to include a collation in the transfer, and choose whether to include the dependent objects in the transfer. You can choose to copy data and then can also select to replace the existing data or append to the existing data. 6. In the Security section, you can select whether to transfer the database users, database roles, SQL Server logins, and object-level permissions. 7. In the Table options section, you can select to include Indexes, Full-Text Indexes, Triggers, Primary Keys, Foreign Keys, and all data referential integrity (DRI) objects in the transfer. You can also specify whether the script generated by this task to transfer the object is in Unicode format. 8. Finally, you can use the Expressions page to modify any property at run time using property expressions. Chapter 5: Integration Services Control Flow Tasks 211 Figure 5-29 Configuration options for Transfer SQL Server Objects task 212 Hands-On Microsoft SQL Server 2008 Integration Services Back Up Database Task The Back Up Database task uses the BACKUP DATABASE statement to perform different types of SQL Server database backups. Using the Back Up Database task, a package can back up a single database or multiple databases. Following is the step-by- step method to configure this task: 1. Specify a connection to the SQL Server using the ADO.NET Connection Manager in the Connection field. Choose the databases you want to back up in the Databases field from the available options: All databases, System databases (master, msdb, model), All user databases (excluding master, msdb, model, and tempdb) or select databases from the available list. You can choose to ignore the databases that are not online at the time this task is run. 2. Specify the Backup type by selecting from the available options of Full, Differential, or Transaction Log. 3. If you’ve selected a single database for backup, you can choose the backup component by choosing Database or its files and filegroups. 4. Specify the destination where you want to back up the database. The available options are Disk and Tape. 5. Choose to back up databases across one or more files or choose to back up each database to a separate file (see Figure 5-30). Configure available options in either method. 6. Select to verify the integrity of the backup files. 7. You can also choose to compress the backup based on the default server setting or as specified in the task. You can see the T-SQL command that this task will send to the server by clicking View T-SQL. Chapter 5: Integration Services Control Flow Tasks 213 Figure 5-30 Configuration settings for the Back Up Database task Check Database Integrity Task The Check Database Integrity task uses DBCC CHECKDB statement to check the allocation and structural integrity of all the objects in the specified databases. The GUI interface of the task is simple to configure (refer Figure 5-31): 1. Specify a connection to the SQL Server using the ADO.NET Connection Manager in the task editor. 214 Hands-On Microsoft SQL Server 2008 Integration Services Choose the databases from Databases field. When you click the down arrow in the field, following list of options appear: All Databases, System Databases (master, msdb, model), All User Databases (excluding master, msdb, model, and tempdb) or select databases from the provided list. You can choose either a single database or multiple databases and can also choose to ignore the databases that are not online at the time this task is run. 2. Finally, you can also specify whether to include the database indexes in the integrity check as well. Execute SQL Server Agent Job Task The Execute SQL Server Agent Job task runs jobs configured in the SQL Server Agent. You can create a variety of jobs under the SQL Server Agent. For example, the jobs can be ActiveX script jobs or replication jobs, which can be run from within the SSIS package using this task. The SQL Server Agent is a Windows service and must be running for jobs to run automatically. The task interface is intuitive and easy to configure, as you can make out from Figure 5-32. After you specify a connection to the SQL Server, the task reads the SQL Server Agent jobs from the specified SQL Server and lists them under the Available SQL Server Agent Jobs area. You then select the job you want to run from the list provided. Figure 5-31 Checking the Database Integrity Task interface Chapter 5: Integration Services Control Flow Tasks 215 Execute T-SQL Statement Task Using the Execute T-SQL Statement task, you can run Transact-SQL (T-SQL) statements against the specified database. This task supports only the T-SQL version of the SQL language and cannot be used to run statements on the servers that use other dialects of the SQL language. The Execute T-SQL Statement task cannot run parameterized queries and cannot save result sets to variables. This is a lightweight task and is mainly designed to run maintenance T-SQL commands against SQL Server. While SSIS provides many other maintenance tasks for SQL Server, having an ability to send T-SQL commands directly to the SQL Server enables you to achieve the desired results quickly and efficiently. This task is quite simple to configure, as you can see from Figure 5-33. You specify a connection to the SQL Server in the Connection field and type your T-SQL command in the space provided. Optionally, you can specify an execution timeout value to the task. Figure 5-32 Interface for the Execute SQL Server Agent Job task 216 Hands-On Microsoft SQL Server 2008 Integration Services History Cleanup Task When the SQL Server Agent runs a job, it keeps the history about each run in the MSDB database. Over a considerable period of time the job history can fill up the MSDB database with lot of unwanted data. The tables of the MSDB database that get affected are backupfile, backupfilegroup, backupmediafamily, backupmediaset, backupset, restorefile, restorefilegroup, and restorehistory. The History Cleanup task enables a package to delete the historical data stored in these tables of MSDB database for backup and restore activities, SQL Server Agent jobs, and database maintenance plans. Here’s the step-by-step configuration method for this task: 1. Connect to the SQL Server using the ADO.NET (SqlClient Data Provider) Connection Manager. 2. Choose the historical data that you want to delete. The available options are: Backup and restore history, SQL Server Agent job history, and Maintenance plan history (Figure 5-34). 3. Specify the time period for which you want to retain the data. You can specify the time period by number of days, weeks, months, or years from the date the task is run. Figure 5-33 Interface for the Execute T-SQL Statement task Chapter 5: Integration Services Control Flow Tasks 217 Maintenance Cleanup Task While the History Cleanup task removes the stale data such as job history or backup and restore activity from the tables in the MSDB database, the Maintenance Cleanup task deletes database backup files or Maintenance Plan text report files for the time period specified. Here are the steps you can take to configure this task: 1. In the user interface, specify a connection to the server using the ADO.NET (SqlClient Data Provider) Connection Manager. 2. Choose the type of files you want to delete from the available backup files or Maintenance Plan text reports options (Figure 5-35). 3. Specify a folder to look for the type of files selected in the preceding step, or point the task to the specific file. Optionally, you can choose to include first-level subfolders. 4. Specify a value for the time period for which you want to keep files. You can specify this value by providing a number, and unit of time in day, week, month, or year. Figure 5-34 History Cleanup task options . Stored Procedures task 210 Hands-On Microsoft SQL Server 2008 Integration Services Transfer SQL Server Objects Task The Transfer SQL Server Objects task transfers SQL Server objects such as Schema,. expressions. Chapter 5: Integration Services Control Flow Tasks 211 Figure 5-29 Configuration options for Transfer SQL Server Objects task 212 Hands-On Microsoft SQL Server 2008 Integration Services Back. task. Figure 5-32 Interface for the Execute SQL Server Agent Job task 216 Hands-On Microsoft SQL Server 2008 Integration Services History Cleanup Task When the SQL Server Agent runs a job, it keeps the

Ngày đăng: 04/07/2014, 15:21

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan