MySQL ddl 的问题现状

在 运维mysql数据库时,我们总会对数据表进行ddl 变更,修改添加字段或者索引,对于mysql 而已,ddl 显然是一个令所有MySQL dba 诟病的一个功能,因为在MySQL中在对表进行ddl时,会锁表,当表比较小比如小于1w上时,对前端影响较小,当时遇到千万级别的表 就会影响前端应用对表的写操作。

 

工作原理:

1、如果存在外键,根据alter-foreign-keys-method参数的值,检测外键相关的表,做相应设置的处理。没有使用 --alter-foreign-keys-method=rebuild_constraints 指定特定的值,该工具不予执行
2、创建一个和源表表结构一样的临时表(_tablename_new),执行alter修改临时表表结构。
3、在原表上创建3个于inser delete update对应的触发器. (用于copy 数据的过程中,在原表的更新操作 更新到新表.)

4、从原表拷贝数据到临时表,拷贝过程中在原表进行的写操作都会更新到新建的临时表
5、修改外键相关的子表,根据修改后的数据,修改外键关联的子表。
6、rename源数据表为old表,把新表rename为源表名,并将old表删除。
7、删除触发器。

执行条件:

1.操作的表必须有主键或则唯一索引,否则报如下错误。

Cannot chunk the original table `test`.`t_driver_allowance_test`: There is no good index and the table is oversized. at /usr/local/bin/pt-online-schema-change line 5486.

2 . 该表不能定义触发器,否则报如下错误。

The table `taotao`.`tttt` has triggers.  This tool needs to create its own triggers, so the table cannot already have triggers.

用法介绍:

pt-online-schema-change --help  查看参数选项

这里有几个参数需要介绍一下:

--dry-run  这个参数不建立触发器,不拷贝数据,也不会替换原表。只是创建和更改新表。

--execute  这个参数的作用和前面工作原理的介绍的一样,会建立触发器,来保证最新变更的数据会影响至新表。注意:如果不加这个参数,这个工具会在执行一些检查后退出。

--critical-load  每次chunk操作前后,会根据show global status统计指定的状态量的变化,默认是统计Thread_running。目的是为了安全,防止原始表上的触发器引起负载过高。这也是为了防止在线DDL对线上的影响。超过设置的阀值,就会终止操作,在线DDL就会中断。提示的异常如上报错信息。

--max-load 选项定义一个阀值,在每次chunk操作后,查看show global status状态值是否高于指定的阀值。该参数接受一个mysql status状态变量以及一个阀值,如果没有给定阀值,则定义一个阀值为为高于当前值的20%。注意这个参数不会像--critical-load终止操作,而只是暂停操作。当status值低于阀值时,则继续往下操作。是暂停还是终止操作这是--max-load和--critical-load的差别。

--charset=utf8连接到MySQL后运行SET NAMES UTF8

--check-replication-filters 检查复制中是否设置了过滤条件,如果设置了,程序将退出

--nocheck-replication-filters 不检查复制中是否设置了过滤条件

--set-vars 设置mysql的变量值

--check-slave-lag 检查主从延迟

例子:

  1. 添加字段

pt-online-schema-change -u root  -p 123456  --alter='add column vid int ' --execute D=taotao,t=tttt --max-load=Threads_connected:650 --critical-load=Threads_running=550 --charset=utf8  --nocheck-replication-filters --set-vars innodb_lock_wait_timeout=30000

  1. 删除字段

pt-online-schema-change -u root  -p 123456  --alter='drop column vid  '  --execute D=taotao,t=tttt --max-load=Threads_connected:650 --critical-load=Threads_running=550 --charset=utf8  --nocheck-replication-filters --set-vars innodb_lock_wait_timeout=30000

  1. 修改字段

pt-online-schema-change -u root  -p 123456  --alter='modify  column sid bigint(25) '  --execute D=taotao,t=tttt --max-load=Threads_connected:650 --critical-load=Threads_running=550 --charset=utf8  --nocheck-replication-filters --set-vars innodb_lock_wait_timeout=30000

  1. 添加索引

pt-online-schema-change -u root  -p 123456  --alter=' add key indx_sid(sid) '  --execute D=taotao,t=tttt --max-load=Threads_connected:650 --critical-load=Threads_running=550 --charset=utf8  --nocheck-replication-filters --set-vars innodb_lock_wait_timeout=30000

  1. 删除索引

