hello and welcome,
as you mentioned,your upper right tooth has dislocated 8 years ago,there is chance of traumatic injury
occured with the tooth resulting in periapical abscess
as well as apical periodontitis
Usually in such cases,root canal treatment
is indicated depending on the condition of tooth.
The pus has to be drained and curetted,
Please do visit an endodontist and get the treatment.
analgesics will give only temporary relief.
for permanent cure,you must get the treatment done.
ANTibiotics has to be administered for the infection underlying.