首页 > 其他 > 详细

Tbs_P2 : 改变表空间特性

时间:2016-06-17 19:45:42      阅读:288      评论:0      收藏:0      [点我收藏+]

SQL>conn system/oracle

 

--创建手动段管理的表空间

SQL>altersystem set db_create_file_dest =‘/oradata‘;

SQL>createtablespace tbs_manualsegs segment space management manual;

 

--确定新表空间的存在

SQL>selecttablespace_name, segment_space_management from dba_tablespaces

Wheretablespace_name=‘TBS_MANUALSEGS‘;

 

--在表空间中创建表和索引

SQL>createtable t_mantab (c1 number) tablespace tbs_manualsegs;

SQL>createindex i_mantab on t_mantab(c1) tablespace manualsegs;

 

--新建自动段表空间

SQL>createtablespace tbs_autosegs;

 

--将对象移入新的表空间

SQL>altertable t_mantab move tablespace tbs_autosegs;

SQL>alterindex i_mantab  rebuild online tablesapcetbs_autosegs;

 

--删除原来的表空间

SQL>droptablespace tbs_manualsegs including contents and datafiles;

 

--将新的表空间重命名为原来的名称。(应用软件的需要)

SQL>altertablesapce tbs_autosegs rename to tbs_manualsegs;

 

--通过删除表空间进行清理,首先用以下命令

SQL>droptablespace tbs_manualsegs;

 --由于表空间非空,将引发错误,应该对此进行纠正。

SQL>drop tablespace tbs_manualsegs including contents and datafiles;


本文出自 “奋斗不止” 博客,请务必保留此出处http://peenboo.blog.51cto.com/2865551/1790370

Tbs_P2 : 改变表空间特性

原文:http://peenboo.blog.51cto.com/2865551/1790370

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!