-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pg_verifybackup documentation in English and Chinese #223
Open
guanLouise
wants to merge
1
commit into
apache:main
Choose a base branch
from
guanLouise:add-pxf-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Cloudberry System Tool: pg_verifybackup | ||
|
||
## Overview | ||
|
||
`pg_verifybackup` is a command-line tool used to verify the integrity and consistency of PostgreSQL database backups. It helps ensure that backup files are reliable when needed for data recovery. | ||
|
||
## Installation and Configuration | ||
|
||
`pg_verifybackup` is typically installed as part of PostgreSQL. On most Linux distributions, you can install PostgreSQL using the package manager, for example: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apache Cloudberry cannot be installed with package manager. |
||
|
||
``` | ||
sudo apt-get install postgresql | ||
``` | ||
|
||
On macOS, you can use Homebrew to install PostgreSQL: | ||
|
||
``` | ||
brew install postgresql | ||
``` | ||
|
||
On Windows, you can download and install PostgreSQL from the official website. | ||
|
||
## Usage | ||
|
||
To use `pg_verifybackup` to verify a backup file, provide the path to the backup file as an argument. For example: | ||
|
||
``` | ||
pg_verifybackup /path/to/backup/file | ||
``` | ||
|
||
If the backup file is compressed (e.g., with gzip or bzip2), specify the `-z` option and indicate the compression algorithm. For example: | ||
|
||
``` | ||
pg_verifybackup -z gzip /path/to/compressed/backup/file.gz | ||
``` | ||
|
||
If the backup file is encrypted, use the `-P` option to provide the password. For example: | ||
|
||
``` | ||
pg_verifybackup -P mysecretpassword /path/to/encrypted/backup/file | ||
``` | ||
|
||
## Options | ||
|
||
Here are some common `pg_verifybackup` options: | ||
|
||
- `-V` or `--version`: Display version information. | ||
- `-h` or `--help`: Display help information. | ||
- `-v` or `--verbose`: Increase the level of detail in the output. | ||
- `-q` or `--quiet`: Only output error messages. | ||
- `-d` or `--debug`: Output debug information. | ||
- `-z` or `--compress`: Specify the compression algorithm used for the backup file. | ||
- `-P` or `--password`: Provide the password for the encrypted backup file (if applicable). | ||
- `-s` or `--schema`: Verify only the specified database schema. | ||
- `-S` or `--system`: Verify system directories and control files. | ||
|
||
## Result Interpretation | ||
|
||
The output of `pg_verifybackup` will contain information about the backup file, including its size, creation time, and database version. If the backup file is invalid or corrupted, the tool will report an error. | ||
|
||
## Notes | ||
|
||
- When verifying a backup file, ensure that you have enough disk space to decompress and verify the file. | ||
- If the backup file is encrypted, ensure that you provide the correct password. | ||
- The verification process may take some time, depending on the size and complexity of the file. | ||
|
||
## Reference | ||
|
||
For more information about `pg_verifybackup`, refer to the PostgreSQL official documentation: https://www.postgresql.org/docs/14/app-pgverifybackup.html | ||
|
||
## Conclusion | ||
|
||
`pg_verifybackup` is a valuable tool for ensuring the integrity and consistency of PostgreSQL database backups. By regularly verifying backup files, users can promptly identify and resolve potential issues, reducing the risk of data loss. |
73 changes: 73 additions & 0 deletions
73
i18n/zh/docusaurus-plugin-content-docs/current/pg_verifybackup.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
**Cloudberry 系统工具:pg_verifybackup** | ||
|
||
### 概述 | ||
|
||
`pg_verifybackup` 是一个用于验证 PostgreSQL 数据库备份有效性的命令行工具。它可以检查备份文件的完整性和一致性,帮助确保在需要恢复数据时,备份文件是可靠的。 | ||
|
||
### 安装和配置 | ||
|
||
`pg_verifybackup` 通常作为 PostgreSQL 的一部分进行安装。在大多数 Linux 发行版中,可以通过包管理器安装 PostgreSQL,例如: | ||
|
||
``` | ||
sudo apt-get install postgresql | ||
``` | ||
|
||
在 Mac OS X 上,可以使用 Homebrew 安装 PostgreSQL: | ||
|
||
``` | ||
brew install postgresql | ||
``` | ||
|
||
在 Windows 上,可以从官方网站下载并安装 PostgreSQL。 | ||
|
||
### 使用 | ||
|
||
要使用 `pg_verifybackup` 验证备份文件,需要提供备份文件的路径作为参数。例如: | ||
|
||
``` | ||
pg_verifybackup /path/to/backup/file | ||
``` | ||
|
||
如果备份文件是压缩的(如 gzip 或 bzip2),则需要指定 `-z` 选项并指明压缩算法。例如: | ||
|
||
``` | ||
pg_verifybackup -z gzip /path/to/compressed/backup/file.gz | ||
``` | ||
|
||
如果备份文件是加密的,需要使用 `-P` 选项提供密码。例如: | ||
|
||
``` | ||
pg_verifybackup -P mysecretpassword /path/to/encrypted/backup/file | ||
``` | ||
|
||
### 选项 | ||
|
||
以下是一些常用的 `pg_verifybackup` 选项: | ||
|
||
- `-V` 或 `--version`:显示版本信息。 | ||
- `-h` 或 `--help`:显示帮助信息。 | ||
- `-v` 或 `--verbose`:增加输出的详细程度。 | ||
- `-q` 或 `--quiet`:只输出错误消息。 | ||
- `-d` 或 `--debug`:输出调试信息。 | ||
- `-z` 或 `--compress`:指定备份文件的压缩算法。 | ||
- `-P` 或 `--password`:提供备份文件的密码(如果已加密)。 | ||
- `-s` 或 `--schema`:只验证指定的数据库模式。 | ||
- `-S` 或 `--system`:验证系统目录和控制文件。 | ||
|
||
### 结果解释 | ||
|
||
`pg_verifybackup` 的输出将包含关于备份文件的信息,包括文件大小、创建时间、数据库版本等。如果备份文件无效或损坏,工具将报告错误。 | ||
|
||
### 注意事项 | ||
|
||
- 在验证备份文件时,需要有足够的磁盘空间来解压和验证文件。 | ||
- 如果备份文件是加密的,需要确保提供正确的密码。 | ||
- 验证备份文件的过程可能会花费一些时间,取决于文件的大小和复杂性。 | ||
|
||
### 参考资料 | ||
|
||
更多关于 `pg_verifybackup` 的信息可以在 PostgreSQL 官方文档中找到:https://www.postgresql.org/docs/14/app-pgverifybackup.html | ||
|
||
### 结论 | ||
|
||
`pg_verifybackup` 是一个非常有用的工具,可以帮助确保 PostgreSQL 数据库备份的有效性和一致性。通过定期验证备份文件,用户可以及时发现并解决潜在的问题,减少数据丢失的风险。 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.