Home » RDBMS Server » Server Administration » How to copy an Entity and Related Objects?
How to copy an Entity and Related Objects? [message #285112] Mon, 03 December 2007 09:59 Go to next message
MikeSanders
Messages: 6
Registered: December 2007
Junior Member
Hi.

I'm a DBA in a medium software billing company.

The testing team people ask me replicate a customer (and all its data) from the System-Test DB to a DB of a certain tester.

Problem is the CUSTOMER table has releations to several other tables (ACCOUNTS, BILLS, etc) which in turn has relations to other tables.

As I see it I have two options:

1. Copy the entire System Tests DB to the oother DB. This is bad - this DB is very large and we don't have enough disk space.

2. Work out manually all the relations of the CUSTOMER and write a script to copy just the relevant tables/records for the specific customer. This seems too much work...


Anybody familiar with a script/tool to perform this?
Re: How to copy an Entity and Related Objects? [message #285113 is a reply to message #285112] Mon, 03 December 2007 10:09 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

Did you try with export / import option or DB link ?

[Updated on: Mon, 03 December 2007 10:09]

Report message to a moderator

Re: How to copy an Entity and Related Objects? [message #285138 is a reply to message #285113] Mon, 03 December 2007 12:42 Go to previous messageGo to next message
MikeSanders
Messages: 6
Registered: December 2007
Junior Member
Yes, I use DB-Link.

My problem is the part where I need to locate the records that are related.

For example:
I need to copy CUSTOMER whose CUSTOMER_ID is 30.
In ACCOUNT table, there's a FK to the CUSTOMER table. So I need to copy the ACCOUBT records where CUSTOMER_ID = 30.
And so it goes, for BILLS, and other tables.

The CUSTOMER is related to 6 tables! And these tables are releated as well..
Re: How to copy an Entity and Related Objects? [message #285199 is a reply to message #285138] Mon, 03 December 2007 22:25 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

Then why not your copy all related tables ( 6 tables is not big value).
Re: How to copy an Entity and Related Objects? [message #285210 is a reply to message #285112] Mon, 03 December 2007 23:03 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

First only create the tables without any data and then insert only selected data either by db link or by export/import accordingly.
Re: How to copy an Entity and Related Objects? [message #285294 is a reply to message #285210] Tue, 04 December 2007 03:47 Go to previous messageGo to next message
MikeSanders
Messages: 6
Registered: December 2007
Junior Member
Guys, thank you for your help.

However, this doesn't answer my question.
It's easy to copy records from one DB to another.

The problem is that you need to work out all the specific IDs of the relations, for a specific customer. This may be 20 different IDs!

And when people come and ask me to copy another customer - then I have to repeat the procees all over again - for THIS new customer.

This is a LOT of work..

Any ideas will be appreciated.
Re: How to copy an Entity and Related Objects? [message #285300 is a reply to message #285294] Tue, 04 December 2007 03:52 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is not a DBA task this is an applicative one.
Development team SHOULD give you a script or API to do this.
Only the application knows the relation between entities and the functional consistency.

Regards
Michel
Re: How to copy an Entity and Related Objects? [message #293691 is a reply to message #285300] Mon, 14 January 2008 10:26 Go to previous message
javon
Messages: 7
Registered: December 2007
Junior Member
Hi.

There's a software that does just what you describe.
Check this link:
http://forums.oracle.com/forums/thread.jspa?messageID=2278588
Previous Topic: DB Creation
Next Topic: ORA-01555 caused by SQL statement below
Goto Forum:
  


Current Time: Fri Dec 02 14:12:27 CST 2016

Total time taken to generate the page: 0.16601 seconds