简体   繁体   English

在命令文件中执行的Oracle expdp命令不遵循%U,而是使用不带序列的_U

[英]Oracle expdp command executed in a command file not honoring %U instead using _U without a sequence

I have generated a bunch of expdp commands and stored them in a .cmd file. 我生成了一堆expdp命令,并将它们存储在.cmd文件中。 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. 如果我尝试执行整个.cmd文件,则效果也很好。

I need to use PARALLEL and %U, so I have added that to the commands. 我需要使用PARALLEL和%U,因此已将其添加到命令中。 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. 再次,我在命令提示符下手动运行它,它很好用,并通过创建多个具有序列号的.dmp文件来纪念%U。 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. 但是,当使用PARALLEL和%U执行整个.cmd文件时,它不支持%U,而仅使用_U创建一个.dmp文件。 How can I fix this so it will create the multiple dmp files? 如何解决此问题,以便创建多个dmp文件?

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 expdp TEST / PWD @ ORCL模式= TEST目录= EXPORT_DIR并行= 4 REUSE_DUMPFILES = Y dumpfile = TEST_20190906_%U.dmp日志文件= TEST_20190906_expdp.log

You can escape the % sign to stop Windows swallowing it before Oracle gets a chance to see it: 您可以转义%符号,以在Oracle有机会看到它之前停止Windows吞咽它:

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

As a quick test, in a .cmd file: 作为一个快速测试,在.cmd文件中:

@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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM