How about xlogs are missing and xlogs are deleted
[postgres@minion1 bin]$ pwd
/usr/local/pgtest/bin
[postgres@minion1 bin]$ ./pg_ctl -D ../data/ start
server starting
[postgres@minion1 bin]$ LOG: database system was shut down at 2016-02-04 16:26:41 CST
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
[postgres@minion1 bin]$ ./pgbench -i -F 100 -s 714 -h 127.0.0.1 -p 5432 -U postgres -d postgres
[postgres@minion1 bin]$ ./psql -h localhost -U postgres -d postgres
psql (9.4.5)
Type "help" for help.
postgres=# \d+
List of relations
Schema | Name | Type | Owner | Size | Description
--------+------------------+-------+----------+---------+-------------
public | pgbench_accounts | table | postgres | 9147 MB |
public | pgbench_branches | table | postgres | 64 kB |
public | pgbench_history | table | postgres | 0 bytes |
public | pgbench_tellers | table | postgres | 344 kB |
(4 rows)
postgres=# \q
[postgres@minion1 bin]$ ./pg_controldata
pg_control version number: 942
Catalog version number: 201409291
Database system identifier: 6247349441268682644
Database cluster state: in production
pg_control last modified: Thu 04 Feb 2016 04:46:33 PM CST
Latest checkpoint location: 0/56A5CA8
Prior checkpoint location: 0/56A5C40
Latest checkpoint's REDO location: 0/56A5CA8
Latest checkpoint's REDO WAL file: 000000010000000000000005
Latest checkpoint's TimeLineID: 1
Latest checkpoint's PrevTimeLineID: 1
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID: 0/1825
Latest checkpoint's NextOID: 16403
Latest checkpoint's NextMultiXactId: 1
Latest checkpoint's NextMultiOffset: 0
Latest checkpoint's oldestXID: 1801
Latest checkpoint's oldestXID's DB: 1
Latest checkpoint's oldestActiveXID: 0
Latest checkpoint's oldestMultiXid: 1
Latest checkpoint's oldestMulti's DB: 1
Time of latest checkpoint: Thu 04 Feb 2016 04:40:58 PM CST
Fake LSN counter for unlogged rels: 0/1
Minimum recovery ending location: 0/0
Min recovery ending loc's timeline: 0
Backup start location: 0/0
Backup end location: 0/0
End-of-backup record required: no
Current wal_level setting: minimal
Current wal_log_hints setting: off
Current max_connections setting: 100
Current max_worker_processes setting: 8
Current max_prepared_xacts setting: 0
Current max_locks_per_xact setting: 64
Maximum data alignment: 8
Database block size: 8192
Blocks per segment of large relation: 131072
WAL block size: 8192
Bytes per WAL segment: 16777216
Maximum length of identifiers: 64
Maximum columns in an index: 32
Maximum size of a TOAST chunk: 1996
Size of a large-object chunk: 2048
Date/time type storage: 64-bit integers
Float4 argument passing: by value
Float8 argument passing: by value
Data page checksum version: 0
[postgres@minion1 pg_xlog]$ ll
total 81M
-rw------- 1 postgres postgres 16M Feb 4 16:40 000000010000000000000005
-rw------- 1 postgres postgres 16M Feb 4 16:34 000000010000000000000006
-rw------- 1 postgres postgres 16M Feb 4 16:34 000000010000000000000007
-rw------- 1 postgres postgres 16M Feb 4 16:34 000000010000000000000008
-rw------- 1 postgres postgres 16M Feb 4 16:34 000000010000000000000009
drwx------ 2 postgres postgres 4.0K Feb 4 16:26 archive_status
[postgres@minion1 pg_xlog]$ rm -rf 00000001000000000000000*
[postgres@minion1 pg_xlog]$ ls
archive_status
[postgres@minion1 pg_xlog]$ cd -
/usr/local/pgtest/bin
[postgres@minion1 bin]$ ./pg_ctl -D ../data/ stop -m fast
waiting for server to shut down....LOG: received fast shutdown request
LOG: aborting any active transactions
LOG: autovacuum launcher shutting down
LOG: shutting down
LOG: database system is shut down
done
server stopped
[postgres@minion1 bin]$ ./pg_ctl -D ../data/ start
server starting
[postgres@minion1 bin]$ LOG: database system was shut down at 2016-02-04 16:50:58 CST
LOG: invalid magic number 0000 in log segment 000000010000000000000005, offset 0
LOG: invalid primary checkpoint record
LOG: invalid magic number 0000 in log segment 000000010000000000000005, offset 0
LOG: invalid secondary checkpoint record
PANIC: could not locate a valid checkpoint record
LOG: startup process (PID 2959) was terminated by signal 6: Aborted
LOG: aborting startup due to startup process failure
[postgres@minion1 bin]$ ./pg_resetxlog --help
pg_resetxlog resets the PostgreSQL transaction log.
Usage:
pg_resetxlog [OPTION]... DATADIR
Options:
-e XIDEPOCH set next transaction ID epoch
-f force update to be done
-l XLOGFILE force minimum WAL starting location for new transaction log
-m MXID,MXID set next and oldest multitransaction ID
-n no update, just show what would be done (for testing)
-o OID set next OID
-O OFFSET set next multitransaction offset
-V, --version output version information, then exit
-x XID set next transaction ID
-?, --help show this help, then exit
Report bugs to <pgsql-bugs@postgresql.org>.
[postgres@minion1 bin]$ ./pg_resetxlog -o 16403 -x 1825 -f /usr/local/pgtest/data/
Transaction log reset
[postgres@minion1 bin]$ ./pg_ctl -D ../data/ start
server starting
[postgres@minion1 bin]$ LOG: database system was shut down at 2016-02-04 16:55:44 CST
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
[postgres@minion1 bin]$ ./psql -h localhost -U postgres -d postgres
psql (9.4.5)
Type "help" for help.
postgres=# \d+
List of relations
Schema | Name | Type | Owner | Size | Description
--------+------------------+-------+----------+---------+-------------
public | pgbench_accounts | table | postgres | 9147 MB |
public | pgbench_branches | table | postgres | 64 kB |
public | pgbench_history | table | postgres | 0 bytes |
public | pgbench_tellers | table | postgres | 344 kB |
(4 rows)
[postgres@minion1 bin]$ ./pg_controldata
pg_control version number: 942
Catalog version number: 201409291
Database system identifier: 6247349441268682644
Database cluster state: in production
pg_control last modified: Thu 04 Feb 2016 04:56:11 PM CST
Latest checkpoint location: 0/6000028
Prior checkpoint location: 0/0
Latest checkpoint's REDO location: 0/6000028
Latest checkpoint's REDO WAL file: 000000010000000000000006
Latest checkpoint's TimeLineID: 1
Latest checkpoint's PrevTimeLineID: 1
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID: 0/1825
Latest checkpoint's NextOID: 16403
Latest checkpoint's NextMultiXactId: 1
Latest checkpoint's NextMultiOffset: 0
Latest checkpoint's oldestXID: 2294969121
Latest checkpoint's oldestXID's DB: 0
Latest checkpoint's oldestActiveXID: 0
Latest checkpoint's oldestMultiXid: 1
Latest checkpoint's oldestMulti's DB: 1
Time of latest checkpoint: Thu 04 Feb 2016 04:55:44 PM CST
Fake LSN counter for unlogged rels: 0/1
Minimum recovery ending location: 0/0
Min recovery ending loc's timeline: 0
Backup start location: 0/0
Backup end location: 0/0
End-of-backup record required: no
Current wal_level setting: minimal
Current wal_log_hints setting: off
Current max_connections setting: 100
Current max_worker_processes setting: 8
Current max_prepared_xacts setting: 0
Current max_locks_per_xact setting: 64
Maximum data alignment: 8
Database block size: 8192
Blocks per segment of large relation: 131072
WAL block size: 8192
Bytes per WAL segment: 16777216
Maximum length of identifiers: 64
Maximum columns in an index: 32
Maximum size of a TOAST chunk: 1996
Size of a large-object chunk: 2048
Date/time type storage: 64-bit integers
Float4 argument passing: by value
Float8 argument passing: by value
Data page checksum version: 0
How about xlogs are missing and xlogs are deleted的更多相关文章
- How to build mscorlib.dll with visual studio
Recently, Microsoft Corportation has released a new look for .NET Reference Source. And you may find ...
- Elasticsearch的数据导出和导入操作(elasticdump工具),以及删除指定type的数据(delete-by-query插件)
Elasticseach目前作为查询搜索平台,的确非常实用方便.我们今天在这里要讨论的是如何做数据备份和type删除.我的ES的版本是2.4.1. ES的备份,可不像MySQL的mysqldump这么 ...
- error C4430:missing type specifier 解决错误
错误 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ...
- Missing Push Notification Entitlement 问题
最近打包上传是遇到一个问题: 描述: Missing Push Notification Entitlement - Your app includes an API for Apple's Push ...
- PHPmailer关于Extension missing: openssl报错的解决
最近在写一个网页的时候,需要用到PHPmailer来发送邮件,按照官网上给出的demo写出一个例子,却报错Extension missing: openssl 最后发现需要修改php.ini中的配置: ...
- [LeetCode] Missing Number 丢失的数字
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missin ...
- [LeetCode] Missing Ranges 缺失区间
Given a sorted integer array where the range of elements are [0, 99] inclusive, return its missing r ...
- [LeetCode] First Missing Positive 首个缺失的正数
Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] ...
- maven 加入json-lib.jar 报错 Missing artifact net.sf.json-lib:json-lib:jar:2.4:compile
<dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</art ...
随机推荐
- memcached学习笔记3--telnet操作memcached
方式: 一.telnet访问memcached缓存系统(主要用于教学,不讨论) telnet 127.0.0.1 11211 => telnet IP地址 端口号 //往Memcache ...
- = splice
<script> function wf(w){ console.log(w); } var wa = [3,66,7]; var wb = wa; wa.splice(1,1); wf( ...
- P1371 NOI元丹
luogu月赛的题 本来想爆搜,但是经过ly大佬的点拨,明白这是一个dp. 我们定义dp[n]为从n开始的可行串的数目,具体如下:如果n为'I',则是从n开始有多少个I,如果n为'O',既是从n开始有 ...
- 浅析C++的内存管理
在C++中,内存分成5个区,他们分别是堆.栈.自由存储区.全局/ 静态存储区和常量存储区. 栈,就是那些由编译器在需要的时候分配,在不需要的时候自动清楚的变量的存储区.里面的变量通常是局部变量.函数参 ...
- 注册、启动、停止windows服务
找到本机InstallUtil.exe命令 命令行下注册服务InstallUtil.exe D:\XXXXService.exe 启动服务 net start XXXXService 停止服务net ...
- 用户控件UserControl图片资源定位(一)---Xaml引用图片
MEF编程实现巧妙灵活松耦合组件化编程,一些细节需要花费不小心思去处理: 其中组件中若包含用户控件,且需要访问图片资源,那么Xaml引用资源需要做以下设置 1. 用户控件(usercontrol)所在 ...
- SVN hooks强制提交时填写日志
#!/bin/bash REPOS="$1" TXN="$2" #svnlook路径 SVNLOOK=/usr/bin/svnlook #通过svnlook获取 ...
- MVC从服务器端返回js到客户端的方法(总结)
1.利用ViewBag,从服务器端创建一个显示js开关的ViewBag,然后到View中去做判断. Controller端 [HttpPost] public ActionResult Index(h ...
- TCP协议中的三次握手和四次挥手
转自: http://blog.csdn.net/whuslei/article/details/6667471/ 建立TCP需要三次握手才能建立,而断开连接则需要四次握手.整个过程如下图所示:
- Fiddler-007-修改HTTP请求响应数据
前文简述了如何通过 Fiddler 修改 HTTP请求 的请求参数,详情请参阅:Fiddler-006-修改HTTP请求参数. 在进行 App 测试时,经常需要修改请求参数,以获得不同的显示效果,以查 ...