Backing up and restoring network data
Most database applications require periodic backup of the database. Due to the nature of the NetIM product, database backup is not essential. Using a restored database with NetIM may present the following problems:
• If the database was backed up under an older version of NetIM, data schema changes may have occurred in the current release such that the recovered database is no longer usable.
• The other problem relates to the age of the backup. If the network configuration has changed significantly since the backup was created, NetIM takes as much time to update the database to the current state of the network as it would take to populate a fresh database. For most networks, NetIM can completely populate a network database in a matter of hours.
NetIM provides scripts that can be used to backup and restore the NetIM database in the event that you decide to keep backups of your network database or are asked to provide your database as part of a Technical Support case. This section contains the following topics:
Exporting the NetIM core database
This section contains the following topics:
Exporting the NetIM core database
These procedures can be used to backup and restore a local NetIM database, but not a remote one.
To export the NetIM database
1. Log in to NetIM core as netimadmin.
2. Navigate to the <install_dir> by entering a command like the following:
cd /data1/riverbed/NetIM/<install_dir>
3. Stop the NetIM services by entering the following commands:
bash
./app.sh -c stop ALL
4. Enter the following command:
./app.sh DB_UTIL export
Linux: ./app.sh DB_UTIL export
Numerous progress messages appear that contain backup details.
When complete, the following files are created in <install_dir>/database, and Adapter Statistics are updated:
– <dbname>_db.dmp—Backup file of the NetIM database
– <dbname>_db_export.log—Log file of the export session
5. Restart the NetIM services by entering the following command:
./app.sh -c start ALL
Exporting the NetIM core database without metric data
These procedures can be used to backup and restore a local NetIM database, but not a remote one.
Doing a full database export from NetIM, as described in
Exporting the NetIM core database, can be time-consuming and can produce very large output files. In some cases, the exported metric data may be unrelated to your export goals. To export the NetIM database, excluding metric data, use the following procedure.
To export the NetIM core database without metric data
1. Log in to NetIM core as netimadmin.
2. Navigate to the <install_dir> by entering a command like the following:
cd /data1/riverbed/NetIM/<install_dir>
3. Stop the NetIM services by entering the following commands:
bash
./app.sh -c stop ALL
4. Enter the following command:
./app.sh DB_UTIL exportNoMetrics
Linux: ./app.sh DB_UTIL export
Numerous progress messages appear that contain backup details.
When complete, the following files are created in <install dir>/database:
– <dbname>_db.dmp—Backup file of the NetIM database
– <dbname>_db_export.log—Log file of the export session
5. Restart the NetIM services by entering the following command:
./app.sh -c start ALL
Customizing a core database export
Using additional parameters, you can exclude additional data from your core database export or include only the particular information you want. This section provides the parameters you can use to do so.
To see all supported commands for DB_UTIL, enter the following at the command line:
bash
./app.sh DB_UTIL help
Verifying core database table patterns
For the core database export commands discussed in this section, you specify table patterns to match with include or exclude parameters. To verify your table patterns, use the following procedure.
To verify core database table patterns
1. Log in to NetIM core as netimadmin.
2. Navigate to the install directory, by entering a command like the following:
cd /data1/riverbed/NetIM/<install_dir>
3. Stop all services by entering the following commands:
bash
./app.sh -c stop ALL
4. Navigate to the PostgreSQL bin directory by entering the following command:
cd /data1/riverbed/DSS/PostgreSQL/9.5/bin.
5. Enter the following command:
./psql -U dssuser -p 5495 -d vnes
6. Enter your
dssuser password, which you received from
Riverbed
support.
7. Enter the following command to see a list of tables matching a string:
\dt <table_pattern>
Example: To see all tables starting with chng, enter \dt chng*.
8. Navigate to the install directory, by entering a command like the following:
cd /data1/riverbed/NetIM/<install_dir>
9. Start all services by entering the following command:
./app.sh -c start ALL
Exporting the core database without metrics and with additional exclusions
Use the -exclude parameter to specify tables you do not want to export with the core database. In the following example, tables that start with chng or with install_detail are excluded. You can use the asterisk (*) as a wild card.
bash
./app.sh DB_UTIL exportNoMetrics -exclude chng* -exclude install_detail*
You can specify as many exclusion patterns as you want by using the -exclude parameter before each.
Exporting the core database with selected tables included
To export the core database in NetIM with only selected tables, use the following command:
bash
./app.sh DB_UTIL export -include <table_pattern>
For example, in the following command exports the database and includes tables that start with chng or equal oe:
bash
./app.sh DB_UTIL export -include chng* -include oe
You can specify as many inclusion patterns as you want by using the -include parameter before each.
Exporting the core database without metrics except some metric classes
If you want to export your core database without metrics except those you specify, you need to create separate database dump files for the metric classes you want to export. Use the following procedure to export the files.
To export the core database without metric data except some metric classes
1. Export your core database without metrics by using the following command:
bash
./app.sh DB_UTIL exportNoMetrics
Linux: ./app.sh DB_UTIL export
2. Use the following command to export the required metric classes to another database dump file:
./app.sh DB_UTIL export -dumpFile <filename> -include <table_pattern>
For example, the following command exports all raw, hourly, daily, and weekly interface utilization (ifc_util) data:
./app.sh DB_UTIL export -dumpFile /data1/riverbed/DSS/ifc_util.dmp -include ifc_util_[rhdw]_[0-9]+_[0-9]+__*
You can include all required metric classes by specifying additional inclusion table patterns with the -include option in the export command above.
Can I specify both exclusions and inclusions of tables in the same export command?
Yes. However any table specified by the exclusion pattern overrides the same table specified in any inclusion pattern. Here is an easy way to remember this rule:
Tables included in database export =
Tables specified by inclusion patterns (all tables by default) — Tables specified by exclusion patterns.
Importing the NetIM core database
Perform the following procedure to import a NetIM core database. To successfully import a NetIM core database, the schema of the exported data must match the schema of the current database.
The data saved in an exported database can only be imported into the same NetIM release from which it was exported.
To import the NetIM core database
1. Log in to NetIM core as netimadmin.
2. Navigate to the NetIM installation directory, by entering a command like the following:
cd /data1/riverbed/NetIM/<install_dir>
3. Stop all services by entering the following commands:
bash
./app.sh -c stop ALL
Linux: ./app.sh cleanalldb
4. Copy the <dbname>_db.dmp file that contains the exported database to the <install_dir>/database directory. If you have renamed the file to something more descriptive (that is something with a timestamp), rename it to <dbname>_db.dmp.
5. Enter the following command:
Windows: ./app.sh DB_UTIL import
Linux: ./app.sh DB_UTIL import
– Numerous progress messages appear that contain restore details.
– A message appears when the import is complete.
./app.sh DB_UTIL import -dumpFile <filename>
7. Start NetCollector or NetIM services by entering the following command:
./app.sh -c start ALL