Read Oracle RMAN 11g Backup and Recovery Online
Authors: Robert Freeman
Again, we encourage you to read the book chapter for chapter. Nothing can replace a conceptual understanding of a product, especially when that product is protecting your most valuable asset: the database.
So, enjoy the book! RMAN is a challenging and rewarding product to dig into and utilize. It can save you time and energy, and help avoid health problems related to insomnia, outage stress, and paranoia. We haven’t got a Surgeon General’s label yet, but we’re working on it.
This page intentionally left blank
PART
I
Getting Started
with RMAN in
Oracle Database 11
g
This page intentionally left blank
CHAPTER
1
Oracle Database 11
g
Backup and Recovery
Architecture Tour
4
Part I: Getting Started with RMAN in Oracle Database 11
g
elcome to
Oracle Database 11
g
RMAN Backup and Recovery.
If you purchased our previous RMAN books, you have an idea of what to expect from this text. However,
W
this book is more than just a simple revision. RMAN in Oracle Database 11
g
has so many new features that this book has a lot of new and revised content. We hope you find it useful. We have also listened to you and acted on some of your feedback. We hope you will find the results make this book the best yet!
If you are already using RMAN and are concerned that the changes in Oracle Database 11
g
will adversely affect your backup and recovery strategies, don’t worry. RMAN is fully backward compatible, so your existing backup and recovery strategies will not have to change when you move to Oracle Database 11
g.
If you are just starting with RMAN, then welcome aboard! RMAN is a great choice for Oracle database backup and recovery. In this book, we give you all the information you need to use RMAN
successfully. The book is designed to help you get started using RMAN as quickly as possible.
Before we get deep into RMAN, though, we thought you would like to tour the base Oracle backup and recovery landscape, which actually has not changed a great deal in Oracle Database 11
g.
So, for some of you, the landscape may be familiar, in which case you can either ride along to refresh your memory or proceed straight to Chapter 2. If you are new to Oracle, this tour will really help you prepare for the onslaught of RMAN information you will be getting in subsequent chapters. So, jump on the bus, keep your feet and hands inside at all times, and we will be off.
In this tour of the Oracle database backup and recovery architecture, you will encounter the following:
■ Backup and recovery essentials
■ A few Oracle terms to know
■ Oracle database physical architecture
■ Oracle operational internals
■ ARCHIVELOG versus NOARCHIVELOG mode operations
■ Oracle recovery modes
■ Manual backup operations in Oracle
■ Manual recovery operations in Oracle
As we proceed, you will learn the importance of understanding how the Oracle product works, so that you can properly apply the techniques that will be documented in this book to bring your wayward database back to life. You will also see that there is more to backing up and recovering a database than just entering a few commands and putting tapes in the tape drive.
The direct results of misapplying a technique, or not understanding a principle of the architecture, may be an extended outage or even loss of data. In fact, one of us just had a case where a restore took ten hours, when, after reviewing the facts, it should have only taken two hours.
The difference in this case was that the DBA doing the restore lacked some basic understanding of the database he was recovering. This led to a grave mistake in his selected form of recovery. The old adage that you must walk before you can run certainly applies when it comes to backup and recovery. Finally, we are going to cover only basics and any additional information that you need to know with regard to RMAN and recovering your database. If you need more information on these subject areas, several good Oracle Press titles can help you. You can find these titles at
Chapter 1: Oracle Database 11
g
Backup and Recovery Architecture Tour
5
Backup and Recovery Essentials
Our first stop is backup and recovery essentials. Two different areas need to be dealt with when crafting plans to execute in the event your database goes bottom up. The first architectural question is one of high availability, which is loosely coupled with the second question, which is one of backup and recovery. Let’s look at these questions of high availability and backup and recovery in more detail.
High Availability
High availability (HA) implies an architecture that prevents the users from being aware of partial or total system (database, network, hardware, and so forth) failure. HA solutions can include such elements as mirrored drives, RAID architectures, database clustering, database failover schemes, and, of course, backup and recovery. HA adds costs to the overall database architectural solution, over and above the costs of the backup and recovery solution selected. RMAN is really not an HA solution, but it is part of an overall database solution that can include HA. Backup and recovery of your database is not superseded by HA solutions. Rather, how you will back up and recover your database is one of a collection of HA decisions you need to make.
If you are interested in looking at HA solutions, a number of them include
■ Data Guard/Stand-by Database
■ Real Application Clusters
■ Oracle Replication/Streams
■ RAID and mirrored drives
Various other vendors provide HA solutions as well. Because HA options are really a separate topic from RMAN, we do not cover them in this book. Oracle Press does offer a book that includes coverage on HA solutions:
Oracle Database 10
g
High Availability with RAC,
Flashback, & Data Guard
(McGraw-Hill/Osborne, 2004) by Matthew Hart, one of the authors of this very text!
Backup and Recovery
As we continue our tour (anyone want to stop at the snack bar?), we move to backup and recovery, which is getting us close to the main topic of this book, RMAN. We will talk in detail throughout this chapter about the different kinds of backups that can be done in Oracle, but for now, let’s talk about the primary types of backups: offline (cold) and online (hot).
Offline
backups are done with the database down, which means that it is also unavailable to users.
Online
backups, on the other hand, are done with the database up and running, so users can continue with their business. RMAN supports both types of backups. In fact, as you will see in later chapters, some of the features of RMAN make it the preferable method for performing online database backups.
You shouldn’t just “decide” that it’s time to back up your database. This is particularly true in the case of production databases, where the users have certain levels of expectations for protection of their data. Before you decide when and how to back up your database, you should gather some of your users’ requirements and consider your company’s general backup policy.
Only after you have gathered those requirements can you craft that backup plan. Let’s look in some more detail at how you gather those requirements.
6
Part I: Getting Started with RMAN in Oracle Database 11
g
Backup and Recovery Strategy Requirements Gathering
In gathering user requirements, you really want to find out from them what their needs are. Users need to be asked a number of questions, and as the database administrator (DBA), you should take the lead in asking them. To collect backup and recovery requirements, you need to ask your customers a few questions like the following:
■ How much data loss can you afford in the event of a database failure?
■ What is the maximum length of time you are able to allow for recovery of your database?
■ How much are you willing to spend to ensure that your data is recoverable?
■ Can the system be down during the backup?
■ How much time will it take to get damaged hardware replaced?
Let’s quickly look at each of these questions in more detail.
How Much Data Loss Can You Afford?
This is probably the most important question of all. All backup and recovery plans have some risk of data loss associated with them, and as you move closer to a zero data loss solution, the costs of the backup and recovery plan can skyrocket. Just as was the case with HA, the organization needs to quantify the cost of data loss and, based on that cost, craft a cost-effective backup and recovery plan. It is critical that the customer understand how much data loss risk they are taking with the chosen backup and recovery plan.
Of course, each database has an allowable amount of loss, too, and one database may be much more tolerant of data loss than another.
What Is the Maximum Length of Time You Are Able to Allow for Recovery?
Different technologies perform in different ways and vary widely in price. Generally, the faster you wish your recovery to go, the more expensive the technology ends up being. For example, recoveries directly from disk tend to be a bit more expensive than recoveries from tape, but also tend to be faster. It is important that the customer understand how long recovery of the database will take in the event of a complete outage. Some cases have little tolerance for recovery, and you may need to consider technologies such as Oracle Stand-by Database.
How Much Can You Spend on Recovery?
There is a direct relationship between how much data loss you can tolerate, how long it will take to actually recover the database, and how much it will cost to provide a given level of protection. It is important, early on, to understand just how much the customer is willing to spend on architecture to support your proposed backup and recovery plan. Nothing is more embarrassing than proposing a massive architecture with a high dollar cost, and having the customer look at you and laugh at the projected expense.
Can the System Be Down During the Backup?
Another key piece of information to determine is what the state of the database needs to be during the backup. Can an outage be afforded to do backups, or do those backups need to be done online? The answer to this question impacts your total overall cost and your decisions in choosing a backup strategy.
How Much Time Will It Take to Get Damaged Hardware Replaced?
This is a key consideration. Often it’s not the database that fails, but some piece of hardware. Hardware failure can considerably impact the time it takes to get your database running again. You need to make Chapter 1: Oracle Database 11
g
Backup and Recovery Architecture Tour
7
sure the system stakeholders understand the impact of hardware failures and consider architectures that can help protect them from hardware failures, such as Oracle Real Application Clusters.