
postgresql wal xlog log
数据库人生
专注于数据库
PostgreSQL;Oracle 11G OCA、OCP;OceanBase V2 OBCA、OBCP
展开
-
PostgreSQL的WAL
<<PostgreSQL的WAL(1)–Buffer Cache>><<PostgreSQL的WAL(2)–Write-Ahead Log>><<PostgreSQL的WAL(3)–Checkpoint>><<PostgreSQL的WAL(4)–WAL创建和调优>>转载 2022-03-09 11:27:16 · 150 阅读 · 0 评论 -
如何遏制PostgreSQL WAL的疯狂增长
http://blog.chinaunix.net/uid-20726500-id-5766987.html转载 2022-03-08 14:29:07 · 274 阅读 · 0 评论 -
postgresql 13 的 wal_keep_segments 已经取消,改用 wal_keep_size
os: centos 7.4.1708db: postgresql 13.0-bash-4.2$ psqlpsql (13.0)Type "help" for help.postgres=# select name,setting,unit from pg_settings where name like '%wal_keep_segments%'; name | setting | unit ------+---------+------(0 rows)postgres=# sel原创 2020-09-25 13:58:34 · 3587 阅读 · 0 评论 -
xlog、wal 分析工具 wal2json
os: centos 7.4db: postgresql 10.11版本# cat /etc/centos-releaseCentOS Linux release 7.4.1708 (Core) # # # yum list installed |grep -i postgresqlpostgresql10.x86_64 10.11-2PGDG.rhe...原创 2020-04-26 09:58:45 · 2028 阅读 · 0 评论 -
xlog、wal 分析工具 xlogminer、walminer
os: ubuntu 16.04db: postgresql 10.6该 blog 是 http://postgres.cn/v2/news/viewone/1/417 的实践记录.读者可以看 https://gitee.com/movead/XLogMiner 的说明.翰高公司在postgresql上还有有相当实力的.XlogMiner 是从PostgreSQL的WAL(write ahe...原创 2019-04-02 16:52:09 · 1957 阅读 · 0 评论 -
postgresql 数据库的 xlog、wal 的文件名组成
os: centos 7.4db: postgresql 10.10PG使用无符号64bit整型(uint64)作为日志文件的寻址空间,为了高效管理事务日志文件,PG把日志文件划分为N个大小为16M(默认值)的WAL segment file.版本# cat /etc/centos-releaseCentOS Linux release 7.4.1708 (Core) # # su ...原创 2020-03-21 21:17:29 · 723 阅读 · 0 评论 -
pg_current_xlog_insert_location、pg_current_xlog_location、pg_current_xlog_flush_location的含义
os: centos 7.4 postgresql: 9.6.10最近在看postgresql的管理函数时,看到下面这几个函数,研究了一下:pg_current_xlog_flush_location() pg_lsn Get current transaction log flush locationpg_current_xlog_insert_location() ...原创 2018-08-19 20:51:55 · 1340 阅读 · 0 评论 -
postgresql 9.6 xlog 相关的一些函数
postgresql:9.6xlog 切换select pg_switch_xlog(); xlog 写入WAL buffer位置select pg_current_xlog_insert_location();xlog 写入WAL文件位置select pg_current_xlog_location(); xlog 当前文件名select pg_xlogfile_n...原创 2018-10-22 09:32:46 · 577 阅读 · 0 评论 -
pg_waldump pg_xlogdump 的初步使用
pg_waldump 是 postgres 10.x 之后的命令,对应之前版本的 pg_xlogdump。 postgresql 从 10 版本开始,将所用xlog相关的全部用wal替换了,同时大版本的命名规则也做了调整。实际工作总用户难免会误操作,当寻求用户误操作时间时,基本只能得到一个大概的时间范围。 但是通过pg_waldump可以定位到具体的xid或者lsn,然后使用recover...原创 2018-06-10 14:20:59 · 3871 阅读 · 2 评论 -
postgresql 监控日志的方法
postgresql数据库运行产生的日志都会输出到日志文件里,因此实时监控该文件就可以大致了解到数据库的运行状况。public.sp_gather_pgsql_log_part(pi_time_last integer)这个函数的作用是创建目标机的日志外部表CREATE OR REPLACE FUNCTION public.sp_gather_pgsql_log_part(pi_t...原创 2018-06-22 14:57:44 · 3362 阅读 · 0 评论 -
postgresql 切换 log、xlog日志
切换log: selectpg_rotate_logfile();切换xlog:select pg_switch_xlog();原创 2017-05-26 16:39:48 · 2016 阅读 · 0 评论 -
postgresql 9.1 使用 pg_resetxlog 处理 invalid primary checkpoint record
postgresql 9.1 做异机 pitr 时,可以read only恢复到指定的时间点“recovery stopping before commit of transaction 1413611332, time 2018-02-23 17:00:00.320187+08” “recovery has paused”,,”Execute pg_xlog_replay_resume()...原创 2018-02-24 10:48:30 · 3910 阅读 · 0 评论 -
postgresql lsn/location 获取 wal/xlog 文件名
postgresql 10.x 叫做 wal、lsn postgresql 9.x 叫做 xlog、location在实际应用中经常需要根据 lsn/location 获取 wal/xlog 文件名postgresql 10.xpostgres=# select pg_current_wal_lsn(); pg_current_wal_lsn ----------------...原创 2018-03-07 16:12:57 · 2740 阅读 · 0 评论