SureBackup with SQL 2000

Discussions specific to Microsoft Hyper-V hypervisor

SureBackup with SQL 2000

Veeam Logoby TGacs » Thu Jun 29, 2017 3:53 pm 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.
TGacs
Influencer
 
Posts: 23
Liked: 6 times
Joined: Tue Sep 27, 2016 6:59 pm

Return to Microsoft Hyper-V



Who is online

Users browsing this forum: No registered users and 1 guest