Oracle用户与表空间管理

 

 

 

 

 

 

 

 

 

 

 

 

--1、创建临时表空间
create temporary tablespace oa_temp
    tempfile 'c:\data\oa_temp_001.dbf' size 1024m
    extent management local;
--2、创建用户数据表空间
create tablespace oa_data
    logging datafile 'c:\data\oa_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

 

posted @ 2020-05-20 00:32  YC_Muck  阅读(147)  评论(0编辑  收藏  举报