-- Table structure for table `index_stats`
--

CREATE TABLE `index_stats` (
  `db_name` varchar(64) COLLATE utf8_bin NOT NULL,
  `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
  `index_name` varchar(64) COLLATE utf8_bin NOT NULL,
  `prefix_arity` int(11) unsigned NOT NULL,
  `avg_frequency` decimal(12,4) DEFAULT NULL,
  PRIMARY KEY (`db_name`,`table_name`,`index_name`,`prefix_arity`)
) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='Statistics on Indexes';

--
-- Dumping data for table `index_stats`
--


--
-- Table structure for table `innodb_index_stats`
--

CREATE TABLE `innodb_index_stats` (
  `database_name` varchar(64) COLLATE utf8_bin NOT NULL,
  `table_name` varchar(199) COLLATE utf8_bin NOT NULL,
  `index_name` varchar(64) COLLATE utf8_bin NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `stat_name` varchar(64) COLLATE utf8_bin NOT NULL,
  `stat_value` bigint(20) unsigned NOT NULL,
  `sample_size` bigint(20) unsigned DEFAULT NULL,
  `stat_description` varchar(1024) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;

--
-- Dumping data for table `innodb_index_stats`
--

INSERT INTO `innodb_index_stats` VALUES ('mysql','gtid_slave_pos','PRIMARY','2018-09-26 02:49:46','n_diff_pfx01',0,1,'domain_id'),('mysql','gtid_slave_pos','PRIMARY','2018-09-26 02:49:46','n_diff_pfx02',0,1,'domain_id,sub_id'),('mysql','gtid_slave_pos','PRIMARY','2018-09-26 02:49:46','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('mysql','gtid_slave_pos','PRIMARY','2018-09-26 02:49:46','size',1,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status','PRIMARY','2019-08-14 06:08:50','n_diff_pfx01',1,1,'site'),('te3logex1','app_to_db_status','PRIMARY','2019-08-14 06:08:50','n_diff_pfx02',80,1,'site,project'),('te3logex1','app_to_db_status','PRIMARY','2019-08-14 06:08:50','n_diff_pfx03',154,1,'site,project,app_server'),('te3logex1','app_to_db_status','PRIMARY','2019-08-14 06:08:50','n_diff_pfx04',166,1,'site,project,app_server,instance'),('te3logex1','app_to_db_status','PRIMARY','2019-08-14 06:08:50','n_diff_pfx05',166,1,'site,project,app_server,instance,check_time'),('te3logex1','app_to_db_status','PRIMARY','2019-08-14 06:08:50','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status','PRIMARY','2019-08-14 06:08:50','size',1,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status','idx_app_to_db_status','2019-08-14 06:08:50','n_diff_pfx01',80,1,'project'),('te3logex1','app_to_db_status','idx_app_to_db_status','2019-08-14 06:08:50','n_diff_pfx02',80,1,'project,site'),('te3logex1','app_to_db_status','idx_app_to_db_status','2019-08-14 06:08:50','n_diff_pfx03',86,1,'project,site,instance'),('te3logex1','app_to_db_status','idx_app_to_db_status','2019-08-14 06:08:50','n_diff_pfx04',166,1,'project,site,instance,app_server'),('te3logex1','app_to_db_status','idx_app_to_db_status','2019-08-14 06:08:50','n_diff_pfx05',166,1,'project,site,instance,app_server,check_time'),('te3logex1','app_to_db_status','idx_app_to_db_status','2019-08-14 06:08:50','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status','idx_app_to_db_status','2019-08-14 06:08:50','size',1,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status2','GEN_CLUST_INDEX','2018-09-26 06:31:23','n_diff_pfx01',232,2,'DB_ROW_ID'),('te3logex1','app_to_db_status2','GEN_CLUST_INDEX','2018-09-26 06:31:23','n_leaf_pages',2,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status2','GEN_CLUST_INDEX','2018-09-26 06:31:23','size',3,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status_exclude','PRIMARY','2019-01-21 05:47:32','n_diff_pfx01',0,1,'ID_ROW'),('te3logex1','app_to_db_status_exclude','PRIMARY','2019-01-21 05:47:32','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status_exclude','PRIMARY','2019-01-21 05:47:32','size',1,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status_history','PRIMARY','2019-08-12 20:01:19','n_diff_pfx01',0,2,'site'),('te3logex1','app_to_db_status_history','PRIMARY','2019-08-12 20:01:19','n_diff_pfx02',4378,20,'site,project'),('te3logex1','app_to_db_status_history','PRIMARY','2019-08-12 20:01:19','n_diff_pfx03',4378,20,'site,project,app_server'),('te3logex1','app_to_db_status_history','PRIMARY','2019-08-12 20:01:19','n_diff_pfx04',4378,20,'site,project,app_server,instance'),('te3logex1','app_to_db_status_history','PRIMARY','2019-08-12 20:01:19','n_diff_pfx05',4925,20,'site,project,app_server,instance,status'),('te3logex1','app_to_db_status_history','PRIMARY','2019-08-12 20:01:19','n_diff_pfx06',1275756,20,'site,project,app_server,instance,status,check_time'),('te3logex1','app_to_db_status_history','PRIMARY','2019-08-12 20:01:19','n_leaf_pages',5473,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status_history','PRIMARY','2019-08-12 20:01:19','size',9857,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status_history','idx_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx01',68,20,'project'),('te3logex1','app_to_db_status_history','idx_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx02',137,20,'project,app_server'),('te3logex1','app_to_db_status_history','idx_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx03',167,20,'project,app_server,instance'),('te3logex1','app_to_db_status_history','idx_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx04',247,20,'project,app_server,instance,status'),('te3logex1','app_to_db_status_history','idx_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx05',1233100,20,'project,app_server,instance,status,check_time'),('te3logex1','app_to_db_status_history','idx_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx06',1413892,20,'project,app_server,instance,status,check_time,site'),('te3logex1','app_to_db_status_history','idx_app_to_db_status_history','2019-08-12 20:01:19','n_leaf_pages',4269,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status_history','idx_app_to_db_status_history','2019-08-12 20:01:19','size',8769,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status_history','key_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx01',81,20,'project'),('te3logex1','app_to_db_status_history','key_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx02',146,20,'project,app_server'),('te3logex1','app_to_db_status_history','key_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx03',137,20,'project,app_server,instance'),('te3logex1','app_to_db_status_history','key_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx04',203,20,'project,app_server,instance,status'),('te3logex1','app_to_db_status_history','key_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx05',1255093,20,'project,app_server,instance,status,check_time'),('te3logex1','app_to_db_status_history','key_app_to_db_status_history','2019-08-12 20:01:19','n_diff_pfx06',1376109,20,'project,app_server,instance,status,check_time,site'),('te3logex1','app_to_db_status_history','key_app_to_db_status_history','2019-08-12 20:01:19','n_leaf_pages',4299,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status_history','key_app_to_db_status_history','2019-08-12 20:01:19','size',8513,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status_history2','GEN_CLUST_INDEX','2018-09-26 06:33:05','n_diff_pfx01',0,1,'DB_ROW_ID'),('te3logex1','app_to_db_status_history2','GEN_CLUST_INDEX','2018-09-26 06:33:05','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status_history2','GEN_CLUST_INDEX','2018-09-26 06:33:05','size',1,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status_history2','key_app_to_db_status_history2','2018-09-26 06:33:05','n_diff_pfx01',0,1,'project'),('te3logex1','app_to_db_status_history2','key_app_to_db_status_history2','2018-09-26 06:33:05','n_diff_pfx02',0,1,'project,app_server'),('te3logex1','app_to_db_status_history2','key_app_to_db_status_history2','2018-09-26 06:33:05','n_diff_pfx03',0,1,'project,app_server,instance'),('te3logex1','app_to_db_status_history2','key_app_to_db_status_history2','2018-09-26 06:33:05','n_diff_pfx04',0,1,'project,app_server,instance,status'),('te3logex1','app_to_db_status_history2','key_app_to_db_status_history2','2018-09-26 06:33:05','n_diff_pfx05',0,1,'project,app_server,instance,status,check_time'),('te3logex1','app_to_db_status_history2','key_app_to_db_status_history2','2018-09-26 06:33:05','n_diff_pfx06',0,1,'project,app_server,instance,status,check_time,DB_ROW_ID'),('te3logex1','app_to_db_status_history2','key_app_to_db_status_history2','2018-09-26 06:33:05','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status_history2','key_app_to_db_status_history2','2018-09-26 06:33:05','size',1,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status_last_check_time','PRIMARY','2018-09-26 06:33:19','n_diff_pfx01',1,1,'site'),('te3logex1','app_to_db_status_last_check_time','PRIMARY','2018-09-26 06:33:19','n_diff_pfx02',52,1,'site,project'),('te3logex1','app_to_db_status_last_check_time','PRIMARY','2018-09-26 06:33:19','n_diff_pfx03',108,1,'site,project,app_server'),('te3logex1','app_to_db_status_last_check_time','PRIMARY','2018-09-26 06:33:19','n_diff_pfx04',132,1,'site,project,app_server,instance'),('te3logex1','app_to_db_status_last_check_time','PRIMARY','2018-09-26 06:33:19','n_diff_pfx05',132,1,'site,project,app_server,instance,last_check_time'),('te3logex1','app_to_db_status_last_check_time','PRIMARY','2018-09-26 06:33:19','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status_last_check_time','PRIMARY','2018-09-26 06:33:19','size',1,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status_report','PRIMARY','2019-08-14 05:55:19','n_diff_pfx01',1,108,'site'),('te3logex1','app_to_db_status_report','PRIMARY','2019-08-14 05:55:19','n_diff_pfx02',96,108,'site,project'),('te3logex1','app_to_db_status_report','PRIMARY','2019-08-14 05:55:19','n_diff_pfx03',374,108,'site,project,app_server'),('te3logex1','app_to_db_status_report','PRIMARY','2019-08-14 05:55:19','n_diff_pfx04',424,108,'site,project,app_server,instance'),('te3logex1','app_to_db_status_report','PRIMARY','2019-08-14 05:55:19','n_diff_pfx05',17758,108,'site,project,app_server,instance,from_time'),('te3logex1','app_to_db_status_report','PRIMARY','2019-08-14 05:55:19','n_diff_pfx06',17868,108,'site,project,app_server,instance,from_time,to_time'),('te3logex1','app_to_db_status_report','PRIMARY','2019-08-14 05:55:19','n_leaf_pages',108,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status_report','PRIMARY','2019-08-14 05:55:19','size',1922,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status_report','idx_app_to_db_status_report','2019-08-14 05:55:19','n_diff_pfx01',1,79,'site'),('te3logex1','app_to_db_status_report','idx_app_to_db_status_report','2019-08-14 05:55:19','n_diff_pfx02',96,79,'site,project'),('te3logex1','app_to_db_status_report','idx_app_to_db_status_report','2019-08-14 05:55:19','n_diff_pfx03',374,79,'site,project,app_server'),('te3logex1','app_to_db_status_report','idx_app_to_db_status_report','2019-08-14 05:55:19','n_diff_pfx04',424,79,'site,project,app_server,instance'),('te3logex1','app_to_db_status_report','idx_app_to_db_status_report','2019-08-14 05:55:19','n_diff_pfx05',17758,79,'site,project,app_server,instance,from_time'),('te3logex1','app_to_db_status_report','idx_app_to_db_status_report','2019-08-14 05:55:19','n_diff_pfx06',17868,79,'site,project,app_server,instance,from_time,to_time'),('te3logex1','app_to_db_status_report','idx_app_to_db_status_report','2019-08-14 05:55:19','n_leaf_pages',79,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status_report','idx_app_to_db_status_report','2019-08-14 05:55:19','size',1409,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status_report2','GEN_CLUST_INDEX','2018-09-26 06:33:06','n_diff_pfx01',0,1,'DB_ROW_ID'),('te3logex1','app_to_db_status_report2','GEN_CLUST_INDEX','2018-09-26 06:33:06','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status_report2','GEN_CLUST_INDEX','2018-09-26 06:33:06','size',1,NULL,'Number of pages in the index'),('te3logex1','app_to_db_status_report2','idx_app_to_db_status_report2','2018-09-26 06:33:06','n_diff_pfx01',0,1,'site'),('te3logex1','app_to_db_status_report2','idx_app_to_db_status_report2','2018-09-26 06:33:06','n_diff_pfx02',0,1,'site,project'),('te3logex1','app_to_db_status_report2','idx_app_to_db_status_report2','2018-09-26 06:33:06','n_diff_pfx03',0,1,'site,project,app_server'),('te3logex1','app_to_db_status_report2','idx_app_to_db_status_report2','2018-09-26 06:33:06','n_diff_pfx04',0,1,'site,project,app_server,instance'),('te3logex1','app_to_db_status_report2','idx_app_to_db_status_report2','2018-09-26 06:33:06','n_diff_pfx05',0,1,'site,project,app_server,instance,DB_ROW_ID'),('te3logex1','app_to_db_status_report2','idx_app_to_db_status_report2','2018-09-26 06:33:06','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','app_to_db_status_report2','idx_app_to_db_status_report2','2018-09-26 06:33:06','size',1,NULL,'Number of pages in the index'),('te3logex1','cmdb_account','GEN_CLUST_INDEX','2018-09-26 06:33:07','n_diff_pfx01',9994,20,'DB_ROW_ID'),('te3logex1','cmdb_account','GEN_CLUST_INDEX','2018-09-26 06:33:07','n_leaf_pages',76,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_account','GEN_CLUST_INDEX','2018-09-26 06:33:07','size',97,NULL,'Number of pages in the index'),('te3logex1','cmdb_application','PRIMARY','2018-09-26 06:33:07','n_diff_pfx01',6,1,'NAME'),('te3logex1','cmdb_application','PRIMARY','2018-09-26 06:33:07','n_diff_pfx02',6,1,'NAME,SITE'),('te3logex1','cmdb_application','PRIMARY','2018-09-26 06:33:07','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_application','PRIMARY','2018-09-26 06:33:07','size',1,NULL,'Number of pages in the index'),('te3logex1','cmdb_computer_systems','PRIMARY','2018-09-26 06:33:07','n_diff_pfx01',2045,20,'SERVER_NAME'),('te3logex1','cmdb_computer_systems','PRIMARY','2018-09-26 06:33:07','n_leaf_pages',23,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_computer_systems','PRIMARY','2018-09-26 06:33:07','size',24,NULL,'Number of pages in the index'),('te3logex1','cmdb_db_instance','PRIMARY','2018-09-26 06:33:07','n_diff_pfx01',110,1,'BD_INSTANCE_UNIQUE_NAME'),('te3logex1','cmdb_db_instance','PRIMARY','2018-09-26 06:33:07','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_db_instance','PRIMARY','2018-09-26 06:33:07','size',1,NULL,'Number of pages in the index'),('te3logex1','cmdb_db_service','GEN_CLUST_INDEX','2018-09-26 06:33:07','n_diff_pfx01',592,6,'DB_ROW_ID'),('te3logex1','cmdb_db_service','GEN_CLUST_INDEX','2018-09-26 06:33:07','n_leaf_pages',6,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_db_service','GEN_CLUST_INDEX','2018-09-26 06:33:07','size',7,NULL,'Number of pages in the index'),('te3logex1','cmdb_digital_certificate','GEN_CLUST_INDEX','2018-09-26 06:33:08','n_diff_pfx01',587,5,'DB_ROW_ID'),('te3logex1','cmdb_digital_certificate','GEN_CLUST_INDEX','2018-09-26 06:33:08','n_leaf_pages',5,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_digital_certificate','GEN_CLUST_INDEX','2018-09-26 06:33:08','size',6,NULL,'Number of pages in the index'),('te3logex1','cmdb_dns','PRIMARY','2018-09-26 06:33:08','n_diff_pfx01',244,1,'DNS'),('te3logex1','cmdb_dns','PRIMARY','2018-09-26 06:33:08','n_diff_pfx02',273,1,'DNS,SITE'),('te3logex1','cmdb_dns','PRIMARY','2018-09-26 06:33:08','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_dns','PRIMARY','2018-09-26 06:33:08','size',1,NULL,'Number of pages in the index'),('te3logex1','cmdb_ip','PRIMARY','2018-09-26 06:33:08','n_diff_pfx01',4102,20,'IP'),('te3logex1','cmdb_ip','PRIMARY','2018-09-26 06:33:08','n_leaf_pages',23,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_ip','PRIMARY','2018-09-26 06:33:08','size',24,NULL,'Number of pages in the index'),('te3logex1','cmdb_mount_point','PRIMARY','2018-09-26 06:33:08','n_diff_pfx01',1633,12,'MOUNT_POINT_UNIQUE_NAME'),('te3logex1','cmdb_mount_point','PRIMARY','2018-09-26 06:33:08','n_leaf_pages',12,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_mount_point','PRIMARY','2018-09-26 06:33:08','size',13,NULL,'Number of pages in the index'),('te3logex1','cmdb_project_db_instance_map','PRIMARY','2018-09-26 06:33:08','n_diff_pfx01',85,2,'PROJECT_ID'),('te3logex1','cmdb_project_db_instance_map','PRIMARY','2018-09-26 06:33:08','n_diff_pfx02',408,2,'PROJECT_ID,BD_INSTANCE_UNIQUE_NAME'),('te3logex1','cmdb_project_db_instance_map','PRIMARY','2018-09-26 06:33:08','n_leaf_pages',2,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_project_db_instance_map','PRIMARY','2018-09-26 06:33:08','size',3,NULL,'Number of pages in the index'),('te3logex1','cmdb_project_details','PRIMARY','2018-09-26 06:33:08','n_diff_pfx01',130,7,'PROJECT_ID'),('te3logex1','cmdb_project_details','PRIMARY','2018-09-26 06:33:08','n_leaf_pages',7,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_project_details','PRIMARY','2018-09-26 06:33:08','size',8,NULL,'Number of pages in the index'),('te3logex1','cmdb_project_dns_map','PRIMARY','2018-09-26 06:33:08','n_diff_pfx01',81,1,'PROJECT_ID'),('te3logex1','cmdb_project_dns_map','PRIMARY','2018-09-26 06:33:08','n_diff_pfx02',196,1,'PROJECT_ID,DNS'),('te3logex1','cmdb_project_dns_map','PRIMARY','2018-09-26 06:33:08','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_project_dns_map','PRIMARY','2018-09-26 06:33:08','size',1,NULL,'Number of pages in the index'),('te3logex1','cmdb_project_ip_map','PRIMARY','2018-09-26 06:33:08','n_diff_pfx01',94,7,'PROJECT_ID'),('te3logex1','cmdb_project_ip_map','PRIMARY','2018-09-26 06:33:08','n_diff_pfx02',2297,7,'PROJECT_ID,IP'),('te3logex1','cmdb_project_ip_map','PRIMARY','2018-09-26 06:33:08','n_leaf_pages',7,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_project_ip_map','PRIMARY','2018-09-26 06:33:08','size',8,NULL,'Number of pages in the index'),('te3logex1','cmdb_project_mount_point_map','PRIMARY','2018-09-26 06:33:08','n_diff_pfx01',92,6,'PROJECT_ID'),('te3logex1','cmdb_project_mount_point_map','PRIMARY','2018-09-26 06:33:08','n_diff_pfx02',1653,6,'PROJECT_ID,MOUNT_POINT_UNIQUE_NAME'),('te3logex1','cmdb_project_mount_point_map','PRIMARY','2018-09-26 06:33:08','n_leaf_pages',6,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_project_mount_point_map','PRIMARY','2018-09-26 06:33:08','size',7,NULL,'Number of pages in the index'),('te3logex1','cmdb_project_server_map','PRIMARY','2018-09-26 06:33:08','n_diff_pfx01',97,10,'PROJECT_ID'),('te3logex1','cmdb_project_server_map','PRIMARY','2018-09-26 06:33:08','n_diff_pfx02',3873,10,'PROJECT_ID,SERVER_NAME'),('te3logex1','cmdb_project_server_map','PRIMARY','2018-09-26 06:33:08','n_leaf_pages',10,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_project_server_map','PRIMARY','2018-09-26 06:33:08','size',11,NULL,'Number of pages in the index'),('te3logex1','cmdb_project_ssl_certificate_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx01',92,13,'PROJECT_ID'),('te3logex1','cmdb_project_ssl_certificate_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx02',641,13,'PROJECT_ID,SERVER_NAME'),('te3logex1','cmdb_project_ssl_certificate_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx03',837,13,'PROJECT_ID,SERVER_NAME,WEB_INSTANCE_UNIQUE_NAME'),('te3logex1','cmdb_project_ssl_certificate_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx04',837,13,'PROJECT_ID,SERVER_NAME,WEB_INSTANCE_UNIQUE_NAME,COMMON_NAME'),('te3logex1','cmdb_project_ssl_certificate_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx05',837,13,'PROJECT_ID,SERVER_NAME,WEB_INSTANCE_UNIQUE_NAME,COMMON_NAME,SITE'),('te3logex1','cmdb_project_ssl_certificate_map','PRIMARY','2018-09-26 06:33:09','n_leaf_pages',13,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_project_ssl_certificate_map','PRIMARY','2018-09-26 06:33:09','size',14,NULL,'Number of pages in the index'),('te3logex1','cmdb_project_web_instance_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx01',95,4,'PROJECT_ID'),('te3logex1','cmdb_project_web_instance_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx02',941,4,'PROJECT_ID,WEB_INSTANCE_UNIQUE_NAME'),('te3logex1','cmdb_project_web_instance_map','PRIMARY','2018-09-26 06:33:09','n_leaf_pages',4,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_project_web_instance_map','PRIMARY','2018-09-26 06:33:09','size',5,NULL,'Number of pages in the index'),('te3logex1','cmdb_server_host_mount_point_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx01',277,7,'SERVER_NAME'),('te3logex1','cmdb_server_host_mount_point_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx02',1633,7,'SERVER_NAME,MOUNT_POINT_UNIQUE_NAME'),('te3logex1','cmdb_server_host_mount_point_map','PRIMARY','2018-09-26 06:33:09','n_leaf_pages',7,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_server_host_mount_point_map','PRIMARY','2018-09-26 06:33:09','size',8,NULL,'Number of pages in the index'),('te3logex1','cmdb_server_ip_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx01',426,11,'SERVER_NAME'),('te3logex1','cmdb_server_ip_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx02',2899,11,'SERVER_NAME,IP'),('te3logex1','cmdb_server_ip_map','PRIMARY','2018-09-26 06:33:09','n_leaf_pages',11,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_server_ip_map','PRIMARY','2018-09-26 06:33:09','size',12,NULL,'Number of pages in the index'),('te3logex1','cmdb_server_mount_point_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx01',369,7,'SERVER_NAME'),('te3logex1','cmdb_server_mount_point_map','PRIMARY','2018-09-26 06:33:09','n_diff_pfx02',1669,7,'SERVER_NAME,MOUNT_POINT_UNIQUE_NAME'),('te3logex1','cmdb_server_mount_point_map','PRIMARY','2018-09-26 06:33:09','n_leaf_pages',7,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_server_mount_point_map','PRIMARY','2018-09-26 06:33:09','size',8,NULL,'Number of pages in the index'),('te3logex1','cmdb_server_web_instance_map','PRIMARY','2018-09-26 06:33:29','n_diff_pfx01',199,4,'SERVER_NAME'),('te3logex1','cmdb_server_web_instance_map','PRIMARY','2018-09-26 06:33:29','n_diff_pfx02',921,4,'SERVER_NAME,WEB_INSTANCE_UNIQUE_NAME'),('te3logex1','cmdb_server_web_instance_map','PRIMARY','2018-09-26 06:33:29','n_leaf_pages',4,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_server_web_instance_map','PRIMARY','2018-09-26 06:33:29','size',5,NULL,'Number of pages in the index'),('te3logex1','cmdb_shared_services','GEN_CLUST_INDEX','2018-09-26 06:33:39','n_diff_pfx01',215,3,'DB_ROW_ID'),('te3logex1','cmdb_shared_services','GEN_CLUST_INDEX','2018-09-26 06:33:39','n_leaf_pages',3,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_shared_services','GEN_CLUST_INDEX','2018-09-26 06:33:39','size',4,NULL,'Number of pages in the index'),('te3logex1','cmdb_web_instance','PRIMARY','2018-09-26 06:33:48','n_diff_pfx01',983,6,'WEB_INSTANCE_UNIQUE_NAME'),('te3logex1','cmdb_web_instance','PRIMARY','2018-09-26 06:33:48','n_leaf_pages',6,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_web_instance','PRIMARY','2018-09-26 06:33:48','size',7,NULL,'Number of pages in the index'),('te3logex1','cmdb_web_instance_details_access_log','PRIMARY','2018-09-26 06:33:49','n_diff_pfx01',908,17,'WEB_INSTANCE_UNIQUE_NAME'),('te3logex1','cmdb_web_instance_details_access_log','PRIMARY','2018-09-26 06:33:49','n_diff_pfx02',1742,17,'WEB_INSTANCE_UNIQUE_NAME,ASSESS_LOG_UNIQUIE_NAME'),('te3logex1','cmdb_web_instance_details_access_log','PRIMARY','2018-09-26 06:33:49','n_leaf_pages',17,NULL,'Number of leaf pages in the index'),('te3logex1','cmdb_web_instance_details_access_log','PRIMARY','2018-09-26 06:33:49','size',18,NULL,'Number of pages in the index'),('te3logex1','complete_db_info','PRIMARY','2019-08-14 04:39:56','n_diff_pfx01',1,15,'site'),('te3logex1','complete_db_info','PRIMARY','2019-08-14 04:39:56','n_diff_pfx02',57,15,'site,app_server'),('te3logex1','complete_db_info','PRIMARY','2019-08-14 04:39:56','n_diff_pfx03',187,15,'site,app_server,project'),('te3logex1','complete_db_info','PRIMARY','2019-08-14 04:39:56','n_diff_pfx04',658,15,'site,app_server,project,log_file'),('te3logex1','complete_db_info','PRIMARY','2019-08-14 04:39:56','n_diff_pfx05',724,15,'site,app_server,project,log_file,dns_name'),('te3logex1','complete_db_info','PRIMARY','2019-08-14 04:39:56','n_diff_pfx06',730,15,'site,app_server,project,log_file,dns_name,instance'),('te3logex1','complete_db_info','PRIMARY','2019-08-14 04:39:56','n_diff_pfx07',754,15,'site,app_server,project,log_file,dns_name,instance,db_mode'),('te3logex1','complete_db_info','PRIMARY','2019-08-14 04:39:56','n_diff_pfx08',760,15,'site,app_server,project,log_file,dns_name,instance,db_mode,host_group'),('te3logex1','complete_db_info','PRIMARY','2019-08-14 04:39:56','n_diff_pfx09',1174,15,'site,app_server,project,log_file,dns_name,instance,db_mode,host_group,db_name'),('te3logex1','complete_db_info','PRIMARY','2019-08-14 04:39:56','n_leaf_pages',15,NULL,'Number of leaf pages in the index'),('te3logex1','complete_db_info','PRIMARY','2019-08-14 04:39:56','size',16,NULL,'Number of pages in the index'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','n_diff_pfx01',1,13,'site'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','n_diff_pfx02',64,13,'site,instance'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','n_diff_pfx03',102,13,'site,instance,project'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','n_diff_pfx04',112,13,'site,instance,project,dns_name'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','n_diff_pfx05',112,13,'site,instance,project,dns_name,dns_site'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','n_diff_pfx06',228,13,'site,instance,project,dns_name,dns_site,app_server'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','n_diff_pfx07',730,13,'site,instance,project,dns_name,dns_site,app_server,log_file'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','n_diff_pfx08',754,13,'site,instance,project,dns_name,dns_site,app_server,log_file,db_mode'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','n_diff_pfx09',760,13,'site,instance,project,dns_name,dns_site,app_server,log_file,db_mode,host_group'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','n_diff_pfx10',1174,13,'site,instance,project,dns_name,dns_site,app_server,log_file,db_mode,host_group,db_name'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','n_leaf_pages',13,NULL,'Number of leaf pages in the index'),('te3logex1','complete_db_info','idx_complete_db_info_1','2019-08-14 04:39:56','size',14,NULL,'Number of pages in the index'),('te3logex1','complete_db_info','idx_complete_db_info_2','2019-08-14 04:39:56','n_diff_pfx01',1,12,'site'),('te3logex1','complete_db_info','idx_complete_db_info_2','2019-08-14 04:39:56','n_diff_pfx02',64,12,'site,instance'),('te3logex1','complete_db_info','idx_complete_db_info_2','2019-08-14 04:39:56','n_diff_pfx03',138,12,'site,instance,app_server'),('te3logex1','complete_db_info','idx_complete_db_info_2','2019-08-14 04:39:56','n_diff_pfx04',204,12,'site,instance,app_server,project'),('te3logex1','complete_db_info','idx_complete_db_info_2','2019-08-14 04:39:56','n_diff_pfx05',664,12,'site,instance,app_server,project,log_file'),('te3logex1','complete_db_info','idx_complete_db_info_2','2019-08-14 04:39:56','n_diff_pfx06',730,12,'site,instance,app_server,project,log_file,dns_name'),('te3logex1','complete_db_info','idx_complete_db_info_2','2019-08-14 04:39:56','n_diff_pfx07',754,12,'site,instance,app_server,project,log_file,dns_name,db_mode'),('te3logex1','complete_db_info','idx_complete_db_info_2','2019-08-14 04:39:56','n_diff_pfx08',760,12,'site,instance,app_server,project,log_file,dns_name,db_mode,host_group'),('te3logex1','complete_db_info','idx_complete_db_info_2','2019-08-14 04:39:56','n_diff_pfx09',1174,12,'site,instance,app_server,project,log_file,dns_name,db_mode,host_group,db_name'),('te3logex1','complete_db_info','idx_complete_db_info_2','2019-08-14 04:39:56','n_leaf_pages',12,NULL,'Number of leaf pages in the index'),('te3logex1','complete_db_info','idx_complete_db_info_2','2019-08-14 04:39:56','size',13,NULL,'Number of pages in the index'),('te3logex1','db_instance_restart_time','PRIMARY','2019-08-12 20:10:24','n_diff_pfx01',0,2,'site'),('te3logex1','db_instance_restart_time','PRIMARY','2019-08-12 20:10:24','n_diff_pfx02',22,20,'site,db_server'),('te3logex1','db_instance_restart_time','PRIMARY','2019-08-12 20:10:24','n_diff_pfx03',54,20,'site,db_server,instance'),('te3logex1','db_instance_restart_time','PRIMARY','2019-08-12 20:10:24','n_diff_pfx04',615815,20,'site,db_server,instance,last_update_time'),('te3logex1','db_instance_restart_time','PRIMARY','2019-08-12 20:10:24','n_leaf_pages',2900,NULL,'Number of leaf pages in the index'),('te3logex1','db_instance_restart_time','PRIMARY','2019-08-12 20:10:24','size',3649,NULL,'Number of pages in the index'),('te3logex1','db_instance_restart_time','idx_db_instance_restart_time','2019-08-12 20:10:24','n_diff_pfx01',0,2,'site'),('te3logex1','db_instance_restart_time','idx_db_instance_restart_time','2019-08-12 20:10:24','n_diff_pfx02',25,20,'site,instance'),('te3logex1','db_instance_restart_time','idx_db_instance_restart_time','2019-08-12 20:10:24','n_diff_pfx03',63,20,'site,instance,db_server'),('te3logex1','db_instance_restart_time','idx_db_instance_restart_time','2019-08-12 20:10:24','n_diff_pfx04',563267,20,'site,instance,db_server,last_update_time'),('te3logex1','db_instance_restart_time','idx_db_instance_restart_time','2019-08-12 20:10:24','n_leaf_pages',1947,NULL,'Number of leaf pages in the index'),('te3logex1','db_instance_restart_time','idx_db_instance_restart_time','2019-08-12 20:10:24','size',2881,NULL,'Number of pages in the index'),('te3logex1','db_instance_restart_time2','GEN_CLUST_INDEX','2018-09-26 06:33:48','n_diff_pfx01',0,1,'DB_ROW_ID'),('te3logex1','db_instance_restart_time2','GEN_CLUST_INDEX','2018-09-26 06:33:48','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','db_instance_restart_time2','GEN_CLUST_INDEX','2018-09-26 06:33:48','size',1,NULL,'Number of pages in the index'),('te3logex1','db_instance_restart_time_history','PRIMARY','2019-07-09 18:45:40','n_diff_pfx01',1,25,'site'),('te3logex1','db_instance_restart_time_history','PRIMARY','2019-07-09 18:45:40','n_diff_pfx02',78,25,'site,db_server'),('te3logex1','db_instance_restart_time_history','PRIMARY','2019-07-09 18:45:40','n_diff_pfx03',318,25,'site,db_server,instance'),('te3logex1','db_instance_restart_time_history','PRIMARY','2019-07-09 18:45:40','n_diff_pfx04',3388,25,'site,db_server,instance,restart_time'),('te3logex1','db_instance_restart_time_history','PRIMARY','2019-07-09 18:45:40','n_leaf_pages',25,NULL,'Number of leaf pages in the index'),('te3logex1','db_instance_restart_time_history','PRIMARY','2019-07-09 18:45:40','size',26,NULL,'Number of pages in the index'),('te3logex1','db_instance_restart_time_history','idx_db_instance_restart_time_history','2019-07-09 18:45:40','n_diff_pfx01',1,12,'site'),('te3logex1','db_instance_restart_time_history','idx_db_instance_restart_time_history','2019-07-09 18:45:40','n_diff_pfx02',78,12,'site,db_server'),('te3logex1','db_instance_restart_time_history','idx_db_instance_restart_time_history','2019-07-09 18:45:40','n_diff_pfx03',318,12,'site,db_server,instance'),('te3logex1','db_instance_restart_time_history','idx_db_instance_restart_time_history','2019-07-09 18:45:40','n_diff_pfx04',3388,12,'site,db_server,instance,restart_time'),('te3logex1','db_instance_restart_time_history','idx_db_instance_restart_time_history','2019-07-09 18:45:40','n_leaf_pages',12,NULL,'Number of leaf pages in the index'),('te3logex1','db_instance_restart_time_history','idx_db_instance_restart_time_history','2019-07-09 18:45:40','size',13,NULL,'Number of pages in the index'),('te3logex1','replica_test','GEN_CLUST_INDEX','2018-09-26 06:33:53','n_diff_pfx01',99076,20,'DB_ROW_ID'),('te3logex1','replica_test','GEN_CLUST_INDEX','2018-09-26 06:33:53','n_leaf_pages',1054,NULL,'Number of leaf pages in the index'),('te3logex1','replica_test','GEN_CLUST_INDEX','2018-09-26 06:33:53','size',1059,NULL,'Number of pages in the index'),('te3logex1','tak','GEN_CLUST_INDEX','2018-09-26 06:34:03','n_diff_pfx01',4,1,'DB_ROW_ID'),('te3logex1','tak','GEN_CLUST_INDEX','2018-09-26 06:34:03','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','tak','GEN_CLUST_INDEX','2018-09-26 06:34:03','size',1,NULL,'Number of pages in the index'),('te3logex1','tmp_app_to_db_status','PRIMARY','2019-08-14 06:09:00','n_diff_pfx01',1,1,'site'),('te3logex1','tmp_app_to_db_status','PRIMARY','2019-08-14 06:09:00','n_diff_pfx02',80,1,'site,project'),('te3logex1','tmp_app_to_db_status','PRIMARY','2019-08-14 06:09:00','n_diff_pfx03',154,1,'site,project,app_server'),('te3logex1','tmp_app_to_db_status','PRIMARY','2019-08-14 06:09:00','n_diff_pfx04',166,1,'site,project,app_server,instance'),('te3logex1','tmp_app_to_db_status','PRIMARY','2019-08-14 06:09:00','n_diff_pfx05',166,1,'site,project,app_server,instance,status'),('te3logex1','tmp_app_to_db_status','PRIMARY','2019-08-14 06:09:00','n_diff_pfx06',168,1,'site,project,app_server,instance,status,check_time'),('te3logex1','tmp_app_to_db_status','PRIMARY','2019-08-14 06:09:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','tmp_app_to_db_status','PRIMARY','2019-08-14 06:09:00','size',1,NULL,'Number of pages in the index'),('te3logex1','tmp_app_to_db_status2','GEN_CLUST_INDEX','2018-09-26 06:33:52','n_diff_pfx01',0,1,'DB_ROW_ID'),('te3logex1','tmp_app_to_db_status2','GEN_CLUST_INDEX','2018-09-26 06:33:52','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','tmp_app_to_db_status2','GEN_CLUST_INDEX','2018-09-26 06:33:52','size',1,NULL,'Number of pages in the index'),('te3logex1','tmp_app_to_db_status_report','PRIMARY','2019-08-14 06:08:13','n_diff_pfx01',1,2,'site'),('te3logex1','tmp_app_to_db_status_report','PRIMARY','2019-08-14 06:08:13','n_diff_pfx02',90,2,'site,project'),('te3logex1','tmp_app_to_db_status_report','PRIMARY','2019-08-14 06:08:13','n_diff_pfx03',182,2,'site,project,app_server'),('te3logex1','tmp_app_to_db_status_report','PRIMARY','2019-08-14 06:08:13','n_diff_pfx04',196,2,'site,project,app_server,instance'),('te3logex1','tmp_app_to_db_status_report','PRIMARY','2019-08-14 06:08:13','n_diff_pfx05',196,2,'site,project,app_server,instance,status'),('te3logex1','tmp_app_to_db_status_report','PRIMARY','2019-08-14 06:08:13','n_diff_pfx06',293,2,'site,project,app_server,instance,status,check_time'),('te3logex1','tmp_app_to_db_status_report','PRIMARY','2019-08-14 06:08:13','n_leaf_pages',2,NULL,'Number of leaf pages in the index'),('te3logex1','tmp_app_to_db_status_report','PRIMARY','2019-08-14 06:08:13','size',3,NULL,'Number of pages in the index'),('te3logex1','tmp_app_to_db_status_report','idx_tmp_app_to_db_status_report','2019-08-14 06:08:13','n_diff_pfx01',1,1,'site'),('te3logex1','tmp_app_to_db_status_report','idx_tmp_app_to_db_status_report','2019-08-14 06:08:13','n_diff_pfx02',90,1,'site,project'),('te3logex1','tmp_app_to_db_status_report','idx_tmp_app_to_db_status_report','2019-08-14 06:08:13','n_diff_pfx03',182,1,'site,project,app_server'),('te3logex1','tmp_app_to_db_status_report','idx_tmp_app_to_db_status_report','2019-08-14 06:08:13','n_diff_pfx04',196,1,'site,project,app_server,instance'),('te3logex1','tmp_app_to_db_status_report','idx_tmp_app_to_db_status_report','2019-08-14 06:08:13','n_diff_pfx05',196,1,'site,project,app_server,instance,status'),('te3logex1','tmp_app_to_db_status_report','idx_tmp_app_to_db_status_report','2019-08-14 06:08:13','n_diff_pfx06',293,1,'site,project,app_server,instance,status,check_time'),('te3logex1','tmp_app_to_db_status_report','idx_tmp_app_to_db_status_report','2019-08-14 06:08:13','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','tmp_app_to_db_status_report','idx_tmp_app_to_db_status_report','2019-08-14 06:08:13','size',1,NULL,'Number of pages in the index'),('te3logex1','tmp_app_to_db_status_report2','GEN_CLUST_INDEX','2018-09-26 06:34:33','n_diff_pfx01',15213,20,'DB_ROW_ID'),('te3logex1','tmp_app_to_db_status_report2','GEN_CLUST_INDEX','2018-09-26 06:34:33','n_leaf_pages',66,NULL,'Number of leaf pages in the index'),('te3logex1','tmp_app_to_db_status_report2','GEN_CLUST_INDEX','2018-09-26 06:34:33','size',97,NULL,'Number of pages in the index'),('te3logex1','tmp_app_to_db_status_report_null','PRIMARY','2019-01-21 05:59:08','n_diff_pfx01',1,1,'site'),('te3logex1','tmp_app_to_db_status_report_null','PRIMARY','2019-01-21 05:59:08','n_diff_pfx02',1,1,'site,project'),('te3logex1','tmp_app_to_db_status_report_null','PRIMARY','2019-01-21 05:59:08','n_diff_pfx03',1,1,'site,project,app_server'),('te3logex1','tmp_app_to_db_status_report_null','PRIMARY','2019-01-21 05:59:08','n_diff_pfx04',1,1,'site,project,app_server,instance'),('te3logex1','tmp_app_to_db_status_report_null','PRIMARY','2019-01-21 05:59:08','n_diff_pfx05',1,1,'site,project,app_server,instance,status'),('te3logex1','tmp_app_to_db_status_report_null','PRIMARY','2019-01-21 05:59:08','n_diff_pfx06',1,1,'site,project,app_server,instance,status,check_time'),('te3logex1','tmp_app_to_db_status_report_null','PRIMARY','2019-01-21 05:59:08','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','tmp_app_to_db_status_report_null','PRIMARY','2019-01-21 05:59:08','size',1,NULL,'Number of pages in the index'),('te3logex1','tmp_app_to_db_status_report_null','idx_tmp_app_to_db_status_report_null','2019-01-21 05:59:08','n_diff_pfx01',1,1,'site'),('te3logex1','tmp_app_to_db_status_report_null','idx_tmp_app_to_db_status_report_null','2019-01-21 05:59:08','n_diff_pfx02',1,1,'site,project'),('te3logex1','tmp_app_to_db_status_report_null','idx_tmp_app_to_db_status_report_null','2019-01-21 05:59:08','n_diff_pfx03',1,1,'site,project,app_server'),('te3logex1','tmp_app_to_db_status_report_null','idx_tmp_app_to_db_status_report_null','2019-01-21 05:59:08','n_diff_pfx04',1,1,'site,project,app_server,instance'),('te3logex1','tmp_app_to_db_status_report_null','idx_tmp_app_to_db_status_report_null','2019-01-21 05:59:08','n_diff_pfx05',1,1,'site,project,app_server,instance,status'),('te3logex1','tmp_app_to_db_status_report_null','idx_tmp_app_to_db_status_report_null','2019-01-21 05:59:08','n_diff_pfx06',1,1,'site,project,app_server,instance,status,check_time'),('te3logex1','tmp_app_to_db_status_report_null','idx_tmp_app_to_db_status_report_null','2019-01-21 05:59:08','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','tmp_app_to_db_status_report_null','idx_tmp_app_to_db_status_report_null','2019-01-21 05:59:08','size',1,NULL,'Number of pages in the index'),('te3logex1','tmp_app_to_db_status_report_tt','GEN_CLUST_INDEX','2018-09-26 06:33:53','n_diff_pfx01',0,1,'DB_ROW_ID'),('te3logex1','tmp_app_to_db_status_report_tt','GEN_CLUST_INDEX','2018-09-26 06:33:53','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','tmp_app_to_db_status_report_tt','GEN_CLUST_INDEX','2018-09-26 06:33:53','size',1,NULL,'Number of pages in the index'),('te3logex1','tmp_app_to_db_status_report_tt','idx_tmp_app_to_db_status_report_TT','2018-09-26 06:33:53','n_diff_pfx01',0,1,'site'),('te3logex1','tmp_app_to_db_status_report_tt','idx_tmp_app_to_db_status_report_TT','2018-09-26 06:33:53','n_diff_pfx02',0,1,'site,project'),('te3logex1','tmp_app_to_db_status_report_tt','idx_tmp_app_to_db_status_report_TT','2018-09-26 06:33:53','n_diff_pfx03',0,1,'site,project,app_server'),('te3logex1','tmp_app_to_db_status_report_tt','idx_tmp_app_to_db_status_report_TT','2018-09-26 06:33:53','n_diff_pfx04',0,1,'site,project,app_server,instance'),('te3logex1','tmp_app_to_db_status_report_tt','idx_tmp_app_to_db_status_report_TT','2018-09-26 06:33:53','n_diff_pfx05',0,1,'site,project,app_server,instance,check_time'),('te3logex1','tmp_app_to_db_status_report_tt','idx_tmp_app_to_db_status_report_TT','2018-09-26 06:33:53','n_diff_pfx06',0,1,'site,project,app_server,instance,check_time,DB_ROW_ID'),('te3logex1','tmp_app_to_db_status_report_tt','idx_tmp_app_to_db_status_report_TT','2018-09-26 06:33:53','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),('te3logex1','tmp_app_to_db_status_report_tt','idx_tmp_app_to_db_status_report_TT','2018-09-26 06:33:53','size',1,NULL,'Number of pages in the index');

--
-- Table structure for table `innodb_table_stats`
--

CREATE TABLE `innodb_table_stats` (
  `database_name` varchar(64) COLLATE utf8_bin NOT NULL,
  `table_name` varchar(199) COLLATE utf8_bin NOT NULL,
  `last_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `n_rows` bigint(20) unsigned NOT NULL,
  `clustered_index_size` bigint(20) unsigned NOT NULL,
  `sum_of_other_index_sizes` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`database_name`,`table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;

--
-- Dumping data for table `innodb_table_stats`
--

INSERT INTO `innodb_table_stats` VALUES ('mysql','gtid_slave_pos','2018-09-26 02:49:46',0,1,0),('te3logex1','app_to_db_status','2019-08-14 06:08:50',166,1,1),('te3logex1','app_to_db_status2','2018-09-26 06:31:23',232,3,0),('te3logex1','app_to_db_status_exclude','2019-01-21 05:47:32',0,1,0),('te3logex1','app_to_db_status_history','2019-08-12 20:01:19',1275756,9857,17282),('te3logex1','app_to_db_status_history2','2018-09-26 06:33:05',0,1,1),('te3logex1','app_to_db_status_last_check_time','2018-09-26 06:33:19',132,1,0),('te3logex1','app_to_db_status_report','2019-08-14 05:55:19',17868,1922,1409),('te3logex1','app_to_db_status_report2','2018-09-26 06:33:06',0,1,1),('te3logex1','cmdb_account','2018-09-26 06:33:07',9994,97,0),('te3logex1','cmdb_application','2018-09-26 06:33:07',6,1,0),('te3logex1','cmdb_computer_systems','2018-09-26 06:33:07',2045,24,0),('te3logex1','cmdb_db_instance','2018-09-26 06:33:07',110,1,0),('te3logex1','cmdb_db_service','2018-09-26 06:33:07',592,7,0),('te3logex1','cmdb_digital_certificate','2018-09-26 06:33:08',587,6,0),('te3logex1','cmdb_dns','2018-09-26 06:33:08',273,1,0),('te3logex1','cmdb_ip','2018-09-26 06:33:08',4102,24,0),('te3logex1','cmdb_mount_point','2018-09-26 06:33:08',1633,13,0),('te3logex1','cmdb_project_db_instance_map','2018-09-26 06:33:08',408,3,0),('te3logex1','cmdb_project_details','2018-09-26 06:33:08',130,8,0),('te3logex1','cmdb_project_dns_map','2018-09-26 06:33:08',196,1,0),('te3logex1','cmdb_project_ip_map','2018-09-26 06:33:08',2297,8,0),('te3logex1','cmdb_project_mount_point_map','2018-09-26 06:33:08',1653,7,0),('te3logex1','cmdb_project_server_map','2018-09-26 06:33:08',3873,11,0),('te3logex1','cmdb_project_ssl_certificate_map','2018-09-26 06:33:09',837,14,0),('te3logex1','cmdb_project_web_instance_map','2018-09-26 06:33:09',941,5,0),('te3logex1','cmdb_server_host_mount_point_map','2018-09-26 06:33:09',1633,8,0),('te3logex1','cmdb_server_ip_map','2018-09-26 06:33:09',2899,12,0),('te3logex1','cmdb_server_mount_point_map','2018-09-26 06:33:09',1669,8,0),('te3logex1','cmdb_server_web_instance_map','2018-09-26 06:33:29',921,5,0),('te3logex1','cmdb_shared_services','2018-09-26 06:33:39',215,4,0),('te3logex1','cmdb_web_instance','2018-09-26 06:33:48',983,7,0),('te3logex1','cmdb_web_instance_details_access_log','2018-09-26 06:33:49',1742,18,0),('te3logex1','complete_db_info','2019-08-14 04:39:56',1174,16,27),('te3logex1','db_instance_restart_time','2019-08-12 20:10:24',615207,3649,2881),('te3logex1','db_instance_restart_time2','2018-09-26 06:33:48',0,1,0),('te3logex1','db_instance_restart_time_history','2019-07-09 18:45:40',3388,26,13),('te3logex1','replica_test','2018-09-26 06:33:53',99076,1059,0),('te3logex1','tak','2018-09-26 06:34:03',4,1,0),('te3logex1','tmp_app_to_db_status','2019-08-14 06:09:00',168,1,0),('te3logex1','tmp_app_to_db_status2','2018-09-26 06:33:52',0,1,0),('te3logex1','tmp_app_to_db_status_report','2019-08-14 06:08:13',293,3,1),('te3logex1','tmp_app_to_db_status_report2','2018-09-26 06:34:33',15213,97,0),('te3logex1','tmp_app_to_db_status_report_null','2019-01-21 05:59:08',1,1,1),('te3logex1','tmp_app_to_db_status_report_tt','2018-09-26 06:33:53',0,1,1);

--
-- Table structure for table `plugin`
--

CREATE TABLE `plugin` (
  `name` varchar(64) NOT NULL DEFAULT '',
  `dl` varchar(128) NOT NULL DEFAULT '',
  PRIMARY KEY (`name`)
) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='MySQL plugins';

--
-- Dumping data for table `plugin`
--

INSERT INTO `plugin` VALUES ('unix_socket','auth_socket.so');

--
-- Table structure for table `proc`
--

CREATE TABLE `proc` (
  `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `name` char(64) NOT NULL DEFAULT '',
  `type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL,
  `specific_name` char(64) NOT NULL DEFAULT '',
  `language` enum('SQL') NOT NULL DEFAULT 'SQL',
  `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL',
  `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO',
  `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER',
  `param_list` blob NOT NULL,
  `returns` longblob NOT NULL,
  `body` longblob NOT NULL,
  `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NOT NULL DEFAULT '',
  `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `body_utf8` longblob DEFAULT NULL,
  `aggregate` enum('NONE','GROUP') NOT NULL DEFAULT 'NONE',
  PRIMARY KEY (`db`,`name`,`type`)
) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Stored Procedures';

