OGG监控页面展示需求与设计-django+echars+pycharts

 

 

 

  

摘 要

为解决OGG数据库监控缺乏展示页面问题,达到直观展示OGG运行状态的目的。最终在业务高峰期监控OGG,提高系统故障反应速度。迫切需要可视化实时监控OGG数据库运行状态。

故进行开发OGG数据库监控系统,实现对数据库连接、OGG(抽取、投递、复制)进程、业务表数据量、告警日志和数据库锁的实时监控。

OGG数据库监控系统使用Python语言开发,在Django MVT 的架构上进行拓展,采用MVC分层架构。前端展现使用Jquery 、Bootstrap、Echarts.由于监控OGG故数据库采用Oracle12c数据库。

 关键词:OGG 监控  python  oracle


第一章 引言

1.1 背景

核心系统历史数据库采用OGG(同构)进行数据同步,历史出现过多次问题存在不易发现、恢复时间长等因素,一致没有彻底解决实时监控问题。

新助贷系统采取OGG(异够)进行数据同步,经各方综合分析,OGG数据同步为高风险点,可能影响到客户的友好性,甚至会丢失数据。

1.2 任务

1.2.1 内容

1.2.2 本次任务范围

监控总体流程概述:监控数据获取->录入数据库表->读取监控数据->数据展示为报表

本次任务范围:读取监控数据->数据展示为报表

1.3 文档结构

1.4预期读者和阅读建议

1.5参考资料

1.6术语和定义

  1. OGG:

是一个实现异构IT环境数据实时数据集成和复制的综合软件包。该产品集支持高可用性解决方案,实时数据集成,事务更改数据捕获,运营和分析企业系统之间的数据复制,转换和验证.Oracle GoldenGate 12 c通过简化配置和管理,加强与Oracle数据库的集成,支持云环境,扩展异构性以及增强安全性,实现了高性能。

  1. 数据库连接:session

SESSIONS specifies the maximum number of sessions that can be created in the system.

Property

Description

Parameter type

Integer

Default value

Derived: (1.5 * PROCESSES) + 22

Modifiable

ALTER SYSTEM can be used in a PDB only to change the value of the SESSIONS parameter for that PDB.

ALTER SYSTEM cannot be used to change the value of the SESSIONSparameter in a non-CDB or in a CDB$ROOT.

Modifiable in a PDB

Yes

Range of values

1 to 216 (which is 1 to 65536)

Basic

Yes

Because every login requires a session, this parameter effectively determines the maximum number of concurrent users in the system. You should always set this parameter explicitly to a value equivalent to your estimate of the maximum number of concurrent users, plus the number of background processes, plus approximately 10% for recursive sessions.

Oracle uses the default value of this parameter as its minimum. Values between 1 and the default do not trigger errors, but Oracle ignores them and uses the default instead.

The default values of the ENQUEUE_RESOURCES and TRANSACTIONS parameters are derived from SESSIONS. Therefore, if you increase the value of SESSIONS, you should consider whether to adjust the values of ENQUEUE_RESOURCES and TRANSACTIONS as well. (Note that ENQUEUE_RESOURCES is obsolete as of Oracle Database 10g release 2 (10.2).)

In a shared server environment, the value of PROCESSES can be quite small. Therefore, Oracle recommends that you adjust the value of SESSIONS to approximately 1.1 * total number of connections.

For a CDB, the root container's SESSIONS parameter specifies the total number of sessions for the database.

The SESSIONS parameter for a PDB specifies the total number of sessions that can be used by that PDB. Its value defaults to the root container's SESSIONS value. If the PDB tries to use more sessions than configured by its SESSIONS parameter, an ORA-00018 error message is generated. For PDBs, the SESSIONS parameter does not count recursive sessions and hence does not require the 10% adjustment.