pt-online-schema-change -u root  -p 123456  --alter=' drop  key indx_sid '  --execute D=taotao,t=tttt --max-load=Threads_connected:650 --critical-load=Threads_running=550 --charset=utf8  --nocheck-replication-filters --set-vars innodb_lock_wait_timeout=30000

pt-online-schema-change --user=dba_user --password=msds007 -S /app/mysqldata/3306/mysql.sock  --charset=utf8 --no-check-replication-filters --alter "modify HomeworkID bigint(20) AUTO_INCREMENT" --no-drop-old-table D=test,t=wx_edu_homework --alter-foreign-keys-method=rebuild_constraints --print --execute

考虑从库延迟情况 ,意味这要注意这几个选项的设置

  • --max-lag
  • --check-interval
  • --recursion-method
  • --check-slave-lag

pt-online-schema-change --user=dba_user --password=msds007 -S /app/mysqldata/3306/mysql.sock  --charset=utf8 --no-check-replication-filters --alter "modify HomeworkID bigint(20) AUTO_INCREMENT" --no-drop-old-table D=test,t=wx_edu_homework --alter-foreign-keys-method=rebuild_constraints --print --execute --max-lag=1s --check-interval=10s --check-slave-lag=h=192.168.1.121,u=root,p=msds007,P=3306

pt-online-schema-change --user=dba_user --password=msds007 -S /app/mysqldata/3306/mysql.sock  --charset=utf8 --no-check-replication-filters --alter "modify HomeworkID bigint(20) AUTO_INCREMENT" --no-drop-old-table D=test,t=wx_edu_homework --alter-foreign-keys-method=rebuild_constraints --print --execute --max-lag=1s --check-interval=10s --recursion-method=processlist

流程:

1.判断各种参数

2.根据原表"t",创建一个名称为"_t_new"的新表

3.执行ALTER TABLE语句修改新表"_t_new"

4.创建3个触发器,名称格式为pt_osc_库名_表名_操作类型,比如

CREATE TRIGGER `pt_osc_dba_t_del` AFTER DELETE ON `dba`.`t` FOR EACH ROW DELETE IGNORE FROM `dba`.`_t_new` WHERE `dba`.`_t_new`.`id` <=> OLD.`id`

CREATE TRIGGER `pt_osc_dba_t_upd` AFTER UPDATE ON `dba`.`t` FOR EACH ROW REPLACE INTO `dba`.`_t_new` (`id`, `a`, `b`, `c1`) VALUES (NEW.`id`, NEW.`a`, NEW.`b`, NEW.`c1`)

CREATE TRIGGER `pt_osc_dba_t_ins` AFTER INSERT ON `dba`.`t` FOR EACH ROW REPLACE INTO `dba`.`_t_new` (`id`, `a`, `b`, `c1`) VALUES (NEW.`id`, NEW.`a`, NEW.`b`, NEW.`c1`)

5.开始复制数据,比如

INSERT LOW_PRIORITY IGNORE INTO `dba`.`_t_new` (`id`, `a`, `b`, `c1`) SELECT `id`, `a`, `b`, `c1` FROM `dba`.`t` LOCK IN SHARE MODE /*pt-online-schema-change 28014 copy table*/

注意:对原表加共享锁,会阻塞所有排他锁

6.复制完成后,交互原表和新表,执行RENAME命令,如 RENAME TABLE t to _t_old, _t_new to t;

7.删除老表,_t_old

8.删除触发器

9.修改完成

注意:如果异常终止程序,触发器不会自动删除,如果要删除新表,那么要先删除触发器,否则向老表插入数据会因为找不到新表而报错

注意事项:

  1. pt-online-schema-change 在线DDL工具,虽然说不会锁表,但是对性能还是有一定的影响,执行过程中对全表做一次select。这个过程会将buffer_cache中活跃数据全部交换一遍,这就导致活跃数据的请求都要从磁盘获取,导致慢SQL增多,file_reads增大。所以对于大表应在业务低峰期执行该操作
  2. 执行 RENAME 时,你不能有任何锁定的表或活动的事务。你同样也必须有对原初表的 ALTER 和 DROP 权限,以及对新表的 CREATE 和 INSERT 权限。当业务量较大时,修改操作会等待没有数据修改后,执行最后的rename操作。因此,在修改表结构时,应该尽量选择在业务相对空闲时,至少修改表上的数据操作较低时,执行较为妥当。如果在多表更名中,MySQL 遭遇到任何错误,它将对所有被更名的表进行倒退更名,将每件事物退回到最初状态。
  3. 对表的慢查询操作,慢查询还未结束执行osc操作,会报错,超时错误,在创建触发器的时候退出。
  4. 对于主从复制架构。 考虑到主从的一致性,应该在主库上执行pt-online-schema-change操作。

