www.it-ebooks.info Oracle Data Guard 11 g R2 Administration Beginner's Guide Learn how to build and maintain Data Guard conguraons with real-life, praccal examples Emre Baransel Nassyam Basha BIRMINGHAM - MUMBAI www.it-ebooks.info Oracle Data Guard 11 g R2 Administration Beginner's Guide Copyright © 2013 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmied in any form or by any means, without the prior wrien permission of the publisher, except in the case of brief quotaons embedded in crical arcles or reviews. Every eort has been made in the preparaon of this book to ensure the accuracy of the informaon presented. However, the informaon contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark informaon about all of the companies and products menoned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this informaon. First published: June 2013 Producon Reference: 1170613 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-84968-790-4 www.packtpub.com Cover Image by Sandeep Babu (sandyjb@gmail.com) www.it-ebooks.info Credits Authors Emre Baransel Nassyam Basha Reviewers Syed Jaar Hussain Michael Seberg Joel Perez Acquision Editor Marn Bell Lead Technical Editor Susmita Panda Technical Editors Ankita Meshram Veena Pagare Zafeer Rais Copy Editors Insiya Morbiwala Aditya Nair Alda Paiva Laxmi Subramanian Project Coordinator Leena Purkait Proofreaders Dirk Manuel Stephen Copestake Indexer Hemangini Bari Graphics Abhinash Sahu Producon Coordinator Aparna Bhagat Cover Work Aparna Bhagat www.it-ebooks.info About the Authors Emre Baransel is a graduate of Electrical and Electronic engineering and has two Master's, one in Business Administraon and the other one in Informaon Systems. He has been working in the IT industry for the past 10 years. He has worked for one of the largest xed-line and GSM technology-based companies in Turkey. He was nominated as an Oracle ACE in 2012. He's an Oracle Cered Professional (OCP), a founding member of TROUG (Turkish Oracle User Group), and a blogger at emrebaransel.blogspot.com. He has spoken at the Oracle Open World in the US and at user group conferences in dierent countries of Europe. He has also contributed to the Oracle RMAN 11g Backup and Recovery book in 2010. He has focused specially on high database availability and disaster recovery soluons, cloud technologies, and database security. First of all, I would like to thank the love of my life, my wife Tulay, for her paence and support during the me I was wring this book, and my super sweet son Demir for his presence in my life. I would also like to thank my co-author Nassyam for his great eort on this book under intense work pressure, the technical reviewers Jaar, Joel, and Michael for their valuable me, and the Packt Publishing team for all their help and labor on this book. Thousands of hours were spent on this book by many dierent people. Thank you all who made this book possible. www.it-ebooks.info Nassyam Basha is a Database Administrator. He has around seven years of IT experience of which the last ve years have been as a Producon Oracle DBA. He is a post graduate who holds a master's degree in Computer Applicaons from the University of Madras. He started working with dBase and FoxPro, and has parcipated in several projects with FoxPro and Oracle database starng from Oracle 7. He is an Oracle 10g Cered Professional having good knowledge in Oracle technologies such as Data Guard, RMAN, RAC, and performance tuning. He has completed more than 90 Data Guard setups on all plaorms, from RAC to non-RAC and successful cluster migraons with switchovers and failovers for many business- crical producon databases with major Data Guard-related issues. He acvely parcipates in Oracle-related forums such as OTN, having 9000+ posts, using the prole Freelists (https://forums.oracle.com/forums/profile.jspa?editMode=true&user ID=651869). He maintains an Oracle technology-related blog, (www.oracle-ckpt.com) and he is reachable at nassyambasha@gmail.com. Above and beyond all others, I have to thank my Almighty Allah and my parents N. Abdul Aleem and Rahimunnisa. Without them I wouldn't have been able to be what I am today. A special thanks to my brother Nawaz Basha who has been with me all the me, in joy and even in sadness, and to my family members Zaheer Ahamed, Farhana, Riyana, niece Fathima Zehra, and my nephew Azzoo. I would also like to express my gratude to Oracle professionals such as Shahbaz, Mohammad Farhan, Syed Jaar Hussain, Chinar Aliyev, Michael Seberg, Uwe Hesse, Mohamed Houri, Adi Narayana, and all my friends along with my favorite authors Larry Carpenter and Joseph Meeks. I shall not forget to thank my clients and colleagues who have provided me with invaluable opportunies to expand my knowledge and shape my career. My hearelt appreciaon goes to the technical reviewers of this book, Syed Jaar Hussain, Michael Seberg, and Joel Perez for the me they have spent reviewing this book, and to Packt Publishing's team members, Stephanie Moss, Leena Purkait, and Marn Bell for their support. Thanks to all of them and to their team members for giving me the opportunity to write this book. Last but not the least, I would like to say a big thanks to Emre Baransel who gave me the opportunity to co-author this book with him. His help, along with his direcon were strong assets to write. Thank you Emre. www.it-ebooks.info About the Reviewers Syed Jaer Hussain has been an Oracle Database Expert for over 14 years in his 20 years of Informaon Technology (IT) career. Over the past 14 years of his Oracle journey, he has been associated with several local and large-scale internaonal banks where he implemented and managed very complex cluster and non-cluster environments with hundreds of business crical databases. Recognizing his eorts and contribuon towards the community, Oracle awarded him the presgious Best DBA of the year award in 2011, and bestowed him with the Oracle ACE Director status. He has also acquired a number of industry best-Oracle credenals, such as Oracle Cered Master (OCM), Oracle RAC Expert, and OCP DBA 8i, 9i, 10g, and 11g in addion to ITIL experse. Syed is an acve Oracle speaker. He regularly presents technical sessions and webinars on various Oracle technologies at many Oracle events. You can visit his technical blog at http://jaffardba.blogspot.com, where he discusses and writes about workarounds/ soluons for the issues confronted by him in his day-to-day acvies. Apart from being a part of the core Technical Review commiee for a few Oracle technology- oriented books, he has also co-authored the books Oracle 11g R1/R2 Real Applicaon Cluster Essenals and Oracle Expert RAC. I would like to thank the Almighty and my parents for giving me everything I needed to become what I am today in life. Also, I owe a very big thanks to my wife Ayesha and my three champs (Ashfaq, Arfan, and Aahil) for allowing me to concentrate on my work by sacricing their family me. Last but not the least, from the boom of my heart, I would like to thank every individual who stood behind me and supported me morally during my ups and downs and encouraged me all through my life. www.it-ebooks.info Michael Seberg has worked with Oracle since Version 7.3 in programming and administraon. In the spring of 2010, Michael took on data protecon for his employer, designing a complete failover site for Oracle using Data Guard. He has done extensive tesng of switchover, failover, and monitoring of Data Guard. An Oracle generalist, Michael also works with Fusion Middleware, Forms and Reports, PHP, JSP, and Linux. He also does development in PL SQL, Object Pascal, and Java. Michael maintains a large personal website dedicated to Oracle technologies. He is a frequent contributor to the Oracle Technology Network (OTN) forum. I would like to thank my wife Andrea for her commitment and paence with me. Joel Perez is an expert DBA with over 12 years of specialized experience in several database areas with special focus on high availability and disaster recovery soluons (RAC, RMAN, Data Guard, and so on), upgrades, backup and recovery, database hardening, performance tuning, and others. During these years, Joel has worked as a Senior Consultant with a large number of companies and clients in various countries namely Venezuela, Panama, Costa Rica, Dominican Rep., Hai, Nicaragua, Guatemala, Colombia, Honduras, Ecuador, Mexico, India, and others. Joel is a frequent speaker at many events such as OTN LAD TOUR. Among other complementary acvies, Joel teaches high availability courses in Oracle University of several countries in Lan America and publishes arcles for OTN LAD. Joel was the rst Lan American to be named OTN Expert in the year 2003. Joel has been an Oracle ACE since 2004 and an Oracle ACE Director since 2012. www.it-ebooks.info www.PacktPub.com Support les, eBooks, discount offers and more You might want to visit www.PacktPub.com for support les and downloads related to your book. Did you know that Packt oers eBook versions of every book published, with PDF and ePub les available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entled to a discount on the eBook copy. Get in touch with us at service@ packtpub.com for more details. At www.PacktPub.com, you can also read a collecon of free technical arcles, sign up for a range of free newsleers and receive exclusive discounts and oers on Packt books and eBooks. TM http://PacktLib.PacktPub.com Do you need instant soluons to your IT quesons? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's enre library of books. Why Subscribe? Fully searchable across every book published by Packt Copy and paste, print and bookmark content On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine enrely free books. Simply use your login credenals for immediate access. Instant Updates on New Packt Books Get noed! Find out when new books are published by following @PacktEnterprise on Twier, or the Packt Enterprise Facebook page. www.it-ebooks.info Table of Contents Preface 1 Chapter 1: Geng Started 7 What is Data Guard? 7 Standby database 8 Physical standby database 9 Logical standby database 10 Snapshot standby database 10 Oracle Data Guard evoluon 11 Version 7.3 – stone age 11 Version 8i – rst age 11 Version 9i – middle age 12 Version 10g – new age 12 Version 11g – modern age 13 Oracle Data Guard architecture 14 Data Guard services 15 Redo transport services 15 Apply services 18 Time for acon – monitoring Redo Apply 19 SQL Apply (logical standby databases) 23 Role transions 23 Switchover 24 Failover 24 User interfaces for administering Data Guard 25 SQL*Plus 25 DGMGRL 25 Enterprise Manager 25 Time for acon – using interfaces to monitor Data Guard 26 Data Guard background processes 29 www.it-ebooks.info [...]... Active Data Guard, Snapshot Standby, and Advanced Techniques Oracle Active Data Guard Why Active Data Guard? Oracle Data Guard license Enabling Active Data Guard Time for action – enabling Active Data Guard if Redo Apply is running using SQL *PLUS Time for action – enabling Active Data Guard if the standby database is shut down Time for action – enabling Active Data Guard using broker Monitoring Active Data. .. of Data Guard Comparison of Data Guard with other replication solutions Let's get on with learning what Oracle Data Guard is and its primary features are What is Data Guard? Data Guard, which was introduced as the standby database in Oracle database Version 7.3 under the name of Data Guard with Version 9i, is a data protection and availability solution for Oracle databases The basic function of Oracle. .. Monitoring Active Data Guard From primary From standby Active Data Guard with applications 203 204 204 207 208 208 209 210 212 212 213 213 Active Data Guard with PeopleSoft Time for action – Active Data Guard with PeopleSoft Active Data Guard with EBS Active Data Guard with TopLink Active Data Guard with Oracle BI Active Data Guard with SAP Active Data Guard features EXPDP from standby database using NETWORK_LINK... failover Recommendation Data Guard broker components Oracle Data Guard broker server-side components Data Guard Monitor process (DMON) Configuration file Oracle Data Guard broker client-side components DGMGRL utility Enterprise Manager Cloud Control client Implementation of Oracle Data Guard broker Time for action – initial setup of Data Guard broker Time for action – connecting to Data Guard broker Time... Configuring Oracle Data Guard Logical Standby Database, shows you how to prepare a logical standby database configuration with pre and post steps Customization and management in a logical standby database are also covered Chapter 4, Oracle Data Guard Broker, explains the detailed implementation of the Data Guard broker, monitoring and managing Data Guard using the broker, troubleshooting the Data Guard broker,... logical standby database Automatic deletion of archived logs 107 111 Summary 113 Deletion of the foreign archived logs Deletion of the local archived logs Chapter 4: Oracle Data Guard Broker Introduction to Data Guard broker Data Guard broker features and benefits Centralized and simple management Cloud Control integration Oracle Data Guard and RAC Role transition with Data Guard broker Data Guard fast-start... notice, Data Guard started its life as a very simple database property revealed to keep a synchronized database copy with a lot of manual work and now it's a complicated tool with advanced automation, precaution, and monitoring features Now let's move on with the architecture and components of Oracle Data Guard 11gR2 Oracle Data Guard architecture The main architecture of Oracle Data Guard 11gR2 includes... disaster recovery for Oracle databases www.it-ebooks.info Getting Started Using Oracle Data Guard, it's possible to direct user connections to a Data Guard standby database automatically with no data loss, in case of an outage in the primary database Data Guard also offers taking advantage of the standby database for reporting, test, and backup offloading Corruptions on the primary database may be fixed... components of Data Guard, and then continue with configuring physical and logical standby databases of Data Guard The important details and best practices of Data Guard administration will be covered later on What this book covers Chapter 1, Getting Started, includes an introduction to Oracle Data Guard Configuration elements, the architecture of the physical and logical standby databases, Data Guard services,... with the Oracle Data Guard 11gR2 environment We will discuss the definition, properties, and history of Data Guard You will become accustomed with the concepts of standby databases and how Data Guard provides the robust solution of high availability and disaster recovery In this chapter, we will discuss the following topics: The definition and features of Data Guard The evolution of Data Guard . ] Chapter 7: Acve Data Guard, Snapshot Standby, and Advanced Techniques 203 Oracle Acve Data Guard 204 Why Acve Data Guard? 204 Oracle Data Guard license 207 Enabling Acve Data Guard 208 Time. Acve Data Guard 212 From primary 212 From standby 213 Acve Data Guard with applicaons 213 Acve Data Guard with PeopleSo 214 Time for acon – Acve Data Guard with PeopleSo 215 Acve Data Guard. Guard with EBS 216 Acve Data Guard with TopLink 217 Acve Data Guard with Oracle BI 218 Acve Data Guard with SAP 218 Acve Data Guard features 219 EXPDP from standby database using NETWORK_LINK