---创建表空间
create tablespace 表空间名字 datafile 'F:/oracle/product/10.2.0/oradata/wsdata(数据库对象)/01.dbf' size 4096M;
alter tablespace 表空间名字 add datafile 'F:/oracle/product/10.2.0/oradata/wsdata(数据库对象)/02.dbf' size 4096M;
alter tablespace 表空间名字 add datafile 'F:/oracle/product/10.2.0/oradata/wsdata(数据库对象)/03.dbf' size 4096M;
alter tablespace 表空间名字 add datafile 'F:/oracle/product/10.2.0/oradata/wsdata(数据库对象)/04.dbf' size 4096M;
alter tablespace 表空间名字 add datafile 'F:/oracle/product/10.2.0/oradata/wsdata(数据库对象)/05.dbf' size 4096M;
alter tablespace 表空间名字 add datafile 'F:/oracle/product/10.2.0/oradata/wsdata(数据库对象)/06.dbf' size 4096M;
alter tablespace 表空间名字 add datafile 'F:/oracle/product/10.2.0/oradata/wsdata(数据库对象)/07.dbf' size 4096M;
alter tablespace 表空间名字 add datafile 'F:/oracle/product/10.2.0/oradata/wsdata(数据库对象)/08.dbf' size 4096M;
alter tablespace 表空间名字 add datafile 'F:/oracle/product/10.2.0/oradata/wsdata(数据库对象)/09.dbf' size 2048M;
---创建表空间
alter tablespace SYSAUX add datafile 'F:/oracle/product/10.2.0/oradata/wsdata(数据库对象)/sysaux02.dbf' size 512M;
alter database datafile 'E:/oracle/product/10.2.0/oradata/pluto/ysstech01.dbf' offline drop
create undo tablespace UNDOTBS2 datafile 'E:/oracle/product/10.2.0/oradata/pluto/undotbs02.dbf' SIZE 300M AUTOEXTEND ON;
alter system set UNDO_TABLESPACE=UNDOTBS2
DBA_ROLLBACK_SEGS
drop tablespace UNDOTBS1
-- 如果undo表空间undotbs不能释放空间,重建之
-- 创建备用undo表空间
create undo tablespace newundotbs datafile '$ORA_DATA/newundotbs01.dbf' size 1000m
/
-- 切换undo表空间
alter system set undo_tablespace=newundotbs scope=spfile
/
shutdown immediate
/
startup
/
-- drop原表空间
drop tablespace undotbs including contents and datafiles
/
-- 创建原undo表空间
create undo tablespace undotbs datafile '$ORA_DATA/undotbs01.dbf' size 1000m
/
-- 切换undo表空间
alter system set undo_tablespace=undotbs scope=spfile
/
-- 关闭重起并把备用undo表空间drop
shutdown immediate
/
startup
/
drop tablespace newundotbs including contents and datafiles
/
本文介绍如何在Oracle数据库中创建及管理表空间,包括创建不同类型的表空间、调整表空间大小、离线删除数据文件以及重建无法释放空间的undo表空间等操作。
464

被折叠的 条评论
为什么被折叠?



