Oracle创建表空间,用户,授权
select tablespace_name,sum(bytes)/1024/1024 from dba_data_files group by tablespace_name
select file_name,tablespace_name,bytes/1024/1024 from dba_data_files
select tablespace_name,sum(bytes)/1024/1024 from dba_free_space group by tablespace_name
--1、创建用户临时表空间
create temporary tablespace user_temp
tempfile 'D:\oracle_base\oradata\ORCL\DATAFILE\user\user_temp_001.dbf' size 1024m
extent management local;
--删除
DROP TABLESPACE temp001 INCLUDING CONTENTS AND DATAFILES;
--2、创建用户数据表空间
create tablespace user_data_default
logging datafile 'D:\oracle_base\oradata\ORCL\DATAFILE\user\user_data_default_001.dbf'
size 1024m reuse extent management local segment space management auto;
--删除
DROP TABLESPACE temp001 INCLUDING CONTENTS AND DATAFILES;
--3、创建用户
create user oa identified by 123456
default tablespace USER_DATA_DEFAULT
temporary tablespace user_temp;
--删除
drop user ×× cascade
--4、授权
grant connect,resource to oa;
grant dba to oa;
[若表空间不足了,给表空间添加数据文件]
--对表空间进行添加数据文件
alter tablespace USER_DATA_DEFAULT
add datafile 'D:\oracle_base\oradata\ORCL\DATAFILE\user\user_data_default_002.dbf'
size 1024m;