Table Of Contents
Maintaining the Cisco DCNM Database
Information About Database Maintenance
Automatic and Manual Purging of Data
Licensing Requirements for Database Maintenance
Prerequisites for Database Maintenance
Guidelines and Limitations for Database Maintenance
Performing Database Maintenance
Backing Up the Cisco DCNM Database
Cleaning a Cisco DCNM Database
Restoring a Cisco DCNM Database from a Backup File
Feature History for Cisco DCNM Database Maintenance
Maintaining the Cisco DCNM Database
This chapter describes how to maintain the Cisco Data Center Network Manager (DCNM) database.
This chapter includes the following sections:
•Information About Database Maintenance
•Licensing Requirements for Database Maintenance
•Prerequisites for Database Maintenance
•Guidelines and Limitations for Database Maintenance
•Performing Database Maintenance
•Feature History for Cisco DCNM Database Maintenance
Information About Database Maintenance
Cisco DCNM uses a PostgreSQL database or an Oracle database to store all data, including configuration information from managed devices, events and statistical data gathered from managed devices, and Cisco DCNM user information. In addition to scripts that you can run to perform database maintenance, Cisco DCNM provides features to help you delete events and statistical data that you no longer need.
This section includes the following topics:
•Automatic and Manual Purging of Data
Automatic and Manual Purging of Data
You can use the Auto-Synchronization with Devices feature to delete unwanted event data and the Statistical Data Collection feature to delete unwanted statistical data. Cisco DCNM supports automatic purging of both types of data. You can configure the following aspects of automatic data purging:
•Days of the week and time of day that automatic purging occurs.
•Whether Cisco DCNM determines which data to purge by the age of the data or by a maximum number of database entries.
•For event-related data, whether Cisco DCNM determines which events to purge by event severity.
We recommend that you configure automatic purging of events and statistical data to ensure that the Cisco DCNM database size does not grow too large.
You can also manually purge events and statistical data.
For more information, see the following sections:
•Automatic and Manual Purging of Event Data, page 12-2
•Automatic and Manual Purging of Statistical Data, page 14-2
Database Backup
You can use the Cisco DCNM database backup script to create a backup file of the Cisco DCNM database.
We strongly recommend that you regularly back up the Cisco DCNM database and that you archive backup files in a secure location that is not on the Cisco DCNM server system. You should retain the backup files as long as required by the standards of your organization.
Database Clean
You can use the Cisco DCNM database clean script to clean the Cisco DCNM database. Cleaning removes all Cisco DCNM data from the database and is a necessary step prior to restoring the Cisco DCNM database. Any database records that have not been backed up are lost when you clean the database.
You can also clean the database if you want to delete all data and rebuild your Cisco DCNM implementation without restoring data from a backup.
Database Restore
You can use the Cisco DCNM database restore script to restore the Cisco DCNM database from a backup file. The backup file must have been created by the Cisco DCNM database backup script included in the same release of Cisco DCNM that you are restoring the data to. For example, if you are running Cisco DCNM Release 5.0(2), you should only perform database restoration from a backup of Cisco DCNM Release 5.0(2).
Also, the backup file must have been created from the same database type and release that you are restoring the data to. For example, if you are restoring data to an Oracle 11g database, the backup file must have been created from an Oracle 11g database.
Before you restore a Cisco DCNM database, you should clean the database. Restoring a database without cleaning the database can have unpredictable results.
Licensing Requirements for Database Maintenance
The following table shows the licensing requirements for this feature:
Prerequisites for Database Maintenance
Database maintenance has the following prerequisites:
•You must have successfully installed the Cisco DCNM server.
•Cleaning the Cisco DCNM database requires that you stop the Cisco DCNM server.
•Restoring the Cisco DCNM database requires the following:
–You must have a backup file created from exactly the same release of Cisco DCNM that you are restoring with the backup file.
–You must have a backup file created from exactly the same database type and release that you are restoring data to.
–You must have a backup file that was created from a Cisco DCNM database running in the same operating system as the database that you want to restore. For example, backup files made from a database running in Microsoft Server 2003 can only be used to restore other Cisco DCNM databases running in Microsoft Server 2003.
Guidelines and Limitations for Database Maintenance
Database maintenance has the following configuration guidelines and limitations:
•We recommend that you configure automatic purging of statistical data and event data to ensure that the Cisco DCNM database size does not grow too large.
•We recommend that you perform backups on a regular basis. Follow the standards of your organization to determine how frequently you should perform backups.
•You can only restore a Cisco DCNM database from a backup of the same release of Cisco DCNM. For example, if you are running Cisco DCNM Release 5.0(2), you should only perform database restoration from a backup of Cisco DCNM Release 5.0(2).
•You can only restore a Cisco DCNM database from a backup of the same database type and release as the current database. For example, if the current database is an Oracle 11g database, you can only restore it with a backup file made from an Oracle 11g database.
•You can only restore a Cisco DCNM database from a backup file that was made from a Cisco DCNM database running in the same operating system as the database that you want to restore. For example, backup files made from a database running in Microsoft Server 2003 can only be used to restore other Cisco DCNM databases running in Microsoft Server 2003.
Performing Database Maintenance
This section includes the following topics:
•Backing Up the Cisco DCNM Database
•Cleaning a Cisco DCNM Database
•Restoring a Cisco DCNM Database from a Backup File
Backing Up the Cisco DCNM Database
You can back up the Cisco DCNM database with the backup script. The Cisco DCNM server installer configures the backup script with the database username and database name that you specified during server installation.
DETAILED STEPS
Step 1 On the Cisco DCNM server, access a command prompt.
Step 2 Use the cd command to change the directory to the bin directory under the Cisco DCNM installation directory, as follows:
cd path
where path is the relative or absolute path to the bin directory. For Microsoft Windows, the default path to the bin directory is C:\Program Files\dcm\dcnm\bin. For RHEL, the default path to the bin directory is /usr/local/cisco/dcm/dcnm/bin.
Step 3 Run the Cisco DCNM database backup script. The script name depends upon the server operating system and database type, as shown in the following table:
Step 4 Enter the filename for the backup that you are creating.
Step 5 At the confirmation prompt, enter y to continue with the backup.
Step 6 Verify that the backup file was created as you specified and has a file size greater than zero.
•On Linux, use the ls -l command.
•On Microsoft Windows, use the dir command.
Step 7 Store the backup file in a safe location. We recommend that you copy the backup file to a secure location that is off the Cisco DCNM server system so that you can protect your data from the potential of a catastrophic hardware failure.
Example
The following example from a Windows server shows how to create a backup named masterbackup.bkp from a PostgreSQL Cisco DCNM database that was installed using default values:
C:\Documents and Settings\Administrator>cd "C:\Program Files\Cisco Systems\dcm\dcnm\bin"C:\Program Files\Cisco Systems\dcm\dcnm\bin>backup-pgsql-dcnm-db.bat========================================================Database Postgres EnvironmentPostgreSQL Bin Path : ""C:\Program Files\Cisco Systems\dcm\db"\bin"DCNM Database Name : "dcmdb"DCNM Database User Name : "dcnmuser"========================================================Please enter the filename to be used for Database Backup:masterbackup.bkp"""Database Schema "dcnmuser" will be backed up in filename : masterbackup.bkp"""Continue y/n [n] : y...Database backup File: woobie1Operation CompletedC:\Program Files\Cisco Systems\dcm\dcnm\bin>dir masterbackup.bkpVolume in drive C has no label.Volume Serial Number is D415-F632Directory of C:\Program Files\PostgreSQL\8.2\bin06/15/2009 01:53 PM 900,129 masterbackup.bkp1 File(s) 900,129 bytes0 Dir(s) 23,960,858,624 bytes freeC:\Program Files\Cisco Systems\dcm\dcnm\bin>Cleaning a Cisco DCNM Database
You can use the Cisco DCNM database clean script to clean the database, which deletes all data from the Cisco DCNM database. You may want to clean the database for the following reasons:
•You want to restore the Cisco DCNM database from a backup.
•You want to delete all data and rebuild your Cisco DCNM implementation without restoring data from a backup.
The Cisco DCNM server installer configures the clean script with the database username and database name that you specified during server installation.
BEFORE YOU BEGIN
Back up the Cisco DCNM database. Any data not preserved in a backup is lost when you clean the database.
Stop the Cisco DCNM server. The Cisco DCNM server must be down before you can finish the database cleaning procedure. For detailed steps, see the "Stopping Cisco DCNM Servers" section on page 16-5.
DETAILED STEPS
Step 1 On the Cisco DCNM server, access a command prompt.
Step 2 If you have not already done so, stop the Cisco DCNM server. For detailed steps, see the "Stopping Cisco DCNM Servers" section on page 16-5.
Step 3 Use the cd command to change the directory to the bin directory under the Cisco DCNM installation directory, as follows:
cd path
where path is the relative or absolute path to the bin directory. For Microsoft Windows, the default path to the bin directory is C:\Program Files\dcm\dcnm\bin. For RHEL, the default path to the bin directory is /usr/local/cisco/dcm/dcnm/bin.
Step 4 Run the Cisco DCNM database clean script. The script name depends upon the server operating system and database type, as shown in the following table:
Step 5 At the confirmation prompt, enter y to continue with cleaning the database.
Step 6 If you want to restore the Cisco DCNM database from a backup, proceed to the "Restoring a Cisco DCNM Database from a Backup File" section. Do not start the Cisco DCNM server.
If you do not want to restore the Cisco DCNM database from a backup and want to rebuild your Cisco DCNM implementation manually, start the Cisco DCNM server. See the "Starting a Single Cisco DCNM Server" section on page 16-2.
Example
The following example from a Windows server shows how to clean a PostgreSQL Cisco DCNM database that was installed using default values:
C:\Documents and Settings\Administrator>cd "C:\Program Files\Cisco Systems\dcm\dcnm\bin"C:\Program Files\Cisco Systems\dcm\dcnm\bin>clean-pgsql-dcnm-db.bat========================================================Database Postgres EnvironmentPostgreSQL Bin Path : ""C:\Program Files\Cisco Systems\dcm\db"\bin"DCNM Database Name : "dcmdb"DCNM Database User Name : "dcnmuser"DCNM Database SuperUser Name : "cisco"=========================================================***************************************************************************PLEASE MAKE SURE THE DCNM SERVICE IS SHUTDOWN BEFORE RUNNING THIS SCRIPT!!***************************************************************************DCNM database schema "dcnmuser" will be deleted permanently...Please Confirm y/n [n] : y...Operation CompletedC:\Program Files\Cisco Systems\dcm\dcnm\bin>Restoring a Cisco DCNM Database from a Backup File
You can use the Cisco DCNM database restore script to restore the Cisco DCNM database from a backup file. The restore script cleans the database prior to restoring it.
BEFORE YOU BEGIN
Locate the backup file that you want to use to restore the Cisco DCNM database.
Ensure that the backup file that you want to use to restore the database was made from the same release of Cisco DCNM. For example, you can only restore a Cisco DCNM Release 5.0(2) database from a backup file created from a Cisco DCNM Release 5.0(2) database.
Ensure that the backup file was made from the same database type and release as the current database. For example, you can only restore an Oracle 11g database from a backup file made from an Oracle 11g database.
Ensure that the backup file was made from a Cisco DCNM database running in the same operating system as the Cisco DCNM server that you want to restore the database to. For example, backup files made from a database running in Microsoft Server 2003 can only be used to restore other Cisco DCNM databases running in Microsoft Server 2003.
The Cisco DCNM server must be stopped while you are restoring the database.
DETAILED STEPS
Step 1 On the Cisco DCNM server, access a command prompt.
Step 2 If you have not already done so, stop the Cisco DCNM server. For detailed steps, see the "Stopping Cisco DCNM Servers" section on page 16-5.
Step 3 Use the cd command to change the directory to the bin directory under the Cisco DCNM installation directory, as follows:
cd path
where path is the relative or absolute path to the bin directory. For Microsoft Windows, the default path to the bin directory is C:\Program Files\dcm\dcnm\bin. For RHEL, the default path to the bin directory is /usr/local/cisco/dcm/dcnm/bin.
Step 4 Run the Cisco DCNM database restore script. The script name depends upon the server operating system and database type, as shown in the following table:
Step 5 Enter the name of the backup file that you want to use to restore the Cisco DCNM database.
Step 6 At the confirmation prompt, enter y to continue with the database restore.
Step 7 To resume using Cisco DCNM, start the Cisco DCNM server. See the "Starting a Single Cisco DCNM Server" section on page 16-2.
Example
The following example from a Microsoft Windows server shows how to restore a Cisco DCNM PostgreSQL database that was installed using default values and using a backup file named masterbackup.bkp that exists in the bin directory Cisco DCNM installation directory:
C:\Documents and Settings\Administrator>cd "C:\Program Files\Cisco Systems\dcm\dcnm\bin"C:\Program Files\Cisco Systems\dcm\dcnm\bin>restore-pgsql-dcnm-db.bat========================================================Database Postgres EnvironmentPostgreSQL Bin Path : ""C:\Program Files\Cisco Systems\dcm\db"\bin"DCNM Database Name : "dcmdb"DCNM Database User Name : "dcnmuser"========================================================***************************************************************************PLEASE MAKE SURE THE DCNM SERVICE IS SHUTDOWN BEFORE RUNNING THIS SCRIPT!!***************************************************************************Please enter the filename to be used for Database Restore:masterbackup.bkp"""Database Schema "dcnmuser" will be Restore from filename : masterbackup.bkp"""Continue y/n [n] : y"Cleaning the database......"Done"pg_restore: connecting to database for restore...Restored Database from : masterbackup.bkpOperation CompletedC:\Program Files\Cisco Systems\dcm\dcnm\bin>Additional References
For additional information related to maintaining the Cisco DCNM database, see the following sections:
Related Documents
Related Topic Document TitleAutomatic purge of event data
Chapter 12, "Administering Auto-Synchronization with Devices"
Automatic purge of statistical data
Standards
Standards TitleNo new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
—
Feature History for Cisco DCNM Database Maintenance
Table 17-1 lists the release history for this feature.
Table 17-1 Feature History for Cisco DCNM Database Maintenance
Feature Name Releases Feature InformationDatabase maintenance scripts
5.0(2)
No change from Release 4.2(3).