asm和file system之间数据文件的转换
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之间数据文件的转换的更多相关文章
- rac下asm管理的表空间-数据文件的重命名
asm下表空间的重命名与普通文件系统下的表空间重命名原理是一样的,只不过asm管理的数据文件有一些需要注意的地方,另外在asm下操作数据文件需要格外小心,稍有不慎将会造成数据文件丢失,如可以做备份最好 ...
- ASM集群文件系统ACFS(ASM Cluster File System)
在11g R2中ASM文件支持包括数据文件,控制文件,归档日志文件,spfile,RMAN备份文件,Change Tracking文件,数据泵Dump文件盒OCR文件等.而推出的ACFS和Oracle ...
- ASM时的OFM特性对影的建数据文件名称的影响及为SYSTEM表空间的数据文件使用别名
客户遇到个DG的问题,存储使用的ASM管理,有多个磁盘盘. 在主库创建数据文件,备库自己主动创建的数据文件都在同一磁盘组,而且在主库创建数据文件是指定的是类似**.DBF的名字,到备库也变成了使用AS ...
- 磁盘、分区及Linux文件系统 [Disk, Partition, Linux File System]
1.磁盘基础知识 1.1 物理结构 硬盘的物理结构一般由磁头与碟片.电动机.主控芯片与排线等部件组成:当主电动机带动碟片旋转时,副电动机带动一组(磁头)到相对应的碟片上并确定读取正面还是反面的碟面,磁 ...
- 12C新功能:在线移动数据文件 (Doc ID 1566797.1)
12C New Feature : Move a Datafile Online (Doc ID 1566797.1) APPLIES TO: Oracle Database - Enterprise ...
- 【转】Oracle 表空间与数据文件
--============================== --Oracle 表空间与数据文件 --============================== /* 一.概念 表空间:是一个或 ...
- 表空间与数据文件Offline,online的区别
首先明确,表空间与数据文件的关系:Oracle数据库表空间有两种,一种smallfile小文件表空间(默认),另一种bigfile大文件表空间: 默认表空间与数据文件的关系:允许一对多的处理方式,一个 ...
- Oracle 表空间与数据文件
-============================== --Oracle 表空间与数据文件 --============================== /* 一.概念 表空间:是一个或多 ...
- Git报错:error: cannot open .git/FETCH_HEAD: Read-only file system
Git:git pull时报错 error: cannot open .git/FETCH_HEAD: Read-only file system 查看该文件: 未在网上找到解决办法,重启服务器就好了 ...
随机推荐
- 学大伟业 Day 4 培训总结
今天讲的全是dp... 不多废话,先看一道经典的模板LIS(最长不下降子序列) 一.LIS 给定一个长度为N的数列,求最长上升子序列 例:1 7 2 8 3 4 答案:1 2 3 4 代码: #inc ...
- 消息中间件JMS(一)
1.JMS入门 1.1消息中间件 模块之间的依赖也称之为耦合.而耦合越多,之后的维护工作就越困难.那么如果改善系统模块调用关系.减少模块之间的耦合呢?我们接下来就介绍一种解决方案----消息中间件. ...
- Python—面向对象02
1.抽象类与归一化 接口,即提供给使用者来调用自己功能的方式.方法.入口 为什么要使用接口? 接口提取了一类共同的函数,可以把接口看做一个函数的集合 然后让子类去实现接口中的函数 这么做的意义在于 ...
- ES6 基础概念汇总
let const命令 声明变量 let 声明的变量 没有变量提升的效果 1 let声明的变量只在代码块内有效 for循环的计数器 2 不存在变量提升 要在声明后使用 let bar = 2 3 ...
- JavaScript函数-高阶函数
JavaScript的函数其实都指向某个变量.既然变量可以指向函数,函数的参数能接收变量,那么一个函数就可以接收另一个函数作为参数,这种函数就称之为高阶函数. function add(x,y,f) ...
- element 表单的input循环生成,并可单个input失去焦点单个验证并保存; (多个表单实例)
<div class="box_item"> <el-form ref="aList" :model="form" :ru ...
- <<学会提问>>第一章学习笔记
中国应不应该现在取消死刑? 中医是不是伪科学? 读书无用论? 集体主义和团队精神? 欧洲难民危机,你是支持接收难民,还是反对? 欧洲白左是不是幼稚圣母,抑或是右派种族歧视,顽固保守? 如何看待&quo ...
- flex布局设置min-width
在一个flex布局中,对于一个设置了flex属性设置为1的div容器,再对其设置min-width:0,保证内容不超出外层容器
- 封装localstorage方法
//封装操作localstorage本地存储的方法 var storage = { //存储 set(key, value) { localStorage.setItem(key, JSON.stri ...
- 配置Github秘钥
Git安装完成后,需要手动配置ssh密钥 配置github的ssh密钥: (1)打开Git Bash查看电脑上是否已经存在SSH密钥: 输入 cd ~/.ssh 若如上图显示无法找到该文件则要创建新的 ...