[英]Tool to extract specific data from a Oracle database (with over 100 tables) to another Oracle Database which has the structure but not the data
I have the following challenge: I have a large Oracle Database # 1 with 100 tables which are linked through one to many and many to many relationship.我面临以下挑战:我有一个大型Oracle 数据库 # 1,其中包含 100 个表,这些表通过一对多和多对多关系链接。
I need to copy only certain rows from the main Oracle Database # 1 into a Oracle Database #2 which has the same data structure ( tables) but no data.我只需要将主Oracle 数据库 #1中的某些行复制到具有相同数据结构(表)但没有数据的Oracle 数据库 #2中。 Is there a tool that helps me automate the load process, taking into account the constraints that arise from one-many and many-many relationships.有没有一种工具可以帮助我自动化加载过程,同时考虑到由一对多和多对多关系产生的约束。
It is a relatively simple task to "copy" all the data. “复制”所有数据是一项相对简单的任务。 How?如何? Using Export/Import Data Pump (or even the original exp/imp utilities).使用导出/导入数据泵(甚至是原始的 exp/imp 实用程序)。
Although you can apply the WHERE
clause to export, I'm not sure that doing that for 100 tables is feasible.虽然您可以应用WHERE
子句进行导出,但我不确定对 100 个表执行此操作是否可行。 You should know how tables are related to each other so that you wouldn't miss a record.您应该知道表之间是如何相互关联的,这样您就不会错过任何记录。
So, if you're about to do it table-by-table, perhaps it is a better option to write (PL/)SQL code which will do the job.因此,如果您要逐个表地执行此操作,那么编写 (PL/)SQL 代码来完成这项工作也许是更好的选择。 A procedure, maybe?一个程序,也许? Using an IN
parameter, you'd be able to copy any set-of-records you want.使用IN
参数,您将能够复制您想要的任何记录集。 Of course, you'd have to maintain the procedure if new tables are created or relationships are modifed.当然,如果创建新表或修改关系,则必须维护该过程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.