亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

SP2-0618: Cannot find the Session Identifier.Check PLUSTRACE role is enabled

發布時間:2020-08-19 01:13:41 來源:ITPUB博客 閱讀:265 作者:迷倪小魏 欄目:關系型數據庫

1、今天在scott用戶下執行語句跟蹤時報了如下錯誤:

 

SCOTT@seiang11g>set autotrace traceonly statistice

SP2-0618: Cannot find the Session Identifier.  Check PLUSTRACE role is enabled

SP2-0611: Error enabling STATISTICS report

 

2、通過上述報錯信息分析,是由于scott用戶沒有PLUSTRACE角色,所以使用SYS用戶授予scott用戶PLUSTRACE角色的權限:

 

SYS@seiang11g>grant PLUSTRACE to scott;

grant PLUSTRACE to scott

      *

ERROR at line 1:

ORA-01919: role 'PLUSTRACE' does not exist

 

但是報錯信息提示:PLUSTRACE角色不存在,這是因為PLUSTRACE角色在數據庫創建時并不會自動創建,這個角色需要手動通過運行plustrce.sql腳本來創建;

 

[oracle@seiang11g ~]$ cd $ORACLE_HOME/sqlplus/admin

[oracle@seiang11g admin]$ ll

total 16

-rw-r--r-- 1 oracle oinstall  466 Jul 13 13:13 glogin.sql

drwxr-xr-x 2 oracle oinstall   81 Jul 13 10:01 help

-rw-r--r-- 1 oracle oinstall  226 Jul 17  2013 libsqlplus.def

-rw-r--r-- 1 oracle oinstall  813 Mar  7  2006 plustrce.sql

-rw-r--r-- 1 oracle oinstall 2118 Feb 16  2003 pupbld.sql

 

plustrace.sql腳本內容如下所示:

[oracle@seiang11g admin]$ cat plustrce.sql

--

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

--

-- NAME

--   plustrce.sql

--

-- DESCRIPTION

--   Creates a role with access 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 "sys/knl_test7 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

 

SYS用戶下執行該腳本:

SYS@seiang11g>@?/sqlplus/admin/plustrce.sql

SYS@seiang11g>

SYS@seiang11g>drop role plustrace;

drop role plustrace

          *

ERROR at line 1:

ORA-01919: role 'PLUSTRACE' does not exist

 

 

SYS@seiang11g>create role plustrace;

 

Role created.

 

SYS@seiang11g>

SYS@seiang11g>grant select on v_$sesstat to plustrace;

 

Grant succeeded.

 

SYS@seiang11g>grant select on v_$statname to plustrace;

 

Grant succeeded.

 

SYS@seiang11g>grant select on v_$mystat to plustrace;

 

Grant succeeded.

 

SYS@seiang11g>grant plustrace to dba with admin option;

 

Grant succeeded.

 

SYS@seiang11g>

SYS@seiang11g>set echo off

腳本執行完畢!

 

3、最后將PLUSTRACE角色授權給scott用戶:

 

SYS@seiang11g>grant PLUSTRACE to scott;

Grant succeeded.

 

SCOTT@seiang11g>set autotrace traceonly statistics

注意:在將PLUSTRACE角色授權給scott用戶后,需要重新連接scott用戶才可以開啟會話跟蹤。

 

SCOTT@seiang11g>insert into emp1 select * from emp1;

14 rows created.


Statistics

----------------------------------------------------------

         15  recursive calls

         22  db block gets

         33  consistent gets

          5  physical reads

       1872  redo size

        834  bytes sent via SQL*Net to client

        791  bytes received via SQL*Net from client

          3  SQL*Net roundtrips to/from client

          2  sorts (memory)

          0  sorts (disk)

         14  rows processed



作者:SEian.G(苦練七十二變,笑對八十一難)

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

塔城市| 吉林省| 电白县| 泾川县| 珠海市| 容城县| 广水市| 卓尼县| 文成县| 沙田区| 牡丹江市| 高陵县| 翁牛特旗| 丹巴县| 尼木县| 灯塔市| 崇义县| 自治县| 凤城市| 闸北区| 长宁区| 辽阳县| 乌海市| 若羌县| 久治县| 武功县| 广水市| 五寨县| 博客| 察隅县| 桐梓县| 鹤壁市| 余姚市| 乌鲁木齐县| 谢通门县| 泌阳县| 河间市| 五华县| 阿合奇县| 海盐县| 烟台市|