OA系统冗余数据过多,访问效率受到影响,现需要对历史数据进行一次清理,以提高OA访问速度

大的数据主要体现在流程上,流程数据主要放在flow_run,flow_run_data,flow_run_prcs,flow_run_feedback表中,清理一年半以前的数据是比较合理的。run_id是主键而run_id随着时间的增加而变大,run_id小于50W的流程刚好是一年半以前的历史数据,选择run_id小于50W作为临界点进行删除。以下是清理数据的计划

思路:

①创建和flow_run_data、flow_run、flow_run_prcs、flow_run_feedback、notify表结构一致的表

②把需要清理的历史数据插入刚创建的备份表中

③删除正式表中的数据

操作:

1.晚上10点以后停止mysql数据库服务,前端web服务(避免有人继续访问)

2.备份td_oa数据库

3.依次执行以下SQL语句:

4.开启web和mysql服务,验证是否成功

//对flow_run的操作

create table flow_run_old like flow_run;

insert into flow_run_old select * from flow_run where run_id < '500000';

delete from flow_run where run_id < '500000';

//对flow_run_data的操作

create table flow_run_data_old like flow_run_data;

insert flow_run_data_old select * from flow_run_data where run_id < '500000'

delete from flow_run_data where run_id < '500000';

//对flow_run_prcs操作

create table flow_run_prcs_old like flow_run_prcs;

insert into flow_run_prcs_old select * from flow_run_prcs where run_id < '500000'

delete from flow_run_prcs where run_id < '500000';

select count(*) from flow_run_prcs_old

//对flow_run_feedback操作

create table flow_run_feedback_old like flow_run_feedback;

insert into flow_run_feedback_old select * from flow_run_feedback where run_id < '500000'

delete from flow_run_feedback where run_id < '500000';

//公告notify_id<3349是2013年以前的数据,从该时刻开始删除

create table notify_old like notify;

insert into notify_old select * from notify where notify_id < '3349';

delete from notify where notify_id < '3349';

//删除一年以前的系统日志sys_log、流程日志FLOW_RUN_LOG、SMS、SMS_BODY、UC_PMS、

delete from sys_log where time<date_sub(date(now()),interval 1 year);

//对流程日志的操作

create table flow_run_log_old like flow_run_log;

insert into flow_run_log_old select * from flow_run_log where run_id < '500000';

delete from flow_run_log where run_id < '500000';

=============================================================================================================

//会议室申请

create table meeting_old like meeting;

insert into meeting_old select * from meeting where m_request_time < '2013-06-01 00:00:00';

delete from meeting where m_request_time < '2013-06-01 00:00:00';

//车辆申请

create table vehicle_usage_old like vehicle_usage;

insert into vehicle_usage_old select * from vehicle_usage where vu_request_date < '2013-06-01 00:00:00';

delete from vehicle_usage where vu_request_date < '2013-06-01 00:00:00';

=============================================================================================================

//在线考试信息清理主要是exam_flow和exam_data两张表,这两张表是通过flow_id关联,清理2012-06-01以前的数据,flow_id<4212

//考试发布表exam_flow

create table exam_flow_old like exam_flow;

insert into exam_flow_old select * from exam_flow where flow_id<'4212';

delete from exam_flow where flow_id<'4212';

//考试信息表exam_data

create table exam_data_old like exam_data;

insert into exam_data_old select * from exam_data where flow_id<'4212';

delete from exam_data where flow_id<'4212';

