This is the enlisted oath:
"I, _____, do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; and that I will obey the orders of the President of the United States and the orders of the officers appointed over me, according to regulations and the Uniform Code of Military Justice. So help me God."
This is the officer oath:
"I, _____ (SSAN), having been appointed an officer in the _____ (Military Branch) of the United States, as indicated above in the grade of _____ do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign or domestic, that I will bear true faith and allegiance to the same; that I take this obligation freely, without any mental reservation or purpose of evasion; and that I will well and faithfully discharge the duties of the office upon which I am about to enter; So help me God."
I took the enlisted oath, being enlisted. As a retiree, I am no longer subject to obeying the orders of the President nor any serving officer in the military nor am I subject to the UCMJ. The same holds true for anyone who was enlisted and subsequently was discharged from military service. That is to say, once you retire OR are discharged from service, you are no longer subject to that oath.
Now, the officer oath is lifetime unless you resign your commission. If you do so, you are no longer subject to the oath as you are no longer an officer.