How to secure a toilet
1:   Are 2 bolts enough for securing a toilet or should all 4 bolts
  be used when available?


I have not seen toilets with 4 bolts - only 2 bolts. 2 should be fine if the toilet is installed correctly. Level with the floor and attached to the flange spud. You should have a wax ring (although you might have a wax ring and a spacer - check for exactly what you have - you might take some pictures and post.


  2:  Is shimming a robust way of securing toilets and avoiding
  rocking, or is there a better way?


The real issue here is why do you need to shim the toilet in the first place. How much rocking do you have ?... Does your toilet flange have a spacer attached to it ? If so remove the spacer. 

Did you remove the old wax ring before installing a new one ?

How does your floor level sit - did someone change out the flooring and not set it correctly or install it with out leveling with the toilet flange. I have seen ceramic tile that had mastic 2 inches thick in order to have the floor height match the toilet drain spud.

You can use wooden shims or better yet the plastic ones - but first make sure you really need the shims. I re-did my bathroom with new ceramic tile - when I installed the tile I made sure the toilet level would be fine with the tile - some people don't think this far ahead.


  3:  Is any distance between the water tank and the wall behind the
  toilet a problem that needs bracing?


There should not be if the toilet is assembled correctly - again the key is correctly assembling the toilet. The Tank has 2 bolts and a rubber seal - install the seal correctly and make sure it is seated properly - wiggle the tank a bit to make sure it seats - tighten your tank screws (be careful as you can break the tank) a slight rock is not an issue - and it will move slightly.

Some videos that might be helpful to you ..

https://www.youtube.com/watch?v=Y_hVZ3rPzm4

https://www.youtube.com/watch?v=wM-6bgV7G5s