暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

换一种思路 - 通过导出导入进行数据整理

原创 eygle 2009-09-16
309
虽然通过不断的优化,在前面客户的数据表里将数据鉴别出来仍然是不现实的。
20亿条记录,过滤用户退订部分,据估算,统计一次要46天左右,删除可能要耗时在200天左右,单块读平均每次等待时间达到8ms。

而且关键是,在业务库上的操作会影响到正常业务处理,删除又会生成大量的归档日志,存储空间又将变得极为紧张。
于是今天和客户交流,建议客户将这部分表的数据转移到测试机,通过测试机来并行、拆分,加快运算处理过程,再将整理后的数据转移回主库。

当然这个方案也需要一定的支撑条件,幸运的是,客户条件满足,又无风险,高效,所以客户欣然同意了这一方案。

刚刚测试了一下导出一个分区,1.3亿左右的记录,大约用了50分钟时间
Export: Release 10.2.0.2.0 - Production on Wed Sep 16 21:17:56 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                    SMSMG
. . exporting partition                            P01  135587487 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
Export terminated successfully with warnings.
[oracle@sms backup]$ ls -al *.dmp
-rw-r--r--  1 oracle oinstall 34349481984 Sep 16 22:08 smsmg_p1.dmp
这样通过测试机进行并行处理,基本上可以每天处理几个分区,可以快速的完成数据的清理工作,又不会对主库产生性能影响。

-The End-

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论