oracle创建表空间

create tablespace  tablespacename
logging 
datafile '/home/oracle/database/197data_source/197data_source.dbf' 
size 500m 
autoextend on 
next 500m maxsize 10G 
extent management local; 




imp CJJ/a123456@orcl file=/home/oracle/Desktop/197data.dmp  fromuser=cais touser=CJJ ignore=y 




create tablespace tablespacename
logging 
datafile '/home/oracle/database/197data_source/197data_source2.dbf' 
size 500m 
autoextend on 
next 500m maxsize 10G 
extent management local; 


alter user CJJ default tablespace  tablespacename;


select distinct(tablespace_name) from dba_tables;
select tablespace_name from user_tables;


alter user 用户名 quota unlimited on tablespace 表空间名 






alter user cjj quota unlimited on CAIS;
答: 在开发oracle数据库中,我们有两种方法增加表空间的大小:


  1.增加额外的数据文件到表空间中


  例如:alter tablespace users add datafile '/u01/oradata/orcl/users02.dbf' size 25m;


  2.修改表空间当前的数据文件


  例如:alter database datafile


  '/u01/oradata/orcl/users01.dbf' resize 50m;




(2)让临时文件能自动扩展
       alter database  tempfile '/opt/oracle/oradata/orcl/t2.dbf'
       autoextend on next 10m maxsize 50m;
alter database datafile '/home/oracle/database/197data_source/197data_source2.dbf'
  autoextend on next 50m maxsize 200m




//查看数据文件表空间的对应关系
select t.name,t1.name 
 from v$tablespace t,
    v$datafile t1 
 where t.ts# = t1.ts#;
 
 
 -- 创建表空间


1.表空间
create tablespace tablespacename datafile 'datafilepath/datafilename ' size 10g;
--删除
drop tablespace tablespacename including contents and datafiles;--删除表空间及操作系统的数据文件


2.临时表空间
create temporary tablespace TEMP2 TEMPFILE '/home2/oracle/oradata/sysmon/temp02.dbf' SIZE 10g;
-- 删除
drop tablespace temp including contents and datafiles;--删除临时表空间及操作系统的数据文件


3.undo表空间
create undo tablespace undotbs_01
 datafile '/u01/oracle/rbdb1/undo0201.dbf' size 2g;


-- 我们创建表空间时要以tbs_业务类型进行命名
 
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值