Ezra 10:5

Then arose Ezra, and made the chief priests, the Levites, and all Israel, to swear that they should do according to this word. And they sware.

Shechaniah urged that the matter belonged to Ezra, and Ezra arose and took leadership of the response. He made the chief priests, the Levites, and all Israel swear to do according to the proposed word to address their transgression. What they swore was to carry out Shechaniah's proposal to enter a covenant with God to forsake the sin of taking strange wives and to act and be judged according to God's law.

Their oath was a solemn commitment to forsake the sin and act according to God's law. It secured the people's pledged commitment to follow the instruction for dealing with their wrongdoing. That oath began a reformation in which the repentant were led to forsake sin and live in obedience to God's law. The reformation was guided by careful attention to each individual case, with regard to the holiness of the law and the blessings of obedience.