軟件測試初學者必讀:sqlplus的autotrace的設置

發表于:2009-10-16來源:作者:點擊數: 標簽:軟件測試autotracesqlplus初學者設置
軟件 測試 初學者必讀:sqlplus的autotrace的設置 sql數據庫 關鍵字:初學者 sqlplus autotrace 設置 autotrace是 SQL *PLUS中的一個工具,可以顯示所執行查詢的解釋計劃(explain plan)以及所用的資源。 (如果是其它版本的話可能要先執行/rdbms/admin/utlxpla
軟件測試初學者必讀:sqlplus的autotrace的設置 sql數據庫

關鍵字:初學者 sqlplus autotrace 設置

  autotrace是SQL*PLUS中的一個工具,可以顯示所執行查詢的解釋計劃(explain plan)以及所用的資源。

  (如果是其它版本的話可能要先執行/rdbms/admin/utlxplan.sql;再create public synonym plan_table for plan_table;)

  grant all on plan_table to public;

  運行sqlplus/admin/plustrace.sql;內容如下:

  --

  -- Copyright (c) Oracle Corporation 1995, 2002. All Rights Reserved.

  --

  -- NAME

  -- plustrce.sql

  --

  -- DESCRIPTION

  -- Creates a role with aclearcase/" target="_blank" >ccess to Dynamic Performance Tables

  -- for the SQL*Plus SET AUTOTRACE ... STATISTICS command.

  -- After this script has been run, each user requiring access to

  -- the AUTOTRACE feature should be granted the PLUSTRACE role by

  -- the DBA.

  --

  -- USAGE

  -- sqlplus "/ as sysdba" @plustrce

  --

  -- Catalog.sql must have been run before this file is run.

  -- This file must be run while connected to a DBA schema.

  set echo on

  drop role plustrace;

  create role plustrace;

  grant select on v_$sesstat to plustrace;

  grant select on v_$statname to plustrace;

  grant select on v_$mystat to plustrace;

  grant plustrace to dba with admin option;

  set echo off

  再執行:

  grant plustrace to public;

  set autotrace off;

  set autotrace on explain;

  set autotrace on statistics;

  set autotrace on;

原文轉自:http://www.anti-gravitydesign.com

国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97