Developing and Deploying SQL Server Applications on HP Integrity

Developing and Deploying SQL Server Applications
on HP Integrity Servers
Abstract ..............................................................................................................................................3
Environment Setup ................................................................................................................................4
Installation .......................................................................................................................................4
HP Integrity Server ........................................................................................................................4
Windows Client............................................................................................................................4
Tools ...............................................................................................................................................5
SQL Server Management Studio (on both Integrity Server and Windows Client) ...................................5
Business Intelligence Development Studio (ONLY on Windows Client) .................................................5
Visual Studio 2005 SQL Server Projects (ONLY on Windows Client)...................................................6
.NET Framework 2.0 SDK for IA64 (ONLY on Integrity Server)...........................................................6
Surface Area Configuration (on both Integrity Server and Windows Client)..........................................7
Other Tools ......................................................................................................................................8
Remote Debugger Configurations .......................................................................................................9
For SQL Server 2005 Debugging....................................................................................................9
On HP Integrity Server ...................................................................................................................9
On Windows Client ....................................................................................................................11
Debuging Tips ............................................................................................................................11
ClickOnce deployment from Visual Studio .............................................................................................12
T-SQL Trigger .................................................................................................................................13
.NET CLR Stored Procedure..............................................................................................................14
ClickOnce deployment from BI Development Studio ...................................................................18
Integration Services.........................................................................................................................18
Create and Debug the Package on Windows client ........................................................................19
Deploy the Package to Integrity ....................................................................................................21
Execute the package at the Integrity Server ....................................................................................23
Extend SSIS features using .NET Script Task ...................................................................................23
Analysis Services ............................................................................................................................27
1 of 39
Create the Cube on Windows Client .............................................................................................27
Deploy the Cube to Integrity .........................................................................................................28
Execute the Cube at Integrity ........................................................................................................29
Reporting Services ..........................................................................................................................30
Create a Report on Windows client...............................................................................................32
Deploy a Report to Integrity ..........................................................................................................32
Web-Based Report Management ..................................................................................................33
Develop and Deploy Applications without Visual Studio..........................................................................34
Native VC++/VB6 Applications...........................................................................................................36
Additional Resources ..........................................................................................................................38
2 of 39
Abstract
Visual Studio 2005 is the latest version of Microsoft’s Integrated Development Environment (IDE)
product that now offers an even richer set of tools for SQL Server development. Visual Studio 2005
enables software development for all three processor architectures that Windows supports: x86,
x64, and IA64.
BI Development Studio (BIDS) is a subset of Visual Studio 2005 focused on the development of
Integration Service, Analysis Services, and Reporting Services projects. BI Development Studio is
bundled with the toolset that ships standard with SQL Server 2005.
While neither Visual Studio 2005 nor BI Development Studio are intended to run directly on IA64
systems, developing solutions for IA64 systems using these tools is fully supported. The IDE for
Visual Studio and BI Development Studio must be hosted on an x86 or x64 system, such as a
desktop, workstation, or a notebook. The IDE is where you do the solution design, coding, editing,
compiling, and linking. You then deploy the resulting program or package to the IA64 system
either as managed code or native IA64 code using the automated deployment tools built into the
IDE. And with the aid of Visual Studio’s remote debug facility, you can perform debugging on the
target IA64 system over the network from the IDE with full source level debugging.
You can develop managed .NET applications and deploy them directly on Integrity servers without
using Visual Studio IDE. Microsoft has announced discontinuance of support for extended stored
procedures. In future versions, .NET procedures are the recommended coding method.
Network
Debug
Remote Debug
Facility
Storage
SQL Server
IA64 Server
IDE
Deploy
(VS / BIDS)
Desktop
When you use the ClickOnce deployment technology, .NET Framework SDK, and Visual Studio
2005 remote debugging capabilities, you can be assured of the same development experience for
IA64 applications as x86 or x64. This paper provides step-by-step instructions and examples
showing you how to develop SQL Server 2005 applications on a Windows client and then deploy,
debug, and test them on HP Integrity Servers. This document includes links to further readings and
provides section on additional resources at the end.
3 of 39
Environment Setup
Installation
The development environment consists of an HP Integrity Server and a Windows XP client
(any Windows machine x86 or x64 architecture is sufficient). Install the following software on
these machines. Unless mentioned or missing in the step, choose the default settings or steps
everywhere and continue.
HP Integrity Server
1.
Microsoft Windows Server 2003 with SP1 for IA64
2.
Microsoft SQL Server 2005 Enterprise Edition for IA64
3.
Microsoft SQL Server 2005 Service Pack 1 and the latest hot fixes
4.
SQL Server 2005 Samples and Sample Databases. This is needed to execute the
examples in this paper and your own learning purpose. This is optional.
5.
Microsoft Visual Studio 2005 Remote Debugging Monitor for IA64
To install, run rdbgsetup.exe from C:\Program Files\Microsoft SQL Server\
90\Shared\1033 or the SQL Server install directory in your system. This is also in the
Visual studio 2005 CD at VS\Remote Debugger\IA64 folder.
6.
Microsoft .NET Framework 2.0 (Software Development Kit) IA64 : This is needed ONLY
if you are developing .NET solutions on an Integrity Server without Visual Studio.
Windows Client
1.
Microsoft Windows XP with SP2 or Windows Server 2003 with SP1
2.
Microsoft SQL Server 2005 Developer Edition for x86( Developer Edition is same as
Enterprise Edition except the licensing terms)
3.
Microsoft SQL Server 2005 Service Pack 1 and the latest hot fixes
4.
Microsoft Visual Studio 2005.
•
Professional Edition is sufficient to write all the managed .NET code.
•
Also choose Visual Studio 2005 Team Edition for DB professional which gives
enhanced database features like source control of schema, schema and database
compare, new TSQL editor, collaboration through team portal, etc. For current
CTP5 Beta, you must have Visual Studio 2005 Professional or higher installed on
your machine.
•
This is optional.
Team System includes 64-bit Itanium compiler and cross compiler along with all
the features of the Professional Edition. If you have legacy VC++/VB6 applications
to compile or planning to write you must choose this option. This is optional.
•
Team
Foundation
Server
has
several
additional
comparisons of different versions of Visual Studio.
features.
Please
see
the
4 of 39
•
Visual Studio 2005 installs Business Intelligence Development Studio (BIDS) and
.NET Frame Work Software Development Kit (SDK) 2.0 by default.
•
Visual Studio 2005 and BIDS are not designed to install on IA64 servers.
5.
SQL Server 2005 Samples and Sample Databases. This is needed to execute the
examples in this paper and your own learning purpose. This is optional.
6.
Microsoft SQL Server 2005 Reports Packs : Report pack consists of a set of predefined
reports, a sample database, etc and you can use these templates to quickly author
and distribute new interactive reports. This is optional.
7.
Microsoft SQL Server 2005 Feature Packs : Feature pack is a collection of standalone
install packages that provide additional value for SQL Server 2005. This is optional.
Tools
The following tools are used for development, deployment, configuration and management of
SQL Server 2005 applications. The list is not exhaustive but it is essential for Integrity
application deployments.
SQL Server Management Studio (on both Integrity Server and Windows Client)
SQL Server Management Studio (SSMS) is an integrated environment for accessing,
configuring, managing, administering, and developing components of SQL Server. SSMS can
be used to manage applications developed from Business Intelligence Development Studio like
Integration Services, Analysis Services and Reporting Services. It also has the query editor for
the scripting capabilities of Transact-SQL, MDX, DMX, XML/A, and XML.
To launch SQL Server Management Studio, on the taskbar, click Start, point to
All Programs, Microsoft SQL Server 2005, and then click SQL Server Management
Studio. A sample SSMS screen is shown below with all the SQL instances connected to it.
Business Intelligence Development Studio (ONLY on Windows Client)
Business Intelligence Development Studio is the primary development environments for SQL
Server 2005 business intelligence solutions. The figure below shows the projects available for
the business intelligence solutions from the installed templates. Business Intelligence
Development Studio is the 32-bit development environment with Visual Studio 2005 design
interface. All the BI solutions developed from it on a 32-bit machine can be deployed on IA64
servers just like as on other 32-bit machines, including OnceClick deployment.
5 of 39
To launch Business Intelligence Development Studio, on the taskbar, click Start, point to
All Programs, Microsoft SQL Server 2005, and then click SQL Server Business
Intelligence Development Studio.
Visual Studio 2005 SQL Server Projects (ONLY on Windows Client)
Objects using .NET Framework languages and Transact-SQL programming language can be
created from Visual Studio 2005 SQL Server Projects on 32-bit environment. The figure below
shows the projects or solutions available from the installed templates. Visual Studio provides
the OnceClick Deployment Feature for seamless application deployment to IA64 just like 32bit machines.
To Launch Visual Studio SQL Server Projects, on the taskbar, click Start, point to
All Programs, then Microsoft Visual Studio 2005, then Microsoft Visual Studio 2005.
From Visual Studio select the File menu, select new, then Project. Choose the appropriate
programming language like C# and select database. From Solution Explorer right-click and
add the items shown.
.NET Framework 2.0 SDK for IA64 (ONLY on Integrity Server)
Visual Studio 2005 by default installs .NET Frame Works SDK on 32-bit machines. SQL Server
2005 is fully integrated to explore all the potentials of .NET managed code. Microsoft .NET
Framework 2.0 (SDK) IA64 is installed on the IA64 machine. Applications can build and deploy
from this SDK to IA64 SQL Server. It includes the build environment for managed codes like
C#.NET, VB.NET. The assemblies generated from this environment will be similar to
the one created from Visual Studio 2005 environment.
To access the SDK, on the taskbar click Start, point to All Programs, point to Microsoft .NET
Frame works SDK v2.0(64 bit), then Tools. The figure below shows the description of
several tool sets available on the system and how to use them.
6 of 39
Surface Area Configuration (on both Integrity Server and Windows Client)
Through Surface Area Configuration for services and connection, enable the remote database
connection. You must enable remote connections for each instance of SQL Server 2005 that
you want to access from a remote computer. For example, connecting to Integrity server from
a windows Client needs to enable this setting.
Click Start, point to Programs, point to Microsoft SQL Server 2005, point to
Configuration Tools, and then click SQL Server Surface Area Configuration, click
Surface Area Configuration for Services and Connections, expand Database Engine,
choose SQL Server Instance, click Local and remote connections, click the Using
TCP/IP ONLY, and then click Apply. On Database Engine, click Service, click Stop, wait
until the SQL SERVER service stops, then click Start to restart the SQL Server service. See
Microsoft site remote SQL connection for more information.
For setting the features, on the SQL Server 2005 Surface Area Configuration page,
click Surface Area Configuration features, expand Database Engine to locate the
appropriate SQL Server Instance. Select CLR Integration and check Enable CLR
Integration. Click Apply.
7 of 39
Other Tools
Some of the other tools available are shown below. Click on each topic for more
details. These tools are not explicitly used in the examples in this document.
•
SQL Server Profiler
•
Database Engine Tuning Advisor
•
SQL Server Configuration Manager
•
Reporting Services Configuration
•
SQL Upgrade Advisor
•
Windows System Resource Manager
•
Windows System Group Policy Editor
•
Windows Debugger
•
NUMA Configuration Tools
8 of 39
Remote Debugger Configurations
Remote Debugging Monitor (IA64) provides a graphical user interface for debugging
applications directly on an IA64 server using the Visual studio on the remote machine.
For SQL Server 2005 Debugging
Your Windows user account on both the windows client and the HP Integrity Server must be a
member of SQL Server's sysadmin group. By default, Windows administrators on a machine
running SQL Server have SQL Server sysadmin privileges on that machine. If you are using a
different account, you must set the appropriate permissions.
On HP Integrity Server
1. On taskbar select Start, go to Program Files, then Visual Studio 2005, then Visual
Studio Tools and select Visual Studio Remote Debugger Configuration Wizard
2.
Start the debugger monitor on manual mode. Do not check the “Run the Visual Studio
2005 Remote Debugger Service” tab on the screen.
3.
On the next screen, select “Configure the windows firewall for debugging” and choose
the appropriate computer settings depending on your network, for example, either
allow all computers to connect or allow only computers in the subnet to connect.
4.
From Visual Studio Tools open Visual Studio Remote Debugger. On the Tools
Menu click Options. Use the default Windows Authentication.
5.
From the Tools Menu, select Permissions. Select or add the user account that will
be debugging and check Allow permission for Debug.
9 of 39
6.
Click Advanced this screen to see any privileges required.
7.
The following table describes the privileges required to debug various types of code
supported by the Remote Debugging Monitor. See more at Microsoft web site
required permissions to debug a program.
Type of Code Being
Debugged
Privilege Required
Native Code
(C/C++ only)
No special privileges required (on remote machine) to debug
a process running under your own user account.
SE_DEBUG_PRIVILEGE required (on remote machine) to
debug a process running under a different user account.
Managed Code
(VB.NET, C#)
No special privileges required (on remote machine) to debug
a process running under your own user account.
Administrator privilege required (on remote machine) to
debug a process running under a different user account.
TSQL Debugging
Managed Code (SQL Server )
Permission to debug the stored procedure(s)
sysadmin privilege required
8.
To launch Remote Debugging Monitor on HP Integrity Server, on the taskbar click
Start, point to All Programs, point to Visual Studio 2005, then Visual Studio
Tools and select Visual Studio Remote Debugger (IA64).
9.
You must establish a connection with the other server to proceed. The figure below
shows the Remote Debugging Monitor on an IA64 machine with a connection
established with a remote client.
10 of 39
On Windows Client
1.
Install the application to debug (along with the related PDB and other DLLs and
necessary files) on the remote machine as part of the Visual studio 2005 Build.
2.
Start Visual Studio 2005. Select the project, then properties. On Configuration
Properties, select Build Events and then Post Build Events.
3.
On Command line section type: xcopy $(TargetDir)*.* G:\$(OutDir)\*.* /E /Y . Map
a network drive in the remote machine. ( eg: E:\OutDir). The files will be copied to
this folder by the build.
4.
On the Configuration Properties select Debugging. On the debugger, to Launch
select Remote Windows Debugger from the drop down menu. Configure the
debugging information as described below and Click OK.
5.
Finish the properties page and start the build. At the end of the build, the application
files will be placed on the remote machine’s mapped directory. From Visual Studio
menu, select Debug and Attach To Process to start remote debugging.
Debuging Tips
It is very difficult to generalize the debugging process. Nevertheless, the following outline
of debugging illustrates how debugging works.
•
On the Debug menu, click Start to compile, deploy, and unit test the project.
When the instruction pointer, designated by a yellow arrow, appears on the
breakpoint, you are debugging your function.
11 of 39
•
Place breakpoints in objects by double-clicking the object name in project
Explorer, then click in the left margin of the Text Editor on the lines of code
where you want to insert the breakpoint.
•
A message is displayed in the Output window stating whether the object was
successfully deployed to the SQL Server database. The script in the Test.SQL
file, (or whichever file was made the default debug script), will run, and if any
of your breakpoints hit, you can debug the object.
•
By repeatedly clicking Step Into from the Debug menu, you can watch how
the method result gets built. In the Locals window, open the variable value,
that contains the current store name being processed. Click the variable if it is.
The child node will be returned from this function, and it contains all of the
store names up to the current one concatenated together and separated by
commas.
•
In the Text editor, double-click the variable to select it. Drag it to the Watch
window and drop it anywhere in the window. The variable is now added to the
list of watched variables.
•
Step through several times as needed. The value may change each time
depending on the code. Add or remove break points as needed. Stop when you
hit the return statement. Click Continue again to finish debugging the
function.
•
For more debugging details see the following Microsoft Web sites:
C#
http://msdn2.microsoft.com/library/2kf0yb05.aspx
Visual Basic
http://msdn2.microsoft.com/library/0a10ws2y.aspx
C/C++
http://msdn2.microsoft.com/library/kcw4dzyf.aspx
ClickOnce deployment from Visual Studio
Like x86 and x64 applications, all SQL Server 2005 database applications developed in Visual
Studio 2005 SQL Server project can be deployed to an Integrity server with ClickOnce. You
can develop and deploy T-SQL only applications directly on Integrity Server’s SQL Server
Management Studio.
As Microsoft recommends using .NET for all the SQL application development, the same code
base (source code) can be used across different hardware platforms, including Integrity
servers. The same .NET assembly will run under Integrity’s .NET Framework.
The behavior of VC++ managed code extension applications will be similar to any other .NET
application for Integrity. VC++ or VB6 native language can also be used to write applications
like extended stored procedures, but they require Itanium specific compilers from the Visual
studio team suite edition. This native code scenario may not be supported in future versions of
SQL Server.
12 of 39
T-SQL Trigger
The following example shows step-by-step how to deploy a T-SQL Trigger from a Windows
Client to Integrity Server with a single Click. The same procedure can be used for any T-SQL
application development and deployment on Integrity Server.
1.
To Launch Visual Studio SQL Server Projects, on the taskbar, click Start, point
to All Programs, then Microsoft Visual Studio 2005, then Microsoft Visual
Studio 2005. From Visual Studio select the File menu, select New, then
Project.
2.
Select Database Projects, then Microsoft SQL Server, then SQL Server 2005
template. Choose the name and the location of the project. Click OK.
3.
In solution explorer, you see the Pre- and post-deployment scripts which can be
altered as required for the deployment scenario.
4.
Right-click on the Project, select Add, then New item. From Programmability
select database Trigger template. Select the Trigger Name.
5.
Also make sure that Project’s Tools menu, Options, Database Connections and
Design-Time Validation Database are properly chosen. For design time
validation the project may require a local database. For default choose blank.
6.
From Solution Explorer right-click, Select Properties, and choose Build. Select
the database Adventure Works on Integrity Server.
13 of 39
7.
On the Solution Explorer, under the project, under scripts, you see the PostDeployment and Pre-Deployment folders, as shown below, that contain
numerous scripts for tuning the deployment scenario.
8.
On the Visual Studio Project screen, write your Trigger. This sample trigger will not
allow programs to CREATE, ALTER, or DROP tables in the Adventure Works
database.
9.
From the Build Menu, select Build project. This will validate the errors and
connections in the scripts and show it in the error list window.
10. From the Build Menu, select Deploy. The trigger will be deployed to the target
Integrity Server. If you have any problem with deployment, it may be because you
did not have a trusted data base connection or the appropriate permission level for
the database objects. Check that the permissions are correct.
11. To verify that the trigger works correctly, open the SQL Server management
Studio on the Integrity Server and try to delete a table in the Adventure Works
database as shown below:
DROP TABLE AdventureWorks.dbo.SalesPerson;
12. The table can not be dropped because the trigger will fire back as expected.
.NET CLR Stored Procedure
The following example shows step-by-step how a CLR c# stored procedure can be deployed
from a Windows Client to Integrity Server with single Click. The same procedure can be used
for any .NET applications(VB, .NET, or VC++ managed) development and deployment on
Integrity Server.
You must configure the CLR Integration before proceeding with this example as shown in Tools
section 2.2. Computers configured with large amounts of memory and a large number of
processors may fail to load the CLR integration feature of SQL Server when starting the
server. To address this issue, start the server by using the -g memory_to_reserve SQL
Server service startup option, and specify a memory value large enough. See more details
about Enabling CLR Integration at the Microsoft web site.
1.
To Launch Visual Studio SQL Server Projects, on the taskbar, click Start, point to
All Programs, then Microsoft Visual Studio 2005, then Microsoft Visual Studio
14 of 39
2005. From Visual Studio select the File menu, select New, then Project. Choose
the appropriate programming language, for example C#.
2.
Select the database. On Templates select SQL Server Projects. Choose the name
and the location of the project. Click OK. It will ask to add a database reference as
shown below. You could add the database to a project later stage also from project’s
Tool menu and then connect to database.
3.
Select HP Integrity Server name and press Test connection. If database
references are already created then select the appropriate references from the
window.
4.
On the next screen set the SQL/CLR debugging (if not already set). Choose YES.
The following restrictions apply while CLR debugging:
You should not choose this option on any production servers. While enabled
SQL CLR debugging, all managed threads will stop.
Debugging CLR routines is restricted to one debugger instance at a time. This
limitation applies because all CLR code execution freezes when a break point is hit,
and execution does not continue until the debugger advances from the break point.
Existing connections cannot be debugged, only new connections, as SQL Server
requires information about the client and debugger environment before the connection
can be made. See more details at Microsoft web site about SQL/CLR debugging.
15 of 39
5.
To set the build environment, point to project Menu and select Properties. On Build
choose platform target Itanium or any CPU and Uncheck Optimized Code. You can
not debug with the optimized code checked. Click Ok. A sample page is shown below.
6.
Enable SQL debugging by pointing to the Project Menu and selecting Properties,
then click the Debug tab. in the Enable Debuggers section, select the SQL Server
Debugging check box. If the Debug tab is not visible, then choose this feature from
the project’s Debug menu.
7.
On the Property page all the configurations, like database connection and deployment,
can be set. Also from Tools Menu you can choose Options that gives you more
choices to set advanced features.
8.
From Solution explorer, right-click Properties, and choose Database. Add the
database reference as shown if not already available. Select permission level SAFE.
For EXTERNAL_ACCESS and UNSAFE assembly, you need to set the appropriate
permissions. For more details about the CLR environment, see Microsoft web site CLR
Hosted Environment and CLR Integration Code Access Security
16 of 39
9.
Right-click Solution Explorer, select Add, then New Item, then Stored Procedure.
Select a name for the stored procedure. Click OK.
10. Write the code in the Visual Studio project window as shown below. This example is a
simple Hello World program.
11. From the project’s Build Menu, select Build Solution. The status window at the
bottom of the screen shows the activities.
12. If there are build errors, they will be displayed. On Debug menu, set the break points
and start debugging the solution as you normaly do for x86 and x64 platforms.
13. You can also use the solution explorer’s Test Scripts to validate the code. Detailed
information about debugging SQL CLR database objects is available at Microsoft web
site.
14. From the Build menu, rebuild the solution, then select Deploy Solution. The
HelloWorld stored procedure will be deployed to the Integrity Server.
17 of 39
15. Open the SQL Server Management Studio on Integrity Server. Run the stored
procedure as shown below. The output “Hello World:” string is displayed.
16. If there are run time issues on Integrity Server, use the remote debugger from the
Visual studio. Set up the remote debugger as described in Section 2.3. Connect to the
sqlserver process and run the stored procedure at Integrity Server and start
debugging.
ClickOnce deployment from BI Development Studio
Integration Services
•
SQL Server Integration Services packages are created from the Business Intelligence
Studio (BIDS) on windows Client and deployed to Integrity Server with either
OnceClick or through the deployment wizard. All the functionalities of the Integration
Services are available in Integrity Servers except:
¾
Script tasks must be compiled before the package runs in a 64-bit
environment. If you do not use the default precompile option, the script is
compiled at run time and will not work on Integrity. However, run time
compile slows package execution and, except for debugging, it is not used.
¾
Debug capability on remote Integrity server with Integration Services projects
are not fully functional. The current remote debugger cannot be used to debug
packages deployed on Integrity system. These packages will have to be
debugged on x86 or x64 systems.
¾
Package execution utility dtexec.exe executes the same way as the Graphical
Interface Utility dtexecui.exe. This dtexecui.exe is a 32-bit process and in a
64-bit environment runs in Windows on Win32 (WOW). You should test the
commands/packages in 64-bit mode by using the 64-bit version of dtexec.exe
before deploying to a production server. Integration Services Considerations
on 64-bit Computers on the Microsoft web site gives more details about 64-bit
Runtime for SSIS packages.
18 of 39
•
SQL Server Import Export Wizard is available on Integrity machine for data transfer
(ETL), but it has very limited capabilities for SSIS packages.
•
SSIS packages can be managed from SQL Server Management studio on Integrity
Server. BIDS on windows client is only needed for the package design and debugging.
The example below shows how a sample SSIS package can be developed, debugged, deployed
and tested on Integrity Servers. This sample package copies a table from the Windows client’s
Adventure Works database to Integrity Server with sorting by Employee table. The example
also shows how to add a script task to the package and deploy it to Integrity Server.
Create and Debug the Package on Windows client
1.
From Business Intelligence Development Studio select Create Project and
Integration Services Project. A designer window opens for development.
2.
On the Control Flow tab, drag a Data Flow task to the design window.
3.
On the Data Flow tab, select Source OLE DB server from the Tool box and drag it.
4.
Double-click on it and set the source database connection as Adventure Works on
the 32-bit system. From connection manager, as shown below, choose a New
Connection, if it is not already listed in the connection window.
5.
Select Sort from the Tool Box and drag to the design window. Double-click on it and
choose to sort on table Employee. Connect the sort Box to the bottom of the Source
OLE DB.
6.
Select the Destination OLE DB Server from the Tool box and drag it. Connect its
input to the sort’s output. Set connection to Adventure Works on the IA64 machine.
This step is similar to Step 4 above. You can create a new table or select an existing
table (e.g., the Employee table) at IA64 for receiving the data.
7.
From the Debug menu select Start Debugging. T color of the each block changes as
the process moves through different stages — Gray waiting to run, Yellow currently
processing, Green successfully processed and Red failed. Verify that the program
completes successfully by looking at the Error List window.
19 of 39
8.
Select the control flow task and from the Debug menu select Toggle Break points
to set or clear the breakpoints, a red circle shown in the figure below.
9.
From the Debug menu select Windows and then select Breakpoints to display all
the break points set in the task. In this example there is ONLY one control flow task
and that is the Data flow task.
10. Right-click on the Control flow task to bring up all the available break points setting
conditions to choose as shown in figure below.
11. Checkpoints enable a failed SSIS package to be restarted at the spot where the
execution was ended at control flow level. To enable a checkpoint, right-click
anywhere in the background of the control flow design surface, then click Properties.
Set the SaveCheckpoints property to True. Type the name of the checkpoint file in
the CheckpointFileName property. Set the CheckpointUsage property to Always
to always restart the package from the checkpoint.
12. From the Debug Menu you can use stat/stop debugging, step over tasks, etc as
usual for debugging the scenario for the SSIS package. For more information see SSIS
package debugging at the Microsoft web site.
20 of 39
Deploy the Package to Integrity
1.
From the Project Menu select Project Properties. In the Debugging section, set
the Run64BitRuntime to TRUE to specify whether the Integration Services runtime
uses an available 64-bit version of the SSIS run time provider. See Integration
Services Considerations on 64-bit Computers on the Microsoft web site for more
details.
2.
In the Deployment utility section, set AllowConfigurationChanges to TRUE to
manage the package later in IA64 machine. Set Create Deployment Utility to TRUE
to create a deployment package. Specify the destination location of the package to
be created on DeploymentOutputPath
3.
Using Package configurations you can set properties for a package during package
development, and then add the configuration, (e.g., XML, registry, environment
variable), to the package to update the properties at run time. On the SSIS menu,
click Package Configurations. In the Package Configuration Organizer dialog
box, select Enable package configurations, and click Add.
4.
In the package Configuration Wizard specify the configuration type as XML and the
path name for the configuration file.
21 of 39
5.
Select Properties to export on the next screen. You can choose all properties or
selectively set them. After the wizard finishes, the new configuration is added to the
configuration list as shown above in the Package Configuration Organizer dialog box.
6.
Create the package by selecting Build Package or Build Solution from the Build
Menu. This creates the package, a Configuration XML File, and a Manifestation XML file
for the deployment. The following is a sample connection property string in the
configuration file which can be manipulated very easily at any target server.
7.
Deploy the package by copying the deployment folder to the target IA64 server, then
run the Package SSIS Deployment Manifest File.
8.
In the Package Deployment Wizard, select File System Deployment. You could
also install the package on SQL Server. Select the folder in which to install the
package.
9.
In the window you can see the configuration file details for editing as shown below.
Finish the installation. Go to the location of the package installed, to see the .dtsx
package file and the configuration XML file there.
22 of 39
Execute the package at the Integrity Server
1.
To execute an SSIS package that is saved in the file system, configured externally
with a logging option use the following command, where pkg.dtsx is the SSIS
package, config.xml is the configuration file and log.txt is the log file.
dtexec /f "c:\pkg.dtsx" /conf "c:\Config.xml"/l "DTS.LogProviderTextFile;c:\log.txt"
2.
SSIS package execution goes through four phases on execution: 1) Command
Sourcing, 2) Package Load, 3) Configure, and 4) Validation and Execution. The log file
captures the details of these phases, including the errors and warnings.
3.
In Graphical mode, execute the package at the target Integrity Server by doubleclicking the dtsx package file. Select the configuration file as needed (e.g.,
config.xml we created earlier). The run time window shows all the processing in detail,
including the errors and warnings. See a sample SSIS package run window below.
4.
Also, from SQL Server Management Studio Integration Services object Explorer, you
can select the package from either the file system or SQL server as shown below and
Execute it.
Extend SSIS features using .NET Script Task
.NET can be used to extend SQL Server integration Service functionality in several ways. This
section describes one important component called script task. Script tasks are custom tasks,
using a programming language such as VB.NET, that enhance the functionality of the basic
Integration Services Tasks available by default. Other options include execute a command-line
application, build your code into a CLR stored procedure, ActiveX Script Task, and custom Task
components for reusable components.
23 of 39
Script Task must be compiled before the package runs in a 64-bit environment. If you do not
use the default precompile option, the script is compiled at run time and will not work on
Integrity. Run time compile slows package execution, however the draw back is that a
precompiled script cannot be debugged without all the relevant files.
Using the package we created in the preceding sections, we’ll extent it with VB .NET code. This
sample script task will show a message in a message box about how many records are
transferred from source to destination at the end of the SSIS package run. This example also
shows how a variable can be used to pass the value at run time.
1.
In Business Intelligence Development Studio, open the Integration Services project.
2.
On Control Flow Task, from Tool set, select Script Task and drag it to the Control Flow
Area. Connect the input to the script task to the output of data Flow task we already
created on section 3.1.1 above.
3.
From the project’s SSIS menu, select variables. Type variable names and other details
as shown in the figure below.
4.
Double-click the Script task component. Select the “Script” tab. Select the entries as
shown.
24 of 39
5.
Click the Design Script Tab. It opens the Visual Studio Application designer. Cut and
paste the following lines of VB .NET code.
' Microsoft SQL Server Integration Services Script Task
Imports
Imports
Imports
Imports
Imports
Imports
System
System.Data
System.Math
Microsoft.SqlServer.Dts.Runtime
System.Data.SqlClient
System.Data.Common
Public Class ScriptMain
Public Sub Main()
Dim strConnection As String
strConnection = "Data
Source=Integrityrx1620;Initial
Catalog=AdventureWorks;Integrated Security=True"
Dim connection As New SqlConnection(strConnection)
connection.Open()
Dim strQuery As String
strQuery = "select max(AddressID) from Address"
Dim command As New SqlCommand(strQuery, connection)
Dim srReader As SqlDataReader
srReader = command.ExecuteReader()
Dim strTheId As String
'Default
strTheId = "32521"
While (srReader.Read())
strTheId = srReader.Item(0).ToString
End While
25 of 39
MsgBox("The max number of Addresses in the table is" and
strTheId, 0, "SSIS Script Task Example")
connection.Close()
' String Defenition
Dts.Variables("sqlint").Value = strTheId
' Test
MsgBox(Dts.Variables("sqlInt").Value.ToString)
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
6.
From the Build menu, Select the Precompile option as shown.
<screenshot />
7.
From the Debug menu, select start debugging. At the end of a successful run the
script task ill displays the number of records moved as shown in the figure below.
8.
Deploy and execute the package at the IA64 machine. As described in the section 2.3,
item 14, Set up the remote debugger environment and start debugging the package
from the IA64 machine.
9.
The SSIS package executes under the configured SSIS account (DTS Server).
Therefore, you must consider whether the actions taken by your Script Task have the
appropriate authority.
10. Script Task allows you to access SSIS Package variables and change SSIS Package
behavior. However, as you develop your own Script Tasks, you must consider things
like transactions and error handling.
26 of 39
Analysis Services
•
Analysis Services objects (e.g., perform back-ups, processing) can be managed from
SQL Server Management Studio on Integrity and you can also create Scripts project to
manipulate and apply changes to objects on an Analysis Services instance.
•
These Analysis Services use a variety of languages like XMLA, MDX, DMX, ASSL, to
manage its data objects. These scripts can be executed directly in SQL Server query
builder under SQL Server Management Studio and Business Intelligence Development
Studio. For example to run an XMLA query, right-click on the Analysis Services
database and select New Query. Select the option of XMLA. Write XMLA code on the
query window and press Execute. This operates just like T-SQL code.
•
ADOMD.NET is a standard Microsoft .NET Framework data provider that is designed to
communicate with multidimensional data sources. Multidimensional data, key
performance indicators (KPI), and mining models can be retrieved and manipulated by
using the ADOMD.NET object model. See the Microsoft web site for more information
about ADOMD.NET programming.
The following example shows how an Analysis Services project can be developed, debugged,
deployed and tested for Integrity Server. This sample shows how to develop a cube from
Adventure Works database on Integrity Server and deploy it.
Create the Cube on Windows Client
1.
From Business Intelligence Development Studio select Create Project and then
Analysis Services project.
2.
On the solution explorer click Data Sources, then select New Data Sources.
From the Data Source Wizard select Adventure Works on Integrity. This
Connection wizard is same as the one described for the Integration Services above.
Select the service account for execution and Data Source Name as Adventure Works
and Finish.
3.
On the solution explorer click Data Source Views, then select New Data Source
View. From Data Source View Wizard select the Adventure Works and Finish
4.
In the solution explorer click Cube, then select New Cube. In the Cube Wizard
select the Build Method as Build the Cube using the data source. Select the Data
Source View as Adventure Works on the next screen and continue.
5.
Cube Wizard automatically detects the fact table, dimensions, and measure
groups. Choose the default or change as needed and finish the Cube creation.
6.
Process the cube by clicking the project in solution explorer and select process. A
process window and an Error List show the progress of the processing as shown below.
27 of 39
Deploy the Cube to Integrity
Two most commonly used deployment options are OnceClick deployment from Business
Intelligence Studio and using the Analysis Services Deployment Wizard. OnceClick does not
provide the flexibility of the Deployment Wizard.
1.
From the Analysis Services Project Select properties. The Deployment Mode
property controls how the project is deployed; either all of the project is deployed or
only the changed objects are deployed.
2.
The Transactional Deployment property determines whether the project is
deployed as a single transaction or as multiple transactions. If the project is deployed
as multiple transactions, the deployment is done in one transaction and each
processing operation done as part of the deployment is done in its own transaction.
3.
The Processing Option parameter establishes what cube processing is done as part
of the deployment. If Default is selected, the deployment includes whatever
processing is necessary to bring the deployed objects to a fully processed state. If Do
Not Process is selected, no processing is done. If Full is selected, all of the data is
deleted from the deployed objects and all values are reloaded or recalculated.
4.
The information entered on the Deployment page of the Project Property Pages dialog
box is stored inside the folder created for your project.
5.
To deploy, select Deploy project from Build menu. The progress of the deployment is
displayed in the Output window and the Deployment Progress window. Also from
Solution Explorer Select the Project and then Deploy.
28 of 39
Execute the Cube at Integrity
1.
From SQL Server Management Studio connect to the Analysis Services instance. After
the deployment of the Analysis Services project the Databases tab will be populated
with the new project.
2.
Select the database or the individual cube within the database to process by rightclicking it and select Process. The difference between selecting the database and
selecting the individual cube is that processing the database populates the entire
solution set while cube processing only handles its content.
3.
The process window shows all processing activities. The figure below shows a typical
processing window.
<screenshot />
29 of 39
Reporting Services
•
HP Integrity Server can play the role of Report Server database or Report Server or
both as shown below. In fact, for performance issues it is wise to separate the Report
Server and Report Server database.
•
Reporting Services projects are developed from BIDS on a windows client computer,
separate from the report server. After your report looks the way you want, you can
publish it to a report server, where it becomes available for general use either ondemand or subscription based.
¾
Report Builder is a client-side application, web based visual environment,
that builds reports based on a report model using a simplified interface.
You can query data and create on-demand reports from Integrity Servers.
¾
Report Designer and Report Model Designer are available from BIDS only.
¾
Reports Manager on Integrity Server can be used to manage, configure
and secure the reports
¾
IIS will not be running on the Windows Client and so the Reporting
Services. However, from BIDS reports can be generated.
•
There are several ways we can enhance the standard features provided in reporting
Services. These include Custom Data Processing Extension and ADO.Net Data Set.
Report Definition Language (RDL) is used to manage the reports.
•
Report Services Configuration Tool is used to set up the Report Server. The
following example shows how to set up a Report Server on Integrity Server.
30 of 39
1.
From taskbar, click Start select Program Files, then Microsoft SQL Server 2005,
then Configuration Tools, then Reporting Services Configuration.
2. Select Server Status as
3. Select the Report Server Virtual Directory as
4.
Select the Report Manager Virtual Directory as
5.
Select Windows Service Identity as
6.
Select Web Service Identity as
7.
Select Database setup and choose Integrity Server’s Adventure Works database.
Select the Credentials as Windows credentials.
8.
Select the Encryption Keys as
9.
Select the Initialization. Make sure that Report Server is running correctly. If not,
Check the error from the window shown and resolve the issue.
10. Select the Email Settings as
11. Select the Execution Account as
31 of 39
The following example shows how to develop a Reporting Services project tbe debug, deploy
and test it for Integrity Server. This sample shows how to develop a Report from the
Adventure Works database on Integrity Server and deploy it.
Create a Report on Windows client
1.
From BIDS choose the Report Services project. Select the Report Server Project
Wizard template. Type a name and the location.
2.
On Report Wizard choose the Database source Adventure Works Database from
the IA-64 machine. This connection manager is same as the one described in
Integration Services. Select default Windows Authentication Credentials.
<screenshot />
3.
In the Design Query Window type a simple TSQL statement like this:
SELECT * FROM Person.Contact
4.
Select the Report Type Tabular. From Design the Table window click the page,
group and details tab. Select the default fields or choose the fields you want.
5.
Select the Table layout and Table Style you want. You can choose the deployment
server and the location if needed.
6.
Give a name to the Report and finish. The build will start. See the Error List for the
Build Errors. In the Report design window select Preview to see the report.
7.
In Step 2 above, if you choose Report Template, it will open the Report Designer
for creating the report. There are three tabs available on the report designer as data,
layout and preview. Use these tabs and the tool box to modify the parameters as you
wish.
Deploy a Report to Integrity
Reports can be deployed directly from Business Intelligence Development Studio, or use SQL
Server Management Studio or the Web-based Report Manager to upload the RDL file. This
section discuss the OnceClick BIDS deployment.
1.
From BIDS, select menu Project, then properties, then configuration properties
2.
In Deployment choose TargetDataSourceFolder, targetReportFolder and
TargetServerURL (e.g.,: http://IntegrityServer/ReportServer) as shown below.
32 of 39
3.
From Build Menu select Deploy project or from the solution explorer choose project
and select Deploy.
4.
From Internet Explorer select the Deployed Report Server location. For example,
URL http://IntegrityServer/ReportServer. The report solution we created is available
for use at this site as shown below.
<screenshot>
Web-Based Report Management
Browse to the URL http://IntegrityServer/reports. This is the location of the Report Manager.
From here, you can manage data sources, reports, and subscriptions—and even set report and
role security. The Upload Files option allows you to add existing report files to the server. By
clicking a report, you can view it, edit its properties (including changing the data source,
description, execution context, etc.), and even download the report file to edit it.
After choosing values for the parameters, you can click the View Report button to see the
report contents, specify parameter values and other formats for the report, for example PDF
file format. If you choose the PDF option, you will see a PDF file with the rendered report. You
can use this direct URL access feature in conjunction with a product such as Microsoft
SharePoint Portal Server to provide portal-based reporting capabilities.
Reporting Services stores component information in configuration files that are copied to the
file system during setup. Configuration files contain a combination of internal-use-only and
user-defined values. If you modify a configuration setting manually and the change is valid,
the configuration setting is seamlessly incorporated into the current server session. If the
change is not valid, the report server logs an error to the Windows application log and either
fails to start or uses a report.
For more on trouble shooting information, visit the Microsoft web site Troubleshooting
Reporting Services
33 of 39
Develop and Deploy Applications without Visual Studio
Business Intelligence applications are developed in Business Intelligence Studio (BIDS) which
is part of the Visual Studio tool set. Without BIDS very limited actions can be performed for
the BI application arena. But most of the BI objects can be managed through SQL Server
Management Studio directly from Integrity Server.
•
For Integration Services, package design and debugging needs BIDS. However SQL
server Import Export Wizard which does not needs BIDS can perform some primitive
data transfer. Also the packages can be managed by editing the package XML files for
connection, configurations, etc.
•
For Analysis Services, you can create Scripts projects to manipulate and apply
changes to objects on an instance directly from Management Studio. Analysis Services
uses a variety of languages and protocols like MDX, DMX, ASSL and XMLA to manage its
data objects which all can be accessed from Management Studio.
•
For Reporting Services, Report builder and Report Manager can run in Integrity
Server without BIDS. Also RDL can be edited to manage Reports without BIDS.
All .NET applications can be written directly on Integrity Server with any text editor and
compiled from the command line using the .NET Frame Work Software Development Kit
(SDK). Also Microsoft CLR Debugger on Integrity Server will be a very helpful tool too. Though
it is not a commonly used practice, a simple few lines of .NET code is manageable from
Integrity.
¾
There are three Framework products, .NET Framework 1.0, .NET Framework 1.1,
and .NET Framework version 2.0, and all the three may co-exist in the same
machine. Microsoft web site Debugging with .Net Frame Work SDK provides more
details on this topic.
¾
Go to the c:\ProgramFiles\Microsoft.NET\SDK\v2.0\Samples folder. Open
startsample.html. Click setup the Quick starts and run the ConfigSamples.exe
program. This will give you a head start on several .NET features/samples
available on 64-bit platforms.
¾
On the taskbar, click Start, point to All Programs, point to Microsoft .NET
Frame works SDK v2.0 (64bit). Several tools are available from this area.
Some of them are mentioned below:
DbgCLR.exe - Microsoft CLR Debugger for runtime bugs fix.
Fuslogvw.exe - Assembly Binding Log Viewer display details of failed assembly
Mdbg.exe and cordbg.exe - command line debuggers
Gacutil.exe - Manipulate the global assembly cache
34 of 39
The example below from an Integrity Server shows how to create a .NET assembly using a 64bit SDK environment and deploying to the SQL Server 2005
1. From the taskbar, click Start, point to All Programs, point to Microsoft .NET Frame
works SDK v2.0(64 bit), select SDK Command Prompt.
2. Create a project folder underneath and run the following command to create the safe
key for the .NET code to execute.
Sn –k keypair.snk
3. Copy the HelloWorld project created in Section 3.2 c# stored procedure to the project
folder or see the Microsoft website for more samples.
4. Compile the sample HelloWorld.sln c# project.
Msbuild /nologo /verbository:quiet /property:Configuration=Debug CS\ HelloWorld.sln
Note: Instead of Steps 3 and 4 above, you could write your stored procedure in c#
using a text editor (e.g., Notepad) and name it HelloWorld.cs. You could use
the same source code from Section 3.2 c# stored procedure. However, you
must ensure that the proper calling sequences are inserted. Sample code is
shown below:
public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
5.
Compile the code by using the csc.exe compiler. For VB .NET code use vbc.exe
instead. See more details about command line building of c# code at the Microsoft
website.
csc.exe HelloWorld.cs
6. This procedure generates a .dll which you can use as a stored procedure as follows.
During the ClickOnce install in Section 3.2, SQL server used the similar procedure
internally.
CREATE ASSEMBLY HelloWorld
FROM
'C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\projects\HW\HelloWorld.exe'
WITH permission_set = Safe;
GO
CREATE PROCEDURE usp_HelloWorld
AS ExTERNAL NAME HelloWorld
35 of 39
GO
7.
Run the stored procedure from the SQL Server Management Studio. The result “Hello
World” will be displayed in the Query Window pane.
8.
Use the Microsoft CLR Debugger for bug fixes at compile time as well as run time.
Native VC++/VB6 Applications
Microsoft recommends using .NET languages for SQL Server 2005 programming. The purpose of
this section is to help you port legacy applications to HP Integrity Servers. Do not code your new
SQL server 2005 programming in native VC++ or Visual Basic code.
1.
To Launch Visual Studio SQL Server Projects, on the taskbar, click Start, point to
All Programs, then Microsoft Visual Studio 2005, then Microsoft Visual Studio
2005. From Visual Studio select the File menu, select new, then Project. Choose
the appropriate programming language and an installed template like VC++ and Class
Library.
2.
Choose the name and the location of the project. Click OK. On Visual Studio 2005
Project, point to Project menu, select Properties, then select Configuration
Manager.
3.
Select New from Active Solution Configuration and type name as IA64. Select Copy
Settings From Box, type Either Debug or Release, and Click OK
4.
From Active Solution Platform select New and then choose Itanium Processor. Close
all windows for the configuration manager.
36 of 39
5.
Choose this IA64 configuration for all the future builds for generating native IA64
binary. Also, from this properties window, several other advanced options can be set.
6.
To enable SQL debugging on Visual Studio 2005 C++ projects, in the Property Pages
dialog box, open the Configuration Properties node, and select the Debugging
node. Set SQL Debugging to Yes. Click OK.
7.
From Project Tools Menu Select Options, then select Projects and properties.
Select directories for VC++ and choose platform Itanium
8.
From the show directories for window, choose executable files, then move
entries up/down as needed such as SDK, DDK, .NET Frame Work SDK files or any
files particular to your development environment.
9.
Repeat step 8 for library files and include files instead of executable files.
10. Before porting 32-bit applications to the IA-64, turn on the /WP64 flag and compile
your code like you normally would in 32-bit mode and verify. Use Itanium crosscompiler switches /G1 and /G2 for optimization. Microsoft web site Introduction to
Developing Applications for the 64-bit Itanium-based Version of Windows gives more
information on IA-64 development.
37 of 39
11. Some of the 64-bit runtime dlls must be copied to the IA-64 machine for VC++
application execution on IA-64. Those files are msvcp80.dll, msvcr80.dll, msvcm80.dll
and Microsoft.VC80.CRT.manifest. To install these dlls and the Itanium compiler, select
the "Itanium Compilers and Tools" check box during a Custom installation. Copy these
dlls to the target machine.
12. Write your VC++ code and compile using the Itanium compiler. A sample HelloWorld
program is shown below.
#include <iostream>
using namespace std;
void main() {cout << "Hello World!" << endl; }
13. Copy the files to the location in the Integrity Server. And run the following T-SQL code
from the Integrity Server management studio.
Create procedure ……………..
14. Execute the application by typing the following. This will display Hello World on the
Query Result screen.
dbo.HelloWorld();
15. For run time issues in executables on Integrity Server, use the Remote debugging
Monitor as described in Section 2.3.
Additional Resources
1) Anti virus running on SQL Server
http://support.microsoft.com/?kbid=309422
2) SQL Server Books Online July 2006
http://www.microsoft.com/downloads/details.aspx?familyid=BE6A2C5D-00DF-4220B133-29C1E0B6585F&displaylang=en
3) ADO.NET CTP August 2006
http://www.microsoft.com/downloads/details.aspx?familyid=b68f6f53-ec87-4122b1c8-ee24a043bf72&displaylang=en
4) .NET Framework 3.0 Pre Release
http://www.microsoft.com/downloads/details.aspx?FamilyId=19E21845-F5E3-438795FF-66788825C1AF&displaylang=en
5) SSIS API Programming
38 of 39
http://msdn2.microsoft.com/zh-cn/library/ms136025(SQL.90).aspx
6) SMO Programming
http://msdn2.microsoft.com/en-us/library/ms162169.aspx
7) HP Windows Integrity resources
http://www.hp.com/go/integrity
http://www.hp.com/support/itaniumservers/
39 of 39
Download PDF
Similar pages