How to move a datafile from a file system to ASM
Moving a datafile from the file system can be achived in two ways.

i. While the database is shutdown (in mount stage).
ii. While the database is running (with the selected tablespace offline).
(数据文件实现文件系统到ASM的转换迁移,一是在数据库mount状态,二是在open状态,但数据文件所属表空间需要offline状态)
-----------------------------------------------------------------------------------------------

i. While the database is shutdown (in mount stage).
(1、mount状态)
Moving oracle datafile while the database is in mount stage is performed in the following way:

1. Shutdown and mount the database.

[oracle@linux] sqlplus '/as sysdba'
SQL> shutdown immediate;
SQL> startup mount;

2. Ensure you have enough space in the ASM diskgroup to copy the datafile.
First identify the size of the datafile you wish to move.

在ASM上要有足够的空间

SQL> select file#, name, (bytes/1048576) File_Size_MB from v$datafile;
FILE# NAME FILE_SIZE_MB
----- ---------------------------- --------------
...
4 /oradata/PROD/users01.dbf 2500
...
* In this example we will be moving users01.dbf

[oracle@linux] export ORACLE_SID=+ASM

SQL> select NAME, STATE, TOTAL_MB, FREE_MB from v$asm_diskgroup;

NAME STATE TOTAL_MB FREE_MB
------------------------------ ----------- ---------- ----------
DGROUP1 MOUNTED 100 3
DGROUP2 MOUNTED 4882 4830

3. Connect to RMAN and copy the datafile from the filesystem to the select ASM diskgroup.

用RMAN copy 数据文件

[oracle@linux] rman target=/
RMAN> copy datafile 4 to '+DGROUP2'
Starting backup at 2006/09/05 12:14:23
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=31 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00004 name=/oradata/PROD/users01.dbf
output filename=+DGROUP2/PROD/datafile/users01.258.600351265 tag=TAG20060905T121424 recid=10 stamp=600351264
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:05:01
Finished backup at 2006/09/05 12:19:24

4. Update the controlfile with the new location of the datafile.

更新控制文件中的数据文件新的文件位置

[oracle@linux] rman target /
RMAN> switch datafile 4 to copy;
datafile 4 switched to datafile copy "+DGROUP2/PROD/datafile/users01.258.600351265".

5. The file is now if the new location.

在数据库中查看,文件位置已经更新

SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
..
+DGROUP2/PROD/datafile/users01.258.600351265
..

6. The database may now be opened.
open 数据库。

While the database is running (with the select tablespace offline).

在open状态下转换
In order to move a datafile on a running active database the tablespace where the datafile resides must be placed offline.

1. Identify the tablespace which contains the datafile and offline the tablespace.

确保表空间offline

SQL> select tablespace_name, file_name from dba_data_files where file_id=4;

TABLESPACE_NAME FILE_NAME
------------------ ------------------------------
USERS /oradata/RMAN/users01.dbf

SQL> alter tablespace USERS offline;

* * * * * Continue with Steps 2 - 5 above. * * * * *

以上步骤2-5相同

6. After you have successfully completed the above steps (2 -5) place the

tablespace online;

SQL> alter tablespace USERS online;

