• 查看SQL Server数据库恢复进度


    DECLARE @DBName VARCHAR(64) = 'DBName'


    DECLARE @ErrorLog AS TABLE([LogDate] CHAR(24), [ProcessInfo] VARCHAR(64), [TEXT] VARCHAR(MAX))

    INSERT INTO @ErrorLog
    EXEC sys.xp_readerrorlog 0, 1, 'Recovery of database', @DBName

    SELECT TOP 10
    [LogDate]
    ,SUBSTRING([TEXT], CHARINDEX(') is ', [TEXT]) + 4,CHARINDEX(' complete (', [TEXT]) - CHARINDEX(') is ', [TEXT]) - 4) AS PercentComplete
    ,CAST(SUBSTRING([TEXT], CHARINDEX('approximately', [TEXT]) + 13,CHARINDEX(' seconds remain', [TEXT]) - CHARINDEX('approximately', [TEXT]) - 13) AS FLOAT)/60.0 AS MinutesRemaining
    ,CAST(SUBSTRING([TEXT], CHARINDEX('approximately', [TEXT]) + 13,CHARINDEX(' seconds remain', [TEXT]) - CHARINDEX('approximately', [TEXT]) - 13) AS FLOAT)/60.0/60.0 AS HoursRemaining
    ,[TEXT]

    FROM @ErrorLog ORDER BY [LogDate] DESC

  • 相关阅读:
    sprin AOP
    springDI注解
    Spring学习
    cookie、session、token三者之间的关系
    解决报错:Cannot find module 'webpack-cli/bin/config-yargs'
    Vue全家桶-前端工程化
    Vue全家桶-前端路由
    Vue
    Git
    Ajax
  • 原文地址:https://www.cnblogs.com/andy-2014/p/11225267.html
Copyright © 2020-2023  润新知