RE: Really basic DB2 question

From: <>
Date: Wed, 18 Mar 2009 13:31:17 -0400
Message-ID: <>

Just a thank you to everyone who replied, it's been very helpful.

This database is due to be retired in about 6 weeks so I kept hoping I wouldn't have to do anything but turn it off one last time...

Jay Miller
Sr. Oracle DBA

-----Original Message-----
From: Bancea, Danut (FIN) [] Sent: Tuesday, March 17, 2009 8:54 AM
To: Miller, Jay
Subject: RE: Really basic DB2 question

Hi Jay,

You also can use "db2stop force" to stop the instance and kill all the database connections at the same time.

Here are some other useful commands:

At the database level you can quiesce/unquiesce the database

db2 "quiesce dbname immediate" - it is like shutdown immediate db2 "unquiesce dbname"

To kill a database connection:

db2 "list application"

db2 "force application (Appl.Handle1, Appl.Handle2)"

Link to the DB2 Info center:

There are two types of commands:

CLP commands - for catalog db, backup, restore, update database/instance parameters...

DB2 OS commands - system commands for : db2stop, db2start, db2look, ...


-----Original Message-----
[] On Behalf Of Grant Allen Sent: March 16, 2009 6:42 PM
Subject: Re: Really basic DB2 question wrote:
> We have an old DB2 database that's been kept for occasional querying.
> The primary DBA left the company years ago and the secondary DBA is
> on disability recovering from surgery.
> The server is being moved and as the only DBA left from that era it's
> fallen in my lap to stop the database before the move and start it
> afterwards.
> I have all the passwords and have done some minimal querying over the
> years but I've never shut down or started up a DB2 database in my
> I've googled around a bit and what I've come up with is:
> STOP DATABASE (databasename)
> START DATABASE (databasename)
> Is there anything else? Perhaps an equivalent of the oracle listener?
> I've also seen the command STOP DDF but am uncertain if this is
> something we're running. ps -ef|grep -i ddf doesn't return anything.
> Any advice from someone who knows what they're doing would be
> appreciated :).


Welcome to the dark side ;-) You'll probably be more interested in the commands to start and stop the DB2 instance, and the DAS (administration instance), rather than just stop/quiesce a database. From your Unix/Linux command line, as the instance owner, use "db2stop" to stop the regular instance, and "db2admin stop" to stop the DAS. Jared is right, running "force applications all" interactively, or "db2 force applications all" from the Unix/Linux prompt as the instance owner or SYSADMIN class user will terminate all current sessions - similar to alter session kill "sid, serial#" across all connections in Oracle.

To start them up again, "db2start" and "db2admin start" are your friends.

There's no separate listener process, this is handled by a process or thread (depending on your version #) under the control of the instance itself, so no separate start or stop commands for this required.

There are a world of other commands that can help, and there's also the GUI Control Centre (if you're server has a GUI environment, try running db2cc to launch it). You might have this installed on linux or windows client too.

<shameless author plug> You might find Beginning DB2: From Novice to Professional (Apress) a handy reference, and it's a hardback, so you can always beat the DB2 host with it if it's giving you grief :-) </shameless author plug>

Let me know if you have other questions.


Dazed and confused about technology for 20 years

Received on Wed Mar 18 2009 - 12:31:17 CDT

Original text of this message