简体   繁体   中英

How to move a table from system schema to scott schema in Oracle?

In some days ago...i was converting some Large MySQL Database to Oracle 10g R2 by using Oracle SQL Developer database migration tools.But unfortunately it was migrated on system schema.but i need to it on scott schema. After Googling i found this two links OraFAQ Forum and ASK TOM Q&A .But I cannot find any appropriate answer. Any one Can help me to do , How it is possible.

Thanks In Advance.

IIRC the MySQL backup tool spits out plain SQL. As it would be in the form of fairly vanilla SQL -- just create and insert , I guess -- it ought to be able to be run against your Oracle schema with the minimum of alteration.

Having said that, in the SQL Developer migration wizard, the second step allows you to select the target schema. If you have a connection setup to scott , why doesn't that work for you?

If the table isn't too large (dependent upon your system resources and server horsepower etc.) then you could simply rebuild the table in the desired schema with the following. NB You need to be logged in as either the target schema's user (with select permission on the table in the SYSTEM tablespace) or as system:

CREATE TABLE <newschema>.<tablename>
AS
SELECT *
  FROM system.<tablename>;

Then remove the original table once the new table has been created.

If the table is large then you could use DATAPUMP to export and import it into the desired schema.

Here is an article on using Data Pump for this purpose: http://oraclehack.blogspot.com/2010/06/data-pump-moving-tables-to-new-schema.html

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM