1. Trang chủ
  2. » Công Nghệ Thông Tin

Microsoft SQL Server 2008 R2 Unleashed- P218 pdf

10 393 0

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

THÔNG TIN TÀI LIỆU

Cấu trúc

  • Table of Contents

  • Introduction

  • Part I: Welcome to Microsoft SQL Server

    • 1 SQL Server 2008 Overview

      • SQL Server Components and Features

      • SQL Server 2008 R2 Editions

      • SQL Server Licensing Models

      • Summary

    • 2 What’s New in SQL Server 2008

      • New SQL Server 2008 Features

      • SQL Server 2008 Enhancements

      • Summary

    • 3 Examples of SQL Server Implementations

      • Application Terms

      • OLTP Application Examples

      • DSS Application Examples

      • Summary

  • Part II: SQL Server Tools and Utilities

    • 4 SQL Server Management Studio

      • What’s New in SSMS

      • The Integrated Environment

      • Administration Tools

      • Development Tools

      • Summary

    • 5 SQL Server Command-Line Utilities

      • What’s New in SQL Server Command-Line Utilities

      • The sqlcmd Command-Line Utility

      • The dta Command-Line Utility

      • The tablediff Command-Line Utility

      • The bcp Command-Line Utility

      • The sqldiag Command-Line Utility

      • The sqlservr Command-Line Utility

      • Summary

    • 6 SQL Server Profiler

      • What’s New with SQL Server Profiler

      • SQL Server Profiler Architecture

      • Creating Traces

      • Executing Traces and Working with Trace Output

      • Saving and Exporting Traces

      • Replaying Trace Data

      • Defining Server-Side Traces

      • Profiler Usage Scenarios

      • Summary

  • Part III: SQL Server Administration

    • 7 SQL Server System and Database Administration

      • What’s New in SQL Server System and Database Administration

      • System Administrator Responsibilities

      • System Databases

      • System Tables

      • System Views

      • System Stored Procedures

      • Summary

    • 8 Installing SQL Server 2008

      • What’s New in Installing SQL Server 2008

      • Installation Requirements

      • Installation Walkthrough

      • Installing SQL Server Using a Configuration File

      • Installing Service Packs and Cumulative Updates

      • Slipstream Installations

      • Summary

    • 9 Upgrading to SQL Server 2008

      • What’s New in Upgrading SQL Server

      • Using the SQL Server Upgrade Advisor (UA)

      • Destination: SQL Server 2008 or SQL Server 2008 R2

      • Upgrading Using a Configuration File

      • Slipstreaming Upgrades

      • Upgrading Other SQL Server Components

      • Summary

    • 10 Client Installation and Configuration

      • What’s New in Client Installation and Configuration

      • Client/Server Networking Considerations

      • Client Installation

      • Client Configuration

      • Client Data Access Technologies

      • Summary

    • 11 Security and User Administration

      • What’s New in Security and User Administration

      • An Overview of SQL Server Security

      • Authentication Methods

      • Managing Principals

      • Managing Securables

      • Managing Permissions

      • Managing SQL Server Logins

      • Managing SQL Server Users

      • Managing Database Roles

      • Managing SQL Server Permissions

      • The Execution Context

      • Summary

    • 12 Data Encryption

      • What’s New in Data Encryption

      • An Overview of Data Security

      • An Overview of Data Encryption

      • SQL Server Key Management

      • Column-Level Encryption

      • Transparent Data Encryption

      • Column-Level Encryption Versus Transparent Data Encryption

      • Summary

    • 13 Security and Compliance

      • Exposure and Risk

      • Across the Life Cycle

      • The Security Big Picture

      • Identity Access Management Components

      • Compliance and SQL Server

      • SQL Server Auditing

      • Setting Up Auditing via T-SQL

      • SQL Injection Is Easy to Do

      • Summary

    • 14 Database Backup and Restore

      • What’s New in Database Backup and Restore

      • Developing a Backup and Restore Plan

      • Types of Backups

      • Recovery Models

      • Backup Devices

      • Backing Up a Database

      • Backing Up the Transaction Log

      • Backup Scenarios

      • Restoring Databases and Transaction Logs

      • Restore Scenarios

      • Additional Backup Considerations

      • Summary

    • 15 Database Mail

      • What’s New in Database Mail

      • Setting Up Database Mail

      • Sending and Receiving with Database Mail

      • Using SQL Server Agent Mail

      • Related Views and Procedures

      • Summary

    • 16 SQL Server Scheduling and Notification

      • What’s New in Scheduling and Notification

      • Configuring the SQL Server Agent

      • Viewing the SQL Server Agent Error Log

      • SQL Server Agent Security

      • Managing Operators

      • Managing Jobs

      • Managing Alerts

      • Scripting Jobs and Alerts

      • Multiserver Job Management

      • Event Forwarding

      • Summary

    • 17 Administering SQL Server 2008 with PowerShell

      • What’s New with PowerShell

      • Overview of PowerShell

      • PowerShell Scripting Basics

      • PowerShell in SQL Server 2008

      • Step-By-Step Examples

      • Summary

    • 18 SQL Server High Availability

      • What’s New in High Availability

      • What Is High Availability?

      • The Fundamentals of HA

      • Building Solutions with One or More HA Options

      • Other HA Techniques That Yield Great Results

      • High Availability from the Windows Server Family Side

      • Summary

    • 19 Replication

      • What’s New in Data Replication

      • What Is Replication?

      • The Publisher, Distributor, and Subscriber Magazine Metaphor

      • Replication Scenarios

      • Subscriptions

      • Replication Agents

      • Planning for SQL Server Data Replication

      • SQL Server Replication Types

      • Basing the Replication Design on User Requirements

      • Setting Up Replication

      • Scripting Replication

      • Monitoring Replication

      • Summary

    • 20 Database Mirroring

      • What’s New in Database Mirroring

      • What Is Database Mirroring?

      • Roles of the Database Mirroring Configuration

      • Setting Up and Configuring Database Mirroring

      • Testing Failover from the Principal to the Mirror

      • Client Setup and Configuration for Database Mirroring

      • Migrate to Database Mirroring 2008 as Fast as You Can

      • Using Replication and Database Mirroring Together

      • Using Database Snapshots from a Mirror for Reporting

      • Summary

    • 21 SQL Server Clustering

      • What’s New in SQL Server Clustering

      • How Microsoft SQL Server Clustering Works

      • Installing SQL Server Clustering

      • Summary

    • 22 Administering Policy-Based Management

      • Introduction to Policy-Based Management

      • Policy-Based Management Concepts

      • Implementing Policy-Based Management

      • Sample Templates and Real-World Examples

      • Policy-Based Management Best Practices

      • Summary

  • Part IV: Database Administration

    • 23 Creating and Managing Databases

      • What’s New in Creating and Managing Databases

      • Data Storage in SQL Server

      • Database Files

      • Creating Databases

      • Setting Database Options

      • Managing Databases

      • Summary

    • 24 Creating and Managing Tables

      • What’s New in SQL Server 2008

      • Creating Tables

      • Defining Columns

      • Defining Table Location

      • Defining Table Constraints

      • Modifying Tables

      • Dropping Tables

      • Using Partitioned Tables

      • Creating Temporary Tables

      • Summary

    • 25 Creating and Managing Indexes

      • What’s New in Creating and Managing Indexes

      • Types of Indexes

      • Creating Indexes

      • Managing Indexes

      • Dropping Indexes

      • Online Indexing Operations

      • Indexes on Views

      • Summary

    • 26 Implementing Data Integrity

      • What’s New in Data Integrity

      • Types of Data Integrity

      • Enforcing Data Integrity

      • Using Constraints

      • Rules

      • Defaults

      • Summary

    • 27 Creating and Managing Views in SQL Server

      • What’s New in Creating and Managing Views

      • Definition of Views

      • Using Views

      • Creating Views

      • Managing Views

      • Data Modifications and Views

      • Partitioned Views

      • Indexed Views

      • Summary

    • 28 Creating and Managing Stored Procedures

      • What’s New in Creating and Managing Stored Procedures

      • Advantages of Stored Procedures

      • Creating Stored Procedures

      • Executing Stored Procedures

      • Deferred Name Resolution

      • Viewing Stored Procedures

      • Modifying Stored Procedures

      • Using Input Parameters

      • Using Output Parameters

      • Returning Procedure Status

      • Debugging Stored Procedures Using SQL Server Management Studio

      • Using System Stored Procedures

      • Startup Procedures

      • Summary

    • 29 Creating and Managing User-Defined Functions

      • What’s New in SQL Server 2008

      • Why Use User-Defined Functions?

      • Types of User-Defined Functions

      • Creating and Managing User-Defined Functions

      • Rewriting Stored Procedures as Functions

      • Creating and Using CLR Functions

      • Summary

    • 30 Creating and Managing Triggers

      • What’s New in Creating and Managing Triggers

      • Using DML Triggers

      • Using DDL Triggers

      • Using CLR Triggers

      • Using Nested Triggers

      • Using Recursive Triggers

      • Summary

    • 31 Transaction Management and the Transaction Log

      • What’s New in Transaction Management

      • What Is a Transaction?

      • How SQL Server Manages Transactions

      • Defining Transactions

      • Transactions and Batches

      • Transactions and Stored Procedures

      • Transactions and Triggers

      • Transactions and Locking

      • Coding Effective Transactions

      • Transaction Logging and the Recovery Process

      • Long-Running Transactions

      • Bound Connections

      • Distributed Transactions

      • Summary

    • 32 Database Snapshots

      • What’s New with Database Snapshots

      • What Are Database Snapshots?

      • Limitations and Restrictions of Database Snapshots

      • Copy-on-Write Technology

      • When to Use Database Snapshots

      • Setup and Breakdown of a Database Snapshot

      • Reverting to a Database Snapshot for Recovery

      • Setting Up Snapshots Against a Database Mirror

      • Database Snapshots Maintenance and Security Considerations

      • Summary

    • 33 Database Maintenance

      • What’s New in Database Maintenance

      • The Maintenance Plan Wizard

      • Managing Maintenance Plans Without the Wizard

      • Executing a Maintenance Plan

      • Maintenance Without a Maintenance Plan

      • Database Maintenance Policies

      • Summary

  • Part V: SQL Server Performance and Optimization

    • 34 Data Structures, Indexes, and Performance

      • What’s New for Data Structures, Indexes, and Performance

      • Understanding Data Structures

      • Database Files and Filegroups

      • Database Pages

      • Space Allocation Structures

      • Data Compression

      • Understanding Table Structures

      • Understanding Index Structures

      • Data Modification and Performance

      • Index Utilization

      • Index Selection

      • Evaluating Index Usefulness

      • Index Statistics

      • SQL Server Index Maintenance

      • Index Design Guidelines

      • Indexed Views

      • Indexes on Computed Columns

      • Filtered Indexes and Statistics

      • Choosing Indexes: Query Versus Update Performance

      • Identifying Missing Indexes

      • Identifying Unused Indexes

      • Summary

    • 35 Understanding Query Optimization

      • What’s New in Query Optimization

      • What Is the Query Optimizer?

      • Query Compilation and Optimization

      • Query Analysis

      • Row Estimation and Index Selection

      • Join Selection

      • Execution Plan Selection

      • Query Plan Caching

      • Other Query Processing Strategies

      • Parallel Query Processing

      • Common Query Optimization Problems

      • Managing the Optimizer

      • Summary

    • 36 Query Analysis

      • What’s New in Query Analysis

      • Query Analysis in SSMS

      • SSMS Client Statistics

      • Using the SET SHOWPLAN Options

      • Using sys.dm_exec_query_plan

      • Query Statistics

      • Query Analysis with SQL Server Profiler

      • Summary

    • 37 Locking and Performance

      • What’s New in Locking and Performance

      • The Need for Locking

      • Transaction Isolation Levels in SQL Server

      • The Lock Manager

      • Monitoring Lock Activity in SQL Server

      • SQL Server Lock Types

      • SQL Server Lock Granularity

      • Lock Compatibility

      • Locking Contention and Deadlocks

      • Table Hints for Locking

      • Optimistic Locking

      • Summary

    • 38 Database Design and Performance

      • What’s New in Database Design and Performance

      • Basic Tenets of Designing for Performance

      • Logical Database Design Issues

      • Denormalizing a Database

      • Database Filegroups and Performance

      • RAID Technology

      • SQL Server and SAN Technology

      • Summary

    • 39 Monitoring SQL Server Performance

      • What’s New in Monitoring SQL Server Performance

      • Performance Monitoring Tools

      • A Performance Monitoring Approach

      • Summary

    • 40 Managing Workloads with the Resource Governor

      • Overview of Resource Governor

      • Resource Governor Components

      • Configuring Resource Governor

      • Monitoring Resource Usage

      • Modifying Your Resource Governor Configuration

      • Summary

    • 41 A Performance and Tuning Methodology

      • The Full Architectural Landscape

      • Primary Performance and Tuning Handles

      • A Performance and Tuning Methodology

      • Performance and Tuning Design Guidelines

      • Tools of the Performance and Tuning Trade

      • Summary

  • Part VI: SQL Server Application Development

    • 42 What’s New for Transact-SQL in SQL Server 2008

      • MERGE Statement

      • Insert over DML

      • GROUP BY Clause Enhancements

      • Variable Assignment in DECLARE Statement

      • Compound Assignment Operators

      • Row Constructors

      • New date and time Data Types and Functions

      • Table-Valued Parameters

      • Hierarchyid Data Type

      • Using FILESTREAM Storage

      • Sparse Columns

      • Spatial Data Types

      • Change Data Capture

      • Change Tracking

      • Summary

    • 43 Transact-SQL Programming Guidelines, Tips, and Tricks

      • General T-SQL Coding Recommendations

      • General T-SQL Performance Recommendations

      • T-SQL Tips and Tricks

      • In Case You Missed It: New Transact-SQL Features in SQL Server 2005

      • The xml Data Type

      • The max Specifier

      • TOP Enhancements

      • The OUTPUT Clause

      • Common Table Expressions

      • Ranking Functions

      • PIVOT and UNPIVOT

      • The APPLY Operator

      • TRY...CATCH Logic for Error Handling

      • The TABLESAMPLE Clause

      • Summary

    • 44 Advanced Stored Procedure Programming and Optimization

      • T-SQL Stored Procedure Coding Guidelines

      • Using Cursors in Stored Procedures

      • Nested Stored Procedures

      • Using Temporary Tables in Stored Procedures

      • Using Remote Stored Procedures

      • Stored Procedure Performance

      • Using Dynamic SQL in Stored Procedures

      • Installing and Using .NET CLR Stored Procedures

      • Using Extended Stored Procedures

      • Summary

    • 45 SQL Server and the .NET Framework

      • What’s New in SQL Server 2008 and the .NET Framework

      • Getting Comfortable with ADO.NET 3.5 and SQL Server 2008

      • Developing with LINQ to SQL

      • Using ADO.NET Data Services

      • Leveraging the Microsoft Sync Framework

      • Summary

    • 46 SQLCLR: Developing SQL Server Objects in .NET

      • What’s New for SQLCLR in SQL Server 2008

      • Developing Custom Managed Database Objects

      • Summary

    • 47 Using XML in SQL Server 2008

      • What’s New in Using XML in SQL Server 2008

      • Understanding XML

      • Relational Data As XML: The FOR XML Modes

      • XML As Relational Data: Using OPENXML

      • Using the xml Data Type

      • Indexing and Full-Text Indexing of xml Columns

      • Summary

    • 48 SQL Server Web Services

      • What’s New in SQL Server Web Services

      • Web Services Migration Path

      • Web Services History and Overview

      • Building Web Services

      • Examples: A C# Client Application

      • Using Catalog Views and System Stored Procedures

      • Controlling Access Permissions

      • Summary

    • 49 SQL Server Service Broker

      • What’s New in Service Broker

      • Understanding Distributed Messaging

      • Designing a Sample System

      • Understanding Service Broker Constructs

      • Service Broker Routing and Security

      • Troubleshooting SSB Applications with ssbdiagnose.exe

      • Related System Catalogs

      • Summary

    • 50 SQL Server Full-Text Search

      • What’s New in SQL Server 2008 Full-Text Search

      • Upgrade Options in SQL Server 2008

      • How SQL Server FTS Works

      • Implementing SQL Server 2008 Full-Text Catalogs

      • Setting Up a Full-Text Index

      • Full-Text Searches

      • Full-Text Search Maintenance

      • Full-Text Search Performance

      • Full-Text Search Troubleshooting

      • Summary

  • Part VII: SQL Server Business Intelligence Features

    • 51 SQL Server 2008 Analysis Services

      • What’s New in SSAS

      • Understanding SSAS and OLAP

      • Understanding the SSAS Environment Wizards

      • An Analytics Design Methodology

      • An OLAP Requirements Example: CompSales International

      • Summary

    • 52 SQL Server Integration Services

      • What’s New with SSIS

      • SSIS Basics

      • SSIS Architecture and Concepts

      • SSIS Tools and Utilities

      • A Data Transformation Requirement

      • Running the SSIS Wizard

      • The SSIS Designer

      • The Package Execution Utility

      • Connection Projects in Visual Studio

      • Change Data Capture Addition with R2

      • Using bcp

      • Logged and Nonlogged Operations

      • Summary

    • 53 SQL Server 2008 Reporting Services

      • What’s New in SSRS 2008

      • Reporting Services Architecture

      • Installing and Configuring SSRS

      • Developing Reports

      • Management and Security

      • Performance and Monitoring

      • Summary

  • Part VIII: Bonus Chapters

    • 54 Managing Linked and Remote Servers

      • What’s New in Managing Linked and Remote Servers

      • Managing Remote Servers

      • Linked Servers

      • Adding, Dropping, and Configuring Linked Servers

      • Mapping Local Logins to Logins on Linked Servers

      • Obtaining General Information About Linked Servers

      • Executing a Stored Procedure via a Linked Server

      • Setting Up Linked Servers Using SQL Server Management Studio

      • Summary

    • 55 Configuring, Tuning, and Optimizing SQL Server Options

      • What’s New in Configuring, Tuning, and Optimizing SQL Server Options

      • SQL Server Instance Architecture

      • Configuration Options

      • Fixing an Incorrect Option Setting

      • Setting Configuration Options with SSMS

      • Obsolete Configuration Options

      • Configuration Options and Performance

      • Database Engine Tuning Advisor

      • Data Collection Sets

      • Summary

    • 56 SQL Server Disaster Recovery Planning

      • What’s New in SQL Server Disaster Recovery Planning

      • How to Approach Disaster Recovery

      • Microsoft SQL Server Options for Disaster Recovery

      • The Overall Disaster Recovery Process

      • Have You Detached a Database Recently?

      • Third-Party Disaster Recovery Alternatives

      • Summary

  • Index

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    • H

    • I

    • J

    • K

    • L

    • M

    • N

    • O

    • P

    • Q

    • R

    • S

    • T

    • U

    • V

    • W

    • X

    • Y-Z

