One liner to kill Oracle expdp job

2014-01-30

This is a very obscure one liner to kill a running an Oracle expdp job.

Background:

Pre requisites for my one liner:

Here comes the one-liner which works in ksh:

expdp attach=$(grep Starting $(ls -tr exp*.log | tail -1) | cut -d":" -f 1 | cut -d"." -f 2 | sed -e 's/"//g')<$(printf "/ as sysdbanKILL_JOBnyesn">/tmp/someFile$(echo /tmp/someFile)

That's it! If the expdp job exits with an exit code > 0 (echo $?), it failed. Just run the one liner again. The output of the one liner will hang for some seconds at the question "are you really really sure: [yes]/no:", which is normal. Just wait.

Over and out!