asm和file system之间数据文件的转换相关推荐

  1. rac下asm管理的表空间-数据文件的重命名

    asm下表空间的重命名与普通文件系统下的表空间重命名原理是一样的,只不过asm管理的数据文件有一些需要注意的地方,另外在asm下操作数据文件需要格外小心,稍有不慎将会造成数据文件丢失,如可以做备份最好 ...

  2. 服务器之间数据文件推送,数据库数据推送到另外服务器

    数据库数据推送到另外服务器 内容精选 换一换 该方案优点是简单,容易上手,缺点是停机时间较长.因此它适用于数据量不大,或者允许停机的时间较长,并且在这个时间范围内能够完成的数据.由于云数据库RDS服务 ...

  3. 使用AMDU工具从无法MOUNT的DISKGROUP中抽取数据文件

    AMDU是ORACLE针对ASM开发的源数据转储工具,其全称为ASM Metadata Dump Utility(AMDU) AMDU具体以下三个主要功能: 1. 将ASM DISK上的元数据转储到文 ...

  4. 磁盘、分区及Linux文件系统 [Disk, Partition, Linux File System]

    1.磁盘基础知识 1.1 物理结构 硬盘的物理结构一般由磁头与碟片.电动机.主控芯片与排线等部件组成:当主电动机带动碟片旋转时,副电动机带动一组(磁头)到相对应的碟片上并确定读取正面还是反面的碟面,磁 ...

  5. 续: [转]Oracle 表空间与数据文件

    续 http://nvd11.blog.163.com/blog/static/20001831220127710369356/ 五.数据文件 数据文件是数据库中最重要的一个要求,是所有的数据库内容存 ...

  6. Oracle 表空间与数据文件

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

  7. 西电李航 操作系统课程笔记 day8 Implementation of File system

    文章目录 File system Implementation 文件系统(file system) 布局 普通文件(file) 分配(allocation) 连续存储 指针存储 追踪(tracking ...

  8. asm 查看 数据文件 修改 时间_Oracle的ASM介绍及管理

    Oracle的ASM介绍及管理 Oracle经历过的文件系统历史 操作系统--逻辑卷管理器(LVM):管理文件相对容易,性能较差 裸设备:管理文件相对困难,性能好 OCFS(Oracle Cluste ...

  9. 迁移数据文件到ASM【转】

    1.迁移数据文件到ASM  1)数据库一致性情况下迁移:  将数据库启动到mount状态,生成rman copy 语句,然后在rman中执行:  SQL> startup mount  SQL& ...

最新文章

  1. android studio 开发android app 真机调试
  2. http发送16进制报文_阿里云物联网平台使用心得(25)MQTT协议详解UNSUBSCRIBE报文...
  3. C++中默认构造函数使用时的要点
  4. python常用函数使用方法实例
  5. 枚举算法:求解不等式
  6. crbug/1173575, non-JS module files deprecated.
  7. oracle数据库迁移部分表,oracle 数据库之间 表数据的 迁移
  8. 查看openfrie是否连接mysql_openfire连接mysql数据库的字符集问题解决
  9. mysql导入的sql文件导入到哪里了_mysql导入导出sql文件
  10. 7.29~8.2 广州软件所-实习工作日记
  11. 群晖3617可以有几个网卡_Synology 群晖 DS1621+ 六盘位NAS 开箱拆解评测
  12. 2017年第八届CSTQB®国际软件测试高峰论坛议题征集启动
  13. 文件夹重命名导致软件图标不显示问题解决
  14. JavaScript debugger调试
  15. es6 箭头函数 模板字符串 点点点运算符
  16. 口袋里的mini宝贝,西圣Ava蓝牙耳机,百元即可享受好音质耳机
  17. AVCaptureDevice中通过调用VideoZoomFactor方法调整焦距实现拉近拉远镜头进行拍照录制视频(动画缩放画面,不闪屏)
  18. 什么是批标准化 (Batch Normalization)
  19. PhotoShop cc合并多张静态图片为gif动画
  20. mysql maser-slave

热门文章

  1. nginx配置https以及出现的各种问题
  2. 三维CNN:收集一些最近的3d卷积网络PointNet++
  3. Dynamics CRM 注册插件dll到GAC
  4. uva 11401思维+预处理
  5. Netflix:我们为什么要将GraphQL引入前端架构?\n
  6. 浅析 React Fiber
  7. 并发-6-wait、notify、Semaphore、CountDownLatch、CyclicBarrier
  8. [Spark][Python]groupByKey例子
  9. hdu 5256 序列变换 (LIS变形)
  10. 装了Ubuntu后将默认启动项修改为windows