PowerShell script exchange
Post Reply
Talom
Enthusiast
Posts: 43
Liked: 6 times
Joined: Oct 21, 2014 7:56 am
Contact:

List of SAP HANA Log Backups

Post by Talom »

I recently found out, that the information about SAP Hana Jobs do not have a lot of details anymore.
I am reporting all SAP HANA backups and before Veeam 11 i could differ between full backups and log backups by checking the detaill. If the backup files were named "log_backup_*" i could determine the backup session was a log job.
Now i only get backup files which couldn't be processed. Is it possible to identify a logbackup session somehow? Usually i use everything i get from a cbackupsession object
BACKUP EAGLE® Developer
PetrM
Veeam Software
Posts: 3229
Liked: 520 times
Joined: Aug 28, 2013 8:23 am
Full Name: Petr Makarov
Location: Prague, Czech Republic
Contact:

Re: List of SAP HANA Log Backups

Post by PetrM »

Hello,

Please let me find out how to get the requested information using our PS module. By the way, in the version 12, we'll have SAP HANA backup policies for data files and redo log backups with enhanced statistics and monitoring for both session types. Also, why you don't use SAP HANA backup catalog views as a source of data? I guess it would be a more accurate approach than recognizing sessions depending on backup file name.

Thanks!
Talom
Enthusiast
Posts: 43
Liked: 6 times
Joined: Oct 21, 2014 7:56 am
Contact:

Re: List of SAP HANA Log Backups

Post by Talom »

i am reporting all backup jobs. HANA jobs are just a subset.

I do not have access to the SAP HANA directly so i don't think it's possible to use the backup catalog.
BACKUP EAGLE® Developer
PetrM
Veeam Software
Posts: 3229
Liked: 520 times
Joined: Aug 28, 2013 8:23 am
Full Name: Petr Makarov
Location: Prague, Czech Republic
Contact:

Re: List of SAP HANA Log Backups

Post by PetrM »

Hello,

You may try the following script:

Code: Select all

$jobs = Get-VBRPluginJob
foreach ($job in $jobs) {
    $sessions = [Veeam.Backup.Core.CBackupSession]::GetAllSessionsByPolicyJob($Job.Id) | Sort-Object -Property CreationTime
    $session = $sessions[-1]
    $task = Get-VBRTaskSession -Session $session
    $text = $task.logger.GetLog().updatedrecords.Title
    if ($text -like "*log_backup*" ) {
        Write-Host "$($job.Name), $($task.Status) - Log Backup"
    }else{
        Write-Host "$($job.Name), $($task.Status) - Data backup"
    }
}
But please keep in mind that such a script is not supported officially because it calls the internal methods (f.e. GetAllSessionsByPolicyJob, GetLog) of some objects and our support team will be unable to help with technical issues that may happen due to script execution. On the other hand, I wouldn't expect any issues with this script.

Thanks!
Talom
Enthusiast
Posts: 43
Liked: 6 times
Joined: Oct 21, 2014 7:56 am
Contact:

Re: List of SAP HANA Log Backups

Post by Talom »

Hello,

this topic was on hold from my side until Veeam 12 was released. Now i checked the logger records again and there are still no indicators for log backups.

What PetrM suggested was actually similar to my approach but it only works, if the backup has errors and the failed backup files are listed.
If there is no switch or config option to enable the listing of successful backup files as well, i think i have to search for the largest backup per day to identify a full backup.
BACKUP EAGLE® Developer
PetrM
Veeam Software
Posts: 3229
Liked: 520 times
Joined: Aug 28, 2013 8:23 am
Full Name: Petr Makarov
Location: Prague, Czech Republic
Contact:

Re: List of SAP HANA Log Backups

Post by PetrM »

Hello,

By the way, starting from the version 12 you can use SAP HANA backup policy that provides enhanced reporting including the detailed log backup statistics.

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests