---
# System prepended metadata

title: 重置手冊

---

# 重置手冊


### 0. 確認目標時間區段
```
1670860800 Your time zone: 2022年12月13日星期二 00:00:00 GMT+08:00
1671465600 Your time zone: 2022年12月20日星期二 00:00:00

2022-12-13 00:00:00
2022-12-20 23:59:59
```

### 1. 停止相關 mins_sh/mins_*

### 2. 清除物化跟 local
```
local 相關
    ALTER TABLE data_center.caipiao_bet ON CLUSTER default DELETE WHERE create_time between 1670860800 and 1671465600
    ALTER TABLE data_center.cash ON CLUSTER default DELETE WHERE op_time between 1670860800 and 1671465600
    ALTER TABLE data_center.payment ON CLUSTER default DELETE WHERE pay_time between 1670860800 and 1671465600
    ALTER TABLE data_center.recharge ON CLUSTER default DELETE WHERE create_time between 1670860800 and 1671465600
    ALTER TABLE data_center.list_activity_log ON CLUSTER default DELETE WHERE time between 1670860800 and 1671465600
    ALTER TABLE data_center.list_diamond_log ON CLUSTER default DELETE WHERE create_time between 1670860800 and 1671465600
    ALTER TABLE data_center.list_exchange_log ON CLUSTER default DELETE WHERE create_time between 1670860800 and 1671465600
    ALTER TABLE data_center.list_game_log ON CLUSTER default DELETE WHERE game_time between 1670860800 and 1671465600
    ALTER TABLE data_center.list_game_money_log ON CLUSTER default DELETE WHERE time between 1670860800 and 1671465600
    ALTER TABLE data_center.list_login_log ON CLUSTER default DELETE WHERE create_time between 1670860800 and 1671465600
    ALTER TABLE data_center.list_ticket_log ON CLUSTER default DELETE WHERE create_time between 1670860800 and 1671465600

mv 相關
    ALTER TABLE data_center.mv_d_caipiao_bet ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_game_data ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_game_data_date ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_game_data_pid_type ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_game_data_type ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_list_diamond_log ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_list_exchange_log ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_list_game_log ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_list_login_log ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_recharge ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_cash ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_payment ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_game_data_no_open_channel ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_jbcp_fenghong ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_d_game_data_no_channel ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_caipiao_bet ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_game_data ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_game_data_date ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_game_data_pid_type ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_game_data_type ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_jbcp_fenghong ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_list_diamond_log ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_list_exchange_log ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_list_game_log ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_list_login_log ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_recharge ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_game_data_no_open_channel ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_game_data_no_channel ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_cash ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'
    ALTER TABLE data_center.mv_h_payment ON CLUSTER default DELETE WHERE date_time between '2022-12-13 00:00:00' and '2022-12-20 23:59:59'

```

### 3.清除 mv_m_* 的 ( 可選討論)
```
    ALTER TABLE data_center.mv_m_game_data_pid_type ON CLUSTER default DELETE WHERE date_time between '2022-12-01 00:00:00' and '2023-01-01 23:59:59'
    ALTER TABLE data_center.mv_m_game_data_no_channel ON CLUSTER default DELETE WHERE date_time between '2022-12-01 00:00:00' and '2023-01-01 23:59:59'
    ALTER TABLE data_center.mv_m_game_data_no_open_channel ON CLUSTER default DELETE WHERE date_time between '2022-12-01 00:00:00' and '2023-01-01 23:59:59'
```

### 4. 清除 base ( 可選 )
```
    ALTER TABLE data_center.base_caipiao_bet ON CLUSTER default DELETE WHERE create_time between 1671292800 and 1671379199
    ALTER TABLE data_center.base_cash ON CLUSTER default DELETE WHERE op_time between 1671292800 and 1671379199
    ALTER TABLE data_center.base_payment ON CLUSTER default DELETE WHERE pay_time between 1671292800 and 1671379199
    ALTER TABLE data_center.base_recharge ON CLUSTER default DELETE WHERE create_time between 1671292800 and 1671379199
    ALTER TABLE data_center.base_list_activity_log ON CLUSTER default DELETE WHERE time between 1671292800 and 1671379199
    ALTER TABLE data_center.base_list_diamond_log ON CLUSTER default DELETE WHERE create_time between 1671292800 and 1671379199
    ALTER TABLE data_center.base_list_exchange_log ON CLUSTER default DELETE WHERE create_time between 1671292800 and 1671379199
    ALTER TABLE data_center.base_list_game_log ON CLUSTER default DELETE WHERE game_time between 1671292800 and 1671379199
    ALTER TABLE data_center.base_list_game_money_log ON CLUSTER default DELETE WHERE time between 1671292800 and 1671379199
    ALTER TABLE data_center.base_list_login_log ON CLUSTER default DELETE WHERE create_time between 1671292800 and 1671379199
    ALTER TABLE data_center.base_list_ticket_log ON CLUSTER default DELETE WHERE create_time between 1671292800 and 1671379199
```
### 5. 確認 base_* 數據
``` 
略
```

### 6. 確認 local_* 數據
``` 
略
```
### 7. 確認 mv_* 數據
``` 
略
```

### 8. 查詢任務區段 ( 可選 )

``` 
SELECT * FROM move_task WHERE begintime >= '2022-12-18 00:00:00' AND begintime <= '2022-12-18 23:59:59'
```

### 9. 重置 task_center, 有二個分別是 task, move_task
```
搬移部分
UPDATE move_task SET active = '0',
        activetime = NULL,
        pid = '',
        done = 0 WHERE begintime >= '2022-12-18 00:00:00' AND begintime <= '2022-12-18 23:59:59'

抓取部分
UPDATE task SET active = '0',
        activetime = NULL,
        pid = '',
        done = 0 WHERE begintime >= '2022-12-18 00:00:00' AND begintime <= '2022-12-18 23:59:59'
```
### 10. 回復相關 mins_sh/mins_*
``` 
略
```



