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

操作过程:

1、添加数据文件或者创建表空间时,误操作将路径指定为单节点本地

SQL> alter tablespace users add datafile '/home/oracle/test.dbf' size 4m;
Tablespace altered.

SQL>
set line 180
col file_name for a60
col tablespace_name for a15
select file_name,file_id,online_status,tablespace_name from dba_data_files;

FILE_NAME FILE_ID ONLINE_ TABLESPACE_NAME
------------------------------------------------------------ ---------- ------- ---------------
+DATA/devdb/datafile/users.259.936769201 4 ONLINE USERS
+DATA/devdb/datafile/undotbs1.258.936769201 3 ONLINE UNDOTBS1
+DATA/devdb/datafile/sysaux.257.936769199 2 ONLINE SYSAUX
+DATA/devdb/datafile/system.256.936769199 1 SYSTEM SYSTEM
+DATA/devdb/datafile/example.265.936769441 5 ONLINE EXAMPLE
/home/oracle/test.dbf 6 ONLINE USERS
6 rows selected.

2.干净关闭RAC2,RAC1
srvctl stop database -d XXX

3.将RAC1启动mount状态
SQL> startup mount;

4.通过RMAN CP命令拷贝数据文件
node1-> rman target /
connected to target database: DEVDB (DBID=841499351, not open)

RMAN> copy datafile '/home/oracle/test.dbf' to '+data';

Starting backup at 2017/09/17 02:13:03
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=36 instance=devdb1 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/home/oracle/test.dbf
output file name=+DATA/devdb/datafile/users.273.954900787 tag=TAG20170917T021305 RECID=3 STAMP=954900786
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2017/09/17 02:13:07

Starting Control File and SPFILE Autobackup at 2017/09/17 02:13:07
piece handle=+FLASH/devdb/autobackup/2017_09_17/s_954900552.304.954900789 comment=NONE
Finished Control File and SPFILE Autobackup at 2017/09/17 02:13:10

5.在 ASM 中查找 /home/oracle/test.dbf 映射过来对应的 ASM 文件名
ASMCMD> cd data/devdb/datafile
ASMCMD> pwd
+data/devdb/datafile
ASMCMD> ls -lt user*
Type Redund Striped Time Sys Name
DATAFILE UNPROT COARSE SEP 17 03:00:00 Y USERS.273.954900787
DATAFILE UNPROT COARSE SEP 17 03:00:00 Y USERS.259.936769201
说明: /home/oracle/test.dbf 对应为 USERS 表空间, 所以这里为 user*

6.在sqlplus中将数据库启动到mount状态,rename数据文件
SQL> alter database rename file '/home/oracle/test.dbf' to '+DATA/devdb/datafile/USERS.273.954900787';

7.将rac1,rac2启动
#RAC1
SQL> alter database open;
Database altered.
SQL>

#RAC2
SQL> startup;

附:SYSTEM数据文件移植步骤(过程说明):
1. Stop DB.
2. Move the datafile using asmcmd.
3. Mount the DB.
4. Rename the datafile.
5. Open the DB.
6. On other RAC nodes you still need to bounce the database because it is SYSTEM tablespace, otherwise you will keep getting errors ORA-01516 or original error ORA-01157: cannot identify/lock data file.

oracle之 RAC本地数据文件迁移至ASM的更多相关文章

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

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

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

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

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

    --添加测试表空间 SQL> create tablespace xff datafile '/u01/oradata/xifenfei.dbf' size 10m autoextend on ...

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

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

  5. Oracle 数据文件迁移

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

  6. oracle数据文件迁移

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

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

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

  8. 【转】Oracle 表空间与数据文件

    --============================== --Oracle 表空间与数据文件 --============================== /* 一.概念 表空间:是一个或 ...

  9. Oracle 表空间与数据文件

    -============================== --Oracle 表空间与数据文件 --============================== /* 一.概念 表空间:是一个或多 ...

随机推荐

  1. java 中list进行动态remove处理

    java中遍历 list遇到需要动态删除arraylist中的一些元素 的情况 错误的方式 for(int i = 0, len = list.size(); i < len; i++){ if ...

  2. CEF3开发者系列之CefEnableHighDPISupport详解

    在CEF3中,CefEnableHighDPISupport()这个接口函数在使用时一般不为人所注意,但是如果稍有不慎,会造成打开的网页不能填满窗口的问题.如果是需要flash插件才能运行的游戏.则会 ...

  3. 如何解决tensorflow报:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2

    答:使能AVX,AVX2和FMA来进行源码编译,这样可以提速噢 具体编译方法,请参考windows10下如何进行源码编译安装tensorflow

  4. c++ 容器排序

    #include <algorithm> #include <functional> #include <array> #include <iostream& ...

  5. 上海仪电Azure Stack技术深入浅出系列1:谈Azure Stack在私有云/混合云生态中的定位

    2.2 Azure Stack Azure Stack到2017年7月才提供GA版本,但目前还是可以通过技术预览版了解该技术.Azure Stack本质上是核心Azure服务的一个私有实例. Micr ...

  6. PHP如何生成文章预览图

    PHP如何生成文章预览图 一.总结 一句话总结:php的wkhtmltox扩展,php官方文档有怎么使用,或者github,或者百度,等等等等 wkhtmltox 1.PHP如何自动生成文章预览图? ...

  7. @ResponseBody和@ResponseEntity注解

    如果需要返回json格式的数据,那么添加该注解就行了@ResponseBody对于ResponseEntity确切的说是ResponseEntity ,如果你即需要返回数据,又需要确定数据的状态,就用 ...

  8. arcgis api for silverlight开发系列之二:缓存图层与动态图层及图层总结 .

    本文摘自:http://blog.csdn.net/leesmn/article/details/6916458(很优秀的博客)   作为ESRI的平台的一份子arcgis api for silve ...

  9. (GoRails)ActionCable如何用Redis + 菜鸟redis教程

    视频: https://gorails.com/episodes/how-actioncable-uses-redis?autoplay=1 原理PubSub, 你进入一个频道,然后就能接收,和发布信 ...

  10. recv,recvfrom,send,sendto

    一般情况下:send(),recv()用于TCP,sendto()及recvfrom()用于UDP 但是send(),recv()也可以用于UDP,sendto()及recvfrom()也可以用于TC ...