--以管理员身份登录conn sys/wowangz as sysdba
--创建临时表空间create temporary tablespace tblspace_temptempfile 'D:/app/Administrator/oradata/orcl/tblspace_temp.dbf'size 20M autoextend on next 20M maxsize 100M extent management local;
--创建数据表空间create tablespace tblspace_data logging datafile 'D:/app/Administrator/oradata/orcl/tblspace_data.dbf'size 20M autoextend on next 20M maxsize 100M extent management local;
--创建用户并为用户指定表空间create user wowz identified by wowangz default tablespace tblspace_datatemporary tablespace tblspace_temp;
--也可以解锁账户(比如解锁)
alter user hr account unlock;
--给用户设置一个密码
alter user hr identified by hr;
--创建角色create role myrole;
--给角色授权grant connect,resource to myrole with admin option;
--通过角色给用户授权grant myrole to wowz;
--表空间不受限制,权限太大,无法授予 故单独授予grant unlimited tablespace to wowz;
--授予所有权限grant all privileges on wowz;
--撤消带有admin option 的system privileges 时,连带的权限将保留 A grant B ,
--revoke A,B的权限还在--撤消带有grant option 的object privileges 时,连带的权限也将撤消 A grant B ,
--revoke A,B的权限也将被revoke
--使用EM创建某个用户时,该用户会被自动授予CONNECT角色
QQ群:36645603 Oracle初学者群 初学Oracle进