如何在 MSBuild 中执行 Oracle 实用程序

发布于 2024-07-30 06:46:42 字数 60 浏览 8 评论 0原文

我想在 MSBuild 中执行 oracle 的导入实用程序作为任务。 请给予详细解答。 我是初学者。

I want to execute the oracle's import utility in MSBuild as a task. Please give a detailed answer. I am a beginner.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

闻呓 2024-08-06 06:46:42

您可能需要查看 MSBuild Exec 任务。 我不熟悉您指定的 Oracle 实用程序,但我知道 Exec 任务将运行大多数可以从命令行运行的任何内容。 您需要的相关 MSBuild 配置可能如下所示:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="DoImport">
        <Exec 
            Command="imp SYSTEM/password FILE=dba.dmp FROMUSER=scott TABLES=(dept,emp)" />
    </Target>
</Project>

You may want to look into the MSBuild Exec task. I am not familiar with the Oracle utility you specified, but I do know that the Exec task will run most anything that can be run from a command line. The relevant MSBuild configuration you would need might looks something like this:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="DoImport">
        <Exec 
            Command="imp SYSTEM/password FILE=dba.dmp FROMUSER=scott TABLES=(dept,emp)" />
    </Target>
</Project>
涙—继续流 2024-08-06 06:46:42

一个稍微冗长但更好的解决方案是开发一个自定义任务来扩展 ToolTask​​ 基类。 这将允许更好的日志记录,并且您可以使用特定的 XML 属性来定义参数。

我为 SqlPlus 开发了一个,它运行得非常好。

A somewhat more long-winded but better solution is to develop a custom Task that extends the ToolTask base class. This will allow better logging and you can define the arguments by using specific XML attributes.

I've developed one for SqlPlus and it works really well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文