Oracle statistics collection

Source: Internet
Author: User

Oracle statistics collection
Collect statistics

1: Create an analysis table

$ Cd $ ORACLE_HOME/rdbms/admin $ sqlplus/as sysdba> @ utlxplan. SQL


2: For convenience, you can create a synonymous table (by default, only sys users can use it)
SQL> create public synonym plan_tables for plan_table;


3: grant the table permission to the owner or the specified person.
SQL> grant all on plan_tables to public;


4: Create the role of plustrace
$ Cd $ ORACLE_HOME/sqlplus/admin $ sqlplus/as sysdba> @ plustrce. SQL


5: grant its permission to public
SQL> grant plustrace to public;


6. Set the display mode.
SQL> set autotrace off; # this option is used by default. autotraceSQL> set autotrace explain is not displayed; # only show the optimizer execution path SQL> set autotrace traceonly; # SQL statements output by unrealistic users> set autotrace on; # report display optimizer execution path

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.