本文档旨在描述 Subversion 1.1。如果您正在运行更新版本的 Subversion,我们强烈建议您访问 https://svnbook.subversion.org.cn/ 并查阅适合您 Subversion 版本的书籍。

名称

svnadmin recover — 将存储库数据库恢复到一致状态(仅适用于使用bdb后端的存储库)。

概要

svnadmin recover REPOS_PATH

描述

如果您收到错误消息,表明您的存储库需要恢复,请运行此命令。

开关

--wait

示例

恢复挂起的存储库

$ svnadmin recover /usr/local/svn/repos/ 
Repository lock acquired.
Please wait; recovering the repository may take some time...

Recovery completed.
The latest repos revision is 34.

恢复数据库需要对存储库进行独占锁定。如果其他进程正在访问存储库,那么 svnadmin recover 将出错

$ svnadmin recover /usr/local/svn/repos
svn: Failed to get exclusive repository access; perhaps another process
such as httpd, svnserve or svn has it open?

$

但是,--wait选项将导致 svnadmin recover 无限期地等待其他进程断开连接

$ svnadmin recover /usr/local/svn/repos --wait
Waiting on repository lock; perhaps another process has it open?

### time goes by...

Repository lock acquired.
Please wait; recovering the repository may take some time...

Recovery completed.
The latest repos revision is 34.