Hi all. I would like to know what the fastest, lightest weight
query/SQL a client can send to the DBMS. I want to do this
occasionally from a Java client to verify the current health
of an otherwise idle connection. In Oracle we can select from
the fake table 'DUAL', or the SQL 'BEGIN NULL; END;'. What is
a DB2 equivalent/approximate?
thanks,
Joe Weinstein at BEA Systems
shsandeep - 29 Jul 2006 04:02 GMT
db2 select 1 from SYSIBM.SYSDUMMY1
Serge Rielau - 29 Jul 2006 04:28 GMT
> Hi all. I would like to know what the fastest, lightest weight
> query/SQL a client can send to the DBMS. I want to do this
> occasionally from a Java client to verify the current health
> of an otherwise idle connection. In Oracle we can select from
> the fake table 'DUAL', or the SQL 'BEGIN NULL; END;'. What is
> a DB2 equivalent/approximate?
SELECT 1 FROM SYSIBM.SYSDUMMY1
In DB2 for LUW that won't even hit the buffer pool.
You could also update a special register (saves the cursor logic):
SET CURRENT SCHEMA = SCHEMA
Cheers
Serge

Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
IOD Conference
http://www.ibm.com/software/data/ondemandbusiness/conf2006/