--
-- Dumping data for table `proc`
--

INSERT INTO `proc` VALUES ('mysql','AddGeometryColumn','PROCEDURE','AddGeometryColumn','SQL','CONTAINS_SQL','NO','DEFINER','catalog varchar(64), t_schema varchar(64),\n   t_name varchar(64), geometry_column varchar(64), t_srid int','','begin\n  set @qwe= concat(\'ALTER TABLE \', t_schema, \'.\', t_name, \' ADD \', geometry_column,\' GEOMETRY REF_SYSTEM_ID=\', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end','root@localhost','2018-09-26 02:49:46','2018-09-26 02:49:46','','','utf8','utf8_general_ci','utf8mb4_general_ci','begin\n  set @qwe= concat(\'ALTER TABLE \', t_schema, \'.\', t_name, \' ADD \', geometry_column,\' GEOMETRY REF_SYSTEM_ID=\', t_srid); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end','NONE'),('mysql','DropGeometryColumn','PROCEDURE','DropGeometryColumn','SQL','CONTAINS_SQL','NO','DEFINER','catalog varchar(64), t_schema varchar(64),\n   t_name varchar(64), geometry_column varchar(64)','','begin\n  set @qwe= concat(\'ALTER TABLE \', t_schema, \'.\', t_name, \' DROP \', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end','root@localhost','2018-09-26 02:49:46','2018-09-26 02:49:46','','','utf8','utf8_general_ci','utf8mb4_general_ci','begin\n  set @qwe= concat(\'ALTER TABLE \', t_schema, \'.\', t_name, \' DROP \', geometry_column); PREPARE ls from @qwe; execute ls; deallocate prepare ls; end','NONE'),('te3logex1','purge_db_instance_restart_time','PROCEDURE','purge_db_instance_restart_time','SQL','CONTAINS_SQL','NO','DEFINER','IN day_back int','','BEGIN\n DECLARE del_count  INT;\n\n SET del_count = 1;\n\n WHILE del_count > 0 DO\n\n        DELETE FROM te3logex1.db_instance_restart_time\n        WHERE last_update_time <= (now() - interval day_back day)\n        LIMIT 5000;\n\n        SET del_count = (SELECT ROW_COUNT());\n\n        COMMIT;\n END WHILE;\n\n END','root@localhost','2019-01-21 07:30:55','2019-01-21 07:30:55','NO_ENGINE_SUBSTITUTION','','utf8mb4','utf8mb4_general_ci','utf8mb4_general_ci','BEGIN\n DECLARE del_count  INT;\n\n SET del_count = 1;\n\n WHILE del_count > 0 DO\n\n        DELETE FROM te3logex1.db_instance_restart_time\n        WHERE last_update_time <= (now() - interval day_back day)\n        LIMIT 5000;\n\n        SET del_count = (SELECT ROW_COUNT());\n\n        COMMIT;\n END WHILE;\n\n END','NONE'),('te3logex1','stp_app_to_db_status_retrieve_all_sites','PROCEDURE','stp_app_to_db_status_retrieve_all_sites','SQL','CONTAINS_SQL','NO','DEFINER','\n	\n','','BEGIN\n\n	select adb.project,\n		adb.site,\n		dbi.app_server,\n        adb.instance,\n        dbi.dns_name, dbi.dns_site, dbi.db_type, dbi.db_mode,\n        adb.`status` as conn_status,\n        adb.check_time as last_update_time,\n        -- adb.last_failed_time,\n        \'A\' as record_status,\n        now() as last_sync_time\n    from te3logex1.app_to_db_status adb\n    inner join (\n		select project, site, instance, max(check_time) as max_check_time\n		from te3logex1.app_to_db_status \n        GROUP BY project, site, instance\n	) adb1 on (adb.project = adb1.project and adb.site = adb1.site and adb.instance = adb1.instance and adb.check_time = adb1.max_check_time)\n    inner join \n    (\n		select distinct project, site, instance, app_server, dns_name, dns_site, db_type, db_mode\n		from te3logex1.complete_db_info \n	) dbi on (adb.site = dbi.site and adb.project = dbi.project and adb.instance = dbi.instance)\n    GROUP BY adb.site, adb.project, dbi.app_server, adb.instance, adb.check_time, adb.last_failed_time;\n\n    \nEND','e3logext10@%','2018-11-16 01:45:58','2018-11-16 01:45:58','NO_ENGINE_SUBSTITUTION','','utf8','utf8_general_ci','utf8mb4_general_ci','BEGIN\n\n	select adb.project,\n		adb.site,\n		dbi.app_server,\n        adb.instance,\n        dbi.dns_name, dbi.dns_site, dbi.db_type, dbi.db_mode,\n        adb.`status` as conn_status,\n        adb.check_time as last_update_time,\n        -- adb.last_failed_time,\n        \'A\' as record_status,\n        now() as last_sync_time\n    from te3logex1.app_to_db_status adb\n    inner join (\n		select project, site, instance, max(check_time) as max_check_time\n		from te3logex1.app_to_db_status \n        GROUP BY project, site, instance\n	) adb1 on (adb.project = adb1.project and adb.site = adb1.site and adb.instance = adb1.instance and adb.check_time = adb1.max_check_time)\n    inner join \n    (\n		select distinct project, site, instance, app_server, dns_name, dns_site, db_type, db_mode\n		from te3logex1.complete_db_info \n	) dbi on (adb.site = dbi.site and adb.project = dbi.project and adb.instance = dbi.instance)\n    GROUP BY adb.site, adb.project, dbi.app_server, adb.instance, adb.check_time, adb.last_failed_time;\n\n    \nEND','NONE'),('te3logex1','update_app_to_db_status_report','PROCEDURE','update_app_to_db_status_report','SQL','CONTAINS_SQL','NO','DEFINER','IN syn_timeout int, local_site varchar(5)','','BEGIN\n    DECLARE t_site char(2);\n    DECLARE t_project varchar(7);\n    DECLARE t_app_server varchar(30);\n    DECLARE t_instance varchar(20);\n    DECLARE t_status varchar(7);\n    DECLARE t_check_time datetime;\n\n    DECLARE r_last_status varchar(7);\n    DECLARE r_last_from_time datetime;\n    DECLARE r_last_to_time datetime;\n\n    DECLARE ignore_missing_from_time datetime;\n    DECLARE ignore_missing_to_time datetime;\n\n    DECLARE done INT DEFAULT FALSE;\n    DECLARE cur CURSOR FOR\n        SELECT site, project, app_server, instance, status, check_time\n        FROM tmp_app_to_db_status_report\n        WHERE site = local_site\n        order by site, project, app_server, instance, check_time;\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;\n\n    OPEN cur;\n    read_loop: LOOP\n        FETCH cur INTO t_site, t_project, t_app_server, t_instance, t_status, t_check_time;\n\n        IF done THEN\n            LEAVE read_loop;\n        END IF;\n\n        IF NOT EXISTS (SELECT * FROM app_to_db_status_report\n                       WHERE project = t_project\n                       AND app_server = t_app_server\n                       AND instance = t_instance\n                       AND site = t_site) THEN\n            IF (t_status != \'\') THEN\n            \n                INSERT INTO app_to_db_status_report\n                VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n            END IF;\n        ELSE\n        \n            SELECT status, from_time, to_time\n            INTO r_last_status, r_last_from_time, r_last_to_time\n            FROM app_to_db_status_report\n            WHERE project = t_project\n            AND app_server = t_app_server\n            AND instance = t_instance\n            AND site = t_site\n            AND from_time = (SELECT MAX(from_time)\n                           FROM app_to_db_status_report a1\n                           WHERE a1.project = t_project\n                           AND a1.app_server = t_app_server\n                           AND a1.instance = t_instance\n                           AND a1.site = t_site)\n            LIMIT 1;\n\n            IF (r_last_status = \'OK\') THEN\n                IF (t_status = \'OK\') THEN\n                    \n\n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n                ELSEIF (t_status = \'ERROR\') THEN\n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                    INSERT INTO app_to_db_status_report\n                    VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n\n                ELSE \n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                    INSERT INTO app_to_db_status_report\n                    VALUES (t_site, t_project, t_app_server, t_instance, \'MISSING\', t_check_time, t_check_time);\n\n                END IF;\n\n            ELSEIF (r_last_status = \'ERROR\') THEN\n                IF (t_status = \'OK\') THEN\n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                    INSERT INTO app_to_db_status_report\n                    VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n\n                ELSEIF (t_status = \'ERROR\') THEN\n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                ELSE \n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                    INSERT INTO app_to_db_status_report\n                    VALUES (t_site, t_project, t_app_server, t_instance, \'MISSING\', t_check_time, t_check_time);\n\n                END IF;\n\n            ELSEIF (r_last_status = \'MISSING\') THEN\n                IF (t_status = \'OK\') THEN\n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    IF (TIMESTAMPDIFF(\n                                MINUTE,\n                                DATE_FORMAT(r_last_from_time, \"%Y-%m-%d %H:%i\"),\n                                DATE_FORMAT(t_check_time, \"%Y-%m-%d %H:%i\")\n                                        ) <= 0\n                         OR\n                         (TIME(r_last_from_time) >= TIME(\'23:57:00\') OR\n                          TIME(r_last_from_time) <= TIME(\'00:01:59\'))\n                        ) THEN\n\n                        DELETE FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        SELECT status, from_time, to_time\n                        INTO r_last_status, r_last_from_time, r_last_to_time\n                        FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND site = t_site\n                        AND from_time = (SELECT MAX(from_time)\n                                         FROM app_to_db_status_report a1\n                                         WHERE a1.project = t_project\n                                         AND a1.app_server = t_app_server\n                                         AND a1.site = t_site\n                                         AND a1.instance = t_instance)\n                        LIMIT 1;\n\n\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        IF (r_last_status = \'ERROR\') THEN\n                            INSERT INTO app_to_db_status_report\n                            VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                        END IF;\n                    ELSE\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        INSERT INTO app_to_db_status_report\n                        VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                    END IF;\n\n                ELSEIF (t_status = \'ERROR\') THEN\n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    IF (TIMESTAMPDIFF(\n                                MINUTE,\n                                DATE_FORMAT(r_last_from_time, \"%Y-%m-%d %H:%i\"),\n                                DATE_FORMAT(t_check_time, \"%Y-%m-%d %H:%i\")\n                                        ) <= 0\n                         OR\n                         (TIME(r_last_from_time) >= TIME(\'23:57:00\') OR\n                          TIME(r_last_from_time) <= TIME(\'00:01:59\'))\n                        ) THEN\n\n                        DELETE FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        SELECT status, from_time, to_time\n                        INTO r_last_status, r_last_from_time, r_last_to_time\n                        FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND site = t_site\n                        AND from_time = (SELECT MAX(from_time)\n                               FROM app_to_db_status_report a1\n                               WHERE a1.project = t_project\n                               AND a1.app_server = t_app_server\n                               AND a1.site = t_site\n                               AND a1.instance = t_instance)\n                        LIMIT 1;\n\n\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        IF (r_last_status = \'OK\') THEN\n                            INSERT INTO app_to_db_status_report\n                            VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                        END IF;\n\n                    ELSE\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        INSERT INTO app_to_db_status_report\n                        VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                    END IF;\n\n                ELSE \n                    \n                    \n                    \n                    \n                    IF (TIMESTAMPDIFF(MINUTE, r_last_from_time, t_check_time) >=\n                        syn_timeout) THEN\n                        UPDATE app_to_db_status_report\n                        SET status = \'SYN_ERR\', to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n                    ELSE\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n                    END IF;\n\n                END IF;\n\n            ELSE \n                IF (t_status = \'OK\') THEN\n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    IF (TIMESTAMPDIFF(\n                                MINUTE,\n                                DATE_FORMAT(r_last_from_time, \"%Y-%m-%d %H:%i\"),\n                                DATE_FORMAT(t_check_time, \"%Y-%m-%d %H:%i\")\n                                        ) <= 0) THEN\n                        DELETE FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        SELECT status, from_time, to_time\n                        INTO r_last_status, r_last_from_time, r_last_to_time\n                        FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND site = t_site\n                        AND from_time = (SELECT MAX(from_time)\n                                         FROM app_to_db_status_report a1\n                                         WHERE a1.project = t_project\n                                         AND a1.app_server = t_app_server\n                                         AND a1.site = t_site\n                                         AND a1.instance = t_instance)\n                        LIMIT 1;\n\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        IF (r_last_status = \'ERROR\') THEN\n                            INSERT INTO app_to_db_status_report\n                            VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                        END IF;\n                    ELSE\n                        UPDATE app_to_db_status_report\n                        SET status = \'MISSING\', to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        INSERT INTO app_to_db_status_report\n                        VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                    END IF;\n\n                ELSEIF (t_status = \'ERROR\') THEN\n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    IF (TIMESTAMPDIFF(\n                                MINUTE,\n                                DATE_FORMAT(r_last_from_time, \"%Y-%m-%d %H:%i\"),\n                                DATE_FORMAT(t_check_time, \"%Y-%m-%d %H:%i\")\n                                        ) <= 0) THEN\n\n                        DELETE FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        SELECT status, from_time, to_time\n                        INTO r_last_status, r_last_from_time, r_last_to_time\n                        FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND site = t_site\n                        AND from_time = (SELECT MAX(from_time)\n                                         FROM app_to_db_status_report a1\n                                         WHERE a1.project = t_project\n                                         AND a1.app_server = t_app_server\n                                         AND a1.site = t_site\n                                         AND a1.instance = t_instance)\n                        LIMIT 1;\n\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        IF (r_last_status = \'ERROR\') THEN\n                            INSERT INTO app_to_db_status_report\n                            VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                        END IF;\n                    ELSE\n                        UPDATE app_to_db_status_report\n                        SET status = \'MISSING\', to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        INSERT INTO app_to_db_status_report\n                        VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n\n                    END IF;\n\n                ELSE \n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                END IF;\n\n            END IF;\n        END IF;\n        \n\n    END LOOP;\n\n    CLOSE cur;\nEND','dailyrpt@localhost','2019-01-21 07:18:26','2019-01-21 07:18:26','NO_ENGINE_SUBSTITUTION','','utf8mb4','utf8mb4_general_ci','utf8mb4_general_ci','BEGIN\n    DECLARE t_site char(2);\n    DECLARE t_project varchar(7);\n    DECLARE t_app_server varchar(30);\n    DECLARE t_instance varchar(20);\n    DECLARE t_status varchar(7);\n    DECLARE t_check_time datetime;\n\n    DECLARE r_last_status varchar(7);\n    DECLARE r_last_from_time datetime;\n    DECLARE r_last_to_time datetime;\n\n    DECLARE ignore_missing_from_time datetime;\n    DECLARE ignore_missing_to_time datetime;\n\n    DECLARE done INT DEFAULT FALSE;\n    DECLARE cur CURSOR FOR\n        SELECT site, project, app_server, instance, status, check_time\n        FROM tmp_app_to_db_status_report\n        WHERE site = local_site\n        order by site, project, app_server, instance, check_time;\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;\n\n    OPEN cur;\n    read_loop: LOOP\n        FETCH cur INTO t_site, t_project, t_app_server, t_instance, t_status, t_check_time;\n\n        IF done THEN\n            LEAVE read_loop;\n        END IF;\n\n        IF NOT EXISTS (SELECT * FROM app_to_db_status_report\n                       WHERE project = t_project\n                       AND app_server = t_app_server\n                       AND instance = t_instance\n                       AND site = t_site) THEN\n            IF (t_status != \'\') THEN\n            \n                INSERT INTO app_to_db_status_report\n                VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n            END IF;\n        ELSE\n        \n            SELECT status, from_time, to_time\n            INTO r_last_status, r_last_from_time, r_last_to_time\n            FROM app_to_db_status_report\n            WHERE project = t_project\n            AND app_server = t_app_server\n            AND instance = t_instance\n            AND site = t_site\n            AND from_time = (SELECT MAX(from_time)\n                           FROM app_to_db_status_report a1\n                           WHERE a1.project = t_project\n                           AND a1.app_server = t_app_server\n                           AND a1.instance = t_instance\n                           AND a1.site = t_site)\n            LIMIT 1;\n\n            IF (r_last_status = \'OK\') THEN\n                IF (t_status = \'OK\') THEN\n                    \n\n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n                ELSEIF (t_status = \'ERROR\') THEN\n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                    INSERT INTO app_to_db_status_report\n                    VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n\n                ELSE \n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                    INSERT INTO app_to_db_status_report\n                    VALUES (t_site, t_project, t_app_server, t_instance, \'MISSING\', t_check_time, t_check_time);\n\n                END IF;\n\n            ELSEIF (r_last_status = \'ERROR\') THEN\n                IF (t_status = \'OK\') THEN\n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                    INSERT INTO app_to_db_status_report\n                    VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n\n                ELSEIF (t_status = \'ERROR\') THEN\n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                ELSE \n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                    INSERT INTO app_to_db_status_report\n                    VALUES (t_site, t_project, t_app_server, t_instance, \'MISSING\', t_check_time, t_check_time);\n\n                END IF;\n\n            ELSEIF (r_last_status = \'MISSING\') THEN\n                IF (t_status = \'OK\') THEN\n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    IF (TIMESTAMPDIFF(\n                                MINUTE,\n                                DATE_FORMAT(r_last_from_time, \"%Y-%m-%d %H:%i\"),\n                                DATE_FORMAT(t_check_time, \"%Y-%m-%d %H:%i\")\n                                        ) <= 0\n                         OR\n                         (TIME(r_last_from_time) >= TIME(\'23:57:00\') OR\n                          TIME(r_last_from_time) <= TIME(\'00:01:59\'))\n                        ) THEN\n\n                        DELETE FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        SELECT status, from_time, to_time\n                        INTO r_last_status, r_last_from_time, r_last_to_time\n                        FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND site = t_site\n                        AND from_time = (SELECT MAX(from_time)\n                                         FROM app_to_db_status_report a1\n                                         WHERE a1.project = t_project\n                                         AND a1.app_server = t_app_server\n                                         AND a1.site = t_site\n                                         AND a1.instance = t_instance)\n                        LIMIT 1;\n\n\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        IF (r_last_status = \'ERROR\') THEN\n                            INSERT INTO app_to_db_status_report\n                            VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                        END IF;\n                    ELSE\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        INSERT INTO app_to_db_status_report\n                        VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                    END IF;\n\n                ELSEIF (t_status = \'ERROR\') THEN\n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    IF (TIMESTAMPDIFF(\n                                MINUTE,\n                                DATE_FORMAT(r_last_from_time, \"%Y-%m-%d %H:%i\"),\n                                DATE_FORMAT(t_check_time, \"%Y-%m-%d %H:%i\")\n                                        ) <= 0\n                         OR\n                         (TIME(r_last_from_time) >= TIME(\'23:57:00\') OR\n                          TIME(r_last_from_time) <= TIME(\'00:01:59\'))\n                        ) THEN\n\n                        DELETE FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        SELECT status, from_time, to_time\n                        INTO r_last_status, r_last_from_time, r_last_to_time\n                        FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND site = t_site\n                        AND from_time = (SELECT MAX(from_time)\n                               FROM app_to_db_status_report a1\n                               WHERE a1.project = t_project\n                               AND a1.app_server = t_app_server\n                               AND a1.site = t_site\n                               AND a1.instance = t_instance)\n                        LIMIT 1;\n\n\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        IF (r_last_status = \'OK\') THEN\n                            INSERT INTO app_to_db_status_report\n                            VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                        END IF;\n\n                    ELSE\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        INSERT INTO app_to_db_status_report\n                        VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                    END IF;\n\n                ELSE \n                    \n                    \n                    \n                    \n                    IF (TIMESTAMPDIFF(MINUTE, r_last_from_time, t_check_time) >=\n                        syn_timeout) THEN\n                        UPDATE app_to_db_status_report\n                        SET status = \'SYN_ERR\', to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n                    ELSE\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n                    END IF;\n\n                END IF;\n\n            ELSE \n                IF (t_status = \'OK\') THEN\n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    IF (TIMESTAMPDIFF(\n                                MINUTE,\n                                DATE_FORMAT(r_last_from_time, \"%Y-%m-%d %H:%i\"),\n                                DATE_FORMAT(t_check_time, \"%Y-%m-%d %H:%i\")\n                                        ) <= 0) THEN\n                        DELETE FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        SELECT status, from_time, to_time\n                        INTO r_last_status, r_last_from_time, r_last_to_time\n                        FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND site = t_site\n                        AND from_time = (SELECT MAX(from_time)\n                                         FROM app_to_db_status_report a1\n                                         WHERE a1.project = t_project\n                                         AND a1.app_server = t_app_server\n                                         AND a1.site = t_site\n                                         AND a1.instance = t_instance)\n                        LIMIT 1;\n\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        IF (r_last_status = \'ERROR\') THEN\n                            INSERT INTO app_to_db_status_report\n                            VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                        END IF;\n                    ELSE\n                        UPDATE app_to_db_status_report\n                        SET status = \'MISSING\', to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        INSERT INTO app_to_db_status_report\n                        VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                    END IF;\n\n                ELSEIF (t_status = \'ERROR\') THEN\n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    \n                    IF (TIMESTAMPDIFF(\n                                MINUTE,\n                                DATE_FORMAT(r_last_from_time, \"%Y-%m-%d %H:%i\"),\n                                DATE_FORMAT(t_check_time, \"%Y-%m-%d %H:%i\")\n                                        ) <= 0) THEN\n\n                        DELETE FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        SELECT status, from_time, to_time\n                        INTO r_last_status, r_last_from_time, r_last_to_time\n                        FROM app_to_db_status_report\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND site = t_site\n                        AND from_time = (SELECT MAX(from_time)\n                                         FROM app_to_db_status_report a1\n                                         WHERE a1.project = t_project\n                                         AND a1.app_server = t_app_server\n                                         AND a1.site = t_site\n                                         AND a1.instance = t_instance)\n                        LIMIT 1;\n\n                        UPDATE app_to_db_status_report\n                        SET to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        IF (r_last_status = \'ERROR\') THEN\n                            INSERT INTO app_to_db_status_report\n                            VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n                        END IF;\n                    ELSE\n                        UPDATE app_to_db_status_report\n                        SET status = \'MISSING\', to_time = t_check_time\n                        WHERE project = t_project\n                        AND app_server = t_app_server\n                        AND instance = t_instance\n                        AND status = r_last_status\n                        AND site = t_site\n                        AND from_time = r_last_from_time;\n\n                        INSERT INTO app_to_db_status_report\n                        VALUES (t_site, t_project, t_app_server, t_instance, t_status, t_check_time, t_check_time);\n\n                    END IF;\n\n                ELSE \n                    \n                    UPDATE app_to_db_status_report\n                    SET to_time = t_check_time\n                    WHERE project = t_project\n                    AND app_server = t_app_server\n                    AND instance = t_instance\n                    AND status = r_last_status\n                    AND site = t_site\n                    AND from_time = r_last_from_time;\n\n                END IF;\n\n            END IF;\n        END IF;\n        \n\n    END LOOP;\n\n    CLOSE cur;\nEND','NONE'),('te3logex1','purge_app_to_db_status_history','PROCEDURE','purge_app_to_db_status_history','SQL','CONTAINS_SQL','NO','DEFINER','IN day_back int','','BEGIN\n DECLARE del_count  INT;\n\n SET del_count = 1;\n\n WHILE del_count > 0 DO\n\n        DELETE FROM te3logex1.app_to_db_status_history\n        WHERE check_time <= (now() - interval day_back day)\n        LIMIT 5000;\n\n        SET del_count = (SELECT ROW_COUNT());\n\n        COMMIT;\n END WHILE;\n\n END','root@localhost','2019-01-21 06:16:00','2019-01-21 06:16:00','NO_ENGINE_SUBSTITUTION','','utf8mb4','utf8mb4_general_ci','utf8mb4_general_ci','BEGIN\n DECLARE del_count  INT;\n\n SET del_count = 1;\n\n WHILE del_count > 0 DO\n\n        DELETE FROM te3logex1.app_to_db_status_history\n        WHERE check_time <= (now() - interval day_back day)\n        LIMIT 5000;\n\n        SET del_count = (SELECT ROW_COUNT());\n\n        COMMIT;\n END WHILE;\n\n END','NONE'),('te3logex1','stp_db_instance_restart_time_retrieve_all_sites','PROCEDURE','stp_db_instance_restart_time_retrieve_all_sites','SQL','CONTAINS_SQL','NO','DEFINER','\n	\n','','BEGIN\n\n/*\nHistory:\n20170927 : Handle Unknow logic, should be unknown if 5 mins later\n*/\n\n	DECLARE var_latest_update_time DATETIME;\n    DECLARE var_latest_update_time_remote DATETIME;\n    \n    DECLARE const_interval INT;\n    \n    SET const_interval := -5;\n    \n    SELECT \n		max(last_update_time)\n	INTO \n		var_latest_update_time\n	from te3logex1.db_instance_restart_time \n    LIMIT 1;\n\n/*    \n    SELECT \n		max(last_update_time)\n	INTO \n		var_latest_update_time_remote\n	from te3logex1.complete_db_info_remote \n    LIMIT 1;\n*/    \n\n	select \n		dbi.project,\n		rs.site,\n        rs.instance,\n        dbi.dns_name,\n        dbi.dns_site,\n        rs.restart_time,\n		-- // ***** [START] modified by eddie 20170927\n		-- rs.status as db_status,\n		CASE WHEN rs.status = \'UNKNOWN\' AND rsi.instance IS NULL\n		THEN\n			rs.`status`\n		ELSE\n			rsi.`status`\n		END as db_status,\n		-- // ***** [END] modified by eddie 20170927\n        rs.last_update_time AS last_update_time,\n        now() AS last_sync_time\n    from te3logex1.db_instance_restart_time rs\n	-- // ***** [START] modified by eddie 20170927\n	/*\n		inner join\n		(\n			select site, instance, max(last_update_time) as max_last_update_time\n			from pe3logex1.db_instance_restart_time \n			GROUP BY site, instance\n		) rs1 on (rs.site = rs1.site and rs.instance = rs1.instance and rs.last_update_time = rs1.max_last_update_time)\n	*/\n	LEFT JOIN \n	(\n		SELECT rs1.instance, rs1.`status`, max(rs1.last_update_time) AS max_last_update_time\n		FROM te3logex1.db_instance_restart_time rs1\n		WHERE rs1.last_update_time < var_latest_update_time AND rs1.last_update_time >= date_add(var_latest_update_time, interval const_interval minute)\n			 AND rs1.`status` <> \'UNKNOWN\'\n		GROUP BY rs1.instance, rs1.`status`\n	) rsi ON (rs.instance = rsi.instance)\n	-- // ***** [END] modified by eddie 20170927\n    inner join \n    (\n		select distinct site, instance, project, dns_name, dns_site \n        from te3logex1.complete_db_info\n	) dbi on (rs.site = dbi.site and rs.instance = dbi.instance)\n	-- // ***** [START] modified by eddie 20170927\n	WHERE rs.last_update_time = var_latest_update_time\n	-- // ***** [END] modified by eddie 20170927\n\n/*    \n    union all\n    \n    select \n		dbi.project,\n		rs.site,\n        rs.instance,\n        dbi.dns_name,\n        dbi.dns_site,\n        rs.restart_time,\n-- // ***** [START] modified by eddie 20170927\n-- rs.status as db_status,\nCASE WHEN rs.status = \'UNKNOWN\' AND rsi.instance IS NULL\nTHEN\n	rs.`status`\nELSE\n	rsi.`status`\nEND as db_status,\n-- // ***** [END] modified by eddie 20170927\n        rs.last_update_time AS last_update_time,\n        now() AS last_sync_time\n    from pe3logex1.db_instance_restart_time_remote rs\n-- // ***** [START] modified by eddie 20170927\n--     inner join\n--     (\n-- 		select site, instance, max(last_update_time) as max_last_update_time\n-- 		from pe3logex1.db_instance_restart_time_remote \n--         GROUP BY site, instance\n-- 	) rs1 on (rs.site = rs1.site and rs.instance = rs1.instance and rs.last_update_time = rs1.max_last_update_time)\nLEFT JOIN \n(\n	SELECT rs1.instance, rs1.`status`, max(rs1.last_update_time) AS max_last_update_time\n    FROM pe3logex1.db_instance_restart_time_remote rs1\n    WHERE rs1.last_update_time < var_latest_update_time_remote AND rs1.last_update_time >= date_add(var_latest_update_time_remote, interval const_interval minute)\n		 AND rs1.`status` <> \'UNKNOWN\'\n	GROUP BY rs1.instance, rs1.`status`\n) rsi ON (rs.instance = rsi.instance)\n-- // ***** [END] modified by eddie 20170927\n    inner join \n    (\n		select distinct site, instance, project, dns_name, dns_site \n        from pe3logex1.complete_db_info_remote\n	) dbi on (rs.site = dbi.site and rs.instance = dbi.instance)\n-- // ***** [START] modified by eddie 20170927\nWHERE rs.last_update_time = var_latest_update_time_remote;\n-- // ***** [END] modified by eddie 20170927\n\n*/\n;\n\n\nEND','e3logext10@%','2018-11-16 01:46:46','2018-11-16 01:46:46','NO_ENGINE_SUBSTITUTION','','utf8','utf8_general_ci','utf8mb4_general_ci','BEGIN\n\n/*\nHistory:\n20170927 : Handle Unknow logic, should be unknown if 5 mins later\n*/\n\n	DECLARE var_latest_update_time DATETIME;\n    DECLARE var_latest_update_time_remote DATETIME;\n    \n    DECLARE const_interval INT;\n    \n    SET const_interval := -5;\n    \n    SELECT \n		max(last_update_time)\n	INTO \n		var_latest_update_time\n	from te3logex1.db_instance_restart_time \n    LIMIT 1;\n\n/*    \n    SELECT \n		max(last_update_time)\n	INTO \n		var_latest_update_time_remote\n	from te3logex1.complete_db_info_remote \n    LIMIT 1;\n*/    \n\n	select \n		dbi.project,\n		rs.site,\n        rs.instance,\n        dbi.dns_name,\n        dbi.dns_site,\n        rs.restart_time,\n		-- // ***** [START] modified by eddie 20170927\n		-- rs.status as db_status,\n		CASE WHEN rs.status = \'UNKNOWN\' AND rsi.instance IS NULL\n		THEN\n			rs.`status`\n		ELSE\n			rsi.`status`\n		END as db_status,\n		-- // ***** [END] modified by eddie 20170927\n        rs.last_update_time AS last_update_time,\n        now() AS last_sync_time\n    from te3logex1.db_instance_restart_time rs\n	-- // ***** [START] modified by eddie 20170927\n	/*\n		inner join\n		(\n			select site, instance, max(last_update_time) as max_last_update_time\n			from pe3logex1.db_instance_restart_time \n			GROUP BY site, instance\n		) rs1 on (rs.site = rs1.site and rs.instance = rs1.instance and rs.last_update_time = rs1.max_last_update_time)\n	*/\n	LEFT JOIN \n	(\n		SELECT rs1.instance, rs1.`status`, max(rs1.last_update_time) AS max_last_update_time\n		FROM te3logex1.db_instance_restart_time rs1\n		WHERE rs1.last_update_time < var_latest_update_time AND rs1.last_update_time >= date_add(var_latest_update_time, interval const_interval minute)\n			 AND rs1.`status` <> \'UNKNOWN\'\n		GROUP BY rs1.instance, rs1.`status`\n	) rsi ON (rs.instance = rsi.instance)\n	-- // ***** [END] modified by eddie 20170927\n    inner join \n    (\n		select distinct site, instance, project, dns_name, dns_site \n        from te3logex1.complete_db_info\n	) dbi on (rs.site = dbi.site and rs.instance = dbi.instance)\n	-- // ***** [START] modified by eddie 20170927\n	WHERE rs.last_update_time = var_latest_update_time\n	-- // ***** [END] modified by eddie 20170927\n\n/*    \n    union all\n    \n    select \n		dbi.project,\n		rs.site,\n        rs.instance,\n        dbi.dns_name,\n        dbi.dns_site,\n        rs.restart_time,\n-- // ***** [START] modified by eddie 20170927\n-- rs.status as db_status,\nCASE WHEN rs.status = \'UNKNOWN\' AND rsi.instance IS NULL\nTHEN\n	rs.`status`\nELSE\n	rsi.`status`\nEND as db_status,\n-- // ***** [END] modified by eddie 20170927\n        rs.last_update_time AS last_update_time,\n        now() AS last_sync_time\n    from pe3logex1.db_instance_restart_time_remote rs\n-- // ***** [START] modified by eddie 20170927\n--     inner join\n--     (\n-- 		select site, instance, max(last_update_time) as max_last_update_time\n-- 		from pe3logex1.db_instance_restart_time_remote \n--         GROUP BY site, instance\n-- 	) rs1 on (rs.site = rs1.site and rs.instance = rs1.instance and rs.last_update_time = rs1.max_last_update_time)\nLEFT JOIN \n(\n	SELECT rs1.instance, rs1.`status`, max(rs1.last_update_time) AS max_last_update_time\n    FROM pe3logex1.db_instance_restart_time_remote rs1\n    WHERE rs1.last_update_time < var_latest_update_time_remote AND rs1.last_update_time >= date_add(var_latest_update_time_remote, interval const_interval minute)\n		 AND rs1.`status` <> \'UNKNOWN\'\n	GROUP BY rs1.instance, rs1.`status`\n) rsi ON (rs.instance = rsi.instance)\n-- // ***** [END] modified by eddie 20170927\n    inner join \n    (\n		select distinct site, instance, project, dns_name, dns_site \n        from pe3logex1.complete_db_info_remote\n	) dbi on (rs.site = dbi.site and rs.instance = dbi.instance)\n-- // ***** [START] modified by eddie 20170927\nWHERE rs.last_update_time = var_latest_update_time_remote;\n-- // ***** [END] modified by eddie 20170927\n\n*/\n;\n\n\nEND','NONE'),('te3logex1','copy_to_tmp_app_to_db_status_report','PROCEDURE','copy_to_tmp_app_to_db_status_report','SQL','CONTAINS_SQL','NO','DEFINER','IN local_site varchar(5)','','BEGIN\n    DECLARE t_site char(2);\n    DECLARE t_project varchar(7);\n    DECLARE t_app_server varchar(30);\n    DECLARE t_instance varchar(20);\n\n    DECLARE last_status varchar(10);\n    DECLARE last_status_time datetime;\n\n    DECLARE done INT DEFAULT FALSE;\n    DECLARE cur CURSOR FOR\n        SELECT DISTINCT site, project, app_server, instance \n        FROM complete_db_info \n        WHERE site = local_site\n        GROUP BY site, project, app_server, instance;\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;\n\n    OPEN cur;\n    read_loop: LOOP\n        FETCH cur INTO t_site, t_project, t_app_server, t_instance;\n\n        IF done THEN\n            LEAVE read_loop;\n        END IF;\n\n	set last_status = (SELECT status FROM app_to_db_status_report\n			 WHERE site = local_site\n                         AND project = t_project\n                         AND app_server = t_app_server\n                         AND instance = t_instance\n			 ORDER BY to_time DESC\n			 LIMIT 1);\n\n	IF (last_status = \'MISSING\') THEN\n		\n		SET last_status_time = (SELECT MAX(from_time) FROM app_to_db_status_report\n	  		 WHERE site = local_site \n                         AND project = t_project\n                         AND app_server = t_app_server\n                         AND instance = t_instance);\n	ELSE\n		SET last_status_time = (SELECT MAX(to_time) FROM app_to_db_status_report\n                         WHERE site = local_site\n                         AND project = t_project\n                         AND app_server = t_app_server\n                         AND instance = t_instance);\n	END IF;\n\n	IF (last_status_time IS NOT NULL) THEN \n		INSERT INTO tmp_app_to_db_status_report\n        	(site, project, app_server, instance, status, check_time)\n		SELECT site, project, app_server, instance, status, check_time\n        	FROM app_to_db_status_history\n        	WHERE site = local_site\n        	AND project = t_project\n        	AND app_server = t_app_server\n        	AND instance = t_instance\n        	AND check_time >= DATE_FORMAT(last_status_time, \'%Y-%m-%d %H:%i\');\n	ELSE\n		\n		INSERT INTO tmp_app_to_db_status_report\n                (site, project, app_server, instance, status, check_time)\n                SELECT site, project, app_server, instance, status, check_time\n                FROM app_to_db_status_history\n                WHERE site = local_site\n                AND project = t_project\n                AND app_server = t_app_server\n                AND instance = t_instance\n		AND check_time > DATE_SUB(NOW(), INTERVAL 1 HOUR);\n	END IF;\n\n    END LOOP;\n\n    CLOSE cur;\n\n    \n    DELETE FROM tmp_app_to_db_status_report_null\n    WHERE site = local_site;\n\n    INSERT INTO tmp_app_to_db_status_report_null (\n    SELECT * FROM tmp_app_to_db_status_report a \n    WHERE a.status = \'\'\n    AND a.site = local_site\n    AND EXISTS (SELECT b.status FROM tmp_app_to_db_status_report b \n	        WHERE a.site = b.site \n	        AND a.project = b.project \n		AND a.app_server = b.app_server \n		AND a.instance = b.instance \n		AND b.status != \'\'\n		AND DATE_FORMAT(a.check_time, \'%Y-%m-%d %H:%i\') = DATE_FORMAT(b.check_time, \'%Y-%m-%d %H:%i\')\n		)\n    );\n\n    DELETE FROM tmp_app_to_db_status_report \n    WHERE EXISTS (SELECT 1 FROM tmp_app_to_db_status_report_null b\n		  WHERE tmp_app_to_db_status_report.site = b.site\n		  AND tmp_app_to_db_status_report.project = b.project\n		  AND tmp_app_to_db_status_report.app_server = b.app_server\n		  AND tmp_app_to_db_status_report.instance = b.instance\n		  AND tmp_app_to_db_status_report.status = \'\'\n 		  AND b.status = \'\'\n                  AND b.site = local_site\n		  AND tmp_app_to_db_status_report.check_time = b.check_time)\n    AND site = local_site;\n\nEND','dailyrpt@localhost','2019-01-21 07:20:28','2019-01-21 07:20:28','NO_ENGINE_SUBSTITUTION','','utf8mb4','utf8mb4_general_ci','utf8mb4_general_ci','BEGIN\n    DECLARE t_site char(2);\n    DECLARE t_project varchar(7);\n    DECLARE t_app_server varchar(30);\n    DECLARE t_instance varchar(20);\n\n    DECLARE last_status varchar(10);\n    DECLARE last_status_time datetime;\n\n    DECLARE done INT DEFAULT FALSE;\n    DECLARE cur CURSOR FOR\n        SELECT DISTINCT site, project, app_server, instance \n        FROM complete_db_info \n        WHERE site = local_site\n        GROUP BY site, project, app_server, instance;\n    DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;\n\n    OPEN cur;\n    read_loop: LOOP\n        FETCH cur INTO t_site, t_project, t_app_server, t_instance;\n\n        IF done THEN\n            LEAVE read_loop;\n        END IF;\n\n	set last_status = (SELECT status FROM app_to_db_status_report\n			 WHERE site = local_site\n                         AND project = t_project\n                         AND app_server = t_app_server\n                         AND instance = t_instance\n			 ORDER BY to_time DESC\n			 LIMIT 1);\n\n	IF (last_status = \'MISSING\') THEN\n		\n		SET last_status_time = (SELECT MAX(from_time) FROM app_to_db_status_report\n	  		 WHERE site = local_site \n                         AND project = t_project\n                         AND app_server = t_app_server\n                         AND instance = t_instance);\n	ELSE\n		SET last_status_time = (SELECT MAX(to_time) FROM app_to_db_status_report\n                         WHERE site = local_site\n                         AND project = t_project\n                         AND app_server = t_app_server\n                         AND instance = t_instance);\n	END IF;\n\n	IF (last_status_time IS NOT NULL) THEN \n		INSERT INTO tmp_app_to_db_status_report\n        	(site, project, app_server, instance, status, check_time)\n		SELECT site, project, app_server, instance, status, check_time\n        	FROM app_to_db_status_history\n        	WHERE site = local_site\n        	AND project = t_project\n        	AND app_server = t_app_server\n        	AND instance = t_instance\n        	AND check_time >= DATE_FORMAT(last_status_time, \'%Y-%m-%d %H:%i\');\n	ELSE\n		\n		INSERT INTO tmp_app_to_db_status_report\n                (site, project, app_server, instance, status, check_time)\n                SELECT site, project, app_server, instance, status, check_time\n                FROM app_to_db_status_history\n                WHERE site = local_site\n                AND project = t_project\n                AND app_server = t_app_server\n                AND instance = t_instance\n		AND check_time > DATE_SUB(NOW(), INTERVAL 1 HOUR);\n	END IF;\n\n    END LOOP;\n\n    CLOSE cur;\n\n    \n    DELETE FROM tmp_app_to_db_status_report_null\n    WHERE site = local_site;\n\n    INSERT INTO tmp_app_to_db_status_report_null (\n    SELECT * FROM tmp_app_to_db_status_report a \n    WHERE a.status = \'\'\n    AND a.site = local_site\n    AND EXISTS (SELECT b.status FROM tmp_app_to_db_status_report b \n	        WHERE a.site = b.site \n	        AND a.project = b.project \n		AND a.app_server = b.app_server \n		AND a.instance = b.instance \n		AND b.status != \'\'\n		AND DATE_FORMAT(a.check_time, \'%Y-%m-%d %H:%i\') = DATE_FORMAT(b.check_time, \'%Y-%m-%d %H:%i\')\n		)\n    );\n\n    DELETE FROM tmp_app_to_db_status_report \n    WHERE EXISTS (SELECT 1 FROM tmp_app_to_db_status_report_null b\n		  WHERE tmp_app_to_db_status_report.site = b.site\n		  AND tmp_app_to_db_status_report.project = b.project\n		  AND tmp_app_to_db_status_report.app_server = b.app_server\n		  AND tmp_app_to_db_status_report.instance = b.instance\n		  AND tmp_app_to_db_status_report.status = \'\'\n 		  AND b.status = \'\'\n                  AND b.site = local_site\n		  AND tmp_app_to_db_status_report.check_time = b.check_time)\n    AND site = local_site;\n\nEND','NONE');

