Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Should you or should you not analyze sys schema in 9i? 2

Status
Not open for further replies.

dbtoo2001

MIS
Jun 18, 2001
415
US
I am interested in your real world experiences in the analyzing of sys schema in 9i. Some documents state it should be done. What have you found to be the real world case?
Also, I was wondering what your real world experience is for analyzing other schemas? Do you do it on a scheduled basis, monitored basis (gather stale), or other? (Analyzing invalidates the shared pool for sql that is acting on the newly
Thanks.
 
I dont have any comments on analyzing the sys schema but I think you should famiarize yourself with the new DBMS_STATS package where you can gather statistics. We have migrated our data warehouse completely off of analyze statements and have been using DBMS stats package, we analyze every table after 10% of the data has changed.
 
Dima, do you have an oracle reference, or strictly experience? (I know, I was asking for experience, not reference.) Do you have any scenarios where dropping the stats gave better execution?
 
Hi,
If I may step in:

Thomas Kyte in his "Expert One-on-One Oracle" clearly states the reason ( Appendix A, page 1176) :( to paraphrase)

For SYS schema especially, the recursive SQL generated by Oracle over the years was optimized for execution using the rule-based optimizer.Having Ststistics on SYS ( and SYSTEM) objects will cause your database to operate slower than it should.




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
The only thing I know about analyzing the Oracle catalog tables is that the last couple of 9.2 patch sets have recommended running dbms_stats.drop_schema_stats on the sys schema before running the upgrade script, and then running dbms_stats.gather_schema_stats afterwards. The installation instructions say that the upgrade script will run faster with no statistics.

So you can take that advice for what it's worth. On the surface, it appears that there are certain situations where things will run faster without catalog statistics. On the other hand, the fact that the installation instructions say to run gather_schema_stats at the end of the upgrade script strongly implies that Oracle thinks it's just fine in general to generate statistics on the catalog tables.
 
Ok, I found that it's essential to use dbms_stats.gather_schema_stats and not other ways of gathering statistics on SYS schema, e.g. in Note 245051.1

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top