Moving a datafile from the file system can be achived in two ways.
(1). While the database is shutdown (in mount stage).
(2). While the database is running (with the selected tablespace offline).
一. While the database is shutdown (in mount stage).
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.
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.
[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.
二. While the database is running (with the select tablespace offline).
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.
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. * * * * *
6. After you have successfully completed the above steps (2 -5) place the tablespace online;
SQL> alter tablespace USERS online;
The datafile has now been successfully moved to the ASM diskgroup.
From Oracle
-------------------------------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
Email: dvd.dba@gmail.com
DBA1 群:62697716(满); DBA2 群:62697977(满) DBA3 群:62697850(满)
DBA 超级群:63306533(满); DBA4 群: 83829929 DBA5群: 142216823
聊天 群:40132017 聊天2群:69087192
--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请
分享到:
相关推荐
How to view and edit data on ASM using BBED
ASM1153 USB转sata芯片datasheet
asm1352data sheet
ASM1166datasheet.pdf
asm1053 asm1153e datasheet asm1053 asm1153e 手册
ASM1061_Data Sheet_R1_8
asm330 solidstate gyroscope datasheet
ASM1153E Datasheet
该资源文档是ASMedia公司的芯片ASM1042的芯片技术规格书,可用于芯片资料的信息查询。
when the data file on an ASM disk group gets corrupted C. when one of the disks in a disk group is accidentally unplugged D. when one or more file directory paths are accidentally deleted from an ASM...
ASM1153E 的Datasheet,用于USB3.0到SATA的桥接,制作移动硬盘盒的资料
AASM远程升级软件资料,内部包含配药柜的软件开发文件,有远程升级方案研究报告,程序架构,功能手册,用户使用手册,与下位机通讯协议等资料
Database Initora parameters to support ASM ASM and database shutdown dependencies ASM and database deployment Best Practices Storage Management and Allocation Rebalance and Redistribution Files ...
PCIE转 4-SATA 6Gb/s
中国人写的ASM、AAM,包括最新的一些改进算法,代码规范,值得学习
linux下intel asm 转at & t asm
1、ASM1064 DATASHEET; 2、ASM1064 参考原理图设计; 3、支持的SPI Flash清单; 4、System BIOS Programming Note
汇编语言数据结构Data+Structures+In+ASM
ASM1062 pcie 转SATA x2 PCI Express 2.0 to 2 ports SATA 6Gbps AHCI Controller
System.asm