--
-- Table structure for table `procs_priv`
--

CREATE TABLE `procs_priv` (
  `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Routine_name` char(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
  `Routine_type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') COLLATE utf8_bin NOT NULL,
  `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
  `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
  KEY `Grantor` (`Grantor`)
) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Procedure privileges';

--
-- Dumping data for table `procs_priv`
--


--
-- Table structure for table `proxies_priv`
--

CREATE TABLE `proxies_priv` (
  `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Proxied_user` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
  `With_grant` tinyint(1) NOT NULL DEFAULT 0,
  `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`),
  KEY `Grantor` (`Grantor`)
) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='User proxy privileges';

--
-- Dumping data for table `proxies_priv`
--

INSERT INTO `proxies_priv` VALUES ('localhost','root','','',1,'','2018-09-26 02:49:46'),('ttis-applog1.egisdctr.hksarg','root','','',1,'','2018-09-26 02:49:46');

--
-- Table structure for table `roles_mapping`
--

CREATE TABLE `roles_mapping` (
  `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Admin_option` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  UNIQUE KEY `Host` (`Host`,`User`,`Role`)
) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Granted roles';

--
-- Dumping data for table `roles_mapping`
--


--
-- Table structure for table `servers`
--

CREATE TABLE `servers` (
  `Server_name` char(64) NOT NULL DEFAULT '',
  `Host` char(64) NOT NULL DEFAULT '',
  `Db` char(64) NOT NULL DEFAULT '',
  `Username` char(80) NOT NULL DEFAULT '',
  `Password` char(64) NOT NULL DEFAULT '',
  `Port` int(4) NOT NULL DEFAULT 0,
  `Socket` char(64) NOT NULL DEFAULT '',
  `Wrapper` char(64) NOT NULL DEFAULT '',
  `Owner` char(64) NOT NULL DEFAULT '',
  PRIMARY KEY (`Server_name`)
) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='MySQL Foreign Servers table';

--
-- Dumping data for table `servers`
--


--
-- Table structure for table `table_stats`
--

CREATE TABLE `table_stats` (
  `db_name` varchar(64) COLLATE utf8_bin NOT NULL,
  `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
  `cardinality` bigint(21) unsigned DEFAULT NULL,
  PRIMARY KEY (`db_name`,`table_name`)
) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='Statistics on Tables';

--
-- Dumping data for table `table_stats`
--


--
-- Table structure for table `tables_priv`
--

CREATE TABLE `tables_priv` (
  `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Grantor` char(141) COLLATE utf8_bin NOT NULL DEFAULT '',
  `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') CHARACTER SET utf8 NOT NULL DEFAULT '',
  `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
  PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
  KEY `Grantor` (`Grantor`)
) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Table privileges';

--
-- Dumping data for table `tables_priv`
--


--
-- Table structure for table `time_zone`
--

CREATE TABLE `time_zone` (
  `Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N',
  PRIMARY KEY (`Time_zone_id`)
) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Time zones';

--
-- Dumping data for table `time_zone`
--


--
-- Table structure for table `time_zone_leap_second`
--

CREATE TABLE `time_zone_leap_second` (
  `Transition_time` bigint(20) NOT NULL,
  `Correction` int(11) NOT NULL,
  PRIMARY KEY (`Transition_time`)
) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Leap seconds information for time zones';

--
-- Dumping data for table `time_zone_leap_second`
--


--
-- Table structure for table `time_zone_name`
--

CREATE TABLE `time_zone_name` (
  `Name` char(64) NOT NULL,
  `Time_zone_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`Name`)
) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Time zone names';

