有个表中记录有100万条左右,怎么样才能快速将复合条件的记的某个字段改成一个新值?
如下:
update table1 set flag=1 where flag=0
如下:
update table1 set flag=1 where flag=0
解决方案 »
- 紧急求助!!!
- 菜人问题:PL/SQL中的存储过程的写法中小小问题???
- 批量提交锁表!!!急急急急!!!!!在线等
- oracle 中对整形字段转化成字符,现进行进行填充。。。。高手们,帮帮忙。。
- rman 恢复中,文件系统->裸设备以及裸设备->文件系统 该如何恢复?脚本如何写? 谢谢!!!
- Oracle Blob字段存放Base64编码字符,取出后与原码产生差异问题。
- 一困难数据库排序
- 求一查询语句
- oracle9.01监听器占用8080端口的问题
- ORACLE的存储过程或函数如何返回结果集?
- Oracle用户请注意了,好消息要与大家一同分享!千万不要错过!
- sql优化的问题:(not)exists 比 (not)in 好吗?
晕...
update时如果不开启事务,数据丢失了或者误改了怎么办? 可以批量更新, 每更新小批量数据例如1000条时就提交一次.
grant on new table
add constraints on new_table
etc on new_tabledrop table old_table
rename new_table to old_table;
you can do that using parallel query, with nologging on most operations
generating very little redo and no undo at all -- in a fraction of the time it
would take to update the data.
批量更新很快的, TOM 也推荐这种做法, 如果仍然很慢的话, 估计
是你的应用的问题. 楼上写的方式也可用。