码迷,mamicode.com
首页 > 数据库 > 详细

oracle表空间与用户创建

时间:2014-11-25 18:56:19      阅读:198      评论:0      收藏:0      [点我收藏+]

标签:oracle   空间   用户   product   

-------------------------创建表空间与用户

创建临时表空间


CREATE TEMPORARY TABLESPACE test_temp
bubuko.com,布布扣 TEMPFILE ‘/u01/oracle/product/10.2.0/oradata/orcl/test_temp01.dbf ‘
bubuko.com,布布扣 SIZE 32M
bubuko.com,布布扣 AUTOEXTEND ON
bubuko.com,布布扣 NEXT 32M MAXSIZE 2048M
bubuko.com,布布扣 EXTENT MANAGEMENT LOCAL;

创建用户表空间


CREATE TABLESPACE test_data
bubuko.com,布布扣 LOGGING
bubuko.com,布布扣 DATAFILE ‘/u01/oracle/product/10.2.0/oradata/orcl/my_data01.dbf ‘
bubuko.com,布布扣 SIZE 32M
bubuko.com,布布扣 AUTOEXTEND ON
bubuko.com,布布扣 NEXT 32M MAXSIZE 2048M
bubuko.com,布布扣 EXTENT MANAGEMENT LOCAL;


创建用户并制定表空间


CREATE USER username IDENTIFIED BY password
DEFAULT TABLESPACE TEST_DATA
TEMPORARY TABLESPACE TEST_TEMP;


--------------------用户赋权与查看用户权限

给用户授予权限


GRANT
bubuko.com,布布扣    CREATE SESSION, CREATE ANY TABLE , CREATE ANY VIEW , CREATE ANY INDEX , CREATE ANY PROCEDURE ,
bubuko.com,布布扣    ALTER ANY TABLE , ALTER ANY PROCEDURE ,
bubuko.com,布布扣    DROP ANY TABLE , DROP ANY VIEW , DROP ANY INDEX , DROP ANY PROCEDURE ,
bubuko.com,布布扣    SELECT ANY TABLE , INSERT ANY TABLE , UPDATE ANY TABLE , DELETE ANY TABLE
bubuko.com,布布扣    TO username;


将role这个角色授与username,也就是说,使username这个用户可以管理和使用role所拥有的资源

bubuko.com,布布扣GRANT role TO username;

查看所有用户

SELECT * FROM DBA_USERS;
SELECT * FROM ALL_USERS;
SELECT * FROM USER_USERS;

查看用户系统权限

SELECT * FROM DBA_SYS_PRIVS;
SELECT * FROM USER_SYS_PRIVS;

查看用户对象或角色权限

SELECT * FROM DBA_TAB_PRIVS;
SELECT * FROM ALL_TAB_PRIVS;
SELECT * FROM USER_TAB_PRIVS;
bubuko.com,布布扣

查看所有角色

SELECT * FROM DBA_ROLES;

查看用户或角色所拥有的角色

SELECT * FROM DBA_ROLE_PRIVS;
SELECT * FROM USER_ROLE_PRIVS;



本文出自 “努力奔向前方” 博客,请务必保留此出处http://liucb.blog.51cto.com/3230681/1582387

oracle表空间与用户创建

标签:oracle   空间   用户   product   

原文地址:http://liucb.blog.51cto.com/3230681/1582387

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!