Oracle 是否有相当于 mysqldump 的工具
有没有办法将 oracle 表的内容转储到格式化为 INSERT 语句的文件中。我无法使用 oradump,因为它是 GPL 协议。我将从 Perl CGI 脚本运行它。我正在寻找使用单个命令直接从 Oracle 服务器转储数据的工具。使用 perl 运行 select 并创建插入语句太慢,因为会有大量数据。
我知道我可以使用 spool 命令和服务器端的 plsql 块来做到这一点。但是是否有内置命令可以执行此操作,而不是自己格式化 INSERT 语句?
Is there a way to dump the content of a oracle table in to a file formated as INSERT statements. I can't use oradump as it is on GPL. I will be running it from a perl CGI script. I am looking for something to dump data directly from oracle server using a single command. Running a select and creating insert statements using perl is too slow as there will be lot of data.
I know I can probably do this using spool command and a plsql block at server side. But is there a built in command to do this instead of formating the INSERT statements myself?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
无论您如何执行,生成大量 INSERT 语句都可能会很慢,并且执行所有插入也会很慢。你为什么要这样做?如果您无法使用数据泵等工具,更有效的解决方案是生成一个文本文件,稍后可以使用 SQL*Loader 导入。
Generating large numbers of INSERT statement will likely be slow no matter how you do it, and it will be slow to execute all the inserts as well. Why are you doing this? A more efficient solution, if you can't use a tool like data pump, would be to generate a text file you could later import with SQL*Loader.
简短的回答是:不。
使用批量读取可以对生成这些插入语句的性能产生非常积极的影响。 dbi 很有可能支持批量获取。检查并尝试一下。我还编写了一个名为 fun 的小程序,它在 PRO*c 中生成 sql 加载程序文件。不是最好的代码,但您可以从我最近写的博客中获取它 http://ronr.blogspot.com/2010/11/proc-and-xcode-32-how-to-get-it-working.html 在文章中我解释了如何使用 xcode 使 PRO*c 在 mac 上工作,并通过巧合的 wat fun 来实现该程序。 (快速卸载)。它几乎满足你的要求,你可以稍微调整一下......
我希望它有帮助。
the short answer is : NO.
The performance of generating those insert statements can be very positively influenced using bulk fetches. There is a good chance that dbi does support bulk fetches. Check it out and experiment with it. I also wrote a little program called fun that generates sql loader files in PRO*c. Not the best code but you can fetch it from a recent blog I wrote http://ronr.blogspot.com/2010/11/proc-and-xcode-32-how-to-get-it-working.html In the article I explained how to get PRO*c working on a mac using xcode and the program by coincident wat fun. (Fast Un Load). It almost does what you want, you can adjust it a little...
I hope it helps.