Now I’m playing a little with this topic hehehe… but be with me, this have a final goal that I will reveal soon (probably two weeks from now since next week I will be away in the MVP Summit and BizTalk Summit in Seattle). Until then let’s try to find some of the “basic” possible errors that you can find in the Backup BizTalk Server job.
In my previous posts (here and here), I have explained two possible errors that you can find when trying to run this job, today we will talk about this one:
SQL Server Scheduled Job ‘Backup BizTalk Server (BizTalkMgmtDb)’ (0x4020953E49DEFA43B8FEC18D6AD9B062) – Status: Failed – Invoked on: 2013-11-12 08:50:46 – Message: The job failed. The Job was invoked by User BTS2013LAB01\Administrator. The last step to run was step 3 (MarkAndBackupLog). The job was requested to start at step 1 (Set Compression Option).
Although the execution of job ‘Backup BizTalk Server (BizTalkMgmtDb)’ failed, no error is register in the event viewer only the warning showed above. This probably happens because the main task of this job: “BackupFull” responsible for performing a full database backups of the BizTalk Server databases, is properly executed. You can validate this in the tables “adm_BackupSettings” and “adm_BackupHistory”, or on the file system where the backup files are saved.
However, and as the message states, the job was not entirely performed and there is a problem in the third task: MarkAndBackupLog. Again the error message doesn’t help us much, so what you should do is go to the Backup BizTalk Server job history to try so see if you can obtain more information’s. In this case the log history show as much more information:
Log Job History (Backup BizTalk Server (BizTalkMgmtDb))
Step ID 3
Job Name Backup BizTalk Server (BizTalkMgmtDb)
Step Name MarkAndBackupLog
Sql Severity 15
Sql Message ID 105
Message
Executed as user: NT SERVICE\SQLSERVERAGENT. Incorrect syntax near ‘´’. [SQLSTATE 42000] (Error 102) Unclosed quotation mark after the character string ‘ /* location of backup files */ ‘. [SQLSTATE 42000] (Error 105). The step failed.
CAUSE
The MarkAndBackupLog step is responsible for marking the logs for backup, and then backing them up. This step execute the “sp_MarkAll” stored procedure that accepts two mandatory parameters:
- @MarkName: Log mark name is part of the naming convention for backup files
- @BackupPath:. You must change the destination path this to a valid one. It may be local or a UNC path to another server
And one optional parameter:
- @UseLocalTime: This is an extra parameter that you can also add that tells the procedure to use local time
The mandatory parameters (MarkName and BackupPath) must be placed between single quotation marks:
- MarkName:
'BTS', 'BTS2013LAB01' and so on
- BackupPath:
'c:\backups'
The problem here is that for some reason I’m not using a single quotation mark:
exec [dbo].[sp_MarkAll] ‘BTS’ /* Log mark name */, ‘C ….’ …
SOLUTION
Fix the job to ensure that all the parameters of the sp_MarkAll is between single quotation marks.
Another error that you can find in the Job history is:
Log Job History (Backup BizTalk Server (BizTalkMgmtDb))
Step ID 3
Job Name Backup BizTalk Server (BizTalkMgmtDb)
Step Name MarkAndBackupLog
Sql Severity 16
Sql Message ID 3013
Message
Executed as user: NT SERVICE\SQLSERVERAGENT. Cannot open backup device ‘K:\Backups\BizTalk Database\Logs\BTS2013LAB01_BAMAlertsApplication_Log_BTS_2013_11_12_17_51_07_990.bak’. Operating system error 3(The system cannot find the path specified.). [SQLSTATE 42000] (Error 3201) BACKUP LOG is terminating abnormally. [SQLSTATE 42000] (Error 3013). The step failed.
In this case you also get one or several errors in the Event Viewer:
BackupDiskFile::CreateMedia: Backup device ‘K:\Backups\BizTalk Database\Logs\BTS2013LAB01_BAMAlertsApplication_Log_BTS_2013_11_12_17_51_07_990.bak’ failed to create. Operating system error 3(The system cannot find the path specified.).
CAUSE
If you check the parameters of the “sp_MarkAll” stored procedure you will see that the second parameter is the location of backup files and this location must exist in the file system.
SOLUTION
You must remember that you need to ensure that all the paths specified in the BizTalk jobs must exist in the file system. In my case, we create the folder on the file system and run the job again with success.