表数据的问题 有两张表,table1和table2 ,table1中的大量的数据(上亿条的),table2是空表,我现在要将table1中的所有数据插到table2中,有木有什么方法可以提高速度的?求牛逼的sql语句。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把table2删掉,直接用create table2 as select * from table1,如果机器够好,加并行! 1.insert into table2 select * from table12.删除table2,直接用工具将table1生成table2. 晕死 没看到table2表已经存在了吗 而且结构是一样的。。 wf@WF>select * from tab;TNAME TABTYPE CLUSTERID------------------------------ ------- ----------BIN$j/G6GzuWTciCfbYqWKWPsg==$0 TABLEDUALD TABLE已用时间: 00: 00: 00.12wf@WF>create table t1(i int);表已创建。已用时间: 00: 00: 00.39wf@WF>alter table t1 rename t2;alter table t1 rename t2 *第 1 行出现错误:ORA-14155: 缺失 PARTITION 或 SUBPARTITION 关键字已用时间: 00: 00: 00.07wf@WF>rename table t1 to t2;rename table t1 to t2 *第 1 行出现错误:ORA-00903: 表名无效已用时间: 00: 00: 00.04wf@WF>rename t1 to t2;表已重命名。已用时间: 00: 00: 00.15wf@WF>select * from tab;TNAME TABTYPE CLUSTERID------------------------------ ------- ----------BIN$j/G6GzuWTciCfbYqWKWPsg==$0 TABLEDUALD TABLET2 TABLE已用时间: 00: 00: 00.00wf@WF> 表结构是一样的?drop table table2;alter table table1 rename to table2; 囧,忘记了。 table1,还要的是吧。--这样呢?insert /*+ append */ into table2 nologgingselect * from table1; (转载)【独家连载】企业级GoldenGate实战揭秘(1) 临时表创建后 怎么向里面插入数 并取出其中的数据 SOS!监听程序当前无法识别 这个存储过程哪里错了呢?? 求一计算数值的 SQL 语句 获得某个用户下所有表的schema 大侠提示下下面的内容是在干嘛?oracle能这么写吗? 求海量数据统计方法(方案),给一定建议,谢谢!在线等。有具体说明。 在哪里下载win2000中的odbc最新版本(for chinese) ORACLE中日期字段怎么表示 minus 、union、 union all、intersect 求一替代料算法
2.删除table2,直接用工具将table1生成table2.
------------------------------ ------- ----------
BIN$j/G6GzuWTciCfbYqWKWPsg==$0 TABLE
DUALD TABLE已用时间: 00: 00: 00.12
wf@WF>create table t1(i int);表已创建。已用时间: 00: 00: 00.39
wf@WF>alter table t1 rename t2;
alter table t1 rename t2
*
第 1 行出现错误:
ORA-14155: 缺失 PARTITION 或 SUBPARTITION 关键字
已用时间: 00: 00: 00.07
wf@WF>rename table t1 to t2;
rename table t1 to t2
*
第 1 行出现错误:
ORA-00903: 表名无效
已用时间: 00: 00: 00.04
wf@WF>rename t1 to t2;表已重命名。已用时间: 00: 00: 00.15
wf@WF>select * from tab;TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
BIN$j/G6GzuWTciCfbYqWKWPsg==$0 TABLE
DUALD TABLE
T2 TABLE已用时间: 00: 00: 00.00
wf@WF>
insert /*+ append */ into table2 nologging
select * from table1;