创建一个新用户,登录时,提示如下错误:ORA-01045:user ZG_GRSDS lacks CREATE SESSION privilege :logon denied
ORA-01045:用户ZG_GRSDS缺乏创建会话权限:登录被拒绝后,根据提示,我添加了如下语句:grant create session to ZG_GRSDS;当执行此句时,仍然提示错误:ORA-01031:insufficient privileges 请问如何解决?
ORA-01045:用户ZG_GRSDS缺乏创建会话权限:登录被拒绝后,根据提示,我添加了如下语句:grant create session to ZG_GRSDS;当执行此句时,仍然提示错误:ORA-01031:insufficient privileges 请问如何解决?
grant create session to ZG_GRSDS;
SQL>GRANT RESOURCE TO U_NAME;
SQL>CONN U_NAME/PWD;
就是产生ORA-01031:insufficient privileges的语句
Cause: An attempt was made to change the current username or password without the appropriate privilege. This error also occurs if attempting to install a database without the necessary operating system privileges. When Trusted Oracle is configure in DBMS MAC, this error may occur if the user was granted the necessary privilege at a higher label than the current login.
Action: Ask the database administrator to perform the operation or grant the required privileges. For Trusted Oracle users getting this error although granted the the appropriate privilege at a higher label, ask the database administrator to regrant the privilege at the appropriate label.
在运行此段命令前,已经运行完了创建用户,授权等的一系列命令:
SQL语句如下:
-----------------------------建立用户及授权---------------------------
-- Create the user
create user ZG_GRSDS --创建用户 ZG_GRSDS
identified by "ZG_GRSDS" --设置密码 ZG_GRSDS
default tablespace TS_ZGXT --默认表空间
temporary tablespace TEMP --临时表空间
profile DEFAULT; --默认配置文件
-- Grant/Revoke role privileges
grant create session to ZG_GRSDS; --此句是新添加的,因为报错提示是没有 CREATE SESSION .
grant connect to ZG_GRSDS; --授权 连接数据库
grant dba to ZG_GRSDS; --授权 dba
-- Grant/Revoke system privileges
grant alter any index to ZG_GRSDS; --授权 更改任何参数
grant alter tablespace to ZG_GRSDS; --授权 更改表空间
grant create sequence to ZG_GRSDS; --授权 创建序列
grant create table to ZG_GRSDS; --授权 创建表
grant create tablespace to ZG_GRSDS; --授权 创建表空间
grant unlimited tablespace to ZG_GRSDS;--授权 无限制的表空间--以下是一些对表的增删改查的权限赋予,就不再贴出了
grant connect,resource to ZG_GRSDS;
就是用哪个用户在执行grant create sessionto ZG_GRSDS;这条语句?
是以用户登录的时候?
还是对该用户进行授权的时候?
你用谁在进行授权conn / as sysdba; 以sys来对ZG_GRSDS授权