Tuesday, August 11, 2020
dbametrix
More
    Home Oracle DBA Tips How 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 a local storage. We would migrate it to shared storage with 2 RAC instances.

    HIGH LEVEL STEPS:

    • Preliminary Configuration and Verification
    • Migrate the existing database to shared storage (Raw devices / ASM)
    • Install the CRS Software
    • Install Oracle RAC Software
    • Configure Listeners, tnsnames files
    • Modify/Create Initialization parameter, Password files
    • Start the first Instance
    • Create RAC data dictionary views
    • Create Undo tablespace, Redo log files
    • Bring up the Second RAC Instance
    • Verify status of RAC processes/Services

    DETAILED STEPS of converting:

    - Advertisement -
    dbametrix

    Pre-Setup:
    ———-

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

    Sample init, tnsnames, listener files

    Moving DB to shared storage:

    - Advertisement -
    dbametrix

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

    e.g.

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

    Start instance in mount state:

    startup mount;

    Rename datafiles:
    e.g.
    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;

    e.g.
    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

    e.g.
    ALTER TABLESPACE TEMP ADD TEMPFILE '/dev/raw/raw7'

    Create RAC dictionary views:

    @$ORACLE_HOME/rdbms/admin/catclust

    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 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 be keep yourself up to date. You should need to be aware of Cloud database technology like DBaaS. These all Oracle DBA tips are available in 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 be enjoy more advance topics from our partner resource.

    Consider reading to these articles:

    1+
    - Advertisement -
    dbametrix

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here

    - Advertisment -
    dbametrix

    Most Popular

    ASM Disk creation issue

    The article explains how to troubleshoot Oracle ASM disk creation. Solution of Oracle ASM disk creation with ASMLIB

    Oracle Tuning Basics Part-2

    This is the 2nd part of Oracle database tuning basics including depth of every aspects.

    Oracle Tuning Basics Part-1

    The article explains Oracle database performance tuning basics details.

    When you finding new job

    The article guides you 10 things to remember when you are searching a new job to improve yourself including skills and better growth for every DBA.

    Recent Comments