--添加测试表空间
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. gleez安装报错

    1gleez安装时候常见的问题就是别人在代码版本服务器上安装好了,一般开发者都会去对文件做一些忽略,所以导致有几个文件是没有的.比如: bootstrap.php      .htaccess 2.如 ...

  2. Leetcode 526

    class Solution { public: int countArrangement(int N) { vector<int> nums; ;i <= N;i++) nums. ...

  3. Error: [ng:areq] Argument 'LoginCtrl' is not a function, got undefined

  4. OC Copy和Property

  5. zk如何实现watch

    在客户端发送命令:stat /zhang watch 在zk server中产生如下图的调用栈: //在DataTree类中有 private final WatchManager dataWatch ...

  6. UVALive 5846 计数

    DES:给出任意两点之间连线的颜色.问一共会有多少个由相同颜色的边组成的三角形. 一共有C(3, n)个三角形.考虑一每个点为顶点的三角形.颜色不同的两条边组成的三角形一定不行.所以减去. 题目链接: ...

  7. learning uboot part command

    => part --helppart - disk partition related commands Usage:part uuid <interface> <dev> ...

  8. bzoj1464

    题解: 简单bfs 显然不能到负数 也不能超过k两倍 代码: #include<bits/stdc++.h> using namespace std; ; int b[N],vis[N], ...

  9. bzoj1082

    题解: 暴搜+二分+剪枝 二分答案,暴力判断是否有解 然后加上剪枝 代码: #include<bits/stdc++.h> using namespace std; ; int rest, ...

  10. Java多线程安全问题

    body, table{font-family: 微软雅黑; font-size: 10pt} table{border-collapse: collapse; border: solid gray; ...