Ulcer is nothing but a break or discontinuity in the epithelium which will cause pain , soarness difficulty in intake of food etc.
Ulcers are caused due to trauma from any sharp tooth or sharp food, nutritional deficiencies, gastrointestinal distress syndrome.
You can apply Dolo gel and take
vitamin B tablets.
Ulcers usually subside by 5to 7days so you can wait and if it does not subside you can consult a dentist.