You're absolutely correct that SNR, being a ratio, is dimensionless.
Now, the "dimension" dB (see Wikipedia) is not really a physical dimension like meters, seconds, or kilograms. Instead it's a special way to express dimensionless ratios using a logarithmic scale (see the table in the Wikipedia link). I only know of usages for expressing electric / electro-magnetic / acoustic power ratios.
The (rarely used) "base unit" Bel corresponds to a ratio of 10, meaning that 0 Bel is a factor of 1, 1 Bel a factor of 10, 2 Bel a factor of 100, and so on.
"dB" is a derived unit, being deci-Bel, i.e. one tenth of a Bel. So, 0 dB is a factor of 1, 10 dB a factor of 10, 20 dB a factor of 100, and so on.
As a final remark, of course your SNR formula does not give dB values, but simply ratios. Converting that to dB still needs to calculate the logarithm.