在库 db1中
create table test(id number(10), value varchar(15));
在库db2中
create table test(id number(10), value varchar(15));
然后在db1中建立到db2的dblink,DL_db2;
然后db1中执行insert into test@DL_db2 select * from test where id = %d;
总共有几万条记录,执行了2万左右后,就会出现每条insert语句花费50-90秒左右时间;
但是每条都能执行成功,why?
create table test(id number(10), value varchar(15));
在库db2中
create table test(id number(10), value varchar(15));
然后在db1中建立到db2的dblink,DL_db2;
然后db1中执行insert into test@DL_db2 select * from test where id = %d;
总共有几万条记录,执行了2万左右后,就会出现每条insert语句花费50-90秒左右时间;
但是每条都能执行成功,why?
解决方案 »
- plsql执行EXECUTE IMMEDIATE STR 时权限不足
- 奇怪的:PLS-00201 必须说明标识符 'SYS_EXTRACT_UTC'错误
- 请教关于例程的问题
- statspack规划的自动任务不能运行,查到是job出错,但不知是什么错误
- 求助TNS-12560: TNS:protocol adapter error
- 请各位看一下这个绑定变量的问题?
- ”弱水三千“请进来。还是包的调用问题。急急急。。。。。。。。。。。。。
- oracle数据库建立的选项,专用服务器和共享服务器有什么区别,,???
- Oracle间歇性卡顿
- oracle 索引中的branch node会有多少个兄弟节点呢
- 如何将orcl 数据库中所有 L9999用户的表,复制到LC数据库,用户也是L9999
- 【求助】弱弱地问一下,想更新Oracle库中某个字段的批量数据,如何写sql语句更新或替换??
insert into t22 select 1 from dual union all select 2 from dual;insert /*+ append */ into t11
select * from t22;
重启了一下,现在每秒能insert 15个左右的数据,这个oracle用了5年左右,有没有什么优化措施?
2、确认网络延迟是否正常。
3、如果目标表中原来没有记录,可以考虑用copy from ..... to..... create tablename using 的办法,减少日志的生成,可以成倍的提高效率。
刚连接oracle数据库时运行insert into test@DL_db2 select * from test where id = %d速度还能接受,
运行了万条左右,每秒就只有10个左右的操作,
越往后,速度越慢,最后竟然每个insert花了50秒左右,然后查询了一下,
发现db1数据库中的这个会话进程占用了一个cpu 95.6%之多
然后db1中执行insert into test@DL_db2 select * from test where id = %d;
总共有几万条记录,执行了2万左右后,就会出现每条insert语句花费50-90秒左右时间;
但是每条都能执行成功,why?方法相当多:
1.在db2中建立到db1的dblink,DL_db1;
然后db2中执行insert into test select * from test@DL_db1 where id = %d; 2.如果目标表中原来没有记录,可以考虑用copy from ..... to..... create tablename using 的办法,减少日志的生成,可以成倍的提高效率。
给你一个方法吧用dblink将数据复制本地库的临时表
然后再对临时表做你的操作,速度就快了
14楼的方法也不可行,已经测试了
现在每秒也就5个左右insert;但是却占用了一个cpu
insert into test@DL_db2 select * from v_test where id = %d;
看看会不会快呀(瞎猜,我也没试过)