Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: Performance & Tuning >> Query optimization - need help

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: Query optimization - need help
 Gai  Posted: Oct 06, 2006 04:12:57 PM

 Total Post: 8
 Joined: Aug, 2006






 Hi
I am working on a query that refrences 4 tables and the query is going to give out abt 2.5 million records. Now I have this query in a sql script and I call this sql script from a shell script. I spool the result of this query into a file and I find that it takes almost 3 hrs for the process to be completed. When I try executing the query on Toad/sqlplus, it gives me the result in 1 min. Does it mean that the spooling of file takes a long time? Does it usually take this time for 2.5 million records?
The surprising thing is that when I run it in the test environment, I dont get any errors and the process completes in 3 hrs which is fine. But when I run it in production, I get a rollback segment error. This is just a select statement and I am not writing into any temporary tables. What could be the reason for the failure of the query in production environment? Has it got anything to do with the settings fo the database? Any help to solve the problem is greatly appreciated. Thanks!
Gayathri

 Gai
Posted: Oct 06, 2006 04:19:02 PM  

 Total Post: 8
 Joined: Aug, 2006






 
Forgot to mention that Iam working in oracle 9i...

 Vigyan
Posted: Oct 09, 2006 03:23:37 PM  

 Total Post: 386
 Joined: May, 2001






 
Hi Gai,

Yes, spooling file can take longer time as it depends on type of data you have, disk speed and other related hardware components.

Oracle use rollback segment for READ CONSISTENCY. You should increase its size. You can test it by creating a bigger rollback segment and assign it to the transaction by using SET TRANSACTION command.


Hope it helps.

Vigyan



 PP
Posted: Oct 26, 2006 01:13:45 AM  

 Total Post: 11
 Joined: Oct, 2006






 
I am quite eager to know what is the purpose of generating a 2.5 million record report.

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi333
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software