Oracle database ASM migration….

Successfully migrated an oracle database from filesystem to ASM. More or less it was easy…

shutdown immediate
startup mount
alter database archivelog;
startup;

[oracle@scada ~]$ rman target=/

Recovery Manager: Release 11.2.0.3.0 – Production on Mon Jun 3 19:35:59 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: DB (DBID=1578985198)

RMAN> backup as copy incremental level 0 database format ‘+DATA’ tag ‘ORA_ASM_MIGRATION’;

RMAN> restore spfile to ‘+DATA/DB/spfiledb.ora’;
RMAN> shutdown immediate

mv $ORACLE_HOME/dbs/spfileDB.ora $ORACLE_HOME/dbs/spfileDB.ora.bak
echo “SPFILE=’+DATA/DB/spfiledb.ora’ > $ORACLE_HOME/dbs/initDB.ora

SQL> STARTUP FORCE NOMOUNT;
SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST=’+DATA’ SID=’*’;

if ( FRA is used ) {
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=100G SID=’*’;
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST=’+FRA’ SID=’*’;
}

SQL> ALTER SYSTEM SET CONTROL_FILES=’+DATA’,’+DATA’ SCOPE=SPFILE SID=’*’;
SQL> SHUTDOWN IMMEDIATE

RMAN> STARTUP FORCE NOMOUNT;
RMAN> RESTORE CONTROLFILE FROM ‘/data/oradata/DB/control01.ctl’;
RMAN> SWITCH DATABASE TO COPY;
RMAN> RECOVER DATABASE;

SQL> alter database add logfile thread 1 size 100M;
SQL> alter database add logfile thread 1 size 100M;
SQL> alter database add logfile thread 1 size 100M;
SQL> select * from v$log;
SQL> select * from v$logfile;
SQL> alter database drop logfile group <nr>
SQL> alter database drop logfile member ‘/u01/oradata/DB/onlinelog/o1_mf_2_8tssrbd8_.log’;
SQL> ..
SQL> alter system switch logfile;
SQL> alter system checkpoint global;
SQL> alter tablespace temp add tempfile size 2G;
SQL> alter tablespace temp drop tempfile ‘/u00/oradata/DB/temp01.dbf’;