set autotrace on 時報SP2-0618、SP2-0611的解決方法
C:\Users\Administrator>sqlplus test/test@orcl
SQL*Plus: Release 11.2.0.1.0 Production on 星期五 7月 31 10:47:47 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
連線到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> set autotrace on
SP2-0618: 無法找到會話識別符號。啟用檢查 PLUSTRACE 角色
SP2-0611: 啟用 STATISTICS 報告時出錯
分析錯誤原因:該錯誤的的主要原因是由於當前使用者下沒有PLAN_TABLE這張表及相應的PLUSTRACE角色許可權。
解決方法:
1、以sys使用者,執行下面二個sql檔案
1)執行$ORACLE_HOME/sqlplus/admin/plustrce.sql ,建立角色
2)執行$ORACLE_HOME/rdbms/admin/utlxplan.sql ,建立plan_table表
2、給使用者賦予plustrace角色許可權。
具體操作程式碼如下:
點選(此處)摺疊或開啟
-
SQL> conn sys/oracle@orcl as sysdba
-
已連線。
-
SQL> select role from dba_roles where role like 'PLUS%';
-
-
未選定行
-
-
SQL> select * from dba_role_privs where granted_role='PLUSTRACE';
-
-
未選定行
-
-
SQL> @E:\app\Administrator\product\11.2.0\dbhome_1\sqlplus\admin\plustrce.sql
-
SQL>
-
SQL> drop role plustrace;
-
drop role plustrace
-
*
-
第 1 行出現錯誤:
-
ORA-01919: 角色 'PLUSTRACE' 不存在
-
-
-
SQL> create role plustrace;
-
-
角色已建立。
-
-
SQL>
-
SQL> grant select on v_$sesstat to plustrace;
-
-
授權成功。
-
-
SQL> grant select on v_$statname to plustrace;
-
-
授權成功。
-
-
SQL> grant select on v_$mystat to plustrace;
-
-
授權成功。
-
-
SQL> grant plustrace to dba with admin option;
-
-
授權成功。
-
-
SQL>
-
SQL> set echo off
-
SQL> @E:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\utlxplan.sql
-
-
表已建立。
-
-
SQL> grant plustrace to test;
-
-
授權成功。
-
-
SQL> conn test/test@orcl
-
已連線。
- SQL> set autotrace on
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21251711/viewspace-1757550/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle autotrace 報 SP2-0618 PLUSTRACE role 問題解決Oracle
- 使用set autotrace on 檢視資料庫執行計劃資料庫
- docker pull下載映象時的報錯及其解決方法Docker
- Larabel遷移檔案時報SQLSTATE[42000]錯誤的解決方法SQL
- 依賴衝突時的解決方法
- 電腦開機時報錯No Bootable Device找不到索引的解決方法bootdev索引
- 資料庫匯入匯出時報ORA-01843的解決方法資料庫
- list中add、set方法詳解
- hive使用報錯解決方法Hive
- 建立外來鍵時報 Cannot add foreign key constraint 解決方法AI
- Android Studio 中使用switch語句時報錯Constant expression required的解決方法AndroidExpressUI
- npm publish 釋出一個 Angular 庫的時候報錯以及解決方法NPMAngular
- sudo時出現unable to resolve host 的解決方法
- 單重繼承缺陷的臨時解決方法繼承
- 解決代理超時問題的三種方法
- SpringBoot框架:兩個方法同時呼叫時父方法使內部方法的DataSource註解失效的解決辦法Spring Boot框架
- linux下使用npm install報EACCES的解決方法LinuxNPM
- Nginx報504 gateway timeout錯誤的解決方法NginxGateway
- 下載HuggingFace模型的方法以及報錯解決模型
- 時區提示:Local time zone must be set--see zic manual page 2018的解決辦法
- pip安裝selenium超時解決方法
- Dynamics CRM 安裝SSRS Extension時報Could not find the name or insufficient right to see name的解決方法
- Set delete() 方法delete
- URLSearchParams set() 方法
- vue渲染時閃爍{{}}的問題及解決方法Vue
- MSSQL資料庫超時的原因與解決方法SQL資料庫
- 批量更新時無法觸發事件的解決方法事件
- git操作時中文顯示亂碼的解決方法Git
- 使用nodeAPI時遇到非同步問題的解決方法API非同步
- 建立資料庫時“Insufficient privileges”的解決方法DK資料庫
- dbfread報錯ValueError錯誤解決方法Error
- ceph叢集安裝報錯解決方法
- Django2.2 報錯:UnicodeDecodeError 解決方法DjangoUnicodeError
- Nginx 報錯 504 Gateway Time-out 的解決方法NginxGateway
- Logo(圖片)作為報表水印的解決方法Go
- kaldi的編譯安裝與報錯解決方法編譯
- Nodejs的npm安裝模組時候報錯:npm ERR! Error: CERT_UNTRUSTED的解決方法NodeJSNPMErrorRust
- 完美解決呼叫“sudo rosdep init“命令時的報錯ROS
- 解決vue使用Sass時候的報錯問題Vue