The gunman who killed nine people in Munich was obsessed with mass shootings and had an obvious link to Norwegian mass murderer Anders Behring Breivik, German police say.