1. Use the Oracle Export utility to dump the table out of the first database and the Import utility to pull it into the other.
2. Set up a database link between the two databases, then use a CREATE TABLE ... AS ... command to recreate the table in the second database.
If your database link was called db1, then it would look like this:
CREATE TABLE cloned_table AS SELECT * FROM base_table@db1;
Note that method 1 allows you to also transport indexes, triggers, constraints, etc while method #2 only recreates the table structure and then inserts the data. Also, it can generate a lot of network traffic.
You can also use SQPLUS if you can access both databases in the server.
usage: COPY FROM <db> TO <db> <opt> <table> { (<cols>) } USING <sel>
<db> : database string, e.g., scott/tiger@d:chicago-mktg
<opt> : ONE of the keywords: APPEND, CREATE, INSERT or REPLACE
<table>: name of the destination table
<cols> : a comma-separated list of destination column aliases
<sel> : any valid SQL SELECT statement
For example, from sqlplus:
COPY FROM scott/tiger@source_db CREATE new_table USING select * FROM source_table;
Robbie
"The rule is, not to besiege walled cities if it can possibly be avoided" -- Art of War
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.