I need to write a single script in which I have to execute a certain set of commands as oracle user, then become root user and execute a few commands and and then back to oracle user. All of this has to be done in a single script...how to do this?
To be more specific, I am basically automating OTD(Oracle Traffic Director) installation and configuration for which I have been asked to write a shell script. All the steps in its installation are done as oracle user, but these two commands:

chown root portbind

chmod 4750 portbind 

have to be executed after becoming a root user, the further steps of automation have to be done as oracle user again. So I need a way to switch users(root and oracle) in my script.