Вы находитесь на странице: 1из 5

Convert Single Instance ( Non-RAC ) Database to RAC Here we are convering a Non-RAC Single Instance on a node where Cluster

Services are Running to a RAC Instance. Perform the following procedure to convert this type of single-instance database to a RAC database: ======================================= 1. Change the directory to the lib subdirectory in the rdbms directory under the Oracle home. 2. Relink the oracle binary by executing the following commands , to convert the Oracle Home to RAC-Enabled: (Database should be down , to relink 'oracle' executable with rac_on) make -f ins_rdbms.mk rac_on make -f ins_rdbms.mk ioracle Manual Database Conversion Procedure ======================================= 1. Create the OFA directory structure on all of the nodes that you have added. 2. copy the database datafiles, control files, redo logs, and server parameter file to their ASM Disk Groups (when using ASM) / corresponding raw devices (whan using raw devices )/ Cluster File systems (OCFS2/third party Cluster file systems) using the respective command. For ASM , the steps are outlined in : Migrate-Convert-Database-from-Non-ASM-toASM-Using-RMAN 3. Re-create the control files by executing the CREATE CONTROLFILE SQL statement with the REUSE keyword and specify MAXINSTANCES and MAXLOGFILES, and so on, as needed for your RAC configuration. The MAXINSTANCES recommended default is 32. 4. Shut down the database instance. 5. If your single-instance database was using an SPFILE parameter file, then create a temporary PFILE from the SPFILE using the following SQL statement: CREATE PFILE='pfile_name' from spfile='spfile_name' 6. Set the CLUSTER_DATABASE parameter to TRUE, set the INSTANCE_NUMBER parameter to a unique value for each instance, using a sid.parameter=value syntax. 7. Start up the database instance using the PFILE created in step 5. 8. If your single-instance database was using automatic undo management, then create an undo tablespace for each additional instance using the CREATE UNDO TABLESPACE SQL statement. 9. Create redo threads that have at least two redo logs for each additional instance. If you are using raw devices, then ensure that the redo log files are on raw devices.

Enable the new redo threads by using an ALTER DATABASE SQL statement. Then shutdown the database instance. 10. Copy the Oracle password file from the initial node, or from the node from which you are working, to the corresponding location on the additional nodes on which the cluster database will have an instance. Make sure that you replace the ORACLE_SID name in each password file appropriately for each additional instance. 11. Add REMOTE_LISTENER=LISTENERS_DB_NAME and sid.LOCAL_LISTENER=LISTENER_SID parameters to the PFILE. 12. Configure the net service entries for the database and instances and address entries for the LOCAL_LISTENER for each instance and REMOTE_LISTENER in the tnsnames.ora file and copy it to all nodes. 13. Create the SPFILE from the PFILE. If you are not using a cluster file system, then ensure that the SPFILE is on a raw device. 14. Add the configuration for the RAC database and its instance-to-node mapping using SRVCTL. 15. Start the RAC database using SRVCTL. After starting the database with SRVCTL, your conversion process is complete and, for example, you can execute the following SQL statement to see the statuses of all the instances in your RAC database: select * from v$active_instances

EXAMPLE : (In this case it was observerd that MAXINSTANCES was 8 and MAXLOGFILES was 16. Hence the Control file did not require re-creation) Shutdown the Database that needs to be converted to RAC rac1-> cd $ORACLE_HOME/rdbms/lib rac1-> make -f ins_rdbms.mk rac_on rac1-> make -f ins_rdbms.mk ioracle rac1-> cd $ORACLE_HOME/dbs rac1-> sqlplus SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 18:50:11 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. Enter user-name: / as sysdba Connected to an idle instance. SQL> create pfile='initstagedb.ora' from spfile='spfilestagedb.ora';

File created. SQL> exit rac1-> cp initstagedb.ora initstagedb1.ora rac1-> vi initstagedb1.ora *.cluster_database=true stagedb1.instance_number=1 rac1-> sqlplus SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 18:54:24 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. Enter user-name: / as sysdba Connected to an idle instance. SQL> !pwd /u01/app/oracle/product/10.2.0/db_2/dbs SQL> startup pfile=./initstagedb1.ora ORACLE instance started. ... Database opened. Add redo log groups for thread 1 and 2 .. SQL> alter database add logfile thread 1 group 1 ('+DATA'); Database altered. SQL> alter database add logfile thread 2 group 7 ('+DATA'); Database altered. Create Undo Tablespace for Instance 1 .The same needs to be done also for Instance 2 SQL> create undo tablespace undotbs_1 datafile '+DATA' size 2000M; Tablespace created. SQL> alter system set undo_tablespace='UNDOTBS_1' ; System altered. SQL> drop tablespace undotbs1 including contents and datafiles; Tablespace dropped. SQL> exit

rac1-> pwd /u01/app/oracle/product/10.2.0/db_2/dbs rac1-> pwd /u01/app/oracle/product/10.2.0/db_2/dbs rac1-> vi initstagedb1.ora and stagedb.undo_tablespace='UNDOTBS_1' rac1-> export ORACLE_SID=stagedb1 rac1-> sqlplus SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 19:12:10 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. Enter user-name: / as sysdba SQL> create spfile='spfilestagedb1.ora' from pfile='initstagedb1.ora'; File created. SQL> exit rac1-> srvctl add database -d stagedb -o /u01/app/oracle/product/10.2.0/db_2 rac1-> crs_stat -t Name Type Target State Host -----------------------------------------------------------ora.stagedb.db application OFFLINE OFFLINE ora.devdb.db application ONLINE ONLINE rac2 ora....b1.inst application ONLINE OFFLINE ora....b2.inst application ONLINE ONLINE rac2 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 ora....SM2.asm application ONLINE ONLINE rac2 ora....C2.lsnr application ONLINE ONLINE rac2 ora.rac2.gsd application ONLINE ONLINE rac2 ora.rac2.ons application ONLINE ONLINE rac2 ora.rac2.vip application ONLINE ONLINE rac2 rac1-> rac1-> sqlplus SQL*Plus: Release 10.2.0.1.0 - Production on Sun Nov 27 19:18:03 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved.

Enter user-name: / as sysdba Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, Real Application Clusters, OLAP and Data Mining options SQL> shut immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> exit rac1-> srvctl add instance -d stagedb -i stagedb1 -n rac1 rac1-> srvctl start database -d stagedb rac1-> crs_stat -t Name Type Target State Host -----------------------------------------------------------ora.stagedb.db application ONLINE ONLINE rac1 ora....ak.inst application ONLINE ONLINE rac1 ora.devdb.db application ONLINE ONLINE rac2 ora....b1.inst application ONLINE OFFLINE ora....b2.inst application ONLINE ONLINE rac2 ora....SM1.asm application ONLINE ONLINE rac1 ora....C1.lsnr application ONLINE ONLINE rac1 ora.rac1.gsd application ONLINE ONLINE rac1 ora.rac1.ons application ONLINE ONLINE rac1 ora.rac1.vip application ONLINE ONLINE rac1 ora....SM2.asm application ONLINE ONLINE rac2 ora....C2.lsnr application ONLINE ONLINE rac2 ora.rac2.gsd application ONLINE ONLINE rac2 ora.rac2.ons application ONLINE ONLINE rac2 ora.rac2.vip application ONLINE ONLINE rac2

Вам также может понравиться