ps:如果在误在从库上执行了pt-online-schema-change操作,未执行完成不要取消,等到执行完成了,在修改成原来的状态。

如果在误在从库上执行了pt-online-schema-change操作,未执行完成取消的话,删除有 pt-online-schema-change在从库上创建的临时表和触发器即可。

####################################################################

在原表上建立三个触发器,如下:
(1)CREATETRIGGER mk_osc_del AFTER DELETE ON $table ” “FOR EACH ROW ”
“DELETE IGNORE FROM $new_table “”WHERE$new_table.$chunk_column = OLD.$chunk_column”;
(2)CREATETRIGGER mk_osc_ins AFTER INSERT ON $table ” “FOR EACH ROW ”
“REPLACEINTO $new_table ($columns) ” “VALUES($new_values)”;
(3)CREATETRIGGER mk_osc_upd AFTER UPDATE ON $table ” “FOR EACH ROW ”
“REPLACE INTO $new_table ($columns) “”VALUES ($new_values)”;

我们可以看到这三个触发器分别对应于INSERT、UPDATE、DELETE三种操作:
(1)mk_osc_del,DELETE操作,我们注意到DELETEIGNORE,当新有数据时,我们才进行操作,也就是说,当在后续导入过程中,如果删除的这个数据还未导入到新表,那么我们可以不在新表执行操作,因为在以后的导入过程中,原表中改行数据已经被删除,已经没有数据,那么他也就不会导入到新表中;
(2)mk_osc_ins,INSERT操作,所有的INSERT INTO全部转换为REPLACEINTO,为了确保数据的一致性,当有新数据插入到原表时,如果触发器还未把原表数据未同步到新表,这条数据已经被导入到新表了,那么我们就可以利用replaceinto进行覆盖,这样数据也是一致的
(3)mk_osc_upd UPDATE操作,所有的UPDATE也转换为REPLACEINTO,因为当跟新的数据的行还未同步到新表时,新表是不存在这条记录的,那么我们就只能插入该条数据,如果已经同步到新表了,那么也可以进行覆盖插入,所有数据与原表也是一致的;
我们也能看出上述的精髓也就这这几条replaceinto操作,正是因为这几条replaceinto才能保证数据的一致性
4、拷贝原表数据到临时表中,在脚本中使用如下语句
INSERT IGNORE INTO $to_table ($columns) ” “SELECT $columns FROM $from_table “”WHERE ($chunks->[$chunkno])”,我们能看到他是通过一些查询(基本为主键、唯一键值)分批把数据导入到新的表中,在导入前,我们能通过参数–chunk-size对每次导入行数进行控制,已减少对原表的锁定时间,并且在导入时,我们能通过—sleep参数控制,在每个chunk导入后与下一次chunk导入开始前sleep一会,sleep时间越长,对于磁盘IO的冲击就越小
5、Rename 原表到old表中,在把临时表Rename为原表,
“RENAME TABLE `$db`.`$tmp_tbl`TO `$db`.`$tbl`”; 在rename过程,其实我们还是会导致写入读取堵塞的,所以从严格意思上说,我们的OSC也不是对线上环境没有一点影响,但由于rename操作只是一个修改名字的过程,也只会修改一些表的信息,基本是瞬间结束,故对线上影响不太大
6、清理以上过程中的不再使用的数据,如OLD表。

pt-online-schema-change --user=bluewhale --password=bluewhale001 -S /tmp/mysqld.3313_sslog.sock --charset=utf8 --no-check-replication-filters --alter "modify id bigint(20) AUTO_INCREMENT" --no-drop-old-table D=susuan,t=edu_user_vip_log --alter-foreign-keys-method=rebuild_constraints --print --execute --max-lag=1s --check-interval=10s

[root@zsyx-wlzj-dbbakrescs8 ~]# pt-online-schema-change --user=bluewhale --password=bluewhale001 -S /tmp/mysqld.3313_sslog.sock --charset=utf8 --no-check-replicatiINCREMENT" --no-drop-old-table D=susuan,t=edu_user_vip_log --alter-foreign-keys-method=rebuild_constraints --print --execute --max-lag=1s --check-interval=10s

No slaves found.  See --recursion-method if host zsyx-wlzj-dbbakrescs8 has slaves.

