Crunchy PostgreSQL database backup via pgo command
pgo使得Crunchy Postgresql的管理極為方便,可惜目前支援的命令不太多。但是有幾個關鍵的操作比如備份,恢復pgo命令還是支援的。
安裝非常簡單,詳情見下面的連結
Install pgo from https://access.crunchydata.com/documentation/postgres-operator-client/latest/
在測試命令之前,先在openshift上安裝Crunchy Postgres Operator和一個postgrescluster
namespace: project-demo
postgrescluster: demo
Check version information
➜ ~ oc pgo -n project-demo version Client Version: v0.2.0 Operator Version: v5.2.0
Show database backup information
➜ ~ oc pgo show backup demo stanza: db status: ok cipher: none db (current) wal archive min/max (14): 000000010000000000000001/000000010000000000000005 full backup: 20230216-012002F timestamp start/stop: 2023-02-16 01:20:02 / 2023-02-16 01:21:15 wal start/stop: 000000010000000000000004 / 000000010000000000000004 database size: 36.4MB, database backup size: 36.4MB repo1: backup set size: 4.5MB, backup size: 4.5MB ➜ ~
Run a full backup
➜ ~ oc pgo -n project-demo backup demo --repoName=repo1 --options="--type=full" postgresclusters/demo backup initiated
Show all backup
➜ ~ oc pgo show backup demo stanza: db status: ok cipher: none db (current) wal archive min/max (14): 000000010000000000000001/000000010000000000000007 full backup: 20230216-012002F timestamp start/stop: 2023-02-16 01:20:02 / 2023-02-16 01:21:15 wal start/stop: 000000010000000000000004 / 000000010000000000000004 database size: 36.4MB, database backup size: 36.4MB repo1: backup set size: 4.5MB, backup size: 4.5MB full backup: 20230216-013037F timestamp start/stop: 2023-02-16 01:30:37 / 2023-02-16 01:30:49 wal start/stop: 000000010000000000000007 / 000000010000000000000007 database size: 37.1MB, database backup size: 37.1MB repo1: backup set size: 4.5MB, backup size: 4.5MB ➜ ~
Run a differential backup
➜ ~ oc pgo -n project-demo backup demo --repoName=repo1 --options="--type=diff" postgresclusters/demo backup initiated
Show all backup
➜ ~ oc pgo show backup demo stanza: db status: ok cipher: none db (current) wal archive min/max (14): 000000010000000000000001/00000001000000000000000A full backup: 20230216-012002F timestamp start/stop: 2023-02-16 01:20:02 / 2023-02-16 01:21:15 wal start/stop: 000000010000000000000004 / 000000010000000000000004 database size: 36.4MB, database backup size: 36.4MB repo1: backup set size: 4.5MB, backup size: 4.5MB full backup: 20230216-013037F timestamp start/stop: 2023-02-16 01:30:37 / 2023-02-16 01:30:49 wal start/stop: 000000010000000000000007 / 000000010000000000000007 database size: 37.1MB, database backup size: 37.1MB repo1: backup set size: 4.5MB, backup size: 4.5MB diff backup: 20230216-013037F_20230216-013645D timestamp start/stop: 2023-02-16 01:36:45 / 2023-02-16 01:36:48 wal start/stop: 000000010000000000000009 / 00000001000000000000000A database size: 37.6MB, database backup size: 4.4MB repo1: backup set size: 4.5MB, backup size: 400.3KB backup reference list: 20230216-013037F ➜ ~
Run an incremental backup
➜ ~ oc pgo -n project-demo backup demo --repoName=repo1 --options="--type=incr" postgresclusters/demo backup initiated
Show all backup
➜ ~ oc pgo show backup demo stanza: db status: ok cipher: none db (current) wal archive min/max (14): 000000010000000000000001/00000001000000000000000D full backup: 20230216-012002F timestamp start/stop: 2023-02-16 01:20:02 / 2023-02-16 01:21:15 wal start/stop: 000000010000000000000004 / 000000010000000000000004 database size: 36.4MB, database backup size: 36.4MB repo1: backup set size: 4.5MB, backup size: 4.5MB full backup: 20230216-013037F timestamp start/stop: 2023-02-16 01:30:37 / 2023-02-16 01:30:49 wal start/stop: 000000010000000000000007 / 000000010000000000000007 database size: 37.1MB, database backup size: 37.1MB repo1: backup set size: 4.5MB, backup size: 4.5MB diff backup: 20230216-013037F_20230216-013645D timestamp start/stop: 2023-02-16 01:36:45 / 2023-02-16 01:36:48 wal start/stop: 000000010000000000000009 / 00000001000000000000000A database size: 37.6MB, database backup size: 4.4MB repo1: backup set size: 4.5MB, backup size: 400.3KB backup reference list: 20230216-013037F incr backup: 20230216-013037F_20230216-014148I timestamp start/stop: 2023-02-16 01:41:48 / 2023-02-16 01:41:50 wal start/stop: 00000001000000000000000C / 00000001000000000000000D database size: 38MB, database backup size: 2MB repo1: backup set size: 4.5MB, backup size: 99.9KB backup reference list: 20230216-013037F, 20230216-013037F_20230216-013645D ➜ ~
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/725820/viewspace-2935651/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Crunchy PostgreSQL database restore via pgo commandSQLDatabaseRESTGo
- Crunchy pgo安裝Go
- 雲原生 PostgreSQL 叢集 - PGO:來自 Crunchy Data 的 Postgres OperatorSQLGo
- SQLBackupAndFTP12.0 failed to backup database with full backup typeSQLFTPAIDatabase
- recover database using backup controlfile理解Database
- WPF Button Command and CommandParamet completed via C# no xaml at allC#
- PostgreSQL xlog格式之no backup full pageSQL
- PostgreSQL xlog格式之backup full pageSQL
- 理解RMAN backup database plus archivelog delete all input命令DatabaseHivedelete
- RMAN-03009: failure of backup command on ORA_DISK_1 channelAI
- 雲原生 PostgreSQL 叢集 - PGO:5分鐘快速上手SQLGo
- PL/SQL package SYS.DBMS_BACKUP_RESTORE version 19.16.00.00 in TARGET database isSQLPackageRESTDatabase
- PostgreSQL DBA(28) - Backup&Recovery#1(基本操作)SQL
- 雲原生 PostgreSQL - CrunchyData PGO 教程:建立、連線、刪除 Postgres 叢集SQLGo
- PostgreSQL DBA(148) - pgAdmin(Show script for psql command)SQL
- PostgreSQL DBA(31) - Backup&Recovery#4(搭建流複製)SQL
- PostgreSQL DBA(138) - PG 13(Drop database force)SQLDatabase
- PostgreSQL DBA(159) - pgAdmin(Allow vacuum command to process indexes in paralleSQLIndex
- [重慶思莊每日技術分享]-ORA-1142 signalled during: ALTER DATABASE END BACKUPDatabase
- PostgreSQL DBA(29) - Backup&Recovery#2(日期格式導致的錯誤)SQL
- Postgresql實戰:使用pg_basebackup或pg_start_backup方式搭建Postgresql主從流複製SQL
- PostgreSQL DBA(30) - Backup&Recovery#3(資料檔案損壞恢復)SQL
- Crunchy PG手動備份實驗
- Rust 編譯器探索使用 PGORust編譯Go
- 解決You should consider upgrading via the 'python -m pip install --upgrade pip' command. (pip工具版本較低導致)IDEPython
- PostgreSQL 原始碼解讀(237)- 後臺程式#15(rebuild_database_list)SQL原始碼RebuildDatabase
- md_backup
- The database owner SID recorded in the master database differs from the database owner SID recorded in database 'DB_NAME'DatabaseAST
- SQL Injection via DNSSQLDNS
- Using V$BACKUP_ASYNC_IO / V$BACKUP_SYNC_IO to Monitor RMAN PerformanceORM
- How to use “cat” command on “find” command's output?
- -bash: id: command not found -bash: tty: command not found
- command模式模式
- Oracle Database Cloud - Database as a Service Quick StartOracleDatabaseCloudUI
- Error querying database. XXXXXXXXXXXXX, No database selected。ErrorDatabase
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- DBMS_BACKUP_RESTORE.DBMS_BACKUP_RESTORE用於特殊情況下的恢復REST
- WPF Datagrid display via DataGridTemplateColumn