1.建立用户账号
create user zhao identified by "zhao123";
(默认表空间 USERS 默认临时表空间 TEMP)
create user zhao identified by "zhao123"
default tablespace users temporary tablespace temp;
default tablespace指定的必须是永久表空间
temporary tablespace指定的必须是临时表空间
2.设置权限(两类权限 系统权限、对象权限)
系统权限-----针对数据库系统
对象权限-----针对数据库对象 DCL语句授权GRANT撤销权限REVOKE
系统权限grant create session to zhao;
grant create table to zhao;
grant create any table to zhao;
alter user zhao quota 10M on users;
grant create view to zhao;
最大的系统权限 sysdba
对象权限-----针对数据库对象
grant select,insert,update,delete on hr.hr01 to zhao;
撤销权限REVOKE
revoke create view from zhao;
revoke update,delete on hr.hr01 from zhao;
授权 ---级联授权
系统权限用with admin option;
对象权限用with grant option;
SQL> grant create table to zhao with admin option;
SQL> grant select on hr.hr01 to zhao with grant option;
revoke create table from zhao;
revoke select on hr.hr01 from zhao;
3.角色
create role r01;
grant create table to r01;
grant create view to r01;
grant select on hr.hr01 to r02;
grant r01,r02 to r03;
grant r03 to qian;
oracle默认提供一些角色
connect resource schedule_admin dba select_catalog_role
4.概要文件PROFILE
两项功能 -- 资源控制 (CPU session IO time.....)
----口令安全性
资源控制
配合参数SQL> alter system set resource_limit=true;
建立profile
口令安全性中检查口令复杂度函数 verify_function_11g
oracle提供脚本(直接执行 也可以修改执行)
$ORACLE_HOME/rdbms/admin/utlpwdmg.sql
5.配额
alter user zhao quota 10M on users;
alter user zhao quota unlimited on example;
另一个方法 系统权限 unlimited tablespace
grant unlimited tablespace to qian;