ORACLE 10G AUTOTRACE
原創
O7_DICTIONARY_ACCESSIBILITY是針對select any table許可權控制是否可以訪問相關資料字典的
今天在資料庫ORACLE 10G測試了下 AUTOTRACE 功能 發現原來10G中不用在手工建立PLAN_TABLE了可以直接進行SET AUTOTRACE ON。
我首先建立測試使用者TEST 密碼為TEST
create user test identified by test
然後賦予許可權
grant connect to test
grant select any table to test
grant CREATE any table to test
然後建立PLUSTRACE角色,並且賦予給TEST
grant plustrace to test
然後切換使用者到 TEST
connect
SQL> select * from session_roles;
ROLE
------------------------------
CONNECT
PLUSTRACE
SQL> select * from session_privs;
PRIVILEGE
----------------------------------------
CREATE SESSION
ALTER SESSION
CREATE TABLE
CREATE ANY TABLE
SELECT ANY TABLE
CREATE CLUSTER
CREATE SYNONYM
CREATE VIEW
CREATE SEQUENCE
CREATE DATABASE LINK
但是在進行SET AUTOTRACE ON 報錯
SQL> set autotrace on
SP2-0618: 無法找到會話識別符號。啟用檢查 PLUSTRACE 角色
SP2-0611: 啟用STATISTICS報告時出錯
SQL> select * from session_roles;
ROLE
------------------------------
CONNECT
PLUSTRACE
Execution Plan
----------------------------------------------------------
ERROR:
ORA-01039: insufficient privileges on underlying objects of the view
SP2-0612: 生成AUTOTRACE EXPLAIN報告時出錯
分析下 ORA-01039: insufficient privileges on underlying objects of the view 可以發現可能是因為對底層的資料字典表的訪問許可權不夠所以可能涉及到引數O7_DICTIONARY_ACCESSIBILITY
SQL> show parameter o7
NAME TYPE VALUE
------------------------------------ ----------- ------------
O7_DICTIONARY_ACCESSIBILITY boolean FALSE
然後修改
SQL> alter system set O7_DICTIONARY_ACCESSIBILITY=true scope=spfile;
系統已更改。
SQL> SHUTDOWN IMMEDIATE
資料庫已經關閉。
已經解除安裝資料庫。
ORACLE 例程已經關閉。
SQL> startup
ORACLE 例程已經啟動。
Total System Global Area 369098752 bytes
Fixed Size 788952 bytes
Variable Size 342619688 bytes
Database Buffers 25165824 bytes
Redo Buffers 524288 bytes
資料庫裝載完畢。
資料庫已經開啟。
SQL> SHOW PARAMETER O7
NAME TYPE VALUE
------------------------------------ ----------- -----------------------------
O7_DICTIONARY_ACCESSIBILITY boolean TRUE
然後更改使用者
SQL> set autotrace on;
SQL> select * from session_roles;
ROLE
------------------------------
CONNECT
PLUSTRACE
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT ptimizer=ALL_ROWS (Cost=25 Card=1 Bytes=28
)
1 0 NESTED LOOPS (Cost=25 Card=1 Bytes=28)
2 1 FIXED TABLE (FULL) OF 'X$KZSRO' (TABLE (FIXED)) (Cost=24
Card=1 Bytes=13)
3 1 TABLE ACCESS (CLUSTER) OF 'USER$' (CLUSTER) (Cost=1 Card
=1 Bytes=15)
4 3 INDEX (RANGE SCAN) OF 'I_USER#' (INDEX) (Cost=0 Card=1
)
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
0 consistent gets
0 physical reads
0 redo size
0 bytes sent via SQL*Net to client
0 bytes received via SQL*Net from client
0 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
2 rows processed
SQL>
現在已經正常了
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7728585/viewspace-483773/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 10g R2 autotrace 增強Oracle 10g
- Oracle AutotraceOracle
- 關於ORACLE AUTOTRACEOracle
- ORACLE 使用AUTOTRACE功能Oracle
- Oracle最佳化工具——AutoTraceOracle
- oracle之autotrace統計資訊分析Oracle
- oracle 9i 開啟autotrace onOracle
- Oracle 9I 下的AutoTraceOracle
- 【優化】ORACLE set autotrace in SQL*Plus優化OracleSQL
- 【AUTOTRACE】SQL優化的重要工具--AUTOTRACESQL優化
- 10g 中使用toad的sql編輯的autotrace的問題?SQL
- (轉)oracle效能工具包Explain plan、Autotrace、TkprofOracleAI
- ORACLE 10g下載|ORACLE 10g下載地址|ORACLE 10g官網下載地址Oracle 10g
- oracle 10g patchOracle 10g
- oracle asm 10gOracleASM
- recyclebin for oracle 10gOracle 10g
- Oracle 10g flashbackOracle 10g
- Glossary Oracle 10gOracle 10g
- set autotrace in SQL*PlusSQL
- Autotrace 用法總結
- oracle10g_10.2.0.1_sql tuning_set autotrace配置OracleSQL
- Oracle 9i 開啟autotrace on 檢視執行計劃Oracle
- oracle 10g flashback databaseOracle 10gDatabase
- Oracle 10g RAC NFSOracle 10gNFS
- oracle 10g em建立Oracle 10g
- ORACLE 10G 升級Oracle 10g
- Oracle 10g RAC TAFOracle 10g
- oracle 10g RMAN管理Oracle 10g
- ORACLE 10G AWR 速查!Oracle 10g
- Oracle AS 10g 10.1.2.0.2Oracle
- Oracle 10G 跟蹤Oracle 10g
- oracle 10g的程式Oracle 10g
- oracle 10g em patchOracle 10g
- Oracle 10g Scheduler 特性Oracle 10g
- Oracle 10g AS基本管理Oracle 10g
- oracle 10g logmnrOracle 10g
- oracle 10g downloadOracle 10g
- ORACLE 10G expdp/impdpOracle 10g