Backup catalog maintenance
Download catalog, query backups and delete expired backups using your command line interface.
Topics
Overview
Backup keeps the inventory of all backups perform with the tool in the Database Catalog.
The file can be found in the following paths depending on the database:
Database | Path |
---|---|
SAP HANA | /hana/shared/$SAPSYSTEMNAME/global/hdb/opt/emory.db |
SAP ASE | $SYBASE/$SYBASE_ASE/emory.db |
Oracle | /oracle/$ORACLE_SID/sapprof/emory.db |
MaxDB | /opt/emory/conf/<SID>.db |
DB2 | /opt/emory/conf/<SID>.db |
Retrieve the latest catalog
In case of accidentally deletion, disaster recovery or system copy procedure, you can download the latest saved backup catalog from the Storage Provider by executing the following command:
$ /opt/emory/emory catalog download
Query backups from command-line
Backup list
Print a CSV format output of the summary of backups that emory catalog has ever taken (deleted backups will not be retrieved)
$ /opt/emory/emory catalog list
Expand to see an example
$ /opt/emory/emory catalog list
#,EBID,ID,StartDate,EndDate,ExpirationDate,UID,Level,LcType,SourceDB,Status,#Objs
1,20220225085552,1,2022-02-25 08:55:53,2022-02-25 08:57:32,,DBD,FULL,,DBD@sapnwdb2,completed,0
2,20220225085750,2,2022-02-25 08:57:50,2022-02-25 08:57:58,,DBD,ARCHIVE,,DBD@sapnwdb2,completed,0
3,20220225093619,3,2022-02-25 09:36:20,2022-02-25 09:37:54,,DBD,FULL,,DBD@sapnwdb2,completed,0
4,20220225093738,4,2022-02-25 09:37:38,2022-02-25 09:37:44,,DBD,ARCHIVE,,DBD@sapnwdb2,completed,0
5,20220301175414,5,2022-03-01 17:54:14,2022-03-01 17:54:24,,DBD,ARCHIVE,,DBD@sapnwdb2,completed,0
6,20220302070434,6,2022-03-02 07:04:34,2022-03-02 07:04:45,,DBD,ARCHIVE,,DBD@sapnwdb2,completed,0
7,20220302234442,7,2022-03-02 23:44:42,2022-03-02 23:44:52,,DBD,ARCHIVE,,DBD@sapnwdb2,completed,0
8,20220303154452,8,2022-03-03 15:44:52,2022-03-03 15:46:30,,DBD,FULL,,DBD@sapnwdb2,completed,0
9,20220303154613,9,2022-03-03 15:46:13,2022-03-03 15:46:21,,DBD,ARCHIVE,,DBD@sapnwdb2,completed,0
...
You can filter by date and expiration.
Execute /opt/emory/emory catalog list --help
to display such options:
Usage: emory catalog list
Get a complete list of catalog backups
Flags:
-h, --help Show context-sensitive help.
--expired List expired backups only
--start-date=STRING Define start date (YYYY-MM-DD)
--end-date=STRING Define end date (YYYY-MM-DD)
Detailed information of a specific backup
You can retrieve more detailed information for a backup using its backup id from catalog list
$ /opt/emory/emory catalog info <backup-id>
Expand to see an example
$ /opt/emory/emory catalog info 20220609232404
+---+----------------+-----+---------------------+---------------------+-----------------------+-----+---------+--------+--------------+-----------+-------+
| # | EBID | ID | STARTDATE | ENDDATE | EXPIRATIONDATE | UID | LEVEL | LCTYPE | SOURCEDB | STATUS | #OBJS |
+---+----------------+-----+---------------------+---------------------+-----------------------+-----+---------+--------+--------------+-----------+-------+
| 1 | 20220609232404 | 286 | 2022-06-09 23:24:04 | 2022-06-09 23:24:15 | 2022-06-11 23:24:04 * | DBD | ARCHIVE | | DBD@sapnwdb2 | completed | 1 |
+---+----------------+-----+---------------------+---------------------+-----------------------+-----+---------+--------+--------------+-----------+-------+
+-------------------------+------------+-----+
| BUCKET | ENCRYPTION | KEY |
+-------------------------+------------+-----+
| emory-backup-charlatans | none | |
+-------------------------+------------+-----+
+---+-------------------------------------------------------+---------------------------------------------------------------------+----------+-----------+------------+
| # | NAME | KEY | SIZE | STATUS | COMPRESSED |
+---+-------------------------------------------------------+---------------------------------------------------------------------+----------+-----------+------------+
| 1 | /tmp/20220609232404.DBD.ARCHIVE.C0000006_S0000162.LOG | DBD/DBD/2022/06/09/20220609232404.DBD.ARCHIVE.C0000006_S0000162.LOG | 81928192 | completed | FALSE |
+---+-------------------------------------------------------+---------------------------------------------------------------------+----------+-----------+------------+
sapnwdb2:db2dbd 117> /opt/emory/emory catalog info 20220609165831
+---+----------------+-----+---------------------+---------+-----------------------+-----+-------+--------+--------------+---------+-------+
| # | EBID | ID | STARTDATE | ENDDATE | EXPIRATIONDATE | UID | LEVEL | LCTYPE | SOURCEDB | STATUS | #OBJS |
+---+----------------+-----+---------------------+---------+-----------------------+-----+-------+--------+--------------+---------+-------+
| 1 | 20220609165831 | 285 | 2022-06-09 16:58:31 | | 2022-06-16 16:58:31 * | DBD | FULL | Daily | DBD@sapnwdb2 | started | 4 |
+---+----------------+-----+---------------------+---------+-----------------------+-----+-------+--------+--------------+---------+-------+
+-------------------------+------------+-----+
| BUCKET | ENCRYPTION | KEY |
+-------------------------+------------+-----+
| emory-backup-charlatans | none | |
+-------------------------+------------+-----+
+---+---------------------------------------------------+-----------------------------------------------------------------+------+---------+------------+
| # | NAME | KEY | SIZE | STATUS | COMPRESSED |
+---+---------------------------------------------------+-----------------------------------------------------------------+------+---------+------------+
| 1 | /tmp/20220609165831.DBD.FULL.db2dbd.DBPART000.001 | DBD/DBD/2022/06/09/20220609165831.DBD.FULL.db2dbd.DBPART000.001 | 0 | started | FALSE |
| 2 | /tmp/20220609165831.DBD.FULL.db2dbd.DBPART000.002 | DBD/DBD/2022/06/09/20220609165831.DBD.FULL.db2dbd.DBPART000.002 | 0 | started | FALSE |
| 3 | /tmp/20220609165831.DBD.FULL.db2dbd.DBPART000.003 | DBD/DBD/2022/06/09/20220609165831.DBD.FULL.db2dbd.DBPART000.003 | 0 | started | FALSE |
| 4 | /tmp/20220609165831.DBD.FULL.db2dbd.DBPART000.004 | DBD/DBD/2022/06/09/20220609165831.DBD.FULL.db2dbd.DBPART000.004 | 0 | started | FALSE |
+---+---------------------------------------------------+-----------------------------------------------------------------+------+---------+------------+
Delete expired backups
If you specified a lifecycle policy during CxLink Backup configuration you can list all the backups that have expire.
/opt/emory/emory catalog delete expired
TIP
You can check expired backups before execute deletion running /opt/emory/emory catalog list --expired