sql server - How to monitor SQL Restore on my web app -


i'm using proc manage restore statements

... exec('restore database mydb  disk = n''c:\folder\mydb.bak'' ...,  stats = 10') ... 

when run proc on mssms, can see % regularly.

i want use proc on java web app jtds. can have % restore processing ? restore take 40 minutes, user have have visual feedback on restore.

thx lot

i found way on https://www.mssqltips.com/sqlservertip/2343/how-to-monitor-backup-and-restore-progress-in-sql-server-2005-and-2008/

select session_id spid, command, a.text query, start_time, percent_complete, dateadd(second,estimated_completion_time/1000, getdate()) estimated_completion_time sys.dm_exec_requests r cross apply sys.dm_exec_sql_text(r.sql_handle) r.command in ('backup database','restore database')  

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -