Host-based backup of Microsoft Hyper-V VMs.
Post Reply
TGacs
Enthusiast
Posts: 37
Liked: 8 times
Joined: Sep 27, 2016 6:59 pm
Contact:

SureBackup with SQL 2000

Post by TGacs » 3 people like this post

Goal: Use SureBackup with SQL script to verify restore functionality of a legacy SQL 2000 / Server 2003 VM.

Problem: default Veeam.Backup.SqlChecker.vbs script fails with error code 4 (EXIT_CODE_CANT_QUERY_DBS).

Solution:
  • Copy Veeam Veeam.Backup.SqlChecker.vbs script to SQL2000Checker.vbs (for example)
  • Edit SQL2000Checker.vbs
  • replace line:

    Code: Select all

    Const SELECT_ALL_DBS = "SELECT [name] FROM [master].[sys].[databases]"
  • with line:

    Code: Select all

    Const SELECT_ALL_DBS = "SELECT [name] FROM [master].[dbo].[sysdatabases]"
  • Update the SureBackup application group entry for the VM.
  • - Deselect role SQL Server (since you will be using a custom script)
  • - On Test Scripts tab, select SQL2000Checker.vbs
  • - For arguments, use: %vm_ip% instancename (for the default SQL instance, instancename will be the VM's computername)
NOTE: If you specify credentials and use Windows user credentials instead of SQL user credentials, you will end up with SureBackup failing with error code 2 (EXIT_CODE_CANT_CONNECT).
This is because when 4 arguments are passed to the script (%vm_ip% instancename username password), the script is set to assume SQL authentication. To fix this, so Windows authentication is used instead:
  • Edit SQL2000Checker.vbs
  • replace last line of case 4:

    Code: Select all

    Case 4:
    sLogsFolder = WScript.Arguments(0)
    gsServer=WScript.Arguments(1)
    gLog.GenerateLog sLogsFolder,gsServer
    gsSqlUser=WScript.Arguments(2)
    gsPassword=WScript.Arguments(3)
    gbIsWindowsAuth=False
  • with last line here:

    Code: Select all

    Case 4:
    sLogsFolder = WScript.Arguments(0)
    gsServer=WScript.Arguments(1)
    gLog.GenerateLog sLogsFolder,gsServer
    gsSqlUser=WScript.Arguments(2)
    gsPassword=WScript.Arguments(3)
    gbIsWindowsAuth=True
Now your credentials will be passed as Windows credentials.

Hope this is helpful.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests