将 Oracle 表数据转储到 INSERT 语句
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1034782/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Dump Oracle table(s) data to INSERT statements
提问by ThaDon
I have a requirement right now where my client's business people have populated a website with a bunch of data. They want the site to go live to production with the UAT data so that on launch day the site is not barren.
我现在有一个要求,我客户的业务人员用一堆数据填充了一个网站。他们希望网站使用 UAT 数据上线生产,以便在发布当天网站不会变得贫瘠。
Now, the webservers and data centers are managed by a certain Big Blue friend of ours and they refuse to give me a user account on the UAT Database server, not even with access restricted only to the tables my app owns. That situation can be left to another discussion.
现在,网络服务器和数据中心由我们的某个 Big Blue 朋友管理,他们拒绝给我 UAT 数据库服务器上的用户帐户,即使访问仅限于我的应用程序拥有的表。这种情况可以留待另一个讨论。
So, originally I was simply going to connected up to UAT using SQL Developer, and run it's nifty little INSERT statement export tool which will dump the data from a table into a series of INSERT statements. Since I can't have access to UAT, I can't do that.
所以,最初我只是想使用 SQL Developer 连接到 UAT,然后运行它的漂亮的小 INSERT 语句导出工具,它将表中的数据转储到一系列 INSERT 语句中。因为我无法访问 UAT,所以我不能这样做。
Is there a method by which I can literally hand my blue friends some PL/SQL code which will dump all the table data from specified tables to INSERT statements? Preferably to a file (instead of the console)? This way they can take those INSERT statements and execute them against UAT.
有没有一种方法可以让我的蓝色朋友们真正地将一些 PL/SQL 代码从指定的表中转储到 INSERT 语句中?最好是文件(而不是控制台)?通过这种方式,他们可以使用这些 INSERT 语句并针对 UAT 执行它们。
采纳答案by Steve Broberg
I just answered a similar question yesterday. It may not be exactly what you want (and it is still incomplete), but it probably has the information to get you started to complete the scripts yourself. Check it out.
昨天刚回答了一个类似的问题。它可能不完全是您想要的(而且它仍然不完整),但它可能包含让您开始自己完成脚本的信息。 检查一下。
回答by Rob van Laarhoven
Let the Big Blue friend sort this out. If they don't give you access to the databases then they should populate the production database. Give them a list of tables an let them export them from UAT and import it into production. Export / import or datapump is the standard for these kind of operations, you should not be forced to invent your own because of their lack of cooperation.
让蓝色巨人的朋友解决这个问题。如果他们不让您访问数据库,那么他们应该填充生产数据库。给他们一个表列表,让他们从 UAT 导出它们并将其导入到生产中。导出/导入或数据泵是此类操作的标准,您不应该因为缺乏合作而被迫自己发明。
回答by akf
have you considered exporting the data from your UAT db and then importing itto your local?
您是否考虑过从 UAT 数据库导出数据,然后将其导入本地?