Sei sulla pagina 1di 17

All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

CHAPTER 27
The Intelligent Infrastructure

Exam Objectives
In this chapter you will learn to
• 052.18.1 Use the Enterprise Manager Support Workbench
• 052.18.2 Manage Patches
• 053.13.1 Set Up the Automatic Diagnostic Repository
• 053.13.2 Use Support Workbench

ch27.indd 1 7/2/2009 11:51:56 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

OCA/OCP Oracle Database 11g All-in-One Exam Guide


2
The Support Workbench and the Automatic Diagnostic Repository offer wizards for
diagnosing and repairing problems, and for working with Oracle Support Services.
This material is not extensively examined, but it is possible that general knowledge
of procedures could be tested. If you do not have a MetaLink account, you cannot
complete the exercises for this chapter—for this reason, it includes screen shots to
illustrate every step in using Database Control to set up a job to download and apply
a patch.

TIP MetaLink has recently been rebadged as My Oracle Support, with an


alternative user interface that requires the Adobe Flash player. Some Oracle
professionals prefer the Flash interface, but others prefer the “classic” interface;
try them both, and make up your own mind.

MetaLink is the external interface of Oracle Support Services: a searchable database


containing millions of articles on technical issues, and facilities for locating and
downloading patches and for raising SRs (Service Requests). An SR is a request for
an Oracle Support Services analyst to assist with a problem. To raise an SR, you must
have a MetaLink account associated with a valid CSI (Customer Support Identifier)
number issued by Oracle Corporation.

The Enterprise Manager Support Workbench


The Enterprise Manager Support Workbench is a graphical tool giving access to the
Automatic Diagnostic Repository (the ADR) with facilities for gathering information,
packaging it, and sending it to Oracle Support Services.

The Automatic Diagnostic Repository (ADR)


The ADR is a central storage point for all diagnostic information. This includes various
dumps and trace files, the alert log, and health monitor reports. It is a file-based
repository. All instances (RDBMS instances and also ASM instances) create their own
directory structure within the ADR.
The location of the ADR is determined by the instance parameter DIAGNOSTIC_
DEST. This will default to the ORACLE_BASE environment variable (which is a registry
variable on Windows systems) or, if this has not been set, to the ORACLE_HOME/log
directory. Within the DIAGNOSTIC_DEST, there will be a directory for the ADR_BASE:
this is DIAGNOSTIC_DEST/diag. In the ADR_BASE there are directories for each Oracle
product, such as the RDBMS, or database listeners. Within each product directory, there
will be directories for each instance of the product: this is the ADR_HOME for the
instance. For a database instance, the ADR_HOME is

ORACLE_BASE/diag/rdbms/database_name/instance_name

ch27.indd 2 7/2/2009 11:52:10 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

Chapter 27: The Intelligent Infrastructure

3
where database_name is the name of the database and instance_name is the name of
the instance. For example:
/u01/app/oracle/diag/rdbms/orcl11g/orcl11g

Within the ADR_HOME there will be a directory structure for the various files that
make up the ADR for the instance. Some of the files are formatted with XML tags and
are not intended to be viewed directly with editors; some are binary data; others are
plain text. The directory ADR_HOME/trace is used as the default value for the
instance parameters USER_DUMP_DEST (trace files generated by user sessions) and
BACKGROUND_DUMP_DEST (the alert log and trace files generated by background
processes). There is another copy of the alert log, formatted with XML tags, in ADR_
HOME/alert.

PART III
Problems and Incidents
A problem is a critical error in the database or the instance. Examples include internal
Oracle errors (errors reported with the error code ORA-600) and operating system
errors. Each problem has a problem key, which is a text string including the error code
and any parameters.
An incident is an occurrence of a problem. Incidents are considered to have the
same root cause if their problem keys match. When an incident occurs, it is reported
in the alert log and Enterprise Manager gathers diagnostic data about the incident in
the form of dump files (incident dumps) and stores these in an ADR subdirectory
created for that incident.
An incident package is a collection of data regarding one or more incidents and
problems, formatted for upload to Oracle Support Services as part of an SR.

The ADR Command-Line Interface (ADRCI)


There is a command-line tool for managing the ADR: the ADRCI. This tool can
display details of all problems and incidents, and generate reports and incident
packages. Figure 27-1 shows the launching of the ADCRI on Windows, and then
running the HELP command.
In Figure 27-1, note that ADRCI has detected the ADR_BASE. A simple ADRCI
session might use these commands:
set home diag/rdbms/orcl1g/orcl11g
show problem
ips create package problem 8

The SET HOME command points the ADRCI toward one ADR_HOME, the path
being relative to the ADR_BASE. The SHOW PROBLEM command will list all known
problems for that ADR_HOME, identified by PROBLEM_ID number. The IPS CREATE
PACKAGE command will generate an incident package for the nominated problem in
the directory ADR_HOME/incpkg.
In most cases, the ADRCI will not be needed: Database Control has an interface to
the ADR that is usually easier to use.

ch27.indd 3 7/2/2009 11:52:11 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

OCA/OCP Oracle Database 11g All-in-One Exam Guide


4

Figure 27-1 The ADRCI utility

The Support Workbench


Enterprise Manager Database Control database home page displays all critical alerts.
Clicking any of them will take you to the Support Workbench, shown in Figure 27-2.
Figure 27-2 shows that there have been eight problems with a total of 127
incidents, but only one problem is still active. This is the problem number 5, which
generated an ORA-600 error. From the Support Workbench, you can select a problem,
view the details, and create an incident package by clicking the appropriate buttons.

TIP SRs used to be called TARs (Technical Assistant Requests), and you will
still hear many DBAs using phrases such as “raising a tar.”

To create an SR regarding a problem, select problem’s check box and click View to
reach the Problem Details window, shown in Figure 27-3.

ch27.indd 4 7/2/2009 11:52:11 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

Chapter 27: The Intelligent Infrastructure

PART III
Figure 27-2 The Support Workbench

Figure 27-3 Problem Details, with links for using MetaLink

ch27.indd 5 7/2/2009 11:52:11 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

OCA/OCP Oracle Database 11g All-in-One Exam Guide


6
The links shown in the Oracle Support tab of the Problem Details window will
launch wizards for creating an incident package, and then raising an SR to which the
package can be attached.

EXAM TIP The Support Workbench is a tool for interfacing with MetaLink
and for packaging diagnostic information.

Exercise 27-1: Use the Support Workbench In this exercise, you will
investigate any problems that may have been recorded in the ADR.

1. Connect to your database with Database control as user SYSTEM.


2. Open the Support Workbench: from the database home page, take the
Software And Support tab, then the Support Workbench link in the Support
section.
3. The default display is to show problems in the last 24 hours. In the View
drop-down box, choose All to see all problems that are known to the ADR,
as shown here:

4. Investigate any problems shown by clicking the links to show the details of
the problem.

ch27.indd 6 7/2/2009 11:52:11 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

Chapter 27: The Intelligent Infrastructure

7
Patches
In some environments, patching can take up a considerable amount of time. It is,
however, a vital task. Some patches will be to fix problems in the Oracle code that
cause some features not to work as documented: applying these is optional, only
necessary if your installation happens to have hit the problem. Others are to fix security
issues and are not optional at all. Patches can be applied using a command-line utility,
or with Enterprise Manager.

Types of Patch
Patches are shipped in three forms:
• Interim patches These are written to fix one specific problem, for an exact

PART III
release level of the database. They are not necessarily fully integration or
regression tested.
• CPU (Critical Patch Update) patches These are cumulative patches for
a specific release level and include all dependent patches. CPUs are fully
integration and regression tested.
• Patch sets A patch set is a cumulative set of product fixes that will increment
the release level of the product (as reported by a query against V$VERSION),
for instance, from 11.1.0.6 to 11.1.0.7.

If you have hit a problem, and research with MetaLink and with other resources
identifies the problem as a known bug with a patch to fix it, this patch can be installed
as an interim patch. Otherwise, do not install interim patches. CPUs are usually issued
every three months and will often include patches for security problems. These should
be installed, particularly if your systems have to comply with security standards
enforced by local jurisdictions. Applying a patch set is a much bigger operation that
may change the behavior of the product, rather than merely fixing problems.
Applying patch sets should not be embarked upon without full testing.
To apply patches, use the Opatch utility. This can be invoked from the command
line, or through Database Control.

TIP Many DBAs try to avoid installing interim patches. They will fix a problem,
but applying several may be problematic because of the lack of integration
testing. CPUs and patch sets are much safer.

Integration with MetaLink and the Patch Advisor


Database Control includes a Patch Advisor that will identify what CPUs and what
Oracle-recommended patches should be applied to the database. This requires
configuring a connection to MetaLink and scheduling a job to make the check. An
account with MetaLink and an Internet connection from the server machine are
prerequisites for doing this.

ch27.indd 7 7/2/2009 11:52:11 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

OCA/OCP Oracle Database 11g All-in-One Exam Guide


8
To configure MetaLink integration, take the Setup link at the top right of the
Database Control database home page and then the Patching Setup link in the Overview
Of Setup section. In the Patching Setup window, enter your MetaLink username and
password. These will be associated with the username you used when connecting to
Database Control. If there is a proxy server between the database server and the Internet,
the Proxy And Connection Settings tab will let you configure this.
To schedule a job for checking what patches are needed, from the database home
page take the Jobs link in the Related Links section. In the Create Job drop-down box
choose Refresh From MetaLink and click GO. Give the job a name, schedule it to run
with whatever frequency you think appropriate, and submit the job. Once the job has
run, the Patch Advisor should be available.
To reach the Patch Advisor, from the database home page take the Software And
Support tab, then the Patch Advisor link in the Database Software Patching section.
This will show all the recommended patches for the database, as of the last time the
job was run.

Applying Patches
Patches can be applied with the Opatch utility, or with Database Control; the Database
Control method in fact uses Opatch behind the scenes. The Opatch utility is installed
into the directory ORACLE_HOME/Opatch and launched by running the executable
file opatch (or opatch.bat on Windows). The prerequisites are that the ORACLE_
HOME environment variable must be set (note that on Windows it is not sufficient to
have this as a registry variable; it must be set within the operating system session); the
Java Runtime Environment 1.4 or later must be available; a few standard operating
system utilities must be available. To test the prerequisites, use the LSINVENTORY
command as in Figure 27-4.
In Figure 27-4, Opatch is being run on a Windows system. The utility was invoked
by specifying the full path, using the ORACLE_HOME environment variable, and the
LSINVENTORY command. This shows summary information regarding what has been
installed, including any interim patches (none, in the example). To obtain much more
detailed information, use the -detail switch:

%ORACLE_HOME%\Opatch\opatch lsinventory -detail

All patches will come with a README.TXT file of instructions detailing how to install
the patch. These instructions will include detail on whether the database should be open
or shut down while the patch is applied. To apply a patch once it is downloaded from
MetaLink and expanded (it will have come as a ZIP file), run Opatch as follows:

opatch apply path_to_patch

where path_to_patch is the directory where the patch was expanded.

ch27.indd 8 7/2/2009 11:52:11 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

Chapter 27: The Intelligent Infrastructure

PART III
Figure 27-4 Using Opatch to inspect the inventoried software

To apply a patch with Database Control, the patch must first be downloaded to
a staging area. The staging area is a location where the patch is staged—stored locally,
prior to application. To reach the wizard that will stage and apply the patch, from the
database home page take the Software And Support tab, and then the Stage Patch link
in the Database Software Patching section. This will launch a six-step wizard:

• Select patch
• Select destination
• Set credentials
• Stage or apply
• Schedule
• Summary

The wizard will connect to MetaLink using stored credentials, download the patch,
and create a job to apply the patch. The illustrations that follow show examples of
using the wizard to apply a patch.

ch27.indd 9 7/2/2009 11:52:12 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

OCA/OCP Oracle Database 11g All-in-One Exam Guide


10
1. First, enter the patch number and operating system (some patches come in
versions that are operating system specific).

2. Choose the targets to which the patch should be applied. The choice will be
limited to targets appropriate for the patch (in the example, database instances).

ch27.indd 10 7/2/2009 11:52:12 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

Chapter 27: The Intelligent Infrastructure

11
3. Provide credentials. These will be either operating system credentials, database
credentials, or both depending on the patch.

PART III
4. Decide whether to apply the patch or only stage it for future use.

ch27.indd 11 7/2/2009 11:52:12 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

OCA/OCP Oracle Database 11g All-in-One Exam Guide


12
5. Schedule the job that will download and apply the patch.

6. The final step is to view a summary of the operation.

ch27.indd 12 7/2/2009 11:52:12 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

Chapter 27: The Intelligent Infrastructure

13
EXAM TIP Patches are applied with the Opatch utility—even when working
with Database Control, you are still using Opatch.

Exercise 27-2: Download and Apply a Patch In this exercise, you will
download a patch and apply it. Oracle Corporation provides a dummy patch for
this purpose. At the time of writing, this is only available for 32-bit Linux. If you are
working on another operating system, don’t worry—you will get practice in patching
soon enough when you start working on a live database.
1. Log in to MetaLink.
2. Take the Patches & Updates tab, and then the Simple Search link.
3. When prompted for a Patch Number/Name, enter 6198642. When prompted

PART III
for a Platform Or Language, select Linux x86 from the drop-down box. Click GO.
4. Click the DOWNLOAD button, shown in the next illustration, to download the
patch from MetaLink to an appropriate directory.

5. From an operating system prompt, unzip the patch. It will unzip into a
directory named 6198642.
6. Shut down the database and the listener: Opatch will not proceed if these are
running.

ch27.indd 13 7/2/2009 11:52:12 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

OCA/OCP Oracle Database 11g All-in-One Exam Guide


14
7. Apply the patch:
$ORACLE_HOME/OPatch/opatch apply patch_directory

where patch_directory is the directory into which the patch was unzipped. The
next illustration shows this step, and the start of the output.

8. Confirm the patch application with this command:


$ORACLE_HOME/OPatch/opatch lsinventory

Two-Minute Drill
Use the Enterprise Manager Support Workbench
• Database Control can connect to MetaLink and identify lists of advised patches.
• The Support Workbench can classify errors into named problems, each
consisting of one or more incidents.
• Diagnostic information is stored in files in the ADR, located by default in the
ORACLE_BASE directory.
• All diagnostic information in the ADR relevant to a problem can be packaged
for transmission to Oracle Support Services.

Managing Patches
• Interim patches fix one problem.
• CPUs are bundled patches, often including security fixes.

ch27.indd 14 7/2/2009 11:52:13 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

Chapter 27: The Intelligent Infrastructure

15
• Patch sets raise the release level of the product.
• The Opatch utility installs patches and updates the inventory.

Set Up Automatic Diagnostic Repository


• The ADR is a file-based repository, accessible no matter what the state of the
instance and the database.
• The ADR location is determined by the DIAGNOSTIC_DEST instance
parameter, which will default to the ORACLE_BASE environment variable.
• Maintenance of the ADR is automatic: the instance (and other processes, such
as database listeners) will create their own directories and files in the ADR.

PART III
Self Test
1. If the system is behind a firewall proxy server, where must the proxy server be
defined before the REFRESHFROMMETALINK job can run? (Choose the best
answer.)
A. In the browser
B. In Database Control
C. In both the browser and Database Control
D. It is necessary to configure the firewall to allow a direct connection from
the. database server to the Internet
2. Where is the Automatic Diagnostic Repository? (Choose the best answer.)
A. In the location specified by the ADR_BASE environment variable.
B. In the flash recovery area.
C. In the location specified by the DIAGNOSTIC_DEST instance parameter.
D. In the location specified by the oraInst.loc file on Unix systems, or the
INST_LOC registry variable on Windows systems.
3. If your database release level is at 11.1.0.6, application of what type of patch
will raise this level? (Choose the best answer.)
A. An interim patch
B. A critical patch update
C. A patch set
D. Any patch installation will raise the reported level
4. What tool(s) can you use to install patches? (Choose all correct answers.)
A. Database Control
B. The Opatch utility
C. The Oracle Universal Installer
D. The Automatic Diagnostic Repository Command-Line Interface tool
(the ADRCI)

ch27.indd 15 7/2/2009 11:52:13 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

OCA/OCP Oracle Database 11g All-in-One Exam Guide


16
5. What are the prerequisites for running the Opatch utility? (Choose all correct
answers.)
A. The ORACLE_HOME must be set as an environment variable.
B. MetaLink credentials must be either stored or entered at runtime.
C. A Java Runtime Environment must be available.
D. The database must be in NOMOUNT mode.
6. The value of the initialization parameter DIAGNOSTIC_DEST is NULL,
the environment variable ORACLE_HOME is set to /u01/app/oracle/
product/11.1.0/db_1, and the value of the environment variable
ORACLE_BASE is set to /u01/app/oracle. At startup, what value is
assigned by Oracle to DIAGNOSTIC_DEST? (Choose the best answer.)
A. /u01/app/oracle/diag
B. /u01/app/oracle/log
C. /u01/app/oracle/product/11.1.0/db_1/log
D. /u01/app/oracle
7. Which of the following tasks can you accomplish using the adrci command-
line tool? (Choose the best answer.)
A. Package incident information into a ZIP file to send to Oracle support.
B. View diagnostic data within ADR.
C. Perform a health check on the database while it is running.
D. Run recommended fixes from the most recent health check on the database.
8. You can use the EM Support Workbench for which of the following tasks?
(Choose all correct answers.)
A. Run recommended repairs.
B. Manually run a health check.
C. Close problems and incidents.
D. Generate additional SQL test cases to help Oracle support solve the problem.
E. View problems and incidents.

Self Test Answers


1. þ B. Database Control must be able to make an outbound HTTP
connection to MetaLink.
ý A, C, and D. A and C are wrong because the browser does not make the
connection to MetaLink—it makes a connection to Database Control. D is
wrong because while this would work, it is not necessary.

ch27.indd 16 7/2/2009 11:52:13 AM


All-in-1 / OCA/OCP Oracle Database 11g All-in-One / Watson, Ramklass / 162-918-1

Chapter 27: The Intelligent Infrastructure

17
2. þ C. The DIAGNOSTIC_DEST parameter specifies the directory used as the
root of the ADR.
ý A, B, and D. A is wrong because ADR_BASE is not an environment variable.
B is wrong because the flash recovery area stores backup and recovery data,
not problem diagnosis data. D is wrong because it confuses the ADR with the
OUI Inventory.

3. þ C. Patch sets raise the fourth digit of the release level.


ý A, B, and D. Interim patches and critical patch updates apply within a
release level and cannot raise it.

4. þ A and B. Opatch (either invoked from the command line or through


Database Control) is the tool to install patches.

PART III
ý C and D. C is wrong because the OUI doesn’t install patches—it installs
or upgrades an Oracle Home, which is a much larger operation. D is wrong
because the ADRCI uses the ADR to investigate problems; it doesn’t install
patches to fix them.

5. þ A and C. Opatch needs the ORACLE_HOME environment variable (the


Windows registry variable is not enough) and a JRE.
ý B and D. B is wrong because MetaLink is not needed to apply a patch,
only to download it. D is wrong because (in most cases) the database should
be shut down before applying patches.

6. þ D. The ADR root directory (also known as the ADR base) is set by the
parameter DIAGNOSTIC_DEST. If it is not set, Oracle sets DIAGNOSTIC_
DEST to the environment variable ORACLE_BASE. If ORACLE_BASE is not
set, then the ADR root directory is set to $ORACLE_HOME/log.
ý A, B, and C. All three locations are not assigned, given the values of
DIAGNOSTIC_DEST, ORACLE_BASE, and ORACLE_HOME.

7. þ A and B. The adrci command-line tool allows you to view diagnostic


information in the ADR root directory in addition to packaging both problem
and incident information for Oracle support.
ý C and D. The adrci command-line tool cannot initiate health checks
nor run fixes recommended by other Oracle diagnostic tools.

8. þ B, C, D, and E. You can use the Support Workbench for viewing problems
and incidents, manually running health checks, generating additional dumps
and test cases for Oracle support, creating and tracking a service request to
Oracle support, collecting all data related to a problem and packaging it, and
closing the problem when it has been resolved.
ý A. The EM support workbench cannot run recommended repairs.
However, you can initiate advisors that recommend repairs.

ch27.indd 17 7/2/2009 11:52:13 AM

Potrebbero piacerti anche