--添加测试表空间
SQL> create tablespace xff datafile '/u01/oradata/xifenfei.dbf' size 10m autoextend on maxsize 100m;
 
Tablespace created.
 
--查看数据文件位置
SQL> select name from v$datafile;
 
NAME
--------------------------------------------------------------------------------
+DATA/tasm/system01.dbf
+DATA/tasm/undotbs01.dbf
+DATA/tasm/sysaux01.dbf
+DATA/tasm/users01.dbf
+DATA/tasm/example01.dbf
/u01/oradata/xifenfei.dbf
 
6 rows selected.
 
--创建测试表
SQL> create table hr.a tablespace xff
  as
  select * from dba_tables;
 
Table created.
 
SQL> select count(*) from hr.a;
 
  COUNT(*)
----------
      1580
--转移数据文件位置
[oracle@localhost oradata]$ rman target /
 
Recovery Manager: Release 10.2.0.3.0 - Production on Mon Jun 27 04:30:22 2011
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
connected to target database: TASM (DBID=3032096031)
 
RMAN> sql 'alter tablespace xff offline';
 
using target database control file instead of recovery catalog
sql statement: alter tablespace xff offline
 
RMAN> backup as copy tablespace xff format '+DATA';
 
Starting backup at 27-JUN-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=132 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00006 name=/u01/oradata/xifenfei.dbf
output filename=+DATA/tasm/datafile/xff.269.754893121 tag=TAG20110627T043200 recid=2 stamp=754893123
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 27-JUN-11
 
RMAN> switch tablespace xff to copy;
 
datafile 6 switched to datafile copy "+DATA/tasm/datafile/xff.269.754893121"
 
RMAN> sql 'alter tablespace xff online';
 
sql statement: alter tablespace xff online
 
--查看转移后的数据文件位置
SQL> select name from v$datafile;
 
NAME
--------------------------------------------------------------------------------
+DATA/tasm/system01.dbf
+DATA/tasm/undotbs01.dbf
+DATA/tasm/sysaux01.dbf
+DATA/tasm/users01.dbf
+DATA/tasm/example01.dbf
+DATA/tasm/datafile/xff.269.754893121
 
6 rows selected.
 
--测试其中数据是否存在
SQL> select count(*) from hr.a;
 
  COUNT(*)
----------
      1580
 
--创建asm中文件别名
ASMCMD> mkalias  +DATA/tasm/datafile/xff.269.754893121 +DATA/tasm/xff01.dbf
 
--文件重命名
SQL> alter tablespace xff offline;
 
Tablespace altered.
 
SQL> alter database rename file '+DATA/tasm/datafile/xff.269.754893121' to '+DATA/tasm/xff01.dbf';
 
Database altered.
 
SQL> alter tablespace xff online;
 
Tablespace altered.
 
SQL> select name from v$datafile;
 
NAME
--------------------------------------------------------------------------------
+DATA/tasm/system01.dbf
+DATA/tasm/undotbs01.dbf
+DATA/tasm/sysaux01.dbf
+DATA/tasm/users01.dbf
+DATA/tasm/example01.dbf
+DATA/tasm/xff01.dbf
 
6 rows selected.
 
--手工删除原来数据
[oracle@localhost oradata]$ rm xifenfei.dbf

说明:可以在rman移植数据文件位置的时候,同时处理好别名,然后对表空间重命名,实现只需要表空间离线一次

转:http://www.xifenfei.com/2011/08/%e9%9d%9easm%e6%95%b0%e6%8d%ae%e6%96%87%e4%bb%b6%e7%a7%bb%e6%a4%8d%e5%88%b0asm.html

