Monday, September 12, 2011

SSIS Package Permissions 2005 and 2008


Role Read action Write action
db_dtsadmin Enumerate own packages. Import packages.
or Enumerate all packages. Delete own packages.
sysadmin View own packages. Delete all packages.
  View all packages. Change own package roles.
  Execute own packages. Change all package roles.
  Execute all packages.  
  Export own packages.  
  Export all packages.  
  Execute all packages in SQL Server Agent.  
db_dtsltduser Enumerate own packages. Import packages.
Enumerate all packages. Delete own packages.
View own packages. Change own package roles.
Execute own packages.  
Export own packages.  
db_dtsoperator Enumerate all packages. None
View all packages.
Execute all packages.
Export all packages.
Execute all packages in SQL Server Agent.
Windows administrators View execution details of all running packages. Stop all currently running packages.

In SQL Server 2008 these 3 Database Roles are now named db_ssisltduser, db_ssisoperator, and db_ssisadmin
 MSDN Integration Services Roles (2008)
Role Read action Write action
db_ssisadmin Enumerate own packages. Import packages.
or Enumerate all packages. Delete own packages.
sysadmin View own packages. Delete all packages.
  View all packages. Change own package roles.
  Execute own packages. Change all package roles.
  Execute all packages. Bitmap
  Export own packages.  
  Export all packages.  
  Execute all packages in SQL Server Agent.  
db_ssisltduser Enumerate own packages. Import packages.
Enumerate all packages. Delete own packages.
View own packages. Change own package roles.
Execute own packages.  
Export own packages.  
db_ssisoperator Enumerate all packages. None
View all packages.
Execute all packages.
Export all packages.
Execute all packages in SQL Server Agent.
Windows administrators View execution details of all running packages. Stop all currently running packages

How to Schedule and Run a SSIS package ( DTS ) with SQL Agent Job for Non-SysAdmin user



In SQL Server 2005, you need to go through the security layer in order to run the job.

The logic is like this:
      The job executor account needs the roles of  SQLAgentUserRole, SQLAgentReaderRole,  SQLAgentOperatorRole
      The job needs to be run under Proxy account
      The job executor account is better to be used to create SSIS package and so you are sure the job executor account has the right to run this SSIS package.

The following steps can be followed to get the job done.
The work environment is MS SQL Server Management Studio and you log in as sa.

I. Create job executor account
Highlight Security->New Login, say to make login as devlogin, type your password, default database can be your target database.
User mapping: your target database
Msdb database: you make sure to include SQLAgentUserRole, SQLAgentReaderRole,  SQLAgentOperatorRole 
Also grant db_dtsoperator role on MSDB database to devlogin user.
Then click OK

II. Create SQL proxy account and associate proxy account with job executor account
Here is the code and run it the query window.

Use master
CREATE CREDENTIAL [MyCredential] WITH IDENTITY = 'yourdomain\myWindowAccount', secret = 'WindowLoginPassword'
Use msdb

EXEC dbo.sp_add_proxy  @proxy_name = 'MyProxy',  @enabled = 1,  @description = 'Maintenance tasks on catalog application.',  @credential_name = 'MyCredential' ;
GO
Sp_grant_login_to_proxy @login_name=' devlogin', @proxy_name='MyProxy'
Sp_grant_proxy_to_subsystem @proxy_name='MyProxy', @subsystem_name='SSIS'

III. Create SSIS package
In MS SQL Server Business Intelligence Development Studio, you use job executor account devlogin to create the SSIS package (DTS) and make sure you can execute this package in SQL Server Business Intelligence Development Studio. Compile/build this package.

IV. Create the job, schedule the job and run the job
In SQL Server Management Studio, highlight SQL Server Agent -> Start. Highlight Job ->New Job�, name it , myJob.
Under Steps, New Step, name it, Step1,
Type: SQL Server Integration Service Package
Run as: myProxy
Package source: File System
Browse to select your package file xxx.dtsx
Click Ok
Schedule your job and enable it

Monday, August 29, 2011

PowerShell 2008

http://www.sqlservergeeks.com/blogs/piyush.bajaj.2007/sql-server-bi/113/sql-server-powershell-in-sql-server-2008-part-i

http://www.sqlservergeeks.com/blogs/piyush.bajaj.2007/sql-server-bi/120/sql-server-powershell-in-sql-server-2008-part-ii

http://www.sqlservergeeks.com/blogs/piyush.bajaj.2007/sql-server-bi/121/sql-server-powershell-in-sql-server-2008-part-iii


http://www.sqlservergeeks.com/blogs/sarab/sql-server-bi/214/how-to-enable-powershell-feature-in-windows-server-2008-r2

Monday, August 15, 2011

Installation steps for SQL Server 2008 R2

http://www.sqlservergeeks.com/articles/sql-server-bi/32/installation-guide-for-sql-server-2008-r2

Thursday, August 11, 2011

One-click Deploy SSIS Package from Visual Studio to SQLServer

http://blog.boxedbits.com/archives/25

SSIS Packages deployment

http://decipherinfosys.wordpress.com/2008/09/16/deploying-ssis-packages-in-sql-server-2005/

There are two options available for us to deploy the SSIS Packages.

a) File System Deployment:

As the name suggests, this option allows us to deploy the SSIS Project to the File System i.e. a physical location on the hard disk on the target server. If this option is chosen, we have to back up the SSIS Packages manually every night for any disaster recovery.

b) Sql Server Deployment:
This option allows us to deploy the SSIS project to the SQL Server i.e. on the MSDB database. Since the msdb is usually backed up every night, this method of deployment saves us some extra work of backing up the SSIS Packages manually if deployed using the file system.

SSIS Packages execution  options:


Syntax:   dtexec /option [value] [/option [value]]...
1. Command prompt
dtexec /f "c:\pkgOne.dtsx"  --File system
dtexec /sq pkgOne /ser productionServer -- SQL Server
 

2. Using the xp_cmdshell extended stored procedure by using the dtexec command line utility
EXEC xp_cmdshell 'dtexec /f "C:\UpsertData.dtsx"'

3.Using BIDS

Could not save the package "D:\Test\Deployment1\Package2.dtsx" to SQL Server "(local)".

Error while deplying the SSIS Packag: Could not save the package "D:\Test\Deployment1\Package2.dtsx" to SQL Server "(local)".
The SaveToSQLServer method has encountered OLE DB error code 0x80004005 (Login timeout expired).  The SQL statement that was issued has failed.

Solutuon:  http://msdn.microsoft.com/en-us/library/ms137789.aspx

Modify the MsDtsSrvr.ini.xml, file ( ServerName\InstanceName)
,which is located in the folder, %ProgramFiles%\Microsoft SQL Server\100\DTS\Binn.