modified db query, to be more like FileReplicas API
putting back -se_name option and made it mutually exclusive with -node and -injected options