您的位置:首页 > 数据库 > Oracle

oracle基本权限的管理

2013-12-23 21:30 309 查看
oracle创建表空间、创建用户、授权、夺权、删除用户、删除表空间



表空间定义

表空间是为了统一ORACLE物理和逻辑上的结构而专门建立的,从物理上来说,

一个表空间是由具体的一个或多个磁盘上数据文件构成的(至少1对1,可以1对

多),从逻辑上来说一个表空间是由具体的一个或多个用户模式下的表,索引等等

里面的数据所构成的。

www.2cto.com

创建表空间:首先连接到拥有dba权限的用户下、例如system



[sql]

SQL> create tablespace baicheng datafile 'f:\baicheng.dbf' size 25M;



Tablespace created



创建用户:用户名yuge、 用户密码yuge、 所在表空间baicheng



[sql]

SQL> create user yuge

2 identified by yuge

3 default tablespace baicheng;

授权给用户(grant resource,connect,dba,sysdba to test)

www.2cto.com

[sql]

SQL> grant connect to yuge;



Grant succeeded



SQL> grant resource to yuge;



Grant succeeded



收回权限



[sql]

SQL> revoke connect from yuge;



Revoke succeeded



SQL> revoke resource from yuge;



Revoke succeeded

www.2cto.com

删除用户(加cascade的话,这样连用户自己创建的表也一起删除,如果不加就只是删除当前用户)

[sql]

SQL> drop user yuge cascade;



User dropped

删除表空间(drop tablespace baicheng including contents and datafiles;连带BAICHENG.DBF文件一起删除)



[sql]

SQL> drop tablespace baicheng;



Tablespace dropped

授予用户创建视图,以及查询任何表,查询任何字典的权限



{sql} grant create view to scott;

grant select any table to scott;

grant select any dictionary to scott;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: