I have generated a bunch of expdp commands and stored them in a .cmd file. When I execute one of the commands by copy and paste into a command prompt, it works fine. If I try to execute the whole .cmd file, it also works great.

I need to use PARALLEL and %U, so I have added that to the commands. Again, I run it manually in the command prompt and it works great and honors the %U by creating multiple .dmp files with a sequence number. But when executing the whole .cmd file with the PARALLEL and %U, it does not honor the %U and just creates one .dmp file with _U. How can I fix this so it will create the multiple dmp files?

Here is an example of one of my commands that executes fine when copied and pasted into a command prompt but does not work right when executed as a file.

expdp TEST/PWD@ORCL schemas=TEST directory=EXPORT_DIR parallel=4 REUSE_DUMPFILES=Y dumpfile=TEST_20190906_%U.dmp logfile=TEST_20190906_expdp.log


1 Answer 1


You can escape the % sign to stop Windows swallowing it before Oracle gets a chance to see it:

... dumpfile=TEST_20190906_%%U.dmp ...

As a quick test, in a .cmd file:

@echo expdp ... dumpfile=TEST_20190906_%U.dmp logfile=TEST_20190906_expdp.log
@echo expdp ... dumpfile=TEST_20190906_%%U.dmp logfile=TEST_20190906_expdp.log

then running that from a command prompt shows:

expdp ... dumpfile=TEST_20190906_U.dmp logfile=TEST_20190906_expdp.log
expdp ... dumpfile=TEST_20190906_%U.dmp logfile=TEST_20190906_expdp.log
  • Perfect!! Thank you!
    – Rita Bowers
    Sep 6, 2019 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.