In general, I would advise something more powerful than 9mm for bears, too. However, in practice it has been more effective than I would have thought:
https://www.ammoland.com/2018/02/defense-against-bears-with-pistols-97-success-rate-37-incidents-by-caliber/#ixzz5sS36vLdL