Home » RDBMS Server » Server Administration » need to copy table from one host to another.
need to copy table from one host to another. [message #57391] Wed, 11 June 2003 08:32 Go to next message
sidd
Messages: 130
Registered: May 2003
Senior Member
i need to write a script that copies table from aaa host uaaa schema table to bbb host ubbb schema, how do i do this, i need help.
Re: need to copy table from one host to another. [message #57397 is a reply to message #57391] Wed, 11 June 2003 16:47 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
you can export the source, import into database.
create a tnsconection string from anywhere you want ( if the databases are of different versions, use the lower version of exp to export and same version of imp to import).
the process is done is steps ( accumilate them into a single script, depending on your OS).
1. exp the source table(s)
2. import into target ( you may need to truncate the target table before import. else add an option IGNORE=Y
to append the data)

----------------------------------------------------------------------

else
1. create a dblink in target to connect to the source.
2. truncate the target table in source.
3. insert into target_table ( select * from source_table@dblink)

Re: need to copy table from one host to another. [message #57404 is a reply to message #57397] Thu, 12 June 2003 10:01 Go to previous messageGo to next message
sidd
Messages: 130
Registered: May 2003
Senior Member
I need to write a script so that they can schedule every night, so which one is the best way to do
Re: need to copy table from one host to another. [message #57405 is a reply to message #57404] Thu, 12 June 2003 14:09 Go to previous messageGo to next message
Trifon Anguelov
Messages: 514
Registered: June 2002
Senior Member
DBMS_JOB package. It's Oracle's native - so you don't have to rely on some OS job schedulers.
Write your code as stored procedure and then create a job for it.

Hope that helps,

clio_usa
OCP - DBA

Visit our Web site

Re: need to copy table from one host to another. [message #57417 is a reply to message #57404] Fri, 13 June 2003 06:15 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
depends on your need and configuration.
both will work.
if u want to use OS scedulers use export/import
else
if u want to use dblink, script that into a stored proc, and sheddule it in DBMS_JOB as trifon has said
Previous Topic: Compatibility
Next Topic: Case Sensitive
Goto Forum:
  


Current Time: Fri Sep 20 11:40:54 CDT 2024