You should be fine with 5W30 although there should be a recommendation on the oil cap as to what grade is factory recommended.
I would go with a 10w-30 if your living some where were it is warm.
Make sure it's sythetic. That year of BMW specifies that.
Looking for a Used 5 Series in your area?
CarGurus has 16,369 nationwide 5 Series listings starting at $995.
Search BMW 5 Series Questions
BMW 5 Series Experts