Copying data between Oracle schemas using SQL

chabzjo picture chabzjo · May 15, 2009 · Viewed 40.6k times · Source

I'm trying to copy data from one Oracle schema (CORE_DATA) into another (MY_DATA) using an INSERT INTO (...) SQL statement.

What would the SQL statement look like?

Answer

Sliff picture Sliff · May 15, 2009

Prefix your table names with the schema names when logged in as a user with access to both:

insert into MY_DATA.table_name select * from CORE_DATA.table_name;

Assuming that the tables are defined identically in both schemas, the above will copy all records from the table named table_name in CORE_DATA to the table named table_name in MY_DATA.