sp_dumpoptimize [ 'archive_space = {maximum | minimum | default }' ]
sp_dumpoptimize [ 'reserved_threshold = {<nnn> | default }' ]
sp_dumpoptimize [ 'allocation_threshold = {<nnn> | default }' ]
archive_space
指定要转储的数据库量。
maximum
在未确定分配哪些页的情况下转储整个数据库。档案图像使用的总空间量等于该数据库的大小。使用此选项与使用 reserved_threshold=0 和 allocation_threshold=0 选项的作用相同。
minimum
只转储分配的页,这将产生可能的最小档案图像。当转储到吞吐量远小于数据库设备(例如 QIC 磁带驱动器)的吞吐量的档案设备时,可以使用此选项。使用此选项与使用 reserved_threshold=100 和 allocation_threshold=100 选项的作用相同。
default
指定应使用的缺省值。在与以下选项一起使用时:
reserved_threshold
如果数据库磁盘中保留的页的百分比大于或等于 <nnn>,则转储该磁盘中属于该数据库的所有页。例如,如果将 <nnn> 指定为 60,并且数据库磁盘中保留页的百分比等于或大于 60%,则将转储整个磁盘,而不确定分配该磁盘中的哪些页。此选项的缺省值为 85%。
<nnn>
一个介于 0 到 100 之间的整数值,该值表示阈值的值。该值用于确定要转储的数据量。
当和 reserved_threshold 一起使用时,如果磁盘中保留页的百分比大于指定的值,则将转储数据库磁盘中该数据库的所有页。
当和 allocation_threshold 一起使用时,如果分配单元中已分配页的百分比大于为 allocation_threshold 指定的百分比,则将转储分配单元中的所有页。
allocation_threshold
如果分配单元中已分配页的百分比大于或等于 <nnn>,则将转储该分配单元中的所有页。例如,如果将 <nnn> 指定为 70 并且分配单元中已分配页的百分比大于或等于 70%,则将转储整个分配单元,而不确定是否分配该分配单元中的页。如果 reserved_threshold 设置导致转储整个磁盘,则将忽略磁盘的 allocation_threshold 设置。此选项的缺省值为 40%。
转储整个数据库:
sp_dumpoptimize 'archive_space=maximum'
Backup Server: 4.172.1.1: The value of 'reserved pages threshold' has been set to 0%.
Backup Server: 4.172.1.2: The value of 'allocated pages threshold' has been set to 0%.
仅转储分配的页,因此将产生最小的存档映像:
sp_dumpoptimize 'archive_space=minimum'
Backup Server: 4.172.1.1: The value of 'reserved pages threshold' has been
set to 100%.
Backup Server: 4.172.1.2: The value of 'allocated pages threshold' has been
set to 100%.
将保留阈值设置为 85%,分配阈值设置为 40%:
sp_dumpoptimize 'archive_space=default'
Backup Server: 4.172.1.1: The value of 'reserved pages threshold' has been
set to 85%.
Backup Server: 4.172.1.2: The value of 'allocated pages threshold' has been
set to 40%.
转储其保留页的百分比大于或等于 60% 的数据库中的磁盘,而不读取该磁盘上的分配页。对于其余的磁盘,将读取分配页,并且使用为 allocation_threshold 最后设置的值。如果在启动 Backup Server 后未设置 allocation_threshold,则使用 allocation_threshold 的缺省值 40%:
sp_dumpoptimize 'reserved_threshold=60'
Backup Server: 4.172.1.3: The value of 'reserved pages threshold' has been
set to 60%.
将保留阈值设置为 85%。它不影响分配页阈值:
sp_dumpoptimize 'reserved_threshold=default'
Backup Server: 4.172.1.3: The value of 'reserved pages threshold' has been
set to 85%.
为保留页的百分比小于 reserved_threshold 最后设置值的那些磁盘读取分配页,如果分配单元中已分配了 80% 或更多的页,则将转储整个分配单元:
sp_dumpoptimize 'allocation_threshold=80'
Backup Server: 4.172.1.4: The value of 'allocated pages threshold' has been
set to 80%.
本例将分配页阈值设置为缺省值 40%。它不影响保留页阈值:
sp_dumpoptimize 'allocation_threshold=default'
Backup Server: 4.172.1.4: The value of 'allocated pages threshold' has been
set to 40%.
转储其保留页的百分比大于或等于 60% 的数据库中的磁盘,而不读取该磁盘上的分配页。对于其余的磁盘,将读取分配页;如果分配单元中已分配了 30% 或更多的页,则将转储整个分配单元:
sp_dumpoptimize 'reserved_threshold=60', 'allocation_threshold=30'
Backup Server: 4.172.1.3: The value of 'reserved pages threshold' has been
set to 60%.
Backup Server: 4.172.1.4: The value of 'allocated pages threshold' has been
set to 30%.
显示阈值的当前值:
sp_dumpoptimize
Backup Server: 4.171.1.1: The current value of 'reserved pages threshold'
is 60%
Backup Server: 4.171.1.2: The current value of 'allocated pages threshold'
is 30%.
阈值的缺省值为:保留的页:85%;分配页:40%。
如果数据库设备段的保留页百分比:
a) 小于分配阈值 – 则只转储写有数据的页
b) 大于分配阈值 – 则转储整个分配单元。