idsdbrestore, dbrestore
Use the dbrestore command to restore a database and configuration files for a directory server instance.
Description
The dbrestore command restores database and configuration files for a directory server instance when the instance is offline. You must stop the instance before you run the dbrestore command.
- Specifying backup location on an NFS mounted partition and restoring
from an NFS mounted partition causes the following error.
The idsdbback or idsdbrestore operation must be done on a local drive or partition only.2004-10-07-21:08:00.native retcode = -1026; state = "^A"; message = "SQL1026N The database manager is already active." 2004-10-07-21:08:01.native retcode = -2025; state = "^A"; message = "SQL2025N An I/O error "6" occurred on media "/dbrestore/backup/SVTINST1.0.svtinst1.NODE0000.CATN0000.20041007185"."
- You can run the db2 rollforward command when
you restore from an online backup. After the restore operation and
before you start the server, run the db2 rollforward command.
You must run this command if you get the following errors.db2 rollforward db dbname to end of logs and stop
SQL1117N A connection to or activation of database dbname cannot be made because of ROLL-FORWARD PENDING.
- When you restore from an online backup, the idsdbrestore command attempts to restore from the online backup image. This image is in the backup directory path that is specified by using the -k parameter. At any time, only one online backup image is in existence and only that online backup image must be used for the restore operation.
- When you run idsdbrestore with -x,
you might see unexpected results if the backed up configuration file
and the configuration file of the instance to restore are inconsistent.
For example:
- Server type mismatch (
RDBM
/PROXY
). For example, restoring frominst1
an instance withRDBM
toinst1
a proxy instance by using idsdbrestore -x. - Matching server type but server name mismatch. For example, restoring
from
inst1
an instance withRDBM
toinst2
an instance withRDBM
by using idsdbrestore -x.
- Server type mismatch (
Synopsis
idsdbrestore | dbrestore -I instancename -k backupdir [-d debuglevel]
[-b outputfile] [-r] [-q] [-n][[-l] | [-x]]] | -v | -?
Options
The idsdbrestore command takes the following parameters.- -b outputfile
- Specifies the full path of a file to redirect console output. If you use this parameter with the -q parameter, errors are sent to the outputfile file. If debug mode is set, then the debug output is sent to this file.
- -d debuglevel
- Sets the LDAP debug level to debuglevel. If you specify this parameter, it sends the debug output to stdout. The debuglevel value is a bit mask that controls which output is generated with values from 1 to 65535. For more information about debug levels, see Debugging levels.
- -I instancename
- Specifies the directory server instance name for which you want to restore the database and configuration and schema files.
- -k backupdir
- Specifies the directory from which to restore. The idsdbrestore command restores a database into a database and database instance with the same name from a database backup location.
- -l
- Specifies to include change log data for restore, if change log configured.
- -n
- Specifies to run in no prompt mode. All output from the command is generated, except for messages that require user interaction.
- -q
- Specifies to run in quiet mode. All output from the command is suppressed, except for error messages. If you also specify the -d parameter, then the trace output is not suppressed.
- -r
- Specifies not to restore the ibmslapd.conf file.
- -v
- Specifies to show the version information of the command.
- -x
- Specifies not to restore database files, indicating a proxy restore.
- -?
- Specifies to show the syntax format.
Examples
- Example 1:
- To restore a database, configuration files, and schema files for
a directory server instance, run the following command:
idsdbrestore -I instance_name -k /backupdir
- Example 2:
- To restore a proxy server instance, run the following command:
idsdbrestore –I proxy_instance –k /backup_dir –x -n
- Example 3:
- To restore a directory server instance and the change log data
for the instance, run the following command:
idsdbrestore -I instance_name -l -k /backupdir