Table Of Contents
Backup and Restore
Before You Begin
Cisco ANA Registry Backup and Restore
Overview
Backed-Up Content
Backup Procedure
Configuring Automatic Backups
Initiating Backups Manually
Troubleshooting
Changing Periodic Backup Time
Restore Procedure
Oracle Database Backup and Restore
Overview
Creating RMAN Catalog Database
Creating RMAN User
Creating RMAN Catalog
Registering the Cisco ANA Database with the RMAN Catalog
Modifying Cisco ANA Database Initial Parameter File
Backing Up the Database
Recovering the Database
Backup and Restore
This appendix includes:
•
Before You Begin
•
Cisco ANA Registry Backup and Restore
•
Oracle Database Backup and Restore
Before You Begin
The known_hosts file must contain an entry for 127.0.01 for a successful backup of Cisco ANA. The known_hosts file can contain a row for localhost as long as it also contains a row for 127.0.0.1.
To add a row for 127.0.0.1 to the /export/home/sheer4/.ssh/known_hosts file:
Step 1
Examine the /export/home/sheer4/.ssh/known_hosts file to determine if it contains a row for 127.0.0.1 with the specific key 127.0.0.1.
Step 2
If the key 127.0.0.1 is missing, enter the following command as user sheer from the ~/Main directory:
backup.pl 127.0.0.1%/export/home/sheer4/db/db_backup/
This command adds the 127.0.0.1 entry to the known_hosts file and displays the following:
remoteip: 127.0.0.1, remotedir: /export/home/sheer4/db/db_backup/
The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
DSA key fingerprint is 33:dc:5a:39:20:48:5f:5d:7d:94:63:dc:83:1a:1d:13.
Are you sure you want to continue connecting (yes/no)?
Step 3
Enter yes.
Cisco ANA Registry Backup and Restore
This section describes the Cisco ANA Registry backup and restore procedure.
•
Overview—Provides an overview of the backup procedure.
•
Backed-Up Content—Describes the data that is backed up.
•
Backup Procedure—Describes how to activate the backup procedure.
•
Changing Periodic Backup Time—Describes how to change the backup time.
•
Restore Procedure—Describes the restore procedure.
Note
Any new AVM that is added is not deleted after the restore. So if a backup is made, and then another AVM is added, and the last backup is restored, the newly added AVM is still available after the restore.
Note
SSH daemon must be enabled for backup and restore to work.
Overview
The backup procedure is used to back up the data once a week. It operates through the UNIX cron mechanism. By default, an entry in the cron table (crontab) runs the backup procedure every Sunday at 1:00 AM.
To restore data, you must execute the restore.csh script manually.
Backed-Up Content
The data that is backed up is the Cisco ANA registry (Golden Source).
Backup Procedure
The backup script is a scheduled task that operates through the cron mechanism.
The backup files are stored in the directory ~[ana install directory]/db/db_backup/[date+time] where:
•
db is the name of the database directory.
•
db_backup is the name of the database backup directory.
•
[date+time] is a directory name composed of a date and time of the backup.
For example, ~[ana install directory]/db/db_backup/200904130404/ is created on 13 April 2009 at 4:04 AM. By default, the cron table executes the backup procedure every Sunday at 1:00AM.
Note
Important: Reinstalling the server from scratch (install.pl) deletes the sheer user and the content under it. The default backup directory is located under sheer; you can change the location (see configuring the registry below) as long as the user sheer can write to it. For example, the default directory permissions are:
("drwx------ 2 sheer sheer 512 Sep 24 02:54")
We recommend that you do not locate the backup directory under /tmp, since this directory is deleted whenever the server is rebooted, and the backed-up content lost.
To maximize data safety, we recommend that you copy the backed-up directory to an external storage location, such as a DVD or a disk on a different server.
The location is configurable through the registry. For more information, see the registry path avm11/agents/integrity/backup.
Figure A-1 displays the backup registry entries.
Figure A-1 Backup Registry Entries
The backup is enabled by default. If a backup is not required, you can prevent it from running by using the Registry Editor to modify the entry in the registry.
Configuring Automatic Backups
If the backup does not run automatically:
Step 1
Log into the Cisco ANA gateway machine as user sheer.
Step 2
Edit the cron table as follows:
Step 3
Add the following line to back up the integrity tasks and the Cisco ANA registry automatically every 12 hours at 11:00AM and 11:00PM:
0 11, 23 * * * local/cron/every_12_hours.cmd > /dev/null 2>&1
Note
Refer to crontab(1) in the Solaris documentation for a detailed explanation about the cron table format.
Initiating Backups Manually
To activate the backup procedure immediately:
Step 1
Telnet to the Cisco ANA gateway as sheer user.
Step 2
Change the directory to sheer/Main:
Step 3
At the prompt, enter:
./mc.csh localhost 8011 integrity.executeTest backup
Note
It is normal for null to appear in response to this command.
Troubleshooting
The following message might appear during the backup procedure:
sheer@sh-nv210-1v5 [~/Main]% The authenticity of host `127.0.0.1 (127.0.0.1)' can't be
established.
DSA key fingerprint is 4e:cb:81:1c:bf:38:5c:ec:6e:b8:a8:d3:3b:d4:fe:b9.
Are you sure you want to continue connecting (yes/no)?
Solution
From sheer user, enter:
Changing Periodic Backup Time
A crontab file consists of lines of six fields each. The fields are separated by spaces or tabs. The first five are integer patterns that specify the following:
•
Minute (0-59)
•
Hour (0-23)
•
Day of the month (1-31)
•
Month of the year (1-12)
•
Day of the week (0-6 with 0=Sunday)
To specify days using only one field, the other field should be set to *.
For example, 0 0 * * 1 runs a command only on Mondays.
Another example cleans up core files every weekday morning at 3:15AM:
15 3 * * 1-5 find $HOME -name core 2>/dev/null | xargs rm -f
The sequence 0 0 1,15 * 1 runs a command on the first and fifteenth of each month as well as every Monday.
Restore Procedure
Install the Cisco ANA gateway. For more information, see the Cisco Active Network Abstraction Installation Guide. You need to login as root.
To restore from a backup:
Step 1
Change the directory /export/home/[ana install directory]/Main/scripts by executing the following command:
cd ~[ana install directory]/Main/scripts
Step 2
Execute the restoration script:
restore.csh [backup-files-location] [sheer-home-location]
Note
By default, [backup-files-location] is ~[ana install directory]/db/db_backup/[date+time] (as configured through the registry). The filler [date+time] is a directory name composed of a date and time backup time. For example, ~[ana install directory]/db/db_backup/200604130404/ is created on 13 April 2006 at 4:04 AM.
Step 3
Once the restoration is successful, initialize the Cisco ANA gateway by running the commands:
Note
The default password for the user sheer is sheer.
Note
When the registry is restored from the last backup, if new AVMs were added after this last registry backup, all new AVMs that were added after this backup are present.
Oracle Database Backup and Restore
This section describes the Oracle database backup and restore procedures.
•
Overview—Provides an overview of the backup and restore Recovery Manager (RMAN) tool.
•
Creating RMAN Catalog Database— Describes how to create a RMAN catalog database.
•
Creating RMAN User—Describes how to create a RMAN user.
•
Creating RMAN Catalog—Describes how to create a RMAN catalog.
•
Registering the Cisco ANA Database with the RMAN Catalog—Describes how to register the database with the RMAN catalog.
•
Modifying Cisco ANA Database Initial Parameter File—Describes how to modify the MCDB database initial parameter file.
•
Backing Up the Database—Describes how to backup the database.
•
Recovering the Database—Describes how to recover the database.
Note
This section is provided as an example only of the Oracle database backup and restore procedure. For more information, see the Oracle Database Recovery Manager Quick Start Guide.
Overview
Oracle databases have a backup and restore Recovery Manager (RMAN) tool. To use this tool for online backup, the Oracle database must be in ARCHIVELOG mode, (see Creating RMAN Catalog Database). RMAN maintains the bookkeeping intelligence of backup and recovery files and backs up data at the block level. Therefore, RMAN can significantly speed backups and reduce server load by using incremental backups.
Figure A-2 displays the Oracle Database Backup diagram.
Figure A-2 Oracle Database Backup
Note
For more information about RMAN for Oracle 10g, see the Oracle Database Recovery Manager Quick Start Guide.
RMAN is convenient to use. However, it provides only a command line interface, and requires database analyst knowledge when recovery is needed.
Be sure that the backup data and RMAN catalog are located on a different disk than the Oracle database (data files, redo logs, and control files). However, both can reside on the same ANA database server.
The Oracle Enterprise manager (GUI) can be used to set up RMAN.
As an alternative to the Oracle Enterprise manager, the following sections describe how to configure RMAN using the command line. Complete the steps in the sequence given.
Step 1
Creating RMAN Catalog Database.
Step 2
Creating RMAN User.
Step 3
Creating RMAN Catalog.
Step 4
Registering the Cisco ANA Database with the RMAN Catalog.
Step 5
Modifying Cisco ANA Database Initial Parameter File.
Step 6
Backing Up the Database.
Step 7
Recovering the Database.
Note
These steps are provided as an example only of the Oracle database backup and restore procedure. For more information, see the Oracle Database Recovery Manager Quick Start Guide.
Creating RMAN Catalog Database
The catalog database holds the recovery catalogs. This database is typically set up on a server different than any database being registered in it. It also works if this database is set up on the same database server as the Cisco ANA database.
Use the Oracle utility dbassist to create a catalog database. (This is the same as MCDB database creation, except that you name the RMAN global name rcat, and name the SID rcat.)
Creating RMAN User
Creating an RMAN user is the same as creating a Cisco ANA user on an rcat database. Name the RMAN user ID rmanuser and name the password rmanpassword. Make sure rmanuser has proper privileges. For example:
SQL> grant connect, resource, recovery_catalog_owner to rmanuser;
Creating RMAN Catalog
Create a catalog from the RMAN command prompt:
RMAN> connect catalog rmanuser/rmanpassword@rcat
Registering the Cisco ANA Database with the RMAN Catalog
Set the ORACLE_SID environment variable = MCDB.
RMAN > connect catalog rmanuser/rmanpassword@rcat
RMAN > connect target sys/change_on_install
RMAN> configure controlfile autobackup on;
The default password for an Oracle sys account after Oracle installation is change_on_install. Replace this sys account password with the correct sys account password for the Cisco ANA database.
Modifying Cisco ANA Database Initial Parameter File
To modify the MCDB database initial parameter file:
Step 1
To ensure the database is in archive log mode, enter:
SQL> alter system set log_archive_dest_1 = `location=</var/tmp/oradata/arch>' SCOPE=BOTH;
SQL> alter system archive log start;
where </var/tmp/oradata/arch> is the location of the archive destination.
Step 2
Restart the Cisco ANA database server with the ARCHIVELOG mode turned on, as follows:
alter database archivelog;
Step 3
Check the archive log mode, as follows:
Backing Up the Database
To back up the database:
Step 1
Create a file named full_backup.rcv, then enter the following text in the file:
allocate channel d1 type disk;
incremental level = 0 cumulative
format `/var/tmp/backup/db_%d_%s_%p_%t'
include current controlfile for standby
sql `alter system archive log current';
archivelog all delete input
format `/var/tmp/backup/ar_%d_%s_%p_%t';
Make sure the specified directory (in this case /var/tmp/backup) has enough space to hold the backup and that the Oracle user has write permissions.
Step 2
Run the rman command:
rman target / catalog rmanuser/rmanpassword@rcat @full_backup.rcv
Recovering the Database
To recover a database:
Step 1
Define the environment variables for Oracle:
•
export NLS_LANG=american
•
export NLS_DATE_FORMAT="Mon DD YYYY HH24:MI:SS"
•
export ORACLE_SID=MCDB
Step 2
Create a file named time_based_recovery.rcv, then insert the following content:
# Restore and Recover Database using RMAN
SET UNTIL TIME = `Mar 18 2008 10:00:00';
allocate channel d1 type disk;
alter database open resetlogs ;
Step 3
Run the rman command:
rman target / catalog rmanuser/rmanpassword@rcat @ time_based_recovery.rcv
•
Put a desirable restore time in the SET UNTIL TIME clause.
•
After a time-based recovery, immediately back up the database since the database can only be recovered after the previous recovery time, and all previous backups used for the last recovery are no longer recoverable.