01 2020 档案
摘要:主:192.168.1.130 从:192.168.1.131 1、主备库进程查看主库[postgres@localhost data]$ pg_controldata /opt/postgresql-11.6/data/| grep 'Database cluster state'Database
阅读全文
摘要:环境:OS:CentOs 7Postgres-11.61.安装步骤1.1 环境部署数据库部署节点 ip 角色Host01 192.168.1.130 主Host02 192.168.1.131 从1.2 配置等效连接因为我们需要将主库的归档日志通过scp免密传输到备库等效连接配置可以参考https:
阅读全文
摘要:配置等效连接host1 :192.168.216.150host2 :192.168.216.151host3 :192.168.216.152A.配置 host1 与 host2 的等效连接步骤1.host1:192.168.216.150[mysql@host1]$ mkdir ~/.ssh[m
阅读全文
摘要:环境: Centos 7 postgresql:11.6 1.查找相关介质yum search pgagent[root@localhost yum.repos.d]# yum -y install pgagent_11.x86_642..在数据库上配置pgAgent找到pgagent.sql和pg
阅读全文
摘要:环境: Centos 7 1.下载阿里的 repo 资源配置[root@pgadmin ~]# cd /etc/yum.repos.d/[root@pgadmin yum.repos.d]# wget https://mirrors.aliyun.com/repo/epel-7.repo2.安装 p
阅读全文
摘要:PostgreSQL的流复制的原理是通过传递主机(master)上的wal日志信息到备机(slave)然后恢复,这中间就有一个潜在的问题,如果主机端比较忙,wal日志被覆盖了,而从机可能因为网络或者其他原因没有接收到该日志,就会造成主从不一致requested WAL segment 0000000
阅读全文
摘要:insert_data.sh脚本如下: #!/bin/bashpsql -U uhxl -h localhost -d hxl << EOFselect sp_insert_data();EOF #pg生成测试数据*/40 * * * * /home/postgres/scripts/insert_
阅读全文
摘要:环境:OS:CentOs 7Postgres-11.6 源码编译 1.2 主库安装 1.2.1 安装介质准备下载地址: https://www.postgresql.org/ftp/source/我这里下载的是11.6版本,介质如下:postgresql-11.6.tar.gz这里下载的源码,所以下
阅读全文
摘要:CREATE OR REPLACE FUNCTION sp_insert_data() RETURNS integer AS $total$ declare total integer; i integer := 1;BEGIN insert into tb_test(name) values('n
阅读全文
摘要:1.创建用户并将某个数据库的属主修改为该用户 create user uhxl;alter user uhxl with password 'uhxl';alter user uhxl with CONNECTION LIMIT 20;alter database hxl owner to uhxl
阅读全文
摘要:1.下载源码介质下载地址:源码下载地址: https://www.postgresql.org/ftp/source/ 二进制下载地址:https://www.enterprisedb.com/download-postgresql-binaries 我这里下载的介质是: postgresql-11
阅读全文