大家好我在学习oracle时
用create view创建视图老显示这个,不知道怎么处理
SQL> create or replace view simple_productinfo_view
  2  as
  3  select productid,productname,productprice,category,origin
  4  from productinfo
  5  where origin='中国'
  6  and rownum < 6;
create or replace view simple_productinfo_view
                       *
第 1 行出现错误:
ORA-01031: 权限不足
书上说在当前用户下创建视图需要create view系统权限,这里直接给当前用户赋予了DBA权限,这话我不是很理解啊
用grant create view to scott也显示
SQL> grant create view to scott;
grant create view to scott
*
第 1 行出现错误:
ORA-01031: 权限不足

解决方案 »

  1.   

    使用sys用户登录
    然后进行授权grant create any view to scott;
      

  2.   

    sys?我只创建了一个名为scott的用户,是这个吗?新手哈,能具体点吗,谢谢你了
      

  3.   

    用sys用户登录,然后授予创建视图的权限给scott用户,
    grant create any view to scott;
    这样scott就可以创建视图了
      

  4.   

     建数据库是默认有了sys、system、scott等用户的
      

  5.   

    sys用户是系统默认的,密码是你在创建数据库时候,第一步让你填写的密码...如果不知道,可以用cmd进入conn sys/ as sysdba,在cmd模式把sys密码修改了.alter user sys identified by orcl;上面的语句就把sys 修改为orcl了..进入sys ...随便你怎么玩都可以了..