Not checking slave lag because no slaves were found and --check-slave-lag was not specified.

# A software update is available:

#   * The current version for Percona::Toolkit is 3.0.5

Operation, tries, wait:

copy_rows, 10, 0.25

create_triggers, 10, 1

drop_triggers, 10, 1

swap_tables, 10, 1

update_foreign_keys, 10, 1

No foreign keys reference `susuan`.`edu_user_vip_log`; ignoring --alter-foreign-keys-method.

Altering `susuan`.`edu_user_vip_log`...

Creating new table...

CREATE TABLE `susuan`.`_edu_user_vip_log_new` (

`id` int(10) unsigned NOT NULL AUTO_INCREMENT,

`vip_id` int(10) unsigned DEFAULT '0',

`user_id` int(10) unsigned DEFAULT '0',

`create_time` datetime DEFAULT '1970-01-01 00:00:00',

`duration` int(11) DEFAULT '0',

`type` tinyint(4) DEFAULT '1',

`description` varchar(255) DEFAULT '',

`open_id` varchar(50) DEFAULT NULL COMMENT '微信openid',

PRIMARY KEY (`id`),

KEY `user_id_key` (`user_id`),

KEY `create_time_key` (`create_time`),

KEY `vip_log_index_open_id` (`open_id`) USING BTREE

) ENGINE=InnoDB AUTO_INCREMENT=11719633 DEFAULT CHARSET=utf8

Created new table susuan._edu_user_vip_log_new OK.

Altering new table...

ALTER TABLE `susuan`.`_edu_user_vip_log_new` modify id bigint(20) AUTO_INCREMENT

Altered `susuan`.`_edu_user_vip_log_new` OK.

2018-09-17T20:16:02 Creating triggers...

CREATE TRIGGER `pt_osc_susuan_edu_user_vip_log_del` AFTER DELETE ON `susuan`.`edu_user_vip_log` FOR EACH ROW DELETE IGNORE FROM `susuan`.`_edu_user_vip_log_new` WHERE `susuan`.`_edu_user_vip_log_new`.`id` <=> OLD.`id`

CREATE TRIGGER `pt_osc_susuan_edu_user_vip_log_upd` AFTER UPDATE ON `susuan`.`edu_user_vip_log` FOR EACH ROW REPLACE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) VALUES (NEW.`id`, NEW.`vip_id`, NEW.`user_id`, NEW.`create_time`, NEW.`duration`, NEW.`type`, NEW.`description`, NEW.`open_id`)

CREATE TRIGGER `pt_osc_susuan_edu_user_vip_log_ins` AFTER INSERT ON `susuan`.`edu_user_vip_log` FOR EACH ROW REPLACE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) VALUES (NEW.`id`, NEW.`vip_id`, NEW.`user_id`, NEW.`create_time`, NEW.`duration`, NEW.`type`, NEW.`description`, NEW.`open_id`)

2018-09-17T20:16:02 Created triggers OK.

2018-09-17T20:16:02 Copying approximately 7125398 rows...

INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= ?)) AND ((`id` <= ?)) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= ?)) ORDER BY `id` LIMIT ?, 2 /*next chunk boundary*/

Copying `susuan`.`edu_user_vip_log`:  30% 01:08 remain

Copying `susuan`.`edu_user_vip_log`:  58% 00:43 remain

Copying `susuan`.`edu_user_vip_log`:  78% 00:24 remain

2018-09-17T20:19:01 Copied rows OK.

2018-09-17T20:19:01 Swapping tables...

RENAME TABLE `susuan`.`edu_user_vip_log` TO `susuan`.`_edu_user_vip_log_old`, `susuan`.`_edu_user_vip_log_new` TO `susuan`.`edu_user_vip_log`

2018-09-17T20:19:01 Swapped original and new tables OK.

Not dropping old table because --no-drop-old-table was specified.

2018-09-17T20:19:01 Dropping triggers...

DROP TRIGGER IF EXISTS `susuan`.`pt_osc_susuan_edu_user_vip_log_del`;

DROP TRIGGER IF EXISTS `susuan`.`pt_osc_susuan_edu_user_vip_log_upd`;

DROP TRIGGER IF EXISTS `susuan`.`pt_osc_susuan_edu_user_vip_log_ins`;

2018-09-17T20:19:01 Dropped triggers OK.

Successfully altered `susuan`.`edu_user_vip_log`.

