Забираем бывшего сервера репликации 192 168 10 SELECT action param par

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Забираем с бывшего сервера репликации 192.168.3.10
SELECT `action`, `param`, `params`, `device_id`, `city_id`, `date_start`, `date_end`, `duration` FROM `statistic_prolonged` WHERE YEAR(`date_start`) = 2019 INTO OUTFILE '/Users/lloyd/prolonged.txt';
SELECT `action`, `param`, `params`, `device_id`, `city_id`, `date` FROM `statistic_hit` WHERE YEAR(`date`) = 2019 INTO OUTFILE '/Users/lloyd/hit.txt';
# создаем структуру на новом сервере статистики
CREATE TABLE `statistic_prolonged_partition` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`action` varchar(50) NOT NULL,
`param` varchar(50) NOT NULL,
`params` text,
`device_id` int(11) NOT NULL,
`city_id` int(11) DEFAULT NULL,
`ip` char(39) DEFAULT NULL,
`date_start` datetime NOT NULL,
`date_end` datetime NOT NULL,
`duration` bigint(20) NOT NULL,
PRIMARY KEY (`id`,`date_start`),
KEY `statistic_prolonged_9379346c` (`device_id`),
KEY `statistic_prolonged_c7141997` (`city_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
/*!50100 PARTITION BY RANGE (TO_DAYS(date_start))
(PARTITION y2016m1 VALUES LESS THAN (736329),
PARTITION y2016m2 VALUES LESS THAN (736360),
PARTITION y2016m3 VALUES LESS THAN (736389),
PARTITION y2016m4 VALUES LESS THAN (736420),
PARTITION y2016m5 VALUES LESS THAN (736450),
PARTITION y2016m6 VALUES LESS THAN (736481),
PARTITION y2016m7 VALUES LESS THAN (736511),
PARTITION y2016m8 VALUES LESS THAN (736542),
PARTITION y2016m9 VALUES LESS THAN (736573),
PARTITION y2016m10 VALUES LESS THAN (736603),
PARTITION y2016m11 VALUES LESS THAN (736634),
PARTITION y2016m12 VALUES LESS THAN (736664),
PARTITION y2017m1 VALUES LESS THAN (736695),
PARTITION y2017m2 VALUES LESS THAN (736726),
PARTITION y2017m3 VALUES LESS THAN (736754),
PARTITION y2017m4 VALUES LESS THAN (736785),
PARTITION y2017m5 VALUES LESS THAN (736815),
PARTITION y2017m6 VALUES LESS THAN (736846),
PARTITION y2017m7 VALUES LESS THAN (736876),
PARTITION y2017m8 VALUES LESS THAN (736907),
PARTITION y2017m9 VALUES LESS THAN (736938),
PARTITION y2017m10 VALUES LESS THAN (736968),
PARTITION y2017m11 VALUES LESS THAN (736999),
PARTITION y2017m12 VALUES LESS THAN (737029),
PARTITION y2018m1 VALUES LESS THAN (737060),
PARTITION y2018m2 VALUES LESS THAN (737091),
PARTITION y2018m3 VALUES LESS THAN (737119),
PARTITION y2018m4 VALUES LESS THAN (737150),
PARTITION y2018m5 VALUES LESS THAN (737180),
PARTITION y2018m6 VALUES LESS THAN (737211),
PARTITION y2018m7 VALUES LESS THAN (737241),
PARTITION y2018m8 VALUES LESS THAN (737272),
PARTITION y2018m9 VALUES LESS THAN (737303),
PARTITION y2018m10 VALUES LESS THAN (737333),
PARTITION y2018m11 VALUES LESS THAN (737364),
PARTITION y2018m12 VALUES LESS THAN (737394),
PARTITION y2019m1 VALUES LESS THAN (737425),
PARTITION y2019m2 VALUES LESS THAN (737456),
PARTITION y2019m3 VALUES LESS THAN (737484),
PARTITION y2019m4 VALUES LESS THAN (737515),
PARTITION y2019m5 VALUES LESS THAN (737545),
PARTITION y2019m6 VALUES LESS THAN (737576),
PARTITION y2019m7 VALUES LESS THAN (737606),
PARTITION y2019m8 VALUES LESS THAN (737637),
PARTITION y2019m9 VALUES LESS THAN (737668),
PARTITION y2019m10 VALUES LESS THAN (737698),
PARTITION y2019m11 VALUES LESS THAN (737729),
PARTITION y2019m12 VALUES LESS THAN (737759),
PARTITION y2020m1 VALUES LESS THAN (737790),
PARTITION y2020m2 VALUES LESS THAN (737821),
PARTITION y2020m3 VALUES LESS THAN (737850),
PARTITION y2020m4 VALUES LESS THAN (737881),
PARTITION y2020m5 VALUES LESS THAN (737911),
PARTITION y2020m6 VALUES LESS THAN (737942),
PARTITION y2020m7 VALUES LESS THAN (737972),
PARTITION y2020m8 VALUES LESS THAN (738003),
PARTITION y2020m9 VALUES LESS THAN (738034),
PARTITION y2020m10 VALUES LESS THAN (738064),
PARTITION y2020m11 VALUES LESS THAN (738095),
PARTITION y2020m12 VALUES LESS THAN (738125)) */;
CREATE TABLE `statistic_hit_partition` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`action` varchar(50) NOT NULL,
`param` varchar(50) NOT NULL,
`params` text,
`device_id` int(11) NOT NULL,
`city_id` int(11) DEFAULT NULL,
`ip` char(39) DEFAULT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`,`date`),
KEY `statistic_hit_9379346c` (`device_id`),
KEY `statistic_hit_c7141997` (`city_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
/*!50100 PARTITION BY RANGE (TO_DAYS(`date`))
(PARTITION y2016m1 VALUES LESS THAN (736329),
PARTITION y2016m2 VALUES LESS THAN (736360),
PARTITION y2016m3 VALUES LESS THAN (736389),
PARTITION y2016m4 VALUES LESS THAN (736420),
PARTITION y2016m5 VALUES LESS THAN (736450),
PARTITION y2016m6 VALUES LESS THAN (736481),
PARTITION y2016m7 VALUES LESS THAN (736511),
PARTITION y2016m8 VALUES LESS THAN (736542),
PARTITION y2016m9 VALUES LESS THAN (736573),
PARTITION y2016m10 VALUES LESS THAN (736603),
PARTITION y2016m11 VALUES LESS THAN (736634),
PARTITION y2016m12 VALUES LESS THAN (736664),
PARTITION y2017m1 VALUES LESS THAN (736695),
PARTITION y2017m2 VALUES LESS THAN (736726),
PARTITION y2017m3 VALUES LESS THAN (736754),
PARTITION y2017m4 VALUES LESS THAN (736785),
PARTITION y2017m5 VALUES LESS THAN (736815),
PARTITION y2017m6 VALUES LESS THAN (736846),
PARTITION y2017m7 VALUES LESS THAN (736876),
PARTITION y2017m8 VALUES LESS THAN (736907),
PARTITION y2017m9 VALUES LESS THAN (736938),
PARTITION y2017m10 VALUES LESS THAN (736968),
PARTITION y2017m11 VALUES LESS THAN (736999),
PARTITION y2017m12 VALUES LESS THAN (737029),
PARTITION y2018m1 VALUES LESS THAN (737060),
PARTITION y2018m2 VALUES LESS THAN (737091),
PARTITION y2018m3 VALUES LESS THAN (737119),
PARTITION y2018m4 VALUES LESS THAN (737150),
PARTITION y2018m5 VALUES LESS THAN (737180),
PARTITION y2018m6 VALUES LESS THAN (737211),
PARTITION y2018m7 VALUES LESS THAN (737241),
PARTITION y2018m8 VALUES LESS THAN (737272),
PARTITION y2018m9 VALUES LESS THAN (737303),
PARTITION y2018m10 VALUES LESS THAN (737333),
PARTITION y2018m11 VALUES LESS THAN (737364),
PARTITION y2018m12 VALUES LESS THAN (737394),
PARTITION y2019m1 VALUES LESS THAN (737425),
PARTITION y2019m2 VALUES LESS THAN (737456),
PARTITION y2019m3 VALUES LESS THAN (737484),
PARTITION y2019m4 VALUES LESS THAN (737515),
PARTITION y2019m5 VALUES LESS THAN (737545),
PARTITION y2019m6 VALUES LESS THAN (737576),
PARTITION y2019m7 VALUES LESS THAN (737606),
PARTITION y2019m8 VALUES LESS THAN (737637),
PARTITION y2019m9 VALUES LESS THAN (737668),
PARTITION y2019m10 VALUES LESS THAN (737698),
PARTITION y2019m11 VALUES LESS THAN (737729),
PARTITION y2019m12 VALUES LESS THAN (737759),
PARTITION y2020m1 VALUES LESS THAN (737790),
PARTITION y2020m2 VALUES LESS THAN (737821),
PARTITION y2020m3 VALUES LESS THAN (737850),
PARTITION y2020m4 VALUES LESS THAN (737881),
PARTITION y2020m5 VALUES LESS THAN (737911),
PARTITION y2020m6 VALUES LESS THAN (737942),
PARTITION y2020m7 VALUES LESS THAN (737972),
PARTITION y2020m8 VALUES LESS THAN (738003),
PARTITION y2020m9 VALUES LESS THAN (738034),
PARTITION y2020m10 VALUES LESS THAN (738064),
PARTITION y2020m11 VALUES LESS THAN (738095),
PARTITION y2020m12 VALUES LESS THAN (738125)) */;
# загружаем данные
LOAD DATA INFILE '/Users/lloyd/prolonged.txt' INTO TABLE `statistic_prolonged_partition` (`action`, `param`, `params`, `device_id`, `city_id`, `date_start`, `date_end`, `duration`);
LOAD DATA INFILE '/Users/lloyd/hit.txt' INTO TABLE `statistic_hit_partition` (`action`, `param`, `params`, `device_id`, `city_id`, `date`);