Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
IBM DB2 9.7 Advanced Administration Cookbook

You're reading from   IBM DB2 9.7 Advanced Administration Cookbook Over 100 recipes focused on advanced administration tasks to build and configure powerful databases with IBM DB2 book and ebook

Arrow left icon
Product type Paperback
Published in Feb 2012
Publisher Packt
ISBN-13 9781849683326
Length 480 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

Table of Contents (21) Chapters Close

IBM DB2 9.7 Advanced Administration Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. DB2 Instance—Administration and Configuration FREE CHAPTER 2. Administration and Configuration of the DB2 Non-partitioned Database 3. DB2 Multipartitioned Databases—Administration and Configuration 4. Storage—Using DB2 Table Spaces 5. DB2 Buffer Pools 6. Database Objects 7. DB2 Backup and Recovery 8. DB2 High Availability 9. Problem Determination, Event Sources, and Files 10. DB2 Security 11. Connectivity and Networking 12. Monitoring 13. DB2 Tuning and Optimization 14. IBM pureScale Technology and DB2 Index

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.

You have been reading a chapter from
IBM DB2 9.7 Advanced Administration Cookbook
Published in: Feb 2012
Publisher: Packt
ISBN-13: 9781849683326
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime