| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

02-16-10, 15:09
|
|
Registered User
|
|
Join Date: Feb 2010
Posts: 3
|
|
|
Querry Execution time
|
|
Hey experts
how can display execution time for a query i.e.time lapse between start and end of executing a query
am not using any DB2 tool for querry,,am direclty using command line,,so pelase help me to find any simple syntax
to get execution time
its very urgent ,am in the middle of a performance tuning,,please help me some DBa experts
Thanks
Nimisha
|
|

02-16-10, 15:37
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,198
|
|
You can use the "db2 get snapshot for dynamic SQL on db-name".
You must first do the following: - db2 update monitor switches using statement on
- db2 reset monitor all
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

02-16-10, 16:06
|
|
Registered User
|
|
Join Date: Feb 2010
Posts: 3
|
|
|
|
Hello
thank you so much ,really appreciate ur effort to reply my querry
i tried :db2 get snapshot for dynamic SQL on (dbname)
the problm it bring pages and pages of record,,,,so i cant fetch my latest run SQL, is there any option to get only latest run querry details get fetch or any option to write into a file
am new to Db2,so please clear me the way to resolve this
thanks
Nimisha
Quote:
Originally Posted by Marcus_A
You can use the "db2 get snapshot for dynamic SQL on db-name".
You must first do the following: - db2 update monitor switches using statement on
- db2 reset monitor all
|
|
|

02-16-10, 17:21
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,198
|
|
Quote:
Originally Posted by nimisha123
Hello
thank you so much ,really appreciate ur effort to reply my querry
i tried :db2 get snapshot for dynamic SQL on (dbname)
the problm it bring pages and pages of record,,,,so i cant fetch my latest run SQL, is there any option to get only latest run querry details get fetch or any option to write into a file
am new to Db2,so please clear me the way to resolve this
thanks
Nimisha
|
I realize you will get a lot junk, but all the junk should have an execution time of zero (except the one SQL you run after you reset the montor).
To make the file smaller (but not as small as you want it) you can try this: - db2 connect to db-name
- db2 flush package cache dynamic
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|

02-16-10, 17:31
|
|
Registered User
|
|
Join Date: Feb 2010
Posts: 3
|
|
is there any syntax to write the snapshot into a file in a speciafied path as text or some other format,,,
|
|

02-16-10, 18:52
|
|
∞∞∞∞∞∞
|
|
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
|
|
Try using the time command:
time db2 -tvf <query>
|
|

02-16-10, 19:57
|
|
Registered User
|
|
Join Date: May 2003
Location: USA
Posts: 5,198
|
|
Quote:
Originally Posted by nimisha123
is there any syntax to write the snapshot into a file in a specified path as text or some other format,,,
|
You need to learn some basic operating system commands such as piping an output to a file (that have nothing to do with DB2):
db2 get snapshot for dynamic SQL on db-name > snapshot.txt
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|