官术网_书友最值得收藏!

Dropping instances

There could be situations when it is necessary to drop an instance. An instance might be dropped by using the db2idrop command.

Getting ready

In this recipe, we will drop the instance db2inst2, created previously.

How to do it...

  1. The command for dropping an instance is db2idrop. You have to be user root to drop an instance. First, we need to ensure that the instance is not active. If the instance has active connections and it is active, the db2idrop command fails.
  2. Stop the instance by force:
    [db2inst2@nodedb21 ~]$ db2stop force 07/12/2011 16:38:27 0 0 SQL1064N DB2STOP processing was successful. SQL1064N DB2STOP processing was successful. [db2inst2@nodedb21 ~]$
    

    Note

    If the instance hangs for some reason, the db2_kill command might be used. It will bring down the instance abruptly. However, be careful running this, because your databases running under this instance remain in an inconsistent mode.

  3. As the user root, issue the following command to drop db2inst2:
[root@nodedb21 ~]# /opt/ibm/db2/V9.7/instance/db2idrop db2inst2 DBI1070I Program db2idrop completed successfully.

How it works...

On Linux and Unix, db2idrop actually deletes the sqllib directory from the instance owner home. Therefore, it is recommended to save anything you have placed in this directory such as UDFs or external programs.

On Windows, db2idrop removes the service associated with the instance.

There's more…

As a best practice, before the instance is dropped, it is recommended to save the information related to that instance in a server profile file. In case you plan to recreate the instance and configure it as before, you can simply import the server profile after the instance is created again.

To export the instance profile, use Control Center | Tools | Configuration assistant | Export profile | Customize.

In the Export tab, you have plenty of options to export; choose anything you consider worth being saved.

主站蜘蛛池模板: 朝阳县| 宜兴市| 南乐县| 吉林省| 鲜城| 图木舒克市| 阳春市| 灌阳县| 江达县| 资中县| 宿州市| 江门市| 辉南县| 沾益县| 东至县| 察雅县| 屏东市| 信丰县| 古田县| 灌阳县| 峨眉山市| 贞丰县| 二手房| 武隆县| 奉节县| 长沙市| 阜康市| 凤庆县| 舞钢市| 江都市| 大荔县| 恩平市| 施甸县| 安丘市| 额敏县| 徐闻县| 武汉市| 广水市| 凤阳县| 博客| 吉林省|