Home » RDBMS Server » Server Administration » What will be the fastest way to move a db data to another db(has data)? (Oracle 10.2.0.4, RHEL 5.5)
What will be the fastest way to move a db data to another db(has data)? [message #523545] Mon, 19 September 2011 05:33 Go to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Hi, guys
I have a requirement from our client.
There is two database A and B.
They has the same DB software version with the same platform.

Assume that we wanna to merge all the data in A db into B db.
What will be the most fastest solution for this scenario?

PS: B db has some data.

I wanna to try use transport tablespaces, but I am worrying about the pl/sql objects, such as package, function, procedure, trigger.

Any idea?
Thanks very much.
BR,
Milo
Re: What will be the fastest way to move a db data to another db(has data)? [message #523547 is a reply to message #523545] Mon, 19 September 2011 05:35 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Are you supposed to do somwthing with the procedures etc?
Re: What will be the fastest way to move a db data to another db(has data)? [message #523548 is a reply to message #523547] Mon, 19 September 2011 05:41 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

These objects are stored in system or sysaux tablespaces, so should I exp these objects one by one and imp to the target db?

[Updated on: Mon, 19 September 2011 05:42]

Report message to a moderator

Re: What will be the fastest way to move a db data to another db(has data)? [message #523551 is a reply to message #523548] Mon, 19 September 2011 05:48 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
What objects? Do they have equivalents in the other DB? If so which version do you want?
Re: What will be the fastest way to move a db data to another db(has data)? [message #523555 is a reply to message #523551] Mon, 19 September 2011 05:52 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

PL/SQL objects, procedures, function, trigger,etc.
No, A db and B db are not the same branch.
Re: What will be the fastest way to move a db data to another db(has data)? [message #523562 is a reply to message #523545] Mon, 19 September 2011 06:08 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Data Pump.

Regards
Michel
Re: What will be the fastest way to move a db data to another db(has data)? [message #523568 is a reply to message #523555] Mon, 19 September 2011 06:50 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
snowball wrote on Mon, 19 September 2011 11:52
PL/SQL objects, procedures, function, trigger,etc.
No, A db and B db are not the same branch.


That answers my first question but not the other two.
Re: What will be the fastest way to move a db data to another db(has data)? [message #523601 is a reply to message #523568] Mon, 19 September 2011 08:37 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

cookiemonster wrote on Mon, 19 September 2011 19:50
snowball wrote on Mon, 19 September 2011 11:52
PL/SQL objects, procedures, function, trigger,etc.
No, A db and B db are not the same branch.


That answers my first question but not the other two.


Do they have equivalents in the other DB? If so which version do you want?


1. What do you means equivalents? You means they have same definition? If so, no.

2. If the first question is what you mean, then i don't have the version to keep in both site. Smile

Thanks,
Milo

[Updated on: Mon, 19 September 2011 08:49]

Report message to a moderator

Re: What will be the fastest way to move a db data to another db(has data)? [message #523608 is a reply to message #523601] Mon, 19 September 2011 09:09 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Do you want to replace the procedures/functions/triggers in DB B with the equivalent versions in DB A?
Re: What will be the fastest way to move a db data to another db(has data)? [message #523609 is a reply to message #523608] Mon, 19 September 2011 09:12 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>PL/SQL objects, procedures, function, trigger,etc.
>No, A db and B db are not the same branch.

if same OBJECT_NAME exists in both, what should result in target DB; overwrite, left intact?
Re: What will be the fastest way to move a db data to another db(has data)? [message #523616 is a reply to message #523609] Mon, 19 September 2011 09:32 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Oh, that depends.
In most case, the both objects should keep, but if the conflict really exists then the objects in DB A, should be renamed.
Re: What will be the fastest way to move a db data to another db(has data)? [message #523619 is a reply to message #523616] Mon, 19 September 2011 09:38 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
What would be the point of renaming objects?
I think you need to explain your problem in more detail because I'm confused as to what you are trying to achieve here.
Re: What will be the fastest way to move a db data to another db(has data)? [message #523627 is a reply to message #523619] Mon, 19 September 2011 09:54 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Oh, sorry.
DB A has smaller data compare with DB B.
The developers wanna merge the data in DB A into DB B, but the main function in DB B can not be affected.
So the confilict objects in DB A can be renamed or move in other schemas.

I don't know why, but this is what they want.

Thanks,
BR,
Milo
Re: What will be the fastest way to move a db data to another db(has data)? [message #523628 is a reply to message #523627] Mon, 19 September 2011 09:56 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why are we moving objects at all? Either you need them in DB B or you don't. If you don't then ignore them and just move the data.
Re: What will be the fastest way to move a db data to another db(has data)? [message #523632 is a reply to message #523628] Mon, 19 September 2011 10:07 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Yes, we need these objects in DB B.
Re: What will be the fastest way to move a db data to another db(has data)? [message #523634 is a reply to message #523632] Mon, 19 September 2011 10:10 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Then you need to specify, very clearly, exactly what you want to do with them. Your current description is vague.
Re: What will be the fastest way to move a db data to another db(has data)? [message #523636 is a reply to message #523634] Mon, 19 September 2011 10:16 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

I am also a little bit confuse now.
I will double check with client tomorrow.

Thanks.
BR,
Milo
Re: What will be the fastest way to move a db data to another db(has data)? [message #523686 is a reply to message #523636] Mon, 19 September 2011 21:35 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Hi,
I just asked the developers, they want to merge DB A into DB B, so that, DB A can be functional in DB B.
In short, the original schemas in DB B can not be changed according to this merging, the conflict schemas, in DB A should be adjusted.

Thanks,
Milo
Re: What will be the fastest way to move a db data to another db(has data)? [message #523687 is a reply to message #523686] Mon, 19 September 2011 22:19 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>In short, the original schemas in DB B can not be changed according to this merging, the conflict schemas, in DB A should be adjusted.
Forgive me, but what exactly does "adjusted" mean with regards to SQL & schemas?

How will you or I or anyone recognize when correct solution has been posted?
Re: What will be the fastest way to move a db data to another db(has data)? [message #523691 is a reply to message #523687] Mon, 19 September 2011 23:09 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

BlackSwan wrote on Tue, 20 September 2011 11:19
>In short, the original schemas in DB B can not be changed according to this merging, the conflict schemas, in DB A should be adjusted.
Forgive me, but what exactly does "adjusted" mean with regards to SQL & schemas?

How will you or I or anyone recognize when correct solution has been posted?


"Adjust" means rename the conflict objects , developers will also modify the sql according to this situation.

Such as, there is a conflict name "proc_fetch_product" in DB B, so it may need to renamed with "proc_fetch_product_1" in DB A before or during merging.

If it's still not clear, please tell me which items you wanna to know or give me a example. Smile

Thanks.
Milo

[Updated on: Mon, 19 September 2011 23:12]

Report message to a moderator

Re: What will be the fastest way to move a db data to another db(has data)? [message #523692 is a reply to message #523691] Mon, 19 September 2011 23:12 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>"Adjust" means rename the conflict objects , developers will also modify the sql according to this situation.
produce list including owner, object_name, object_type for all conflict objects that need to be renamed
Re: What will be the fastest way to move a db data to another db(has data)? [message #523693 is a reply to message #523692] Mon, 19 September 2011 23:16 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Ok. What if there are SMALL number of conflict objects and what if there are LARGE number of conflict objects?
Re: What will be the fastest way to move a db data to another db(has data)? [message #523694 is a reply to message #523693] Mon, 19 September 2011 23:32 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Ok. What if there are SMALL number of conflict objects and what if there are LARGE number of conflict objects?
ALL need to be resolved & handled; regardless of quantity; unless you are will to ignore a subset of object;
but then you need to explicitly decide which are handled & which get ignored so complete list is required.
Re: What will be the fastest way to move a db data to another db(has data)? [message #523741 is a reply to message #523694] Tue, 20 September 2011 04:02 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
You need to get the developers to manually sort out all the procedures/functions sql etc. Then you can import the data.
There is no generic way to do this.
Re: What will be the fastest way to move a db data to another db(has data)? [message #523784 is a reply to message #523741] Tue, 20 September 2011 07:20 Go to previous messageGo to next message
Baranor
Messages: 83
Registered: September 2011
Location: Netherlands
Member
Well, yes and no... you can store the relevant information in tables , import the tables into the new DB (i.e. source code, names, tables but not information et all) and write a package to check this info against objects in the new DB and rename if be, and then automatically update your tables with the new name ( and re-process a package or procedure if the renaming means it has to be re-done due to a change in a related package)... but its a hell of a lot of work, and unless you have thousands upon thousands of objects or have to do this on a regular basis, you're better off by doing it manually and then importing the data.

However, if done well then this system would be generic, in that you can grab a schema and export it via seperate tables, import tables and then compare. We use a similar system to roll out patches, but we only compare tables and keys, we simply overwrite all the packages, triggers and synonyms. There will be copious use of DBMS_SQL however, so you'd better know how to handle that, and having a good knowledge of all the relevant views also helps.

[Updated on: Tue, 20 September 2011 07:22]

Report message to a moderator

Re: What will be the fastest way to move a db data to another db(has data)? [message #523808 is a reply to message #523784] Tue, 20 September 2011 08:04 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'll rephrase - there's no pre-existing generic way of doing this.
Re: What will be the fastest way to move a db data to another db(has data)? [message #523814 is a reply to message #523808] Tue, 20 September 2011 08:13 Go to previous messageGo to next message
chris32680
Messages: 92
Registered: January 2006
Location: Charlotte
Member
Can you export the schema from DB A and just import it into a separate schema on B? or do they actually have to be "merged"?
Re: What will be the fastest way to move a db data to another db(has data)? [message #523879 is a reply to message #523741] Tue, 20 September 2011 20:56 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

cookiemonster wrote on Tue, 20 September 2011 17:02
You need to get the developers to manually sort out all the procedures/functions sql etc. Then you can import the data.
There is no generic way to do this.


You means sort the procedures/functions and find out confilit, then split the confilict and non-confilit to imp?
Re: What will be the fastest way to move a db data to another db(has data)? [message #523880 is a reply to message #523784] Tue, 20 September 2011 21:14 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Baranor wrote on Tue, 20 September 2011 20:20
Well, yes and no... you can store the relevant information in tables , import the tables into the new DB (i.e. source code, names, tables but not information et all) and write a package to check this info against objects in the new DB and rename if be, and then automatically update your tables with the new name ( and re-process a package or procedure if the renaming means it has to be re-done due to a change in a related package)... but its a hell of a lot of work, and unless you have thousands upon thousands of objects or have to do this on a regular basis, you're better off by doing it manually and then importing the data.

However, if done well then this system would be generic, in that you can grab a schema and export it via seperate tables, import tables and then compare. We use a similar system to roll out patches, but we only compare tables and keys, we simply overwrite all the packages, triggers and synonyms. There will be copious use of DBMS_SQL however, so you'd better know how to handle that, and having a good knowledge of all the relevant views also helps.


It seems that a little bit complicate for me. But, it's a still look like a convient solution.
Thanks.
Re: What will be the fastest way to move a db data to another db(has data)? [message #523881 is a reply to message #523814] Tue, 20 September 2011 21:25 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

chris32680 wrote on Tue, 20 September 2011 21:13
Can you export the schema from DB A and just import it into a separate schema on B? or do they actually have to be "merged"?


They don't need to "merged" actually.
Pretty cool. I will try it.

Thanks.

BR,
milo
Re: What will be the fastest way to move a db data to another db(has data)? [message #523894 is a reply to message #523881] Wed, 21 September 2011 00:43 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Michel Cadot wrote on Mon, 19 September 2011 13:08
Data Pump.

Regards
Michel

Re: What will be the fastest way to move a db data to another db(has data)? [message #523940 is a reply to message #523880] Wed, 21 September 2011 04:04 Go to previous messageGo to next message
Baranor
Messages: 83
Registered: September 2011
Location: Netherlands
Member
snowball wrote on Tue, 20 September 2011 21:14
Baranor wrote on Tue, 20 September 2011 20:20
Well, yes and no... you can store the relevant information in tables , import the tables into the new DB (i.e. source code, names, tables but not information et all) and write a package to check this info against objects in the new DB and rename if be, and then automatically update your tables with the new name ( and re-process a package or procedure if the renaming means it has to be re-done due to a change in a related package)... but its a hell of a lot of work, and unless you have thousands upon thousands of objects or have to do this on a regular basis, you're better off by doing it manually and then importing the data.

However, if done well then this system would be generic, in that you can grab a schema and export it via seperate tables, import tables and then compare. We use a similar system to roll out patches, but we only compare tables and keys, we simply overwrite all the packages, triggers and synonyms. There will be copious use of DBMS_SQL however, so you'd better know how to handle that, and having a good knowledge of all the relevant views also helps.


It seems that a little bit complicate for me. But, it's a still look like a convient solution.
Thanks.


Basically what you do is copy most of Oracle's Data Dictionary into seperate tables and then write code to compare and update. But it depends on your requirements, like I said... its not worth it for a one-off. I work for a company where constant patching and expanding of the software is normal, and then you need a better delivery system that does the job every time.
Re: What will be the fastest way to move a db data to another db(has data)? [message #524114 is a reply to message #523894] Wed, 21 September 2011 22:09 Go to previous messageGo to next message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Michel Cadot wrote on Wed, 21 September 2011 13:43
Michel Cadot wrote on Mon, 19 September 2011 13:08
Data Pump.

Regards
Michel


Thanks, Michel.
We've tested the solution works. So, tonight, we will start doing this.


Re: What will be the fastest way to move a db data to another db(has data)? [message #524115 is a reply to message #523940] Wed, 21 September 2011 22:12 Go to previous message
snowball
Messages: 229
Registered: April 2006
Location: China
Senior Member

Baranor wrote on Wed, 21 September 2011 17:04
snowball wrote on Tue, 20 September 2011 21:14
Baranor wrote on Tue, 20 September 2011 20:20
Well, yes and no... you can store the relevant information in tables , import the tables into the new DB (i.e. source code, names, tables but not information et all) and write a package to check this info against objects in the new DB and rename if be, and then automatically update your tables with the new name ( and re-process a package or procedure if the renaming means it has to be re-done due to a change in a related package)... but its a hell of a lot of work, and unless you have thousands upon thousands of objects or have to do this on a regular basis, you're better off by doing it manually and then importing the data.

However, if done well then this system would be generic, in that you can grab a schema and export it via seperate tables, import tables and then compare. We use a similar system to roll out patches, but we only compare tables and keys, we simply overwrite all the packages, triggers and synonyms. There will be copious use of DBMS_SQL however, so you'd better know how to handle that, and having a good knowledge of all the relevant views also helps.


It seems that a little bit complicate for me. But, it's a still look like a convient solution.
Thanks.


Basically what you do is copy most of Oracle's Data Dictionary into seperate tables and then write code to compare and update. But it depends on your requirements, like I said... its not worth it for a one-off. I work for a company where constant patching and expanding of the software is normal, and then you need a better delivery system that does the job every time.



Hi, Baranor
It should be the one-off moving as far as I know. But it's good to know there is a reusable solution. Smile
Thanks,

Milo
Previous Topic: ORA-00257: archiver error.
Next Topic: USER ID FETCHING
Goto Forum:
  


Current Time: Wed Apr 24 10:20:02 CDT 2024