通达OA系统优化-对mysql数据库减肥的更多相关文章

  1. OA系统高性能解决方案(史上最全的通达OA系统优化方案)

    序: 这是一篇针对通达OA系统的整体优化方案,文档将硬件.网络.linux操作系统.程序本身(包括web和数据库)以及现有业务有效结合在一起,进行了系统的整合优化.该方案应用于真实生产环境,部署完成后 ...

  2. 修改通达oa数据库root密码

    第一步: 打开通达oamysql远程网页地址:如http://127.0.0.1/mysql,点击修改密码功能按钮,根据提示修改,不要生成加密密码,执行即可! 第二步:修改service.php文件的 ...

  3. 通达OA整合教程

      资源下载地址: 通达OA 2015:http://pan.baidu.com/s/1qYMxsZU mysql下载:http://pan.baidu.com/s/1c2oVI5y 整合文件:htt ...

  4. centos6.5环境通达OA数据库mysql5.0.67升级至mysql5.5.48方案

    centos6.5环境通达OA数据库mysql5.0.67升级至mysql5.5.42方案 整体方案: 环境准备,在备用服务器安装mysql5.5数据库 1.停用生产环境的应用访问 直接修改web的访 ...

  5. 通达OA在centos系统中快速部署文档(web和数据库)

    通达OA2008从windows环境移植到linux中(centos5.5及以上版本) 如果安装好了,还是无法访问,则需要清空浏览器缓存即可 1.安装lamp环境,这里用的是xampp集成安装包xam ...

  6. 使用linux计划任务自动拉起停止的通达OA服务apache和mysql服务

    概述: 数据库或web服务器瞬时并发过大时,可能面临宕机的危险,用类似开门狗的程序自动监控程序是否正常运行,在服务停止时自动启动服务,可临时解决该问题 监控apache服务的脚本: 每两分钟执行脚本检 ...

  7. 通达OA 同步中控考勤机 增强版

    如果你用的是中控考勤机且考勤机能联网,那恭喜有福了! 最近发现考勤机提供web方式查询,经过调试可以用程序直接读取考勤机数据跨过考勤机软件及其access数据库,数据同步及时性.可靠性大幅提高. 通达 ...

  8. 思道OA PK 通达OA 同场竞技 谁与争锋

    技术架构 思道OA 通达OA 开发语言 微软ASP.NET 4.0 PHP开源脚本语言 64位平台 64位 32位 数据库 SQL Server大数据库 MySQL开源数据库 官网下载 下载地址 下载 ...

  9. 通达OA系统故障解决案例记录

    案例1: 现象:在人员访问量大的时候OA系统经卡死,并且经常宕机,需要启动apache服务 优化配置如下: D:\MYOA\conf\http.conf 修改参数如下: <IfModule mp ...

随机推荐

  1. 【已解决】Microsoft visual c++ 14.0 is required问题解决办法

    装 识别图形验证码库tesserocr的时候,出现了Microsoft visual c++ 14.0 is required的问题,用离线安装还是没有用. 就只能乖乖装Microsoft visua ...

  2. ulimit常用参数介绍

    ulimit常用参数介绍 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. ulimit 用于限制 shell 启动进程所占用的资源,支持以下各种类型的限制:所创建的内核文件的大小.进 ...

  3. Hbase记录-HBase基本操作(二)

    HBase Exists   可以使用exists命令验证表的存在.下面的示例演示了如何使用这个命令. hbase(main):024:0> exists 'emp' Table emp doe ...

  4. POJ - 2828 Buy Tickets(线段树单点更新)

    http://poj.org/problem?id=2828 题意 排队买票,依次给出当前人要插队的位置,每个人有个编号,然后问你最后整个的序列是什么? 分析 最后一个人的要插入的位置是确定的,所以逆 ...

  5. Linux命令(九)查找文件find

    4. find -type f   文件 d  目录 l   连接 5. find -size 6. find -maxdepth -2 (最深路径为2) 7. find ./ -maxdepth 1 ...

  6. Jena搭建SPARQL查询RDF数据

    1 Jena搭建SPARQL查询RDF数据 1.1 Jena概要 · SPARQL是W3C的RDF数据工作组设计的一种查询语言和协议,用于RDF数据的查询.经过类似于JDK安装时候的配置,可以在命令行 ...

  7. Python分析网页中的<a>标签

    soup = BeautifulSoup(html,"html.parser") html=soup.select("table a") for k in ht ...

  8. CSS进阶之SASS入门指南

    CSS进阶之SASS入门指南         随着跟着公司学习项目的前端的推进,越来越对好奇了许久的SASS垂涎欲滴,哈哈,可能这个词使用不当,没有关系,就是对SASS有一股神秘的爱!好了,闲话不多说 ...

  9. POJ 2503 Babelfish (STL)

    题目链接 Description You have just moved from Waterloo to a big city. The people here speak an incompreh ...

  10. C - Portals Gym - 102006C (网络流最小割)

    题目链接:https://cn.vjudge.net/contest/283918#problem/C 题目大意:T个测试数据,然后给你一个字符串,每一个字符串包括‘s’,‘t’,‘o’,‘#’,‘. ...