DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: UTL_FILE or Sqlplus Spool

  1. #1
    Join Date
    Oct 2006
    Posts
    175

    UTL_FILE or Sqlplus Spool

    Hello all,
    Could anybody suggest me if UTL_FILE or Sqlplus Spool has better performance to dump around one million rows in some 80+ text files. I googled for references, ended up with these two forum threads, with no clear clue on what to follow with:

    http://www.dbasupport.com/forums/arc...p/t-44153.html
    http://www.dbforums.com/showthread.php?t=1616497

    Merry X-mas to all !!!

    Thanking you all in advance,
    gtcol

  2. #2
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    I would go with simple spool command.

    Follow this rule:
    If you can do the job in a single SQL statement, do it.
    If it can not be done in SQL, use PL/SQL.

  3. #3
    Join Date
    Oct 2006
    Posts
    175
    What about performance, as it is said, UTL_FILE is faster while reading/writing bulk number of records. Spool is better with smaller numbers.

  4. #4
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    Quote Originally Posted by gtcol
    What about performance, as it is said, UTL_FILE is faster while reading/writing bulk number of records. Spool is better with smaller numbers.
    TEST, TEST, TEST

  5. #5
    Join Date
    Oct 2006
    Posts
    175
    Sure Tamil,
    I was just expecting some advices from the seniors as I don't have a dev db with me for the time being, for testing purpose.
    Thanking you once again,
    gtcol

  6. #6
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Quote Originally Posted by gtcol
    What about performance, as it is said, UTL_FILE is faster while reading/writing bulk number of records. Spool is better with smaller numbers.
    Is this a recurrent or a one-time task?

    If it's a one-time task I'll go with sql spool solution, if this is a recurrent task I would go with pl/sql ult_file solution.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  7. #7
    Join Date
    Oct 2006
    Posts
    175
    Thanks PAVB for your valuable input.
    I did with sqlplus spool this time, but I am also working with a UTL_FILE script as I can see this task recurring in the future. And testing is still there. .

    gtcol

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