Once the preinstallation tests are completed and passed, the OUI displays the initial OUI screen shown in Figure 8.15.Choose the Oracle Database 11g option, and click the Next button on
Trang 1Performing post-install operations using configuration assistants
Û N
Mounting the CD and Starting the OUI
To begin the install process, insert the Oracle 11g CD in the server On some Unix systems,
you may have to use the appropriate operating-system command to mount the CD in your server before it is accessible
After mounting the CD, you may want to copy its contents to a staging directory so that you can install from there instead of from the CD If you download software from the OTN, you don’t need to mount the CD You can start the install from the disk.
OUI installations on Unix systems must also set the X Windows DISPLAY environment variable; otherwise, the OUI will not appear
Performing Preinstallation Checks
Start the OUI using the runInstaller.sh command, as shown in Figure 8.14
F I g u r e 8 14 Invoking Oracle 11g install
Notice that the output shows that the OUI checked the server’s operating-system sion, available RAM, temporary and swap space, and so on
ver-If needed, you can turn off the system verification that occurs prior to the installation by using the -ignoreSysPrereqs option of the runInstaller
Trang 2Once the preinstallation tests are completed and passed, the OUI displays the initial OUI screen shown in Figure 8.15.
Choose the Oracle Database 11g option, and click the Next button on the OUI screen to proceed with the installation
F I g u r e 8 15 The initial OUI installation screen
Responding to OUI Prompts
The next OUI screen, Select Installation Method, provides the option to perform a basic or advanced installation In the basic installation, no more questions are asked, and the OUI takes all the default values to install the software If you select the Create Starter Database check box and provide a name for the database, OUI will create a database along with the software install
For this example, choose Advanced installation on this screen, as shown in Figure 8.16
The next OUI screen, Specify Inventory Directory and Credentials, prompts you for two pieces of information:
The location for the inventory files that the OUI uses to keep track of which Oracle
Û N
products are installed on the serverThe name of the operating-system group of which the user doing the install is a member
Û N
You can see both items in Figure 8.17
Trang 3Installing Oracle 11g 433
F I g u r e 8 16 Select Installation Method screen
F I g u r e 8 17 Specify Inventory Directory and Credentials screen
Trang 4The value suggested for the oraInventory location, /u01/app/oraInventory, was selected based on the $ORACLE_BASE environment variable The value suggested for the operating-system group, oinstall, is the Oracle default value Because both settings are correct for our example environment, click the Next button to continue the installation
Selecting Products to Install
The next screen, Select Installation Type, prompts you to select the type of installation to perform In this example, I selected the Enterprise Edition option, as shown in Figure 8.18
Choose Enterprise Edition or Standard Edition based on the license you purchased You may also choose Custom, if you want to pick and choose the products
F I g u r e 8 18 Select Installation Type screen
The next screen, Install Location, sets the software installation locations, as shown in Figure 8.19
On the screen shown in Figure 8.19, the default values are populated based on the ORACLE_BASE variable Click the Next button to open the next screen, which is shown in Figure 8.20
The OUI goes through a second round of installation checks that confirm that the er’s operating-system version and configuration are appropriate for the Enterprise Edition
serv-installation of Oracle 11g If all the verification checks complete successfully, click the Next
button to open the Select Configuration Option screen, as shown in Figure 8.21
If these operating-system checks do not succeed, you must correct the areas that are failing the checks before continuing.
Trang 5Installing Oracle 11g 435
F I g u r e 8 19 Install Location screen
F I g u r e 8 2 0 Prerequisite checks
Trang 6F I g u r e 8 21 Select Configuration Option screen
The next screen, Privileged Operating System Groups, asks whether you want to ate a database following the installation process Because creating a database is covered in Chapter 2, you’ll skip this step for now Choose the Install Software Only option, and then click Next to specify the privileged OS groups, as shown in Figure 8.22
cre-F I g u r e 8 2 2 Privileged Operating System Groups screen
You can choose the defaults or specify specific OS groups for each function Click Next
Trang 7Installing Oracle 11g 437
F I g u r e 8 2 3 The Summary screen
This screen summarizes all the options you selected and all the components that will be installed If you need to make changes, click the Back button to modify your previous selec-tions If you are satisfied with your selections, click the Next button to start copying the Oracle binaries to the $ORACLE_HOME directory
Copying and Compiling Files
The OUI displays status information while the installation and setup is in progress Once the file-copy portion of the installation is complete, the OUI begins linking the binaries to
create the executable files needed to make the Oracle 11g software run on the server On
Unix systems, after the linking process, you are prompted to execute configuration scripts
as the superuser root from the Unix command line, as shown in Figure 8.24
F I g u r e 8 2 4 Running the script as root
Trang 8The orainstRoot.sh script creates the inventory location and necessary inventory tory The following example shows this orainstRoot.sh script being executed from another session:
direc$ su Password:
-# cd /u01/app/oraInventory./orainstRoot.sh
Creating the Oracle inventory pointer file (/etc/oraInst.loc)Changing permissions of /u01/app/oraInventory to 770
Changing groupname of /u01/app/oraInventory to oinstall
The execution of the script is complete
$Running the script creates some directory structures that are used to support the Oracle installation and sets the proper file permissions on those directories as well as other files
Once the orainstRoot.sh script executes, click the Continue button to choose the tion type
installa-On Unix and Linux platforms, the orainstRoot.sh script creates a file named /etc/oraInst.loc, which has information about the Oracle Inven- tory location and the software installation owner name The content of the /etc/oraInst.loc is as follows:
$ cat /etc/oraInst.loc inventory_loc=/u01/app/oraInventory inst_group=oinstall
$
The root.sh script should be executed as root Executing the root.sh script copies some files to a location outside $ORACLE_HOME and sets the permissions on several files inside and outside $ORACLE_HOME Once the root.sh script executes successfully, click OK to continue the installation
One important file created by the root.sh script is the /etc/oratab file (the /var/opt/
oracle/oratab file on Solaris) When databases are created on this server, this file will have information about the database and which oracle home directory is used by the database
If you have multiple installations to perform, you can speed up the process and minimize errors by building an OUI response file This text file contains all the necessary responses to the OUI prompts so that an unattended, silent install is possible.
Trang 9Installing Oracle 11g 439
Performing Postinstall Tasks
Once the root.sh script has completed, the OUI will perform some brief tion configuration activities before displaying the End of Installation screen, as shown in Figure 8.25
postinstalla-F I g u r e 8 2 5 End of Installation screen
Click the Exit button and then the OK button on the pop-up screen to exit the OUI and return to the Unix prompt
The OUI on Windows systems also offers a Basic Installation mode in which only a few installation questions are asked before the file copying begins If you select the Advanced Installation mode, the prompts will closely follow those shown for Unix in this section.
Once the OUI is complete, you should have a completely installed and configured
$ORACLE_HOME You’ll use this software to create your first database in Chapter 9, “Creating
and Oracle 11g Database.”
Trang 10Oracle is a relational database SQL is the language used to manage and administer Oracle
databases Several tools are available to administer an Oracle 11g database The most
com-mon ones used by DBAs are SQL*Plus and Oracle Enterprise Manager SQL Developer is a
GUI tool that can be used to interact with the Oracle 11g database.
The Oracle 11g database architecture consists of three major components: memory,
processes, and storage A user process initiates a connection with the Oracle database and starts a server process The server process is responsible for performing the tasks on the database The memory structures and background processes together are an Oracle instance The server process communicates with the memory structure known as the sys-tem global area The SGA consists of a shared pool, database buffer cache, and redo log buffer The shared pool also includes components such as a Java pool, large pool, result cache, and streams pool
There are many types of background processes, each performing a specific job to tain and manage the database instance All databases have five background processes: data-base writer, checkpoint writer, log writer, process monitor, and system monitor Depending
main-on the cmain-onfiguratimain-on of the database, there may be other background processes such as archiver, ASM balancing, and so on
The physical data structure consists of several files stored on disk The most important file is the control file, which keeps track of several important pieces of information such
as database name, names of data files and redo log files, backup information, so on The CKPT process is responsible for keeping the control file updated Redo log files contain information from the redo log buffer The LGWR process is responsible for writing the redo log buffer contents to the redo log files Oracle metadata and application data are
stored in data files The DBWn process is responsible for writing dirty blocks from the
database buffer cache to the data files
Looking at the logical structure of the database, a tablespace is the highest level of logical unit A tablespace consists of several segments A segment consists of one or more extents An extent is a contiguous allocation of blocks A block is the smallest unit of stor-age in an Oracle database
Installing the Oracle 11g software is a relatively easy task once the preinstall checks and hardware requirements are met Installing Oracle 11g is a joint task between the sys-
tem administrator and DBA, because certain scripts need to be run as root on Linux/Unix platforms
Trang 11Exam Essentials 441
Exam Essentials
Describe the Oracle tools and what they are used for Know which tools are available for
connecting to and interacting with an Oracle database Understand how these tools differ from one another
Understand the Oracle architecture components Be able to describe the logical and
phys-ical components of the Oracle architecture and the components that make up each Know the relationship between segments, extents, database blocks, and operating-system blocks
Know the background processes Understand the Oracle 11g background processes and
how they are used The important ones to know are DBWn, SMON, CKPT, PMON, LGWR, ARCn, RBAL, and ASMB
Identify the three types of database files that constitute the database Understand the
pur-pose and key differences between the control files, data files, and redo log files
Explain and categorize the SGA memory structures Identify the SGA areas along with
the subcomponents contained within each of these areas
Explain Oracle 11g system requirements Know what the requirements are for available
server disk space and memory prior to performing an Oracle 11g installation.
Describe the Optimal Flexible Architecture Be able to explain the concepts associated
with the OFA model and how to implement an OFA-compliant installation and database directory structure
Describe the steps for installation and configuration Know how to set up the Oracle
installation environment so that the OUI can be used to install and configure the Oracle
11g software.
Trang 12Review Questions
1 What are the benefits of using the OFA standard for installing Oracle 11g? (Choose all that
apply.)
A Helps eliminate fragmentation of free space in the SYSTEM tablespace
B Helps improve the database performance
C Facilitates routine administrative tasks such as software backups
D Helps avoid data-block corruption
2 You are trying to install Oracle 11g and the OUI prerequisite check failed What should
you do?
A Ignore the error, and proceed with installation.
B Cancel the installation, and try to install on a different server.
C Correct the underlying issue, and retry the installation.
D Cancel the installation, correct the underlying issue, and restart the installation.
3 When installing Oracle 11g on the Linux platform, which file is created by executing the
orainstRoot.sh script as root?
A /etc/oratab
B /etc/oraInst.loc
C $ORACLE_HOME/root.sh
D None—the orainstRoot.sh script starts background processes required to start the OUI.
4 Which component is not part of the Oracle instance?
A System global area
B Process monitor
C Control file
D Shared pool
E None
5 Which background process guarantees that committed data is saved even when the changes
have not been recorded in data files?
Trang 13Review Questions 443
6 You’ve just been hired as a DBA for a large company During the interview process, you
were shown the job description for the position Which of the following tasks might have been included in this job description?
A Install and configure Oracle 11g software.
B Implement database installations according to OFA guidelines.
C Use OFA-compliant naming conventions for database files and directories.
D Any of the above may have been included on the DBA job description.
7 Which of the following best describes a RAC configuration?
A One database, multiple instances
B One instance, multiple databases
C Multiple databases on multiple servers
D Multiple shared server processes catering one database
8 Which component of the SGA contains the parsed SQL code?
A Database buffer cache
B Dictionary cache
C Library cache
D Parse cache
9 Which are the tasks accomplished by the SMON process? (Choose all that apply.)
A Performs recovery at instance startup
B Performs cleanup after a user session is terminated
C Starts any server process that stopped running
D Coalesces contiguous free space in dictionary-managed tablespaces
10 Choose the best statement from the options related to segments.
A A contiguous set of blocks constitutes a segment.
B A nonpartitioned table can have only one segment.
C A segment can belong to more than one tablespace.
D All of the above are true.
11 The Oracle Universal Installer prompts for which variable if not set?
A ORACLE_HOME
B ORACLE_SID
C ORACLE_BASE
D ORACLE_INSTALL_BASE
Trang 1412 Which SGA component will you increase or configure so that RMAN backups are not
using area from the shared pool?
A Java pool
B Streams pool
C Recovery pool
D Large pool
13 When a user session is terminated, which processes are responsible for cleaning up and
releasing locks? (Choose all that apply.)
14 The LRU algorithm is used to manage what part of the Oracle architecture?
A Users who log on to the database infrequently and may be candidates for being
dropped
B The data file that stores the least amount of information and will need the least
fre-quent backup
C The tables that users rarely access so that they can be moved to a less active tablespace
D The shared pool and database buffer cache portions of the SGA
15 Two structures make up an Oracle server: an instance and a database Which of the
follow-ing best describes the difference between an Oracle instance and a database?
A An instance consists of memory structures and processes, whereas a database is
com-posed of physical files
B An instance is used only during database creation; after that, the database is all that is
needed
C An instance is started whenever the demands on the database are high, but the
data-base is used all the time
D An instance is configured using a pfile, whereas a database is configured using an
spfile
16 Which of the following is the proper order of Oracle’s storage hierarchy, from smallest to
largest?
A Operating-system block, database block, segment, extent
B Operating-system block, database block, extent, segment
C Segment, extent, database block, operating-system block
D Segment, database block, extent, operating-system block
Trang 15Review Questions 445
17 You’ve been asked to install Oracle 11g on a new Unix server You’re likely to ask the Unix
system administrator to do all but which of the following for you in order to get the new server ready for Oracle?
A Modify the server’s kernel parameters.
B Create a new Unix user to own the Oracle software.
C Create the mount points and directory structure using the OFA model.
D Determine which directory will be used for $ORACLE_HOME.
18 Oracle’s OFA model specifies a naming convention for all but which of the following?
20 On Unix systems, the script root.sh must be executed during the installation process
What is the purpose of this script?
A It creates the root user in the database.
B It creates the root directory for the server.
C It grants root superuser privileges to the Oracle Unix account.
D It copies files and sets permissions on files outside $ORACLE_HOME.
Trang 16Answers to Review Questions
1 A, C The OFA standard helps in administering the Oracle software installation and
all related Oracle files, such as alert logs and data files OFA recommends that separate tablespaces be created to store application data; the SYSTEM tablespace should be used only for the data dictionary By separating the software from database files, backups are made easy
2 C On the prerequisite check screen, you have the option to retry a failed test So, you can
fix the underlying issue and let OUI perform the test again to continue the installation
3 B If an Oracle installation is performed the first time on a server, the orainstRoot.sh
script needs to be executed to create the /etc/oraInst.loc file The oraInst.loc file specifies the Oracle inventory location
4 C Control file, data file, and redo log files are part of the Oracle database The Oracle
instance constitutes the memory structures and background processes
5 C The log writer (LGWR) process writes the redo log buffer information to the online
redo log files A commit operation is completed only after the redo buffer is written to online redo log files
6 D The tasks that a DBA performs encompass all these areas plus managing database
stor-age, security, and availability
7 A With Real Application Clusters, multiple instances (known as nodes) can mount one
database One instance can be associated with only one database
8 C The shared SQL area is stored in the library cache in a shared pool and is shared
between users If a query is executed again before it is aged out of the library cache, Oracle will use the parsed code and execution plan from the library cache The database buffer cache has the data blocks cached The dictionary cache caches data dictionary information
There is no SGA component called the parse cache
9 A, D SMON is responsible for performing instance recovery using the online redo log files
and for coalescing contiguous free space in tablespaces The PMON is responsible for sion cleanup and for freeing up all resources after a user session is terminated
ses-10 B A table or index has a segment A segment consists of one or more extents A segment
can belong to only one tablespace, but it can span across multiple data files
11 C To better conform to the OFA standard, the Oracle 11g OUI prompts for the ORACLE_
BASE value if the ORACLE_BASE environment variable is not already set The ORACLE_HOME value is derived from ORACLE_BASE, but you have the option to change the derived value
12 D The large pool is configured to have RMAN not use the shared pool; hence, the shared
pool is totally dedicated to application space
13 D PMON is responsible for cleaning up failed user processes It reclaims all the resources
held by the user and releases all locks on tables and rows held by the user No other process
is involved in the session cleanup
Trang 17Answers to Review Questions 447
14 D The LRU mechanism ensures that each user’s server process can find free space in the
shared pool and database buffer cache whenever they need it, but it also keeps frequently used objects cached in those memory areas
15 A The instance consists of the SGA and all the Oracle background processes The database
is composed of the control files, data files, and redo logs
16 B Multiple operating-system blocks make up database blocks, contiguous chunks of which
make up extents A segment consists of one or more extents
17 D Although the Unix system administrator is responsible for creating volume groups and
mount points, the DBA generally decides where the Oracle binaries will be installed—the location derived from $ORACLE_BASE or designated by the $ORACLE_HOME environment variable
18 A The OFA model does not include any reference to naming conventions for the database
or things inside the database, such as users, tables, or tablespaces
19 B The runInstaller executable performs a preinstall check of the operating system and
hardware resources before starting the OUI graphical tool
20 D The root.sh script copies configuration files to directories outside $ORACLE_HOME and
sets the permissions on those files accordingly
Trang 19Û N
Assistant (DBCA)
Managing the Oracle Instance
ÛÛSetting database initialization parameters
Û N
Describe the stages of database startup and shutdown
Û N
Using alert log and trace files
Û N
Using data dictionary and dynamic performance views
Û N
Trang 20DBAs perform these tasks It is important for you to understand these tools and how to use them properly
Oracle has been using Java-based tools to manage the Oracle Database because Java gives the same look and feel for the tools across all platforms In this chapter, I will cover how to use the Oracle Database Configuration Assistant tool, which creates and removes Oracle Databases, and how you can use templates to create databases
After creating the database using DBCA, the database will be up and running I will then cover how to shut down and restart the database for some configuration changes, apply patches, perform server maintenance, and so on I’ll describe the various database startup and shutdown options and explain the circumstances under which you use these options
You will also learn more about the Oracle data dictionary, including how the dictionary
is created, where it is created, and so on Finally, I will cover initialization parameter files and discuss how you can use them to manage, locate, and view the database alert log
Using DBCA to Create
manu-You can also use the DBCA to add options to a running database or to remove a base In recent years, I have seen many diehard command-line DBAs switching to the DBCA tool to create databases, mainly because of its flexibility and ease of use
Trang 21data-Using DBCA to Create Oracle 11g Databases 451
You can also use the DBCA to create a database while the Oracle software is installed,
or you can invoke the DBCA later to manually create a database In the following sections,
I will show you the steps necessary to create an Oracle Database using the DBCA tool
Invoking the Database Configuration Assistant
You can invoke the DBCA from a command line in the Unix environment or as an cation in a Windows 2000 environment If you are using the Windows XP environment,
appli-choose Start All Programs Oracle Oracle Home Configuration and Migration Tools
Database Configuration Assistant
If you are in a Unix environment or would prefer to work from the command line in Windows, type dbca from the $ORACLE_HOME/bin location
After you open the DBCA, you should see the Welcome screen, as shown in Figure 9.1
The Welcome screen will be different on a node that belongs to a RAC cluster, where you will have the option to create a single-instance database or a RAC database Since RAC is not part of the certification exam, you will be using a node that is not part of the RAC
F i g u r e 9 1 DBCA Welcome screen
Click Next to open the Operations screen, as shown in Figure 9.2 You can create a database, configure database options, delete a database, manage templates, and configure
Trang 22F i g u r e 9 2 DBCA Operations screen
Table 9.1 lists and describes the DBCA database-management options
ta b l e 9 1 DBCA Database Management Options
Create a Database Allows for the step-by-step creation of a database The database
can be created based on an existing template or customized for the specific needs of the organization.
Configure Database Options Performs the necessary changes to move from a dedicated server to a shared server You can also add database options that have not
been previously configured for use with your database.
Delete a Database Completely removes a database and all associated files.
Manage Templates Manages database templates The database templates are
defini-tions of your database configuration saved in an XML file format on your local hard disk You can choose from several predefined tem- plates, or you can create customized templates
Trang 23Using DBCA to Create Oracle 11g Databases 453
Configure Automatic Storage Manage- ment (ASM)
Using ASM, Oracle manages the file placement and naming
auto-matically You provide a set of disks to the Oracle 11g database to
use, and the provisioning and optimization are automatically dled by ASM ASM is not covered in this book When you’re ready
han-to take the OCP certification exam, refer han-to OCP: Oracle Database 11g Administrator Certified Professional Study Guide (Sybex, 2009).
Choose Create a Database, and click Next to open the Database Templates screen In the coming sections, I will discuss database templates and the various screens in the DBCA to create a database
Database Templates
The DBCA comes with two preconfigured database templates These XML-based documents contain the information necessary to create the Oracle Database You can choose one of these predefined templates, or you can build a custom database definition The predefined database templates are Data Warehouse and General Purpose or Transaction Processing (see Figure 9.3) These templates were designed to create databases that are optimized for a particular type of workload When you choose Custom Database, you will have more flex-ibility to create tablespaces and decide which components to install The screens that are different when choosing the Custom Database option are identified later in the section
F i g u r e 9 3 DBCA Database Templates screen
ta b l e 9 1 DBCA Database Management Options (continued)
Trang 24To display the configuration definitions for these preconfigured databases, click Show Details Figure 9.4 shows the details of the General Purpose or Transaction Processing template You have the option of saving the details as an HTML file using the button at the bottom-right corner Before creating the database, you will get the summary information, and you will have the option to save the database create scripts as well as a similar HTML file with all the options and parameter values
F i g u r e 9 4 DBCA Templates Details screen
Table 9.2 displays information about what is contained in the template definition shown
in Figure 9.4 When you scroll down, you’ll see multiple sections on the page Each section
of the page gives further information about the template For example, under the Common Options section, you will see a list of each of the database options that gets installed for the template definition you have chosen
Trang 25Using DBCA to Create Oracle 11g Databases 455
ta b l e 9 2 Template Definition Details
Common Options Displays which databases options will be installed
Initialization Parameters Displays the common initialization parameters and their settings
Character Sets Displays character sets to be used
Control Files Displays filenames and locations for control files
Tablespaces Displays names and types of tablespace
Datafiles Displays filenames and size for each tablespace
Redo Log Groups Displays group number and size
Choosing the Custom Database template option on the DBCA Database Templates screen gives you the fullest flexibility For other templates, the database data files are pre-built with certain Oracle options Also, the database block size cannot be changed from 8KB A No value in the Includes Datafiles column in the Database Templates screen shows which templates are fully customizable
After you have chosen the appropriate template to use, click Next You will then be sented with the Database Identification screen
pre-Database Identification
The Database Identification screen (see Figure 9.5) allows you to enter the global database
name and Oracle system identification name (commonly referred to as the Oracle SID).
The global database name is the fully qualified name of the database in the enterprise
It is composed of a database name and a database domain and takes the format database_
name.database_domain; for example, sales.company.com
In this example, the first part of the global database name, OCA11G, is the name of your database Since I have not specified the domain name, there is no default domain name assigned Normally, the database domain is the same as the network domain within the enterprise A global database name must be unique within a given network domain The database name can be up to eight characters and can include letters, numbers, and the spe-cial characters $, _, and #