oracle 创建用户需知

来源:互联网 发布:debian stretch软件源 编辑:程序博客网 时间:2024/05/29 19:19

建议放入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 tablespacegrant 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;



原创粉丝点击