remote dba support
    HomeOracle DBA TipsHow to convert single Instance to RAC?

    How to convert single Instance to RAC?

    Blog post explains how to convert single instance to Oracle RAC manually.

    Convert / Migrate single Instance database to RAC database manually

    Detailed steps to convert/migrate your single instance Oracle 12c Database to 2 node RAC database manually. The current environment is a single Instance Oracle 12c Database running on local storage. We would migrate it to shared storage with 2 RAC instances.


    DETAILED STEPS of converting:


    – Install the Oracle Clusterware and Oracle RAC Database software on nodes
    – Copy/Edit the original init file as init$SID1.ora and init$SID2.ora
    – Make sure SID, listeners, tnsnames, profile, password file are correct on both nodes

    - Advertisement -

    Sample init, tnsnames, listener files

    Moving DB to shared storage:

    Create pfile from spfile on original instance, if using spfile
    Shutdown original instance
    Copy only datafiles on raw devices:


    dd if=/oradata/file_name of=/dev/raw/raw5

    - Advertisement -

    Start instance in mount state:

    startup mount;

    Rename datafiles:
    alter database rename file '/u01/app/oracle/oradata/test12c/users01.dbf' to '/dev/raw/raw5';
    alter database rename file '/u01/app/oracle/oradata/test12c/temp01.dbf' to '/dev/raw/raw6';

    Alter database open;

    ADD LOGFILES on shared storage:

    (Don’t try to drop active group)

    select group#, bytes, status from v$log;
    select group#, member from v$logfile;

    alter database add logfile group 4 '/dev/raw/raw11' size 256M;
    alter database add logfile group 5 '/dev/raw/raw12' size 256M;

    select group#, status from v$log;
    alter system switch logfile;

    alter database drop logfile group 1;
    alter database drop logfile group 2;
    alter database drop logfile group 3;

    select group#, bytes, status from v$log;

    Alter database backup controlfile to trace;
    shutdown immediate;

    Edit init file and give raw location of controlfiles (rename spfile so Instance do not start using spfile)

    startup mount;

    Recreate controlfile;

    Alter database open;

    shutdown immediate;

    Now Database has been moved to shared storage on original instance.

    Now Start DB from RAC instance 1:

    (Make sure RAC instances have the latest init file)

    START the first instance

    Add tempfile


    Create RAC dictionary views:


    shutdown immediate

    From Linux prompt:
    srvctl add database -d -o $ORACLE_HOME
    srvctl add instance -d test12c -i test12c1 -n rac1
    srvctl add instance -d test12c -i test12c2 -n rac2
    srvctl start instance -d test12c -i test12c1

    / as sysdba

    alter database add logfile thread 2 group 1 '/dev/raw/raw15' size 128M;
    alter database add logfile thread 2 group 2 '/dev/raw/raw16' size 128M;
    alter database enable thread 2;

    create undo tablespace UNDOTBS2 datafile '/dev/raw/raw10' size 25M;

    – Start second instance:

    srvctl start instance -d test12c1 -i test12c2

    Verify the RAC services:

    crs_stat -t
    srvctl status database -d test12c
    srvctl stop database -d test12c
    srvctl start database -d test12c
    select instance_number instance#, instance_name, host_name, status from gv$instance;

    You have now converted your single instance database to a 2 node RAC database.

    When you want to make a strong Oracle DBA career then you should be aware of database services and other database technology. Without having knowledge of Oracle internals , Oracle performance tuning, and skill of Oracle database troubleshooting you can’t be an Oracle DBA expert. This expert DBA Team club blog always provides you latest technology news and database news to keep yourself up to date. You should need to be aware of Cloud database technology like DBaaS. All Oracle DBA tips are available in a single unique resource at our orageek. Meanwhile, we are also providing some sql tutorials for Oracle DBA. This is the part of Dbametrix Group and you would enjoy more advanced topics from our partner resource.

    - Advertisement -
    - Advertisment -
    remote dba services

    Most Popular