Cisco DCNM Fundamentals Guide, Release 6.x
Maintaining the Cisco DCNM-LAN Database
Downloads: This chapterpdf (PDF - 152.0KB) The complete bookPDF (PDF - 4.6MB) | Feedback

Table of Contents

Maintaining the Cisco DCNM-LAN 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 DCNM-LAN Database

Cleaning a DCNM-LAN Database

Restoring a DCNM-LAN Database from a Backup File

Additional References

Related Documents

Standards

Feature History for DCNM-LAN Database Maintenance

Maintaining the Cisco DCNM-LAN Database

This chapter describes how to maintain the Cisco Data Center Network Manager for LAN (DCNM-LAN) database.

This chapter includes the following sections:

Information About Database Maintenance

DCNM-LAN 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 DCNM-LAN user information. In addition to scripts that you can run to perform database maintenance, DCNM-LAN 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

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. DCNM-LAN 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 DCNM-LAN determines which data to purge by the age of the data or by a maximum number of database entries.
  • For event-related data, whether DCNM-LAN determines which events to purge by event severity.

We recommend that you configure automatic purging of events and statistical data to ensure that the DCNM-LAN database size does not grow too large.

You can also manually purge events and statistical data.

For more information, see the following sections:

Database Backup

You can use the Cisco DCNM database backup script to create a backup file of the DCNM-LAN database.

We strongly recommend that you regularly back up the DCNM-LAN database and that you archive backup files in a secure location that is not on the DCNM-LAN 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 DCNM-LAN database. Cleaning removes all DCNM-LAN data from the database and is a necessary step prior to restoring the DCNM-LAN 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 DCNM-LAN implementation without restoring data from a backup.


Note Database clean script is unavailable from DCNM Release 6.x onwards.


Database Restore

You can use the Cisco DCNM database restore script to restore the DCNM-LAN database from a backup file. The backup file must have been created by the DCNM-LAN database backup script included in the same release of DCNM-LAN 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 DCNM-LAN 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

DCNM-LAN

Database maintenance requires no license. Any feature not included in a license package is bundled with the DCNM-LAN and is provided at no charge to you. For information about obtaining and installing a Cisco DCNM LAN Enterprise license, see the Cisco DCNM Installation and Licensing Guide, Release 5.x .

Prerequisites for Database Maintenance

Database maintenance has the following prerequisites:

  • You must have successfully installed the DCNM-LAN server.
  • Cleaning the DCNM-LAN database requires that you stop the DCNM-LAN server.
  • Restoring the DCNM-LAN database requires the following:

You must have a backup file created from exactly the same release of DCNM-LAN 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 DCNM-LAN 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 DCNM-LAN 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 DCNM-LAN 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 DCNM-LAN database from a backup of the same release of DCNM-LAN. 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 DCNM-LAN 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 DCNM-LAN database from a backup file that was made from a DCNM-LAN 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 DCNM-LAN databases running in Microsoft Server 2003.

Performing Database Maintenance

This section includes the following topics:

Backing Up the DCNM-LAN Database

You can back up the DCNM-LAN database with the backup script. The DCNM-LAN 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 DCNM-LAN 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:

 

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 DCNM-LAN 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 DCNM-LAN 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 DCNM-LAN Database

You can use the DCNM-LAN database clean script to clean the database, which deletes all data from the DCNM-LAN database. You might want to clean the database for the following reasons:

  • You want to restore the DCNM-LAN database from a backup.
  • You want to delete all data and rebuild your DCNM-LAN implementation without restoring data from a backup.

The DCNM-LAN server installer configures the clean script with the database username and database name that you specified during the server installation.

BEFORE YOU BEGIN

Back up the DCNM-LAN database. Any data not preserved in a backup is lost when you clean the database.

Stop the DCNM-LAN server. The DCNM-LAN server must be down before you can finish the database cleaning procedure. For more information, see the “Stopping DCNM-LAN Servers” section.

DETAILED STEPS


Step 1 On the DCNM-LAN server, access a command prompt.

Step 2 If you have not already done so, stop the DCNM-LAN server. For more information, see the “Stopping DCNM-LAN Servers” section.

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:

 

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 DCNM-LAN database from a backup, proceed to the “Restoring a DCNM-LAN Database from a Backup File” section. Do not start the DCNM-LAN server.

If you do not want to restore the DCNM-LAN database from a backup and want to rebuild your DCNM-LAN implementation manually, start the DCNM-LAN server. See the “Starting a Single DCNM-LAN Server” section.


 

Example

The following example from a Windows server shows how to clean a PostgreSQL DCNM-LAN 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 DCNM-LAN Database from a Backup File

You can use the Cisco DCNM database restore script to restore the DCNM-LAN 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 DCNM-LAN database.

Ensure that the backup file that you want to use to restore the database was made from the same release of DCNM-LAN. 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 DCNM-LAN database running in the same operating system as the DCNM-LAN 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 DCNM-LAN databases running in Microsoft Server 2003.

The DCNM-LAN server must be stopped while you are restoring the database.

DETAILED STEPS


Step 1 On the DCNM-LAN server, access a command prompt.

Step 2 If you have not already done so, stop the DCNM-LAN server. For more information, see the “Stopping DCNM-LAN Servers” section.

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:

 

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 DCNM-LAN database.

Step 6 At the confirmation prompt, enter y to continue with the database restore.

Step 7 To resume using DCNM-LAN, start the DCNM-LAN server. See the “Starting a Single DCNM-LAN Server” section.


 

Example

The following example from a Microsoft Windows server shows how to restore a DCNM-LAN 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 DCNM-LAN database, see the following sections:

Related Documents

 

Related Topic
Document Title

Automatic purge of event data

Chapter 22, “Administering Auto-Synchronization with Devices”

Automatic purge of statistical data

Chapter 24, “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 DCNM-LAN Database Maintenance

Table 28-1 lists the release history for this feature.

 

Table 28-1 Feature History for DCNM-LAN Database Maintenance

Feature Name
Releases
Feature Information

Database maintenance scripts

5.0(2)

No change from Release 4.2(3).