2019年1月29日
MySQL常用性能突发事件分析命令: SHOW PROCESSLIST; —当前MySQL数据库的运行的所有线程 INNODB_TRX; — 当前运行的所有事务 INNODB_LOCKS; — 当前出现的锁 INNODB_LOCK_WAITS; — 锁等待的对应关系计 SHOW OPEN TABLES where In_use >0; — 当前打开表 SHOW ENGINE INNODB STATUS \G; —Innodb状态 SHOW STATUS LIKE ‘innodb_row_lock_%'; — 锁性能状态 SQL语句EXPLAIN; — 查询优化器 数据库size查看 -- databases size select table_schema as '……
阅读全文
2019年1月29日
数据库分库调研 Greenplum 更适用于AP场景 PGXL PGXC 社区不活跃,沟通问题反馈时间长。没找到用户群体. 在此基础上发展的有亚信antdb,腾讯tbase。没有那个研发实力,算了吧。 citus 插件方式,无侵入。很多牛X的特性企业版才支持。主要强调多租户。 mycat mysql支派,阿里开源(抛弃)项目。主要是对sql语……
阅读全文
2019年1月29日
介绍 pgwatch2官方 官方演示示例 架构 agent server agent 在被监控的pg上自定义方法,用于收集数据库信息。这些自定义的方法需要依赖需要数据库扩展如pg_stat_statements,plpythonu. server 负责存储收集过来的信息,可以存放在postgres或influxdb中. 并将收集的信息……
阅读全文
2019年1月24日
https://blog.csdn.net/pg_hgdb/article/details/79403651 https://habr.com/en/company/postgrespro/blog/500714/ 表锁 https://www.modb.pro/db/26462 查看被堵塞的任务 select * from pg_locks where not granted; locktype | database | relation | page | tuple | virtualxid | transactionid | classid | objid | objsubid | virtualtransaction | pid | mode | granted | fastpath ----------+----------+----------+------+-------+------------+---------------+---------+-------+----------+--------------------+-----+------+---------+---------- (0 行记录) 查看等待锁信息,是被谁堵塞了 select pg_blocking_pids(pid); pg_blocking_pids ------------------ {} 终止进程 select pg_cancel_backend(pid); # select select pg_terminate_backend(pid); # update insert delete 事务的隔离级别 Postgres 数据库共有三种数据隔离级别。 Read Commit 读看提交 默认级别 在读开始的时候建立数据快照 Repeat Read 可重复读。……
阅读全文
2019年1月24日
PITR Point-in-time recovery https://blog.csdn.net/a964921988/article/details/84957241 https://github.com/digoal/blog/blob/master/201608/20160823_03.md https://github.com/digoal/blog/blob/master/201608/20160823_04.md 依赖条件 历史完整备份 不间断wal日志 以上都可有wal-g 备份系统提供支持 恢复到指定点 指定标签 具体时间点 具体事务 指定标签 recovery.conf recovery_target_action= 'pause' # promote ,shutdown --- 打lable select pg_create_restore_point('my_daily_process_ended'); --- 恢复到指定的lable recovery.conf recovery_target_name = 'my_daily_process_ended' 具体时间 restore_command = 'cp /data/arch/%f %p' # e.g. 'cp /mnt/server/archivedir/%f %p' recovery_target_time = '2020-12-23 09:37:17.010268' recovery_target_inclusive = false recovery_target_timeline = 'latest' 具体事务 restore_command = 'cp /data/arch/%f %p' # e.g. 'cp /mnt/server/archivedir/%f %p' recovery_target_xid = '26897309' recovery_target_inclusive = false……
阅读全文
2019年1月24日
介绍 分区表的诉求在现实的生成中的意义不必多说,pg以前的实现方式多采用触发器,rules实现。数据量上来时性能明显不尽如意。 虽然pg10 ,11 版本在分区表的特性上不断发力。但是性能啥还是不够给力。 pg_pathman 分区表功能在目前的pg版本10.6 中优势还是非常明显的。 在期待pg自身分区表特性的……
阅读全文
2019年1月17日
4k对齐 早期硬盘每个扇区以512字节为标准,新一代硬盘扇区容量为4096个字节,也就是所说的4k扇区。 硬盘标准更新,但操作系统一直使用的是512字节扇区的标准,所以硬盘厂商为了保证兼容性,把4k扇区模拟成512字节扇区。 通常文件系统的块(簇)是512字节的倍数,新的系统基本上都设……
阅读全文
2019年1月14日
NAME memtest-setup - Install Memtest86+ into your GRUB boot loader menu SYNOPSIS memtest-setup [OPTIONS] DESCRIPTION memtest-setup installs Memtest86+ into your GRUB boot loader menu. It supports both GRUB 2 and GRUB Legacy (i.e. GRUB 0.9x). In case of GRUB 2 it installs GRUB 2 template into /etc/grub.d and GRUB 2 config needs to be regenerated manually by running grub2-mkconfig -o /boot/grub2/grub.cfg under root. This is not done automatically because it could overwrite any custom changes in /boot/grub2/grub.cfg. OPTIONS -h, --help Shows help. AUTHOR Jaroslav Škarvada <jskarvad@redhat.com> Manpage author. COPYRIGHT Copyright © 2014 Jaroslav Škarvada Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at your option) any later version published by the Free……
阅读全文