zhangchaoming 2019-12-25
整理一下之前使用oracle数据库遇到的表空间不足的问题,顺便水个博客。
ALTER TABLESPACE app_data ADD DATAFILE ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF‘ SIZE 20480M;
ALTER DATABASE DATAFILE ‘D:\ORACLE\PRODUCT\10.2.0\ORADATA\EDWTEST\APP03.DBF‘ AUTOEXTEND ON NEXT 100M MAXSIZE 20480M;
ALTER TABLESPACE SYSTEM ADD DATAFILE ‘C:\APP\ORACLE\ORADATA\DFYYCDB\DATAFILE\O2_MF_SYSTEM_CWMNZ9XV_.DBF‘ size 7167M autoextend on ; ALTER TABLESPACE SYSTEM ADD DATAFILE ‘C:\APP\ORACLE\ORADATA\DFYYCDB\DATAFILE\O3_MF_SYSTEM_CWMNZ9XV_.DBF‘ size 7167M autoextend on ;
drop tablespace hnjsj_tablespace including contents and datafiles cascade constraint; --删除表空间
create tablespace hnjsj datafile ‘D:\oracle\oradata\orcl\hnjsj.dbf‘ size 1024M --存储地址 初始大小1G autoextend on next 10M maxsize 20480m --每次扩展10M,最大20480m,无限制扩展用unlimited EXTENT MANAGEMENT local autoallocate segment space management auto;
create temporary tablespace hnjsj_temp --临时表空间 tempfile ‘D:\oracle\oradata\orcl\hnjsj_temp.dbf‘ size 50m autoextend on next 50m maxsize 20480m extent management local;
可以通过oracle自带的管理工具(10g版本以后自带的EM,用emctl start dbconsole 查看地址)给用户设置表空间。