-
Hi,
I want to do a complete analyze of all tables and index in a schema. Do I use analyze_table on every table or do I use Analyze_schema (taht will analyze every tables and index under the shcema)?
Which one is less consuming for the CPU and the system ?
Thank for your help !
-
-
Hi
Right use analyze_schema this is less time consuming for you in one command it will analyze all the objects in the schema where if you analyze using analyze_table you will have to do it manually one by one or write a script put all the analyze_table statements in it and then execute the file.I feel both of them will consume the same CPU resources
Regards
-
Thank You very much !!! I really appreciate.
-
However, analyze_schema is a serial process. If you write your own, you can launch several jobs simultanwously that can each analyze a different set of tables. This is, AFAIK, the most efficient way to analyze the entire schema.
- Chris
-
with DBMS_STATS you can analyze the schema in parallel
-
I read that analyze_schema can sometimes lock the whole system...is this true ? how do you avoid that ?
I have these 2 scripts for analyze_schema..
BEGIN
sys.dbms_utility.analyze_schema ( '&OWNER','COMPUTE');
END ;
/
BEGIN
dbms_utility.analyze_schema ( '&OWNER', 'ESTIMATE', NULL, 5 ) ;
END ;
/
Whats the difference between ESTIMATE and COMPUTE...
We always do compute here. When will you do Estimate ?
When do you do validate structure ?
Also if you do analyze table it does analyze indexes too right, I saw the new date in user_indexes tables..just wanted to confirm this.
If say I analyze all of my tables today i.e May 21st... and I do lots of DML on that database. For how long will they be using cost based optimizer ? In other words when do I need to analyze all my tables again ?
thanks
Sonali