---
title: "Steps To Migrate/Move a Database From Non-ASM to ASM And Vice-Versa [ID 252219.1"
author: "libin123"
date: "2010-05-14T15:08:37Z"
tags: []
categories: ["数据库"]
slug: "steps-to-migrate-move-a-database-from-non-asm-to-asm-and-vice-versa-id-252219-1"
draft: false
lastmod: "2010-05-14T15:08:37Z"
id: 666467
url: "https://dbua.iteye.com/blog/666467"
---

**Applies to:**

Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 11.1.0.7  
Information in this document applies to any platform.

[]()**Purpose**

This article describes the steps to migrate a database from Non-ASM to ASM and vice-versa.

To setup ASM, please follow

Note 452924.1 - How to Prepare Storage for ASM  
Note 265633.1 - ASM Technical Best Practices  
Note 249992.1 - New Feature on ASM (Automatic Storage Manager).

[]()**Scope and Application**

A scheduled downtime is needed.

[]()**Steps To Migrate/Move a Database From Non-ASM to ASM And Vice-Versa**

**Step 1: Edit the pfile/spfile of DB to point the new control\_file location on ASM**

E.g. : if your disk group name is '+DATA'

control\_files='+DATA/&lt;dbid&gt;/control01.ctl'

 The setting here is actually an alias for the controlfile.

For 10gR1 or you don't want to use an alias for controlfile, please set control\_files='+DATA' and use the following note to update the parameter again in the pfile/spfile after the controlfile is created at step #3.

Note 468458.1 - How To Move Controlfile To ASM

If you later want to duplicate an extra copy of control file, please see

Note 345180.1 - How to duplicate a controlfile when ASM is involved

 

**Step 2: Startup the database in nomount state**

**SQL&gt; Startup nomount**

 

**Step 3: From RMAN session, copy the control file from old location to new location**

RMAN&gt; CONNECT TARGET

RMAN&gt; RESTORE CONTROLFILE FROM '/u01/TST/control01.ctl';

Here /u01/TST/control01.ctl is the old location of control file.

**Step 4: From SQL session, mount the database**

SQL&gt; ALTER DATABASE MOUNT;

 

**Step 5: Using RMAN, copy the datafile from NON-ASM to ASM**

RMAN&gt;BACKUP AS COPY DATABASE FORMAT '+DATA';

 

**Step 6: Using RMAN, rename the datafile , using the following command**

RMAN&gt; SWITCH DATABASE TO COPY;

 

**Step 7: Switch tempfile and open database.**

RMAN&gt; run {  
set newname for tempfile 1 to '+DATA';  
set newname for tempfile 2 to '+DATA';  
...  
switch tempfile all;  
}

RMAN&gt; ALTER DATABASE OPEN;

 

**Step 8: Do the following maintenance**

SQL&gt; SELECT a.group#, b.member, a.status FROM v$log a, v$logfile b WHERE a.group#=b.group#;  
SQL&gt; ALTER DATABASE ADD LOGFILE MEMBER '+ASM\_Disk\_group' TO GROUP 1;  
SQL&gt; ALTER DATABASE ADD LOGFILE MEMBER '+ASM\_Disk\_group' TO GROUP 2;  
SQL&gt; ALTER DATABASE DROP LOGFILE MEMBER '';  
SQL&gt; ALTER SYSTEM SWITCH LOGFILE;  
SQL&gt; ALTER DATABASE DROP LOGFILE MEMBER '';  
SQL&gt; ALTER SYSTEM SWITCH LOGFILE;

... repeat for \*all* online redo log members.  
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. 

 

**STEP of MIGRATION from ASM to NON-ASM**

1\. Start your database with ASM.

2\. Create pfile from spfile.

3\. Edit pfile/spfile to reflect controlfile name in file system location.

4\. Startup nomount the DB.

SQL&gt; Startup nomount

5\. Use RMAN to copy the control file from ASM to NON-ASM.

RMAN&gt; RESTORE CONTROLFILE FROM '';

6\. Mount the DB.

SQL&gt; alter database mount;

7\. Use RMAN to copy the database from ASM to NON-ASM.

RMAN&gt; BACKUP AS COPY DATABASE format '/u01/oradata/nonasmdb/datafile/%U';

8\. From RMAN.

RMAN&gt; SWITCH DATABASE TO COPY;

9\. Recreate the tempfile and redo logs as before. See step 7 and 8 above.