Here are some relevant portions of the Catechism of the Catholic Church:
2147 Promises made to others in God’s name engage the divine honor, fidelity, truthfulness, and authority. They must be respected in justice. To be unfaithful to them is to misuse God’s name and in some way to make God out to be a liar.77
**2150 **The second commandment forbids false oaths. Taking an oath or swearing is to take God as witness to what one affirms. It is to invoke the divine truthfulness as a pledge of one’s own truthfulness. An oath engages the Lord’s name. "You shall fear the LORD your God; you shall serve him, and swear by his name."81
**2151 **Rejection of false oaths is a duty toward God. As Creator and Lord, God is the norm of all truth. Human speech is either in accord with or in opposition to God who is Truth itself. When it is truthful and legitimate, an oath highlights the relationship of human speech with God’s truth. A false oath calls on God to be witness to a lie.
**2152 **A person commits *perjury *when he makes a promise under oath with no intention of keeping it, or when after promising on oath he does not keep it. Perjury is a grave lack of respect for the Lord of all speech. Pledging oneself by oath to commit an evil deed is contrary to the holiness of the divine name.
**2153 **In the Sermon on the Mount, Jesus explained the second commandment: "You have heard that it was said to the men of old, ‘You shall not swear falsely, but shall perform to the Lord what you have sworn.’ But I say to you, Do not swear at all. . . . Let what you say be simply ‘Yes’ or ‘No’; anything more than this comes from the evil one."82 Jesus teaches that every oath involves a reference to God and that God’s presence and his truth must be honored in all speech. Discretion in calling upon God is allied with a respectful awareness of his presence, which all our assertions either witness to or mock.
2154 Following St. Paul,83 the tradition of the Church has understood Jesus’ words as not excluding oaths made for grave and right reasons (for example, in court). "An oath, that is the invocation of the divine name as a witness to truth, cannot be taken unless in truth, in judgment, and in justice."84
2155 The holiness of the divine name demands that we neither use it for trivial matters, nor take an oath which on the basis of the circumstances could be interpreted as approval of an authority unjustly requiring it. When an oath is required by illegitimate civil authorities, it may be refused. It must be refused when it is required for purposes contrary to the dignity of persons or to ecclesial communion.
My take on all this? It is sometimes appropriate to take an oath. It should not be done lightly or in trivial matters. You should fully intend to keep the promises made under oath.
You should be allowed to read the text of the oath well in advance so you can have time to decide whether it is a promise you intend to keep and feel comfortable making with God as your witness. (And make sure it only calls upon the one true God as we understand Him; do not take an oath calling upon any false deities.)
If taking such an oath is likely to make your scrupulosity worse, talk it over with your priest before doing it. It might not be a good idea for some people.