The SESSIONS parameter for a PDB can only be modified by the PDB. It cannot be set higher than the CDB's SESSIONS value.

  • ACTIVE - Session currently executing SQL
  • INACTIVE - Session which is inactive and either has no configured limits or has not yet exceeded the configured limits
  • KILLED - Session marked to be killed
  • CACHED - Session temporarily cached for use by Oracle*XA
  • SNIPED - An inactive session that has exceeded some configured limits (for example, resource limits specified for the resource manager consumer group or idle_time specified in the user's profile). Such sessions will not be allowed to become active again.

 

  1. 数据库进程:process

process is a mechanism in an operating system that can run a series of steps.

The process execution architecture depends on the operating system. For example, on Windows an Oracle background process is a thread of execution within a process. On Linux and UNIX, an Oracle process is either an operating system process or a thread within an operating system process.

Processes run code modules. All connected Oracle Database users must run the following modules to access a database instance:

  • Application or Oracle Database utility

A database user runs a database application, such as a precompiler program or a database tool such as SQL*Plus, that issues SQL statements to a database. 

  • Oracle database code

Each user has Oracle database code executing on his or her behalf that interprets and processes the application's SQL statements.

A process normally runs in its own private memory area. Most processes can periodically write to an associated trace file.

See Also:

  1. Types of Processes

A database instance contains or interacts with multiple processes.

Processes are divided into the following types:

  • client process runs the application or Oracle tool code. 
  • An Oracle process is a unit of execution that runs the Oracle database code. In the multithreaded architecture, an Oracle process can be an operating system process or a thread within an operating system process. Oracle processes include the following subtypes:
    • background process starts with the database instance and perform maintenance tasks such as performing instance recovery, cleaning up processes, writing redo buffers to disk, and so on.
    • server process performs work based on a client request. 

For example, these processes parse SQL queries, place them in the shared pool, create and execute a query plan for each query, and read buffers from the database buffer cache or from disk.

Note:

Server processes, and the process memory allocated in these processes, run in the database instance. The instance continues to function when server processes terminate.

  • A slave process performs additional tasks for a background or server process.

The process structure varies depending on the operating system and the choice of Oracle Database options. For example, you can configure the code for connected users for dedicated server or shared server connections. In a shared server architecture, each server process that runs database code can serve multiple client processes.

  1. 告警日志: alert 日志, alert log

A file that provides a chronological log of database messages and errors. The alert log is stored in the ADR.

  1. 锁:lock

A database mechanism that prevents destructive interaction between transactions accessing a shared resource such as a table, row, or system object not visible to users. The main categories of locks are DML locks, DDL locks, and latches and internal locks.

  1. 抽取进程:
  2. 投递进程:
  3. 复制进程:
  4. 实时监控:

第二章 相关技术介绍

本章概述:

2.1 Python

2.1.1 Django

2.1.2 Jquery

2.1.3 Bootstrap

2.1.2 Echars

2.1.2 oracle

2.n 本章小结

(从)

 

第三章 系统的需求分析

本章概述

3.0业务需求

3.0.1系统目标

解决OGG数据库监控缺乏展示页面问题,达到直观展示OGG运行状态的目的。最终在新助贷系统高峰期监控OGG,提高系统故障反应速度。同时达到美观、易懂体现工作工作价值。

3.0.1业务规则

数据运行中心运维规范手册

3.0.2总体要求

  1. 实时监控、高峰期前(6-9月)使用
  2. 从ORACLE数据库读取数据
  3. 包括历史数据展示和实时数据展示
  4. 监控项;数据库连接、OGG(抽取、投递、复制)进程、业务表数据量、告警日志和数据库锁

3.1系统角色分析

3.1.1 组织结构

开发测试中心:处室、外包团队

数据运行中心:处室、外包团队(应用运维团队、数据库运维团队)

3.1.2 角色概述

主要面向:数据库运维团队的数据库运维工程

次要面向:中心领导展示,以体现价值

角色:中心领导

角色:运维工程师

目前只实现工程师角色,同时达到美观以满足领导需求

3.2 系统功能需求分析

数据库会话监控(最近一小时):工程师

同步表行数监控(最近一小时):工程师

告警日志监控(最后五条):工程师

进程状态监控(最后一次):工程师

抽取数据监控(最后一次):工程师

投递数据监控(最后一次):工程师

复制数据监控(最后一次):工程师

 

用例名称

OGG数据库监控

参与者

工程师,兼顾领导

目标

实时让让参与者了解OGG数据库运行状态(最近一小时)

触发器

参与者发出请求

前置任务

后续任务

基础流程

a)选择菜单 b) 查看监控 c) 移动鼠标 d)显示细节 f) 下载监控图

替换流程

暂无

异常

问题

实时刷新,延迟不能超过10秒

 

3.3 系统功能需求分析

3.3.1 UML用例图


图 3-1工程师用例图示例

3.3.2 线框图

  1. 数据库会话监控:o_db01, o_db02,m_db03共三个图像

 

  1. 业务表行数监控:student 一张(暂定)

 

  1. 进程状态监控: o_db01, o_db02 ,m_db03 三个

Node_name

o_db01

Xtime

201805050959

   

REPLICAT

 

REP1

1

REP2

1

REP3

1

 

  1. 告警日志监控:o_db01, m_db01,各一个(都是OGG的)。共两个

 

Node_name

Log_state

Xtime

o_db01

XXXXXXXX

201805050900

o_db01

XXXXXXXX

201805050901

o_db01

XXXXXXXX

201805050902

o_db01

XXXXXXXX

201805050903

o_db01

XXXXXXXX

201805050904

 

  1. 抽取数据监控,投递数据监控,复制数据监控:

 

锁监控 o_db01, o_db02, 2个

               

Node_name

lock_state

Xtime

o_db01

XXXXXXXX

201805050900

o_db01

XXXXXXXX

201805050901

o_db01

XXXXXXXX

201805050902

o_db01

XXXXXXXX

201805050903

o_db01

XXXXXXXX

201805050904

整体线框

数据库监控页面:

l  数据库会话监控:o_db01, o_db02,m_db03共三个图像

l  锁监控 o_db01, o_db02, 2个

OGG监控页面:

l  进程状态监控: o_db01, o_db02 ,m_db03 三个

l  进程数据监控: o_db01, o_db02 ,m_db03 三个

l  业务表行数监控:student 一张(暂定)

l  告警日志监控:o_db01, m_db01,各一个(都是OGG的)。共两个

