Ronald, In order to execute any db2 command you need the database manager running. 
Once you issue db2stop, you cannot execute any DB2 commands for that instance. 
Following strategy might work for you, set the DB2INSTANCE and the db2 path variable 
to point to each instance and then stop each one of them.
Regards,
Ajith

-----Original Message-----
From: Ronald Draper [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 17, 2001 2:40 PM
To: [EMAIL PROTECTED]
Subject: DB2EUG: Shutting down a DB2 NT server cleaning



We are trying to develop a batch file that will cleanly stop all of the DB2 instances 
and services, so we can do maintenance on the box.  The servers have multiple 
instances on the box.  I can shut down the first instance with no problems but when I 
try attaching to the second instance it fails.  Any help would be greatly appreciated. 
 Here is a copy of the code in the batch file: 

** Stopping the Cool-Gen services to DB2  ** 
!NET STOP TE-AD-51-1; 
!NET STOP TE-UF-51-1; 

!NET STOP TE-AD-51-2; 
!NET STOP TE-UF-51-2; 

!NET STOP TE-AD-51-CRID1; 
!NET STOP TE-UF-51-CRID1; 

ATTACH TO NRDEVL1 USER XXXXXXXX USING XXXXXXXXXXX; 

LIST APPLICATIONS FOR DATABASE NRDAIRD1 SHOW DETAIL; 
LIST APPLICATIONS FOR DATABASE NRDHPPD1 SHOW DETAIL; 

DB2STOP FORCE; 

ATTACH TO NRTEST1 USER XXXXXX USING XXXXX; 

LIST APPLICATIONS FOR DATABASE NRDAIRT1 SHOW DETAIL; 

DB2STOP FORCE; 

DB2ADMIN STOP;

Here is what is returned 


!NET STOP TE-AD-51-1 

!NET STOP TE-UF-51-1 

!NET STOP TE-AD-51-2 

!NET STOP TE-UF-51-2 

!NET STOP TE-AD-51-CRID1 

!NET STOP TE-UF-51-CRID1 

ATTACH TO NRTEST1 USER XXXXXXXX USING         

   Instance Attachment Information 

 Instance server        = DB2/NT 6.1.0 
 Authorization ID       = XXXXXXXXXX 
 Local instance alias   = NRTEST1 


LIST APPLICATIONS FOR DATABASE NRDAIRT1 SHOW DETAIL 

Auth Id  Application Name     Appl.      Application Id                 Seq# Number of 
 Coordinating Coordinator     Status                         Status Change Time        
 DB Name  DB Path 
                              Handle                                         Agents    
 Node Number  pid/thread 
-------- -------------------- ---------- ------------------------------ ---- 
---------- ------------ --------------- ------------------------------ 
-------------------------- -------- -------------------- 
XXXXXXX  NR34S201.exe         21         *LOCAL.NRTEST1.010516123102    0001 1         
 0            336             UOW Waiting                    Not Collected             
          NRDAIRT1 F:\NRTEST1\NODE0000\SQL00001\ 
XXXXXXX  NR34S202.exe         22         *LOCAL.NRTEST1.010516123113    0001 1         
 0            344             UOW Waiting                    Not Collected             
          NRDAIRT1 F:\NRTEST1\NODE0000\SQL00001\ 


DB2STOP FORCE 
DB20000I  The DB2STOP command completed successfully. 

ATTACH TO NRDEVL1 USER XXXXXXX USING         
SQL1032N  No start database manager command was issued.  SQLSTATE=57019 

LIST APPLICATIONS FOR DATABASE NRDAIRD1 SHOW DETAIL 
SQL1032N  No start database manager command was issued.  SQLSTATE=57019 

LIST APPLICATIONS FOR DATABASE NRDHPPD1 SHOW DETAIL 
SQL1032N  No start database manager command was issued.  SQLSTATE=57019 

DB2STOP FORCE 
SQL1032N  No start database manager command was issued.  SQLSTATE=57019 

DB2ADMIN STOP 
DB21034E  The command was processed as an SQL statement because it was not a 
valid Command Line Processor command.  During SQL processing it returned: 
SQL1024N  A database connection does not exist.  SQLSTATE=08003 

Any help would be greatly appreciated.  This script is being used by the network team 
to shut down the server, so DB2 doesn't have to do a crash recovery. 

Ron Draper
Computer Information Technology Specialist I
Missouri Department of Natural Resources
MIS Program
526-1077

[EMAIL PROTECTED]
Microsoft Certified Professional




=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod

Reply via email to