Background: With a rapidly aging population, the need for endoscopic retrograde cholangiopancreatography (ERCP) is increasing. The commonly used sedation anesthesia in ERCP is a combination of propofol and fentanyl, even though fentanyl may cause some adverse reactions such as respiratory depression. Objectives: This study aimed to evaluate the efficacy of oxycodone combined with propofol versus fentanyl combined with propofol for sedation anesthesia during ERCP. Methods: A total of 193 patients aged from 65 to 80 years undergoing ERCP were enrolled and randomized into two groups: an “oxycodone combined with propofol” group (group OP, n = 97) and a “fentanyl combined with propofol” group (group FP, n = 96). The rate of perioperative adverse events as well as the recovery time, patients’ satisfaction, and endoscopists’ satisfaction were noted. Results: There was no difference in the frequency of hypotension or bradycardia between the two groups, but there were more episodes of desaturation (SpO<sub>2</sub> <90% for >10 s in 8.3%), postoperative nausea (7.3%), and vomiting (5.2%) in group FP than in group OP. Patients’ satisfaction in group FP was lower than that in group OP. The recovery time was longer in group FP than in group OP. Conclusions: Oxycodone combined with propofol was effective in ERCP, with a low incidence of perioperative adverse events.