Repord Create Table Duration
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Repord Create Table Duration

  1. #1
    Join Date
    Oct 2000
    Posts
    250
    Hi all,
    I have a script to create all the tables. I create a script file called createtab.sh. Basically my script is to create numbers of tables. Inside my createtab.sh, sqlplus -s / $ORACLE_HOME/scripts/crttab1.sql,........crttab5

    I want to record down the time for each table creation.
    Any one can guide me on this ?

    Thanks

  2. #2
    Join Date
    Mar 2002
    Posts
    534
    In sql*plus you can execute a "set timing on" to display the time taken for a DML/DDL. To record the result I would add a spool command at the beging of your sql script.

    So to record down the time for each table creation I would add at the begingin of your scripts the following 2 lines:

    spool $ORACLE_HOME/.../crttab1.log
    set timing on

  3. #3
    Join Date
    Oct 2000
    Posts
    250
    Is there any Unix command to write and append the timestamp to a file rather I manually combine ?

  4. #4
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    man date?

  5. #5
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,333
    If all you want to do it append the date to the file

    date >> filename

    will stick the date to the end of the file

Posting Permissions

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


Click Here to Expand Forum to Full Width