logo资料库

Oracle11g RAC 上安装和配置 Data Guard.pdf

第1页 / 共37页
第2页 / 共37页
第3页 / 共37页
第4页 / 共37页
第5页 / 共37页
第6页 / 共37页
第7页 / 共37页
第8页 / 共37页
资料共37页,剩余部分请下载后查看
Introduction
Purpose
Background
Scope & Application
Related Documents
Assumptions
Architecture and Concepts
Glossary
RAC Architecture
Data Guard Architecture
Network
Data Guard Architecture
Log Transport Services
Log Apply Services
Data Guard Broker
How it Works
Archived Log Shipping
Standby Redo logs
Levels of Protection
Maximum Protection
Maximum Availability
Maximum Performance
Pros and Cons
Prerequisites
Hardware
Network
Software
Real Application Clusters
ASM
Raw Devices
Non Raw Devices
Creating a Data Guard Environment
Assumptions
Procedure - Summary
Creating the RAC Standby Database
Configure Primary and Standby sites
Install Oracle Software on each site.
Server Names / VIPs
Configure Oracle Networking
Configure Listener on Each Site
Static Registration
Sample Listener.ora
Configure TNS entries on each site.
Sample tnsnames.ora (europa)
Configure ASM on each Site
Prepare Primary Database for Duplication.
Primary Site Preparation
Standby Site Preparation
Duplicate the Primary database.
Create an SPFILE for the Standby Database
Get location of the Control File
Create a textual initialisation file
Edit the init.ora
Create SPFILE
Create Pointer File
Create secondary control files
Cluster-enable the Standby Database
Ensure Server Side Load Balancing is configured
Register the Database with CRS
Test
Temporary Files
Create Standby Redo Logs
Configuring Data Guard using SQL Plus
Introduction
Configure the Standby Database
Configure the Primary Database
Set the Protection Mode
Enable Redo Transport & Redo Apply
Standby Site
Primary Site:
Configuring Data Guard using the Data Guard Broker
Introduction
Broker Configuration Files
Enabling the Broker
Creating a Broker Configuration
Enable the Broker Configuration
Broker Customisation
Maximum Availability/Protection
Monitoring
Introduction
Log Files
Fixed Views
Management
Switchover
Switchover using SQL Plus
Switchover using Data Guard Broker
Failover
Failover using SQL Plus
Failover using Data Guard Broker
Forced failover
Forced Failover using Data Guard Broker
Opening a Standby Database Read Only
Real Time Apply / Real Time Query
Appendix A – Using RMAN to create the Sta�
Assumptions
RMAN Backup
New Backup
Existing Backup
Creating the Standby Database
Prerequisites
Procedure
Appendix B – Further reading
Oracle Manuals
Metalink
Data Guard 11g Installation and Configuration On Oracle RAC Systems An Oracle White Paper October 2008 Maximum Availability Architecture Oracle Best Practices For High Availability
Contents 1 2.7 INTRODUCTION ................................................................................................................................................................4 PURPOSE ...........................................................................................................................................................................4 1.1 BACKGROUND ..................................................................................................................................................................4 1.2 SCOPE & APPLICATION....................................................................................................................................................4 1.3 1.4 RELATED DOCUMENTS.....................................................................................................................................................5 1.5 ASSUMPTIONS...................................................................................................................................................................5 2 ARCHITECTURE AND CONCEPTS ...............................................................................................................................6 2.1 GLOSSARY.........................................................................................................................................................................6 2.2 RAC ARCHITECTURE.......................................................................................................................................................6 2.3 DATA GUARD ARCHITECTURE.........................................................................................................................................6 2.4 NETWORK.........................................................................................................................................................................7 2.5 DATA GUARD ARCHITECTURE.........................................................................................................................................8 2.5.1 Log Transport Services.................................................................................................................................................8 2.5.2 Log Apply Services.......................................................................................................................................................8 2.5.3 Data Guard Broker........................................................................................................................................................9 2.6 HOW IT WORKS ................................................................................................................................................................9 2.6.1 Archived Log Shipping................................................................................................................................................9 2.6.2 Standby Redo logs ........................................................................................................................................................9 LEVELS OF PROTECTION.................................................................................................................................................10 2.7.1 Maximum Protection..................................................................................................................................................10 2.7.2 Maximum Availability...............................................................................................................................................10 2.7.3 Maximum Performance .............................................................................................................................................10 2.7.4 Pros and Cons..............................................................................................................................................................10 3 PREREQUISITES................................................................................................................................................................11 3.1 HARDWARE ....................................................................................................................................................................11 3.2 NETWORK.......................................................................................................................................................................11 SOFTWARE ......................................................................................................................................................................11 3.3 3.4 REAL APPLICATION CLUSTERS ......................................................................................................................................11 3.4.1 ASM ..............................................................................................................................................................................11 3.4.2 Raw Devices ................................................................................................................................................................11 4 CREATING A DATA GUARD ENVIRONMENT.......................................................................................................13 4.1 ASSUMPTIONS.................................................................................................................................................................13 PROCEDURE - SUMMARY................................................................................................................................................13 4.2 CREATING THE RAC STANDBY DATABASE...................................................................................................................14 4.3 4.3.1 Configure Primary and Standby sites......................................................................................................................14 4.3.2 Install Oracle Software on each site..........................................................................................................................14 4.3.3 Server Names / VIPs..................................................................................................................................................14 4.3.4 Configure Oracle Networking ..................................................................................................................................15 4.3.5 Configure ASM on each Site .....................................................................................................................................17 2
4.5 4.4 4.3.6 Prepare Primary Database for Duplication.............................................................................................................18 4.3.7 Duplicate the Primary database................................................................................................................................20 4.3.8 Create an SPFILE for the Standby Database ...........................................................................................................20 4.3.9 Create secondary control files...................................................................................................................................21 4.3.10 Cluster-enable the Standby Database ....................................................................................................................22 4.3.11 Temporary Files ........................................................................................................................................................23 4.3.12 Create Standby Redo Logs.......................................................................................................................................23 CONFIGURING DATA GUARD USING SQL PLUS ...........................................................................................................24 4.4.1 Introduction.................................................................................................................................................................24 4.4.2 Configure the Standby Database ..............................................................................................................................24 4.4.3 Configure the Primary Database ..............................................................................................................................25 4.4.4 Set the Protection Mode .............................................................................................................................................25 4.4.5 Enable Redo Transport & Redo Apply ....................................................................................................................26 CONFIGURING DATA GUARD USING THE DATA GUARD BROKER................................................................................26 4.5.1 Introduction.................................................................................................................................................................26 4.5.2 Broker Configuration Files ........................................................................................................................................27 4.5.3 Enabling the Broker ....................................................................................................................................................27 4.5.4 Creating a Broker Configuration ..............................................................................................................................27 4.5.5 Enable the Broker Configuration..............................................................................................................................27 4.5.6 Broker Customisation.................................................................................................................................................28 5 MONITORING ...................................................................................................................................................................29 5.1.1 Introduction.................................................................................................................................................................29 5.1.2 Log Files .......................................................................................................................................................................29 5.1.3 Fixed Views .................................................................................................................................................................29 6 MANAGEMENT.................................................................................................................................................................30 SWITCHOVER ..................................................................................................................................................................30 6.1.1 Switchover using SQL Plus .......................................................................................................................................30 6.1.2 Switchover using Data Guard Broker......................................................................................................................30 FAILOVER........................................................................................................................................................................31 6.2.1 Failover using SQL Plus.............................................................................................................................................31 6.2.2 Failover using Data Guard Broker ...........................................................................................................................31 FORCED FAILOVER..........................................................................................................................................................31 6.3.1 Forced Failover using Data Guard Broker ..............................................................................................................32 6.4 OPENING A STANDBY DATABASE READ ONLY .............................................................................................................32 REAL TIME APPLY / REAL TIME QUERY .......................................................................................................................32 6.5 7 APPENDIX A – USING RMAN TO CREATE THE STANDBY DATABASE (TRADITIONAL METHOD ....33 7.1 ASSUMPTIONS.................................................................................................................................................................33 RMAN BACKUP.............................................................................................................................................................33 7.2 7.2.1 New Backup ................................................................................................................................................................33 7.2.2 Existing Backup...........................................................................................................................................................34 CREATING THE STANDBY DATABASE ............................................................................................................................34 7.3.1 Prerequisites ................................................................................................................................................................34 7.3.2 Procedure .....................................................................................................................................................................34 8 APPENDIX B – FURTHER READING...........................................................................................................................36 8.1 ORACLE MANUALS ........................................................................................................................................................36 8.2 METALINK ......................................................................................................................................................................36 7.3 6.1 6.2 6.3 3
1 Introduction 1.1 Purpose This document will describe an end-to-end process for creating a High Availability environment which utilises both Real Application Clusters (Oracle RAC) 11g and Data Guard 11g. This paper complements the standard documentation by the way that it steps through the whole process of building a complete environment where both the primary and physical standby systems are based on Oracle RAC. The described process has been tested and applied many times over by Oracle and customers in workshops or during consulting engagements and reflects the practical experiences gained from these. 1.2 Background Organisations are using Oracle databases to store mission critical information. This information must be kept safe even in the event of a major disaster. The traditional methods used to achieve this have centred on Oracle RAC and hardware- orientated solutions such as remote disk mirroring. Whilst Oracle RAC provides a high level of availability, RAC nodes are generally situated in the same computer room (with the exception so-called Extended Clusters). Oracle RAC clusters provide a high level of redundancy on the hardware layer to ensure that there are no single points of failure. That said, there are however still single points of failure in the architecture – the database alone (which is still single) or the whole computer room itself. If the room is destroyed or becomes isolated then it is likely that access to the cluster is impossible. If the database itself becomes unusable (partly or completely destroyed), redundancy on the server level doesn’t help much. This is where a disaster recovery plan comes into operation. This plan could consist of restoring the database to another machine. However, this process is likely to take a number of hours to complete. A better solution is to have a shadow database already restored to a separate machine, which is continuously being kept up to date. In the event of a disaster this database could be brought on line very quickly. This technology provided by Oracle is called Data Guard and the database itself is called a Standby database. While Data Guard is in fact the conceptual framework around two types of standby databases (physical and logical) the discussions in this document focus solely on the type of Physical Standby database. 1.3 Scope & Application This document will examine the steps undertaken to create a Data Guard installation in general and in the context of Oracle RAC in particular. It will also cover the procedures, which need to be undertaken should one wish to switchover or failover from the primary site to the site where the standy database is located.
1.4 Related Documents • Oracle Data Guard Concepts and Administration 11g Release 1 Sep 2007 • Oracle Data Guard Broker 11g Release 1 Sep 2007 1.5 Assumptions The following assumptions have been made in this document: • Network Connectivity between production and standby systems matches the requirements for the desired level of protection and for the transport of production amounts of database redo information • The reader is familiar with the configuration of Oracle Net • The reader is familiar with Recovery Manager (RMAN) • The reader is familiar with the installation and configuration of Oracle Real Application Clusters 5
2 Architecture and Concepts 2.1 Glossary Primary Site This is where the users connect to access the production database. Standby Site This is where the standby database is maintained. It is also known as the disaster recovery (DR) site. Users will only connect to this site in the event of a failover or switchover. Disaster Non-availability of the primary site. 2.2 RAC Architecture Oracle Real Application Clusters (Oracle RAC) consists of a number of separate computer systems joined together via a high speed interconnect, all of which have access to the same set of disks. Oracle RAC creates a database on the shared disks using ASM, RAW partitions or Clustered Filesystems. The most common implementation in Oracle 11g is using ASM. Each cluster node runs an Oracle Instance that is used to interact with the database. Users can connect to any one of the Oracle instances to run their applications. 2.3 Data Guard Architecture Ideally the architecture of the node(s) located at the standby site will be the same as that of the primary, although this is not mandatory. When planning the architecture of the standby system, the following will need to be considered (especially if that system does not have the same architecture as the primary system) 6
• • If a failover is required (unplanned outage of the primary site), can the standby site handle the expected workload? If the standby site is going to be used whilst maintenance is being performed on the primary site (planned outage), can it handle the expected workload? Assuming that capacities have been catered for, then the following is true: It is not necessary for: • • the standby site to be clustered. the standby site to use RAW devices (unless it is a cluster itself). NOTE: The requirement for having both sites (primary and standby) equipped with identical software versions and/or operating systems has been relaxed. Customers can now have flexible configurations. The status of what is currently allowed is reflected in Metalink Note 413484.1: “Data Guard Support for Heterogeneous Primary and Standby Systems in Same Data Guard Configuration” This note will always have the latest support information. NOTE: If the standby system is a cluster, only one node of that cluster will be able to synchronize the standby database. The remaining nodes will stay idle until the database on the standby system is opened for normal (productive) operation. The Data Guard Broker, discussed later in this document, enables automatic failover of the “apply node” to a surviving node of the standby cluster in the event that the original apply node fails for whatever reason. 2.4 Network The primary and standby sites will be connected together via a Network link. This network link must be reliable and have suitable bandwidth and latency. Data Guard provides 3 different modes: • Maximum Protection • Maximum Availability • Maximum Performance These are discussed later; however, the first 2 require synchronous writes to the standby site. Note that there is often a performance tradeoff using synchronous writes. While providing zero data loss protection, these modes may impact primary database performance if bandwidth is limited or if the round-trip network latency (RTT) between the primary and the standby database is high. 7
2.5 Data Guard Architecture The Diagram below shows the Data Guard architectural components. These are explained in more detail below. 2.5.1 Log Transport Services The Log Transport Services (aka Redo Transport Services) are designed to propagate changes from the primary database to the standby database in two ways – either by shipping archivelogs (ARCH) or by transmitting redo data continously as it is processed by the Logwriter process (LNS). 2.5.2 Log Apply Services Log Apply Services (aka ‘Redo Apply’ with Physical and ‘SQL Apply’ with Logical standby databases) are responsible for applying the redo information to the standby database from the archived or the standby redo log files. 8
分享到:
收藏