先说下我创建的步骤:
1.创建表空间
create tablespace FROEST
datafile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\froest.dbf' size 10M
default storage(initial 500k
next 500k
minextents 1
maxextents unlimited
pctincrease 0
)
2.在该表空间下创建表
create table TEST(
USER_ID NUMBER(3) NOT NULL PRIMARY KEY,
USER_NAME VARCHAR2(64) NOT NULL,
USER_DESC VARCHAR2(64)
)tablespace froest
3.创建用户
create user froest identified by froest default tablespace FROEST
create user froesttest identified by froesttest default tablespace FROEST
4.给用户froest分配权限
grant connect,resource to froest
5用froest用户创建角色
create role student
6.用froest用户给角色分配权限
grant select on test to student
7.用froest用户给用户froesttest分配角色
grant student to froesttest
8.在froest用户下给表test插入数据
insert into test(user_id,user_name,user_desc) values(101,'louh','test')
9.切换到用户froesttest,用plsql登录
username:froesttest
password:froesttest
datebase:orcl
Connect as:Normal(只有Normal,SYSDBA,SYSOPER)用SYSDBA登录可以查询
登录以后
select * from test
查询不了,提示表或者视图不存在
求大虾指导。小弟不胜感激
1.创建表空间
create tablespace FROEST
datafile 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\froest.dbf' size 10M
default storage(initial 500k
next 500k
minextents 1
maxextents unlimited
pctincrease 0
)
2.在该表空间下创建表
create table TEST(
USER_ID NUMBER(3) NOT NULL PRIMARY KEY,
USER_NAME VARCHAR2(64) NOT NULL,
USER_DESC VARCHAR2(64)
)tablespace froest
3.创建用户
create user froest identified by froest default tablespace FROEST
create user froesttest identified by froesttest default tablespace FROEST
4.给用户froest分配权限
grant connect,resource to froest
5用froest用户创建角色
create role student
6.用froest用户给角色分配权限
grant select on test to student
7.用froest用户给用户froesttest分配角色
grant student to froesttest
8.在froest用户下给表test插入数据
insert into test(user_id,user_name,user_desc) values(101,'louh','test')
9.切换到用户froesttest,用plsql登录
username:froesttest
password:froesttest
datebase:orcl
Connect as:Normal(只有Normal,SYSDBA,SYSOPER)用SYSDBA登录可以查询
登录以后
select * from test
查询不了,提示表或者视图不存在
求大虾指导。小弟不胜感激
先提示我:
Dynamic Performance Tables not acceible,
Automatic Statics disabled for this sessionYou can disabled statistics in the preference menu,or botain select
priviliges on the v$session,v$sesstat and v$statname tables
再确定以后提示我
表或者视图不存在
2.在该表空间下创建表
create table TEST(用谁创建的表?如果是sys,那么,表是sys的select * from sys.test别的都白扯,又没有同义词。
select * from sys.test
试试
1.把表建到了SYS用户中
2.怎么在自己的用户下自己的用户下解决:我用username:froest,database:orcl,Connect as SYSDBA,如果这样登录,则当我建表的时候会建到SYS用户中,但是如果Connect as Normal,则建的表在froest用户下
多谢各位大虾!