How to move a datafile from a file system to ASM (Doc ID 390274.1)

来源:互联网 发布:期货趋势分析软件 编辑:程序博客网 时间:2024/05/16 01:02

Applies to:

Oracle Database - Enterprise Edition - Version 10.1.0.5 to 10.2.0.3 [Release 10.1 to 10.2]
Information in this document applies to any platform.
***Checked for relevance on 23-June-2011***


Goal

This note will guide a DBA in moving a datafile currently located on file system to an ASM diskgroup.

Solution

How>[oracle@linux] sqlplus '/as sysdba'

SQL>>SQL> select file#, name, (bytes/1048576) File_Size_MB from v$datafile;

FILE#   NAME                         FILE_SIZE_MB
-----   ---------------------------- --------------
...
4       /oradata/PROD/users01.dbf    2500
...

* In>
SQL>>[oracle@linux] rman target=/

RMAN>>channel ORA_DISK_1: starting datafile copy
input>output filename=+DGROUP2/PROD/datafile/users01.258.600351265 tag=TAG20060905T121424 recid=10 stamp=600351264
channel ORA_DISK_1:>[oracle@linux] rman target /


RMAN>>SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
..
+DGROUP2/PROD/datafile/users01.258.600351265
..

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

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


SQL>>* * * * * Continue>SQL> alter tablespace USERS online;


     The datafile has now been successfully moved to the ASM diskgroup.

0 0
原创粉丝点击