达梦数据库 DEM安装
DEM部署说明
-
创建一个数据库作为DEM后台数据库, 数据库dm.ini参数配置进行优化, 推荐配置:
MEMORY_POOL = 200
BUFFER = 1000
KEEP = 64
MAX_BUFFER = 2000
SORT_BUF_SIZE = 50 -
在该数据库中执行如下语句:
–set CHAR_CODE UTF8
–SCHEMA
CREATE SCHEMA “DEM”;
/
SET SCHEMA “DEM”;
–TABLE
CREATE TABLE “DEM”.“ADMIN_ROLE”
(
“ID” BIGINT NOT NULL,
“NAME” VARCHAR(256),
“DESCRIPTION” VARCHAR(1000),
“POWER” BIGINT,
“FLAG” BIT DEFAULT 1,
NOT CLUSTER PRIMARY KEY(“ID”)) ;
COMMENT ON TABLE “DEM”.“ADMIN_ROLE” IS ‘用户角色’;
COMMENT ON COLUMN “DEM”.“ADMIN_ROLE”.“DESCRIPTION” IS ‘角色描述’;
COMMENT ON COLUMN “DEM”.“ADMIN_ROLE”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“ADMIN_ROLE”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“ADMIN_ROLE”.“NAME” IS ‘角色名称’;
COMMENT ON COLUMN “DEM”.“ADMIN_ROLE”.“POWER” IS ‘角色权限’;
CREATE TABLE “DEM”.“ADMIN_SYS_CONFIG”
(
“ID” VARCHAR(256) NOT NULL,
“DESCRIPTION” VARCHAR(1000),
“VALUE” VARCHAR(256),
“NAME” VARCHAR(256),
“UNITS” VARCHAR(256),
“CAN_MODIFY” BIT,
“TYPE” VARCHAR(100),
“MAX_VALUE” VARCHAR(50),
“MIN_VALUE” VARCHAR(50),
“FIRST_TIME” DATETIME(6),
“GATHER_TYPE” INTEGER DEFAULT 0,
NOT CLUSTER PRIMARY KEY(“ID”)) ;
COMMENT ON TABLE “DEM”.“ADMIN_SYS_CONFIG” IS ‘系统属性配置项’;
COMMENT ON COLUMN “DEM”.“ADMIN_SYS_CONFIG”.“CAN_MODIFY” IS ‘是否可配’;
COMMENT ON COLUMN “DEM”.“ADMIN_SYS_CONFIG”.“DESCRIPTION” IS ‘配置项描述’;
COMMENT ON COLUMN “DEM”.“ADMIN_SYS_CONFIG”.“FIRST_TIME” IS ‘开始执行的时间’;
COMMENT ON COLUMN “DEM”.“ADMIN_SYS_CONFIG”.“GATHER_TYPE” IS ‘监控类型:毫秒级监控;每n天的指定时间执行;’;
COMMENT ON COLUMN “DEM”.“ADMIN_SYS_CONFIG”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“ADMIN_SYS_CONFIG”.“MAX_VALUE” IS ‘允许的最大值’;
COMMENT ON COLUMN “DEM”.“ADMIN_SYS_CONFIG”.“MIN_VALUE” IS ‘允许的最小值’;
COMMENT ON COLUMN “DEM”.“ADMIN_SYS_CONFIG”.“NAME” IS ‘配置项名称’;
COMMENT ON COLUMN “DEM”.“ADMIN_SYS_CONFIG”.“TYPE” IS ‘配置项所属模块’;
COMMENT ON COLUMN “DEM”.“ADMIN_SYS_CONFIG”.“UNITS” IS ‘单位’;
COMMENT ON COLUMN “DEM”.“ADMIN_SYS_CONFIG”.“VALUE” IS ‘属性值’;
CREATE TABLE “DEM”.“ADMIN_USER”
(
“ID” BIGINT NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“LOGIN_NAME” VARCHAR(256),
“PASSWORD” VARCHAR(50) NOT NULL,
“REAL_NAME” VARCHAR(256),
“EMAIL” VARCHAR(256),
“PHONE” VARCHAR(50),
“SEX” VARCHAR(10),
“ROLE_ID” BIGINT,
“FORBIDDEN” BIT DEFAULT 0,
“FLAG” BIT DEFAULT 1,
“FAILED” INT DEFAULT 0,
“LOGIN_TS” BIGINT DEFAULT 0,
NOT CLUSTER PRIMARY KEY(“ID”)) ;
COMMENT ON TABLE “DEM”.“ADMIN_USER” IS ‘用户表’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“EMAIL” IS ‘邮箱’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“FAILED” IS ‘登录失败次数’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“FORBIDDEN” IS ‘是否禁用’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“GMT_CREATE” IS ‘创建时间’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“GMT_MODIFY” IS ‘修改时间’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“LOGIN_NAME” IS ‘登录名’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“LOGIN_TS” IS ‘最近一次登录时间’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“PASSWORD” IS ‘登录密码’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“PHONE” IS ‘手机号’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“REAL_NAME” IS ‘真实姓名’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“ROLE_ID” IS ‘所属角色ID’;
COMMENT ON COLUMN “DEM”.“ADMIN_USER”.“SEX” IS ‘性别’;
CREATE TABLE “DEM”.“ADMIN_AUDIT”
(
“ID” VARCHAR(100),
“TS” VARCHAR(50),
“USER_ID” VARCHAR(100),
“USER_IP” VARCHAR(100),
“CLASS_NAME” VARCHAR(1000),
“METHOD_NAME” VARCHAR(1000),
“DB_IP” VARCHAR(100),
“DB_PORT” VARCHAR(100),
“DB_USER” VARCHAR(256),
“SUCC_FLAG” BIT,
“FAIL_MSG” VARCHAR(1000),
“USER_NAME” VARCHAR(256),
“DESCRIPTION” VARCHAR(1000),
“NAME” VARCHAR(200),
“OP_TYPE” VARCHAR(50),
NOT CLUSTER PRIMARY KEY(“ID”));
CREATE TABLE “DEM”.“ADMIN_AUDIT_SQL”
(
“SQL” CLOB,
“AUDIT_ID” VARCHAR(100));
CREATE TABLE “DEM”.“DBTOOL_DTS_TRANSFORM”
(
“ID” BIGINT NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“NAME” VARCHAR(256),
“DESCRIPTION” VARCHAR(1000),
“FLAG” BIT DEFAULT 1,
“TRANSFORM_TYPE” INTEGER,
NOT CLUSTER PRIMARY KEY(“ID”));
COMMENT ON TABLE “DEM”.“DBTOOL_DTS_TRANSFORM” IS ‘迁移’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM”.“ID” IS ‘迁移ID’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM”.“NAME” IS ‘迁移名称’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM”.“DESCRIPTION” IS ‘迁移的描述信息’;
CREATE TABLE “DEM”.“DBTOOL_DTS_TRANSFORM_TASK”
(
“TASK_ID” VARCHAR(50) NOT NULL,
“TRANSFORM_ID” BIGINT NOT NULL,
“TASK_NAME” VARCHAR(200),
“TASK_STATUS” INTEGER,
“TIME_STR” VARCHAR(50),
“STATUS_MSG” VARCHAR(200),
“TASK_EXCEPTION” CLOB,
“EXECUTOR_MSG” VARCHAR(200),
“FLAG” BIT DEFAULT 1,
“GMT_CREATE” TIMESTAMP(6) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(6) DEFAULT SYSDATE,
“EXECUTE_ID” BIGINT NOT NULL,
“ERROR_SQL” CLOB,
“EXPORT_DIR” VARCHAR(200),
“EXPORT_FILE_NAME” VARCHAR(200),
“TRANSFORM_ITEM_ID” BIGINT,
NOT CLUSTER PRIMARY KEY(“TASK_ID”),
FOREIGN KEY(“TRANSFORM_ID”) REFERENCES “DEM”.“DBTOOL_DTS_TRANSFORM”(“ID”) ON DELETE CASCADE );
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_TASK”.“TIME_STR” IS ‘运行耗时’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_TASK”.“STATUS_MSG” IS ‘状态消息’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_TASK”.“TASK_EXCEPTION” IS ‘异常’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_TASK”.“GMT_CREATE” IS ‘创建时间’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_TASK”.“GMT_MODIFY” IS ‘修改时间’;
CREATE TABLE “DEM”.“DBTOOL_DTS_TRANSFORM_ANALY_EXCEPTION”
(
“ID” BIGINT IDENTITY(1, 1) NOT NULL,
“TASK_ID” VARCHAR(50) NOT NULL,
“OBJECT_NAME” VARCHAR(128),
“EXCEPTION” VARCHAR(512),
“FLAG” BIT DEFAULT 1,
“GMT_CREATE” TIMESTAMP(6) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(6) DEFAULT SYSDATE,
CLUSTER PRIMARY KEY(“ID”),
FOREIGN KEY(“TASK_ID”) REFERENCES “DEM”.“DBTOOL_DTS_TRANSFORM_TASK”(“TASK_ID”));
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_ANALY_EXCEPTION”.“OBJECT_NAME” IS ‘对象名称’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_ANALY_EXCEPTION”.“EXCEPTION” IS ‘异常信息’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_ANALY_EXCEPTION”.“GMT_CREATE” IS ‘创建时间’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_ANALY_EXCEPTION”.“GMT_MODIFY” IS ‘修改时间’;
CREATE TABLE “DEM”.“DBTOOL_DTS_TRANSFORM_DATA_TYPE_MAPPING”
(
“ID” BIGINT NOT NULL,
“TRANSFORM_ID” BIGINT NOT NULL,
“SOURCE_TYPE_NAME” VARCHAR(256),
“DEST_TYPE_NAME” VARCHAR(256),
“SOURCE_PRECISION” INT,
“DEST_PRECISION” INT,
“SOURCE_SCALE” INT,
“DEST_SCALE” INT,
“SOURCE_DEFAULT_VALUE” VARCHAR(500),
“DEST_DEFAULT_VALUE” VARCHAR(500),
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“FLAG” BIT DEFAULT 1,
NOT CLUSTER PRIMARY KEY(“ID”));
COMMENT ON TABLE “DEM”.“DBTOOL_DTS_TRANSFORM_DATA_TYPE_MAPPING” IS ‘数据类型映射关系’;
CREATE TABLE “DEM”.“DBTOOL_DTS_TRANSFORM_EXECUTE”
(
“TRANSFORM_ID” BIGINT NOT NULL,
“EXECUTE_ID” BIGINT NOT NULL,
“FINISHED” BIT,
“SUCCESSFUL” BIT,
“TASK_COUNT” INT,
“CANCELED_COUNT” INT,
“FAILED_COUNT” INT,
“FINISHED_COUNT” INT,
“END_TIME” VARCHAR(50),
“START_TIME” VARCHAR(50),
“TOTAL_TIME” VARCHAR(100),
“GMT_CREATE” TIMESTAMP(6) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(6) DEFAULT SYSDATE,
“FLAG” BIT DEFAULT 1,
CLUSTER PRIMARY KEY(“TRANSFORM_ID”, “EXECUTE_ID”),
FOREIGN KEY(“TRANSFORM_ID”) REFERENCES “DEM”.“DBTOOL_DTS_TRANSFORM”(“ID”) ON DELETE CASCADE );
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_EXECUTE”.“FINISHED” IS ‘是否结束’;
CREATE TABLE “DEM”.“DBTOOL_DTS_TRANSFORM_SESSION”
(
“ID” BIGINT IDENTITY(1, 1) NOT NULL,
“TRANSFORM_ID” BIGINT NOT NULL,
“IS_SOURCE” BIT,
“DB_TYPE” INTEGER,
“HOST” VARCHAR(128),
“PORT” INTEGER,
“USERNAME” VARCHAR(256),
“PASSWORD” VARCHAR(256),
“DRIVER_CLASS” VARCHAR(128),
“USE_DEFAULT_URL” BIT,
“DATABASE_NAME” VARCHAR(256),
“AUTH_TYPE” INTEGER,
“COMPRESS_SUPPORT” BIT,
“MPP_GLOBAL” BIT,
“IS_MPP_CONN” BIT,
“SSL_PATH” VARCHAR(256),
“SSL_PASSWORD” VARCHAR(256),
“FLAG” BIT DEFAULT 1,
“GMT_CREATE” TIMESTAMP(6) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(6) DEFAULT SYSDATE,
CLUSTER PRIMARY KEY(“ID”),
FOREIGN KEY(“TRANSFORM_ID”) REFERENCES “DEM”.“DBTOOL_DTS_TRANSFORM”(“ID”) ON DELETE CASCADE );
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_SESSION”.“TRANSFORM_ID” IS ‘迁移ID’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_SESSION”.“IS_SOURCE” IS ‘源连接还是目的连接’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFORM_SESSION”.“IS_MPP_CONN” IS ‘是否为mpp连接’;
CREATE TABLE “DEM”.“DBTOOL_DTS_TRANSFROM_FILE”
(
“ID” BIGINT IDENTITY(1, 1) NOT NULL,
“TRANSFORM_ID” BIGINT NOT NULL,
“FILE_TYPE” INT,
“FILE_NAME” VARCHAR(512),
“ENCODING” VARCHAR(100),
“PASSWORD” VARCHAR(128),
“NULL_STRING” VARCHAR(512),
“ONE” BIT,
“CELL_AS_STRING” BIT,
“TYPE” INT,
“OPTION” INT,
“DEFINE_EXED” BIT,
“DATA_FILE” VARCHAR(128),
“SPLIT” BIT,
“SPLIT_SIZE” BIGINT,
“COLUMN_SEPARATOR” VARCHAR(512),
“ROW_SEPARATOR” VARCHAR(512),
“TXT_QUOTE” VARCHAR(512),
“IS_COLUMN_SEP_HEX” BIT,
“IS_ROW_SEP_HEX” BIT,
“IS_TEXT_SEP_HEX” BIT,
“SHOW_COLUMN_HEADERS” INT,
“MULTI_THREAD_TRANFER” BIT,
“READ_STRING” BIT,
“FLAG” BIT DEFAULT 1,
“GMT_CREATE” TIMESTAMP(6) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(6) DEFAULT SYSDATE,
NOT CLUSTER PRIMARY KEY(“ID”));
CREATE TABLE “DEM”.“DBTOOL_DTS_TRANSFROM_ITEM”
(
“ID” BIGINT IDENTITY(1, 1) NOT NULL,
“TRANSFORM_ID” BIGINT NOT NULL,
“ITEM_TYPE” INT,
“SOURCE_SCHEMA” VARCHAR(128),
“DEST_SCHEMA” VARCHAR(128),
“QUERY_SQL” VARCHAR(512),
“SOURCE_TRANSFORM_OBJECT_CATALOG_NAME” VARCHAR(128),
“SOURCE_TRANSFORM_OBJECT_SCHEMA_NAME” VARCHAR(128),
“SOURCE_TRANSFORM_OBJECT_NAME” VARCHAR(128),
“DEST_TRANSFORM_OBJECT_CATALOG_NAME” VARCHAR(128),
“DEST_TRANSFORM_OBJECT_SCHEMA_NAME” VARCHAR(128),
“DEST_TRANSFORM_OBJECT_NAME” VARCHAR(128),
“BATCH_SIZE” INT,
“BUF_SIZE” INT,
“FETCH_SIZE” INT,
“LOB_BATCH_SIZE” INT,
“LOB_BUF_SIZE” INT,
“LOB_FETCH_SIZE” INT,
“PARALLEL_EXPORT_NUM” INT,
“TRANSFORM_STRATEGIES” VARCHAR(512),
“DEST_DEFINITION_AUTO_GENERATED” BIT DEFAULT 1,
“DEST_DEFINITION” CLOB,
“FLAG” BIT DEFAULT 1,
“GMT_CREATE” TIMESTAMP(6) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(6) DEFAULT SYSDATE,
“FLDR” CLOB,
“TXT_TO_DM7” BIT,
NOT CLUSTER PRIMARY KEY(“ID”),
FOREIGN KEY(“TRANSFORM_ID”) REFERENCES “DEM”.“DBTOOL_DTS_TRANSFORM”(“ID”) ON DELETE CASCADE );
CREATE TABLE “DEM”.“DBTOOL_DTS_TRANSFROM_MODE”
(
“ID” BIGINT IDENTITY(1, 1) NOT NULL,
“TRANSFORM_ID” BIGINT NOT NULL,
“OBJECTNAME_TO_UPPERCASE” BIT,
“MODE” VARCHAR(50),
“DB_STRATEGIES” VARCHAR(200),
“DEST_CREATE_CHECK” BIT,
“DEST_SCHEMA” VARCHAR(128),
“QUERY_TEXT” CLOB,
“FLAG” BIT DEFAULT 1,
“GMT_CREATE” TIMESTAMP(6) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(6) DEFAULT SYSDATE,
NOT CLUSTER PRIMARY KEY(“ID”),
FOREIGN KEY(“TRANSFORM_ID”) REFERENCES “DEM”.“DBTOOL_DTS_TRANSFORM”(“ID”) ON DELETE CASCADE );
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_MODE”.“OBJECTNAME_TO_UPPERCASE” IS ‘保持对象名大小写’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_MODE”.“MODE” IS ‘查询迁移 or no’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_MODE”.“DB_STRATEGIES” IS '迁移模式/模式对象,目录,公共同义词,上下文 ';
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_MODE”.“DEST_CREATE_CHECK” IS '查询迁移方式,选择是否目的模式不存在,则创建 ';
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_MODE”.“DEST_SCHEMA” IS '查询迁移方式,选择的目的模式 ';
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_MODE”.“QUERY_TEXT” IS ‘查询迁移方式的查询sql脚本’;
CREATE TABLE “DEM”.“DBTOOL_DTS_TRANSFROM_OBJECT”
(
“ID” BIGINT IDENTITY(1, 1) NOT NULL,
“TRANSFORM_ID” BIGINT NOT NULL,
“MODE” INT,
“CONTINUE_WHEN_ERROR” BIT,
“MULTI_THREAD” BIT,
“LIKE_STR” VARCHAR(200),
“DEST_CREATE_CHECK” BIT,
“DEST_REPLACE” BIT,
“FLAG” BIT DEFAULT 1,
“GMT_CREATE” TIMESTAMP(6) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(6) DEFAULT SYSDATE,
CLUSTER PRIMARY KEY(“ID”),
FOREIGN KEY(“TRANSFORM_ID”) REFERENCES “DEM”.“DBTOOL_DTS_TRANSFORM”(“ID”) ON DELETE CASCADE );
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_OBJECT”.“MODE” IS ‘列表方式显示每个迁移对象供选择配置 or no’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_OBJECT”.“CONTINUE_WHEN_ERROR” IS ‘出错后是否继续’;
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_OBJECT”.“MULTI_THREAD” IS '使用多线程迁移数据 ';
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_OBJECT”.“LIKE_STR” IS '统一方式配置转换规则时的,名称匹配串 ';
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_OBJECT”.“DEST_CREATE_CHECK” IS '统一方式配置转换规则时的,除表之外对象,是否先删除已存在对象 ';
COMMENT ON COLUMN “DEM”.“DBTOOL_DTS_TRANSFROM_OBJECT”.“DEST_REPLACE” IS '统一方式配置转换规则时的,除表之外对象,是否需要create or replace方式创建对象 ';
CREATE TABLE “DEM”.“DBTOOL_PREFERENCE”
(
“PARA_NAME” VARCHAR(200),
“PARA_VALUE” VARCHAR(200),
“USER_ID” BIGINT,
“FLAG” BIT DEFAULT 1);
CREATE INDEX “INDEX_DBTOOL_PREFERENCE” ON “DEM”.“DBTOOL_PREFERENCE”(“PARA_NAME” ASC,“PARA_VALUE” ASC,“USER_ID” ASC,“FLAG” ASC);
COMMENT ON TABLE “DEM”.“DBTOOL_PREFERENCE” IS ‘用户在客户端工具模块中配置的首选项属性’;
COMMENT ON COLUMN “DEM”.“DBTOOL_PREFERENCE”.“PARA_NAME” IS ‘属性名称’;
COMMENT ON COLUMN “DEM”.“DBTOOL_PREFERENCE”.“PARA_VALUE” IS ‘属性值’;
COMMENT ON COLUMN “DEM”.“DBTOOL_PREFERENCE”.“USER_ID” IS ‘用户ID’;
COMMENT ON COLUMN “DEM”.“DBTOOL_PREFERENCE”.“FLAG” IS ‘是否有效’;
CREATE TABLE “DEM”.“DBTOOL_SERVER_CONN”
(
“ID” BIGINT NOT NULL,
“USER_ID” BIGINT NOT NULL,
“CONN_NAME” VARCHAR(256),
“IP” VARCHAR(128),
“PORT” INT,
“USERNAME” VARCHAR(256),
“PASSWORD” VARCHAR(256),
“FLAG” INT DEFAULT 1,
“SAVE_PWD” BIT DEFAULT 0,
“NODE_TYPE” INT,
NOT CLUSTER PRIMARY KEY(“ID”),
CONSTRAINT “CON_DBTOOL_SERVER_CONN” UNIQUE(“CONN_NAME”, “USER_ID”));
CREATE INDEX “INDEX_DBTOOL_SERVER_CONN” ON “DEM”.“DBTOOL_SERVER_CONN”(“USER_ID” ASC,“FLAG” ASC);
COMMENT ON TABLE “DEM”.“DBTOOL_SERVER_CONN” IS ‘用户在客户端工具模块中注册的连接’;
COMMENT ON COLUMN “DEM”.“DBTOOL_SERVER_CONN”.“ID” IS ‘注册连接ID’;
COMMENT ON COLUMN “DEM”.“DBTOOL_SERVER_CONN”.“USER_ID” IS ‘所属用户ID’;
COMMENT ON COLUMN “DEM”.“DBTOOL_SERVER_CONN”.“CONN_NAME” IS ‘连接名’;
COMMENT ON COLUMN “DEM”.“DBTOOL_SERVER_CONN”.“IP” IS ‘数据库IP地址’;
COMMENT ON COLUMN “DEM”.“DBTOOL_SERVER_CONN”.“PORT” IS ‘数据库端口号’;
COMMENT ON COLUMN “DEM”.“DBTOOL_SERVER_CONN”.“USERNAME” IS ‘登录用户名’;
COMMENT ON COLUMN “DEM”.“DBTOOL_SERVER_CONN”.“PASSWORD” IS ‘登录密码’;
COMMENT ON COLUMN “DEM”.“DBTOOL_SERVER_CONN”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DBTOOL_SERVER_CONN”.“SAVE_PWD” IS ‘是否保存密码’;
COMMENT ON COLUMN “DEM”.“DBTOOL_SERVER_CONN”.“NODE_TYPE” IS ‘连接类型(manager/monitor)’;
CREATE TABLE “DEM”.“DMA_ALERT”
(
“ID” BIGINT NOT NULL,
“USER_ID” BIGINT,
“GMT_CREATE” DATETIME(0) DEFAULT SYSDATE,
“GMT_MODIFY” DATETIME(0) DEFAULT SYSDATE,
“TITLE” VARCHAR(256),
“DESCRIPTION” VARCHAR(1000),
“MAIL_NOTIFY” BIT,
“PHONE_NOTIFY” BIT,
“FORBIDDEN” BIT,
“FLAG” BIT DEFAULT 1,
NOT CLUSTER PRIMARY KEY(“ID”)) ;
COMMENT ON TABLE “DEM”.“DMA_ALERT” IS ‘告警配置’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT”.“DESCRIPTION” IS ‘描述’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT”.“FORBIDDEN” IS ‘是否禁用’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT”.“GMT_CREATE” IS ‘创建时间’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT”.“GMT_MODIFY” IS ‘修改时间’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT”.“MAIL_NOTIFY” IS ‘是否邮件通知’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT”.“PHONE_NOTIFY” IS ‘是否短信通知’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT”.“TITLE” IS ‘名称’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT”.“USER_ID” IS ‘创建该配置的用户ID’;
CREATE TABLE “DEM”.“DMA_ALERT_HIS”
(
“ID” BIGINT NOT NULL,
“GMT_CREATE” DATETIME(0) DEFAULT SYSDATE,
“FLAG” INT DEFAULT 1,
“ALERT_ID” BIGINT,
“ALERT_NAME” VARCHAR(256),
“RULE_ID” BIGINT,
“RULE_NAME” VARCHAR(256),
“RES_ID” VARCHAR(100),
“RES_NAME” VARCHAR(256),
“RES_TYPE” VARCHAR(50),
“VALID” BIT DEFAULT 1,
“TS” BIGINT,
“MESSAGE” VARCHAR(4000),
“MAIL_NOTIFY_SUCC” BIT,
“PHONE_NOTIFY_SUCC” BIT,
NOT CLUSTER PRIMARY KEY(“ID”)) ;
CREATE INDEX “INDEX_DMA_ALERT_HIS_ALERT_ID” ON “DEM”.“DMA_ALERT_HIS”(“ALERT_ID” ASC) ;
CREATE INDEX “INDEX_DMA_ALERT_HIS_GMT_CREATE” ON “DEM”.“DMA_ALERT_HIS”(“GMT_CREATE” ASC) ;
CREATE INDEX “INDEX_DMA_ALERT_HIS_RES_ID” ON “DEM”.“DMA_ALERT_HIS”(“RES_ID” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_ALERT_HIS” IS ‘警告信息’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“ALERT_ID” IS ‘所属告警配置ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“ALERT_NAME” IS ‘所属告警配置的名称’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“GMT_CREATE” IS ‘创建时间’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“MAIL_NOTIFY_SUCC” IS ‘邮件通知是否成功’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“MESSAGE” IS ‘警告信息’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“PHONE_NOTIFY_SUCC” IS ‘短信通知是否成功’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“RES_ID” IS ‘资源ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“RES_NAME” IS ‘资源名称’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“RES_TYPE” IS ‘资源类型(DB, MF)’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“RULE_ID” IS ‘告警规则ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“RULE_NAME” IS ‘告警规则名称’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“TS” IS ‘发出警告的时间’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS”.“VALID” IS ‘是否标记为已处理’;
CREATE TABLE “DEM”.“DMA_ALERT_HIS_NOTIFY”
(
“ALERT_HIS_ID” BIGINT NOT NULL,
“USER_ID” BIGINT NOT NULL,
“READ” BIT DEFAULT 0,
“MAIL_NOTIFY_SUCC” BIT,
“PHONE_NOTIFY_SUCC” BIT,
NOT CLUSTER PRIMARY KEY(“ALERT_HIS_ID”, “USER_ID”)) ;
CREATE INDEX “INDEX_DMA_ALERT_HIS_NOTIFY_USER_ID” ON “DEM”.“DMA_ALERT_HIS_NOTIFY”(“USER_ID” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_ALERT_HIS_NOTIFY” IS ‘用户收到的告警通知’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS_NOTIFY”.“ALERT_HIS_ID” IS ‘警告信息ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS_NOTIFY”.“MAIL_NOTIFY_SUCC” IS ‘邮件通知是否成功’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS_NOTIFY”.“PHONE_NOTIFY_SUCC” IS ‘短信通知是否成功’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS_NOTIFY”.“READ” IS ‘是否已读’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_HIS_NOTIFY”.“USER_ID” IS ‘用户ID’;
CREATE TABLE “DEM”.“DMA_ALERT_RES”
(
“ALERT_ID” BIGINT,
“RES_ID” VARCHAR(100),
“RES_TYPE” VARCHAR(50),
“FLAG” BIT DEFAULT 1,
“ID” BIGINT) ;
CREATE INDEX “INDEX_DMA_ALERT_RES_ALERT_ID” ON “DEM”.“DMA_ALERT_RES”(“ALERT_ID” ASC) ;
CREATE INDEX “INDEX_DMA_ALERT_RES_RES_ID” ON “DEM”.“DMA_ALERT_RES”(“RES_ID” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_ALERT_RES” IS ‘告警配置中的资源列表’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RES”.“ALERT_ID” IS ‘告警配置ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RES”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RES”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RES”.“RES_ID” IS ‘资源ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RES”.“RES_TYPE” IS ‘资源类型’;
CREATE TABLE “DEM”.“DMA_ALERT_RULE”
(
“ID” BIGINT,
“RULE_TEMPL_ID” BIGINT,
“OP” VARCHAR(50),
“VALUE” VARCHAR(50),
“ALERT_ID” BIGINT,
“BASE_VALUE” VARCHAR(50),
“FORBIDDEN” BIT,
“CONTENT” VARCHAR(8188),
“FLAG” BIT DEFAULT 1,
“MON_ITEM_ID” BIGINT,
“RES_ID” VARCHAR(100),
“RES_TYPE” VARCHAR(50),
“MSG” VARCHAR(1000)) ;
CREATE INDEX “INDEX_DMA_ALERT_RULE_ALERT_ID” ON “DEM”.“DMA_ALERT_RULE”(“ALERT_ID” ASC);
COMMENT ON TABLE “DEM”.“DMA_ALERT_RULE” IS ‘告警配置中的告警规则列表’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RULE”.“ALERT_ID” IS ‘所属告警配置ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RULE”.“BASE_VALUE” IS ‘将配置值转化为统一单位的值,用于告警检测’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RULE”.“CONTENT” IS ‘备注信息’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RULE”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RULE”.“FORBIDDEN” IS ‘是否禁用’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RULE”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RULE”.“MON_ITEM_ID” IS ‘自定义类型监控对象,比如:自定义脚本’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RULE”.“MSG” IS ‘用户自定义异常信息’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RULE”.“OP” IS ‘操作符(>, <, =…)’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RULE”.“RULE_TEMPL_ID” IS ‘所属告警规则类型ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_RULE”.“VALUE” IS ‘配置值’;
CREATE TABLE “DEM”.“DMA_ALERT_USER”
(
“ID” BIGINT,
“USER_ID” BIGINT,
“ALERT_ID” BIGINT,
“FLAG” BIT DEFAULT 1) ;
CREATE INDEX “INDEX_DMA_ALERT_USER_ALERT_ID” ON “DEM”.“DMA_ALERT_USER”(“ALERT_ID” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_ALERT_USER” IS ‘告警配置中的通知用户列表’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_USER”.“ALERT_ID” IS ‘告警配置ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_USER”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_USER”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_ALERT_USER”.“USER_ID” IS ‘用户ID’;
CREATE TABLE “DEM”.“DMA_DATABASE”
(
“ID” VARCHAR(100) NOT NULL,
“MF_ID” VARCHAR(100),
“PORT” INT,
“USER_NAME” VARCHAR(256),
“PASSWORD” VARCHAR(256),
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“DESCRIPTION” VARCHAR(1000),
“FLAG” BIT DEFAULT 1,
“GID” VARCHAR(100),
“EP_SEQNO” INTEGER DEFAULT 0,
“DB_SERVICE_NAME” VARCHAR(100),
“BIN_PATH” VARCHAR(500),
“DM_INI_PATH” VARCHAR(500),
“DMDCR_INI_PATH” VARCHAR(500),
“SSL_FILE_PATH” VARCHAR(500),
“SSL_KEYSTORE_PWD” VARCHAR(500),
“DDFS_ID” VARCHAR(100),
NOT CLUSTER PRIMARY KEY(“ID”)) ;
CREATE INDEX “INDEX_DMA_DB_GMT_CREATE” ON “DEM”.“DMA_DATABASE”(“GMT_CREATE” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE” IS ‘监控的数据库列表’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“BIN_PATH” IS ‘bin目录’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“DB_SERVICE_NAME” IS ‘数据库服务名’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“DESCRIPTION” IS ‘描述信息’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“DM_INI_PATH” IS ‘dm.ini所在路径’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“EP_SEQNO” IS ‘在集群中所属主备组的ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“GID” IS ‘所属集群ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“GMT_CREATE” IS ‘创建时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“GMT_MODIFY” IS ‘修改时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“MF_ID” IS ‘所属主机ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“PASSWORD” IS ‘数据库登录密码’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“PORT” IS ‘数据库端口号’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“USER_NAME” IS ‘数据库登录用户名’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE”.“DMDCR_INI_PATH” IS ‘dmdcr.ini所在路径’;
CREATE TABLE “DEM”.“DMA_DATABASE_DEADLOCK”
(
“TS” BIGINT,
“DB_ID” VARCHAR(100),
“TRX_ID” BIGINT,
“SESS_ID” BIGINT,
“SESS_SEQ” BIGINT,
“SQL_TEXT” VARCHAR(1000),
“HAPPEN_TIME” DATETIME(6),
“USER_NAME” VARCHAR(128),
“APPNAME” VARCHAR(128),
“CLNT_IP” VARCHAR(128)) ;
CREATE INDEX “INDEX_DMA_DB_DEADLOCK” ON “DEM”.“DMA_DATABASE_DEADLOCK”(“DB_ID” ASC,“TS” DESC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_DEADLOCK” IS ‘数据库发生死锁的历史记录’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DEADLOCK”.“APPNAME” IS ‘应用名’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DEADLOCK”.“CLNT_IP” IS ‘客户端IP地址’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DEADLOCK”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DEADLOCK”.“HAPPEN_TIME” IS ‘死锁发生时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DEADLOCK”.“SESS_ID” IS ‘会话ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DEADLOCK”.“SESS_SEQ” IS ‘会话序号’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DEADLOCK”.“SQL_TEXT” IS ‘执行SQL’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DEADLOCK”.“TRX_ID” IS ‘事务ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DEADLOCK”.“TS” IS ‘信息收集时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DEADLOCK”.“USER_NAME” IS ‘用户名’;
CREATE TABLE “DEM”.“DMA_DATABASE_DF”
(
“DB_ID” VARCHAR(100) NOT NULL,
“GROUP_ID” INT,
“ID” INT,
“PATH” VARCHAR(256),
“NAME” VARCHAR(50),
“STATUS” INT,
“TOTAL_SIZE” BIGINT,
“FREE_SIZE” BIGINT,
“MAX_SIZE” INT,
“AUTO_EXTEND” INT) ;
CREATE INDEX “INDEX_DMA_DB_DF” ON “DEM”.“DMA_DATABASE_DF”(“DB_ID” ASC,“GROUP_ID” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_DF” IS ‘数据库表空间文件信息列表’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DF”.“AUTO_EXTEND” IS ‘是否自动扩展’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DF”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DF”.“FREE_SIZE” IS ‘空闲大小’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DF”.“GROUP_ID” IS ‘表空间组ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DF”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DF”.“MAX_SIZE” IS ‘最大大小’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DF”.“NAME” IS ‘文件名’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DF”.“PATH” IS ‘文件目录’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DF”.“STATUS” IS ‘文件状态’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_DF”.“TOTAL_SIZE” IS ‘总大小’;
CREATE TABLE “DEM”.“DMA_DATABASE_EVENT”
(
“EVENT#” INT,
“EVENT” VARCHAR(32),
“TOTAL_WAITS” INT,
“TIME_WAITED” INT,
“TIME_WAITED_MICRO” BIGINT,
“AVERAGE_WAIT_MICRO” INT,
“SMAX_TIME” INT,
“SMIN_TIME” INT,
“WAIT_CLASS#” INT,
“WAIT_CLASS” VARCHAR(32),
“TS” BIGINT,
“DB_ID” VARCHAR(100)) ;
CREATE INDEX “INDEX_DMA_DB_EVENT” ON “DEM”.“DMA_DATABASE_EVENT”(“DB_ID” DESC,“TS” DESC) ;
CREATE INDEX “INDEX_DMA_DB_EVENT_DBID_EVENT” ON “DEM”.“DMA_DATABASE_EVENT”(“DB_ID” ASC,“EVENT#” ASC) ;
CREATE INDEX “INDEX_DMA_DB_EVENT_TS” ON “DEM”.“DMA_DATABASE_EVENT”(“TS” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_EVENT” IS ‘数据库事件历史信息列表’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“AVERAGE_WAIT_MICRO” IS ‘平均等待时间(单位:微秒)’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“EVENT” IS ‘事件名称’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“EVENT#” IS ‘事件编号’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“SMAX_TIME” IS ‘最长等待时间(单位:微秒)’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“SMIN_TIME” IS ‘最短等待时间(单位:微秒)’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“TIME_WAITED” IS ‘等待时间(单位:1/100秒)’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“TIME_WAITED_MICRO” IS ‘等待时间(单位:微秒)’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“TOTAL_WAITS” IS ‘等待次数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“TS” IS ‘信息收集时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“WAIT_CLASS” IS ‘事件类别名称’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_EVENT”.“WAIT_CLASS#” IS ‘事件类别编号’;
CREATE TABLE “DEM”.“DMA_DATABASE_INFO”
(
“DB_ID” VARCHAR(100) NOT NULL,
“INSTANCE_NAME” VARCHAR(128),
“SVR_VERSION” VARCHAR(128),
“DB_VERSION” VARCHAR(128),
“START_TIME” VARCHAR(128),
“STATUS” VARCHAR(128),
“MODE” VARCHAR(128),
“TS” BIGINT,
“ALIVE” BIT,
“PID” VARCHAR(100),
“EP_SEQNO” INTEGER,
“EP_STATE” VARCHAR(128),
“ARCH_STATUS” VARCHAR(512),
“OPEN_COUNT” BIGINT,
“SWITCH_COUNT” BIGINT,
“LSN_INFO” VARCHAR(100),
“STANDBY_TYPE” VARCHAR(128),
“GROUP_NAME” VARCHAR(128),
“OGUID” INTEGER,
“MON_DW_IPS” VARCHAR(1024),
“KEY_SUMMARY” VARCHAR(1024),
“ASM_PORTS” VARCHAR(100),
“DCR_OGUID” INTEGER,
“ON_DDFS” INT,
NOT CLUSTER PRIMARY KEY(“DB_ID”)) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_INFO” IS ‘数据库监控的基本信息列表’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“ALIVE” IS ‘是否存活’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“ARCH_STATUS” IS ‘归档状态’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“ASM_PORTS” IS ‘ASM监听端口’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“DB_VERSION” IS ‘数据库版本’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“EP_SEQNO” IS ‘站点序号’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“EP_STATE” IS ‘站点状态’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“GROUP_NAME” IS ‘所属的守护组名’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“INSTANCE_NAME” IS ‘实例名’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“KEY_SUMMARY” IS ‘KEY信息’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“LSN_INFO” IS ‘LSN信息’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“MODE” IS ‘模式’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“MON_DW_IPS” IS ‘守护进程IP地址和监听端口’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“OGUID” IS ‘所属的守护组OGUID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“OPEN_COUNT” IS ‘重启次数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“PID” IS ‘主备系统中主机ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“STANDBY_TYPE” IS ‘备机类型’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“START_TIME” IS ‘启动时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“STATUS” IS ‘状态’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_INFO”.“SVR_VERSION” IS ‘服务器版本’;
comment on column “DEM”.“DMA_DATABASE_INFO”.“DCR_OGUID” is ‘RAC环境的dcr oguid’;
comment on column “DEM”.“DMA_DATABASE_INFO”.“ON_DDFS” is ‘是否为DDFS’;
CREATE TABLE “DEM”.“DMA_DATABASE_SESSION”
(
“TS” BIGINT,
“SESS_ID” BIGINT,
“SQL_TEXT” TEXT,
“SESS_INTERVAL” BIGINT,
“SESS_COUNT” BIGINT,
“USER_NAME” VARCHAR(128),
“CREATE_TIME” DATETIME(0),
“APPNAME” VARCHAR(128),
“CLNT_IP” VARCHAR(128),
“STATE” VARCHAR(8),
“DB_ID” VARCHAR(100),
“NET_BYTES_R” BIGINT,
“NET_BYTES_S” BIGINT,
“SEL_SQL_CNT” BIGINT,
“INS_SQL_CNT” BIGINT,
“DEL_SQL_CNT” BIGINT,
“UPD_SQL_CNT” BIGINT,
“DDL_SQL_CNT” BIGINT,
“SEL_IN_PL_CNT” BIGINT,
“INS_IN_PL_CNT” BIGINT,
“DEL_IN_PL_CNT” BIGINT,
“UPD_IN_PL_CNT” BIGINT,
“DYN_EXEC_CNT” BIGINT,
“RUNTIME_OBJ_SIZE_CNT” BIGINT,
“IO_WAIT_TIME” BIGINT,
“TAB_SCAN_CNT” BIGINT,
“HASH_JOIN_CNT” BIGINT) ;
CREATE INDEX “INDEX_DMA_DB_SESSION” ON “DEM”.“DMA_DATABASE_SESSION”(“DB_ID” DESC,“TS” DESC,“STATE” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_SESSION” IS ‘数据库会话历史信息列表’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“APPNAME” IS ‘应用程序’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“CLNT_IP” IS ‘客户端IP’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“CREATE_TIME” IS ‘创建时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“DDL_SQL_CNT” IS ‘执行的DDL语句总数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“DEL_IN_PL_CNT” IS ‘执行的语句块中的删除语句总数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“DEL_SQL_CNT” IS ‘执行的删除语句总数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“DYN_EXEC_CNT” IS ‘执行的语句块中的动态执行语句总数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“HASH_JOIN_CNT” IS ‘统计哈希连接的次数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“INS_IN_PL_CNT” IS ‘执行的语句块中的插入语句总数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“INS_SQL_CNT” IS ‘执行的插入语句总数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“IO_WAIT_TIME” IS ‘I/O等待时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“NET_BYTES_R” IS ‘网络收到的字节数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“NET_BYTES_S” IS ‘网络发送的字节数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“RUNTIME_OBJ_SIZE_CNT” IS ‘运行时对象占用空间大小’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“SEL_IN_PL_CNT” IS ‘执行的语句块中的查询语句总数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“SEL_SQL_CNT” IS ‘执行的查询语句总数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“SESS_COUNT” IS ‘会话数量’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“SESS_ID” IS ‘会话ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“SESS_INTERVAL” IS ‘会话使用时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“SQL_TEXT” IS ‘执行SQL’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“STATE” IS ‘状态’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“TAB_SCAN_CNT” IS ‘统计全表扫描次数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“TS” IS ‘信息收集时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“UPD_IN_PL_CNT” IS ‘执行的语句块中的更新语句总数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“UPD_SQL_CNT” IS ‘执行的更新语句总数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SESSION”.“USER_NAME” IS ‘用户名’;
CREATE TABLE “DEM”.“DMA_DATABASE_SQL_COUNT”
(
“TS” BIGINT,
“DB_ID” VARCHAR(100),
“SEQ_NO” BIGINT,
“SESS_ID” BIGINT,
“TRX_ID” BIGINT,
“SQL_TEXT” VARCHAR(1024),
“START_TIME” DATETIME(0),
“TIME_USED” BIGINT,
“IS_OVER” CHAR(1),
“USER_NAME” VARCHAR(128),
“CLNT_IP” VARCHAR(128),
“APPNAME” VARCHAR(128),
“COUNT” BIGINT,
“SQL_TEXT_ID” BIGINT) ;
CREATE INDEX “INDEX_DMA_DB_SQL_COUNT” ON “DEM”.“DMA_DATABASE_SQL_COUNT”(“DB_ID” ASC,“START_TIME” ASC,“COUNT” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_SQL_COUNT” IS ‘数据库执行sql次数统计信息’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“APPNAME” IS ‘应用程序’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“CLNT_IP” IS ‘客户端IP’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“COUNT” IS ‘执行次数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“IS_OVER” IS ‘是否结束’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“SEQ_NO” IS ‘序号’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“SESS_ID” IS ‘会话ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“SQL_TEXT” IS ‘sql语句’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“SQL_TEXT_ID” IS ‘sql语句ID,语句在单独的表中存储’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“START_TIME” IS ‘开始时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“TIME_USED” IS ‘使用时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“TRX_ID” IS ‘事务ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“TS” IS ‘信息收集时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT”.“USER_NAME” IS ‘用户名’;
CREATE TABLE “DEM”.“DMA_DATABASE_SQL_COUNT_SQL_TEXT”
(
“ID” BIGINT IDENTITY(1, 1) NOT NULL,
“SQL_TEXT” VARCHAR(1024),
“DB_ID” VARCHAR(100),
NOT CLUSTER PRIMARY KEY(“ID”)) ;
CREATE INDEX “INDEX_DMA_DB_SQL_COUNT_SQL_TEXT” ON “DEM”.“DMA_DATABASE_SQL_COUNT_SQL_TEXT”(“SQL_TEXT” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_SQL_COUNT_SQL_TEXT” IS ‘数据库执行的sql语句,相同数据库中相同的sql语句消重’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT_SQL_TEXT”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT_SQL_TEXT”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_COUNT_SQL_TEXT”.“SQL_TEXT” IS ‘sql语句’;
CREATE TABLE “DEM”.“DMA_DATABASE_SQL_ERR”
(
“TS” BIGINT,
“DB_ID” VARCHAR(100) NOT NULL,
“SEQ_NO” BIGINT,
“SESS_ID” BIGINT,
“SQL_TEXT” VARCHAR(1024),
“SU_FLAG” CHAR(1),
“ECPT_CODE” INT,
“ECPT_DESC” VARCHAR(256),
“START_TIME” DATETIME(0),
“USER_NAME” VARCHAR(128),
“CLNT_IP” VARCHAR(128),
“APPNAME” VARCHAR(128)) ;
CREATE INDEX “INDEX_DMA_DB_SQL_ERR” ON “DEM”.“DMA_DATABASE_SQL_ERR”(“DB_ID” ASC,“TS” DESC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_SQL_ERR” IS ‘数据库执行sql出错历史记录’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“APPNAME” IS ‘应用程序名称’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“CLNT_IP” IS ‘客户端IP’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“ECPT_CODE” IS ‘异常错误号’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“ECPT_DESC” IS ‘异常描述’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“SEQ_NO” IS ‘***’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“SESS_ID” IS ‘会话ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“SQL_TEXT” IS ‘sql语句’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“START_TIME” IS ‘开始时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“SU_FLAG” IS ‘异常类型’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“TS” IS ‘信息收集时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_ERR”.“USER_NAME” IS ‘用户名’;
CREATE TABLE “DEM”.“DMA_DATABASE_SQL_SLOW”
(
“TS” BIGINT,
“DB_ID” VARCHAR(100),
“SEQ_NO” BIGINT,
“SESS_ID” BIGINT,
“TRX_ID” BIGINT,
“SQL_TEXT” VARCHAR(1024),
“START_TIME” DATETIME(0),
“TIME_USED” BIGINT,
“IS_OVER” CHAR(1),
“USER_NAME” VARCHAR(128),
“CLNT_IP” VARCHAR(128),
“APPNAME” VARCHAR(128)) ;
CREATE INDEX “INDEX_DMA_DB_SQL_SLOW” ON “DEM”.“DMA_DATABASE_SQL_SLOW”(“DB_ID” ASC,“TS” DESC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_SQL_SLOW” IS ‘数据库慢sql统计信息’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“APPNAME” IS ‘应用程序名称’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“CLNT_IP” IS ‘客户端IP’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“IS_OVER” IS ‘是否结束’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“SEQ_NO” IS ‘***’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“SESS_ID” IS ‘会话ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“SQL_TEXT” IS ‘sql语句’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“START_TIME” IS ‘开始时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“TIME_USED” IS ‘执行时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“TRX_ID” IS ‘事务ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“TS” IS ‘信息收集时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_SQL_SLOW”.“USER_NAME” IS ‘用户名’;
CREATE TABLE “DEM”.“DMA_DATABASE_STAT”
(
“TS” BIGINT,
“DB_ID” VARCHAR(100) NOT NULL,
“TPS” BIGINT,
“QPS” BIGINT,
“IPS” BIGINT,
“DPS” BIGINT,
“UPS” BIGINT,
“DDLPS” BIGINT,
“NIO_IPS” BIGINT,
“NIO_OPS” BIGINT,
“FIO_IPS” BIGINT,
“FIO_OPS” BIGINT,
“MEM_USE” BIGINT,
“CPU_USE_RATE” BIGINT,
“THREAD_COUNT” BIGINT,
“SESSION_COUNT” BIGINT,
“MEM_TOTAL” BIGINT,
“ACTIVE_SESSION_COUNT” BIGINT,
“WAITING” INTEGER,
“READY” BIGINT,
“TOTAL_WAIT_TIME” BIGINT,
“AVG_WAIT_TIME” INTEGER,
“SWAP_USE” BIGINT,
“SWAP_TOTAL” BIGINT) ;
CREATE INDEX “INDEX_DMA_DB_STAT” ON “DEM”.“DMA_DATABASE_STAT”(“DB_ID” ASC,“TS” DESC) ;
CREATE INDEX “INDEX_DMA_DB_STAT_TS” ON “DEM”.“DMA_DATABASE_STAT”(“TS” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_STAT” IS ‘数据库状态信息历史记录’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“ACTIVE_SESSION_COUNT” IS ‘活动会话数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“CPU_USE_RATE” IS ‘cpu使用率,单位%’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“DDLPS” IS ‘每秒DDL操作数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“DPS” IS ‘每秒删除数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“FIO_IPS” IS ‘文件读取速率’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“FIO_OPS” IS ‘文件写入速率’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“IPS” IS ‘每秒插入数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“MEM_TOTAL” IS ‘总内存数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“MEM_USE” IS ‘内存使用大小,单位B’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“NIO_IPS” IS ‘网络接收速率’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“NIO_OPS” IS ‘网络发送速率’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“QPS” IS ‘每秒查询数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“SESSION_COUNT” IS ‘总会话数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“THREAD_COUNT” IS ‘线程数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“TPS” IS ‘每秒事务数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“TS” IS ‘信息收集时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“UPS” IS ‘每秒更新数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“TOTAL_WAIT_TIME” IS ‘已处理任务的总等待时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“TS” IS ‘信息收集时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_STAT”.“WAITING” IS ‘等待处理任务数’;
CREATE TABLE “DEM”.“DMA_DATABASE_ARCH”
(
“TS” BIGINT,
“DB_ID” VARCHAR(100),
“ARCH_TYPE” VARCHAR(50),
“STATUS” VARCHAR(50),
“WAITING” INTEGER,
“READY” BIGINT,
“CUR_WAIT_TIME” INTEGER,
“TOTAL_WAIT_TIME” BIGINT,
“MAX_WAIT_TIME” INTEGER,
“AVG_WAIT_TIME” INTEGER);
CREATE INDEX “INDEX_DMA_DB_ARCH” ON “DEM”.“DMA_DATABASE_ARCH”(“DB_ID” ASC,“TS” DESC);
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_ARCH”.“ARCH_TYPE” IS ‘归档类型’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_ARCH”.“AVG_WAIT_TIME” IS ‘已处理任务的平均等待时间(ms)’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_ARCH”.“CUR_WAIT_TIME” IS ‘当前任务等待时间(ms)’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_ARCH”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_ARCH”.“MAX_WAIT_TIME” IS ‘历史任务的最长等待时间 (ms)’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_ARCH”.“READY” IS ‘已处理任务数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_ARCH”.“STATUS” IS ‘归档状态’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_ARCH”.“TOTAL_WAIT_TIME” IS ‘已处理任务的总等待时间(ms)’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_ARCH”.“TS” IS ‘时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_ARCH”.“WAITING” IS ‘等待处理任务数’;
CREATE TABLE “DEM”.“DMA_DATABASE_TABLE”
(
“ID” BIGINT NOT NULL,
“SCH_NAME” VARCHAR(128),
“TAB_NAME” VARCHAR(128),
“DB_ID” VARCHAR(100),
“FLAG” BIT,
“FORBIDDEN” BIT DEFAULT 0,
NOT CLUSTER PRIMARY KEY(“ID”)) STORAGE(ON “MAIN”, CLUSTERBTR) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_TABLE” IS ‘数据库监控表信息’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TABLE”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TABLE”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TABLE”.“FORBIDDEN” IS ‘是否禁用’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TABLE”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TABLE”.“SCH_NAME” IS ‘模式名’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TABLE”.“TAB_NAME” IS ‘表名’;
CREATE TABLE “DEM”.“DMA_DATABASE_TABLE_STAT”
(
“TS” BIGINT,
“TABLE_ID” BIGINT,
“ROW_COUNT” BIGINT) ;
CREATE INDEX “INDEX_DMA_DATABASE_TABLE_STAT” ON “DEM”.“DMA_DATABASE_TABLE_STAT”(“TABLE_ID” ASC,“TS” DESC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_TABLE_STAT” IS ‘数据库表监控历史信息列表’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TABLE_STAT”.“ROW_COUNT” IS ‘表数据行数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TABLE_STAT”.“TABLE_ID” IS ‘表ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TABLE_STAT”.“TS” IS ‘信息收集时间’;
CREATE TABLE “DEM”.“DMA_DATABASE_TS”
(
“TS” BIGINT NOT NULL,
“DB_ID” VARCHAR(100) NOT NULL,
“ID” INT,
“NAME” VARCHAR(128),
“CACHE” VARCHAR(20),
“TYPE” INT,
“STATUS” INT,
“MAX_SIZE” BIGINT,
“TOTAL_SIZE” BIGINT,
“FREE_SIZE” BIGINT,
“FILE_NUM” INT) ;
CREATE INDEX “INDEX_DMA_DB_TS” ON “DEM”.“DMA_DATABASE_TS”(“DB_ID” ASC,“TS” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_TS” IS ‘数据库表空间监控历史信息’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TS”.“CACHE” IS ‘CACHE名’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TS”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TS”.“FILE_NUM” IS ‘文件数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TS”.“FREE_SIZE” IS ‘空闲大小’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TS”.“ID” IS ‘表空间ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TS”.“MAX_SIZE” IS ‘最大大小’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TS”.“NAME” IS ‘表空间名称’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TS”.“STATUS” IS ‘表空间状态’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TS”.“TOTAL_SIZE” IS ‘总大小’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TS”.“TS” IS ‘信息收集时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_TS”.“TYPE” IS ‘表空间类型’;
CREATE TABLE “DEM”.“DMA_DATABASE_UD_SQL”
(
“ID” BIGINT,
“DB_ID” VARCHAR(100),
“UD_SQL” VARCHAR(8188),
“FLAG” BIT DEFAULT 1,
“NAME” VARCHAR(500),
“FORBIDDEN” BIT DEFAULT 0) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_UD_SQL” IS ‘数据库自定义SQL监控列表’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL”.“FORBIDDEN” IS ‘是否禁用’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL”.“NAME” IS ‘名称’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL”.“UD_SQL” IS ‘自定义sql语句’;
CREATE TABLE “DEM”.“DMA_DATABASE_UD_SQL_STAT”
(
“TS” BIGINT,
“RESULT” DECIMAL(22,6),
“SUCCESS” BIT,
“ERROR_MSG” VARCHAR(256),
“UD_SQL_ID” BIGINT,
“MSG” VARCHAR(8188)) ;
CREATE INDEX “INDEX_DMA_DATABASE_UD_SQL_STAT” ON “DEM”.“DMA_DATABASE_UD_SQL_STAT”(“UD_SQL_ID” ASC,“TS” DESC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_UD_SQL_STAT” IS ‘数据库自定义SQL监控历史信息列表’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL_STAT”.“ERROR_MSG” IS ‘出错消息’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL_STAT”.“MSG” IS ‘执行过程中输出的信息’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL_STAT”.“RESULT” IS ‘执行结果’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL_STAT”.“SUCCESS” IS ‘执行是否成功’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL_STAT”.“TS” IS ‘执行时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_UD_SQL_STAT”.“UD_SQL_ID” IS ‘自定义SQL监控ID’;
CREATE TABLE “DEM”.“DMA_DATABASE_USER”
(
“TS” BIGINT,
“DB_ID” VARCHAR(100) NOT NULL,
“USER_ID” BIGINT,
“USER_NAME” VARCHAR(128),
“LOCKED_STATUS” INT,
“FAILED_NUM” INT,
“LASTEST_LOCKED” DATETIME(0),
“LOCK_TIME” INT) ;
CREATE INDEX “INDEX_DMA_DB_USER” ON “DEM”.“DMA_DATABASE_USER”(“DB_ID” ASC,“LASTEST_LOCKED” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_DATABASE_USER” IS ‘数据库用户监控历史信息’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_USER”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_USER”.“FAILED_NUM” IS ‘登录失败次数’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_USER”.“LASTEST_LOCKED” IS ‘最近一次锁定时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_USER”.“LOCKED_STATUS” IS ‘锁定状态’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_USER”.“LOCK_TIME” IS ‘锁定了多久’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_USER”.“TS” IS ‘信息收集时间’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_USER”.“USER_ID” IS ‘用户ID’;
COMMENT ON COLUMN “DEM”.“DMA_DATABASE_USER”.“USER_NAME” IS ‘用户名’;
CREATE TABLE “DEM”.“DMA_GROUP”
(
“ID” VARCHAR(100) NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“NAME” VARCHAR(256),
“MF_ID” VARCHAR(100),
“DESCRIPTION” VARCHAR(1000),
“FLAG” BIT DEFAULT 1,
“TID” INTEGER,
“ORDER_NUM” INTEGER,
NOT CLUSTER PRIMARY KEY(“ID”)) ;
COMMENT ON TABLE “DEM”.“DMA_GROUP” IS ‘监控的资源组’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP”.“DESCRIPTION” IS ‘组的描述信息’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP”.“GMT_CREATE” IS ‘创建时间’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP”.“GMT_MODIFY” IS ‘修改时间’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP”.“ID” IS ‘组ID’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP”.“MF_ID” IS ‘dmmonitor所在的主机ID’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP”.“NAME” IS ‘组名称’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP”.“TID” IS ‘组类型ID’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP”.“ORDER_NUM” IS ‘用于排序’;
CREATE TABLE “DEM”.“DMA_GROUP_TYPE”
(
“ID” INTEGER NOT NULL,
“NAME” VARCHAR(100),
“DESCRIPTION” VARCHAR(200),
“ENABLE” BIT,
NOT CLUSTER PRIMARY KEY(“ID”)) ;
COMMENT ON TABLE “DEM”.“DMA_GROUP_TYPE” IS ‘资源组类型’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP_TYPE”.“DESCRIPTION” IS ‘描述’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP_TYPE”.“ENABLE” IS ‘是否启用’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP_TYPE”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_GROUP_TYPE”.“NAME” IS ‘名称’;
CREATE TABLE “DEM”.“DMA_MAINFRAME”
(
“ID” VARCHAR(100) NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“HOST_NAME” VARCHAR(100),
“OS_NAME” VARCHAR(256),
“OS_VERSION” VARCHAR(256),
“CPU_COUNT” INTEGER,
“OS_VENDOR” VARCHAR(256),
“OS_ARCH” VARCHAR(256),
“MEM_SIZE” BIGINT,
“CPU_DESC” VARCHAR(256),
“OS_DATA_MODEL” VARCHAR(256),
“TS” BIGINT,
“OUTER_IP” VARCHAR(100),
“INNER_IP” VARCHAR(100),
“IP_LIST” VARCHAR(8000),
“FLAG” BIT DEFAULT 1,
“NET_CFG_FLAG” BIT DEFAULT 0,
“DMAGENT_CFG” TEXT,
NOT CLUSTER PRIMARY KEY(“ID”)) ;
CREATE INDEX “INDEX_DMA_MF_GMT_CREATE” ON “DEM”.“DMA_MAINFRAME”(“GMT_CREATE” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_MAINFRAME” IS ‘监控的主机列表’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“CPU_COUNT” IS ‘cpu内核数’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“CPU_DESC” IS ‘cpu’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“DMAGENT_CFG” IS ‘dmagent配置信息’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“GMT_CREATE” IS ‘创建时间’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“GMT_MODIFY” IS ‘修改时间’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“HOST_NAME” IS ‘主机名’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“INNER_IP” IS ‘内网IP’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“IP_LIST” IS ‘网卡列表’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“MEM_SIZE” IS ‘内存大小’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“NET_CFG_FLAG” IS ‘是否配置网络’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“OS_DATA_MODEL” IS ‘操作系统位数’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“OS_NAME” IS ‘操作系统’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“OS_VENDOR” IS ‘操作系统供应商’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“OS_VERSION” IS ‘操作系统版本’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“OUTER_IP” IS ‘外网IP’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME”.“TS” IS ‘信息收集时间’;
CREATE TABLE “DEM”.“DMA_MAINFRAME_DISK”
(
“TS” BIGINT,
“MF_ID” VARCHAR(100),
“DIR” VARCHAR(256),
“USED” BIGINT,
“TOTAL” BIGINT,
“IN_SPEED” DECIMAL(22,2),
“OUT_SPEED” DECIMAL(22,2)) ;
CREATE INDEX “INDEX_DMA_MF_DISK” ON “DEM”.“DMA_MAINFRAME_DISK”(“MF_ID” ASC,“TS” DESC) ;
COMMENT ON TABLE “DEM”.“DMA_MAINFRAME_DISK” IS ‘主机磁盘监控信息’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_DISK”.“DIR” IS ‘磁盘名称或目录’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_DISK”.“IN_SPEED” IS ‘磁盘写速率,单位KBps’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_DISK”.“MF_ID” IS ‘主机ID’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_DISK”.“OUT_SPEED” IS ‘磁盘读速率,单位KBps’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_DISK”.“TOTAL” IS ‘总大小,单位KB’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_DISK”.“TS” IS ‘信息收集时间’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_DISK”.“USED” IS ‘已使用大小,单位KB’;
CREATE TABLE “DEM”.“DMA_MAINFRAME_STAT”
(
“MF_ID” VARCHAR(100),
“TS” BIGINT,
“CPU_USER_P” DECIMAL(22,2),
“CPU_SYS_P” DECIMAL(22,2),
“CPU_WAIT_P” DECIMAL(22,2),
“CPU_USED_P” DECIMAL(22,2),
“MEM_TOTAL” BIGINT,
“MEM_USED” BIGINT,
“SWAP_TOTAL” BIGINT,
“SWAP_USED” BIGINT,
“SWAP_PAGE_IN” BIGINT,
“SWAP_PAGE_OUT” BIGINT,
“DISK_TOTAL” BIGINT,
“DISK_USED” BIGINT,
“DISK_O_COUNT” BIGINT,
“DISK_O_SPEED” DECIMAL(22,6),
“DISK_I_COUNT” BIGINT,
“DISK_I_SPEED” DECIMAL(22,2),
“NET_R_SPEED” DECIMAL(22,2),
“NET_T_SPEED” DECIMAL(22,2)) ;
CREATE INDEX “INDEX_DMA_MF_STAT” ON “DEM”.“DMA_MAINFRAME_STAT”(“MF_ID” ASC, “TS” ASC);
CREATE INDEX “INDEX_DMA_MF_STAT_TS” ON “DEM”.“DMA_MAINFRAME_STAT”(“TS” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_MAINFRAME_STAT” IS ‘主机监控信息’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“CPU_SYS_P” IS ‘系统进程cpu使用率,单位%’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“CPU_USED_P” IS ‘总cpu使用率,单位%’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“CPU_USER_P” IS ‘用户进程cpu使用率,单位%’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“CPU_WAIT_P” IS ‘cpu等待,单位%’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“DISK_I_COUNT” IS ‘磁盘写次数’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“DISK_I_SPEED” IS ‘磁盘写入速率,单位KBps’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“DISK_O_COUNT” IS ‘磁盘读取次数’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“DISK_O_SPEED” IS ‘磁盘读取速率,单位KBps’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“DISK_TOTAL” IS ‘总磁盘大小,单位KB’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“DISK_USED” IS ‘已使用的磁盘大小,单位KB’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“MEM_TOTAL” IS ‘总内存大小,单位B’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“MEM_USED” IS ‘已使用的内存大小,单位B’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“MF_ID” IS ‘主机ID’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“NET_R_SPEED” IS ‘网络接收速率,单位Bps’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“NET_T_SPEED” IS ‘网络发送速率,单位Bps’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“SWAP_PAGE_IN” IS ‘交换区写入页数’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“SWAP_PAGE_OUT” IS ‘交换区读取页数’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“SWAP_TOTAL” IS ‘总交换区大小,单位B’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“SWAP_USED” IS ‘已使用的交换区大小,单位B’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_STAT”.“TS” IS ‘信息收集时间’;
CREATE TABLE “DEM”.“DMA_MAINFRAME_EXEC”
(
“ID” BIGINT,
“NAME” VARCHAR(500),
“MF_ID” VARCHAR(100),
“EXEC_PATH” VARCHAR(1000),
“FLAG” BIT DEFAULT 1,
“FORBIDDEN” BIT DEFAULT 0) ;
CREATE INDEX “IDX_ID” ON “DEM”.“DMA_MAINFRAME_EXEC”(“ID” ASC);
CREATE INDEX “IDX_MF_ID” ON “DEM”.“DMA_MAINFRAME_EXEC”(“MF_ID” ASC);
COMMENT ON TABLE “DEM”.“DMA_MAINFRAME_EXEC” IS ‘自定义可执行程序或脚本监控列表’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC”.“EXEC_PATH” IS ‘执行程序路径’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC”.“FLAG” IS ‘是否有效’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC”.“FORBIDDEN” IS ‘是否禁用’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC”.“MF_ID” IS ‘主机ID’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC”.“NAME” IS ‘名称’;
CREATE TABLE “DEM”.“DMA_MAINFRAME_EXEC_STAT”
(
“TS” BIGINT,
“EXEC_ID” BIGINT,
“RESULT” INT,
“MSG” VARCHAR(2000),
“SUCCESS” BIT,
“ERROR_MSG” VARCHAR(256)) ;
CREATE INDEX “IDX_TS” ON “DEM”.“DMA_MAINFRAME_EXEC_STAT”(“TS” ASC) ;
CREATE INDEX “IDX_EXEC_ID” ON “DEM”.“DMA_MAINFRAME_EXEC_STAT”(“EXEC_ID” ASC) ;
COMMENT ON TABLE “DEM”.“DMA_MAINFRAME_EXEC_STAT” IS ‘自定义可执行程序或脚本监控历史信息列表’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC_STAT”.“ERROR_MSG” IS ‘出错信息’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC_STAT”.“EXEC_ID” IS ‘自定义可执行程序或脚本监控ID’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC_STAT”.“MSG” IS ‘执行过程中输出的信息’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC_STAT”.“RESULT” IS ‘执行结果’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC_STAT”.“SUCCESS” IS ‘是否执行成功’;
COMMENT ON COLUMN “DEM”.“DMA_MAINFRAME_EXEC_STAT”.“TS” IS ‘执行时间’;
CREATE TABLE “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE”
(
“ID” VARCHAR(100) NOT NULL,
“USER_ID” BIGINT NOT NULL,
“SQL_TEMPLATE” TEXT,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“DESCRIPTION” VARCHAR(1000),
“NAME” VARCHAR(100),
“USED_NUM” INT DEFAULT 0,
NOT CLUSTER PRIMARY KEY(“ID”)) ;
COMMENT ON TABLE “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE” IS ‘多连接查询模板’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE”.“DESCRIPTION” IS ‘描述’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE”.“GMT_CREATE” IS ‘创建时间’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE”.“GMT_MODIFY” IS ‘修改时间’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE”.“NAME” IS ‘名称’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE”.“SQL_TEMPLATE” IS ‘sql语句’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE”.“USED_NUM” IS ‘使用次数’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE”.“USER_ID” IS ‘用户ID’;
CREATE TABLE “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE_DB”
(
“ID” VARCHAR(100) NOT NULL,
“SQL_TEMPLATE_ID” VARCHAR(100) NOT NULL,
“DB_ID” VARCHAR(100) NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
NOT CLUSTER PRIMARY KEY(“ID”),
FOREIGN KEY(“DB_ID”) REFERENCES “DEM”.“DMA_DATABASE”(“ID”) ON DELETE CASCADE ) ;
COMMENT ON TABLE “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE_DB” IS ‘多连接查询模板中连接的数据库列表’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE_DB”.“DB_ID” IS ‘数据库ID’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE_DB”.“GMT_CREATE” IS ‘创建时间’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE_DB”.“GMT_MODIFY” IS ‘修改时间’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE_DB”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_MULTI_CONN_SQL_TEMPLATE_DB”.“SQL_TEMPLATE_ID” IS ‘多连接查询模板ID’;
CREATE TABLE “DEM”.“DMA_RULE_TEMPL”
(
“ID” BIGINT NOT NULL,
“NAME” VARCHAR(256),
“TYPE” VARCHAR(50),
“PROCESSOR” VARCHAR(256),
“UNITS” VARCHAR(50),
“GATHER_DATA_TYPE” INTEGER,
NOT CLUSTER PRIMARY KEY(“ID”)) ;
COMMENT ON TABLE “DEM”.“DMA_RULE_TEMPL” IS ‘告警规则类型模板’;
COMMENT ON COLUMN “DEM”.“DMA_RULE_TEMPL”.“GATHER_DATA_TYPE” IS ‘agent收集到的数据类型’;
COMMENT ON COLUMN “DEM”.“DMA_RULE_TEMPL”.“ID” IS ‘ID’;
COMMENT ON COLUMN “DEM”.“DMA_RULE_TEMPL”.“NAME” IS ‘名称’;
COMMENT ON COLUMN “DEM”.“DMA_RULE_TEMPL”.“PROCESSOR” IS ‘告警检测类’;
COMMENT ON COLUMN “DEM”.“DMA_RULE_TEMPL”.“TYPE” IS ‘规则可以应用的资源类型(DB,MF)’;
COMMENT ON COLUMN “DEM”.“DMA_RULE_TEMPL”.“UNITS” IS ‘单位’;
CREATE TABLE “DEM”.“DMA_DDFS_DB”
(
“ID” VARCHAR(100) NOT NULL,
“FLAG” BIT DEFAULT 1,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“MF_ID” VARCHAR(100),
“PORT” INT,
“USERNAME” VARCHAR(256),
“PASSWORD” VARCHAR(256),
“BIN_PATH” VARCHAR(500),
“INI_PATH” VARCHAR(500),
“SERVICE_NAME” VARCHAR(100),
“DDFS_ID” VARCHAR(100),
“MODE” VARCHAR(128),
“IP_ADDRESS” VARCHAR(64));
CREATE TABLE “DEM”.“DMA_DDFS_DCS”
(
“ID” VARCHAR(100) NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“FLAG” BIT DEFAULT 1,
“DDFS_DB_ID” VARCHAR(100),
“BIN_PATH” VARCHAR(500),
“INI_PATH” VARCHAR(500),
“SERVICE_NAME” VARCHAR(100),
“MF_ID” VARCHAR(100),
“DDFS_ID” VARCHAR(100),
“PORT” INT,
“MICRO_SIZE” INT,
“GREAT_SIZE” INT,
“PAGE_SIZE” INT,
“TS” BIGINT,
“IP_ADDRESS” VARCHAR(64));
CREATE TABLE “DEM”.“DMA_DDFS_DRS”
(
“ID” VARCHAR(100) NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“FLAG” BIT DEFAULT 1,
“DRS_ID” VARCHAR(128),
“BIN_PATH” VARCHAR(500),
“INI_PATH” VARCHAR(500),
“SERVICE_NAME” VARCHAR(100),
“MF_ID” VARCHAR(100),
“AUTO_RESTART” BIT DEFAULT 0,
“WATCHER_IS_STOP” BIT DEFAULT 0,
“DDFS_ID” VARCHAR(100),
“INST_NAME” VARCHAR(128),
“IP_ADDRESS” VARCHAR(64),
“PORT” INT,
“GRP_ID” VARCHAR(128),
“GRP_NAME” VARCHAR(128),
“MODE$” INT,
“TS” BIGINT) ;
COMMENT ON COLUMN “DEM”.“DMA_DDFS_DRS”.“AUTO_RESTART” IS ‘是否需要dmagent拉起’;
COMMENT ON COLUMN “DEM”.“DMA_DDFS_DRS”.“WATCHER_IS_STOP” IS ‘是否停止dmagent拉起’;
CREATE TABLE “DEM”.“DMA_DDFS_DSS”
(
“ID” VARCHAR(100) NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“FLAG” BIT DEFAULT 1,
“DSS_ID” VARCHAR(128),
“BIN_PATH” VARCHAR(500),
“INI_PATH” VARCHAR(500),
“SERVICE_NAME” VARCHAR(100),
“MF_ID” VARCHAR(100),
“AUTO_RESTART” BIT DEFAULT 0,
“WATCHER_IS_STOP” BIT DEFAULT 0,
“DDFS_ID” VARCHAR(100),
“INST_NAME” VARCHAR(128),
“IP_ADDRESS” VARCHAR(64),
“PORT” INT,
“REGION_SIZE” INT,
“FD_ID” VARCHAR(128),
“FD_NAME” VARCHAR(128),
“TS” BIGINT) ;
COMMENT ON COLUMN “DEM”.“DMA_DDFS_DSS”.“AUTO_RESTART” IS ‘是否需要dmagent拉起’;
COMMENT ON COLUMN “DEM”.“DMA_DDFS_DSS”.“WATCHER_IS_STOP” IS ‘是否停止dmagent拉起’;
CREATE TABLE “DEM”.“DMA_DDFS_DS”
(
“ID” VARCHAR(100),
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“FLAG” BIT DEFAULT 1,
“DS_ID” VARCHAR(128),
“INST_NAME” VARCHAR(128),
“GRP_ID” VARCHAR(128),
“TS” BIGINT,
“DDFS_ID” VARCHAR(100));
CREATE TABLE “DEM”.“DMA_DDFS_DSS_STAT”
(
“DDFS_ID” VARCHAR(100),
“DSS_ID” VARCHAR(128),
“DSS_INST_NAME” VARCHAR(128),
“REV_BYTES_P” BIGINT,
“SENT_BYTES_P” BIGINT,
“GROUP_ID” INT,
“GROUP_NAME” VARCHAR(128),
“TS” BIGINT);
CREATE TABLE “DEM”.“DMA_DDFS_DS_STAT”
(
“DDFS_ID” VARCHAR(100),
“DS_ID” VARCHAR(128),
“DS_INST_NAME” VARCHAR(128),
“REV_BYTES_P” BIGINT,
“SENT_BYTES_P” BIGINT,
“TS” BIGINT) ;
CREATE TABLE “DEM”.“DMA_DMASM”
(
“DB_ID” VARCHAR(100),
“ID” VARCHAR(100) NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“FLAG” BIT DEFAULT 1,
“BIN_PATH” VARCHAR(500),
“INI_PATH” VARCHAR(500),
“SERVICE_NAME” VARCHAR(100)) ;
CREATE TABLE “DEM”.“DMA_DMCSS”
(
“DB_ID” VARCHAR(100),
“ID” VARCHAR(100) NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“FLAG” BIT DEFAULT 1,
“BIN_PATH” VARCHAR(500),
“INI_PATH” VARCHAR(500),
“SERVICE_NAME” VARCHAR(100),
“DFS_INI_PATH” VARCHAR(500)) ;
CREATE TABLE “DEM”.“DMA_DMMONITOR”
(
“GID” VARCHAR(100),
“ID” VARCHAR(100) NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“FLAG” BIT DEFAULT 1,
“MF_ID” VARCHAR(100),
“BIN_PATH” VARCHAR(500),
“INI_PATH” VARCHAR(500),
“SERVICE_NAME” VARCHAR(100)) ;
CREATE TABLE “DEM”.“DMA_DMWATCHER”
(
“DB_ID” VARCHAR(100),
“ID” VARCHAR(100) NOT NULL,
“GMT_CREATE” TIMESTAMP(0) DEFAULT SYSDATE,
“GMT_MODIFY” TIMESTAMP(0) DEFAULT SYSDATE,
“FLAG” BIT DEFAULT 1,
“BIN_PATH” VARCHAR(500),
“INI_PATH” VARCHAR(500),
“SERVICE_NAME” VARCHAR(100)) ;
CREATE TABLE “DEM”.“DMA_EXE_STAT”
(
“EXE_ID” VARCHAR(100),
“TS” BIGINT,
“STATUS” INT,
“CPU_USED_P” DECIMAL(22,6),
“MEM_USED_P” DECIMAL(22,6),
“MF_CPU_USED_P” DECIMAL(22,6),
“MF_MEM_TOTAL” BIGINT,
“MF_MEM_USED” BIGINT,
“MF_DISK_O_SPEED” DECIMAL(22,6),
“MF_DISK_I_SPEED” DECIMAL(22,6),
“MF_NET_R_SPEED” DECIMAL(22,6),
“MF_NET_T_SPEED” DECIMAL(22,6),
“PID” VARCHAR(128)) ;
–VIEW
CREATE OR REPLACE VIEW “DEM”.“ADMIN_VALID_USER_VIEW”
as
select
“DEM”.“ADMIN_USER”.“ID” ,
“DEM”.“ADMIN_USER”.“GMT_CREATE”,
“DEM”.“ADMIN_USER”.“GMT_MODIFY”,
“DEM”.“ADMIN_USER”.“LOGIN_NAME”,
“DEM”.“ADMIN_USER”.“PASSWORD” ,
“DEM”.“ADMIN_USER”.“REAL_NAME” ,
“DEM”.“ADMIN_USER”.“EMAIL” ,
“DEM”.“ADMIN_USER”.“PHONE” ,
“DEM”.“ADMIN_USER”.“SEX” ,
“DEM”.“ADMIN_USER”.“ROLE_ID” ,
“DEM”.“ADMIN_USER”.“FORBIDDEN” ,
“DEM”.“ADMIN_USER”.“FAILED” ,
“DEM”.“ADMIN_USER”.“LOGIN_TS”
from
“DEM”.“ADMIN_USER”
where
“DEM”.“ADMIN_USER”.“FLAG” = 1 ;
CREATE OR REPLACE VIEW “DEM”.“DMA_VALID_DB_VIEW”
as
select
“DEM”.“DMA_DATABASE”.“ID” ,
“DEM”.“DMA_MAINFRAME”.“OUTER_IP” || ‘:’ || “DEM”.“DMA_DATABASE”.“PORT” “NAME”,
‘DB’ type,
“DEM”.“DMA_DATABASE”.“MF_ID” ,
“DEM”.“DMA_DATABASE”.“PORT” ,
“DEM”.“DMA_DATABASE”.“USER_NAME” ,
“DEM”.“DMA_DATABASE”.“PASSWORD” ,
“DEM”.“DMA_DATABASE”.“GMT_CREATE” ,
“DEM”.“DMA_DATABASE”.“GMT_MODIFY” ,
“DEM”.“DMA_DATABASE”.“DESCRIPTION”,
“DEM”.“DMA_MAINFRAME”.“OUTER_IP”,
“DEM”.“DMA_MAINFRAME”.“INNER_IP”,
“DEM”.“DMA_DATABASE”.“GID”,
dem.dma_group.name gname,
dem.dma_group.order_num gOrderNum,
dem.dma_group_type.id gtid,
dem.dma_group_type.name gtname,
“DEM”.“DMA_DATABASE”.“EP_SEQNO”,
“DEM”.“DMA_DATABASE”.“DB_SERVICE_NAME”,
“DEM”.“DMA_DATABASE”.“BIN_PATH”,
“DEM”.“DMA_DATABASE”.“DM_INI_PATH”,
“DEM”.“DMA_DATABASE”.“DMDCR_INI_PATH”,
“DEM”.“DMA_DATABASE”.“SSL_FILE_PATH”,
“DEM”.“DMA_DATABASE”.“SSL_KEYSTORE_PWD”,
“DEM”.“DMA_DATABASE”.“DDFS_ID”
from
“DEM”.“DMA_DATABASE”
LEFT OUTER JOIN
“DEM”.“DMA_MAINFRAME”
ON
“DEM”.“DMA_DATABASE”.“MF_ID” = “DEM”.“DMA_MAINFRAME”.“ID”
left outer join
“DEM”.“DMA_GROUP”
on dem.dma_group.id = “DEM”.“DMA_DATABASE”.gid
left outer join
“DEM”.“DMA_GROUP_TYPE”
on dem.dma_group.tid = dem.dma_group_type.id
WHERE “DEM”.“DMA_DATABASE”.“FLAG” = 1 ;
CREATE VIEW “DEM”.“DMA_GROUP_ITEM_VIEW” (“GROUP_ID”,“RES_ID”,“RES_TYPE”)
as select gid GROUP_ID, id RES_ID, ‘DB’ RES_TYPE from dem.dma_valid_db_view where gid is not null;
COMMENT ON VIEW “DEM”.“DMA_GROUP_ITEM_VIEW” IS ‘有效的资源组成员列表(目前资源组的成员只有DB)’;
CREATE VIEW “DEM”.“DMA_VALID_ALERT_RES_VIEW” (“ALERT_ID”,“RES_ID”,“RES_TYPE”,“ID”)
as
select
“DEM”.“DMA_ALERT_RES”.“ALERT_ID”,
“DEM”.“DMA_ALERT_RES”.“RES_ID” ,
“DEM”.“DMA_ALERT_RES”.“RES_TYPE”,
“DEM”.“DMA_ALERT_RES”.“ID”
from
“DEM”.“DMA_ALERT_RES”
where
“DEM”.“DMA_ALERT_RES”.“FLAG” = 1 ;
CREATE VIEW “DEM”.“DMA_VALID_ALERT_USER_VIEW” (“ID”,“USER_ID”,“ALERT_ID”)
as
select
“DEM”.“DMA_ALERT_USER”.“ID” ,
“DEM”.“DMA_ALERT_USER”.“USER_ID”,
“DEM”.“DMA_ALERT_USER”.“ALERT_ID”
from
“DEM”.“DMA_ALERT_USER”
where
“DEM”.“DMA_ALERT_USER”.“FLAG” = 1 ;
CREATE VIEW “DEM”.“DMA_VALID_ALERT_VIEW” (“ID”,“USER_ID”,“GMT_CREATE”,“GMT_MODIFY”,“TITLE”,“DESCRIPTION”,“MAIL_NOTIFY”,“PHONE_NOTIFY”,“FORBIDDEN”)
as
select
“DEM”.“DMA_ALERT”.“ID” ,
“DEM”.“DMA_ALERT”.“USER_ID” ,
“DEM”.“DMA_ALERT”.“GMT_CREATE” ,
“DEM”.“DMA_ALERT”.“GMT_MODIFY” ,
“DEM”.“DMA_ALERT”.“TITLE” ,
“DEM”.“DMA_ALERT”.“DESCRIPTION” ,
“DEM”.“DMA_ALERT”.“MAIL_NOTIFY” ,
“DEM”.“DMA_ALERT”.“PHONE_NOTIFY”,
“DEM”.“DMA_ALERT”.“FORBIDDEN”
from
“DEM”.“DMA_ALERT”
where
“DEM”.“DMA_ALERT”.“FLAG” = 1;
CREATE OR REPLACE VIEW “DEM”.“DMA_VALID_DB_TABLE_VIEW”
AS
SELECT
DEM.DMA_DATABASE_TABLE.ID ,
DEM.DMA_DATABASE_TABLE.SCH_NAME,
DEM.DMA_DATABASE_TABLE.TAB_NAME,
DEM.DMA_DATABASE_TABLE.DB_ID ,
“DEM”.“DMA_VALID_DB_VIEW”.“NAME” “DB_NAME”,
DEM.DMA_DATABASE_TABLE.FORBIDDEN
FROM
DEM.DMA_DATABASE_TABLE,
“DEM”.“DMA_VALID_DB_VIEW”
WHERE
DEM.DMA_DATABASE_TABLE.“DB_ID” = “DEM”.“DMA_VALID_DB_VIEW”.“ID”
AND DEM.DMA_DATABASE_TABLE.FLAG = 1;
CREATE OR REPLACE VIEW “DEM”.“DMA_VALID_DB_UD_SQL_VIEW”
as
select
“DEM”.“DMA_DATABASE_UD_SQL”.“ID” ,
“DEM”.“DMA_DATABASE_UD_SQL”.“DB_ID”,
“DEM”.“DMA_VALID_DB_VIEW”.“NAME” “DB_NAME”,
“DEM”.“DMA_DATABASE_UD_SQL”.“UD_SQL”,
“DEM”.“DMA_DATABASE_UD_SQL”.“NAME”,
“DEM”.“DMA_DATABASE_UD_SQL”.“FORBIDDEN”
from
“DEM”.“DMA_DATABASE_UD_SQL”,
“DEM”.“DMA_VALID_DB_VIEW”
where
“DEM”.“DMA_DATABASE_UD_SQL”.“DB_ID” = “DEM”.“DMA_VALID_DB_VIEW”.“ID”
AND “DEM”.“DMA_DATABASE_UD_SQL”.“FLAG” = 1 ;
CREATE OR REPLACE VIEW “DEM”.“DMA_VALID_GROUP_VIEW”
as
select
“DEM”.“DMA_GROUP”.“ID” ,
“DEM”.“DMA_GROUP”.“GMT_CREATE”,
“DEM”.“DMA_GROUP”.“GMT_MODIFY”,
“DEM”.“DMA_GROUP”.“NAME” ,
“DEM”.“DMA_GROUP”.“DESCRIPTION”,
“DEM”.“DMA_GROUP”.“TID”,
“DEM”.“DMA_GROUP”.“MF_ID”,
“DEM”.“DMA_GROUP”.“ORDER_NUM”
from
“DEM”.“DMA_GROUP”
where
“DEM”.“DMA_GROUP”.“FLAG” = 1 ;
CREATE OR REPLACE VIEW “DEM”.“DMA_VALID_MF_VIEW”
(“ID”,“NAME”, “TYPE”, “GMT_CREATE”,“GMT_MODIFY”,“HOST_NAME”,“OS_NAME”,“OS_VERSION”,“CPU_COUNT”,“OS_VENDOR”,“OS_ARCH”,“MEM_SIZE”,“CPU_DESC”,“OS_DATA_MODEL”,“INNER_IP”,“OUTER_IP”,“IP_LIST”,“NET_CFG_FLAG”,“DMAGENT_CFG”,“TS”,“GID”,“GNAME”,“GTNAME”)
as
select
“DEM”.“DMA_MAINFRAME”.“ID” ,
“DEM”.“DMA_MAINFRAME”.“OUTER_IP” “NAME” ,
‘MF’ type,
“DEM”.“DMA_MAINFRAME”.“GMT_CREATE” ,
“DEM”.“DMA_MAINFRAME”.“GMT_MODIFY” ,
“DEM”.“DMA_MAINFRAME”.“HOST_NAME” ,
“DEM”.“DMA_MAINFRAME”.“OS_NAME” ,
“DEM”.“DMA_MAINFRAME”.“OS_VERSION” ,
“DEM”.“DMA_MAINFRAME”.“CPU_COUNT” ,
“DEM”.“DMA_MAINFRAME”.“OS_VENDOR” ,
“DEM”.“DMA_MAINFRAME”.“OS_ARCH” ,
“DEM”.“DMA_MAINFRAME”.“MEM_SIZE” ,
“DEM”.“DMA_MAINFRAME”.“CPU_DESC” ,
“DEM”.“DMA_MAINFRAME”.“OS_DATA_MODEL”,
“DEM”.“DMA_MAINFRAME”.“INNER_IP” ,
“DEM”.“DMA_MAINFRAME”.“OUTER_IP” ,
“DEM”.“DMA_MAINFRAME”.“IP_LIST”,
“DEM”.“DMA_MAINFRAME”.“NET_CFG_FLAG”,
“DEM”.“DMA_MAINFRAME”.“DMAGENT_CFG”,
“DEM”.“DMA_MAINFRAME”.“TS”,
null GID,
null GNAME,
null GTNAME
from
“DEM”.“DMA_MAINFRAME”
where
“DEM”.“DMA_MAINFRAME”.“FLAG” = 1;
CREATE OR REPLACE VIEW “DEM”.“DMA_VALID_RES_VIEW” (“ID”,“NAME”,“TYPE”)
as
(select id id, outer_ip name, ‘MF’ type from “DEM”.“DMA_VALID_MF_VIEW”
union
select id id, outer_ip || ‘:’ || port name, ‘DB’ type from “DEM”.“DMA_VALID_DB_VIEW”
);
COMMENT ON VIEW “DEM”.“DMA_VALID_RES_VIEW” IS ‘所有资源列表,资源有两种,MF和DB’;
CREATE OR REPLACE VIEW “DEM”.“DMA_VALID_ALERT_RULE_VIEW”
as
select
“DEM”.“DMA_ALERT_RULE”.“ID” ,
“DEM”.“DMA_ALERT_RULE”.“RULE_TEMPL_ID”,
“DEM”.“DMA_ALERT_RULE”.“OP” ,
“DEM”.“DMA_ALERT_RULE”.“VALUE” ,
“DEM”.“DMA_ALERT_RULE”.“ALERT_ID” ,
“DEM”.“DMA_ALERT_RULE”.“BASE_VALUE” ,
“DEM”.“DMA_ALERT_RULE”.“FORBIDDEN” ,
“DEM”.“DMA_ALERT_RULE”.“CONTENT” ,
“DEM”.“DMA_ALERT_RULE”.“MON_ITEM_ID” ,
“DEM”.“DMA_ALERT_RULE”.“RES_ID” ,
“DEM”.“DMA_ALERT_RULE”.“RES_TYPE” ,
“DEM”.“DMA_ALERT_RULE”.“MSG”,
(select res_table.name from “DEM”.“DMA_VALID_RES_VIEW” res_table where res_table.id = “DEM”.“DMA_ALERT_RULE”.res_id
and res_table.type = “DEM”.“DMA_ALERT_RULE”.res_type) RES_NAME
from
“DEM”.“DMA_ALERT_RULE”
where
“DEM”.“DMA_ALERT_RULE”.FLAG = 1 ;
CREATE OR REPLACE VIEW “DEM”.“DMA_RULE_BASE_VIEW”
as
(
select
ALERT_RULE.“RES_ID” RES_ID ,
“DEM”.“DMA_RULE_TEMPL”.“TYPE” RES_TYPE ,
ALERT_RULE.“ID” ID ,
ALERT_RULE.“RULE_TEMPL_ID” RULE_TEMPL_ID ,
ALERT_RULE.“OP” OP ,
ALERT_RULE.“VALUE” “VALUE” ,
ALERT_RULE.“ALERT_ID” ALERT_ID ,
ALERT_RULE.“BASE_VALUE” BASE_VALUE ,
ALERT_RULE.“FORBIDDEN” FORBIDDEN ,
ALERT_RULE.“CONTENT” CONTENT ,
ALERT_RULE.MON_ITEM_ID MON_ITEM_ID ,
ALERT_RULE.MSG MSG ,
“DEM”.“DMA_RULE_TEMPL”.NAME RULE_TEMPL_NAME ,
“DEM”.“DMA_RULE_TEMPL”.“TYPE” RULE_TEMPL_TYPE,
“DEM”.“DMA_RULE_TEMPL”.PROCESSOR PROCESSOR ,
“DEM”.“DMA_RULE_TEMPL”.UNITS UNITS ,
“DEM”.“DMA_RULE_TEMPL”.GATHER_DATA_TYPE GATHER_DATA_TYPE
from
“DEM”.“DMA_VALID_ALERT_RULE_VIEW” ALERT_RULE,
“DEM”.“DMA_RULE_TEMPL”
where
ALERT_RULE.RES_ID IS NOT NULL
AND ALERT_RULE.“RULE_TEMPL_ID” = “DEM”.“DMA_RULE_TEMPL”.ID
)
union
(
select
ALERT_RES.“RES_ID” RES_ID ,
ALERT_RES.RES_TYPE RES_TYPE ,
ALERT_RULE.“ID” ID ,
ALERT_RULE.“RULE_TEMPL_ID” RULE_TEMPL_ID ,
ALERT_RULE.“OP” OP ,
ALERT_RULE.“VALUE” “VALUE” ,
ALERT_RULE.“ALERT_ID” ALERT_ID ,
ALERT_RULE.“BASE_VALUE” BASE_VALUE ,
ALERT_RULE.“FORBIDDEN” FORBIDDEN ,
ALERT_RULE.“CONTENT” CONTENT ,
ALERT_RULE.MON_ITEM_ID MON_ITEM_ID ,
ALERT_RULE.MSG MSG ,
“DEM”.“DMA_RULE_TEMPL”.NAME RULE_TEMPL_NAME ,
“DEM”.“DMA_RULE_TEMPL”.“TYPE” RULE_TEMPL_TYPE,
“DEM”.“DMA_RULE_TEMPL”.PROCESSOR PROCESSOR ,
“DEM”.“DMA_RULE_TEMPL”.UNITS UNITS ,
“DEM”.“DMA_RULE_TEMPL”.GATHER_DATA_TYPE GATHER_DATA_TYPE
from
(
SELECT
ALERT_RES.RES_ID RES_ID ,
ALERT_RES.ALERT_ID ALERT_ID,
ALERT_RES.RES_TYPE
FROM
“DEM”.“DMA_VALID_ALERT_RES_VIEW” ALERT_RES
)
ALERT_RES ,
“DEM”.“DMA_VALID_ALERT_RULE_VIEW” ALERT_RULE,
“DEM”.“DMA_RULE_TEMPL”
where
ALERT_RULE.RES_ID IS NULL
AND ALERT_RES.“ALERT_ID” = ALERT_RULE.“ALERT_ID”
AND ALERT_RULE.“RULE_TEMPL_ID” = “DEM”.“DMA_RULE_TEMPL”.ID
AND ALERT_RES.RES_TYPE = “DEM”.“DMA_RULE_TEMPL”.TYPE
);
COMMENT ON VIEW “DEM”.“DMA_RULE_BASE_VIEW” IS ‘有效的告警规则视图’;
–PROCEDURE
CREATE PROCEDURE “DEM”.“DELETE_USER” (“USERID” IN BIGINT,“DELETE_CASCADE” IN BOOLEAN)
AUTHID DEFINER
as
begin
execute immediate ‘update dem.admin_user set flag = 0 where id = ?;’ using userId;
execute immediate ‘update dem.dbtool_server_conn set flag = 0 where user_id = ?;’ using userId;
execute immediate ‘update dem.dbtool_preference set flag = 0 where user_id = ?;’ using userId;
if DELETE_CASCADE = true then
execute immediate ‘update dem.dma_alert set forbidden = 1 where user_id = ?;’ using userId;
end if;
end;
/
CREATE PROCEDURE “DEM”.“FORBIDDEN_USER” (“USERID” IN BIGINT,“FORBIDDEN” IN BIT)
AUTHID DEFINER
as
begin
execute immediate ‘update dem.admin_user set forbidden = ? where id = ?;’ using forbidden, userId;
execute immediate ‘update dem.dma_alert set forbidden = ? where user_id = ?;’ using forbidden, userId;
execute immediate ‘update dem.dma_alert_rule set forbidden = ? where alert_id in (select alert_id from dem.dma_alert where user_id = ?);’ using forbidden, userId;
end;
/
–FUNCTION
create or replace
function dem.user_login
(
userId out bigint,
loginName varchar,
password varchar,
currTs bigint,
lockTime bigint,
loginLimitCount int)
return bigint
as
declare
failedCount int = 0;
lastLoginTs bigint = 0;
forbidden int = 0;
getFailedCountSql varchar = ‘select NVL(T.failed, -1), NVL(T.login_ts, -1), T.FORBIDDEN from dual left join (select * from dem.admin_valid_user_view where login_name = ? ) T ON 1 = 1’;
loginSql varchar = ‘select NVL(T.id, -1) from dual left join (select id from dem.admin_valid_user_view where login_name = ? and password = ?) T ON 1=1’;
clearFailedSql varchar = ‘update dem.admin_user set failed = 0, login_ts = ? where id = ?’;
addFailedSql varchar = ‘update dem.admin_user set failed = failed + 1, login_ts = ? where login_name = ?’;
EX_USER_LOCK int = -20001;
EX_LOGIN_FAILED int = -20002;
EX_USER_FORBIDDEN int = -20003;
begin
–get failed count
execute immediate getFailedCountSql into failedCount, lastLoginTs, forbidden using loginName;
if forbidden == 1
– user forbidden
then
RAISE_APPLICATION_ERROR(EX_USER_FORBIDDEN, 0);
elsif failedCount == -1
– no loginName
then
RAISE_APPLICATION_ERROR(EX_LOGIN_FAILED, 1);
elsif failedCount >= loginLimitCount and (currTs - lastLoginTs < lockTime) then
–user lock
RAISE_APPLICATION_ERROR(EX_USER_LOCK, failedCount);
else
–user unlock, try login
execute immediate loginSql into userId using loginName, password;
if userId > 0 then
–login success, clear failed count
execute immediate clearFailedSql using currTs, userId;
execute immediate ‘commit;’;
return userId;
else
–login failed, add failed count
execute immediate addFailedSql using currTs, loginName;
execute immediate ‘commit;’;
RAISE_APPLICATION_ERROR(EX_LOGIN_FAILED, failedCount + 1);
end if;
end if;
end;
/
–group-type (order by gid asc on databasesPanel)
insert into “DEM”.“DMA_GROUP_TYPE” (“ID”,“NAME”,“DESCRIPTION”,“ENABLE”) values (1, ‘MPP’, ‘MPP’, 1);
insert into “DEM”.“DMA_GROUP_TYPE” (“ID”,“NAME”,“DESCRIPTION”,“ENABLE”) values (2, ‘DSC’, ‘DSC’, 1);
insert into “DEM”.“DMA_GROUP_TYPE” (“ID”,“NAME”,“DESCRIPTION”,“ENABLE”) values (3, ‘RW’, ‘读写分离’, 1);
insert into “DEM”.“DMA_GROUP_TYPE” (“ID”,“NAME”,“DESCRIPTION”,“ENABLE”) values (4, ‘DW’, ‘数据守护’, 1);
insert into “DEM”.“DMA_GROUP_TYPE” (“ID”,“NAME”,“DESCRIPTION”,“ENABLE”) values (5, ‘DCP’, ‘DCP’, 0);
insert into “DEM”.“DMA_GROUP_TYPE” (“ID”,“NAME”,“DESCRIPTION”,“ENABLE”) values (99, ‘OTHER’, ‘其他’, 1);
–rule-templ (use id to alert)
–MF-mainframe
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (1001, ‘连接异常’, ‘MF’, null, null, null);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (1002, ‘CPU使用率’, ‘MF’, ‘com.dameng.dem.server.processor.dma.MFCpuUsedProcessor’, ‘percent’, 12);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (1003, ‘内存使用率’, ‘MF’, ‘com.dameng.dem.server.processor.dma.MFMemUsedProcessor’, ‘percent’, 12);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (1004, ‘磁盘使用率’, ‘MF’, ‘com.dameng.dem.server.processor.dma.MFDiskUsedProcessor’, ‘percent’, 13);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (1005, ‘自定义监控’, ‘MF’, ‘com.dameng.dem.server.processor.dma.MFExecProcessor’, ‘int’, 15);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (1006, ‘交换区使用率’, ‘MF’, ‘com.dameng.dem.server.processor.dma.MFSwapUsedProcessor’, ‘percent’, 12);
–DB-resource
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2001, ‘连接异常’, ‘DB’, null, null, null);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2002, ‘CPU使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBCpuUsedProcessor’, ‘percent’, 21);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2003, ‘内存使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBMemUsedProcessor’, ‘percent’, 21);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2004, ‘文件IO读’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBFioOpsProcessor’, ‘Bps’, 21);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2005, ‘文件IO写’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBFioIpsProcessor’, ‘Bps’, 21);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2006, ‘等待任务数’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBTaskWaitingProcessor’, ‘int’, 21);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2007, ‘归档等待任务数’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBArchWaitingProcessor’, ‘int’, 21);
–DB-storage
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2101, ‘表空间使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBTsUsedProcessor’, ‘percent’, 22);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2102, ‘表数据行数’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBTableProcessor’, ‘int’, 31);
–DB-session
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2201, ‘总会话数’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBSessionCountProcessor’, ‘int’, 21);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2202, ‘活动会话数’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBActiveSessionCountProcessor’, ‘int’, 21);
–DB-sql
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2301, ‘执行SQL出错’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBSqlErrProcessor’, null, 24);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2302, ‘执行SQL超时’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBSqlTimeoutProcessor’, ‘ms’, 25);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2303, ‘自定义SQL’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBUdSqlProcessor’, ‘int’, 28);
–DB-other
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2401, ‘死锁’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBDeadLockProcessor’, null, 27);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2402, ‘用户异常登录’, ‘DB’, ‘com.dameng.dem.server.processor.dma.DBUserLockProcessor’, null, 23);
–DB-exe
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2501, ‘DMWATCHER连接异常’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeAliveProcessor’, null, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2502, ‘DMCSS连接异常’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeAliveProcessor’, null, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2503, ‘DMASM连接异常’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeAliveProcessor’, null, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2504, ‘DMTDD-DCS连接异常’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeAliveProcessor’, null, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2505, ‘DMTDD-DCS后台库连接异常’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeAliveProcessor’, null, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2506, ‘DMTDD-任意DRS连接异常’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeAliveProcessor’, null, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2507, ‘DMTDD-任意DSS连接异常’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeAliveProcessor’, null, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2601, ‘DMWATCHER CPU使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeCpuUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2602, ‘DMCSS CPU使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeCpuUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2603, ‘DMASM CPU使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeCpuUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2604, ‘DMTDD-DCS CPU使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeCpuUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2605, ‘DMTDD-DCS后台库CPU使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeCpuUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2606, ‘DMTDD-任意DRS CPU使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeCpuUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2607, ‘DMTDD-任意DSS CPU使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeCpuUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2701, ‘DMWATCHER内存使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeMemUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2702, ‘DMCSS内存使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeMemUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2703, ‘DMASM内存使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeMemUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2704, ‘DMTDD-DCS内存使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeMemUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2705, ‘DMTDD-DCS后台库内存使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeMemUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2706, ‘DMTDD-任意DRS内存使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeMemUsedProcessor’, ‘percent’, 105);
insert into “DEM”.“DMA_RULE_TEMPL” (“ID”,“NAME”,“TYPE”,“PROCESSOR”,“UNITS”,“GATHER_DATA_TYPE”) values (2707, ‘DMTDD-任意DSS内存使用率’, ‘DB’, ‘com.dameng.dem.server.processor.dma.ExeMemUsedProcessor’, ‘percent’, 105);
–sys-config (order by TYPE, ID asc)
–1)客户端工具配置
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_SESSION_CHECK_FREQ’, ‘客户端工具中的数据库连接有效性检查频率(秒),最小值1’, ‘60’, ‘数据库连接有效性检查频率’, ‘s’, 1, ‘1.客户端工具配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_SESSION_INVALID_TIME’, ‘客户端工具中的数据库连接的失效时间(秒),最小值60’, ‘1800’, ‘数据库连接失效期’, ‘s’, 1, ‘1.客户端工具配置’, null, ‘60’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_SESSION_POOL_COUNT’, ‘用于管理所有用户的数据库会话的池大小(重启生效)’, ‘11’, ‘数据库会话管理池大小’, null, 1, ‘1.客户端工具配置’, null, ‘2’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DEM_PAGE_SIZE’, ‘前端页面中的表格分页时的页大小’, ‘40’, ‘前端表格页大小’, null, 1, ‘1.客户端工具配置’, null, ‘1’, null, 0);
–2)监控告警配置
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘AA_DEM_PAGE_REFRESH_FREQ’, ‘主机和数据库页面状态刷新频率(分钟),最小值1’, ‘1’, ‘页面状态刷新频率’, ‘minute’, 1, ‘2.监控告警配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘ALERT_HIS_RE_NOTIFY_TIME’, ‘同一主机或数据库的同类警告在该时间间隔内不再重复发送(分钟),最小值10’, ‘10’, ‘告警重复发送的间隔’, ‘minute’, 1, ‘2.监控告警配置’, null, ‘10’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘ALERT_CHECK_THREAD_COUNT’, ‘监控告警监测任务线程数(重启生效)’, ‘2’, ‘告警检测线程数’, null, 1, ‘2.监控告警配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘ALERT_NOTIFY_THREAD_COUNT’, ‘监控告警通知任务线程数(重启生效)’, ‘2’, ‘告警通知线程数’, null, 1, ‘2.监控告警配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘ALERT_RULE_RELOAD_FREQ’, ‘内存中告警规则缓存的刷新频率(分钟),最小值1’, ‘1’, ‘告警规则刷新频率’, ‘minute’, 1, ‘2.监控告警配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_AA_INVALID_TIME’, ‘指定时间内没有收到主机信息,则认为数据库失效(分钟),最小值2’, ‘5’, ‘数据库失效时间’, ‘minute’, 1, ‘2.监控告警配置’, null, ‘2’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_SQLSLOW_TIME_INTV’, ‘监控中对于慢SQL的界定时间(毫秒),最小值1’, ‘500’, ‘数据库慢SQL界定时间’, ‘ms’, 1, ‘2.监控告警配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_UDSQL_TIMEOUT’, ‘数据库自定义SQL执行超时时间(分钟),最小值1’, ‘1’, ‘数据库自定义SQL的执行超时时间’, ‘minute’, 1, ‘2.监控告警配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MF_AA_INVALID_TIME’, ‘指定时间内没有收到主机信息,则认为主机失效(秒),最小值20’, ‘180’, ‘主机失效时间’, ‘s’, 1, ‘2.监控告警配置’, null, ‘20’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MF_EXEC_TIMEOUT’, ‘主机可执行程序超时时间(分钟),最小值1’, ‘1’, ‘主机可执行程序的执行超时时间’, ‘minute’, 1, ‘2.监控告警配置’, null, ‘1’, null, 0);
–3)DmAgent监控频率配置
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_INFO_GATHER_FREQ’, ‘数据库基本信息收集频率(分钟),最小值1’, ‘1’, ‘数据库基本信息收集频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_SESSION_GATHER_FREQ’, ‘收集数据库会话信息的频率(分钟),最小值1’, ‘1’, ‘数据库会话监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_EVENT_GATHER_FREQ’, ‘收集数据库事件信息的频率(分钟),最小值1’, ‘1’, ‘数据库事件监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_STAT_GATHER_FREQ’, ‘收集数据库状态信息的频率(分钟),最小值1’, ‘1’, ‘数据库状态监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_TS_GATHER_FREQ’, ‘收集数据库表空间信息的频率(分钟),最小值1’, ‘1’, ‘数据库表空间监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_DEADLOCK_GATHER_FREQ’, ‘收集数据库死锁信息的频率(分钟),最小值1’, ‘1’, ‘数据库死锁监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_USER_GATHER_FREQ’, ‘收集数据库用户锁定信息的频率(分钟),最小值1’, ‘1’, ‘数据库用户锁定监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_SQLSLOW_GATHER_FREQ’, ‘收集数据库慢SQL信息的频率(分钟),最小值1’, ‘1’, ‘数据库慢SQL监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_SQLCOUNT_GATHER_FREQ’, ‘收集数据库高频SQL信息的频率(分钟),最小值1’, ‘1’, ‘数据库高频SQL监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_SQLERR_GATHER_FREQ’, ‘收集数据库执行SQL出错信息的频率(分钟),最小值1’, ‘1’, ‘数据库出错SQL监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_TAB_GATHER_FREQ’, ‘收集数据库表数据信息的频率(分钟),最小值1’, ‘1’, ‘数据库表数据监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘DB_UDSQL_GATHER_FREQ’, ‘收集数据库自定义SQL信息的频率(分钟),最小值1’, ‘1’, ‘数据库自定义SQL监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MF_INFO_GATHER_FREQ’, ‘主机基本信息收集频率(秒),最小值10’, ‘10’, ‘主机基本信息收集频率’, ‘s’, 1, ‘3.DmAgent监控频率配置’, null, ‘10’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MF_STAT_GATHER_FREQ’, ‘收集主机状态信息的频率(秒),最小值10’, ‘10’, ‘主机状态监控频率’, ‘s’, 1, ‘3.DmAgent监控频率配置’, null, ‘10’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MF_DISK_GATHER_FREQ’, ‘收集主机磁盘信息的频率(分钟),最小值1’, ‘10’, ‘主机磁盘监控频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MF_EXEC_GATHER_FREQ’, ‘收集主机自定义可执行程序的频率(秒),最小值10’, ‘60’, ‘主机可执行程序执行频率’, ‘s’, 1, ‘3.DmAgent监控频率配置’, null, ‘10’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘EXE_STAT_GATHER_FREQ’, ‘收集数据库辅助进程(dmwacher,dmcss,drs,dss,dcs等)信息的频率(分钟),最小值1’, ‘1’, ‘数据库辅助进程信息收集频率’, ‘minute’, 1, ‘3.DmAgent监控频率配置’, null, ‘1’, null, 0);
–4)系统邮箱配置
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MAIL_AA_ENABLE’, ‘(1/0),开启时需完成邮箱配置’, ‘1’, ‘是否启用邮箱推送告警信息’, null, 1, ‘4.系统邮箱配置’, ‘1’, ‘0’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MAIL_SENDER’, ‘系统邮件发送人’, ‘Dameng Database Develop Team’, ‘发送人’, null, 1, ‘4.系统邮箱配置’, null, null, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MAIL_ADDRESS’, ‘系统邮箱地址’, ‘[email protected]’, ‘邮箱’, null, 1, ‘4.系统邮箱配置’, null, null, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MAIL_PASSWORD’, ‘系统邮箱密码’, ‘888888’, ‘邮箱密码’, null, 1, ‘4.系统邮箱配置’, null, null, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MAIL_SMTP_HOST’, ‘SMTP服务器地址’, ‘192.168.0.212’, ‘SMTP服务器’, null, 1, ‘4.系统邮箱配置’, null, null, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘MAIL_POP3_HOST’, ‘POP3服务器地址’, ‘192.168.0.212’, ‘POP3服务器’, null, 0, ‘4.系统邮箱配置’, null, null, null, 0);
–4)短信推送配置
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘SMS_ENABLE’, ‘(1/0),开启时必须实现自定义短信推送功能’, ‘0’, ‘是否启用短信推送告警信息’, null, 1, ‘5.短信推送配置’, ‘1’, ‘0’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘SMS_USER_DEFINED_ENABLE_CLASS’, ‘短信推送自定义类需实现接口com.dameng.dem.server.util.IPhoneNotify’, null, ‘自定义短信推送类’, null, 1, ‘5.短信推送配置’, null, null, null, 0);
–5)安全配置
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘USER_LONGIN_LIMIT_COUNT’, ‘限制用户登录连续错误次数,若超过将锁定账号,最小值3’, ‘5’, ‘账号登录错误次数限制’, null, 1, ‘6.安全配置’, null, ‘3’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘USER_LONGIN_LOCK_TIME’, ‘账号锁定的时间(分钟),最小值10’, ‘60’, ‘账号锁定时间’, ‘minute’, 1, ‘6.安全配置’, null, ‘10’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘USER_KEEP_ALIVE_TIME’, ‘账户存活时间(分钟),最小值1,0表示不限制’, ‘0’, ‘账号存活时间’, ‘minute’, 1, ‘6.安全配置’, null, ‘0’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘AUDIT_ENABLE’, ‘(1/0)’, ‘1’, ‘是否开启DEM系统审计’, null, 1, ‘6.安全配置’, ‘1’, ‘0’, null, 0);
insert into “DEM”.“ADMIN_SYS_CONFIG” (“ID”,“DESCRIPTION”,“VALUE”,“NAME”,“UNITS”,“CAN_MODIFY”,“TYPE”,“MAX_VALUE”,“MIN_VALUE”,“FIRST_TIME”,“GATHER_TYPE”) values (‘AUDIT_FLUSH_FREQ’, ‘审计信息刷盘频率(秒),最小值1’, ‘30’, ‘审计信息刷盘频率’, ‘s’, 1, ‘6.安全配置’, null, ‘1’, null, 0);
–ROLE (order by power asc)
insert into “DEM”.“ADMIN_ROLE” (“ID”,“NAME”,“DESCRIPTION”,“POWER”,“FLAG”) values (1, ‘普通用户’, ‘普通用户’, 1, 1);
insert into “DEM”.“ADMIN_ROLE” (“ID”,“NAME”,“DESCRIPTION”,“POWER”,“FLAG”) values (2, ‘高级用户’, ‘高级用户’, 3, 1);
insert into “DEM”.“ADMIN_ROLE” (“ID”,“NAME”,“DESCRIPTION”,“POWER”,“FLAG”) values (3, ‘管理员’, ‘系统管理员’, 7, 1);
insert into “DEM”.“ADMIN_ROLE” (“ID”,“NAME”,“DESCRIPTION”,“POWER”,“FLAG”) values (4, ‘超级管理员’, ‘超级管理员’, 15, 1);
–super-user
insert into “DEM”.“ADMIN_USER” (“ID”,“LOGIN_NAME”,“PASSWORD”,“REAL_NAME”,“EMAIL”,“PHONE”,“SEX”,“ROLE_ID”,“FORBIDDEN”,“FLAG”) values (24565225, ‘admin’, ‘37A8DC12A15F1EE6’, ‘超级管理员’, ‘[email protected]’, ‘’, ‘男’, 4, 0, 1);
commit;
3.Tomcat的安装
下载好tamcat安装包,解压缩
# mkdir /usr/local/tomcat
# cd /usr/local/tomcat
# tar -zxvf apache-tomcat……
4.将dem.war包放到/usr/local/tomcat/server/webapps/目录下面
5.启动Tomat
cd /usr/local/tomcat/server/bin
# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat/server
Using CATALINA_HOME: /usr/local/tomcat/server
Using CATALINA_TMPDIR: /usr/local/tomcat/server/temp
Using JRE_HOME: /usr/local/java/default
Using CLASSPATH: /usr/local/tomcat/server/bin/bootstrap.jar:/usr/local/tomcat/server/bin/tomcat-juli.jar
Tomcat started.
6.关闭防火墙或者开放8080端口
浏览器输入http://localhost:8080
7.停止Tomcat
# ./shutdown.sh
Using CATALINA_BASE: /usr/local/tomcat/server
Using CATALINA_HOME: /usr/local/tomcat/server
Using CATALINA_TMPDIR: /usr/local/tomcat/server/temp
Using JRE_HOME: /usr/local/java/default
Using CLASSPATH: /usr/local/tomcat/server/bin/bootstrap.jar:/usr/local/tomcat/server/bin/tomcat-juli.jar
8.配置后台数据库的连接信息,ip、port、用户名、密码、连接池大小,SSL登录信息等
vim /usr/local/tomcatt/server/webapps/dem/WEB-INF/db.xml
9.配置tomcat
(1)在/usr/local/tomcat/server/conf/server.xml中 <Connector port=“8080” protocol=“HTTP/1.1”… 追加属性字段 maxPostSize="-1"
(2)在/usr/local/tomcat/server/bin/catalina.sh修改jvm启动参数
JAVA_OPTS="-server -Xms256m -Xmx1024m -XX:MaxPermSize=512m -Djava.library.path=/opt/dmdbms/bin"
10.启动Tomcat
假设本机ip为192.168.13.1,开启浏览器访问url(http:// 192.168.13.1:8080/dem),登录(admin/888888)
11.在需要进行监控的主机上启动dmagent,要求agent和dem所运行主机时间一致;
cd /home/dmdba/dmdbms/tool/dmagent
配置config.properties:
center.url=http:// 192.168.13.1:8080/dem #DEM访问地址
center.agent_servlet=dem/dma_agent #一般无需调整
- 启动agent
./DMAgentService.sh start
Starting DMAgentService...
.......... running: PID:7609