自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 postgresql 异步流复制

上篇http://blog.csdn.net/yibei8811/article/details/46650925主库配置wal_level必须为hot_standby其他至pg_basebackup 没有区别备库配置修改postgresql.confhot_standby=onrecovery.conf   默认生成的就可以用,从配置文件中看出,上一步的归档估

2015-06-26 16:29:34 341

原创 postgresql归档备份

主库配置修改pg_hba.conflocal replication postgres trusthost replication postgres 127.0.0.1/32 trusthost replication postgres :

2015-06-26 16:11:06 1095

原创 一次有关pg_depend 错误处理

http://blog.csdn.net/yibei8811/article/details/46623253上篇算是比较详细的说明了pg_depend表的含义。本篇记录一次有关的问题处理。执行:drop schema public cascade出错返回:ERROR: cache lookup failed for relation 24662********** 错误 **

2015-06-24 17:19:53 1974 1

原创 postgres中pg_depend表实验性分析

名字类型引用描述classidoidpg_class.oid有倚赖对象所在系统表的 OIDobjidoid任意 OID 属性指定的依赖对象的 OIDobjsubidint4 对于表字段,这个是该属性的字段数(objid和classid 引用表本身)

2015-06-24 16:17:09 858

原创 postgresql pg_dump备份测试

pg_dump postgres --备份postgres库输出内容到屏幕pg_dump postgres -f 1.sql -- -f参数表示输出到1.sqlpg_dump postgres > 1.sql -- 使用shell ‘>’符号等效上面一行命令由于没有指定备份方式,

2015-06-23 17:49:03 569

原创 centos7下开机启动 postgres开机启动

#!/bin/bash# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES## It is highly advisable to create own systemd services or udev rules# to run scripts during boot instead of using this file.## In cons

2015-06-22 17:16:05 2557

原创 Centos7下systemctl status postgresql 命令相关研究

postgres有源码安装,yum安装,或者下载包自己rpm,安装方法众多。以前一台yum安装postgres的机器设置了  systemctl enable postgresql 这样postgresql就可以开机自启动了。我测试了源码安装,并不支持这个命令。可见,yum安装包偷偷的对systemctl命令进行了一些注册相关的操作?那么研究一下,执行[root@db222

2015-06-22 14:17:44 4459

原创 postgres CENTOS7 上防火墙问题。

依稀记得第一次连接不上数据库的时候执行iptables -F 清除防火墙规则这次服务器重启后又不能正常连接数据库了执行如下命令解决service iptables status service firewalld statussystemctl stop firewalld.service --停止防火墙systemctl disable fire

2015-06-18 16:29:14 729

原创 postgresql 日志配置

log_destination = 'csvlog' --csv模式输出logging_collector = on --收集日志打开log_directory = 'pg_log' --输出日期的陌路log_filename = 'postgresql-%u.log'

2015-06-18 16:09:55 454

原创 linux下日期表示法~

书中写到以下表示只保留7天的日志log_filename='postgresql-%a.log' 意味着 a%可以替换为周一到周日可惜看到书后面居然又来了一段最多保存一周log_filename='postgresql-%u.log'意味着u%也是替换为周一到周日好吧,我才疏学浅,加上书中勘误也有一些,本以为又是一个错误。翻阅了 数据库文档中日期相关的匹配方式,

2015-06-18 16:00:41 425

原创 postgres执行计划 seqscan,indexscan,bitmapscan实验性分析

执行以下代码create table t1(c1 int4);insert into t1 select generate_series(1,10);explain analyze select * from t1 where c1 =4显示为"Seq Scan on t1 (cost=0.00..40.00 rows=12 width=4) (actual time=0.007.

2015-06-16 13:09:55 10058 2

原创 postgres row_number()分析

今天看唐成书看到一段语句不明白什么意思select row_number() over (partition by id),ctid from t以前依稀记得 见过  over( partiontion by  xxx) 类似的语法,但是工作中还未发现有什么sql会写不出来,以为自己用不到,居然没太关注。不过书上别人这么写了,要是看不懂还是显得略微丢人了。所以细细分析如下。执行脚本

2015-06-15 14:14:19 1805

原创 oom_adj分析

postgres 大表merge join的时候占用了大量的work

2015-06-11 16:55:49 1707

原创 ssh长时间不用连接中断。

连接中断问题修改 /etc/ssh/sshd_configClientAliveInterval 60ClientAliveCountMax 3service sshd restart另外有时候会遇到连接缓慢的问题查找资料可能需要修改GSSAPIAuthenticationUseDNS另外关于  tcpkeepAlive 直接摘录如下。

2015-06-11 09:43:59 609

原创 linux合并文件并替换

cat  * >> 1.csv  所有文件追加入 1.csvcat * >    1.csv  所有文件覆盖入 1.csvsed -i "s/111/222/g" cell.csv   将111替换为222

2015-06-10 16:54:09 577

原创 postgres 引起oom问题的 explain 分析。

work_mem设置为2G!一共16张表采用Merge join方式。Sort Method: 一共使用到3种分别为 并分别统计他们的width!Sort Method: quicksort  Memory:93,37,77,61,101,45,61,53Sort Method: external sort  Disk: 117,125,125,117Sort Method

2015-06-10 14:43:09 927

原创 postgres OOM相关问题

测试一组copy数据数据量比较大,调整work_mem为8G连续失败多次。查找原因一直没找到。结果是触发linux的机制Jun  9 15:54:04 R720 kernel: Out of memory: Kill process 21275 (postgres) score 647 or sacrifice childJun  9 15:54:04 R720 kerne

2015-06-09 18:09:21 383

原创 centos下postgres源码编译

基于唐成的postgresSQL相同操作不在累述。选择CentOS-7.0-1406-x86_64-Everything.iso。安装版本选择最后一个加上开发工具包。安装完成配置ip网络后cd /etc/sysconfig/network-scriptsvi ifcfg-enp2s0 ONBOOT=yes【编辑为此内容 保证开机连接网卡】安装postgres

2015-06-09 14:52:40 303

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除