High Availbility

OS & Virtualization

Thursday, May 31, 2012

Cloning with Direct NFS

Clonedb is a new Direct NFS (DNFS) feature introduced in the 11.2.0.2.  clonedb uses dNFS technology to instantly fire up a clone using an existing backup of a database as the data store. The clone uses copy-on-write technology, so only changed blocks need to be stored locally, while the unchanged data is referenced directly from the backup files. This drastically increases the speed of cloning a system and means that several separate clones can function against a single set of backup datafiles, thus saving considerable amounts of space.
Configuration, Setup
  • NFS Server : viviana (ES Linux)
  • Primary DB server : Chopin
  • Clone DB server : Wolfgang
Create an file with the following attributes for each NFS server to be accessed using Direct NFSserver:


 viviana
path: 192.168.1.3
export: /u01/nfs/backup mount: C:\backup





Oracle Database uses an ODM library, , to enable Direct NFS. To replace the standard ODM library, , with the ODM NFS library,complete the following steps:



 
Shutdown database
C:\> copy oraodm11.dll oraodm11.dll.stub
C:\> copy /Y oranfsodm11.dll oraodm11.dll
On the NFS server, Export the directory as an NFS share by adding the following lines to the "/etc/exports" file
/u01/nfs/backup  *(rw,wdelay,insecure,no_root_squash,no_subtree_check)







Make sure the NFS service is available after reboot and restart the NFS service.



 
# chkconfig nfs on
# service nfs restart







Take a image backup of the production database:



 
run {
   set nocfau;
   backup as copy database format '/host/backups/prod/%U' ;
}






Use the following views for Direct NFS management:
  • v$dnfs_servers: Shows a table of servers accessed using Direct NFS.
  • v$dnfs_files: Shows a table of files currently open using Direct NFS.
  • v$dnfs_channels: Shows a table of open network paths (or channels) to servers for which Direct NFS is providing files.
  • v$dnfs_stats: Shows a table of performance statistics for Direct NFS


Thursday, May 24, 2012

Oracle Data Guard Broker DGMGRL Configuration

Step-by-step instructions on how to set up  DG broker
  1. Set up init parameters on primary to enable broker

     ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;
    ALTER SYSTEM SET DB_UNIQUE_NAME='apple1';
    ALTER SYSTEM SET DB_DOMAIN='db_domain';
  2. Set up init parameters on standby

     ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;
    ALTER SYSTEM SET DB_UNIQUE_NAME='apple2';
    ALTER SYSTEM SET DB_DOMAIN='db_domain';
  3. GLOBAL_DBNAME should be set to <<db_unique_name>>_DGMGRL.<<db_domain>> in listener.ora on all instances of both primary and standby.


     SID_LIST_LISTENER =
      (SID_LIST =
     (SID_DESC =
            (GLOBAL_DBNAME = apple1_dgmgrl)
            (ORACLE_HOME = c:\oracle\1020)
            (SID_NAME = apple1)
            )
    )
  4. TNSNAMES.ora need to change to the correct service_names as the listener.ora

    This is important otherwise you'll have TNS-12154 error during switchover operation.
  5. Create the configuration


     CREATE CONFIGURATION 'AppleDR' AS
    > PRIMARY DATABASE IS 'apple1'
    > CONNECT IDENTIFIER IS 'apple1'
    ADD DATABASE 'apple2' AS
    > CONNECT IDENTIFIER IS 'apple2'
    maintained as physical;
  6. Enable the configuration
     DGMGRL> ENABLE CONFIGURATION
    Enabled.

    DGMGRL> SHOW CONFIGURATION
    > show database verbose apple1

  7. Troubleshooting
     Let us see some sample issues and their fix

    Issue

     DGMGRL> CONNECT sys/sys
     ORA-16525: the Data Guard broker is not yet available
     
    Fix
     
    Set dg_broker_start=true



    Issue
     After enabling the configuration, on issuing SHOW CONFIGURATION, this error comes
    Warning: ORA-16608: one or more sites have warnings

    Fix
     To know details of the error, you may check log which will be generated at bdump with naming as drc{DB_NAME}.log or there are various monitorable properties that can be used to query the database status and assist in further troubleshooting.
  8. Monitoring the Data Guard Broker Configuration

    If we receive any error or warnings we can obtain more information about the same by running the commands as shown below. In this case there is no output seen because currently we are not experiencing any errors or warning.


     DGMGRL> SHOW DATABASE 'TESTPRI' 'StatusReport';
    DGMGRL> SHOW DATABASE 'TESTPRI' 'LogXptStatus';
    DGMGRL> SHOW DATABASE 'TESTPRI' 'InconsistentProperties';
    DGMGRL> SHOW DATABASE 'TESTPRI' 'InconsistentLogXptProps';
    DGMGRL> SHOW DATABASE 'TESTDG' 'StatusReport';
    DGMGRL> SHOW DATABASE 'TESTDG' 'LogXptStatus';
    DGMGRL> SHOW DATABASE 'TESTDG' 'InconsistentProperties';
    DGMGRL> SHOW DATABASE 'TESTDG' 'InconsistentLogXptProps';


    ;