Use oraenv script located in $ORACLE_HOME/bin. Variable ORAENV_ASK=YES makes oraenv scripts conversational.