[root@zsyx-wlzj-dbbakrescs8 ~]# cat /data/mysql_3313_sslog/data/zsyx-wlzj-dbbakrescs8.log

/usr/local/mysql/bin/mysqld, Version: 5.6.25-log (Source distribution). started with:

Tcp port: 3313  Unix socket: /tmp/mysqld.3313_sslog.sock

Time                 Id Command    Argument

180917 20:15:59    11 Connect bluewhale@localhost on susuan

11 Query SELECT @@SQL_MODE

11 Query /*!40101 SET NAMES "utf8"*/

11 Query SHOW VARIABLES LIKE 'innodb\_lock_wait_timeout'

11 Query SET SESSION innodb_lock_wait_timeout=1

11 Query SHOW VARIABLES LIKE 'lock\_wait_timeout'

11 Query SET SESSION lock_wait_timeout=60

11 Query SHOW VARIABLES LIKE 'wait\_timeout'

11 Query SET SESSION wait_timeout=10000

11 Query SET @@SQL_QUOTE_SHOW_CREATE = 1/*!40101, @@SQL_MODE='NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION'*/

11 Query SELECT @@server_id /*!50038 , @@hostname*/

12 Connect bluewhale@localhost on susuan

12 Query SELECT @@SQL_MODE

12 Query /*!40101 SET NAMES "utf8"*/

12 Query SHOW VARIABLES LIKE 'innodb\_lock_wait_timeout'

12 Query SET SESSION innodb_lock_wait_timeout=1

12 Query SHOW VARIABLES LIKE 'lock\_wait_timeout'

12 Query SET SESSION lock_wait_timeout=60

12 Query SHOW VARIABLES LIKE 'wait\_timeout'

12 Query SET SESSION wait_timeout=10000

12 Query SET @@SQL_QUOTE_SHOW_CREATE = 1/*!40101, @@SQL_MODE='NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION'*/

12 Query SELECT @@server_id /*!50038 , @@hostname*/

11 Query SHOW VARIABLES LIKE 'wsrep_on'

11 Query SHOW VARIABLES LIKE 'version%'

11 Query SHOW ENGINES

11 Query SHOW VARIABLES LIKE 'innodb_version'

11 Query SELECT @@SERVER_ID

11 Query SHOW GRANTS FOR CURRENT_USER()

11 Query SHOW PROCESSLIST

11 Query SHOW SLAVE HOSTS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query SELECT CONCAT(@@hostname, @@port)

180917 20:16:00    11 Query SHOW VARIABLES

180917 20:16:02    11 Query SHOW TABLES FROM `susuan` LIKE 'edu\_user\_vip\_log'

11 Query SHOW TRIGGERS FROM `susuan` LIKE 'edu\_user\_vip\_log'

11 Query /*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := '', @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */

11 Query USE `susuan`

11 Query SHOW CREATE TABLE `susuan`.`edu_user_vip_log`

11 Query /*!40101 SET @@SQL_MODE := @OLD_SQL_MODE, @@SQL_QUOTE_SHOW_CREATE := @OLD_QUOTE */

11 Query EXPLAIN SELECT * FROM `susuan`.`edu_user_vip_log` WHERE 1=1

11 Query SELECT table_schema, table_name FROM information_schema.key_column_usage WHERE referenced_table_schema='susuan' AND referenced_table_name='edu_user_vip_log'

11 Query SHOW VARIABLES LIKE 'wsrep_on'

11 Query /*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := '', @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */

11 Query USE `susuan`

11 Query SHOW CREATE TABLE `susuan`.`edu_user_vip_log`

11 Query /*!40101 SET @@SQL_MODE := @OLD_SQL_MODE, @@SQL_QUOTE_SHOW_CREATE := @OLD_QUOTE */

11 Query CREATE TABLE `susuan`.`_edu_user_vip_log_new` (

`id` int(10) unsigned NOT NULL AUTO_INCREMENT,

`vip_id` int(10) unsigned DEFAULT '0',

`user_id` int(10) unsigned DEFAULT '0',

`create_time` datetime DEFAULT '1970-01-01 00:00:00',

`duration` int(11) DEFAULT '0',

`type` tinyint(4) DEFAULT '1',

`description` varchar(255) DEFAULT '',

`open_id` varchar(50) DEFAULT NULL COMMENT '微信openid',

PRIMARY KEY (`id`),

KEY `user_id_key` (`user_id`),

KEY `create_time_key` (`create_time`),

KEY `vip_log_index_open_id` (`open_id`) USING BTREE

) ENGINE=InnoDB AUTO_INCREMENT=11719633 DEFAULT CHARSET=utf8

