Showing posts with label DB2 SQL. Show all posts
Showing posts with label DB2 SQL. Show all posts

How to Kill All Processes That Have Open Connection in a SQL

The below code block can be used to kill all the processes which are connected to the database named @dbname except the process that the code block is running in the scope of. You can also set the database name by the DB_NAME() property.

DECLARE @dbname nvarchar(50)
DECLARE @SPId int

SET @
dbname = N'Works'
--SET @
dbname = DB_NAME()
DECLARE my_cursor CURSOR FAST_FORWARD FOR
SELECT SPId FROM MASTER..SysProcesses
WHERE DBId = DB_ID(@DatabaseName) AND SPId <> @@SPId

OPEN my_cursor

FETCH NEXT FROM my_cursor INTO @SPId

WHILE @@FETCH_STATUS = 0
BEGIN
KILL @SPId

FETCH NEXT FROM my_cursor INTO @SPId
END

CLOSE my_cursor
DEALLOCATE my_cursor

Mainframe DB2 SQL - DB2 PROGRAMMING - DB2 Certification Guidelines

Question:I am preparing for IBM DB2 Certification.
Can anyone give the references, suggest the books for the test.



LEVEL 1 
700 DB2 Family Fundamentals Database Associate 
LEVEL 2 
Code:
     701 DB2 UDB V8.1for Linux, UNIX and Windows Database Administration
   702 DB2 UDB V8.1 for z/OS Database Administration 
   703 DB2 UDB V8.1 Family Application Development
   705 DB2 Business Intelligence Solutions V8.1 
   706 DB2 UDB V8.1 for Linux, UNIX and Windows Database Administration Upgrade exam
   442 DB2 Content Manager V8  
 LEVEL 3


Code:
704 DB2 UDB V8.1 for Linux, UNIX and Windows Advanced Database Administration 

Take the exam in LEVEL1, then take the any exam in LEVEL 2 depending on your area of interest and then LEVEL2

After passing the “DB2 Family Fundamentals” entry test #700,
take whichever exam(s) you like. Each one you pass gives you another certification.


Other Tests.. These tests are for version 7.1
512 - DB2 UDB V7.1 Family Fundamentals
514 - DB2 UDB V7.1 Family Application Development
516 - DB2 UDB V7.1 for OS/390 Database Administration