SQL Transaction Log Job Database Protection Status

PowerShell script exchange

SQL Transaction Log Job Database Protection Status

Veeam Logoby GarethUK » Thu Jan 28, 2016 5:39 pm

Hi,

From a job is it possible to get the SQL Protection status for each protected database within a child SQL Transaction log backup?

I can see each SQL transaction log backup status with the following:

Code: Select all
$job.FindChildSqlLogBackupJob().FindLastSession().logger.getlog().UpdatedRecords | format-table


which gives the following:

Code: Select all
   Status OrdinalId UpdateUsn Title Description   UpdateTimeStyle ObjectStartTime Cookie
   ------ --------- --------------- -----------   --------------- --------------- ------
   ESucceeded83   165  Processing VM xx-xxdb 28/01/2016 17:14:16   ENone   28/01/2016 17:13:48   37bf86c1-5ebe-4d98-871b-9e3f997c2559

---- ETC


But how can I see the status for each database (Protect/Unprotected/Warning/Error etc)?

Regards,


Gareth
GarethUK
Influencer
 
Posts: 17
Liked: 1 time
Joined: Fri Mar 21, 2014 11:41 am
Full Name: Gareth

Re: SQL Transaction Log Job Database Protection Status

Veeam Logoby v.Eremin » Fri Jan 29, 2016 10:45 am

Since we communicate directly with SQL server, updating native db properties, wouldn't it better to query the databases directly, instead of finding necessary information in VB&R session logs? Each time log backup job runs, the db property named "Last Log Backup Time" gets updated. So you might just check this property on existing dbs to see whether the logs have been successfully backed up for them. Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 7 guests