假设 有数据库A 数据库B,想要把数据库A中的表复制到数据库B中
首先
create public database link mydblink
connect to sys identified by "123"
using 'A';
-------sys为对象 123是密码
create table aa as select * from aa@mydblink
aa是A中表
如果想要复制所有的表 则
select 'create table '||table_name||' as select * from '||table_name||'@local_elite' from user_tables@mydblink;
注意的是 得到的表 只有数据 并不具备源表的设置的一些约束。
Ps: 本人菜鸟,只是记录一些自己编程遇到的一些原来不知道的知识,希望对跟我有同样问题的朋友一些帮助,算是自己的一个学习笔记吧