What can I do when anxiety causes me to perform poorly in oral exams and class discussions?

I'm not a mental health professional, but it sounds like your anxiety is interfering with your performance in this class.

You may be eligible for some accommodation to immediately triage your grade. If your university has a center for students with disabilities, talk to them and see if there's a process to get you started to talk to a doctor and get a diagnosis about whether your anxiety is serious enough for accommodation. They may have some kind of form you need to bring to the appointment, and can otherwise help you with bureaucracy.

I would also talk to your professor. While you are likely meant to get better at public speaking in this class, many profs will work with you to meet you where you're at and find additional ways to assess your comprehension of the material independently of testing your public speaking.

Also I agree practice will help in the long run, but that doesn't mean you need to fail the class in the short run! Ask for some help and see if people will work with you. No university class should feel this hopeless. You should be able to get better in the timescale of the class if you put in work. Ask for help if the conditions seem insurmountable.