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

本文介绍了解决SQL执行计划中出现的SP2-0618错误的方法。通过为rhys用户授予PLUSTRACE角色,成功解决了因缺少角色而导致的错误,并展示了如何创建PLUSTRACE角色及执行SQL语句分析。

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

今天是2013-09-17,在今天学习sql执行计划的是发现如下问题:
问题描述:
在rhys用户下开启sql语句计划报如下错误:

SQL> set autotrace on
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report
问题分析:
由于该rhys账户没有PLUSTRACE角色导致此问题的产生。
解决办法:
1)查看$ORACLE_HOME/sqlplus/admin下的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
2)执行该sql创建plustrace角色。
SQL> @./plustrce.sql
SQL>
SQL> drop role plustrace;
drop role plustrace
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist

SQL> create role plustrace;
Role created.
SQL>
SQL> grant select on v_$sesstat to plustrace;
Grant succeeded.
SQL> grant select on v_$statname to plustrace;
Grant succeeded.
SQL> grant select on v_$mystat to plustrace;
Grant succeeded.
SQL> grant plustrace to dba with admin option;
Grant succeeded.
SQL>
SQL> set echo off
SQL>
SQL> grant plustrace to rhys;
Grant succeeded.

3)登录rhys账户在此开启sql语句分析功能。
SQL> conn rhys/amy
Connected.
SQL> set autotrace on
SQL>
发现该问题得到解决。
~

SQL> r
  1  select ename,job,sal,dname from amy_emp,amy_dept where amy_emp.deptno=amy_dept.deptno
  2  and not exists
  3* (select * from amy_salgrade where amy_emp.sal between losal and hisal)

no rows selected


Execution Plan
----------------------------------------------------------
Plan hash value: 2345751609

----------------------------------------------------------------------------------------------
| Id  | Operation                    | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |               |     1 |    42 |     9  (23)| 00:00:01 |
|   1 |  NESTED LOOPS                |               |     1 |    42 |     9  (23)| 00:00:01 |
|   2 |   NESTED LOOPS               |               |     1 |    42 |     9  (23)| 00:00:01 |
|   3 |    MERGE JOIN ANTI           |               |     1 |    29 |     8  (25)| 00:00:01 |
|   4 |     SORT JOIN                |               |    14 |   294 |     4  (25)| 00:00:01 |
|   5 |      TABLE ACCESS FULL       | AMY_EMP       |    14 |   294 |     3   (0)| 00:00:01 |
|*  6 |     FILTER                   |               |       |       |            |          |
|*  7 |      SORT JOIN               |               |     5 |    40 |     4  (25)| 00:00:01 |
|   8 |       TABLE ACCESS FULL      | AMY_SALGRADE  |     5 |    40 |     3   (0)| 00:00:01 |
|*  9 |    INDEX RANGE SCAN          | REVERSE_INDEX |     1 |       |     0   (0)| 00:00:01 |
|  10 |   TABLE ACCESS BY INDEX ROWID| AMY_DEPT      |     1 |    13 |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   6 - filter("AMY_EMP"."SAL"<="HISAL")
   7 - access(INTERNAL_FUNCTION("AMY_EMP"."SAL")>=INTERNAL_FUNCTION("LOSAL"))
       filter(INTERNAL_FUNCTION("AMY_EMP"."SAL")>=INTERNAL_FUNCTION("LOSAL"))
   9 - access("AMY_EMP"."DEPTNO"="AMY_DEPT"."DEPTNO")


Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          4  consistent gets
          0  physical reads
          0  redo size
        530  bytes sent via SQL*Net to client
        512  bytes received via SQL*Net from client
          1  SQL*Net roundtrips to/from client
          2  sorts (memory)
          0  sorts (disk)
          0  rows processed

