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

Starting and stopping instances


There are several situations in which an instance must be stopped and started, for example, after you change some parameters that are not dynamic, or after applying a fixpack.

Getting ready

We have, at disposal, a couple of different ways to start or stop an instance. We can use, say, db2start for starting and db2stop for stopping; these commands are available for execution in the command line or from DB2 CLI. We can also start or stop an instance from the Control Center. In Windows, you can also start and stop an instance by starting and stopping the service associated with it.

How to do it...

  1. The current instance is set by the environment variable DB2INSTANCE or the global registry variable DB2INSTDEF, in case DB2INSTANCE is not set. This is applicable mostly for Microsoft Windows platforms where there could be more than one instance per user.

    • On Microsoft Windows:

      C:\Documents and Settings>db2ilist
      DB2_02
      DB2WIN
      C:\Documents and Settings>set DB2INSTANCE
      DB2INSTANCE=DB2_02
      

    Now, if we issue db2stop or db2start, only instance DB2_02 will be affected.

    • On our Linux server nodedb21:

      		[db2inst1@nodedb21 ~]$ echo $DB2INSTANCE
      		db2inst1
      
  2. As the db2inst1 instance owner, stop instance db2inst1 with the db2stop command, and start it with db2start:

    [db2inst1@nodedb21 ~]$ db2stop
    06/09/2011 17:55:21     0   0   SQL1064N  DB2STOP processing was successful.
    SQL1064N  DB2STOP processing was successful.
    [db2inst1@nodedb21 ~]$ db2start
    06/09/2011 17:55:29     0   0   SQL1063N  DB2START processing was successful.
    SQL1063N  DB2START processing was successful.
    
  3. As the multipartitioned instance owner db2instp, stop instance db2instp with the db2stop command, and start it with db2start:

    [db2instp@nodedb21 sqllib]$ db2stop
    06/09/2011 19:03:47     1   0   SQL1064N  DB2STOP processing was successful.
    06/09/2011 19:03:48     0   0   SQL1064N  DB2STOP processing was successful.
    06/09/2011 19:03:49     2   0   SQL1064N  DB2STOP processing was successful.
    SQL1064N  DB2STOP processing was successful.
    [db2instp@nodedb21 sqllib]$ db2start
    06/09/2011 19:04:02     1   0   SQL1063N  DB2START processing was successful.
    06/09/2011 19:04:06     2   0   SQL1063N  DB2START processing was successful.
    06/09/2011 19:04:06     0   0   SQL1063N  DB2START processing was successful.
    SQL1063N  DB2START processing was successful.
    
  4. Using the Control Center, right-click on db2inst1 and issue stop and start.

How it works...

In the process of starting an instance, memory structures are allocated and the instance starts listening for connections on the ports assigned by the SVCENAME database manager configuration parameter. At stop, existing connections are disconnected and memory is deallocated.

There's more...

Other options that can be used to start and stop an instance are the DB2 CLI commands, START DATABASE MANAGER and STOP DATABASE MANAGER. For Windows, we have as alternate option to start or stop the service associated with the instance. To set the instance for automatic start on Linux or Unix, at system boot, you can use the instance-level registry variable DB2AUTOSTART=YES or the db2iauto –on <instance name> command.

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