如何在 Oracle 中将表从系统模式移动到 scott 模式?
几天前...我正在使用 Oracle SQL Developer 数据库迁移工具将一些大型 MySQL 数据库转换为 Oracle 10g R2。但不幸的是它是在系统模式上迁移的。但我需要在 scott 模式上进行迁移。 谷歌搜索后我发现这两个链接OraFAQ论坛和询问汤姆问答.但我找不到任何合适的答案。任何人都可以帮我做,这怎么可能。
提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
IIRC MySQL 备份工具会输出简单的 SQL。因为它采用相当普通的 SQL 形式——我猜只是
create
和insert
——它应该能够使用以下命令针对您的 Oracle 模式运行:最小的改变。话虽如此,在 SQL Developer 迁移向导中,第二步允许您选择目标架构。如果您已设置到
scott
的连接,为什么这对您不起作用?IIRC the MySQL backup tool spits out plain SQL. As it would be in the form of fairly vanilla SQL -- just
create
andinsert
, 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?如果表不太大(取决于您的系统资源和服务器马力等),那么您可以使用以下命令简单地在所需模式中重建表。
注意:您需要以目标模式的用户身份(对 SYSTEM 表空间中的表具有选择权限)或系统身份登录:
然后在创建新表后删除原始表。
如果表很大,那么您可以使用 DATAPUMP 将其导出并导入到所需的架构中。
这是一篇关于使用数据泵来实现此目的的文章:
http://oraclehack.blogspot.com /2010/06/data-pump-moving-tables-to-new-schema.html
希望这有帮助
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.
N.B. 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:
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