sp_dump_info 系统过程显示特定时间点上未压缩累计转储包含的数据和日志的大小。
视情况而定,大小将以 KB、MB 或 GB 为单位进行报告。报告的大小可能稍小于存档文件(如果使用多个分条,则为文件)的实际大小,因为存档包含一些标签、标头、标尾和运行列表页形式的附加信息。此外,sp_dump_info 仅可假定已执行未压缩转储;如果已执行压缩转储,存档大小则会明显小于 sp_dump_info 报告的大小。
您不能使用 sp_dump_info:
除非已使用 sp_dboption 的 allow incremental dumps 参数允许数据库的增量转储。
如果数据库在您启用数据库的增量转储后尚未完全转储。
sp_dump_info <database_name>
<database_name>
是数据库的名称。
Data and log size
显示 test 数据库的累计转储包含的数据和日志大小
sp_dump_info test
go
Data Log Database percentage Allocation threshold
------- ----- ------------------- --------------------
4368 KB 2 KB 2 40
(return status = 0) (return status = 0)
输出表示,如果在该时间点进行累计转储,可能会包含约 4,368KB 的数据和一个日志页,占数据库总大小的 2%。
将其与在该时间执行累计转储的大小进行比较:
dump database test cumulative to "c:/tmp/test.dmp"
go
Backup Server: 4.171.1.1: The current value of 'reserved pages
threshold' is 85%.
Backup Server: 4.171.1.2: The current value of 'allocated pages
threshold' is 40%.
Backup Server session id is: 10. Use this value when executing the
'sp_volchanged' system stored procedure after fulfilling any
volume change request from the Backup Server.
Backup Server: 6.28.1.1: Dumpfile name 'test122480F0EF ' section
number 1 mounted on disk file 'c:/tmp/test.dmp'
Backup Server: 4.188.1.1: Database test: 4328 kilobytes (3%) DUMPED.
Backup Server: 3.43.1.1: Dump phase number 1 completed.
Backup Server: 3.43.1.1: Dump phase number 2 completed.
Backup Server: 3.43.1.1: Dump phase number 3 completed.
Backup Server: 4.188.1.1: Database test: 4370 kilobytes (3%)
DUMPED.
Backup Server: 3.42.1.1: DUMP is complete (database test).
存档的相应大小为 4,487,168 字节或 2191 页。这与 sp_dump_info 提供的 29 页 (14 KB) 的预估不同(其中 8 页为转储标签,1 页为转储标头,1 页为转储标尾,19 页包含运行列表)。转储标签、标头和标尾的大小与转储的页数无关,但运行列表使用的页数取决于转储的页数。
##### 错误消息
在 master 未启用增量转储时显示错误消息
sp_dump_info mydb
go
Msg 17154, Level 16, State 1:
Procedure 'sp_dump_info', Line 32:
Incremental dumps are not enabled in database mydb.
(return status = 1)
如果不允许增量转储,或未启用数据库的增量转储,sp_dump_info 将失败。