The danger of bears in Hokkaido is real and should be taken into account, when your life is dear to you.
Every year about five people are eaten by bears.
Planning to sleep alone by tent, this got me frightened a bit and I started asking people, how to survive an bear attack. That is why exclusively on dwelling in dreams, you will a the
1) Bears usually avoid big groups of people. So the more people you take with you, the less likely an attack by a bear. If you are alone, try to stay in areas with people, whenever possible. Try also to use camping grounds whenever you can find one.
2) Bears have one weak spot, they are very sensitive to sound. That means a very loud noise can scare them away. So what I did is, I went to a 100 Yen store and armed myself with pot lid and a long iron sponge and tied them with a cord to my backpack, so they would always be in reach.
3) If the sound does not work, or the bear won't run away there will be a time when you will want to run away. Here is what you should keep in mind: Trees are not safe, don't try climbing trees like in movies, first it usually is more difficult than you think and second the bear is at you before you know it. So let's run away. Bears are very good and extremely fast in climbing upwards a slop or mountain, so you will never be able to outrun them. However they are very bad concerning climbing downwards. That is because of their huge weight (800 Kilo) they need to put a lot of effort in keeping balance while climbing down, that the weight won't get hold of them and let them roll downwards. So you can outrun a bear downwards.
4) Running away has the disadvantage that the bear will think your prey. So only run if the way is downwards and if you have any quick prospect of getting to safety . The final option is to drop dead. If the bear is not very aggressive your chances are high, that he will quickly loose interest in you. Don't move even when he examines you by stroking you.
That's it! Keep In mind that bears are dangerous, and thus you'd better keep your distance so you never need to use the advice above.
In Hokkaido I also heard a story where a bear entered a camping ground and open a tent with his paw. The girl inside was so surprised she kicked the bear with all her might. This frightened the bear so much, that he ran back into the forest. So I guess we can add
5) Fight the bear honorably and try to land many kicks.