Removes a DB2® instance
that was created by db2icrt.
You can only drop instances that are listed by the db2ilist command
for the same DB2 copy where
you are issuing the db2idrop command from. You
can also use the db2idrop command to drop a DB2 pureScale® instance.
On Linux and UNIX operating systems, this utility
is located in the DB2DIR/instance directory,
where DB2DIR represents the installation location
where the current version of the DB2 database
system is installed. On Windows operating
systems, this utility is located under the DB2PATH\bin directory
where DB2PATH is the location where the DB2 copy is installed.
Note: A non-root-installed DB2 instance, on Linux and UNIX operating systems, cannot be
dropped using this command. The only option is to uninstall the non-root DB2 copy. See the following Usage
notes section for more details.
Authorization
Root user
or non root user authority is required on Linux and UNIX operating
systems. Local Administrator authority is required on Windows operating
systems.
Command syntax
- For root installation on Linux and UNIX operating systems
>>-db2idrop--+-----+--+-----+----| DB2 pureScale options |------>
'- -d-' +- -h-+
'- -?-'
>----| Outside Of DB2 pureScale options |----InstName----------><
DB2 pureScale options
|--+-----+------------------------------------------------------|
'- -g-'
Outside Of DB2 pureScale options
|--+-----+------------------------------------------------------|
'- -f-'
- For a non-root thin server instance on Linux and AIX operating
systems
>>-db2idrop--+-----+--+-----+----------------------------------><
'- -d-' +- -h-+
'- -?-'
- For root installation on Windows operating
systems
>>-db2idrop--InstName--+-----+--+-----+------------------------><
'- -f-' '- -h-'
Command parameters
- For root installation on Linux and UNIX operating systems
- -d
- Enters debug mode, for use by DB2 database
support.
- -h | -?
- Displays the usage information.
- -g
- This parameter is required when db2idrop is
used with a DB2 pureScale instance.
Specifies that you want to drop the DB2 pureScale instance
on all hosts. This parameter requires all DB2 members and
all cluster
caching facilities are
stopped on all the hosts in the DB2 pureScale instance.
This option will be ignored for dropping any other instance type
- -f
- This parameter is deprecated.
Specifies the
force applications flag. If this flag is specified all the applications
using the instance will be forced to terminate. This parameter is
not supported on a DB2 pureScale environment.
- InstName
- Specifies the name of the instance.
- For a non-root thin server instance on Linux and AIX operating
systems
- -d
- Enters debug mode, for use by DB2 database
support.
- -h | -?
- Displays the usage information.
- For root installation on Windows operating
systems
- -f
- Specifies the force applications flag. If this flag is specified
all the applications using the instance will be forced to terminate.
- -h
- Displays usage information.
- InstName
- Specifies the name of the instance.
Example
If
you created
db2inst1 on a Linux or UNIX operating
system by issuing the following command:
/opt/IBM/db2/copy1/instance/db2icrt -u db2fenc1 db2inst1
To
drop
db2inst1, you must run the following command:
/opt/IBM/db2/copy1/instance/db2idrop db2inst1
Usage notes
- Before an instance is dropped, ensure that the DB2 database manager has been stopped on all
hosts and that DB2 database
applications accessing the instance are disconnected and terminated. DB2 databases associated with the
instance can be backed up, and configuration data saved for future
reference if needed.
- The db2idrop command does not remove any databases.
Remove the databases first if they are no longer required. If the
databases are not removed, they can always be catalogued under another DB2 copy of the same release and
continued to be used.
- If you want to save DB2 Text Search configurations
and plan to reuse instance databases, you need to take the extra step
of saving the config directory (on UNIX: instance_home/sqllib/db2tss/config and
on Windows: instance_profile_path\instance_name\db2tss\config)
or config directory contents before issuing the db2idrop command.
After the new instance is created, the config directory
can be restored. However, restoring the config directory
is only applicable if the new instance created is of the same release
and fix pack level.
- A non-root-installed instance cannot be dropped on Linux and UNIX operating
systems. To remove this DB2 instance,
the only option available to the user is to uninstall the non-root
copy of DB2 by running db2_deinstall
-a.
- On Linux and UNIX operating systems, if you are using the su command
instead of the login command to become the root
user, you must issue the su command with the - option
to indicate that the process environment is to be set as if you had
logged in to the system using the login command.
- On Linux and UNIX operating systems, you must not source
the DB2 instance environment
for the root user. Running db2idrop when you sourced
the DB2 instance environment
is not supported.
- In a DB2 pureScale environment,
the -g parameter is mandatory. In this case,
the instance is dropped on all hosts. However, the IBM® General Parallel File System (GPFS™) on the installation-initiating host (IIH)
is not deleted, nor is the GPFS file
system. You must manually remove the file system and uninstall GPFS.
- On Windows operating
systems, if an instance is clustered with Microsoft Cluster Service (MSCS), then
you can uncluster that instance by issuing the db2mscs or db2iclus command
before dropping the instance.
On AIX® 6.1 (or higher), when running this command
from a shared DB2 copy
in a system workload partition (WPAR) global environment, this command
must be run as the root user. WPAR is not
supported in a DB2 pureScale environment.