How to fix PVA Agent database corruptions?
Vấn đề
Như các bạn thấy log lỗi của RDBMS của Parallels Virtual Automation (PVA) Agent (/var/log/pva/agent
):
RDBMS error (-2147483648) : DBMS Error #HY000:1:1:no such table: vSecurity (1)
SELECT T140735578562040.[operation] FROM vSecurity T140735578562040 WHERE ((T140735578562040.[objId]='0ca08c4d-21ab-174a-a495-85b0e0bfd5a4') AND (T140735578562040.[sid] IN ('AQEAAAAAAAAAAAAA','AQEAAAAAAAAAAAAA'))) AND (T140735578562040.[operation] IN ('0','99')) "
Hoặc:
T=11:28:20:184; L=(err); PID=146508; TID=461f0; P=VZLDBSchema [VZL::onRdbmsError] RDBMS error (-2147483648) : DBMS Error #HY000:1:11:database disk image is malformed (11)
Giải pháp:
- Stop the PVA Agent service:
~# pvaagent stop Shutting pvaagentd: [ OK ]
- Dump database cũ sang một database mới:
~# echo ".dump" | sqlite3 /var/opt/pva/agent/etc/VZAgentDB.sqldb | sqlite3 /var/opt/pva/agent/etc/VZAgentDB.sqldb.new
- Các bạn có thể thấy 2 file database bên dưới khác nhau:
~# ls -alh /var/opt/pva/agent/etc/VZAg* -rw-r----- 1 root root 309M Oct 17 14:27 /var/opt/pva/agent/etc/VZAgentDB.sqldb -rw-r--r-- 1 root root 288M Oct 17 14:30 /var/opt/pva/agent/etc/VZAgentDB.sqldb.new
- Backup và thay thế file database cũ bằng file mới:
~# mv /var/opt/pva/agent/etc/VZAgentDB.sqldb{,.corrupted} ~# mv /var/opt/pva/agent/etc/VZAgentDB.sqldb.new /var/opt/pva/agent/etc/VZAgentDB.sqldb
- Start the PVA Agent service:
~# pvaagent start Starting pvaagentd: [ OK ]