I really don’t like answering prompts. It takes extra time, requires extra keystrokes, and makes documenting a process somewhat cumbersome. So, I avoid it whenever possible.
In the world of an Oracle E-Business Suite DBA, one command that we run quite often is adop
. Unfortunately, the adop
command doesn’t directly support command-line arguments for certain common things (passwords, in particular). So, here is what I tend to do:
First, I tend to manually assign the passwords to variables in my current session. The environment variables go away when the session ends. This also makes documentation easier.
export APPSPW=apps
export SYSTEMPW=manager
export WLADMIN=weblogic
PREPARE
{ echo ${APPSPW}; echo ${SYSTEMPW}; echo ${WLADMIN}; }|\
adop phase=prepare
APPLY
{ echo ${APPSPW}; echo ${SYSTEMPW}; echo ${WLADMIN}; }|\
adop phase=apply patches=1234567
FINALIZE
{ echo ${APPSPW}; echo ${SYSTEMPW}; echo ${WLADMIN}; }|\
adop phase=finalize
CUTOVER
{ echo ${APPSPW}; echo ${SYSTEMPW}; echo ${WLADMIN}; }|\
adop phase=cutover
CLEANUP
{ echo ${APPSPW}; echo ${SYSTEMPW}; echo ${WLADMIN}; }|\
adop phase=cleanup
FS_CLONE
{ echo ${APPSPW}; echo ${SYSTEMPW}; echo ${WLADMIN}; }|\
adop phase=fs_clone
A brief warning, though. I typically run the adop phase=abort
command interactively as there are additional prompts that will need to be answered. Fortunately, I don’t have to do that quite as often…