Nodes Available.
vmlinux1,vmlinux2
Single instance running at vmlinux1
ORACLE_HOME=/u05/app/oracle/product/10.2.0/db_1
SID=racorcl
Preparation Required before conversion.
Install clusterware in "/u01/app/oracle/product/10.2.0/db_1" on both nodes.
Install RAC enabled Database Software in "/u01/app/oracle/product/10.2.0/db_1" on both nodes.
Configure listener through the above ORACLE HOME for both the nodes.
Node 1: listener_vmlinux1 Port:1521
Node 2: listener_vmlinux2 Port:1521
Configure ASM through the above ORACLE HOME for both the nodes.
I have configured two DiskGroups named as following.
1) +DATA
2) +FLASH
Before going further make sure that "Nodeapps & ASM" services are running
on both the nodes.
[root@vmlinux2 10.2.0]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE vmlinux1
ora....X1.lsnr application ONLINE ONLINE vmlinux1
ora....ux1.gsd application ONLINE ONLINE vmlinux1
ora....ux1.ons application ONLINE ONLINE vmlinux1
ora....ux1.vip application ONLINE ONLINE vmlinux1
ora....SM2.asm application ONLINE ONLINE vmlinux2
ora....X2.lsnr application ONLINE ONLINE vmlinux2
ora....ux2.gsd application ONLINE ONLINE vmlinux2
ora....ux2.ons application ONLINE ONLINE vmlinux2
ora....ux2.vip application ONLINE ONLINE vmlinux2
Convert Database from NON-ASM to ASM.
From the ORACLE_HOME at "/u05/" convert database to NON-ASM to ASM.
The ASM to which the files should be converted is running on the
at "/u01".
Modify parameters
SQL> alter database disable block change tracking;
SQL> alter system set db_create_file_dest='+DATA' scope=spfile;
System altered.
SQL> alter system set db_recovery_file_dest='+FLASH' scope=spfile;
System altered.
SQL> alter system set control_files='+DATA' scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 201326592 bytes
Fixed Size 1218508 bytes
Variable Size 67110964 bytes
Database Buffers 130023424 bytes
Redo Buffers 2973696 bytes
Connect through RMAN.
[oracle@vmlinux1 bin]$ rman target=/
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Apr 25 19:35:38 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: racorcl (not mounted)
#Restore current controlfile from where it is presently located.
RMAN> restore controlfile from '/u05/app/oracle/oradata/racorcl/control01.ctl';
Starting restore at 25-APR-2012 19:37:58
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: copied control file copy
output filename=+DATA/racorcl/controlfile/backup.269.781558685
Finished restore at 25-APR-2012 19:38:08
# Mount The Database.
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
# Copy the database to ASM group.
RMAN> backup as copy database format '+DATA';
Starting backup at 25-APR-2012 19:40:14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00001 name=/u05/app/oracle/oradata/racorcl/system01.dbf
output filename=+DATA/racorcl/datafile/system.270.781558817 tag=TAG20120425T194015 recid=2 stamp=781558865
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile fno=00003 name=/u05/app/oracle/oradata/racorcl/sysaux01.dbf
output filename=+DATA/racorcl/datafile/sysaux.262.781558883 tag=TAG20120425T194015 recid=3 stamp=781558964
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:42
channel ORA_DISK_1: starting datafile copy
input datafile fno=00005 name=/u05/app/oracle/oradata/racorcl/example01.dbf
output filename=+DATA/racorcl/datafile/example.256.781558973 tag=TAG20120425T194015 recid=4 stamp=781558991
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile fno=00002 name=/u05/app/oracle/oradata/racorcl/undotbs01.dbf
output filename=+DATA/racorcl/datafile/undotbs1.257.781558999 tag=TAG20120425T194015 recid=5 stamp=781559002
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:08
channel ORA_DISK_1: starting datafile copy
input datafile fno=00004 name=/u05/app/oracle/oradata/racorcl/users01.dbf
output filename=+DATA/racorcl/datafile/users.258.781559007 tag=TAG20120425T194015 recid=6 stamp=781559007
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
copying current control file
output filename=+DATA/racorcl/controlfile/backup.259.781559007 tag=TAG20120425T194015 recid=7 stamp=781559008
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 25-APR-2012 19:43:32
channel ORA_DISK_1: finished piece 1 at 25-APR-2012 19:43:33
piece handle=+DATA/racorcl/backupset/2012_04_25/nnsnf0_tag20120425t194015_0.260.781559013
tag=TAG20120425T194015 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 25-APR-2012 19:43:33
# Switch the database to new copy.
RMAN> switch database to copy;
datafile 1 switched to datafile copy "+DATA/racorcl/datafile/system.270.781558817"
datafile 2 switched to datafile copy "+DATA/racorcl/datafile/undotbs1.257.781558999"
datafile 3 switched to datafile copy "+DATA/racorcl/datafile/sysaux.262.781558883"
datafile 4 switched to datafile copy "+DATA/racorcl/datafile/users.258.781559007"
datafile 5 switched to datafile copy "+DATA/racorcl/datafile/example.256.781558973"
# Recover Database
RMAN> recover database;
Starting recover at 25-APR-2012 19:45:25
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 25-APR-2012 19:45:27
# Connect Through SQL prompt.
# Move flashback logs if flashback is enabled.
# SQL> alter database flashback off;
# SQL> alter database flashback on;
SQL> select open_mode from v$database;
OPEN_MODE
----------
MOUNTED
SQL> alter database open;
Database altered
# Create temporary tablespace in the new location and drop
# the old one.
SQL> create temporary tablespace temp1 tempfile '+DATA';
Tablespace created.
SQL> alter database default temporary tablespace temp1;
Database altered.
SQL> drop tablespace temp including contents and datafiles;
Tablespace dropped.
# Create RedoLog Groups in the new location and drop the old ones.
SQL> alter database add logfile group 4 '+DATA';
Database altered.
SQL> alter database add logfile group 5 '+DATA';
Database altered.
SQL> alter database add logfile group 6 '+DATA';
Database altered.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
1 1 2 52428800 1 NO ACTIVE
475458 25-APR-12
2 1 3 52428800 1 NO CURRENT
478631 25-APR-12
3 1 1 52428800 1 NO INACTIVE
446075 25-APR-12
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
4 1 0 104857600 1 YES UNUSED
0
5 1 0 104857600 1 YES UNUSED
0
6 1 0 104857600 1 YES UNUSED
0
6 rows selected.
SQL> alter system switch logfile;
SQL> alter system switch logile;
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
1 1 2 52428800 1 NO ACTIVE
475458 25-APR-12
2 1 3 52428800 1 NO ACTIVE
478631 25-APR-12
3 1 1 52428800 1 NO INACTIVE
446075 25-APR-12
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
4 1 4 104857600 1 NO ACTIVE
478688 25-APR-12
5 1 5 104857600 1 NO CURRENT
478690 25-APR-12
6 1 0 104857600 1 YES UNUSED
0
6 rows selected.
SQL> alter system checkpoint;
System altered.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
1 1 2 52428800 1 NO INACTIVE
475458 25-APR-12
2 1 3 52428800 1 NO INACTIVE
478631 25-APR-12
3 1 1 52428800 1 NO INACTIVE
446075 25-APR-12
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIM
------------- ---------
4 1 4 104857600 1 NO INACTIVE
478688 25-APR-12
5 1 5 104857600 1 NO CURRENT
478690 25-APR-12
6 1 0 104857600 1 YES UNUSED
0
6 rows selected.
SQL> alter database drop logfile group 1;
Database altered.
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database drop logfile group 3;
Database altered.
SQL> shutdown immediate
SQL> exit
Switch your database ORACLE_HOME(from "/u05/" to "/u01").
1) create pfile from spfile and change all the locations from
"/u05" to "/u01".
Also make appropriate directory structures for the new location.
2) Then convert it back to spfile.
Here is my sample pfile after conversion.
racorcl.__db_cache_size=130023424
racorcl.__java_pool_size=4194304
racorcl.__large_pool_size=4194304
racorcl.__shared_pool_size=58720256
racorcl.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/racorcl/adump'
*.background_dump_dest='/u01/app/oracle/admin/racorcl/bdump'
*.compatible='10.2.0.1.0'
*.control_files='+DATA/racorcl/controlfile/backup.269.781558685'#Restore Controlfile
*.core_dump_dest='/u01/app/oracle/admin/racorcl/cdump'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='racorcl'
*.db_recovery_file_dest_size=2147483648
*.db_recovery_file_dest='+FLASH'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=racorclXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=66060288
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=199229440
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/racorcl/udump'
3) Copy all the files from the "dbs" folder from old Oracle home to the new one.
4) change database entries in "/etc/oratab" so they point to the new oracle home.
Make appropriate changes in the bash profile so that the database starts
from the new oracle home.
Before going further start the database from the new oracle home and make
sure it is running.
Conversion Using RCONFIG.
[oracle@vmlinux1 ~]$ cp /u01/app/oracle/product/10.2.0/db_1/assistants/rconfig/sampleXMLs/ConvertToRAC.xml /u01/
# Edit the file
# Sample file.
<?xml version="1.0" encoding="UTF-8"?>
<n:RConfig xmlns:n="http://www.oracle.com/rconfig"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.oracle.com/rconfig">
<n:ConvertToRAC>
<!-- Verify does a precheck to ensure all pre-requisites are met, before the
conversion is attempted. Allowable values are: YES|NO|ONLY -->
<n:Convert verify="YES">
<!--Specify current OracleHome of non-rac database for SourceDBHome -->
<n:SourceDBHome>/u01/app/oracle/product/10.2.0/db_1</n:SourceDBHome>
<!--Specify OracleHome where the rac database should be configured. It can be same as SourceDBHome -->
<n:TargetDBHome>/u01/app/oracle/product/10.2.0/db_1</n:TargetDBHome>
<!--Specify SID of non-rac database and credential. User with sysdba role is required to perform conversion -->
<n:SourceDBInfo SID="racorcl">
<n:Credentials>
<n:User>sys</n:User>
<n:Password>sys</n:Password>
<n:Role>sysdba</n:Role>
</n:Credentials>
</n:SourceDBInfo>
<!--ASMInfo element is required only if the current non-rac database uses ASM Storage -->
<n:ASMInfo SID="+ASM1">
<n:Credentials>
<n:User>sys</n:User>
<n:Password>sys</n:Password>
<n:Role>sysdba</n:Role>
</n:Credentials>
</n:ASMInfo>
<!--Specify the list of nodes that should have rac instances running. LocalNode should be the first
node in this nodelist. -->
<n:NodeList>
<n:Node name="vmlinux1"/>
<n:Node name="vmlinux2"/>
</n:NodeList>
<!--Specify prefix for rac instances. It can be same as the instance name for non-rac database or different.
The instance number will be attached to this prefix. -->
<n:InstancePrefix>racorcl</n:InstancePrefix>
<!--Specify port for the listener to be configured for rac database.If port="", alistener existing on
localhost will be used for rac database.The listener will be extended to all nodes in the nodelist -->
<n:Listener port=""/>
<!--Specify the type of storage to be used by rac database. Allowable values are CFS|ASM. The non-rac database
should have same storage type. -->
<n:SharedStorage type="ASM">
<!--Specify Database Area Location to be configured for rac database.If this field is left empty, current
storage will be used for rac database. For CFS, this field will have directory path. -->
<n:TargetDatabaseArea>+DATA</n:TargetDatabaseArea>
<!--Specify Flash Recovery Area to be configured for rac database. If this field is left empty, current
recovery area of non-rac database will be configured for rac database. If current database is not using
recovery Area, the resulting rac database will not have a recovery area. -->
<n:TargetFlashRecoveryArea>+FLASH</n:TargetFlashRecoveryArea>
</n:SharedStorage>
</n:Convert>
</n:ConvertToRAC>
</n:RConfig>
Before running the rconfig utility make
sure user equivalence is enabled for all the nodes.
Also, make sure that "Nodeapps and ASM" services are running on all the nodes.
[oracle@vmlinux1 ~]$ cd /u01/app/oracle/product/10.2.0/db_1/bin/
[oracle@vmlinux1 bin]$ ./rconfig /u01/ConvertToRAC.xml
Converting Database racorcl to Cluster Database. Target Oracle Home : /u01/app/oracle/product/10.2.0/db_1.
Setting Data Files and Control Files
Adding Database Instances
Adding Redo Logs
Enabling threads for all Database Instances
Setting TEMP tablespace
Adding UNDO tablespaces
Adding Trace files
Setting Flash Recovery Area
Updating Oratab
Creating Password file(s)
Configuring Listeners
Configuring related CRS resources
Adding NetService entries
Starting Cluster Database
Got Exception
oracle.sysman.assistants.rconfig.engine.CRSStartupException: oracle.
ops.mgmt.database.DatabaseException: PRKP-1001 : Error starting instance racorcl2 on node vmlinux2
CRS-0215: Could not start resource 'ora.racorcl.racorcl2.inst'.
Operation Failed. Refer logs at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/
rconfig/rconfig.log for more details.
In order to resolve the last error copy the spfile from node1 to node2
and start the instance using srvctl.
[oracle@vmlinux1 ~]$ scp /u01/app/oracle/product/10.2.0/db_1/dbs/spfileracorcl.ora vmlinux2:/u01/app/oracle
/product/10.2.0/db_1/dbs/
spfileracorcl.ora 100% 3584 3.5KB/s 00:00
0 comments:
Post a Comment