This song has quite a story behind it, because it isn't really Ozzy's. The song was written by Steve Overland and his brother Chris for their band FM. Their bassist at the time was Phil Soussan. Soussan later on left the band and went on to play with (among others) Ozzy. When he started playing "Shot In The Dark" at a rehearsal, Ozzy thought that Soussan had written the song himself, but he didn't like the lyrics and he changed them.
Meanwhile, Steve Overland and Ozzy have come to an agreement regarding the song ─ neither made any problem out of the other one playing their version of the song, and I believe Ozzy has financially compensated Steve Overland for having had such a success with a song Steve had written but had never received any royalties for.
The version below is the original by FM.