Hello Mam, There are various types of ulcers and where different type of ulcers require a different type of treatment, first note the on set of unlcer, whether it's painful or it comes and goes often or it been there for long time, if it comes occasionally then it might be due to
vitamin deficiency, it it doesn't go for a longer time or you notice any near by tooth with sharp margin then you have to get your consult done with your dentist.
Next Steps
Dolo gel can be applied if you feel any kind of pain over there only if the uncler is there for short period of time.
Health Tips
Drink a lot if water.