Professional Documents
Culture Documents
html
You can use these steps to migrate a NON-ASM database to ASM database in Oracle 11gR2.
Prerequisite - ASM instance should be created and up and running. Please refer my previous
article to create a ASM instance
2) We should be able to check the ASM disk available from the instance which we created earlier
1) If you are using a spfile, take a backup of spfile using rman to restore it to ASM disk
3) Now restore the spfile from the backup to ASM disk as below
4) You can see, still the parameter "spfile" is pointing to file system instead of ASM disk
6) Delete "spfile<sid>.ora and init<sid>.ora from the $ORACLE_HOME/dbs directory and create a new
init<sid>.ora with the following line of content and start the instance,
vi initlearndb.ora
SPFILE='+DATA/spfilelearndb.ora'
SQL> Startup ( first it will search for spfile<sid>.ora which we deleted and next it will look for
init<sid>.ora which we have moified with the above content )
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
+DATA/LEARNDB/CONTROLFILE/current.256.787200593
6) Now shutdown the instance and startup in mount stage and check for the control file location
SQL> shutdown immediate
2) Use RMAN "BACKUP AS COPY" method to migrate the datafiles from filesystem to ASM
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
3) Switch the database to the copy created using the following RMAN command
RMAN> run
2> {
3> set newname for tempfile '/u01/data/learndb/temp01.dbf' to '+DATA';
4> switch tempfile all;
5> }
database opened
FILE_NAME
--------------------------------------------------------------------------------
+DATA/learndb/datafile/users.261.787201725
+DATA/learndb/datafile/undotbs1.259.787201713
+DATA/learndb/datafile/sysaux.257.787201553
+DATA/learndb/datafile/system.258.787201633
1) Identify the currently available redo log files using the following command
2 /u01/data/learndb/redo02.log CURRENT
1 /u01/data/learndb/redo01.log INACTIVE
3) Now drop the old logfiles, A redo log member can only be dropped after being archived and being in
INACTIVE mode. If needed, switch logfile multiple times until the logfile is ready for dropping.
ALTER DATABASE DROP LOGFILE MEMBER '/u01/data/learndb/redo01.log';
ALTER SYSTEM SWITCH LOGFILE;
ALTER DATABASE DROP LOGFILE MEMBER '/u01/data/learndb/redo02.log';
ALTER SYSTEM SWITCH LOGFILE;
ALTER DATABASE DROP LOGFILE MEMBER '/u01/data/learndb/redo03.log';
2 +DATA/learndb/onlinelog/group_2.265.787205405 INACTIVE
3 +DATA/learndb/onlinelog/group_3.266.787205417 INACTIVE