SQL Server 백업 시 결과를 확인할 수 있는 쿼리
SELECT A.backup_set_id
, B.physical_device_name AS file_path
, A.database_name AS database_name
, CAST(CAST(A.backup_size / 1000000 AS INT) AS VARCHAR(14))+ ' ' + 'MB' AS backup_size
, CAST(DATEDIFF(second, A.backup_start_date, A.backup_finish_date) AS VARCHAR(4)) + ' '+ 'Seconds' AS backup_time_taken
, A.backup_start_date AS backup_datetime
, CASE A.[type] WHEN 'D' THEN 'Full'
WHEN 'I' THEN 'Differential'
WHEN 'L' THEN 'Transaction Log'
END AS backup_type
, A.server_name AS server_name
, A.name
, A.first_lsn
, A.last_lsn
, A.checkpoint_lsn
, A.database_backup_lsn
FROM msdb.dbo.backupset A
INNER JOIN msdb.dbo.backupmediafamily B
ON A.media_set_id = B.media_set_id
WHERE A.database_name IN ('데이터베이스명')
ORDER BY A.backup_set_id
'WEB TIP > MS-SQL' 카테고리의 다른 글
SQL Server 플랜 캐쉬 (Plan Cache) (0) | 2017.10.11 |
---|---|
Plan Cache 확인 (0) | 2017.03.16 |
DEADLOCK 확인 (0) | 2017.03.13 |
전체 테이블 용량, 행수 (0) | 2016.12.21 |
테이블 변수를 이용한 문자열 분리 (0) | 2016.10.19 |