According to the people at Improbable Research, who collect interesting and completely ridiculous studies done in many scientific fields (including the social sciences), the longest known oath required of witnesses in a judicial proceeding was the oath required in Burmese courts until sometime in the 19th century. The oath was 374 words long, at least in its English translation as recorded in Burmah and the Burmese, an 1853 book by Kenneth R.H. Mackenzie.
It goes into slightly greater detail than the more familiar "truth and nothing but the truth" formulation we boringly use today:
"I will speak the truth. If I speak not the truth, may it be through the influence of the laws of demerit, viz., passion, anger, folly, pride, false opinion, immodesty, hard heartedness, and scepticism, so that when I and my relations are on land, land animals, as tigers, elephants, buffaloes, poisonous serpents, scorpions, &c, shall seize, crush, and bite us, so that we shall certainly die. Let the calamities occasioned by fire, water, rulers, thieves, and enemies oppress and destroy us, till we perish and come to utter destruction. Let us be subject to all the calamities that are within the body, and all that are without the body.
"May we be seized with madness, dumbness, blindness, deafness, leprosy and hydrophobia. May we be struck with thunderbolts and lightning, and come to sudden death. In the midst of not speaking truth, may I be taken with vomiting clotted black blood, and suddenly die before the assembled people. When I am going by water, may the water Nats [spirits] assault me, the boat be upset, and the property lost; and may alligators, porpoises, sharks, or other sea monsters, seize and crush me to death; and when I change worlds, may I not arrive among men or Nats, but suffer unmixed punishment and regret, in the utmost wretchedness, among the four states of punishment, Hell, Prita, Beasts and Athurakai."
I would not be too concerned about the porpoises, but the rest of that seems fairly nasty.
Just in case the oath itself was not enough, the court also got into the act, praying that false witnesses "die of bad diseases, be bitten by crocodiles, [and] be drowned. . . . May they be killed with swords, lances and every sort of weapon. May they be precipitated into the eight great hells and the 120 smaller ones . . . May they be changed into dogs," and, worst of all, "may everyone ill-treat them and raise lawsuits against them."
Link: The Guardian
Link: The Annals of Improbable Research
Link: Burmah and the Burmese (scanned at Archive.org)