May 17, 2010 at 10:14 pm
Comments posted to this topic are about the item Backup\ Restore completion Status.
Thanks.
May 18, 2010 at 2:31 am
Nice question.
I answered wrong even after reading BOL. I definitely need to learn more about that dynamic views because they contain a lot of useful stuff.
Maybe the word "job" is a little bit confusing in the context of the QOTD because in SQL Server it means "specified series of operations performed sequentially by SQL Server Agent".
May 18, 2010 at 4:14 am
vk-kirov (5/18/2010)
Maybe the word "job" is a little bit confusing in the context of the QOTD because in SQL Server it means "specified series of operations performed sequentially by SQL Server Agent".
I agree, the right word is BATCH.
May 18, 2010 at 4:27 am
May 18, 2010 at 6:12 am
Once a job completes (100%), it no longer appears in the dmv right? Am I correct in understanding that the DMV only shows currently executing requests?
Thanks
May 18, 2010 at 6:27 am
I got it right but since when is a Dynamic Management View a table?
May 18, 2010 at 6:43 am
gary.mazzone (5/18/2010)
I got it right but since when is a Dynamic Management View a table?
I agree with you Gary... it's a view (albeit into a system table).
And with Carlo also... it's a "batch", not a job.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 18, 2010 at 7:31 am
Which table helps to find the completion status of the job(e.g, backup, restore etc..) in SQL Server 2005?
:discuss:Unfortunately I believe that none of the answers are correct for this question. The answers refer to batches, and use DMV's. The answer to your question would be to read the message field in the sysjobhistory table in msdb in order to get the status of the job. Also, these batch statuses are not in the tables used by the DMV for long making it difficult to get the completion status, unless the absence of an entry equals the completion but that does not tell you if the completion is a success or failure. But you can get the percentage of completion.
Steve Jimmo
Sr DBA
“If we ever forget that we are One Nation Under God, then we will be a Nation gone under." - Ronald Reagan
May 18, 2010 at 8:23 am
Changed it to a DMV from a table. We generically seem to use "table" for system tables, views, and DMVs, which isn't correct.
The question has been edited to say "batch" as well.
May 18, 2010 at 8:51 am
This is a very good question, thank you. I answered it correctly, but only because I knew that neither option 1 nor 3 is correct. This only left option 2 as a single available choice. It is good to start the day by learning something new from the QotD.
Oleg
May 18, 2010 at 9:29 am
Thanks Steve for changing the original question. I use this all the time to figure out how far along a backup or restore is.
---------------------------------------------------------------------
Use Full Links:
KB Article from Microsoft on how to ask a question on a Forum
May 18, 2010 at 12:53 pm
dgabele (5/18/2010)
Once a job completes (100%), it no longer appears in the dmv right? Am I correct in understanding that the DMV only shows currently executing requests?Thanks
I think had the same confusion. I read the question as to check the completion status of the backup after it had completed. Not as an ongoing monitoring of the progress of the task.
May 19, 2010 at 12:26 am
Yes, it is good question but where and how we can use this? Anybody can explain with an example?
KSB
-----------------------------
Thousands of candles can be lit from a single candle, and the life of the candle will not be shortened. Knowledge and happiness never decreases by being shared.” - Buddha
May 19, 2010 at 1:48 am
Kari Suresh (5/19/2010)
where and how we can use this? Anybody can explain with an example?
For example, it may be very useful when a big transaction rolls back and you want to know the progress status of the rollback.
Here is a simple example. First of all, let's create a table and fill it with the data (it took 5 minutes on my local machine, and 1800 MB on the hard drive (800 MB for the data file and 1000 MB for the log file)).
SET NOCOUNT ON
GO
CREATE TABLE RollbackTest (a CHAR(8000))
GO
BEGIN TRANSACTION
GO
INSERT RollbackTest VALUES ('test')
GO 100000
Here we have a huge uncommitted transaction. Let's roll it back (it took 6 minutes on my local machine):
ROLLBACK TRANSACTION
We can monitor the rollback progress in another window:
SELECT percent_complete, *
FROM sys.dm_exec_requests
WHERE session_id = <spid of the rollback process>
Also we can monitor the progress of backups/restores/etc.
Of course, we can't see the execution progress of queries (such as SELECT/INSERT/UPDATE/etc).
May 19, 2010 at 11:05 pm
Good Question 🙂
Viewing 15 posts - 1 through 15 (of 19 total)
You must be logged in to reply to this topic. Login to reply