Nội dung

ptg 2134 CHAPTER 52 SQL Server Integration Services 10. To execute the package, double-click the .dtsx file, which automatically invokes the package execution utility. Choose Execute, and the package executes and shows all results in the execution console, as shown in Figure 52.40. That’s it: you have popu- lated the data mart and created data in an flat file for distribution to the sales team. FIGURE 52.39 Control of flow between the old data flow and new data flow tasks. FIGURE 52.40 Executing the SSIS package. ptg 2135 The Package Execution Utility 52 NOTE You could also execute this new package by using the dtexec utility at a command prompt: C:> dtexec /FILE “C:\HotCustomerPlus.dtsx” The Package Execution Utility The dtsrun utility in SQL Server 2000 is no longer used within SQL Server 2008. It has been taken over by the dtexec utility, which is bigger and better and has more options and values to serve your every SSIS package execution need. Before you begin to use the dtexec utility, you should execute it at a command prompt with the help option set only and pipe the results into a text file: c:> dtexec /? > dtexec.txt You will quickly see all the main options and how similar this is to dtsrun (in SQL Server 2000). Some dtsrun command-line options have direct dtexec equivalents, such as the options for providing a server name or package name or for setting the value of a variable. Other dtsrun command-line options don’t have direct dtexec equivalents. In addition, some dtexec command-line options support features in SSIS, such as the options to pass in connection strings and manage checkpoints. You can create new command-line dtexec executions visually with the assistance of the Package Execution utility, which you open through dtexecui. This GUI displays all the available options and ensures the use of the correct syntax (see Figure 52.41). You start it up from the command prompt: c:> dtexecui Using this Package Execution utility is really the best way to create new command-line executions for SSIS packages and to run them easily. Figure 52.42 shows the Package Execution Progress console during a package execution. You can choose to stop the execu- tion from here. When you double-click any filesystem-stored SSIS package (that is, .dtsx file), you are always placed in this dtexecui environment (just as you automatically start up Microsoft Word when you double-click a Word document). The dtexec Utility You use the dtexec command-line utility to configure and execute SSIS packages. The dtexec utility provides access to all the package configuration and execution features, such as connections, properties, variables, logging, and progress indicators. The dtexec utility lets you load packages from three sources: . A Microsoft SQL Server database . The SSIS service (package store) ptg 2136 CHAPTER 52 SQL Server Integration Services FIGURE 52.41 The user interface for executing and configuring SSIS packages. FIGURE 52.42 The Package Execution Progress console in the Execute Package utility. . The filesystem itself The dtexec utility proceeds through four phases as it executes: 1. Command sourcing phase—The command prompt reads the list of options and arguments specified. All subsequent phases are skipped if a /? or /H[ELP] option is encountered. ptg 2137 The Package Execution Utility 52 2. Package-loading phase—The package specified by the /SQL, /FILE, or /DTS option is loaded. 3. Configuration phase—These options are processed in the following order: process options that set package flags, variables, and properties; process options that verify the package version and build; and process options that configure the runtime behavior of the utility, such as reporting. 4. Validation and execution phase—The package is run or validated without running if the /VALIDATE option was specified. When a package runs, dtexec can return an exit code. The exit code is used to populate the ERRORLEVEL variable—the value of which can then be tested in conditional statements or branching logic within an operating system batch file. The dtexec utility can set the following exit code values: Running Packages The dtexec options are additive. Depending on what you are trying to do, you are able to string one or more options and their values together in the following form: dtexec /option [value] [/option [value]] To show available options for dtexec, you use ’/?’ or ’/H’ or ’/Help’. Alternatively, you can see the details for a particular option by using the available options indicator followed by the option name ( ’/? [option name]). This invokes SQL Server Books online for that particular option. Note that a dash (-) may be substituted for / in this command. The dtexec package execution options include the following: . /~CheckF[ile] filespec—This option sets the CheckpointFileName property on the package to the path and file specified in filespec. This file is used when the package restarts. . /~CheckP[ointing]{on\off}—The value on specifies that a failed package is to be rerun. When the failed package is rerun, the runtime engine uses the checkpoint file to restart the package from the point of failure. The default value is on if the option is declared without a value. Package execution fails if the value is set to on and the checkpoint file cannot be found. If this option is not specified, the value set in the package is retained. Exit Code Value Description 0 Successful package execution. 1 Package execution failure. 3 User-canceled package execution. 4 Package could not be found. 5 Package could not be loaded. 6 Utility encountered an internal error. ptg 2138 CHAPTER 52 SQL Server Integration Services NOTE Using the /CheckPointing on option of dtexec is equivalent to setting the SaveCheckpoints property of the package to True and the CheckpointUsage property to Always. . /~Com[mandFile] filespec—This option specifies that during the command sourc- ing phase of the utility, the file specified in filespec is opened, and options from the file are read until the EOF is found in the file. filespec is a text file that contains additional dtexec command options. The filespec argument specifies the filename and path of the command file to associate with the execution of the package. . /~Conf[igFile] filespec—This option specifies a configuration file to extract values from. Using this option, you can set a runtime configuration that differs from the configuration specified for the package at design time. . /~Conn[ection] id_or_name;connection_string [[;id_or_name;connection_ string] ]—This option specifies the specific connection manager name or GUID and the specific connection string to use. This option requires that both parameters be specified. . /~Cons[oleLog] [[displayoptions];[list_options;src_name_or_guid] ]—This option displays specified log entries to the console during package execution. The displayoptions values are N (name), C (computer), O (operator), S (source name), G (source GUID), X (execution GUID), M (message), and T (time start and end). One list_options value is I, which specifies the inclusion list. With this value set, only the source names or GUIDs that are specified are logged. The value E specifies the exclusion list. With this value set, the source names or GUIDs that are specified are not logged. The src_name_or_guid parameter specified for inclusion or exclusion is an event name, a source name, or a source GUID. . /~D ¥ package_path—This option is used to load a package from the SSIS package store. The package_path argument specifies the relative path of the SSIS package, starting at the root of the SSIS package store, and includes the name of the SSIS package. The /DTS option cannot be used together with the /File or /SQL option. . /~De[crypt] password—This option provides the decryption password used when you load a package with password encryption. . /~F[ile]filespec—This option is used to load a package saved at the filesystem level. The filespec argument specifies the path and filename of the package. . /~L[ogger]classid_orprogid;configstring—This option associates one or more log providers with the execution of an SSIS package. The classid_orprogid parameter specifies the log provider and can be specified as a class GUID. configstring is the string used to configure the log provider. Following are the available log providers: ptg 2139 The Package Execution Utility 52 Text file: ProgID: DTS.LogProviderTextFile.1 ClassID: {59B2C6A5-663F-4C20-8863-C83F9B72E2EB} SQL Server Profiler: ProgID: DTS.LogProviderSQLProfiler.1 ClassID: {5C0B8D21-E9AA-462E-BA34-30FF5F7A42A1} SQL Server: ProgID: DTS.LogProviderSQLServer.1 ClassID: {6AA833A1-E4B2-4431-831B-DE695049DC61} Windows Event Log: ProgID: DTS.LogProviderEventLog.1 ClassID: {97634F75-1DC7-4F1F-8A4C-DAF0E13AAA22} XML File: ProgID: DTS.LogProviderXMLFile.1 ClassID: {AFED6884-619C-484F-9A09-F42D56E1A7EA} . /~M[axConcurrent] concurrent_executables—This option is used to identify the number of executable files the package can run concurrently. The value specified must be either a non-negative integer or –1. With a value of –1, SSIS allows a maximum number of concurrently running executables equal to the total number of processors on the computer executing the package, plus two. . /~P[assword] password—This option is used together with the /User option to retrieve the package from SQL Server. If the /Password option is omitted and the /User option is used, a blank password is used. . /~Rem comment—This option creates a comment on the command prompt or in command files. The comment is a string that must be enclosed in quotation marks, and it must contain no whitespace. . /~Rep[orting] level [;event_guid_or_name[;event_guid_or_name[ ]]—This option identifies what types of messages to report. Available reporting option levels are N (no reporting), E (errors are reported), W (warnings are reported), I (informa- tional messages are reported), C (custom events are reported), D (data flow task events are reported), P (progress is reported), and V (verbose reporting; all details of each type). If the /Reporting option is not specified, the default level is E, W, and P. . /~Res[tart] {deny | force | ifPossible}—This option enables you to set a new value for the CheckpointUsage property on the package. The possible values are Deny (sets the CheckpointUsage property to DTSCU_NEVER), Force (sets the CheckpointUsage property to DTSCU_ALWAYS), and ifPossible (sets the CheckpointUsage property to DTSCU_IFEXISTS). . /~Set propertyPath;value—This option overrides the configuration of a variable, property, container, log provider, Foreach enumerator, or connection within a package. When this option is used, /SET changes the propertyPath argument to the value specified. You can specify more than one /SET option at a time. ptg 2140 CHAPTER 52 SQL Server Integration Services . /~Ser[ver] server—This option identifies the name of the server from which to retrieve the package. If you do not specify the /Server option, the package execu- tion is attempted against the local server. . /~SQ[L] package_path—This option is used to load a package stored in SQL Server (in the msdb database). . /~Su[m]—This option displays the incremental counter that contains the number of rows that will be received by the next package component. . /~U[ser] user_name—This option identifies the SQL Server user ID needed to retrieve the package. . /~Va[lidate]—This option is used to complete the validation phase of package execution only. The package is not executed. . /~VerifyB[uild] major[;minor[;build]]—This option is a verification of the build number of a package against the build numbers specified during the verification phase in the major, minor, and build arguments. If a mismatch occurs, the package does not execute. These values are long integers. . /~VerifyP[ackageID] packageID—This option verifies the GUID of the package to be executed by comparing it to the value specified in the package_id argument. . /~VerifyS[igned]—If specified, this option causes the package to fail if the package is not signed. . /~VerifyV[ersionID] versioned—This option verifies the version GUID of a package to be executed by comparing it to the value specified in the version_id argument during the package validation phase. . /~W[arnAsError]—This option cause the package to consider a warning as an error. In other words, the package fails if a warning occurs during validation. If no warn- ings occur during validation and the /Validate option is not specified, the package is executed. Running Package Examples To execute an SSIS package saved to SQL Server using Windows authentication, you use the following code: dtexec /SQL UnleashedPackage1SQL /SER DBARCH-LT2\SQL08DE01 To execute an SSIS package saved to the package store (on the filesystem), you use the following code: dtexec /DTS “\File System\UnleashedPackage99PS” To execute an SSIS package saved in the filesystem, you use the following code: C:> dtexec /FILE “C:\HotCustomerPlus.dtsx” /MAXCONCURRENT “ -1 “ /CHECKPOINTING OFF /REPORTING EWCDI ptg 2141 The Package Execution Utility 52 Figure 52.43 shows the command prompt and subsequent execution of the HotCustomersPlus.dtsx SSIS package. Now, the package can be set up for regular batch execution using SQL Agent or any scheduling software. To execute an SSIS package saved in the filesystem and specify logging options, you use the following code: C:> dtexec /FILE “C:\HotCustomerPlus.dtsx” /l “DTS.LogProviderTextFile;c:\log.txt” To execute a package that uses Windows authentication and is saved to the default local instance of SQL Server, and to verify the version before it is executed, you use the following code: dtexec /sq UnleashedPackage1 /verifyv {b399e360-38c5-11c5-99x1-ae62-08002b2b79ef} The dtutil Utility You use the dtutil command-line utility to copy, move, delete, or verify the existence of a package. These actions can be performed on any SSIS package, regardless of whether it is stored in a Microsoft SQL Server database, the SSIS package store, or at the filesystem. The dtutil options are additive. Depending on what you are trying to do, you string one or more options and their values together in the following form: dtutil /option [value] [/option [value]] To show available options for dtutil, you use ’/?’ or ’/H’ or ’/Help’, as follows:. c:> dtutil /? Note that a dash (-) may be substituted for / in this command. FIGURE 52.43 Command-line execution of an SSIS package. ptg 2142 CHAPTER 52 SQL Server Integration Services Alternatively, you can see the details for a particular option by using the available options indicator followed by the option name ( ’/?’ [option name]). This invokes SQL Server Books online for that particular option. The dtutil options include the following: . /~C[opy][StorageLocation];[PackageName]—This option identifies where the package is to be stored ( StorageLocation value of DTS, FILE, or SQL) and the full destination path and filename of the package ( PackageName). When the Copy action encounters an existing package at the destination, dtutil prompts you to confirm package deletion. Y overwrites the package, and N aborts the overwrite of the destina- tion package. If you include the /Q (quiet) option, no prompt appears, and the exist- ing destination package is overwritten. . /~Dec[rypt] Password—This option sets the decryption password used when loading a package with password encryption. . /~Del[ete]—This option deletes the package specified by the SQL, DTS,orFILE option. . /~DestP[assword] Password—This option specifies the password used with the SQL option to connect to a destination SQL Server instance using SQL Server authentication. . /~DestS[erver] Server—This option specifies the server name used with any action that causes a destination to be saved to SQL Server or a nonlocal or nondefault server when saving an SSIS package. . /~DestU[ser] User name—This option specifies the SQL Server username at the destination SQL Server instance. . /~DT[S] PackagePath—This option specifies that the SSIS package referenced is located in the SSIS package store, and the PackagePath argument is a relative path that commences at the root of the SSIS package store. . /~En[crypt] [StorageLocation];[;Path;ProtectionLevel[;Password]—This option encrypts the loaded package with the specified protection level and password and saves it to the location specified in Path. StorageLocation types are DTS, FILE, and SQL. ProtectionLevel determines whether a password is required. The possible ProtectionLevel values are 0 (strips sensitive information), 1 (sensitive information is encrypted using local user credentials), 2 (sensitive information is encrypted using the required password), 3 (package is encrypted using the required password), 4 (package is encrypted using local user credentials), and 5 (package uses SQL Server storage encryption). . /~Ex[ists]—This option is used to determine whether a package exists. . /~FC[reate] [StorageLocation];FolderPath;NewFolderName—This option creates a new folder with the name specified by NewFolderName. StorageLocation is SQL or DTS only. The location of the new folder is indicated by FolderPath. ptg 2143 The Package Execution Utility 52 . /~FDe[lete] [StorageLocation] ExistingFolderPath;ExistingFolderName—This option deletes the folder specified by the name in ExistingFolderName from SQL Server ( SQL) or SSIS (DTS). StorageLocation is SQL or DTS only. The location of the folder to delete is indicated by ExistingFolderPath. . /~FDi[rectory] [StorageLocation] FolderPath[;S]]—This option lists the contents, both folders and packages, in a folder on SSIS ( DTS) or SQL Server (SQL). The optional ExistingFolderPath parameter specifies the folder whose contents you want to view. StorageLocation is SQL or DTS only. The optional S parameter specifies that you want to view a listing of the contents of the subfolders for the folder speci- fied in ExistingFolderPath. . /~FE[xists] [StorageLocation] ExistingFolderPath—This option verifies whether the specified folder exists on SSIS ( DTS) or SQL Server (SQL). The ExistingFolderPath parameter is the path and name of the folder for which you need to verify its existence. StorageLocation is SQL or DTS only. . /~FR[ename] [StorageLocation]; ExistingFolderPath; ExistingFolderName; NewFolderName—This option renames a folder on the SSIS (DTS) or SQL Server (SQL). StorageLocation is SQL or DTS only. ExistingFolderPath is the location (path) of the folder to rename. ExistingFolderName is the name of the folder to be renamed, and NewFolderName is the new name to give the folder. . /~Fi≤ PathName—This option specifies that the SSIS package to be operated on is located in the filesystem, and the PathName value contains either a universal naming convention (UNC) path or local path. . /~I[DRegenerate]—This option creates a new GUID for the package and updates the package ID property. . /~M[ove] [StorageLocation]; PathandName—This option specifies a move action for an SSIS package. StorageLocation may be DTS, FILE, or SQL. PathandName indi- cates the package path (location) and/or package name: SQL uses the package path and package name, FILE uses a UNC or local path, and DTS uses a location relative to the root of the SSIS package store. If an existing package at the destination has the same name, dtutil prompts you to answer Y to overwrite this existing package or N to not do the move. If you specify the /Q (quiet) option, no prompt appears when an existing package may exist at the move destination, and it is just overwritten. . /~Q[uiet]—This option disables the Y/N prompts when a package with the same name as the specified package already exists at the destination location or if the specified package is already signed. . /~R[emark] [Text]—This option is a comment to the command line. There can be multiple remarks in a command line. . /~Si[gn] [StorageLocation]; ExistingPath; Hash—This option signs an SSIS package. StorageLocation may be DTS, FILE, or SQL. ExistingPath specifies the path . {59B2C6A5-663F-4C20-8863-C83F9B72E2EB} SQL Server Profiler: ProgID: DTS.LogProviderSQLProfiler.1 ClassID: {5C0B8D21-E9AA-462E-BA34-30FF5F7A42A1} SQL Server: ProgID: DTS.LogProviderSQLServer.1 ClassID: {6AA833A1-E4B2-4431-831B-DE695049DC61} Windows. specified by the SQL, DTS,orFILE option. . /~DestP[assword] Password—This option specifies the password used with the SQL option to connect to a destination SQL Server instance using SQL Server authentication. . /~DestS[erver]. “C:HotCustomerPlus.dtsx” The Package Execution Utility The dtsrun utility in SQL Server 2000 is no longer used within SQL Server 2008. It has been taken over by the dtexec utility, which is bigger and

Ngày đăng: 05/07/2014, 02:20

TỪ KHÓA LIÊN QUAN