11 Query ALTER TABLE `susuan`.`_edu_user_vip_log_new` modify id bigint(20) AUTO_INCREMENT

11 Query /*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := '', @OLD_QUOTE := @@SQL_QUOTE_SHOW_CREATE, @@SQL_QUOTE_SHOW_CREATE := 1 */

11 Query USE `susuan`

11 Query SHOW CREATE TABLE `susuan`.`_edu_user_vip_log_new`

11 Query /*!40101 SET @@SQL_MODE := @OLD_SQL_MODE, @@SQL_QUOTE_SHOW_CREATE := @OLD_QUOTE */

11 Query CREATE TRIGGER `pt_osc_susuan_edu_user_vip_log_del` AFTER DELETE ON `susuan`.`edu_user_vip_log` FOR EACH ROW DELETE IGNORE FROM `susuan`.`_edu_user_vip_log_new` WHERE `susuan`.`_edu_user_vip_log_new`.`id` <=> OLD.`id`

11 Query CREATE TRIGGER `pt_osc_susuan_edu_user_vip_log_upd` AFTER UPDATE ON `susuan`.`edu_user_vip_log` FOR EACH ROW REPLACE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) VALUES (NEW.`id`, NEW.`vip_id`, NEW.`user_id`, NEW.`create_time`, NEW.`duration`, NEW.`type`, NEW.`description`, NEW.`open_id`)

11 Query CREATE TRIGGER `pt_osc_susuan_edu_user_vip_log_ins` AFTER INSERT ON `susuan`.`edu_user_vip_log` FOR EACH ROW REPLACE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) VALUES (NEW.`id`, NEW.`vip_id`, NEW.`user_id`, NEW.`create_time`, NEW.`duration`, NEW.`type`, NEW.`description`, NEW.`open_id`)

11 Query EXPLAIN SELECT * FROM `susuan`.`edu_user_vip_log` WHERE 1=1

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) ORDER BY `id` LIMIT 1 /*first lower boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX (`PRIMARY`) WHERE `id` IS NOT NULL ORDER BY `id` LIMIT 1 /*key_len*/

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ * FROM `susuan`.`edu_user_vip_log` FORCE INDEX (`PRIMARY`) WHERE `id` >= '1' /*key_len*/

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '1')) ORDER BY `id` LIMIT 999, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '1')) ORDER BY `id` LIMIT 999, 2 /*next chunk boundary*/

11 Query EXPLAIN SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '1')) AND ((`id` <= '1028')) LOCK IN SHARE MODE /*explain pt-online-schema-change 10551 copy nibble*/

11 Query INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '1')) AND ((`id` <= '1028')) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

11 Query SHOW WARNINGS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '1029')) ORDER BY `id` LIMIT 9256, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '1029')) ORDER BY `id` LIMIT 9256, 2 /*next chunk boundary*/

180917 20:16:03    11 Query EXPLAIN SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '1029')) AND ((`id` <= '10304')) LOCK IN SHARE MODE /*explain pt-online-schema-change 10551 copy nibble*/

11 Query INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '1029')) AND ((`id` <= '10304')) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

11 Query SHOW WARNINGS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '10305')) ORDER BY `id` LIMIT 27846, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '10305')) ORDER BY `id` LIMIT 27846, 2 /*next chunk boundary*/

11 Query EXPLAIN SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '10305')) AND ((`id` <= '38151')) LOCK IN SHARE MODE /*explain pt-online-schema-change 10551 copy nibble*/

11 Query INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '10305')) AND ((`id` <= '38151')) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

180917 20:16:04    11 Query SHOW WARNINGS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '38152')) ORDER BY `id` LIMIT 15478, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '38152')) ORDER BY `id` LIMIT 15478, 2 /*next chunk boundary*/

11 Query EXPLAIN SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '38152')) AND ((`id` <= '53630')) LOCK IN SHARE MODE /*explain pt-online-schema-change 10551 copy nibble*/

11 Query INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '38152')) AND ((`id` <= '53630')) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

11 Query SHOW WARNINGS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '53631')) ORDER BY `id` LIMIT 20777, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '53631')) ORDER BY `id` LIMIT 20777, 2 /*next chunk boundary*/

11 Query EXPLAIN SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '53631')) AND ((`id` <= '74408')) LOCK IN SHARE MODE /*explain pt-online-schema-change 10551 copy nibble*/

