Oracle 创建用户需知


建议放入plsql中查看,可以直观的查看关键字

 /*1.创建表空间*/
create tablespace pro_test logging datafile 'D:\OracleXE\oradata\pro_test\pro_test.dbf'
size 32m autoextend on next 32m maxsize 2048m  extent management local;
/*2.创建用户*/
create user pro identified by pro default tablespace pro_test; -- 如果密码是数字,请用双引号括起来
/*3.授以权限*/
grant create session to pro; --是否允许登陆
grant create table,create view,create trigger,create sequence,create procedure to pro; --分配创建表,视图,触发器,序列,过程 权限
grant debug connect session to pro; --给用户debug权限
GRANT debug any procedure to pro;--给用户debug权限
grant create any table,create any procedure to pro;--不知道 why ?? debug存储过程一定要这样付权限
/*4.设置表空间*/
alter user pro default tablespace pro_test; -- 设置 user's tablespace
grant unlimited tablespace to pro ; -- 无配额 限制,(配额:限额是指定标空间中允许的空间容量)
revoke unlimited tablespace  from pro;

/*=================附1:角色===================*/
/*1.建角色*/
create role pro_role;
/*2.授以权限*/
grant create procedure to pro_role;
/*3.把角色付给用户*/
grant pro_role to pro;
/*=================附2:综合===================*/
select * from role_sys_privs; --获取角色所包含权限
create role role_test identified by password_test; -- 在生效带有口令的角色时必须提供口令
/*修改角色:是否需要口令*/
alter role role1 not identified;
alter role role1 identified by password1;

相关内容