SQL>


 
-- A start job for unit iscsi.service has finished with a failure. -- -- The job identifier is 2343 and the job result is failed. Apr 01 15:59:31 iscsi systemd[1]: Starting Login and scanning of iSCSI devices... -- Subject: A start job for unit iscsi.service has begun execution -- Defined-By: systemd -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- A start job for unit iscsi.service has begun execution. -- -- The job identifier is 2537. Apr 01 15:59:31 iscsi iscsiadm[22805]: iscsiadm: default: 1 session requested, but 1 already present. Apr 01 15:59:31 iscsi iscsiadm[22805]: iscsiadm: default: 1 session requested, but 1 already present. Apr 01 15:59:31 iscsi iscsiadm[22805]: iscsiadm: default: 1 session requested, but 1 already present. Apr 01 15:59:31 iscsi iscsiadm[22805]: iscsiadm: default: 1 session requested, but 1 already present. Apr 01 15:59:31 iscsi iscsiadm[22805]: iscsiadm: Could not log into all portals Apr 01 15:59:31 iscsi systemd[1]: iscsi.service: Main process exited, code=exited, status=15/n/a -- Subject: Unit process exited -- Defined-By: systemd -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- An ExecStart= process belonging to unit iscsi.service has exited. -- -- The process' exit code is 'exited' and its exit status is 15. Apr 01 15:59:31 iscsi systemd[1]: iscsi.service: Failed with result 'exit-code'. -- Subject: Unit failed -- Defined-By: systemd -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- The unit iscsi.service has entered the 'failed' state with result 'exit-code'. Apr 01 15:59:31 iscsi systemd[1]: Failed to start Login and scanning of iSCSI devices. -- Subject: A start job for unit iscsi.service has failed -- Defined-By: systemd -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- A start job for unit iscsi.service has finished with a failure. -- -- The job identifier is 2537 and the job result is failed.
最新发布
04-02
<think>好的,我现在要解决用户提到的iscsi.service启动失败的问题,错误信息是exit-code 15,并且提示iscsiadm无法登录所有门户。首先,我需要回顾一下用户提供的引用内容,特别是引用[2]和[3],因为它们涉及iscsiadm命令和ACL配置。 首先,引用[2]显示用户曾经成功登出iscsi目标,但问题现在发生在启动时登录失败。可能的原因包括目标不可达、认证问题或配置错误。引用[3]提到不同主机验证不通过时需要将主机的initiatorname.iscsi中的WWNN添加到目标的ACL列表中,这可能是一个关键点。 接下来,我需要考虑可能的原因和对应的检查步骤。首先检查网络连通性,确保iSCSI目标IP和端口可达。然后检查iscsiadm的配置是否正确,包括目标IQN、IP和端口。接着,检查ACL设置,确认initiator的WWNN是否被允许访问目标。此外,查看日志文件,如journalctl或/var/log/messages,以获取更详细的错误信息。 另外,系统单元启动失败可能有依赖性问题,检查iscsi.service的依赖是否正确安装和启动,比如iscsid.service。最后,可能需要重新发现目标或更新节点信息,以确保配置是最新的。 需要逐步指导用户执行这些检查步骤,确保每一步都清晰易懂,并针对可能的错误提供解决方案。同时,结合用户提供的引用内容,强调ACL配置的重要性,并提醒检查initiatorname.iscsi文件中的名称是否正确,以及是否正确添加到目标的ACL中。</think>### iSCSI服务启动失败解决方案 针对iscsi.service启动失败并报错"exit-code 15"的问题,按照以下步骤排查: 1. **检查网络连通性** - 使用命令验证目标端口可达性: ```bash telnet 172.25.254.238 3260 ``` 若连接失败,需检查防火墙规则: ```bash firewall-cmd --list-all | grep 3260 ``` 若未开放端口,需执行: ```bash firewall-cmd --add-service=iscsi-target --permanent firewall-cmd --reload ``` 2. **验证iSCSI配置** - 检查发现门户配置: ```bash iscsiadm -m discovery -t st -p 172.25.254.238 ``` 输出应包含类似内容: ``` 172.25.254.238:3260,1 iqn.2018-06.com.example:storagel ``` 3. **检查ACL配置** 根据引用[3],确认客户端启动器名称已添加到目标服务器ACL: - 查看本机启动器名称: ```bash cat /etc/iscsi/initiatorname.iscsi ``` 输出示例: ``` InitiatorName=iqn.2023-09.com.example:client1 ``` - 在目标服务器配置中添加该IQN到ACL列表 4. **手动登录验证** 使用引用[2]中的命令测试手动登录: ```bash iscsiadm -m node -T iqn.2018-06.com.example:storagel -p 172.25.254.238 -l ``` 若失败,观察具体报错: - CHAP认证失败:检查`/etc/iscsi/iscsid.conf`中的用户名密码 - 目标不存在:确认目标IQN正确性 5. **查看详细日志** ```bash journalctl -u iscsi.service -xe ``` 重点关注包含"Could not log into all portals"的上下文信息 6. **服务依赖检查** 验证依赖服务状态: ```bash systemctl status iscsid.service ``` 若未运行,需先启动: ```bash systemctl start iscsid && systemctl enable iscsid ``` **典型解决方案流程**: ```bash # 刷新节点信息 iscsiadm -m node --op=delete -T iqn.2018-06.com.example:storagel iscsiadm -m discovery -t st -p 172.25.254.238 iscsiadm -m node -T iqn.2018-06.com.example:storagel -p 172.25.254.238 -l # 确认成功后重启服务 systemctl restart iscsi ```
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值