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. Announcing WebKit SDL port

    转自:http://www.dorothybrowser.com/announcing-webkit-sdl-port/ 下载地址 https://gitorious.org/spiegel/webk ...

  2. A1081. Rational Sum

    Given N rational numbers in the form "numerator/denominator", you are supposed to calculat ...

  3. springboot与springcloud的版本问题

    Spring Cloud为开发者提供了一套可以用来快速搭建分布式系统中常见模式的工具.提取主干即是Spring Cloud提供了一套工具.这些工具为开发人员提供了分布式系统下常见问题的通用解决方案.这 ...

  4. Dom--属性以及创建标签

    一.Dom属性 1.1 设置属性(setAttribute) 设置某个标签的属性,setAttribute(key,value) <body> <div> <input ...

  5. 修改Linux Operating System的时间与时区

    修改Linux Operating System的时间与时区 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 有的小伙伴可能会遇到安装了linux系统后,尽管时区选择正确,也会发现系 ...

  6. Scala进阶之路-反射(reflect)技术详解

    Scala进阶之路-反射(reflect)技术详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. Scala中的反射技术和Java反射用法类似,我这里就不一一介绍反射是啥了,如果对 ...

  7. Elasticsearch日志分析系统

    Elasticsearch日志分析系统 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.什么是Elasticsearch 一个采用Restful API标准的高扩展性的和高可用性 ...

  8. 5、JDBC-元信息

    DatabaseMetaData:描述数据库的元数据对象 获取所有数据库 import org.junit.jupiter.api.AfterEach; import org.junit.jupite ...

  9. Linux记录-清空文件内容

    $ : > filename $ > filename $ echo "" > filename $ echo > filename $ cat /dev/ ...

  10. Hbase记录-ZooKeeper API

    Zookeeper API ZooKeeper有一个Java和C绑定的官方API.ZooKeeper社区提供了对于大多数语言(.NET,Python等)的非官方API.使用ZooKeeper的API, ...