This topic explains how to back up and restore the Cisco IoT FND database to ensure data integrity and system recovery.
Create a full backup of Cisco IoT FND DB
Full backups back up all the blocks from the data file. Full backups are time consuming and consume more disk space and system resources than partial backups.
Cisco IoT FND lets you perform full hot backups of Cisco IoT FND database. In a hot backup, Cisco IoT FND and the Cisco IoT FND database are running during the backup.
The destination backup directory must be writable by the oracle user and have enough space for the Cisco IoT FND data.
To create a backup file of the Cisco IoT FND software:
Procedure
| 1. | On the Cisco IoT FND database server, open a CLI window. |
|
| 2. | Switch to the user oracle:
|
|
| 3. | Change directory to the location of the Cisco IoT FND backup script (backupCgmsDb.sh):
|
|
| 4. | Run the backup script and specify the destination folder. For example, to store the backup data in the /home/oracle/bkp folder, enter this command: ./backupCgmsDb.sh full /home/oracle/bkp 08-03-2018 15:54:10 PST: INFO: ========== CGMS Database Backup Started ==========08-03-2018 15:54:10 PST: INFO: Log file: /tmp/cgms_backup_restore.logAre you sure you want to backup CG-NMS database (y/n)? y |
|
| 5. | Enter y to begin the backup process. |
Schedule a full Cisco IoT FND Backup
To schedule a full Cisco IoT FND backup to run daily at 1:00 AM (default setting):
The destination backup directory must be writable by the oracle user and have enough space for the Cisco IoT FND data.
Procedure
| 1. | On the Cisco IoT FND database server, open a CLI window. |
|
| 2. | Switch to the user oracle :
|
|
| 3. | Change directory to the location of the Cisco IoT FND backup script (backupCgmsDb.sh):
|
|
| 4. | Run the backup script and specify the destination folder. To change the backup scheduling interval, edit the installCgmsBackupJob.sh script before running it. For example, to store the backup data in /home/oracle/bkp, enter this command:
To delete the backup job, enter these commands:
|
Restore a Cisco IoT FND Backup
Perform database backups and restores using the scripts provided in the cgms-oracle.rpm package. If using the supplied scripts, backups and restores only work if performed on the same Oracle database version.
Backups from Oracle version 12.1.0 can only be restored on v12.1.0 if using the supplied scripts. Backups do not work across different versions of Oracle, for example, a backup taken on 12.1.0 cannot be restored on a different version of a future v12.x version using the supplied scripts. If a database upgrade from v12.1.0 to a future v12.x version is required, follow the Oracle upgrade procedure. Refer to the Oracle upgrade document and website.
Cisco IoT FND supports restoring Cisco IoT FND backups on the same host or different host. If you choose to restore Cisco IoT FND backups on a different host, ensure that the host runs the same version of the Oracle database software and that Cisco IoT FND database on the destination host was created using the setupCgmsDb.sh script.
Cisco IoT FND does not support cross-platform backups.
Procedure
| 1. | Run the following command to stop Cisco IoT FND.
|
|||||||
| 2. | Switch to the user oracle, change directories to the script location, and stop Oracle:
|
|||||||
| 3. | To restore the Cisco IoT FND database, run the command:
To restore Cisco IoT FND database from an incremental backup, run these commands and specify the path to last incremental backup file:
The restore script might display these errors:
To avoid these errors, increase the size of the shared memory file system:
|
|||||||
| 4. | Start Oracle:
|
|||||||
| 5. | Change directories to /opt/cgms and run the db-migrate script:
When you restore a Cisco IoT FND database, the restore script restores the database to the Cisco IoT FND version the database was using. An error returns if you restore an old database to a newer version of Cisco IoT FND. Run the migrate script to ensure that the database runs with the current version of Cisco IoT FND. |
|||||||
| 6. | Start Cisco IoT FND by running the following command:
|
Incremental backup of Cisco IoT FND DB
Incremental backups in Cisco IoT FND only back up data file blocks that have changed since the previous specified backup.
-
Cisco IoT FND supports two incremental backup levels: incr0 and incr1 .
-
There is also an hourly archivelog backup to manage database archive log files.
-
Incremental backups help optimize storage and ensure efficient recovery by only saving changed data blocks.
Incremental Backup Levels and Scheduling
Incremental backups in Cisco IoT FND are categorized into incr0 (base), incr1 (differential), and hourly archivelog backups, each with specific scheduling recommendations for large deployments.
-
incr0 – Base backup for subsequent incremental backups. This is similar to a full backup. For large deployments (millions of mesh endpoints and several thousand routers such as CGR1000 and IR800), run incr0 backups twice a week.
-
incr1 – Differential backup of all blocks changed since the last incremental backup. For large deployments, run incr1 backups once a day.
-
Hourly archivelog backup – The Oracle Database uses archived logs to record all changes made to the database. These files grow over time and can consume a large amount of disk space. Schedule the backup_archive_log.sh script to run every hour. This script backs up the database archive (.arc) log files, stores them on a different server, and deletes the source archivelog files to free space on the database server.
An incr0 backup must run before an incr1 backup to establish a base for the incr1 differential backup.
Before performing any significant operation that causes many changes in the Cisco IoT FND database (for example, importing a million mesh endpoints or uploading firmware images to mesh endpoints), perform an incr0 backup. After the operation completes, perform another incr0 backup, and then resume the scheduled incremental backups.
Perform an incremental backup
The destination backup directory must be writable by the oracle user and have enough space for the Cisco IoT FND data.
To perform an incremental backup:
Procedure
| 1. | On the Cisco IoT FND database server, open a CLI window. |
|
| 2. | Switch to the user oracle and change directory to the location of the Cisco IoT FND backup script:
|
|
| 3. | Run the backup script and specify the incremental backup level and the destination folder where the backup data is stored (for example, /home/oracle/bkp). For example, to perform an incr0 backup to /home/oracle/bkp, enter the command:
To perform an incr1 backup, enter the command:
|