11 Query INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '53631')) AND ((`id` <= '74408')) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

11 Query SHOW WARNINGS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '74409')) ORDER BY `id` LIMIT 27015, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '74409')) ORDER BY `id` LIMIT 27015, 2 /*next chunk boundary*/

11 Query EXPLAIN SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '74409')) AND ((`id` <= '101424')) LOCK IN SHARE MODE /*explain pt-online-schema-change 10551 copy nibble*/

11 Query INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '74409')) AND ((`id` <= '101424')) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

11 Query SHOW WARNINGS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '101425')) ORDER BY `id` LIMIT 32911, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '101425')) ORDER BY `id` LIMIT 32911, 2 /*next chunk boundary*/

11 Query EXPLAIN SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '101425')) AND ((`id` <= '134336')) LOCK IN SHARE MODE /*explain pt-online-schema-change 10551 copy nibble*/

11 Query INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '101425')) AND ((`id` <= '134336')) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

.................

180917 20:19:00    11 Query SHOW WARNINGS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11572375')) ORDER BY `id` LIMIT 42715, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11572375')) ORDER BY `id` LIMIT 42715, 2 /*next chunk boundary*/

11 Query EXPLAIN SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11572375')) AND ((`id` <= '11615090')) LOCK IN SHARE MODE /*explain pt-online-schema-change 10551 copy nibble*/

11 Query INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11572375')) AND ((`id` <= '11615090')) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

11 Query SHOW WARNINGS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11615091')) ORDER BY `id` LIMIT 43378, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11615091')) ORDER BY `id` LIMIT 43378, 2 /*next chunk boundary*/

11 Query EXPLAIN SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11615091')) AND ((`id` <= '11658469')) LOCK IN SHARE MODE /*explain pt-online-schema-change 10551 copy nibble*/

11 Query INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11615091')) AND ((`id` <= '11658469')) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

180917 20:19:01    11 Query SHOW WARNINGS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11658470')) ORDER BY `id` LIMIT 42505, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11658470')) ORDER BY `id` LIMIT 42505, 2 /*next chunk boundary*/

11 Query EXPLAIN SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11658470')) AND ((`id` <= '11700975')) LOCK IN SHARE MODE /*explain pt-online-schema-change 10551 copy nibble*/

11 Query INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11658470')) AND ((`id` <= '11700975')) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

11 Query SHOW WARNINGS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query EXPLAIN SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11700976')) ORDER BY `id` LIMIT 43373, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11700976')) ORDER BY `id` LIMIT 43373, 2 /*next chunk boundary*/

