I'm sorry you've had that experience, where I lived in Oakland nothing like that happened with any regularity. And I did not live in one of the nicest neighborhoods in Oakland.
But I mean, it is a city. These things happen in cities, I just don't see how it could credibly be claimed to be worse than San Francisco when the geographical variability is so high.
Anything I saw in Oakland was no worse than any other city I have ever lived in. I don't really know a better way to put it, I'm not saying it's perfect, I'm saying it's as fine as anywhere else of comparable density.