被删除了,或者自己把原来的scott删除了,新建了一个用户,但没有授予角色。
我的结果:
SQL> select * from session_roles;ROLE
------------------------------
CONNECT
RESOURCE
SELECT_CATALOG_ROLE
HS_ADMIN_ROLE
EXECUTE_CATALOG_ROLE
有些角色是自己添加的。

解决方案 »

  1.   

    同意楼上,scott不可能没有角色!
      

  2.   

    没错,我是重新删除并创建SCOTT用户。
    但没有理由SCOTT没有任何角色啊,至少还有连接角色,对不??否则怎么连接进去啊??
      

  3.   

    进入只需要grant create session to scott权限。
      

  4.   

    楼上的,不明白我的意思吗?
    我想请教,既然SCOTT没有任何角色(连create session都没有啊),那么它为什么还可以连接进去呢???
      

  5.   

    select * from session_privs;--查看会话的权限。
      

  6.   

    我知道了。是你scott被授予了public角色,但是通过 
    select * from session_roles;是查不出来的。不信,请看我的过程。
    ------------------------------------------------------------------------
    SQL> create user foot identified by foot
      2  ;用户已创建
    SQL> conn foot/foot;
    ERROR:
    ORA-01045: user FOOT lacks CREATE SESSION privilege; logon denied --没有权限登陆SQL> select * from  dba_roles where role='PUBLIC';----public角色原来没有任何权限未选定行SQL> grant create session,alter session ,create table to  public; --现在授权授权成功。SQL> grant public to foot;授权成功。SQL> conn foot/foot;
    已连接。
    SQL> select *from  session_roles; 
    未选定行--看到了吗?我明明给它授予了public角色,但是没有显示
      

  7.   

    sorry!The User Group PUBLIC
    Each database contains a user group called PUBLIC. The PUBLIC user group provides public access to specific schema objects, such as tables and views, and provides all users with specific system privileges. Every user automatically belongs to the PUBLIC user group.As members of PUBLIC, users can see (select from) all data dictionary tables prefixed with USER and ALL. Additionally, a user can grant a privilege or a role to PUBLIC. All users can use the privileges granted to PUBLIC.You can grant or revoke any system privilege, object privilege, or role to PUBLIC. However, to maintain tight security over access rights, grant only privileges and roles that are of interest to all users to PUBLIC.Granting and revoking some system and object privileges to and from PUBLIC can cause every view, procedure, function, package, and trigger in the database to be recompiled.PUBLIC has the following restrictions:You cannot assign tablespace quotas to PUBLIC, although you can assign the UNLIMITED TABLESPACE system privilege to PUBLIC. 
    You can create database links and synonyms as PUBLIC (using CREATE PUBLIC DATABASE LINK/SYNONYM), but no other schema object can be owned by PUBLIC. For example, the following statement is not legal: 
    CREATE TABLE public.employees ... ; 看了oracle文档才恍然大悟:
    public不必授权。
    所以grant public to foot 是多余的。
    看SQL> create user fo identified by fo
      2  ;用户已创建SQL> conn fo/fo;
    已连接。