2、修改用户
alter user dylan
identified by 234
default tablespace users_new --指定表空间
quota 100m on users_new --指定配额
temporary tablespace temp --指定临时表空间
profile default;
SELECT USERNAME, VALUE || 'bytes' "Current UGA memory"
FROM V$SESSION sess, V$SESSTAT stat, V$STATNAME name
WHERE sess.SID = stat.SID
AND stat.STATISTIC# = name.STATISTIC#
AND name.NAME = 'session uga memory';
3、用户角色
--预定义角色
CONNECT CREATE SESSION
RESOURCE CREATE CLUSTER, CREATE INDEXTYPE, CREATE OPERATOR, CREATE PROCEDURE, CREATE SEQUENCE, CREATE TABLE, CREATE TRIGGER, CREATE TYPE
DBA 所有系统权限WITH ADMIN OPTION
EXP_FULL_DATABASE 执行全库导出权限;SELECT ANY TABLE, BACKUP ANY TABLE, EXECUTE ANY PROCEDURE, EXECUTE ANY TYPE, ADMINISTER RESOURCE MANAGER, 和 INSERT, DELETE,and UPDATE on the tables SYS.INCVID, SYS.INCFIL, and SYS.INCEXP.
还有角色: EXECUTE_CATALOG_ROLE and SELECT_CATALOG_ROLE
IMP_FULL_DATABASE 执行全库导入权限;详见DBA_SYS_PRIVS
RECOVERY_CATALOG_OWNER 恢复目录拥有者权限;CREATE SESSION, ALTER SESSION, CREATE SYNONYM, CREATE VIEW, CREATE DATABASE LINK, CREATE TABLE, CREATE CLUSTER, CREATE SEQUENCE, CREATE TRIGGER, and CREATE PROCEDURE
HS_ADMIN_ROLE 保护异构服务数据字典表访问;SELECT_CATALOG_ROLE and EXECUTE_CATALOG_ROLE
AQ_USER_ROLE 已淘汰;仅保留以兼容8.0;提供DBMS_AQ and DBMS_AQIN包的执行权限
AQ_ADMINISTRATOR_ROLE 提供管理高级队列权限;ENQUEUE ANY QUEUE,DEQUEUE ANY QUEUE, and MANAGE ANY QUEUE, SELECT privileges on AQ tables and EXECUTE privileges on AQ packages
1、创建角色
create role dml identified by dml123;
drop role dml;
grant select, insert, update, select on hr.employees to dml;
grant connect to dml;
grant dml to dylan;
--column级别授权
grant insert(ename, job) on scott.emp to dml;
revoke connect from dml;
revoke select, insert, update, select on hr.employees from dml;
revoke insert(ename, job) on scott.emp from dml;
--REVOKE REFERENCES ON dept FROM jward CASCADE CONSTRAINTS;
--启用role
SET ROLE dml IDENTIFIED BY dml123;
--禁用所有role
SET ROLE NONE;
--指定role
ALTER USER dylan DEFAULT ROLE dml;
2、删除角色
drop role dml;
3、with admin option 和 with grant option
with admin option 对应系统权限赋权而言,赋权后不可级联收回权限;
with grant option 对应对象权限赋权而言,赋权后可级联收回权限;
4、查看授权信息:
SELECT GRANTEE, OWNER, GRANTOR, PRIVILEGE, GRANTABLE
FROM DBA_TAB_PRIVS
WHERE TABLE_NAME = 'EMPLOYEES' and OWNER = 'HR';