Oracle DBA Tips Corner

     Return to the Oracle DBA Tips Corner.

click me  


Oracle10g Data Guard Configuration Example - (Logical, Maximum Performance Mode)

by Jeff Hunter, Sr. Database Administrator


Contents

  1. Overview
  2. Introduction to Data Guard
  3. Configuration
  4. Hardware and O/S Configuration
  5. Configuring Nodes for Remote Access
  6. Configuring the Primary Database
  7. Configuring the Standby Database
  8. Start Remote Archiving
  9. Verifying the Logical Standby Database
  10. Role Transitions
  11. Which Role Transition Operation Should I Use?
  12. Implementing Role Switchover Operations
  13. Implementing Role Failover Operations
  14. Further Reading
  15. About the Author



Overview




Introduction to Data Guard




Hardware and O/S Configuration

Now, let's take a look at the Oracle database configuration and parameters we will be using for our physical standby database configuration.

Primary Database
Oracle Release: Oracle10g Release 2 - (10.2.0.3.0)
Machine Name: vmlinux3.idevelopment.info
Operating System: Red Hat Linux 4 - (CentOS 4.5)
Oracle SID: TESTDB
Instance Service Names: TESTDB.IDEVELOPMENT.INFO
TNS Service Name: TESTDB_VMLINUX3.IDEVELOPMENT.INFO
Standby Database
Oracle Release: Oracle10g Release 2 - (10.2.0.3.0)
Machine Name: vmlinux4.idevelopment.info
Operating System: Red Hat Linux 4 - (CentOS 4.5)
Oracle SID: TESTDB
Instance Service Names: TESTDB.IDEVELOPMENT.INFO
TNS Service Name: TESTDB_VMLINUX4.IDEVELOPMENT.INFO



Configuring Nodes for Remote Access

One other note about my configuration. I have both of my Linux servers configured with an .rhosts file for the oracle user in order to allow the use of the r* commands (like rcp). This allows me to expedite the initial copying of database files from the primary host to the standby host by not requiring me to manually login (FTP) with a username and password. Although it is only necessary to configure the standby database server with an .rhosts file (since it is the standby database server that needs to identify which servers will be trusted), I like to configure both nodes for remote access.

  The rsh daemon on the standby database server validates UNIX users using the /etc/hosts.equiv file or the .rhosts file found in the user's (oracle's) home directory.

  The use of rcp (and any other of the r* commands) is not required for normal Data Guard operation. rcp, however, does expedite the initial copying of database files from the primary host to the standby host! After copying all database files from the primary database server to the standby database server, this feature can be disabled.

Before configuring the .rhosts file, we must first make sure that we have the rsh RPMs installed on each node in the RAC cluster:

# rpm -q rsh rsh-server
rsh-0.17-25.3
rsh-server-0.17-25.3
From the above, we can see that we have the rsh and rsh-server installed.

  If rsh is not installed, run the following command from the CD where the RPM is located:
# su -
# rpm -ivh rsh-0.17-25.3.rpm rsh-server-0.17-25.3.rpm

To enable the "rsh" service, the "disable" attribute in the /etc/xinetd.d/rsh file must be set to "no" and xinetd must be reloaded. This can be done by running the following commands on both nodes in the Data Guard configuration:

# su -
# chkconfig rsh on
# chkconfig rlogin on
# chkconfig rsync on
# chkconfig rexec on
# service xinetd reload
Reloading configuration: [  OK  ]

Here is a copy of the .rhosts file I have configured on both of my Linux servers for the oracle user account. This file should reside in the $HOME directory for the oracle user account:

Example .rhosts File
+vmlinux3.idevelopment.info oracle
+vmlinux4.idevelopment.info oracle

  Before attempting to test the rsh command, ensure that you are using the correct version of rsh. By default, Red Hat Linux puts /usr/kerberos/sbin at the head of the $PATH variable. This will cause the Kerberos version of rsh to be executed.

I will typically rename the Kerberos version of rsh so that the normal rsh command will be used. Use the following:

# su -

# which rsh
/usr/kerberos/bin/rsh

# mv /usr/kerberos/bin/rsh /usr/kerberos/bin/rsh.original
# mv /usr/kerberos/bin/rcp /usr/kerberos/bin/rcp.original
# mv /usr/kerberos/bin/rlogin /usr/kerberos/bin/rlogin.original

# which rsh
/usr/bin/rsh

For security reasons, the permissions of the .rhosts file should be 600 and owned by the "oracle" user account. If instead, you are using a global /etc/hosts.equiv file, it should be owned by root and the permissions be set to 600. In fact, some systems will only honor the content of this file if the owner of this file is root and the permissions are set to 600.

$ chmod 600 ~/.rhosts
$ ls -l ~/.rhosts
-rw-------  1 oracle dba 0 Jun 21 17:08 /u01/app/oracle/.rhosts

After configuring the .rhost file on both computers, I like to perform a simple test from each machine to ensure that the configuration is valid:

FROM vmlinux3 MACHINE

    $ id
    uid=175(oracle) gid=115(dba) groups=115(dba) context=user_u:system_r:unconfined_t

    $ rsh vmlinux4 hostname
    vmlinux4


FROM vmlinux4 MACHINE

    $ id
    uid=175(oracle) gid=115(dba) groups=115(dba) context=user_u:system_r:unconfined_t

    $ rsh vmlinux3 hostname
    vmlinux3



Configuring the Primary Database




Configuring the Standby Database




Start Remote Archiving




Verifying the Logical Standby Database




Role Transitions




Which Role Transition Operation Should I Use?




Implementing Role Switchover Operations




Implementing Role Failover Operations




Further Reading

Additional information on Oracle10g Release 2 Data Guard can be found in the Data Guard Concepts and Administration. This guide is available from the Oracle Documentation Library website located at the following address http://download.oracle.com/docs/cd/B19306_01/server.102/b14239.pdf.



About the Author

Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author, and an Oracle ACE. Jeff currently works as a Senior Database Administrator for The DBA Zone, Inc. located in Pittsburgh, Pennsylvania. His work includes advanced performance tuning, Java and PL/SQL programming, capacity planning, database security, and physical / logical database design in a UNIX, Linux, and Windows server environment. Jeff's other interests include mathematical encryption theory, programming language processors (compilers and interpreters) in Java and C, LDAP, writing web-based database administration tools, and of course Linux. He has been a Sr. Database Administrator and Software Engineer for over 16 years and maintains his own website site at: http://www.iDevelopment.info. Jeff graduated from Stanislaus State University in Turlock, California, with a Bachelor's degree in Computer Science.



Copyright (c) 1998-2010 Jeffrey M. Hunter. All rights reserved.

All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.

I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.

Last modified on
Thursday, 23-Apr-2009 00:16:48 EDT
Page Count: 4489