dbcc dbrepair with remap option

dbcc dbrepair with remap:

You can use dbcc dbrepair with remap to specify either the segment number or segment name, but you can specify only one segment at a time to remap.

If you do not specify the segment to remap, Adaptive Server remaps all the segments in the database. You can use the optional parameters at the end of dbcc dbrepair to specify the segment for remapping.

dbcc dbrepair includes the option fixalloc; to use both remap and fixalloc, add remap before fixalloc. Adaptive Server version 15.1.1 allows you to specify the segment number or segment name at the end of this command. This example specifies the log segment for the pubs2 database:

dbcc dbrepair(pubs2,"remap","fixalloc", -1,"logsegment")

To remap the log segment in the pubs2 database without using fixalloc, enter:

dbcc dbrepair(pubs2, "remap",NULL, -1,"logsegment")

To remap all segments in the pubs2 database, use:

dbcc dbrepair(pubs2, "remap")

dbcc dbrepair with the remap option is used by sp_addsegment, sp_dropsegment, sp_modifysegment, sp_extendsegment, sp_logdevice, and sp_placeobject. For more information on these stored procedures, and on dbcc dbrepair, see the most recent version of the Adaptive Server Enterprise Reference Manual: Commands.