oracle 表空间下数据文件迁移的三种方法

       上个星期周末帮客户做了一个历史表空间的数据文件迁移案例,主要是换存储,有raid 0+1 迁移到 raid 5 存储类型

上,下面记录下几种迁移方法,文件系统是裸设备类型,首先要在raid 5存储上建好相应的lv 裸设备数据文件,注意大小一定要和原来一样大或更大。

  1. 用cplv的方法

    alter tablespace  tablespace_name offline;

   cplv   old_lv  to  new_lv

    alter database rename file 'old_lv' to 'new_lv';

    alter tablespace tablespace_name online;

2.用rman copy的方法

    sqlplus 下

     alter tablespace tablespace_name offline;

    rman 工具下

    rman target  /

    copy datafile  'old_lv ' to 'new_lv';

    sqlplus 下

    alter database rename file 'old_lv' to 'new_lv';

   alter  tablespace tablespace_name online;

3. 全部用rman工具+rman copy 来实现的方法 一个脚本搞定

   run{
  allocate channel c1 type disk;
  sql 'alter tablespace tablespace_name offline';
  copy datafile 'old_lv' to 'new_lv';
  set newname for datafile 6 to 'new_lv';
  switch datafile 6;
  sql 'alter tablespace tablespace_name online';
  release channel c1;
  }

     

  

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7199859/viewspace-580442/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7199859/viewspace-580442/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值