11 Query SELECT /*!40001 SQL_NO_CACHE */ `id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) ORDER BY `id` DESC LIMIT 1 /*last upper boundary*/

11 Query EXPLAIN SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11700976')) AND ((`id` <= '11719632')) LOCK IN SHARE MODE /*explain pt-online-schema-change 10551 copy nibble*/

11 Query INSERT LOW_PRIORITY IGNORE INTO `susuan`.`_edu_user_vip_log_new` (`id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id`) SELECT `id`, `vip_id`, `user_id`, `create_time`, `duration`, `type`, `description`, `open_id` FROM `susuan`.`edu_user_vip_log` FORCE INDEX(`PRIMARY`) WHERE ((`id` >= '11700976')) AND ((`id` <= '11719632')) LOCK IN SHARE MODE /*pt-online-schema-change 10551 copy nibble*/

11 Query SHOW WARNINGS

11 Query SHOW GLOBAL STATUS LIKE 'Threads_running'

11 Query RENAME TABLE `susuan`.`edu_user_vip_log` TO `susuan`.`_edu_user_vip_log_old`, `susuan`.`_edu_user_vip_log_new` TO `susuan`.`edu_user_vip_log`

11 Query DROP TRIGGER IF EXISTS `susuan`.`pt_osc_susuan_edu_user_vip_log_del`

11 Query DROP TRIGGER IF EXISTS `susuan`.`pt_osc_susuan_edu_user_vip_log_upd`

11 Query DROP TRIGGER IF EXISTS `susuan`.`pt_osc_susuan_edu_user_vip_log_ins`

11 Query SHOW TABLES FROM `susuan` LIKE '\_edu\_user\_vip\_log\_new'

12 Quit

11 Quit

pt-online-schema-change使用的更多相关文章

  1. schema change + ogg 变更手册

    Check OGG  until no data queuing in replication process:testRO:a)login  test5 –l oggmgrb)oggc)#ggsci ...

  2. Online Schema Change for MySQL

    It is great to be able to build small utilities on top of an excellent RDBMS. Thank you MySQL. This ...

  3. AppBoxFuture(四). 随需而变-Online Schema Change

      需求变更是信息化过程中的家常便饭,而在变更过程中如何尽可能小的影响在线业务是比较头疼的事情.举个车联网监控的例子:原终端设备上传车辆的经纬度数据,新的终端设备支持同时上传速度数据,而旧的车辆状态表 ...

  4. Online, Asynchronous Schema Change in F1

    F1: A Distributed SQL Database That Scales   http://disksing.com/understanding-f1-schema-change   ma ...

  5. Online Schema Upgrade in MySQL Galera Cluster using TOI Method

    http://severalnines.com/blog/online-schema-upgrade-mysql-galera-cluster-using-toi-method     As a fo ...

  6. Schema 与数据类型优化

    这是<高性能 MySQL(第三版)>第四章<Schema 与数据类型优化>的读书笔记. 1. 选择优化的数据类型 数据类型的选择原则: 越小越好:选择满足需求的最小类型.注意, ...

  7. Awesome Go精选的Go框架,库和软件的精选清单.A curated list of awesome Go frameworks, libraries and software

    Awesome Go      financial support to Awesome Go A curated list of awesome Go frameworks, libraries a ...

  8. MyCat源码分析系列之——SQL下发

    更多MyCat源码分析,请戳MyCat源码分析系列 SQL下发 SQL下发指的是MyCat将解析并改造完成的SQL语句依次发送至相应的MySQL节点(datanode)的过程,该执行过程由NonBlo ...

  9. SQLite剖析之存储模型

    前言 SQLite作为嵌入式数据库,通常针对的应用的数据量相对于DBMS的数据量小.所以它的存储模型设计得非常简单,总的来说,SQLite把一个数据文件分成若干大小相等的页面,然后以B树的形式来组织这 ...

  10. erlang 分布式数据库Mnesia 实现及应用

    先推荐一篇:mnesia源码分析(yufeng)   - linear hash   ETS/DETS/mnesia 都使用了linear hash算法 http://en.wikipedia.org ...

随机推荐

  1. SQL Server Management Studio 清除用户名和密码

    SQL Server Management Studio 2018 delete the file C:\Users\%username%\AppData\Roaming\Microsoft\SQL  ...

  2. Go语言函数之可变参数

    package main //.... 加参数类型 func Sum(nums ...int)int{ total:=0 for _,num:=range nums{ total+=num } ret ...

  3. 错误Uncaught Error: Bootstrap's JavaScript requires jQuery at bootstrap.min.js:6 错误详解

    引入Bootstrap的顺序进行修改 <% //获取以/开始,不以/结尾的部分 pageContext.setAttribute("APP_PATH", request.ge ...

  4. Activiti数据库支持

    Activiti的后台是有数据库的支持,所有的表都以ACT_开头. 第二部分是表示表的用途的两个字母标识. 用途也和服务的API对应. ACT_RE_*: 'RE'表示repository. 这个前缀 ...

  5. C之自定义类型

    声明自定义数据类型,配合各种原有数据类型来达到简化编程的目的的类型定义关键字. #include<stdio.h> #include<stdlib.h> typedef int ...

  6. C++ STL copy copy_backward

    #include <iostream>#include <algorithm>#include <vector>#include <functional> ...

  7. Git报错: OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

    在使用Git来克隆仓库报了错误,如下: fatal: unable to access ‘https://github.com/xiaobingchan/machine_learn/‘: OpenSS ...

  8. Python3 Selenium自动化web测试 ==> 第十一节 WebDriver高级应用 -- 显示等待 + 二次封装

    学习目的: 掌握显示等待 掌握二次封装 正式步骤: step1:显示等待的代码示例 # -*- coding:utf-8 -*- from selenium import webdriver from ...

  9. nrpe command

    1. nrpe 连接问题: 报错:/usr/local/nagios/libexec/check_nrpe  -H  destip   ;   CHECK_NRPE: Error - Could no ...

  10. VSCode 怎么运行代码

    VSCode 怎么运行代码,集成终端和资源管理器也有互动.比如我们打开了一个脚本文件,希望直接执行这个脚本文件,就可以打开命令面板,运行 “在活动终端中运行活动文件”(Run Active File ...