Cisco DCNM Fundamentals Configuration Guide, Release 4.2
Maintaining the DCNM Database
Downloads: This chapterpdf (PDF - 165.0KB) The complete bookPDF (PDF - 7.85MB) | Feedback

Maintaining the Cisco DCNM Database

Table Of Contents

Maintaining the Cisco DCNM Database

Information About Database Maintenance

Automatic and Manual Purging of Data

Database Backup

Database Clean

Database Restore

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

Additional References

Related Documents

Standards

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

Additional References

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

Database Backup

Database Clean

Database Restore

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 15-2

Automatic and Manual Purging of Statistical Data, page 16-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 4.2(1), you should only perform database restoration from a backup of Cisco DCNM Release 4.2(1).

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:

Product
License Requirement

Cisco DCNM

Database maintenance requires no license. Any feature not included in a license package is bundled with the Cisco DCNM and is provided at no charge to you. For information about obtaining and installing a Cisco DCNM LAN Enterprise license, see the "Installing Licenses" section on page 2-11.


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 4.2(1), you should only perform database restoration from a backup of Cisco DCNM Release 4.2(1).

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

To back up the Cisco DCNM database, follow these 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 Windows, the default path to the bin directory is C:\Program Files\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:

Server Operating System
Database Type
Backup Script Name

Microsoft Windows

PostgreSQL

backup-pgsql-dcnm-db.bat

Oracle

backup-oracle-dcnm-db.bat

Linux

PostgreSQL

backup-pgsql-dcnm-db.sh

Oracle

backup-oracle-dcnm-db.sh


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 Environment

  PostgreSQL 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: woobie1
 Operation Completed
C:\Program Files\Cisco Systems\dcm\dcnm\bin>dir masterbackup.bkp
 Volume in drive C has no label.
 Volume Serial Number is D415-F632

 Directory of C:\Program Files\PostgreSQL\8.2\bin

06/15/2009 01:53 PM           900,129 masterbackup.bkp
               1 File(s)        900,129 bytes
               0 Dir(s)  23,960,858,624 bytes free

C:\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 the Cisco DCNM Server" section on page 2-19.

DETAILED STEPS

To clean the Cisco DCNM database, follow these 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 the Cisco DCNM Server" section on page 2-19.

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 Windows, the default path to the bin directory is C:\Program Files\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:

Server Operating System
Database Type
Clean Script

Microsoft Windows

PostgreSQL

clean-pgsql-dcnm-db.bat

Oracle

clean-oracle-dcnm-db.bat

Linux

PostgreSQL

clean-pgsql-dcnm-db.sh

Oracle

clean-oracle-dcnm-db.sh


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 the Cisco DCNM Server" section on page 2-9.


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 Environment

  PostgreSQL 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 Completed
C:\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 4.2(1) database from a backup file created from a Cisco DCNM Release 4.2(1) 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

To restore the Cisco DCNM database from a backup file, follow these 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 the Cisco DCNM Server" section on page 2-19.

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 Windows, the default path to the bin directory is C:\Program Files\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:

Server Operating System
Database Type
Restore Script

Microsoft Windows

PostgreSQL

restore-pgsql-dcnm-db.bat

Oracle

restore-oracle-dcnm-db.bat

Linux

PostgreSQL

restore-pgsql-dcnm-db.sh

Oracle

restore-oracle-dcnm-db.sh


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 the Cisco DCNM Server" section on page 2-9.


Example

The following example from a 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 Environment

  PostgreSQL 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.bkp
 Operation Completed
C:\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

Standards

Related Documents

Related Topic
Document Title

Automatic purge of event data

Chapter 10, "Managing Events"

Automatic purge of statistical data

Chapter 16, "Administering Statistical Data Collection"


Standards

Standards
Title

No 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 18-1 lists the release history for this feature.

Table 18-1 Feature History for Cisco DCNM Database Maintenance 

Feature Name
Releases
Feature Information

Database maintenance scripts

4.2(1)

Support was added for scripts to perform database backup, restore, and cleaning.