Thank you for your question and welcome to Just Answer.
A very good way to control dental pain using over the counter medications is to switch between taking 400 milligrams of ibuprofen (e.g., 2 tablets of Advil), and 1000 milligrams of acetaminophen (e.g., 2 tablets of extra-strength Tylenol) every 3 hours. Be careful not to use these medications if you have had previous adverse reactions to either, or if you have had gastritis or peptic ulcer disease in the past, or if you have liver disease.
In addition, you can try "Toothache Drops" available at your pharmacy. This is clove oil (eugenol) which is very soothing to an exposed tooth. Place a drop or two on a cotton pellet and place on the tooth or on the hole of the tooth.
This advice will only mask the symptom of pain that is associated with whatever the source of the problem is. You should see your dentist to find out the problem and have it treated.
I hope this answers your question. If you would like to discuss this further or have any additional questions, please reply to my answer and I will get right back to you.
Sincerely, XXXXX XXXXX DDS