Setting up the database for the secondary site

To set up the database for the secondary site

  1. Do not create the database. The database will be replicated from the primary site.

    • If you are using hardware-based replication, the database, disk group, and volumes will be replicated from the primary site.

      Create the directory for the CFS mount point which will host the database data and control files.

    • If you are using VVR for replication, create an identical disk group and volumes for the replicated content with the same names and size as listed on the primary site.

      Create the directories for the CFS mount points as they are on the primary site. These will be used to host the database and control files when the failover occurs and the secondary is promoted to become the primary site.

  2. Copy the init.ora file from $ORACLE_HOME/dbs at the primary to $ORACLE_HOME/dbs at the secondary.

  3. Create the following subdirectories as you did on the primary site:

    For Oracle RAC 10g:

    $ mkdir -p /$ORACLE_BASE/admin/adump
    $ mkdir -p /$ORACLE_BASE/admin/database_name/bdump
    $ mkdir -p /$ORACLE_BASE/admin/database_name/cdump
    $ mkdir -p /$ORACLE_BASE/admin/database_name/dpdump
    $ mkdir -p /$ORACLE_BASE/admin/database_name/hdump
    $ mkdir -p /$ORACLE_BASE/admin/database_name/udump
    $ mkdir -p /$ORACLE_BASE/admin/database_name/pfile

    For Oracle RAC 11g there is no need to create the subdirectories since they are created automatically by Oracle RAC 11g when the database starts.

  4. On the secondary site, as Oracle user, make sure that Oracle Clusterware is up and running on the second site. You can do one of the following:

    • Copy the listener.ora and tnsnames.ora files from the primary site and update the names as appropriate for the secondary site.

    • Use Oracle's netca utility to to configure the listener.ora and tnsnames.ora files on the secondary site.

  5. On the secondary site, register the database using srvctl command.

    $ srvctl add database -d database_name \
    -o oracle_home
  6. Modify $ORACLE_HOME/dbs/ init_oradb1.ora file Add following lines in above file

    remote_listener= <SCAN_NAME>:1521
    SPFILE='<SPFILE NAME PATH>'

  7. To prevent automatic database instance restart, change the Management policy for the database (automatic, manual) to MANUAL using the srvctl command:

    $ srvctl modify database -d database_name -y manual
    	
  8. Register the instances using srvctl command. Execute the following command on each node:

    $ srvctl add instance -d database_name \
    -i instance_name -n node-name