Results 1 to 6 of 6
  1. #1
    Join Date
    May 2004
    Posts
    5

    Question Unanswered: 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

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605
    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

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    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

  5. #5
    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

  6. #6
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    time is a Unix Command

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •