DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Monday, October 23, 2017

Migrating Database from ASM to Non-ASM

Migrating ASM Database to Non-ASM

1.Take a note of files like spfile, controlfile, datafiles, tempfiles, and onlinelog files.

2.Create the pfile from spfile

SQL> create pfile from spfile=’+DATA1/orcl/parameterfile/spfile.786.9846012754′;

File created.

3.Shutdown the database

SQL> shutdown immediate

4. Edit the created pfile

$ vi $ORACLE_HOME/dbs/initorcl.ora

Change the below parameters as per file system.

*.control_files=’/u01/oracle/oradata/’

*.db_create_file_dest=’/u01/oracle/oradata’

*.db_create_online_log_dest_1=’/u01/oracle/oradata’

5.Start the database in NOMOUNT with the new parameter file

SQL> startup nomount pfile='$ORACLE_HOME/dbs/initorcl'

Now the database instance has been started with the new parameter file

6 .Create the Controlfile: Controlfile can be created using RMAN

RMAN> restore controlfile from ‘+DATA1/orcl/backup.268.737822625’;

7. Mount the database: Using the created controlfile mount the database using RMAN

RMAN> alter database mount;

8. Backup the datafiles.

RMAN> backup as copy database format ‘/u01/oracle/oradata/ORCL/datafile/%U’;

9. Switch the database

RMAN> switch database to copy;

10. Open the database: Open the database using backup controlfile

SQL> recover database using backup controlfile until cancel;

Once media recovery completed successfully.

11. Open the database: Open the database with resetlogs

SQL> alter database open resetlogs;

Database altered.

12. Create the TEMP files: Though the RMAN will backup only the datafiles, we need to manually drop the datafiles of ASM and adding new tempfiles.

Drop the tempfile which is part of ASM diskgroup

SQL> alter tablespace def_temp drop tempfile ‘+DATA1/orcl/tempfile/def_temp.264.737822965’;

Adding new tempfile

SQL> alter tablespace def_temp add tempfile '/u01/oracle/oradata/ORCL/datafile/temp1.dbf';

SQL> select name from v$tempfile;

13. Adding onlinelog files:

Identify the existing onlinelog files and they status

SQL> select group#, status from v$log;

GROUP# STATUS
———- —————-
1      ACTIVE
2      CURRENT

Add some more logfile group

SQL> alter database add logfile size 50m;

SQL> alter database add logfile size 50m;

14. Identify the Logfile group status and removing the groups which are part of ASM diskgroup

SQL> select group#, status from v$log;

GROUP# STATUS
———- —————-
1      ACTIVE
2      CURRENT
3      UNUSED
4      UNUSED

15. Perform the manual logswitch so that the logfiles which are part of ASM diskgroup becomes INACTIVE

SQL> alter system switch logfile;

15. Remove the INACTIVE groups which are part of ASM diskgroup

SQL> select group#, status from v$log;

GROUP# STATUS
———- —————-
1      INACTIVE
2      INACTIVE
3      INACTIVE
4      CURRENT

SQL> alter database drop logfile group 1;

SQL> alter database drop logfile group 2;

16. Identify the proper onlinelog files which are part of filesystem

SQL> select group#, member from v$logfile;