Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 What procedures are running?

Author  Topic 

mwgainesjr
Starting Member

6 Posts

Posted - 2010-04-23 : 10:33:12
I am working with a program that on the front end allows a user to kick out all users, lock the program and then run database maintenance. The maintenance processes are custom stored procedures. I have identified the store procedures but am finding it hard to identify the order in which they are run.

I am trying to automate the maintenance process to be run on schedule at night. I can kick the users our and lock the database but I need to figure out the processes and their order. Is there a way to see what procedures are running when I run the maintenance from the front end? The ERRORLOG and Activity Monitor don't seem to help.

Thanks in advance
MWG

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-23 : 12:27:39
Use SQL Profiler to see SQL activity.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-23 : 12:28:07
Why do you need to kick people out to do database maintenance?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

mwgainesjr
Starting Member

6 Posts

Posted - 2010-04-23 : 13:05:45
quote:
Originally posted by tkizer

Why do you need to kick people out to do database maintenance?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



There are certain processes that run when rebuilding indexes, relationships, keyword index, following index for calendaring, and an aging index that can wreak havoc on the tables if a user is in the tables. Just the way the application does it's maintenance I guess. They highly recommend the database be locked during maintenance. And for good reason because I've had several situations with data corruption because someone logged in when they weren't suppose to. The lock out feature that I'm referring to is at the application level and not database level.
Go to Top of Page

mwgainesjr
Starting Member

6 Posts

Posted - 2010-04-23 : 13:18:28
Thanks for the suggestion. I'm using Express version so Profiler isn't an option. I tried downloading an open source profiler for Express 2005 but it doesn't show procedure name that's running. I just need something simple to show me which procedures have been executed and when and maybe the sql syntax.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-23 : 13:27:54
SQL Profiler is just a GUI to SQL Trace, which I suspect is available in Express. It'll take a bit of hard work to get a trace configured without SQL Profiler, but at least it's something. To check this option out, start with sp_trace_create in BOL. You'll need to call several sp_trace* stored procedures to get it going.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -