Book Image

Oracle Database 11g : Underground Advice for Database Administrators

By : April Sims
Book Image

Oracle Database 11g : Underground Advice for Database Administrators

By: April Sims

Overview of this book

Today DBAs are expected to deploy and manage large databases with quality service and little to no downtime. The DBA's main focus is on increasing productivity and eliminating idle redundancy throughout the enterprise. However, there is no magic set of best practices or hard and fast rules that DBAs need to follow, and this can make life difficult. But if DBAs follow some basic approaches and best practices, tasks can be performed more efficiently and effectively.This survival guide offers previously unwritten underground advice for DBAs. The author provides extensive information to illuminate where you fit in, and runs through many of the tasks that you need to be watchful of, extensively covering solutions to the most common problems encountered by newcomers to the world of Oracle databases.The book will quickly introduce you to your job responsibilities, as well as the skills, and abilities needed to be successful as a DBA. It will show you how to overcome common problems and proactively prevent disasters by implementing distributed grid computing—scalable and robust—with the ability to redeploy or rearchitect when business needs change. Reduce downtime across your enterprise by standardizing hardware, software, tools, utilities, commands, and architectural components.This book will also help you in situations where you need to install Oracle Database 11g or migrate to new hardware making it compliant with a Maximum Availability Architecture. By the end of this book you will have learned a lot and gained confidence in your abilities. You will be armed with knowledge as to which tools are best used to accomplish tasks while proactively moving towards an automated environment.
Table of Contents (14 chapters)
Oracle Database 11g—Underground Advice for Database Administrators
Credits
About the author
About the reviewers
Preface
Index

Preface

Oracle Corporation has become one of the largest software companies in the world with its premier Relational Database Management System known as Oracle. Larry Ellison, the current CEO, founded the company back in the 1970s. The growth of technology over the last twenty years also fueled the implementation of large databases to maintain control of the explosive growth of data. Through many technical advances and superior design, Oracle rose to the top when companies were choosing the database technology for their enterprise systems.

The role of the Database Administrator (DBA) includes certain key responsibilities—disaster recovery, database architecture and design, as well as performance tuning. Specific tasks also include new installations, security administration, and proactively monitoring all systems at several levels. Because of the great responsibility associated with being a DBA, a concerted effort is required to integrate a constant stream of new knowledge within a locally customized environment. While the documentation and training classes provide some benefit for the basics, it is the advice that comes from experience that lays the real foundation for a career.

DBAs must work closely with other IT members to maintain a high level of dependability for enterprise applications that run on Oracle, often outlined in an official Service Level Agreement. That is what this book is all about—integrating old knowledge with new ideas, while interacting with all levels of expertise within the Oracle Enterprise.

What this book covers

Chapter 1, When to Step Away from the Keyboard, answers the question "What does a DBA do all day?" It contains a comprehensive list of prioritized tasks that the average DBA is responsible for. A common theme throughout the book is introduced in this chapter: Tools should be extensible, flexible, and ubiquitous. Included in this chapter is a list of commonly seen mistakes that can be easily avoided by adopting recommended practices. Emphasis is placed on the attitude and philosophy that a DBA should have while doing their job as a valuable team member.

Chapter 2, Maintaining Oracle Standards, discusses "standards" such as Oracle's Optimal Flexible Architecture, Unix shell scripting, code and configuration basics. This is meant to provide a solid foundation designed to reduce future maintenance. This is where your dedication to detail comes into play, as it takes work to enforce standards, especially when the personnel in your department change. A DBA should be comfortable with the fact that a migration to the next patch set, version, or hardware replacement will always be in progress. This requires multiple Oracle Homes with completely separate environments that can be easily switched; this chapter outlines how to accomplish this goal. The new 11g Automatic Diagnostic Repository features, for diagnosing and repairing certain types of failures, will be outlined in the chapter as well.

Chapter 3, Tracking the Bits and Bytes, covers how data moves from one database component to the next; the mechanics or essential architectural infrastructure at the block level; what the data in a datafile, redo, undo, or archivelog actually looks like; and how the database keeps up with SCN changes. Dumping database blocks provides the raw hexadecimal values that convert to the characters that the end user sees at the application level. Other utilities such as LogMiner can be used to access information from certain database components, as well as the very basic Unix command strings. These essential concepts will provide you with the confidence that you can survive any disaster that you may have to tackle. Corruption prevention and detection is covered because this is one of the real tests for excelling at your job. No one really wants to have to fix corruption when it happens, because the data becomes unrecoverable fast.

Chapter 4, Achieving Maximum Uptime, covers redundancy at all levels: hardware, software, databases, ASM, SAN(s), and load balancers. Databases become redundant with Data Guard and RAC. This chapter offers an introduction to network and SQL*Net tuning for all types of implementations. Achieve the smallest outage windows by moving to rolling upgrades, ensuring there is some sort of backup plan for important personnel as well as documenting configurations with Oracle Configuration Manager. There are always single points of failure in every organization; identifying them is the first step on the path to a fully documented disaster recovery plan.

Chapter 5, Data Guard and Flashback, explains that the combination of Oracle's Flashback and Data Guard makes recovery scenarios, stress testing, and hot fix patching on a physical standby possible by making the database read and write temporarily. Using both Data Guard and Flashback in tandem can reduce or eliminate downtime for the primary database in certain types of recovery situations. It may reduce or eliminate the need for duplication of hardware for testing purposes. Several scenarios are outlined in detail, along with recommendations for implementations that fulfill disaster recovery goals.

Chapter 6, Extended RMAN, covers the essential tool for DBAs—RMAN, which is just complicated enough to warrant its own chapter. In this chapter, we will provide the foundations for writing your own scripts to get you started using this utility today. While the previous standard backups consisted of either a basic cold or hot version, RMAN does that and also adds even more flexibility when automating backup (and even recovery) routines. RMAN is the basic utility behind several types of disaster recovery and migration tasks such as: Creating Physical and Logical Standby(s). You can restore between different versions and migrate to new hardware using Transportable Tablespaces. RMAN is also involved with 11g's ADR Detected Failure Repairs, as well as duplication across the network (both local and remote).

Chapter 7, Migrating to 11g: A Step-Ordered Approach, talks about how migrating to a newer Oracle Database version doesn't have to be confined to a single outage period. Several interim steps can be done ahead of time to certain compatible components, saving valuable time. In a general sense, Oracle is backwards compatible for making that transition from an earlier version to a later one. The following components can be upgraded while still remaining compatible with earlier versions of Oracle:

  • Oracle Net Services

  • Clients

  • RMAN binary, Virtual Private, and Normal Catalog Database

  • Grid Control Repository Database

  • Grid Control Management Agents

  • Automatic Storage Management and Clusterware

This is an essential guide for upgrading to 11g using a multiple home environment: Cloning Oracle homes, Oracle Universal Installer (interactive, silent, and suppressed modes), RMAN catalog, and SQL Net. All of the options for performing upgrades are touched on in this book: DBUA, Manual Method, Export/Import, Data pump, TTS, RMAN, Physical Standbys, and the newer Transient Logical Standby.

Chapter 8, 11g Tuning Tools, covers ORION, TRCANLZR, and Statspack utilities. While it is easy to show someone how to use a tool, it takes experience to correctly interpret the results you get. This chapter will also cover different free-source, load-testing tools for forecasting trends of CPU utilization and I/O; in other words predicting the approximate time to purchase new hardware before the end user experiences degraded performance. 11g features such as SQL Plan Management will be covered along with Oracle's own Enterprise Manager tuning tools. A large portion of this chapter is dedicated to the migration path for upgrading the query optimizer using SQL Plan Management from 10g to 11g. Start a new paragraph from here, you might still be overwhelmed with all of the work set before you, and that's is why you've bought this book in the first place. This is a book you will keep for a long time, referring back again and again for each new project. It will be especially handy to show management when they start altering your job description. It is our hope that this is only a starting place for your career as a DBA and that by reading this book, you will share the knowledge with your peers as an active participant in Oracle User Groups.

What you need for this book

It would be helpful if you have some knowledge of SQL and are comfortable with the Unix operating system, but this is not absolutely essential. For those new to these technologies, keep the documentation nearby to use as a reference. This book is written for the Unix operating system, but you may only have access to a Windows operating system such as a desktop for testing purposes. There are tools, such as Cygwin (for Windows), which enable many of the same operating system commands to work on both Unix and Windows.

This book focuses on 11g Release 2 version with a reference to general Unix operating system commands. Previous versions of Oracle are also referenced when it applies to migration or upgrading to 11g as the topic. The Oracle Database Installation Guide for the version you are installing will have the prerequisite hardware requirements. The best place to start for the latest documentation and Oracle software downloads is the Oracle Technology Network (OTN) website: http://otn.oracle.com.

Who this book is for

This is for you if you find yourself in charge of an Oracle Database (understanding the full responsibility that goes with such a position), but are unsure of what tasks you need to perform. It can be easy to feel overwhelmed, so this reference is designed as a sanity check, whether you are a single employee or the DBA manager of several employees, or whether you are taking over an existing position or taking up a newly created one.

You are a person that wants to be proactively preventing disasters instead of simply keeping ahead of the next problem. In doing so, you'll help counter one of the major causes of professional burnout. This book is meant to make your technical transition to a DBA career easier and more efficient while educating you on how to reduce some of the most common mistakes.

You may be someone who needs guidance for migrating to 11g or implementing Oracle's Maximum Availability Architecture. This book is also meant to map out the migration options available when purchasing new hardware, giving you the opportunity to change the way your Oracle software is implemented, and to make it more Optimal Flexible Architecture compliant. This book will be useful when you are assigned the responsibility of making any sort of change in your Oracle environment—installations, migrations, upgrades, as well as patching. Take a few moments to read through the recommendations and suggestions for automating the maintenance tasks required for your applications to make them more redundant, flexible, and tolerant of future changes.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text are shown as follows: "We can include other contexts through the use of the include directive."

A block of code is set as follows:

run {
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/backuplocation/%F';
restore controlfile from autobackup;
alter database mount;
}

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "clicking the Next button moves you to the next screen".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail to .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Tip

Downloading the example code for the book

Visit http://www.packtpub.com/files/code/0004_Code.zip to directly download the example code.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.