Oracle 10gR 2 에서 단일 sql 을 위해 SQL Access Advisor 를 실행 합 니 다.

1372 단어 OracleDB
SQL Access Advisor 를 단일 sql 로 실행 합 니 다.
참고:
https://oracle-base.com/articles/10g/sql-access-advisor-10g
[oracle@test ~]$ sqlplus scott/aaaaaa

SQL*Plus: Release 10.2.0.5.0 - Production on Sat Jul 1 07:22:20 2017

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> BEGIN
  2  DBMS_ADVISOR.quick_tune(
  3  advisor_name => DBMS_ADVISOR.SQLACCESS_ADVISOR,
  4  task_name    => 'emp_quick_tune_12345',  
  5  attr1        => 'SELECT e.* FROM emp e WHERE UPPER(e.ename) = ''SMITH''');
  6  END;
  7  /

PL/SQL procedure successfully completed.

SQL> SET LONG 100000
SQL> SET PAGESIZE 50000
SQL> SELECT DBMS_ADVISOR.get_task_script('emp_quick_tune_12345') AS script FROM   dual;

SCRIPT
--------------------------------------------------------------------------------
Rem  SQL Access Advisor: Version 10.2.0.5.0 - Production
Rem
Rem  Username:          SCOTT
Rem  Task:          emp_quick_tune_12345
Rem  Execution date:  01/07/2017 07:23
Rem

CREATE INDEX "SCOTT"."EMP_IDX$$_00710001"
    ON "SCOTT"."EMP"
    (UPPER("ENAME"))
    COMPUTE STATISTICS;



SQL>

좋은 웹페이지 즐겨찾기