Wikipedia defines an oath of office as:
An oath or affirmation a person takes before undertaking the duties of an office, usually a position in government or within a religious body, although such oaths are sometimes required of officers of other organisations. Such oaths are often required by the laws of the state, religious body, or other organization before the person may actually exercise the powers of the office or any religious body.
It may be administered at an inauguration, coronation, enthronement, or other ceremony connected with the taking up of office itself, or it may be administered privately. In some cases it may be administered privately and then repeated during a public ceremony.