Oracle如何创建表空间、临时表空间、创建用户、授予角色等等

时间:2018-09-20
本文章向大家介绍Oracle如何创建表空间、临时表空间、创建用户、授予角色等等,需要的朋友可以参考一下

1.创建表空间:
1).查看空间文件:
select tablespace_name, file_id, file_name, round(bytes / (1024 * 1024), 0) total_space from dba_data_files ;
2).创建表空:
create tablespace TB_MDM datafile '+DATA1' size 30G autoextend on next 500M maxsize unlimited;
扩容
alter tablespace TB_MDM add datafile '+DATA1' size 30g autoextend on next 500M maxsize unlimited;
2.创建临时表空间:
1).查看临时文件信息:
select * from dba_temp_files;
2).创建表空间
create temporary tablespace HIP_TEMP_TEST01 tempfile '/opt/oracle/oradata/orcl/hip_test_temp01.dbf' size 50m autoextend on next 50m maxsize unlimited;
3.创建用户
1).查看用户:
select * from dba_users
2).创建用户:
create user username identified by password default tablespace user_data temporary tablespace user_temp;
4.授予角色
grant connect,resource,dba to username;
5.授予系统权限
grant unlimited tablespace to HIP_TEST;
5.空间不限制配额
alter user HIP_TEST quota unlimited on HIPTEST;