Fix queries for Oracle compatibility

They were using a MySQL only feature in the group by
to prevent duplicates. Do the duplicate filtering
after the database query to keep a single compatible query.
Deploy DBS3Upload in standard WMAgent

Add configuration and changes to deploy
both DBS uploads for DBS3 and DBS2
in the current WMAgent
Merge pull request #4591 from dballesteros7/DBS3

Deploy DBS3Upload in standard WMAgent
Merge pull request #4589 from dballesteros7/DBS-DBS-DBS

Fix queries for Oracle compatibility