Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    SQL ANALYZE vs dbms_stats
Go
New
Search
Notify
Tools
Reply
  
SQL ANALYZE vs dbms_stats
 Login/Join
 
Gold member
posted
We have Oracle as our RDBMS. In the past we've used SQL ANALYZE to analyze the tables. We had been told by our DBAs that using dbms_stats was more efficient but we weren't able to get it working. IBI helped us to get the correct syntax so I wanted to pass it along for others.
Note that the dbms_stats statement and options need to be on 1 line. I used <> to indicate where you would need to replace with your information. In our test the ANALYZE took 28 minutes and the dbms_stats only 17 minutes.

SQL SQLORA SET SERVER <database>;
END
-RUN

SQL SQLORA
ex sys.dbms_stats.gather_table_stats ownname => '<table owner>', tabname =>'<table name>', estimate_percent => 10, method_opt => 'for all indexed columns',cascade => TRUE, degree =>6;
END

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.7.05M, gen 144, Windows 2008 Server R2 64-bit, Tomcat 6.0.33, IIS 7.0, SQL Server, Excel 2013, PDF, HTML, FOCUS files.
 
Posts: 88 | Location: Seattle | Registered: March 29, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Bob, thanks much for the post and for sharing this performance enhancing information. Do you run dbms_stats after every table load, or only after loads/updates for tables of a certain size?

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Reply With QuoteReport This Post
Gold member
posted Hide Post
Hey Dan - good to hear from you. Yes, we do it after each of our tables are updated each night. Not the very small tables but any table of significant size. It usually runs quickly.
Bob


WebFOCUS 7.7.05M, gen 144, Windows 2008 Server R2 64-bit, Tomcat 6.0.33, IIS 7.0, SQL Server, Excel 2013, PDF, HTML, FOCUS files.
 
Posts: 88 | Location: Seattle | Registered: March 29, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    SQL ANALYZE vs dbms_stats

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.