Migrating an Oracle10g RAC Database from Oracle Cluster File System to Oracle Automatic Storage g Management on Dell/EMC Storage Arrays
By Zafar Mahmood, Uday Datta Shet, and Bharat Sajnani
/dev/raw/ASM1 /dev/raw/ASM2
/dev/emcpowerb1 /dev/emcpowerc1
4. Restart the raw device binding service on all nodes in the cluster:
service rawdevices restart
Note: In this example, the raw devices interface is used to prepare the ASM disk groups. Administrators also have the option of using the ASM library driver interface, which is available from the Oracle Technology Network, to prepare the additional storage. The raw devices interface was used in this migration example because, at the time of publication, EMC PowerPath software did not support the ASM library interface.
3. Start the ASM cluster instances on all RAC nodes and mount
the newly created ASM disk groups.
5. Prepare the existing OCFS-based RAC database for migration. 6. Migrate the OCFS-based RAC database files to ASM-managed
disk groups using the Oracle Recovery Manager (RMAN) utility.
7. Perform the following post-migration steps: a. Create a new temporary tablespace, which resides in an
ASM disk group.
b. Re-create the online redo log files on an ASM disk group. c. Migrate the server parameter file (spfile) from OCFS to an
ASM disk group. (This step is optional.)
file should be created in $ORACLE_HOME/dbs as init+ASMnode number.ora on all nodes in the cluster. For example, the file shown in Figure A should be created on node 1.
8. Perform verification checks on the migrated database. 9. Remove the database files residing on OCFS volumes to
reclaim the disk space for further expansion of ASM disk groups.
$ORACLE_HOME/dbs/init+ASM1.ora *.asm_diskgroups='DATA','RECOVERY' *.asm_diskstring='/dev/raw/ASM*' *.background_dump_dest='/opt/oracle/admin/+ASM/bdump' *.cluster_database=true *.core_dump_dest='/opt/oracle/admin/+ASM/cdump' +ASM2.instance_number=2 +ASM1.instance_number=1 *.instance_type='asm' *.large_pool_size=20M *.remote_login_passwordfile='exclusive' *.user_dump_dest='/opt/oracle/admin/+ASM/udump'
2. Make the user named oracle the owner of the newly added
devices:
chown oracle.dba /dev/raw/ASM* mkdir -p /opt/oracle/admin/+ASM/udump
Next, administrators should create ASM instance dump files and alert log file destination folders on all nodes:
Reprinted from Dell Power Solutions, August 2005. Copyright 2005 Dell Inc. All rights reserved.
1 1
ONLINE-EXTRA CONTENT
Migrating an Oracle10g RAC Database from Oracle Cluster File System to Oracle Automatic Storage g Management on Dell/EMC Storage Arrays, continued
Then, administrators should start the ASM instance named +ASM1 on the first node and create the disk groups, as shown in Figure B.
srvctl start asm -n zaf1850-pub
Next, administrators should restart ASM using the server control utility to enable the ASM CRS configuration:
Step 3: Starting ASM cluster instances and mounting ASM disk groups
The ASM instances should be started on all nodes in the cluster, and the ASM disk groups should be made available for the database file storage. Optionally, administrators can create the Oracle server parameter file (spfile) from the parameter file (pfile) to help ease ASM instance management:
SQL> create spfile='/dev/raw/spfile+ASM.ora' from pfile;
Next, administrators should edit $ORACLE_HOME/dbs/init+ ASM1.ora and point to the spfile file:
Similarly, administrators should edit the init+ASM2.ora file on the second node and point to the shared spfile.
-d zafdb
state, and then modify the database server parameter to point to the ASM disk groups and enable the use of Oracle Managed Files (OMF), as shown in Figure D.
[oracle@zaf1850-pub dbs]$ export ORACLE_SID=+ASM1 [oracle@zaf1850-pub dbs]$ sqlplus "/as sysdba" SQL> startup nomount; ASM instance started SQL> create diskgroup DATA external redundancy disk '/dev/raw/ASM1'; SQL> create diskgroup RECOVERY external redundancy disk '/dev/raw/ASM2';
[oracle@zaf1850-pub dbs]$ srvctl add asm -n zaf1850-pub -i +ASM1 -o $ORACLE_HOME [oracle@zaf1850-pub dbs]$ srvctl add asm -n zaf2850-pub -i +ASM2 -o $ORACLE_HOME [oracle@zaf1850-pub oracle]$ srvctl enable asm -n zaf1850-pub -i +ASM1 [oracle@zaf1850-pub oracle]$ srvctl enable asm -n zaf2850-pub -i +ASM2
August 2005
Reprinted from Dell Power Solutions, August 2005. Copyright 2005 Dell Inc. All rights reserved.
ONLINE-EXTRA CONTENT
Migrating an Oracle10g RAC Database from Oracle Cluster File System to Oracle Automatic Storage g Management on Dell/EMC Storage Arrays, continued
[oracle@zaf1850-pub oracle]$ sqlplus "/as sysdba" SQL> startup nomount SQL> alter system set control_files='+DATA/control.ctl' scope=spfile sid='*'; SQL> alter system set db_create_file_dest='+DATA' scope=spfile sid='*'; SQL> alter system set db_create_online_log_dest_1='+DATA' scope=spfile sid='*'; SQL> alter system set log_archive_dest_1='LOCATION=+RECOVERY' scope=spfile sid='*'; SQL> alter system set db_recovery_file_dest='+RECOVERY' scope=spfile sid='*';
First, administrators should migrate the control file from the OCFS location to the +DATA disk group:
tablespace for the database and drop the old temporary tablespace, which was on an OCFS volume:
Next, administrators should copy the existing database files into the new ASM disk group (this will retain the existing files):
RMAN> backup as copy database format '+DATA';
Re-create the online redo log files. Before dropping and recreating the online redo log files, administrators should take the following steps:
Finally, they should switch the database files into the new ASM disk group named +DATA:
1. Archive the online redo log files and then stop the archiving
RMAN> switch database to copy;
process:
SQL> alter system archive log all; SQL> alter system archive log stop;
Once this step is completed, all data files will have been migrated to the ASM disk group. The original data files stored on OCFS volumes will be cataloged as data file copies, so administrators can use them as backup, or they can use them to migrate back to the former storage system.
August 2005
2. Create online redo log files in the +DATA ASM disk group
using separate ASM directories for each instance. Connect to
Reprinted from Dell Power Solutions, August 2005. Copyright 2005 Dell Inc. All rights reserved.
ONLINE-EXTRA CONTENT
Migrating an Oracle10g RAC Database from Oracle Cluster File System to Oracle Automatic Storage g Management on Dell/EMC Storage Arrays, continued
SQL> col member format a25 SQL> select lf.member, l.bytes, l.group#, l.thread# from v$logfile lf, v$log l where lf.group# = l.group# and lf.type = 'ONLINE' order by l.thread#, l.sequence#;
GROUP# -------1 2 3 4
THREAD# -------1 1 2 2
3. Find the number, size, thread, and group information for the
existing log files so that they can be re-created on the ASM disk group, as shown in Figure E.
4. Create the redo log files for both threads (thread 1 is zafdb1
and thread 2 is zafdb2, respectively) on ASM disk groups and folders previously created:
SQL> alter database add logfile thread 1 group 5
SQL> alter database drop logfile group 1; SQL> alter database drop logfile group 2;
SQL> alter system switch logfile; SQL> alter system switch logfile; SQL> select group#, status from v$log; GROUP# -------4 5 6 7 8 STATUS -----------INACTIVE INACTIVE CURRENT ACTIVE CURRENT
SQL> alter database drop logfile group 3; SQL> alter database drop logfile group 4;
7. Start up the other instance and switch the log files for
instance 2 (zafdb2) twice to make the existing log file groups inactive (this operation must be performed from the second instance). Figure G shows these steps.
DELL POWER SOLUTIONS
August 2005
Reprinted from Dell Power Solutions, August 2005. Copyright 2005 Dell Inc. All rights reserved.
ONLINE-EXTRA CONTENT
Migrating an Oracle10g RAC Database from Oracle Cluster File System to Oracle Automatic Storage g Management on Dell/EMC Storage Arrays, continued
Migrate the server parameter file. Unlike the previous two tasks, this task is optional. Administrators can migrate the spfile server parameter file from OCFS to an ASM disk group by entering the following in the Oracle SQL*Plus command line:
SQL> create pfile='/home/oracle/pfile_asm_final. ora' from spfile; SQL> create spfile='+DATA/zafdb/spfilezafdb.ora' FROM pfile='/home/oracle/pfile_asm_final.ora';
NAME --------------------------------------------------+DATA/control.ctl
NAME ----------------------------------+DATA/zafdb/tempfile/temp_asm.266.1
STATUS ------ONLINE
[oracle@zaf1850-pub dbs]$ srvctl stop database -d zafdb [oracle@zaf1850-pub dbs]$ srvctl start database -d zafdb [oracle@zaf1850-pub dbs]$ srvctl status database -d zafdb Instance zafdb1 is running on node zaf1850-pub Instance zafdb2 is running on node zaf2850-pub
August 2005
Reprinted from Dell Power Solutions, August 2005. Copyright 2005 Dell Inc. All rights reserved.