lunes, 1 de julio de 2013

Oracle 12c: Move Datafile online from ASM to Filesystem

Como una nueva característica de Oracle 12c ya se pueden mover los datafiles online, a continuación se moverá un datafile desde ASM a filesystem y nuevamente se regresará a ASM, los pasos son muy simples, el formato genérico para mover un datafile es:

ALTER DATABASE MOVE DATAFILE '<ruta origen>' to '<ruta destino>';


[oracle@orcl12c ~]$ srvctl status asm
ASM is running on orcl12c
[oracle@orcl12c ~]$ srvctl status database -d orcl
Database is running.
[oracle@orcl12c ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Mon Jul 1 14:48:27 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
+DATA/ORCL/DATAFILE/system.258.819378025
+DATA/ORCL/DATAFILE/sysaux.257.819377829
+DATA/ORCL/DATAFILE/users.259.819378241
+DATA/ORCL/DATAFILE/undotbs1.260.819378241

SQL>  alter database move datafile '+DATA/ORCL/DATAFILE/users.259.819378241' to '/home/oracle/users.259.819378241';

Database altered.

[oracle@orcl12c ~]$ ls -ltr /home/oracle
-rw-r----- 1 oracle asmadmin 5251072 Jul  1 14:51 users.259.819378241

[oracle@orcl12c ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Mon Jul 1 14:55:07 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL>  alter database move datafile '/home/oracle/users.259.819378241' to '+DATA';

Database altered.

No hay comentarios:

Publicar un comentario

Oracle ACE Director Award - Deiby Gómez

Thanks #OracleACE Program for this awesome certificate recognizing the work I have done in the community for the last year. Looking forwa...