我在下午的时候,重新导入了数据库,发现一个现象,就是当我去掉主键的时候,往数据库里写东西是会有问题的,而加上了主键就没有问题了。 执行的存储过程如下: if devtxxh = 1 then INSERT INTO ITS_NX_CPK_TP (jlbh,txxh,qjtx1,qjtx2,qjtx3,qjtx4,jgsj,cplj) values (devjlbh,devtxxh,devqjtx1,devqjtx2,devqjtx3,devqjtx4,to_date(devjgsj,'yyyy-mm-dd hh24:mi:ss'),devcplj);
elsif devtxxh = 2 then update ITS_NX_CPK_TP set qjtx2 = devqjtx2 where jlbh=devjlbh; elsif devtxxh = 3 then update ITS_NX_CPK_TP set qjtx3 = devqjtx3 where jlbh=devjlbh;
elsif devtxxh = 4 then update ITS_NX_CPK_TP set qjtx4 = devqjtx4 where jlbh=devjlbh; end if; commit; EXCEPTION WHEN OTHERS THEN INSERT INTO ITS_NX_CPK_TP (jlbh,txxh,qjtx1,qjtx2,qjtx3,qjtx4,jgsj,cplj) values (devjlbh,devtxxh,devqjtx1,devqjtx2,devqjtx3,devqjtx4,to_date(devjgsj,'yyyy-mm-dd hh24:mi:ss'),devcplj); commit; 当我去掉主键的时候,devtxxh 等于几,都是执行的insert。而加上主键就正常了。
一 几千万的表在删除之前是做什么用的?这和你要导入的表有关系吗?
二 批量往oracle数据库中导数据,你是用什么工具导入的?
三 删除表的前后,导入数据的数据量是否一致?
从理论上讲,删除一个表,和你导入数据的快慢是没有关系的。
我的理解是,你删除表后,可能是因为别的你不知道的原因,造成了数据库的负载变大了。
执行的存储过程如下: if devtxxh = 1 then
INSERT INTO ITS_NX_CPK_TP (jlbh,txxh,qjtx1,qjtx2,qjtx3,qjtx4,jgsj,cplj) values (devjlbh,devtxxh,devqjtx1,devqjtx2,devqjtx3,devqjtx4,to_date(devjgsj,'yyyy-mm-dd hh24:mi:ss'),devcplj);
elsif devtxxh = 2 then
update ITS_NX_CPK_TP set qjtx2 = devqjtx2 where jlbh=devjlbh; elsif devtxxh = 3 then
update ITS_NX_CPK_TP set qjtx3 = devqjtx3 where jlbh=devjlbh;
elsif devtxxh = 4 then
update ITS_NX_CPK_TP set qjtx4 = devqjtx4 where jlbh=devjlbh; end if;
commit;
EXCEPTION
WHEN OTHERS THEN
INSERT INTO ITS_NX_CPK_TP (jlbh,txxh,qjtx1,qjtx2,qjtx3,qjtx4,jgsj,cplj) values (devjlbh,devtxxh,devqjtx1,devqjtx2,devqjtx3,devqjtx4,to_date(devjgsj,'yyyy-mm-dd hh24:mi:ss'),devcplj);
commit;
当我去掉主键的时候,devtxxh 等于几,都是执行的insert。而加上主键就正常了。