zoukankan      html  css  js  c++  java
  • 案例:PG中事务ID用完

    PG中事务ID用完

    在PG中事务年龄不能超过2^31 (2的31次方),如果超过了,这条数据就会丢失。
    PG中不允许这种情况出现,当事务的年龄离2^31还有1千万的时候,数据库的日志中就会
    有如下告警:

    warning:database "highgo" must be vacuumed within 177000234 trabnsactions
    HINT: To avoid a database shutdown,execute a database-wide VACUUM in "highgo".
    

    如果不处理,当事务的年龄离2^31还有1百万时,数据库服务器出于安全考虑,将会自动
    禁止任何来自任何用户的连接,同时在日志中是如下信息:

    error: database is not accepting commands to avoid wraparound data loss in database "highgo"
    HINT: Stop the postmaster and use a standalone backend to VACUUM in "highgo".
    

    出现这种情况时,只能把数据库启动到单用户模式下,执行VACUUM命令来修复了。

    [highgo@hgdb ~]$ postgres --single
    
    PostgreSQL stand-alone backend 9.5.7
    backend> vacuum freeze table_name; 或者 vacuum full;
    backend> Ctrl + D
    [highgo@hgdb ~]$
    
  • 相关阅读:
    Stream中的map
    项目中的process.bpmn的读-过程
    windows10打开switchHost,提示无修改权限
    Windows10安装node.js
    工作中的小发现
    启动redis
    call apply bin 的区别
    利用promise 让 函数按序执行
    uni-app 小程序
    插件 Generate css tree
  • 原文地址:https://www.cnblogs.com/Alicebat/p/14605293.html
Copyright © 2011-2022 走看看