码迷,mamicode.com
首页 > 数据库 > 详细

Oracle Database 11G R2 表空间管理

时间:2018-06-20 18:49:55      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:creat   altered   end   local   including   name   AC   文件   created   

SQL> alter database datafile '/u01/app/oracle/oradata/king/sysaux01.dbf' resize 2048M;


Database altered.


SQL> alter database datafile '/u01/app/oracle/oradata/king/system01.dbf' resize 2048M;


Database altered.


SQL> alter database tempfile '/u01/app/oracle/oradata/king/temp01.dbf' resize 2048M;


Database altered.


SQL> alter database datafile '/u01/app/oracle/oradata/king/undotbs01.dbf' resize 2048M;


Database altered.


SQL> alter database datafile '/u01/app/oracle/oradata/king/users01.dbf' resize 2048M;


Database altered.





SQL> alter database datafile '/u01/app/oracle/oradata/king/sysaux01.dbf' autoextend off;


Database altered.


SQL> alter database datafile '/u01/app/oracle/oradata/king/system01.dbf' autoextend off;


Database altered.


SQL> alter database tempfile '/u01/app/oracle/oradata/king/temp01.dbf' autoextend off;


Database altered.


SQL> alter database datafile '/u01/app/oracle/oradata/king/undotbs01.dbf' autoextend off;


Database altered.


SQL> alter database datafile '/u01/app/oracle/oradata/king/users01.dbf' autoextend off;


Database altered.


创建表空间

SQL> create tablespace tpcc

datafile '/u01/app/oracle/oradata/king/tpcc01.dbf'

size 1024M

extent management local

uniform size 1M;


Tablespace created.


增加表空间数据文件

SQL> alter tablespace tpcc

add datafile '/u01/app/oracle/oradata/king/tpcc02.dbf'

size 1024M;


Tablespace altered.



移动表空间数据文件

SQL> alter tablespace tpcc01 offline;  


Tablespace altered.


SQL> host cp /u01/app/oracle/oradata/king/tpcc02.dbf /u02/app/oracle/oradata/king


SQL> alter tablespace tpcc01

rename datafile '/u01/app/oracle/oradata/king/tpcc02.dbf'

to '/u02/app/oracle/oradata/king/tpcc02.dbf';


Tablespace altered.



SQL> alter tablespace tpcc01 online;


Tablespace altered.



SQL> host rm -rf /u01/app/oracle/oradata/king/tpcc02.dbf


删除表空间

SQL> drop tablespace tpcc01 including contents and datafiles;


Tablespace dropped.


Oracle Database 11G R2 表空间管理

标签:creat   altered   end   local   including   name   AC   文件   created   

原文地址:http://blog.51cto.com/13598811/2131025

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!