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.

 
Go Back  dBforums > Database Server Software > DB2 > How to record statistics?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-02-04, 06:07
Swatis Swatis is offline
Registered User
 
Join Date: May 2004
Posts: 5
Question How to record statistics?

Hi

I am executing a set of insert statements from Command window using interactive mode (db2 -t -z result.txt -f cust_info.sql).

There are about 10000+ records to load.How do I record the time taken to load these records?

Is there any setting like set timing on or something like that?
Using LIST COMMAND OPTIONS?

Any help on this will be greatly appreciated.

Regards
Swati
Reply With Quote
  #2 (permalink)  
Old 07-02-04, 06:38
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

In input file the first SQL should be:
select current timestamp from sysibm.sysdummy1;

In input file the last SQL should be the same as above SQL. Then manualy calculate the difference between secound and first SQL.

You can also create a table and insert two values into table and then write SQL to calculate difference.

Hope this helps,
Grofaty
Reply With Quote
  #3 (permalink)  
Old 07-02-04, 08:18
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
You might want to look at the db2batch program described in the Command Reference manual.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 07-05-04, 01:19
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

Unix operating system command "time" can be sufficient enough.

Sample:
db2 connect to <dbname>
time db2 select * from db2admin.staff

Hope this helps,
Grofaty
Reply With Quote
  #5 (permalink)  
Old 07-06-04, 01:20
Swatis Swatis is offline
Registered User
 
Join Date: May 2004
Posts: 5
I tried to use the 'Time' Command.It gives me following message.Any idea why?

E:\ECS_GCS\ORACLE\Data\SQL>db2 connect to gcs_stag user gcs using TePyrKKI;

Database Connection Information

Database server = DB2/SUN 8.1.3
SQL authorization ID = GCS
Local database alias = GCS_STAG


E:\ECS_GCS\ORACLE\Data\SQL>time db2 select count(*) from local_cbid
The system cannot accept the time entered.
Enter the new time: 10.45

E:\ECS_GCS\ORACLE\Data\SQL>time db2 select count(*) from local_cbid
The system cannot accept the time entered.
Enter the new time:

E:\ECS_GCS\ORACLE\Data\SQL>db2 select current timestamp from sysibm.sysdummy1

1
--------------------------
2004-07-06-10.47.15.072965

1 record(s) selected.

Regards
Swati
Reply With Quote
  #6 (permalink)  
Old 07-06-04, 02:06
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
time is a Unix Command

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On