DBA从事新工作的第一天-检查备份和安全性-如何?还有什么要检查的?
通常,当我在新环境中启动时,我倾向于检查备份在哪里,何时进行了最后一次完全备份,何时应用了最后一次还原,还检查了安全性。 我这样做的方法是通过T-SQL。 检查备份 ;with Radhe as ( SELECT @@Servername as [Server_Name], B.name as Database_Name, ISNULL(STR(ABS(DATEDIFF(day, GetDate(), MAX(Backup_finish_date)))), 'NEVER') as DaysSinceLastBackup, ISNULL(Convert(char(11), MAX(backup_finish_date), 113)+ ' ' + CONVERT(VARCHAR(8),MAX(backup_finish_date),108), 'NEVER') as LastBackupDate ,BackupSize_GB=CAST(COALESCE(MAX(A.BACKUP_SIZE),0)/1024.00/1024.00/1024.00 AS NUMERIC(18,2)) ,BackupSize_MB=CAST(COALESCE(MAX(A.BACKUP_SIZE),0)/1024.00/1024.00 AS NUMERIC(18,2)) ,media_set_id = MAX(A.media_set_id) ,[AVG Backup Duration]= AVG(CAST(DATEDIFF(s, A.backup_start_date, A.backup_finish_date) AS int)) ,[Longest Backup Duration]= …