--
-- Dumping data for table `time_zone_name`
--


--
-- Table structure for table `time_zone_transition`
--

CREATE TABLE `time_zone_transition` (
  `Time_zone_id` int(10) unsigned NOT NULL,
  `Transition_time` bigint(20) NOT NULL,
  `Transition_type_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`Time_zone_id`,`Transition_time`)
) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Time zone transitions';

--
-- Dumping data for table `time_zone_transition`
--


--
-- Table structure for table `time_zone_transition_type`
--

CREATE TABLE `time_zone_transition_type` (
  `Time_zone_id` int(10) unsigned NOT NULL,
  `Transition_type_id` int(10) unsigned NOT NULL,
  `Offset` int(11) NOT NULL DEFAULT 0,
  `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `Abbreviation` char(8) NOT NULL DEFAULT '',
  PRIMARY KEY (`Time_zone_id`,`Transition_type_id`)
) ENGINE=Aria DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Time zone transition types';

--
-- Dumping data for table `time_zone_transition_type`
--


--
-- Temporary table structure for view `user`
--

/*!50001 DROP VIEW IF EXISTS `user`*/;
/*!50001 CREATE TABLE `user` (
  `Host` tinyint NOT NULL,
  `User` tinyint NOT NULL,
  `Password` tinyint NOT NULL,
  `Select_priv` tinyint NOT NULL,
  `Insert_priv` tinyint NOT NULL,
  `Update_priv` tinyint NOT NULL,
  `Delete_priv` tinyint NOT NULL,
  `Create_priv` tinyint NOT NULL,
  `Drop_priv` tinyint NOT NULL,
  `Reload_priv` tinyint NOT NULL,
  `Shutdown_priv` tinyint NOT NULL,
  `Process_priv` tinyint NOT NULL,
  `File_priv` tinyint NOT NULL,
  `Grant_priv` tinyint NOT NULL,
  `References_priv` tinyint NOT NULL,
  `Index_priv` tinyint NOT NULL,
  `Alter_priv` tinyint NOT NULL,
  `Show_db_priv` tinyint NOT NULL,
  `Super_priv` tinyint NOT NULL,
  `Create_tmp_table_priv` tinyint NOT NULL,
  `Lock_tables_priv` tinyint NOT NULL,
  `Execute_priv` tinyint NOT NULL,
  `Repl_slave_priv` tinyint NOT NULL,
  `Repl_client_priv` tinyint NOT NULL,
  `Create_view_priv` tinyint NOT NULL,
  `Show_view_priv` tinyint NOT NULL,
  `Create_routine_priv` tinyint NOT NULL,
  `Alter_routine_priv` tinyint NOT NULL,
  `Create_user_priv` tinyint NOT NULL,
  `Event_priv` tinyint NOT NULL,
  `Trigger_priv` tinyint NOT NULL,
  `Create_tablespace_priv` tinyint NOT NULL,
  `Delete_history_priv` tinyint NOT NULL,
  `ssl_type` tinyint NOT NULL,
  `ssl_cipher` tinyint NOT NULL,
  `x509_issuer` tinyint NOT NULL,
  `x509_subject` tinyint NOT NULL,
  `max_questions` tinyint NOT NULL,
  `max_updates` tinyint NOT NULL,
  `max_connections` tinyint NOT NULL,
  `max_user_connections` tinyint NOT NULL,
  `plugin` tinyint NOT NULL,
  `authentication_string` tinyint NOT NULL,
  `password_expired` tinyint NOT NULL,
  `is_role` tinyint NOT NULL,
  `default_role` tinyint NOT NULL,
  `max_statement_time` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Table structure for table `general_log`
--

CREATE TABLE IF NOT EXISTS `general_log` (
  `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `user_host` mediumtext NOT NULL,
  `thread_id` bigint(21) unsigned NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `command_type` varchar(64) NOT NULL,
  `argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';

--
-- Table structure for table `slow_log`
--

CREATE TABLE IF NOT EXISTS `slow_log` (
  `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),
  `user_host` mediumtext NOT NULL,
  `query_time` time(6) NOT NULL,
  `lock_time` time(6) NOT NULL,
  `rows_sent` int(11) NOT NULL,
  `rows_examined` int(11) NOT NULL,
  `db` varchar(512) NOT NULL,
  `last_insert_id` int(11) NOT NULL,
  `insert_id` int(11) NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `sql_text` mediumtext NOT NULL,
  `thread_id` bigint(21) unsigned NOT NULL,
  `rows_affected` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log';

--
-- Table structure for table `transaction_registry`
--

CREATE TABLE IF NOT EXISTS `transaction_registry` (
  `transaction_id` bigint(20) unsigned NOT NULL,
  `commit_id` bigint(20) unsigned NOT NULL,
  `begin_timestamp` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
  `commit_timestamp` timestamp(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
  `isolation_level` enum('READ-UNCOMMITTED','READ-COMMITTED','REPEATABLE-READ','SERIALIZABLE') COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`transaction_id`),
  UNIQUE KEY `commit_id` (`commit_id`),
  KEY `begin_timestamp` (`begin_timestamp`),
  KEY `commit_timestamp` (`commit_timestamp`,`transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;

--
-- Final view structure for view `user`
--

/*!50001 DROP TABLE IF EXISTS `user`*/;
/*!50001 DROP VIEW IF EXISTS `user`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,'N' AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` */;