图如下:

 

3.4系统的非功能需求分析

实时监控:延迟不超过10秒

3.5开发限制

必须使用oracle数据库版本要求12c

                                                              

第四章 系统的设计

本章概述,

4.1 系统网络结构设计

 

 

4.2 系统软件层次架构设计

4.3技术架构

(系统扩展,安全架构,可靠性设计,灾备设计)暂不涉及

从技术架构上看,企业网银前端处理采用django MVT的三层结构,并且使用两个view.py分别处理同步请求和异步请求。

 

 

4.3   系统功能模块设计

 

图 4-1 平台功能模块图示例

4.3.1  数据库会话监控模块的详细设计

1、 UML类设计

 

2、 交互设计

 

3、 关键流程设计

(略)

4.4 系统的数据库设计

4.4.1 E-R图设计

表之间基本无关联此部分(略)

4.4.2 数据库表设计

#数据库连接数---线图--最近一个小时的--最后一个点的数据。 Mysql 一张 oracle 一张

create table connection_number

(

Node_name varchar2(10),           #节点名称(例如 o_主机名、m_主机名) o_db01 m_db01  3个值 2个oracle 1个mysql

Active varchar2(10),              #活动的连接数 1                      

Inactive varchar2(10),            #非活动的连接数 1                   

Total varchar2(10),               #总连接数=活动+非活动 2

Rated varchar2(10),               #额定数据库连接数 1

Xtime varchar2(40)                 #脚本提取数据时间 201805121501

)

----------Node_name and  Time

#表对比。----线图-----最近一个小时的--最后一个点的数据 ,,

create table contrast_data

(

Node_name varchar2(10),           #节点名称(例如 o_主机名、m_主机名)   o_db01 m_db01  只有2个值

Table_name varchar2(20),          #表名    table name                   

Line_number varchar2(30),         #行数    20               

Xtime varchar2(40)                 #脚本提取数据时间 201805121501

)

----------Node_name and  Time

#进程状态 info all---按钮 --红绿灯

create table process_state

(

Node_name varchar2(10),           #节点名称(例如 o_主机名、m_主机名) o_db01 m_db01  

Program varchar2(20),             #进程的类别   "Replicat"  大写                                           

Group varchar2(20),               #进程名称 REP1

Process_state varchar2(20),       #进程的状态信息 RUNING--->绿,其他红色

Xtime varchar2(40)                 #脚本提取数据时间 201805121501              

)

#日志信息 OGG alert --- top 5 数据列表

create table log_state

(

Node_name varchar2(10),           #节点名称(例如 o_主机名、m_主机名)   o_db01 m_db01  

Log_state varchar2(200),          #日志的基本信息     “XXXXXXXX”                 

Xtime varchar2(40)                 #脚本提取数据时间    201805121501                 

)

#锁   ----top 5 数据列表

create table lock_state

(

Node_name varchar2(10),           #节点名称(例如 o_主机名、m_主机名) o_db01 m_db01

Lock_type varchar2(200),          #锁的基本信息   “XXXXXXXX”

Xtime varchar2(40)                 #脚本提取数据时间 201805121501

)

#复制进程 stats REP1 oracle端。---柱状图 *3 每一列一个柱子

create table rep_process

(

Node_name varchar2(10),            #节点名称(例如 o_主机名) o_db01 m_db01

Xclass varchar2(20),                #总数和最后一次查询到这次的差值    

Total_inserts varchar2(30),        #插入的行数   12                     

Total_updates varchar2(30),        #更新的行数   12                     

Total_deletes varchar2(30),        #删除的行数   21                     

Total_discards varchar2(30),       #丢弃的行数   12                     

Total_operations varchar2(30),     #操作的行数   12                     

Xtime varchar2(40)                  #脚本提取数据时间 201805121501

)

#抽取进程 stats EXT1 mysql端

create table ext_process

(

Node_name varchar2(10),            #节点名称(例如 m_主机名)

Xclass varchar2(20),                #总数和最后一次查询到这次的差值    

Total_inserts varchar2(30),        #插入的行数                        

Total_updates varchar2(30),        #更新的行数                        

Total_deletes varchar2(30),        #删除的行数                        

Total_discards varchar2(30),       #丢弃的行数                        

Total_operations varchar2(30),     #操作的行数                        

Xtime varchar2(40)                  #脚本提取数据时间

)

#投递进程 stats PUMP1 mysql端

create table pump_process

(

Node_name varchar2(10),            #节点名称(例如 m_主机名)

Xclass varchar2(20),                #总数和最后一次查询到这次的差值

Total_inserts varchar2(30),        #插入的行数

Total_updates varchar2(30),        #更新的行数

Total_deletes varchar2(30),        #删除的行数

Total_discards varchar2(30),       #丢弃的行数

Total_operations varchar2(30),     #操作的行数

Xtime varchar2(40)                  #脚本提取数据时间

)

 

4.5 系统的界面设计

 

 

4.6 系统接口设计

 

 


 

猜你喜欢

转载自www.cnblogs.com/growingoldrui/p/9056930.html
ogg
今日推荐