Why is it important to analyze , and what is analyze anyway ?
well analyze is a method to gather statistics on table objects in order for the optimizer
to choose the best way for executing queries .
for example the optimizer may choose to use full table scan or to use table index ,
it does so by looking at the table statistics .
Oracle doesn’t gather statistics on schema’s all by it self and the DBA must do it
as part of database maintenance . its is wise to analyze your schema on regular basis’s ,
depend on the data changes . i will show you a small script that can help you analyze your schema .

 

#!/bin/sh
#
# This script will call dbms_stats to Analyze SCHEMA_OWNER schema

ORACLE_SID=<sid name>
ORACLE_BASE=<path to oracle base>
ORACLE_HOME=<path to oracle home>
export ORACLE_SID ORACLE_BASE ORACLE_HOME

$ORACLE_HOME/bin/sqlplus -s ” / as sysdba” <<eof1
spool /tmp/Analyzing.txt
exec dbms_stats.gather_schema_stats(ownname=>’SCHEMA_OWNER’,estimate_percent=>5,cascade=>true);
exit;
eof1

  1. BlueHost Promo says:

    woot, thankyou! I finally came to a site where the webmaster knows what they’re talking about. Do you know how many results are in Google when I search.. too many! It’s so annoying having to go from page after page after page, wasting my day away with thousands of people just copying eachother’s articles… bah. Anyway, thankyou very much for the info anyway, much appreciated.

  2. Fun games says:

    Great article. Thank you to tell us more useful information. I am looking forward to reading more of your articles in the future.

  3. Jenifer says:

    Cool…

    Hi there, just became alert to your blog through Google, and found that it is really informative. I’m going to watch out for brussels. I’ll appreciate if you continue this in future. Lots of people will be benefited from your writing. Cheers!…

  4. Homepage says:

    Merely wanna input on couple of common points, The site style is perfect, the topic material is rattling superb : D. 445065

  5. Oakley Dispatch says:

    …Visitor recommendations…

    [...]I am no longer certain the place you’re getting your information, but great topic.[...]…

  6. Augusta says:

    wonderful points altogether, you just received a new reader.
    What might you recommend about your put up that you made a few days
    ago? Any certain?
    my web-site; reverse mortgage cons

  7. Ellen says:

    Hi! I know this is sort of off-topic but I needed to ask.

    Does running a well-established blog such as yours require a massive amount work?
    I’m brand new to blogging however I do write in my diary every day. I’d like to start a blog so I can share my own experience and thoughts online. Please let me know if you have any kind of ideas or tips for brand new aspiring blog owners. Appreciate it!
    My web-site :: “http www INFORMATIONABOUTREVERSEMORTGAGES US” information about reverse mortgages

  8. Custom USB Drive says:

    Such a great blog post. Thank you very much for sharing this blog post……

  9. Osama says:

    Many thanks for the example, it is straight forward