移动表空间内数据两种方式
2016-12-12 11:08
253 查看
1,手动迁移对象 select 'alter table '||owner||'.'||segment_name||' move tablespace '||'TBS_NEW;' from dba_segments where tablespace_name='TBS_OLD' and segment_type='TABLE' and owner='U1'; select 'alter index '||owner||'.'||segment_name||' rebuild tablespace '||'TBS_NEW;' from dba_segments where tablespace_name='TBS_OLD' and segment_type='INDEX' and owner='U1'; select 'alter table '||t1.owner||'.'||t2.TABLE_NAME||' move lob ('||t2.COLUMN_NAME||') store as (tablespace '||'TBS_NEW);' from dba_segments t1, dba_lobs t2 where t1.owner=t2.OWNER and t1.tablespace_name=t2.TABLESPACE_NAME and t1.segment_name=t2.SEGMENT_NAME and t1.tablespace_name='TBS_OLD' and t1.segment_type='LOBSEGMENT' and t1.owner='U1'; 2,整体迁移表空间 alter tablespace TBS_1 offline; os mv '/ora01/oradata/tbs_1_data01.dbf' TO '/ora02/oradata/tbs_1_data01.dbf' alter tablespace TBS_1 RENAME DATAFILE '/ora01/oradata/tbs_1_data01.dbf' TO '/ora02/oradata/tbs_1_data01.dbf'; alter tablespace TBS_1 online;
相关文章推荐
- 关于删除mysql大表数据并释放存储空间的两种方式
- java 位运算中移动位数超过数据长度和右移的两种不同方式
- 在 Linux 下用户空间与内核空间数据交换的方式,第 1 部分: 内核启动参数、模块参数与sysfs、sysctl、系统调用和netlink
- ADO 与ADO.NET两种数据访问方式区别
- Http协议中,主要常见的传送数据到服务器有哪两种方式,这两种方式的特点和区别,以及其在Http协议中的位置
- asp.net mvc两种传值(数据)方式(viewdata/mode)
- 后台获取 GridView 行数据的常见两种方式
- 将Number类型的数据转换成String型后输出的两种方式
- jquery ajax提交表单数据的两种方式
- MVC中使用AJAX方式调用数据(microsoft,jquery两种方式)
- mssql 两种数据插入方式
- 在 Linux 下用户空间与内核空间数据交换的方式
- webwok中的封装页面数据研究(上)-两种实现方式
- 在 Linux 下用户空间与内核空间数据交换的方式,第 2 部分: procfs、seq_file、debugfs和relayfs
- 在 Linux 下用户空间与内核空间数据交换的方式,第 1 部分: 内核启动参数、模块参数与sysfs、sysctl、系统调用和netlink
- ADO 与ADO.NET两种数据访问方式区别
- GridView的两种数据绑定方式对分页的影响
- ADO 与ADO.NET两种数据访问方式区别?
- (转载) 在 Linux 下用户空间与内核空间数据交换的方式,第 1 部分: 内核启动参数、模块参数与sysfs、sysctl、系统调用和netlink
- jquery ajax提交表单数据的两种方式