oracle 创建表空间并授予用户角色

时间:2021-05-05 08:49:10

/*分为四步 */
/*第1步:创建临时表空间 */

1 create temporary tablespace jiangh_temp 
2 tempfile 'G:\app\smile\oradata\localdb\jiangh_temp.dbf' 
3 size 50m 
4 autoextend on 
5 next 50m maxsize 5120m 
6 extent management local; 

/*第2步:创建数据表空间 */

1 create tablespace jiangh 
2 logging 
3 datafile 'G:\app\smile\oradata\localdb\jiangh.dbf' 
4 size 50m 
5 autoextend on 
6 next 50m maxsize 5120m 
7 extent management local; 

/*第3步:创建用户并指定表空间 */

1 create user jiangh identified by 20160913 
2 default tablespace jiangh 
3 temporary tablespace jiangh_temp; 

/*第4步:给用户授予权限 */
 1 grant connect,resource,dba to jiangh;