Plug-in SQL per Avamar: script TSQL utili e quando utilizzarli durante la risoluzione dei problemi

Summary: Script TSQL comunemente utilizzati per risolvere i problemi di backup e ripristino SQL.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

1) Questo script TSQL genera una cronologia di backup completa in un periodo di tempo.
Ciò è utile per determinare se e quando è stato eseguito l'ultimo backup di un database specifico.
  • Ottieni l'intera cronologia di backup del database, incluse le relative dimensioni, di cui è stato eseguito il backup in un determinato intervallo di date.
SELECT msdb.dbo.backupset.database_name,
msdb.dbo.backupset.backup_start_date,
msdb.dbo.backupset.backup_size,
msdb.dbo.backupset.backup_finish_date,
msdb.dbo.backupset.type,
msdb.dbo.backupset.database_backup_lsn,
msdb.dbo.backupset.first_lsn,
msdb.dbo.backupset.last_lsn
FROM msdb.dbo.backupmediafamily
INNER JOIN msdb.dbo.backupset
ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id 
WHERE database_name IN ('sql_database_name_here')
--and msdb.dbo.backupset.backup_finish_date between '1/20/2000' and '10/14/2022'
ORDER BY 
2 DESC,
3 DESC

Questo script TSQL viene utilizzato per controllare la sequenza di numeri SQL LSN e se la "catena del log" è interrotta quando i log avsql mostrano errori "Log gap".
  • Le informazioni LSN di backup possono essere convalidate eseguendo le due query seguenti.
SELECT last_lsn, type, user_name FROM msdb..backupset WHERE database_name=N'sql_database_name_here' AND type LIKE 'L' ORDER by last_lsn DESC

SELECT last_log_backup_lsn FROM sys.database_recovery_status "WHERE database_id = DB_ID(N’sql_database_name_here')"
Nota: Personalizzare le voci "sql_database_name_here" in base alle proprie esigenze.
Confrontare le informazioni LSN del database restituite dalle query precedenti con ciò che Avamar SQL Plugin ha archiviato in sqlmeta.xml file.
Article Properties
Article Number: 000207317
Article Type: How To
Last Modified: 05 Sep 2025
Version:  3
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.