Hi,
In Oracle I have the option as DBA to view what current SQL Statements
is being executed for the current sessions on a database instance. How
do I do this in SQL Server 2005?
The reason is that I have to tune up SQL statements run by binary
executable files for which I don't have the source.
Best regards.Morten
You can turn on SQL Server Profiler and set up a trace to see what is going
on
select
s.session_id,
s.login_name,
s.status session_status,
s.cpu_time session_cpu,
s.logical_reads session_logical_reads,
s.reads session_reads,
s.writes session_writes,
sql_details.objectid session_current_procedure,
object_name(sql_details.objectid) session_current_procedure_name,
sql_details.text session_current_sql_text
from sys.dm_exec_sessions s
join sys.dm_exec_requests req
on s.session_id = req.session_id
cross apply sys.dm_exec_sql_text(req.sql_handle) sql_details
where s.session_id <> @.@.spid
"Morten Abildgaard" <mortenabildgaard@.gmail.com> wrote in message
news:1193213575.893092.10980@.i38g2000prf.googlegroups.com...
> Hi,
> In Oracle I have the option as DBA to view what current SQL Statements
> is being executed for the current sessions on a database instance. How
> do I do this in SQL Server 2005?
> The reason is that I have to tune up SQL statements run by binary
> executable files for which I don't have the source.
> Best regards.
>|||Thanks a bunch, Uri!
The SQL Server Profiler util was exactly what I was looking for. I
just thought it was an integrated part of the Management Studio.
On 24 Okt., 10:43, "Uri Dimant" <u...@.iscar.co.il> wrote:
> Morten
> You can turn on SQL Server Profiler and set up a trace to see what is going
> on
> select
> s.session_id,
> s.login_name,
> s.status session_status,
> s.cpu_time session_cpu,
> s.logical_reads session_logical_reads,
> s.reads session_reads,
> s.writes session_writes,
> sql_details.objectid session_current_procedure,
> object_name(sql_details.objectid) session_current_procedure_name,
> sql_details.text session_current_sql_text
> from sys.dm_exec_sessions s
> join sys.dm_exec_requests req
> on s.session_id = req.session_id
> cross apply sys.dm_exec_sql_text(req.sql_handle) sql_details
> where s.session_id <> @.@.spid
> "Morten Abildgaard" <mortenabildga...@.gmail.com> wrote in message
> news:1193213575.893092.10980@.i38g2000prf.googlegroups.com...
> > Hi,
> > In Oracle I have the option as DBA to view what current SQL Statements
> > is being executed for the current sessions on a database instance. How
> > do I do this in SQL Server 2005?
> > The reason is that I have to tune up SQL statements run by binary
> > executable files for which I don't have the source.
> > Best regards.
No comments:
Post a Comment