Add a tool to set the database SID value properly.

This tool can resolve the sam_rids_to_names: possible deadlock

Ticket: #5828