数据洁癖
--1、创建临时表空间
create temporary tablespace oa_temp
tempfile 'c:dataoa_temp_001.dbf' size 1024m
extent management local;
--2、创建用户数据表空间
create tablespace oa_data
logging datafile 'c:dataoa_data_001.dbf'
size 1024m
reuse
extent management local
segment space management auto;
--3、创建用户
create user oa identified by 123456
default tablespace oa_data
temporary tablespace oa_temp;
--4、授权
grant connect,resource,dba to oa;
create table test(
name varchar2(100)
);
insert into test values('测试测试');
commit;
select count(1) from test;
insert into test (select * from test);
-- 表空间的剩余空间
select
tablespace_name,
sum(bytes)/1024/1024
from dba_free_space
group by tablespace_name