Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

how to find if SSIS packages are running? Expand / Collapse
Author
Message
Posted Sunday, April 17, 2011 2:46 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, August 21, 2014 10:33 AM
Points: 1,283, Visits: 2,959

Any t-sql which can tell me if a particular package is running or not? Under the folder "Running Packages" it really doesnt say if the package is running or not. Please help!!
Post #1094653
Posted Monday, April 18, 2011 9:13 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, February 6, 2014 9:39 AM
Points: 420, Visits: 487
Since you didn't specify a version, I'm going to reply based on SQL 2005. You best bet is tables in the MSDB database that are named dbo.sysdtsxxxx - these tables hold all the package execution details. Specifically, dbo.sysdtslog90 gives a good basic history of package execution.

SELECT [id],[event],[computer],[operator],[source],[sourceid],[executionid],[starttime],[endtime],[datacode],[databytes],[message] FROM [msdb].[dbo].[sysdtslog90]

And dbo.sysjobactivity should show any currently executing packages.

SELECT [session_id],[job_id],[run_requested_date],[run_requested_source],[queued_date],[start_execution_date],[last_executed_step_id],[last_executed_step_date],[stop_execution_date],[job_history_id],[next_scheduled_run_date] FROM [msdb].[dbo].[sysjobactivity]

Another useful table is dbo.sysdtspackages90, which will give a listing of all your stored packages. Note that there is also a table named dbo.sysdtspackages, which is used for compatibility with legacy DTS packages.


Joshua Perry
http://www.usesage.com
Post #1095060
Posted Monday, April 18, 2011 10:21 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, August 21, 2014 10:33 AM
Points: 1,283, Visits: 2,959

Thanks. None of your queries gave me list of currently running packages (:. In the second query, you do not have any column referring to SSIS package? I do see some packages running under the "Running Packages" folder in SSIS. We are on sql 2005. Are you sure this query worked for you in finding currently executing packages?
Post #1095399
Posted Tuesday, April 19, 2011 2:21 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, August 27, 2014 12:31 PM
Points: 466, Visits: 1,914
sqldba_icon (4/18/2011)

Thanks. None of your queries gave me list of currently running packages (:. In the second query, you do not have any column referring to SSIS package? I do see some packages running under the "Running Packages" folder in SSIS. We are on sql 2005. Are you sure this query worked for you in finding currently executing packages?


Use a profiler trace to capture what is hitting your server and it will give you a hostname too. From there you can find out how these packages are being executed and from where.
Post #1095461
Posted Tuesday, April 19, 2011 8:28 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, August 21, 2014 10:33 AM
Points: 1,283, Visits: 2,959
chandan_jha18 (4/19/2011)
sqldba_icon (4/18/2011)

Thanks. None of your queries gave me list of currently running packages (:. In the second query, you do not have any column referring to SSIS package? I do see some packages running under the "Running Packages" folder in SSIS. We are on sql 2005. Are you sure this query worked for you in finding currently executing packages?


Use a profiler trace to capture what is hitting your server and it will give you a hostname too. From there you can find out how these packages are being executed and from where.


Oh yeah for sure i could do that :). Just wanted to avoid using trace, i am so surprised there isnt a query to find running SSIS packages on a server?
Post #1095676
Posted Tuesday, April 19, 2011 10:19 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, February 6, 2014 9:39 AM
Points: 420, Visits: 487
I think I understand what you're asking for now. That's not exposed via TSQL, but you could use some .NET code and expose it through an assembly that can be called with TSQL.

http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.application.getrunningpackages(v=SQL.90).aspx

Keep in mind that this has the same limitation of the Running Packages folder in SSMS - administrators will see all packages, and other users will only see packages they have started.

So, if you want to expose a list of all running packages to all users, you would need to create the assembly and execute the TSQL with a proxy. Or you could display the list of packges in an application using the collection object that is returned.


Joshua Perry
http://www.usesage.com
Post #1095799
Posted Wednesday, April 20, 2011 10:59 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, August 21, 2014 10:33 AM
Points: 1,283, Visits: 2,959
Joshua M Perry (4/19/2011)
I think I understand what you're asking for now. That's not exposed via TSQL, but you could use some .NET code and expose it through an assembly that can be called with TSQL.

http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.application.getrunningpackages(v=SQL.90).aspx

Keep in mind that this has the same limitation of the Running Packages folder in SSMS - administrators will see all packages, and other users will only see packages they have started.

So, if you want to expose a list of all running packages to all users, you would need to create the assembly and execute the TSQL with a proxy. Or you could display the list of packges in an application using the collection object that is returned.



Thanks yeah i knew that i could do this using .net code. What do u mean by "same limitation of the Running Packages folder in SSMS - administrators will see all packages". I am admin on the box as well as sql server. I still cannot see packages running under the RUnning Packages folder.
Post #1096506
Posted Wednesday, April 20, 2011 11:07 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, February 6, 2014 9:39 AM
Points: 420, Visits: 487
In addition to system level roles, the running packages folder uses the SSIS roles in the MSDB database. By default, logins with the db_dtsadmin or sysadmin role will see all packages, logins with the db_dtsoperator and db_dtsoperator roles will only see packages they started.

Joshua Perry
http://www.usesage.com
Post #1096517
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse