10G Data Guard (09)

Thursday 07 August, 2008 - 11:01

Success (Almost)

I have managed to duplicate the example database onto the botany cluster using RMAN.  The standby database has been registered to Grid Control.

However, I am having difficulty in getting Grid Control to manage the Standby configuration because of mismatched service names - the standby database has BOTANY.yaocm.id.au whereas Grid Control is expecting example2.yaocm.id.au.

The rough procedure is:

  • Replicate the directory structure for $ORACLE_BASE/admin/example/[abcu]dump on both nodes
  • Create the directory structure in ASM via ASMCMD mkdir command for:
    • +DATA/example
    • +DATA/BOTANY
    • +FRA/example
    • +FRA/BOTANY
  • Create a directory called /u00/backup on padstow2 and botany2 (these nodes have more disk space because the installation software was not loaded there)
  • Fiddle around with the listener configurations (need to clarify this in my next attempt)
  • Using RMAN on padstow2 ,
  • rman target / catalog rman@rmancat
    backup validate database; /* checks integrity of database */
    blockrecover corruption list; /* repairs any damaged blocks */
    backup format="/u00/backup/%U.dbf" database;
    backup format="/u00/backup/%U.dbf" current controlfile for standby;
    sql "alter system switch logfile"; /* also done on padstow1 */
    backup format="/u00/backup/%U.dbf" archivelog all; /* wrong order, but it works? */
    sql "create pfile='/u00/backup/initexample2.ora' from spfile";
    restore validate database; /* checks the integrity of the backup */
    exit
    
  • Run the following command to copy the backup files to the physical standby site:
  • scp /u00/backup/* botany2:/u00/backup/
    
  • On botany2 , update /etc/oratab with
  • example2:/u00/app/oracle/product/10.2.0/db_1:N
    
  • Run the following commands:
  • export ORACLE_HOME=/u00/app/oracle/product/10.2.0/db_1
    export ORACLE_SID=example2
    export PATH=$ORACLE_HOME/bin:$PATH # or I could use . oraenv
    
  • Update /u00/backup/initexample2.ora to:
    1. change the DB_UNIQUE_NAME to BOTANY
    2. add:
    3. spfile='+DATA/example/spfileexample'
      
  • Run the following commands:
  • sqlplus / as sysdba
    startup nomount pfile='/u00/backup/initexample2.ora'
    create spfile='+DATA/example/spfileexample' from pfile='/u00/backup/initexample2.ora'
    shutdown immediate
    exit
    rman target sys@padstow2 catalog rman@rmancat auxiliary /
    startup clone nomount
    duplicate target database for standby dorecover;
    
  • ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

At this point, the standby database appears to be up and running.

To get Grid Control to recognise the new database, I had to open the database as read-only:

sqlplus / as sysdba
shutdown immediate
startup mount
alter database open read only;

Now the Grid Control is able to connect to the database and is thus able to be registered.