본문 바로가기

Database/MS-SQL

[MSSQL] DB 크기 확인 방법

-- DB size 확인    ver. 0.5

use msdb


select *

from backupset a

where a.backup_start_date > '2013'

  and a.backup_start_date < '2014'

  and a.database_name = 'b2berp'

  and a.type = 'D'


select *

from backupfile

where filegroup_name = 'primary'

  and logical_name = 'b2berp_data'

  and backup_set_id > '1985'



select 

    a.backup_set_id

  , a.backup_start_date

  , a.backup_size

from backupset a  

    left join backupfile b  on a.backup_set_id = b.backup_set_id

where b.filegroup_name = 'primary'

  and b.logical_name = 'b2berp_data'

  and a.backup_start_date > '2013'

  and a.backup_start_date < '2014'

  and a.database_name = 'b2berp'

  and a.type = 'D'