--添加测试表空间
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. 用实例说明Spark stage划分原理

    注意:此文的stage划分有错,stage的划分是以shuffle操作作为边界的,可以参考<spark大数据处理技术>第四章page rank例子! 参考:http://litaotao. ...

  2. 关于display:grid layout

    .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; grid-auto-rows: min ...

  3. ZOJ 3822 Domination 概率dp 难度:0

    Domination Time Limit: 8 Seconds      Memory Limit: 131072 KB      Special Judge Edward is the headm ...

  4. 快速切题 sgu119. Magic Pairs

    119. Magic Pairs time limit per test: 0.5 sec. memory limit per test: 4096 KB “Prove that for any in ...

  5. 软工作业No.9 第六周 事后诸葛亮分析报告

    甜美女孩项目2048结果 整理:邓画月.曾祎祺 设想和目标 1. 我们的软件要解决什么问题?是否定义得很清楚?是否对典型用户和典型场景有清晰的描述? 弄一个给用户消磨时间的游戏,定义的很清楚.该游戏玩 ...

  6. python 元组(tuple)

    面试python我想每个人都会被问一个问题,就是python中的list和tuple有什么区别? 一般情况下,我会回答,list元素可变,tuple元素不可变(书上或者其他的博客都是这么写的),一般情 ...

  7. CUDA ---- Dynamic Parallelism

    Dynamic Parallelism 到目前为止,所有kernel都是在host端调用,GPU的工作完全在CPU的控制下.CUDA Dynamic Parallelism允许GPU kernel在d ...

  8. http指定状态码

    Http状态代码 1.指定状态码: setStatus HttpServletResponse的setStatus方法.如果响应的状态代码比较特殊,并且伴有相关的文档内容,那么一定要在用PrintWr ...

  9. spring的orm模块

    spring整合hibernate 1.hibernate使用注解. daoImpl需要继承HibernateDaoSupport对象,针对给对象的getHibernateTemplate()进行hi ...

  10. L238

    Betty was offended because she felt that her friends had ignored her purposefully(deliberately) at t ...