asm数据文件迁移(os–>asm)的更多相关文章

  1. Oracle 11g Rac 用rman实现把本地数据文件迁移到ASM共享存储中

    在Oracle Rac环境中,数据文件都是要存放在ASM共享存储上的,这样两个节点才能同时访问.而当你在某一节点下把数据文件创建在本地磁盘的时候,那么在另一节点上要访问该数据文件的时候就会报错,因为找 ...

  2. oracle之 RAC本地数据文件迁移至ASM

    系统环境:CentOS release 6.7 (Final)Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit 操作过 ...

  3. RAC本地数据文件迁移至ASM的方法--非归档模式

    系统环境:rhel6.2_x64+Oracle RAC11g 操作过程: 1.非归档模式 SQL> archive log list; Database log mode No Archive ...

  4. asm数据文件迁移(asm–>asm)

    rman迁移操作 [oracle@localhost oradata]$ rman target /   Recovery Manager: Release 10.2.0.3.0 - Producti ...

  5. Oracle 10g DG 数据文件迁移

    背景:某客户Oracle 10g 的DG由于空间不足,之前将部分数据文件迁移到其他目录,如今原目录扩容成功,要将之前迁移的数据文件再次迁移回来. 环境:Oracle 10.2.0.5 DG 单机 首先 ...

  6. Oracle 数据文件迁移

    背景 这两天做一个oracle数据库迁移,以前都是用exp.imp来走,这次用到了expdp.impdp,的确有些优势,但同时又想起了只是拷贝数据文件迁移的方式,其实这个方式不常用做迁移,更多用在磁盘 ...

  7. oracle数据文件迁移

    这篇文章是从网络上获取的,然后根据内容一步步操作, 1.目前的疑问:移动日志文件的时候,为何要先进行切换? 2.move操作后,再进行rename操作的原理 --------------------- ...

  8. Oracle数据文件迁移到裸设备

    本文主要描述如何将Oracle表空间的文件系统形式的数据文件迁移到LV裸设备上. 前提条件 1.oracle运行正常. 2.已使用LVM命令规划好LV文件.如/dev/vgoracle/lvdatat ...

  9. SqlServer:SqlServer(数据库备份,数据文件迁移,增加数据库文件组,递归查询一周报送情况,查询近X天未报送单位,截断数据库日志,复制单个或多个数据库表到另一个数据库 )

    1.数据备份 ) ) ) )),'-','') ) SET @savePath = 'f:/DatabaseBackup/' DECLARE My_Cursor CURSOR FOR ( select ...

随机推荐

  1. python中的注意事项

    .python 中的 and 从左到右计算表达式,若所有值均为真,则返回最后一个值,若存在假,返回第一个假值: or 也是从左到有计算表达式,返回第一个为真的值: 其中数字 0 是假,其他都是真: 字 ...

  2. ZOJ 2770 差分约束+SPFA

    Burn the Linked Camp Time Limit: 2 Seconds      Memory Limit: 65536 KB It is well known that, in the ...

  3. HDU-3480 Division (四边形不等式优化DP)

    题目大意:将n个数分成m组,将每组的最大值与最小值的平方差加起来,求最小和. 题目分析:先对数排序.定义状态dp(i,j)表示前 j 个数分成 i 组得到的最小和,则状态转移方程为dp(i,j)=mi ...

  4. Rotate Array 旋转数组 JS 版本解法

    Given an array, rotate the array to the right by k steps, where k is non-negative. 给定一个数组,并且给定一个非负数的 ...

  5. SSO-CAS单点登录

    基本概念 单点登录SSO ,是目前比较流行的企业业务整合的解决方案之一.SSO的定义是在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的应用系统. CAS(Centeral Authenti ...

  6. linux pipes

    In Linux, a pipe is implemented using two filedata structures which both point at the same temporary ...

  7. 【转】EDNS

    转自:https://www.cnblogs.com/cobbliu/p/3188632.html 随着业务的复杂化和多样化,RFC1035中定义的DNS消息格式和它支持的消息内容已经不足以满足一些D ...

  8. WordCount:C语言实现

    项目地址:https://github.com/m8705/WordCount 项目要求 wc.exe 是一个常见的工具,它能统计文本文件的字符数.单词数和行数. 这个项目要求写一个命令行程序,模仿已 ...

  9. spring入门程序编写

    1.导入jar包

  10. 2014.04.14 Lastpass活动,2年高级版

    点击进入活动地址. 我的邀请地址,^_^