共用方式為


RecoveryManager.RebuildMappingsOnShard Method

Rebuilds a local range shard map from a list of inconsistent shard ranges detected by DetectMappingDifferences(ShardLocation,String) and then accessed by GetMappingDifferences. The resulting local range shard map will always still be inconsistent with the global shard map in the shard map manager database. A subsequent call to ResolveMappingDifferences is necessary to bring the system back to a healthy state.

Namespace: Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.Recovery
Assembly: Microsoft.Azure.SqlDatabase.ElasticScale.Client (in Microsoft.Azure.SqlDatabase.ElasticScale.Client.dll)

Usage

'Usage
Dim instance As RecoveryManager
Dim token As RecoveryToken
Dim ranges As IEnumerable(Of ShardRange)

instance.RebuildMappingsOnShard(token, ranges)

Syntax

'Declaration
<SuppressMessageAttribute("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId:="1")> _
Public Sub RebuildMappingsOnShard ( _
    token As RecoveryToken, _
    ranges As IEnumerable(Of ShardRange) _
)
[SuppressMessageAttribute("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId="1")] 
public void RebuildMappingsOnShard (
    RecoveryToken token,
    IEnumerable<ShardRange> ranges
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1062:Validate arguments of public methods", MessageId=L"1")] 
public:
void RebuildMappingsOnShard (
    RecoveryToken^ token, 
    IEnumerable<ShardRange^>^ ranges
)
/** @attribute SuppressMessageAttribute("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId="1") */ 
public void RebuildMappingsOnShard (
    RecoveryToken token, 
    IEnumerable<ShardRange> ranges
)
SuppressMessageAttribute("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId="1") 
public function RebuildMappingsOnShard (
    token : RecoveryToken, 
    ranges : IEnumerable<ShardRange>
)

Parameters

  • ranges
    The set of ranges to keep on the local shard when rebuilding the local shard map.

Remarks

Note that this method can cause unrecoverable data loss. Make sure you have taken backups or copies of your databases and only then proceed with great care. Only shard ranges with inconsistencies can be rebuilt using this method. All ranges with no inconsistencies between the local shard and the global shard map will be kept intact on the local shard and are not affected by this call. Subsequent changes to the non-conflicting mappings can be made later using the regular interfaces in the shard map manager. It is not necessary to use the recovery manager to change non-conflicting mappings.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Target Platforms

See Also

Reference

RecoveryManager Class
RecoveryManager Members
Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement.Recovery Namespace