代码改变世界

Oracle方案操作

2020-03-17 18:11  默默不语  阅读(165)  评论(0编辑  收藏  举报
--wangwu用户
create table EMPP
(
  empno    NUMBER(4) not null,
  ename    VARCHAR2(10),
  job      VARCHAR2(9),
  mgr      NUMBER(4),
  hiredate DATE,
  sal      NUMBER(7,2),
  comm     NUMBER(7,2),
  deptno   NUMBER(2)
)
--这个select实际上是从当前方案中查找empp表
select * from wangwu.empp;
insert into empp (empno) values (123);

 

--system用户
--为chen用户添加对表的操作权限,否则会报表空间“USERS”无权限
ALTER USER "CHEN" QUOTA UNLIMITED ON "USERS";
--创建zhaoliu create user zhaoliu identified by 123456; grant create table,create session to ZHAOLIU; select * from dba_sys_privs where grantee='ZHAOLIU'; --为zhaoliu添加对wangwu用户表empp的查询权限 grant select on wangwu.empp to zhaoliu; select * from dba_sys_privs where grantee='WANGWU'; grant drop any table to zhaoliu;

 

--zhaoliu用户
select * from wangwu.empp;

drop table wangwu.empp;