DB restore percentage using T-SQL

  • When a restore is done using the interface it displays a progress percentage in 2005 or blue blobs in 2000.

     

    I have restarted managment studio and now cant see the progress. This is an enormous DB and i need to see how the restore is progressing is there a way i can retrieve this information using T-SQL.

     

    Thanks for any help.

    Jules

    www.sql-library.com[/url]

  • I don't think you can retrieve the information from a different spid on the state of a restore but it you run the restore as script, you can give the STATS parameter. Example: STATS=1 which will then give you 1%, 2%, 3% etc. STATS=10 will be 10%, 20% etc.

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

  • but i cant do it for this restore which  is already gooing?

    www.sql-library.com[/url]

  • Not as far as I know.

    You can ensure that it is indeed running my checking it's SPID. Should say "Database Restore" but I don't know if there is a way to track it's progress. Not to say there isn't mind you.

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

  • Hold on a sec...

    You say this is enormous. How big?

    The process SQL takes when doing a restore is first create the files and then seems to stamp them with something. This part of the restore does not issue a status report.

    An example is that we had to restore a 6TB DB and for about 20 odd hours it would be doing "nothing". Once this is complete, the status done starts coming. it is at this stage that it is actually writing the data.

    Using perfmon counter % disk Idle Time, how idle are the disks? if they are close to 0% idle (100% busy) then I suspect it is still at the first stage. Once it starts writing the actual data, it will vary from the idle time as it writes and not always be 100% busy.

    Is this not you case? How large is the DB and how long the has it been doing "nothing"?

    SQL 2000 had the same behaviour. Likewise, running it through script would produce the same result.

    Of course, it could also be a bug in the GUI.

    I would check the disks, if they busy, sit tight.

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

  • See if you can get it from dbcc outputbuffer(spid)

     

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply