磨砺技术珠矶,践行数据之道,追求卓越价值

回到上一级页面: PostgreSQL基础知识与基本操作索引页     回到顶级页面:PostgreSQL索引页

一,从initdb开始,initdb执行结束后,看xlog:

[pgsql@localhost pg_xlog]$ ls -lrt
total
drwx------ pgsql pgsql Aug : archive_status
-rw------- pgsql pgsql Aug :
[pgsql@localhost pg_xlog]$

然后,设置参数为这样:

archive_mode = on               # allows archiving to be done
# (change requires restart)
...
archive_command = 'copy %p "/home/pgsql/archive_log/%f"' # command to use to archive a logfile segment
#archive_timeout = # force a logfile segment switch after this
# number of seconds; disables wal_level = archive # minimal, archive, or hot_standby
# (change requires restart)

二,启动PostgreSQL,然后一直等待...

看xlog是否有变化,等了一个小时以上,没有发现变化。

[pgsql@localhost pg_xlog]$ ls -lrt
total
drwx------ pgsql pgsql Aug : archive_status
-rw------- pgsql pgsql Aug :
[pgsql@localhost pg_xlog]$
[pgsql@localhost pg_xlog]$
[pgsql@localhost pg_xlog]$ ls ../../archive_log
[pgsql@localhost pg_xlog]$

三,关闭PostgreSQL: ./pg_ctl -D ../../DemoDir stop

可以发现,online redo log增加了一个。

[pgsql@localhost ~]$ ls -lrt ./DemoDir/pg_xlog
total 32812
-rw------- 1 pgsql pgsql 16777216 Aug 6 12:48 000000010000000000000001
drwx------ 2 pgsql pgsql 4096 Aug 6 12:48 archive_status
-rw------- 1 pgsql pgsql 16777216 Aug 6 12:48 000000010000000000000002
[pgsql@localhost ~]$ ls -lrt ./archive_log
total 16404
-rw------- 1 pgsql pgsql 16777216 Aug 6 12:48 000000010000000000000001
[pgsql@localhost ~]$

再次开启: ./pg_ctl -D ../../DemoDir start

因为没有什么操作,所以也无变化:

[pgsql@localhost ~]$ ls -lrt ./DemoDir/pg_xlog
total
-rw------- pgsql pgsql Aug :
drwx------ pgsql pgsql Aug : archive_status
-rw------- pgsql pgsql Aug :
[pgsql@localhost ~]$ ls -lrt ./archive_log
total
-rw------- pgsql pgsql Aug :
[pgsql@localhost ~]$

再次关闭:./pg_ctl -D ../../DemoDir stop

[pgsql@localhost ~]$ ls -lrt ./DemoDir/pg_xlog
total
-rw------- pgsql pgsql Aug :
-rw------- pgsql pgsql Aug :
drwx------ pgsql pgsql Aug : archive_status
-rw------- pgsql pgsql Aug :
[pgsql@localhost ~]$ ls -lrt ./archive_log
total
-rw------- pgsql pgsql Aug :
-rw------- pgsql pgsql Aug :
[pgsql@localhost ~]$

四,如果与性中,进行切换log:

postgres=# select pg_switch_xlog();
pg_switch_xlog
----------------
/
( row) postgres=#
[pgsql@localhost ~]$ ls -lrt ./DemoDir/pg_xlog
total
-rw------- pgsql pgsql Aug :
-rw------- pgsql pgsql Aug :
drwx------ pgsql pgsql Aug : archive_status
-rw------- pgsql pgsql Aug :
[pgsql@localhost ~]$ ls -lrt ./archive_log
total
-rw------- pgsql pgsql Aug :
-rw------- pgsql pgsql Aug :
-rw------- pgsql pgsql Aug :
[pgsql@localhost ~]$

回到上一级页面: PostgreSQL基础知识与基本操作索引页     回到顶级页面:PostgreSQL索引页

磨砺技术珠矶,践行数据之道,追求卓越价值

PostgreSQL的xlog实验一的更多相关文章

  1. PostgreSQL基础知识与基本操作索引页

    磨砺技术珠矶,践行数据之道,追求卓越价值 返回顶级页:PostgreSQL索引页 luckyjackgao@gmail.com 本页记录所有本人所写的PostgreSQL的基础知识和基本操作相关文摘和 ...

  2. PostgreSQL Replication之第二章 理解PostgreSQL的事务日志(4)

    2.4 调整检查点和XLOG 目前为止,这一章已经提供深入洞察PostgreSQL如何写入数据,一般来说,XLOG是用来干什么的.考虑到这方面的知识,我们现在可以继续并学习我们能做些什么来使我们的数据 ...

  3. PostgreSQL LIKE 查询效率提升实验<转>

    一.未做索引的查询效率 作为对比,先对未索引的查询做测试 EXPLAIN ANALYZE select * from gallery_map where author = '曹志耘'; QUERY P ...

  4. PostgreSQL PITR实验

    磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面: PostgreSQL基础知识与基本操作索引页     回到顶级页面:PostgreSQL索引页 看PostgreSQL中与PITR相关的设定 ...

  5. PostgreSQL数据库表名的大小写实验

    磨砺技术珠矶,践行数据之道,追求卓越价值回到上一级页面:PostgreSQL基础知识与基本操作索引页    回到顶级页面:PostgreSQL索引页[作者 高健@博客园  luckyjackgao@g ...

  6. PostgreSQL设置事务隔离级别实验

    apple=# begin; BEGIN apple=# set transaction ISOLATION LEVEL read committed ; SET apple=# select * f ...

  7. 对PostgreSQL数据库的hstore类型建立GisT索引的实验

    磨砺技术珠矶,践行数据之道,追求卓越价值回到上一级页面:PostgreSQL基础知识与基本操作索引页    回到顶级页面:PostgreSQL索引页[作者 高健@博客园  luckyjackgao@g ...

  8. PostgreSQL Replication之第十四章 扩展与BDR

    在这一章中,将向您介绍一个全新的技术,成为BDR.双向复制(BDR),在PostgreSQL的世界里,它绝对是一颗冉冉升起的新星.在不久的将来,许多新的东西将会被看到,并且人们可以期待一个蓬勃发展的项 ...

  9. PostgreSQL Replication之扩展与BDR

    在这一章中,将向您介绍一个全新的技术,成为BDR.双向复制(BDR),在PostgreSQL的世界里,它绝对是一颗冉冉升起的新星.在不久的将来,许多新的东西将会被看到,并且人们可以期待一个蓬勃发展的项 ...

随机推荐

  1. 2.CSS使用基础(1)

    目录 一.css颜色的四种表示法 二.使用css 4种方式 三.css注释: 四.CSS Id 和 Class选择器 五.多重样式优先级顺序 六.CSS Backgrounds(背景) 七.CSS T ...

  2. cookie 常用的几种方法

    { setCookie: function(sName, sValue, oExpires, sPath, sDomain, bSecure) { var sCookie = sName + &quo ...

  3. 名词解释:Linux内存管理之RSS和VSZ

    Linux内存管理中不管是top命令还是pmap命令,都会有RSS和VSZ这两个名词,这里解释一下: RSS( Resident Set Size )常驻内存集合大小,表示相应进程在RAM中占用了多少 ...

  4. windows多线程同步

    概述 任何单个应用程序都不能完全使该处理器达到满负荷.当一个线程遇到较长等待时间事件时,同步多线程还允许另一线程中的指令使用所有执行单元.例如,当一个线程发生高速缓存不命中,另一个线程可以继续执行.同 ...

  5. Redis学习---基础学习[all]

    什么是NoSQL型数据库 NoSQL数据库---NoSQL数据库的分类 Redis学习---NoSQL和SQL的区别及使用场景 Redis学习---负载均衡的原理.分类.实现架构,以及使用场景 什么是 ...

  6. Linux tar命令详解

    当你想要压缩一大堆文件时,你得先将这一大堆文件先打成一个包(tar命令),然后再用压缩程序进行压缩(gzip bzip2命令) tar常见命令参数 必要参数有如下: -A 新增压缩文件到已存在的压缩 ...

  7. Linux学习之路-2017/12/25

    三章  命令通配符 .PATH变量 支持多种文本的通配符 通配符                   含义 * 匹配零个或多个字符    ?   匹配任意单个字符 [0-9]   匹配范围内的数字 [ ...

  8. 面向对象课程 - 寒假第三次作业 - C++计算器项目初始部分

    C++计算器项目初始部分 零.项目源文件地址 传送门:calculator 一.项目信息相关: 项目:Calculator 版本:1.0 日期:2016.2.16 实现: 基本的操作界面 对四则运算表 ...

  9. 第一次项目冲刺(Alpha版本)2017/11/19

    一.当天站立式会议 会议内容 1.对数据库的设计的进一步讨论 2.讨论SSH一些配置细节 3.分配今天的任务 二.任务分解图 三.燃尽图 四.心得 1.零散的时间要利用起来,追上计划的进度. 2.在小 ...

  10. DNS Brand

    1) You must add glue records (child nameservers) to your-domain.com from your domain's registrar con ...