機(jī)房斷電后重啟pg數(shù)據(jù)庫,報如下錯誤:
< 2019-01-01 22:42:59.240 EST >LOG: database system was interrupted while in recovery at 2019-01-01 22:00:58 EST
< 2019-01-01 22:42:59.240 EST >HINT: This probably means that some data is corrupted and you will have to use the last backup for recovery.
< 2019-01-01 22:42:59.241 EST >LOG: database system was not properly shut down; automatic recovery in progress
< 2019-01-01 22:42:59.333 EST >PANIC: unexpected pageaddr 26EA/46000000 in log segment 00000001000026EA00000017, offset 0
< 2019-01-01 22:42:59.333 EST >LOG: startup process (PID 88586) was terminated by signal 6: Aborted
< 2019-01-01 22:42:59.333 EST >LOG: aborting startup due to startup process failure
修復(fù)方法:
切換到bin目錄下:
1cd /usr/pgsql-9.3/bin
使用pg_resetxlog命令修復(fù)日志:(/var/lib/pgsql/9.3/data為pg_data的目錄)
1pg_resetxlog -f /var/lib/pgsql/9.3/data
重啟數(shù)據(jù)庫:
1pg_ctl start
補充:PostgreSQL 數(shù)據(jù)庫服務(wù)無法啟動的解決方法
因為客戶那邊的磁盤一般是FAT32的文件系統(tǒng),所以我們程序安裝時,采用手動安裝PostgreSQL的形式安裝數(shù)據(jù)庫,但初始化數(shù)據(jù)庫群成功并且成功注冊了系統(tǒng)服務(wù)后,
發(fā)現(xiàn)PostgreSQL的服務(wù)總是啟動不了,提示服務(wù)啟動又停止了,然后在系統(tǒng)時間查看器里發(fā)現(xiàn)報的錯誤是:Could not create inherited socket, 錯誤編碼為10022
解決方法:
運行 netsh winsock reset,重啟電腦,OK!
文章來源:腳本之家
來源地址:https://www.jb51.net/article/204287.htm
申請創(chuàng)業(yè)報道,分享創(chuàng)業(yè)好點子。點擊此處,共同探討創(chuàng)業(yè)新機(jī)遇!