Oracle Database 10g: Managing Oracle on Linux for DBAs

Student Guide

D46590GC11 Edition 1.1 April 2007 D49900

ra O

le c

le ac r O ly l & On na se er U nt I
®

c A

de a

y m

Authors
Tom Best S. Matt Taylor Jr.

Copyright © 2007, Oracle. All rights reserved. Disclaimer This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle. The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free. Restricted Rights Notice If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract. Trademark Notice Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Technical Contributors and Reviewers
Maria Billings MJ Bryksa Al Flournoy Mark Fuller Sush Jagannath Donna Keesling Sergio Leunissen Greg Marsden Prasanth Narayanan Abhishek Singh James Spiller Herbert van den Bergh Harald van Breederode James Womack

Editor
Amitha Narayan

Graphic Designers
Satish Bettegowda Samir Mozumdar

Publishers
Sujatha Nagendra Nita Brozowski

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Contents

Preface 1 Introduction Objectives 1-2 Suggested Course Schedule 1-3 Supported Linux Distributions 1-4 Linux Distribution: Overview 1-5 Linux Packages 1-6 Linux Kernel 1-7 Verifying the Kernel 1-8 Interpreting the Linux Kernel Version Number 1-9 A Tainted Linux Kernel 1-10 Checking for a Tainted Kernel 1-11 Supported Hardware 1-12 Common Linux Commands and Programs 1-13 Navigating the File System 1-15 The Virtual File System 1-16 Using the Virtual File System 1-17 Bash Shell Scripting 1-18 Bash Shell Scripting: Environment Variables 1-19 Redirecting Input and Output 1-21 Bash Shell Scripting: Conditions 1-23 Bash Shell Scripting: case 1-24 Bash Shell Scripting: while 1-25 Bash Shell Scripting: In-List Syntax of for 1-26

Bash Shell Scripting: Controlled Loop Syntax of for 1-27 Summary 1-28 Practice 1 Overview: Working with Linux 1-29 2 Preparing Linux for Oracle Objectives 2-2 Setting Kernel Parameters 2-3 Linux Shared Memory: Overview 2-6 Shared Memory Parameters for 32-Bit Linux 2-7 Semaphores 2-9

ra O

le c

le ac r O ly l & On na se er U nt I
iii

c A

de a

y m

Setting Semaphore Parameters 2-10 Setting the File Handles Parameter 2-11 Setting Other Parameters 2-12 Shell Limits 2-13 Setting Shell Limits 2-15 Managing Packages 2-17 Required Software 2-19 Linux Patches 2-21 Configuring the X Window System 2-22 Testing the X Window System 2-23 Creating Groups 2-25 Creating and Viewing a Group 2-27 Creating the Oracle Software Owner 2-28 The nobody User 2-30 Summary 2-31 Practice 2 Overview: Preparing Linux for Oracle 2-32 3 Installing Oracle on Linux Objectives 3-2 File System Security 3-3 File Security Attributes 3-4 SETUID and SETGID Bits 3-5 Choosing a Shell 3-6 Setting Environment Variables 3-7 User File Creation Mask 3-8 Setting Oracle Environment Variables 3-9 Optimal Flexible Architecture 3-10 OFA Characteristics 3-11 Mount Points 3-13 ORACLE_HOME and ORACLE_BASE 3-14 Creating the Oracle Directories 3-15 Installing New Releases 3-16 Managing Multiple Versions 3-17 Setting Oracle Environment Variables 3-19 Mounting the CD-ROM 3-21 Starting the Installer 3-22 Oracle Universal Installer 3-23 Installation Log Files 3-24 Prerequisite Check Results 3-25 Oracle Patch Utility 3-26

ra O

le c

le ac r O ly l & On na se er U nt I
iv

c A

de a

y m

Oracle Relink Utility 3-28 Troubleshooting 3-30 Summary 3-31 Practice 3 Overview: Installing Oracle on Linux 3-32 4 Managing Storage Objectives 4-2 Certified and Supported File Systems 4-3 Disk Partitioning 4-4 Comparing File Systems 4-6 File System Characteristics 4-7 Automatic Storage Management 4-9 ext2 and ext3 4-10 Oracle Clustered File System 2 4-11 Network File System 4-12 Summary 4-13 Automatic Storage Management and Automatic Storage Management Library Driver Objectives 5-2 Automatic Storage Management 5-3 Automatic Storage Management Library Driver (ASMLib) 5-4 Installing and Initializing ASMLib 5-5 Configuring Disks 5-6 Marking Disks As Automatic Storage Management Disks 5-7 Creating an ASM Instance 5-8 ASM and ASMLib Installation and Configuration Summary 5-9 ASM Installation: Best Practices 5-10 Disk Group: Best Practices 5-11 Summary 5-12 Practice 5 Overview: Installing and Configuring ASMLib and ASM 5-13 Creating the Database Objectives 6-2 Creating a Database 6-3 Choosing the Storage Mechanism 6-4 Specifying the ASM Disk Groups 6-5 Assigning ASM Disk Groups 6-6 dbca Log Files 6-7 The Instance admin Directory 6-8

5

6

ra O

le c

le ac r O ly l & On na se er U nt I
v

c A

de a

y m

Parameter and Dump Files 6-9 The portlist.ini File 6-10 URL Deployment Information 6-11 Miscellaneous Files 6-12 Background Processes 6-13 Server Processes 6-15 Process Hierarchy 6-16 Implementing OS Authentication for DBAs 6-17 Summary 6-18 Practice 6 Overview: Creating a Database 6-19 7 Customizing Oracle on Linux Objectives 7-2 Controlling Oracle Database 7-3 Linux Startup Sequence 7-4 Linux Runlevels 7-7 Database Startup and Shutdown 7-8 Administrative Scripts 7-10 Managing Services with chkconfig 7-12 Automating Jobs 7-13 OS Scheduling Tools 7-14 Job Capabilities of DB Console 7-16 Database Backups 7-17 Backing Up with RMAN 7-18 Server Parameter File 7-19 Summary 7-20 Practice 7 Overview: Automating Tasks 7-21

8

ra O

Managing Memory Objectives 8-2 Swap Space 8-3 Swap Cache 8-4 Sizing Swap Space 8-6 /proc/meminfo 8-7 Evaluating Free Memory 8-8 Memory Terminology 8-9 Page Address Extensions (PAE) 8-10 Hugepages 8-11 Implementing Hugepages on 32-Bit Linux 8-12 Implementing a Large SGA 8-14

le c

le ac r O ly l & On na se er U nt I
vi

c A

de a

y m

Standard Linux Memory Map 8-15 Modified Linux Memory Map 8-16 Altering the Linux Memory Map 8-17 Relocating the SGA 8-19 Relocating the Database Buffer Cache 8-20 hugemem Kernel 8-22 Summary 8-23 Practice 8 Overview: Managing Memory 8-24 9 Using Linux Measurement Tools Objectives 9-2 Basic Tuning Methodology 9-3 Standard Measurement Tools 9-4 Linux Tools 9-6 Common Areas to Tune 9-8 Monitoring and Tuning CPU 9-9 Is the CPU a Bottleneck? 9-10 CPU Measurements 9-12 Measuring CPU Activity with vmstat 9-14 Interpreting CPU Measurements 9-17 Reducing CPU Bottlenecks 9-19 Monitoring and Tuning Memory 9-20 Measuring Memory Usage 9-21 Measuring Total Memory 9-23 Measuring Memory with sar 9-25 Interpreting Memory Measurements 9-27 Reducing Memory Bottlenecks 9-29 Monitoring and Tuning I/O 9-30 Is I/O a Bottleneck? 9-31 I/O Measurements 9-32 Measuring I/O with iostat 9-33 Interpreting I/O Measurements 9-36 Reducing I/O Bottlenecks 9-37 Summary 9-38 Practice 9 Overview: Using Linux Measurement Tools 9-39

ra O

10 Tuning Oracle on Linux Objectives 10-2 Basic Oracle Database Optimizations 10-3 Sizing Database Blocks 10-4

le c

le ac r O ly l & On na se er U nt I
vii

c A

de a

y m

LOG_BUFFER and Redo Log File 10-6 Advanced Features of Oracle Server 10-8 Multiple DBWR Processes 10-9 DB Writer Slaves 10-10 Changing SGA Behavior 10-11 Automatic Shared Memory Management 10-12 Basic Linux Optimizations 10-13 Choosing a Kernel 10-14 Summary 10-15 Practice 10 Overview: Tuning Performance 10-16 11 Dedugging Oracle on Linux Objectives 11-2 OS Watcher 11-3 Installing OSW 11-4 Configuring OSW 11-5 Running OSW 11-6 Viewing OSW Output 11-7 Remote Diagnostics Agent 11-8 Installing the RDA 11-9 Running the RDA 11-10 Viewing the RDA Output 11-11 Navigating the RDA Output 11-12 strace 11-13 ORA-600 Errors 11-15 ORA-7445 Errors 11-16 Resolving ORA-600/ORA-7445 Errors 11-17 Summary 11-19 Practice 11 Overview: Debugging Oracle on Linux 11-20 Appendix A: Practices Appendix B: Practice Solutions Appendix C: Basic Linux and vi Commands Index

ra O

le c

le ac r O ly l & On na se er U nt I
viii

c A

de a

y m

Preface ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

Profile Before You Begin This Course Before you begin this course.3 c A de a y m . you should have working knowledge with administering an Oracle database. ra O le c le ac r O ly l & On na se er U nt I Preface . Online demonstrations and written practice sessions reinforce the concepts and skills that are introduced. How This Course Is Organized Oracle Database 10g: Managing Oracle on Linux for DBAs is an instructor-led course featuring lectures and hands-on exercises.

2) Oracle® Database Installation Guide 10g Release 2 (10.Related Publications Oracle Publications Title Oracle® Database Administrator's Guide 10g Release 2 (10.2) for Linux x86 Oracle® Database Release Notes 10g Release 2 (10.4 c A de a y m .2) for Linux x86 Additional Publications • System release bulletins • Installation and user’s guides • Read-me files • International Oracle User’s Group (IOUG) articles • Oracle Magazine Part Number B14231-02 B15660-02 B15659-05 ra O le c le ac r O ly l & On na se er U nt I Preface .

table names. names of courses and manuals.Typographic Conventions What follows are two lists of typographical conventions that are used specifically within text or within code. This subject is covered in Lesson 3. Choose Cancel. italic where: role is the name of the role to be created. Typographic Conventions Within Text Convention Uppercase Object or Term Commands. usernames. column names.” Italic Quotation marks ra O le c le ac r O ly l & On na se er U nt I Preface . “Working with Objects.5 c A de a y m . PL/SQL objects. passwords Trigger and button names Books. schemas Filenames. Initial cap Assign a When-Validate-Item trigger to the ORD block. For more information on the subject see Oracle SQL Reference Manual Do not save changes to the database. syntax variables. and emphasized words or phrases Lesson module titles referenced within a course Example Use the SELECT command to view information stored in the LAST_NAME column of the EMPLOYEES table. Lowercase. functions.

./runInstaller Lowercase Column names. . Bold Text that must be entered by a user . functions Syntax variables Forms triggers Example SELECT employee_id FROM employees. .Typographic Conventions (continued) Typographic Conventions Within Code Convention Uppercase Lowercase. PL/SQL objects ra O le c le ac r O ly l & On na se er U nt I Preface . Form module: ORD Trigger level: S_ITEM. .QUANTITY item Trigger name: When-Validate-Item . CREATE ROLE role. OG_ACTIVATE_LAYER (OG_GET_LAYER ('prod_pie_layer')) . . filenames.6 c A de a y m . table names. SELECT last_name FROM employees. . italic Initial cap Object or Term Commands. .

Introduction Copyright © 2007. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m . All rights reserved.

Objectives After completing this lesson. All rights reserved. you should be able to: • Interpret Linux kernel version information • Identify a tainted kernel • Use common Linux commands • Write a simple bash shell script Copyright © 2007.2 . Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 .

Suggested Course Schedule 1: Introduction 2: Preparing Linux for Oracle 3: Installing Oracle on Linux 4: Managing Storage 5: Automatic Storage Management 6: Creating the Database 7: Customizing Oracle on Linux 8: Managing Memory 9: Using Linux Measurement Tools 10: Tuning Performance 11: Debugging Oracle on Linux Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . All rights reserved.3 . Oracle.

All rights reserved. Supported Linux Distributions This chart shows the supported Linux distributions for Oracle Database 10gR2.Supported Linux Distributions x86 EL 4 RHEL AS/ES 3 RHEL AS/ES 4 SuSE SLES-9 SuSE SLES-10 Asianux 2. Enterprise Linux is available on x86 and x86-64 platforms. The Red Hat versions are: • Advanced Server 3 and 4 (RHEL/AS) • Edge Server 3 and 4 (RHEL/ES) The supported SuSE Linux version is SuSE Linux Enterprise Server 9. Oracle.0 x86-64 Itanium Copyright © 2007.0 and later ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 .0 and later • Miracle Linux 4. The supported Asianux-based distributions are: • Red Flag DC Server 5.4 .

kernel patches. modules. Various packages are installed based on the responses in the dialog that occurs during installation. Copyright © 2007. All rights reserved. usually in the form of packages.Linux Distribution: Overview • The core parts of the Linux system are the following: – Packages – The kernel • Certified distributions are made up of packages that contain programs. Linux Distribution: Overview The Linux software distribution consists of a software set that is provided by a vendor. and file systems. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . Oracle. Packages can provide the kernel. applications.5 .

If there are such modules loaded. In this case. All the stock kernels include support for loadable modules. whereas loadable modules can be added without recompiling.” ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . support will be deferred to the supplier of that module. Linux Packages Modules The modules in a Linux distribution can be either kernel based or loadable. then Oracle will support that OS fully.6 . These modules may be proprietary modules where the source code is not available for Linux developers to investigate. Copyright © 2007. and add functionality. you can update the kernel. except in the event that the problem is caused by a proprietary module. All rights reserved. Kernel-based modules have to be compiled in. These are precompiled binaries that can be installed on and removed from your system with a package manager. Packages The Linux software for most of the supported distributions is assembled into packages. With packages. Oracle. patch. Note: Package management is covered in detail in the lesson titled “Preparing Linux for Oracle.Linux Packages The Linux system is made up of software that is delivered as packages: • Packages deliver: – Applications – The kernel – Configurations • Packages are built from: – Sources – Patches Enterprise Linux uses the Red Hat Package Manager (RPM) package format. Some third-party vendors distribute binary modules that are loaded into the kernel.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . has a kernel that is loaded at boot time and stays in the memory. For more information about kernel support. can be customized infinitely. unmodified distribution Copyright © 2007. like most modern operating systems. If the kernel still does not behave to your satisfaction. in your database or the OS. on MetaLink. Oracle. That means only kernels supplied by the certified distributions are supported. You can include or exclude modules that make up the kernel. then Oracle Support Services (OSS) cannot identify where the problem is. Linux Operating System Support.7 . The kernel in Linux.1. see note 228374. Kernels that are patched by packages by the kernel vendor are also supported. It is: • Configurable • Supportable – Supplied kernel – Patched by vendor – A certified. by using the kernel configuration file. source code is available for you to change it to your specification. All rights reserved. Linux Kernel Linux.Linux Kernel The Linux kernel is the core of the operating system. Oracle Corporation supports only stock kernels. If you are running a kernel that is different than the one that was tested by the vendor. This can lead to a support problem. unlike in many other operating systems.

1.9-42.Verifying the Kernel • Execute the uname -r command to see the kernel release: # uname -r 2. Verifying the Kernel View the kernel release using the uname command.0.0. For example: # cat enterprise-release Enterprise Linux Enterprise Linux AS release 4 (October Update 4) ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 .8 .0. Copyright © 2007. You can see the name of the release on EL by viewing the /etc/enterprise-release file.ELsmp • Check the release number returned in MetaLink for support. Oracle. as shown.6. All rights reserved.

• Errata: An extra version number to reflect fixes after the base version was released. For example. smp. The meanings of hugemem and smp are covered in the lesson titled “Managing Memory. Oracle. it shows what machine models it runs on. or an organization’s initials. More than just what revision of the source code was used to compile it. • Type: The type of architecture the kernel is targeted for. as of 2006. • Mod: The source modifier for the kernel. The values of this field can vary greatly. This indicates where the kernel originated from. Interpreting the Linux Kernel Version Number The Linux kernel version numbers reflect information about the kernel.6. the base version number.<Mod><Type> Base kernel version Integers separated by periods Source modifier None: Uniprocessor smp: SMP up to 16 GB hugemem: SMP up to 64 GB Copyright © 2007. All rights reserved. the current version. This typically reflects errors that were fixed. This number can be traced back to a year when that kernel version was first made available.” ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . This course is based on the 2. or minor enhancements to the kernel.9 kernel.Interpreting the Linux Kernel Version Number <Base>-<Errata>. The first two integers do not change very often. and also the source from where the kernel originated. or blank. was originally available in 2003.9 . This is typically three or four integers separated by periods. it could be a developer’s initials.6. and is still. This can be hugemem. For example. which stands for Enterprise Linux. The fields of the version number are as follows: • Base: The base kernel version. referred to as “the two six kernel” for 2. The kernel being used in this course has EL as a source modifier.

Force loading causes the kernel to be marked as tainted.A Tainted Linux Kernel Loadable Kernel Modules (LKMs) T Kernel Copyright © 2007. All rights reserved. A kernel that is delivered with a GPL distribution is considered untainted. and the module is not loaded into the kernel. • EMC Powerpath driver: See MetaLink note 284823. then an error is returned. Oracle may or may not support it. Oracle. depending on the source of the tainting. If a kernel is tainted. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . Here are two cases where a tainted kernel is supported: • OCFS: See MetaLink note 276450. The sysadmin (SA) may choose to force the module to load anyway.1.10 . A Tainted Linux Kernel A General Public License (GPL) is a software license that provides for basically free use of software under certain conditions. Consider that a given module is compiled for use with a specific version of a kernel. If that module is introduced to a kernel with a different version number. It is commonly used in the open source community. There are two actions that cause a kernel to become tainted: • A non-GPL module is loaded into the kernel. • A module is force-loaded into the kernel.1.

This may also be blank. Oracle. The /proc/sys/kernel/tainted file indicates whether the kernel is tainted or not. You can also run the lsmod command.Checking for a Tainted Kernel Determine whether a kernel is tainted by: • Viewing the contents of /proc/sys/kernel/tainted: # cat /proc/sys/kernel/tainted 0 0 = not tainted 1 = tainted • Running lsmod to list the status of modules: # lsmod Module oracleasm loop Size 48020 15817 Used by 1 4 Not tainted Copyright © 2007. All rights reserved. and one means it is tainted.11 . Zero means it is not tainted. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . and look for the tainted string in the header. indicating it is not tainted. Checking for a Tainted Kernel A tainted kernel is one that has had modifications done to it that are not normally supported.

• Customers must check with the OS vendors for supported hardware.com/hardware. For details about hardware configurations that are certified with Enterprise Linux.oracle.html.Supported Hardware • Oracle Corporation does not certify hardware. only OS platforms. Oracle. All rights reserved. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . see http://linux. Copyright © 2007.12 . Supported Hardware Oracle Corporation supports a given Linux distribution on any platform or drivers that the vendor supports.

13 .Common Linux Commands and Programs • • • • • • • • • • • ls: List files cp: Copy files mv: Move and rename files mkdir: Make a directory alias: Define command macros rm: Remove files and directories more: Page through output head: Show beginning of file contents tail: Show end of file contents df: Display filesystem space usage du: Display directory disk space usage Copyright © 2007. All rights reserved. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . Oracle.

All rights reserved.14 . the following displays the manual pages for the touch command: $ man touch ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . Note Use the man command to see the manual pages for any command. For example. Oracle.Common Linux Commands and Programs • • • • • • • • • • • cat: Show and concatenate files grep: Search for patterns in files chmod: Change permissions of files chown: Change owner of files zip: Compress and package files together gedit: A WYSIWYG text editor export: Make environment settings global ps: List running processes touch: Change file time stamps id: Show information about the current user sudo: Execute commands as another user Copyright © 2007.

• Use a period to indicate the current directory. which can be referred to using the tilde character. • Mostly use cd. • Each user has a home directory. pwd.” ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . and a set of permission bits. All rights reserved.15 . • Permissions are noted in the form of a user and group associated with the entry. File system security and permission bits are covered in detail in the lesson titled “Installing Oracle on Linux.Navigating the File System $ whoami oracle $ cd $ cd ~ $ pwd /home/oracle $ ls -l total 40 drwxrwxrwx 2 -rwxrwxrwx 1 drwxr-xr-x 3 drwxrwxrwx 2 drwxr-xr-x 3 drwxr-xr-x 3 drwxr-xr-x 2 Each of these changes to current user's home directory root tbest oracle oracle oracle oracle oracle root oracle oinstall oinstall oinstall oinstall oinstall 4096 57 4096 4096 4096 4096 4096 Oct Dec Sep Oct Sep Sep Oct 4 7 30 9 29 30 11 10:07 2005 13:48 14:08 11:46 12:07 11:47 Desktop diary osw prog rda rda2 stuff Copyright © 2007. Oracle. and ls to navigate and explore the file system from the command line. Navigating the File System Use the following conventions when navigating the file system: • Use a slash to separate directory names.

The Virtual File System

The virtual file system on Linux is referenced as the /proc directory, and: • Does not exist on any permanent media • Is a representation of what is in kernel memory • Can be compared to the v$ views in an Oracle database instance, except that they can be modified

Copyright © 2007, Oracle. All rights reserved.

The Virtual File System The contents of the /proc file system represent the current state of the operating system kernel. This information is stored in memory, actually in the kernel. The /proc file system is a means for allowing a system administrator to access it easily, because a file system is a ubiquitous information structure. Some of the information is simply represented as files under the /proc directory, such as: • meminfo: Memory segment sizes and statistics • uptime: Number of seconds since the system was rebooted, followed by the number of seconds the system has been idle • partitions: Names and sizes of disk partitions But there are also virtual files stored under subdirectories, such as: • net: Network-related information • sys: Low-level operating system settings, including kernel parameters

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 1 - 16

Using the Virtual File System

You use the virtual file system to: • View the current state of the kernel • Change kernel parameters
# cd /proc/sys/kernel # ls -l threads-max -rw-r--r-- 1 root root 0 Dec 28 18:12 threads-max # echo 16375 >/proc/sys/kernel/threads-max # cd /proc/sys/kernel # ls -l tainted -r--r--r-- 1 root root 0 Dec 28 18:14 tainted # echo 0 >tainted -bash: tainted: Operation not permitted

Copyright © 2007, Oracle. All rights reserved.

Using the Virtual File System You can consider the virtual file system as a set of files. The can be viewed simply by using commands such as cat or more. You can also change the values of some kernel parameters by writing values into the appropriate file. You can tell if the file can be changed by looking at its write permissions. If it has the write bit on, then you can edit it. If it does not, then you are not able to update it; it is intended to be read-only. The first example in the slide modifies the maximum number of threads on the system. Note that the file listing shows up as writable. In the second example, an attempt is made to change the tainted flag, using the virtual file system. Because it is not a writable file, the change fails.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 1 - 17

Bash Shell Scripting

Basic attributes of bash shell scripting are: $ SOMEVAR=thisvalue • Environment variables
$ echo $SOMEVAR thisvalue

• Input and output redirecting
$ ls -l >/tmp/filelist – Write output to file: $ date >>/tmp/filelist – Append output to file: $ ls -l | more – Pipe output to another command:

• Flow control
– – – – if: Test a condition and branch based on the result case: Actions to take based on a list of conditions while: Loop while a condition exists for: Loop while a condition or list exists
Copyright © 2007, Oracle. All rights reserved.

Bash Shell Scripting The following are the major scripting features provided by the bash shell: • Environment variables: You can set and interrogate environment variables. You must not put any spaces on either side of the equal sign; an error results if you do so. • Input and Output redirection: You can direct output from one program to be the input of another program. You can also direct input to come from a file, and output to go into a file. Use the greater than sign (“>”) in front of the file name to direct output to the file, creating it if it does not exist, or replacing any existing contents if it does exist. Use two greater than signs (">>") to append the output to an existing file. • Flow control: You have the ability to control the flow of the script using conditional logic. The following are the most common control constructs: - if: Test a condition and branch based on the result - case: Specify actions to take based on a list of conditions - while: Loop while a condition exists - for: Loop while a condition exists or until a list is exhausted

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 1 - 18

Bash Shell Scripting: Environment Variables

The following are some of the variables that are available: • Built-in shell variables:
– – – – – PWD: The current working directory $#: Number of command shell variables $?: Exit value of last command $n: Positional command-line arguments $*: All command-line arguments

• Other variables:
– HOME: The current user's home directory – PATH: List of directories to search for programs – PS1: Primary prompt string

Copyright © 2007, Oracle. All rights reserved.

Bash Shell Scripting: Environment Variables The following variables are available in the bash shell: • PWD: The current working directory
$ echo $PWD /home/oracle

$#: The number of command shell variables. This allows you to know how many command-like values were provided so that they can be processed, for example, by a loop. $?: The exit status value of the last command. This is useful for taking action based on the success or failure of previous commands or other called shell scripts. $n: Any of the command-line parameters, according to their position (for example, $1, $2, and so on). $0 is the command or script name as it was invoked on the command line. - For this example script called showparams.sh: This is the output, based on this invocation:
$ ./showparms.sh abc xyz ./showparms.sh xyz

-

ra O

le c

echo $0 echo $2

le ac r O ly l & On na se er U nt I

c A

de a

y m

$*: All command-line parameters passed in to the shell script

Oracle Database 10g: Managing Oracle on Linux for DBAs 1 - 19

Bash Shell Scripting: Environment Variables (continued) The following variables are also available in the bash shell: • HOME: The current user's home directory. A shortcut for this is the tilde character (“~”). For example:
$ echo $HOME /home/oracle $ cd ~ $ pwd /home/oracle

PATH: The list of directories to be searched when looking for a command or executable file that is being invoked. Each directory is separated by a colon (“:”) . - An example of a PATH setting is:
/usr/local/bin:/bin:/usr/bin:/home/vncuser/bin

Which means that any unqualified command or script names entered on the command line will be located by searching these directories, in the order specified. An unqualified script is one that has no directory specification in front of it. PS1: Primary prompt string. This defines what is displayed at the command-line prompt. This can contain literal strings, but special characters may be included to display dynamic values based on your environment. These are some of the most often used characters: - \h: The host name, up to the first period - \u: The current user's name - \w: The current directory, shown fully - \W: The same as \w, except that it shows only the last subdirectory name, not the full directory name In the following example, the username, machine name, and current directory are included in the prompt:
-

[vncuser@EDRSR9P1 ~]$ echo $PS1 [\u@\h \W]\$ [vncuser@EDRSR9P1 ~]$ cd /tmp/files [vncuser@EDRSR9P1 files]$

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 1 - 20

Redirecting Input and Output
1
$ command > | File $ command2 | tee $ command < File | File2 $ command3

4
$ command1

2

3
$ command1

$ command4

| $ command2

Copyright © 2007, Oracle. All rights reserved.

Redirecting Input and Output

You can redirect from where input for a command program comes, and also to where the output goes. This enables you to string together many commands and files in a single OS command line submittal. When redirecting input and output from and to a file, respectively, you use the I/O redirection syntax, which is made up of the following characters: • >: The greater than sign, which means direct the output to the specified file • <: The less than sign, which means read the input from the specified file • >>: Two greater than signs, which means append the output to the specified file that may already exist If you want to direct input and output from or to another command, respectively, then use the pipe character, which is |(the vertical bar). You can also direct output to a file and to the terminal at the same time. This is a way to see the output on the terminal and also have it written to a file. Use the tee keyword to do this.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 1 - 21

Redirecting Input and Output (continued) In the slide, the following scenarios are illustrated: 1. A command is run, and its output is written to a file. The following example writes the directory listing out to the out.txt file:
ls –a >out.txt

2. A command is run, and its input is taken from a file. In the example, the factor command is used, which calculates and displays the prime factors of the provided number, which come from the standard input stream. You can indicate that factor should read a list of numbers from a file by redirecting input from a file that contains those numbers:
$ factor <numbers.dat 23: 23 55: 5 11 103: 103 86: 2 43 256: 2 2 2 2 2 2 2 2

This presumes the numbers.dat file has the following contents:
23 55 103 86 256

3. A command is run, and its output is provided as input to a second command. In the following example, the process listing is searched for incidents of the string _pmon_, which is the Oracle Database process monitor. There are three occurrences: one for each database instance running, and one for the grep command itself because it is also a running process at the time.
$ ps -ef | grep _pmon_ oracle 6985 1 0 Sep27 ? 00:01:29 asm_pmon_+ASM oracle 6886 1 0 Oct15 ? 00:00:22 ora_pmon_orcl oracle 3571 21645 0 12:34 pts/3 00:00:00 grep _pmon_

4. A series of four commands are run, each accepting as input the output of the previous command. Also, the output of the second command is written to a file. This example parses out the process listing down to displaying only the names of the two database instances that are currently running a pmon process. Note that grep –v searches for those lines in the input that do not have the given string. That serves to eliminate the process that is the grep command itself, which was shown in example (3). The cut command is used here to extract only characters 58 through 61 inclusive.
$ ps -ef | grep _pmon_ | tee all_pmon.txt | grep -v grep | cut c58-61 +ASM orcl

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 1 - 22

Bash Shell Scripting: Conditions
Compare numbers: -eq: -gt: -ge: -lt: -le: -ne: = > >= < <= <> Test strings: s: -n -z =: <: >: Not null s: Nonzero length s: Zero length Strings are equal Less than Greater than

Test files: -a: -d: -w: -x: Exists Is a directory Is writable Is executable

Modify conditions: !: NOT -a: AND -o: OR

Copyright © 2007, Oracle. All rights reserved.

Bash Shell Scripting: Conditions

In the slide are some common syntaxes for testing conditions in the bash shell. Put the condition expression inside brackets:
[ cond ]

It is required that you put a space on each side of the condition to separate it from the brackets. You can use the test syntax instead of the brackets, but there are some syntax variations for some constructs. For details, see the manual pages for bash and test. Some examples of condition-testing syntax are listed below: • Test if the first command-line argument is a number greater than 5:
[ $1 > 5 ]

• Test if the file somefile.dat exists in the current directory:
[ -a somefile.dat ]

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 1 - 23

esac Copyright © 2007. then the string Unknown is output. It is much like a series of if-then-else statements. END1 or END2. and then execute certain commands based upon that criteria. all the data appearing until the label name. Only the commands associated with the first pattern matched are executed.. Oracle. *) echo Unknown.Bash Shell Scripting: case Syntax: case value in pattern1) commands1. down) sqlplus / as sysdba <<-END2 shutdown immediate. Bash Shell Scripting: case The case statement provides a way for you to define criteria. If it is neither of these.24 . is encountered are sent to the sqlplus program as input. When sqlplus is called. pattern2) commands2... which can either be up or down. Not unique to the case statement are the labels that delimit the input to the sqlplus invocation. END1 . The value is evaluated. All rights reserved. based on the input parameter. esac Example: case $1 in up) sqlplus / as sysdba <<-END1 startup. the corresponding commands are executed. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . END2 . The example in the slide either starts up or shuts down the database.. and based upon its match to the patterns listed..

2. it is PID. which pipe their output to one another. kills all of these processes. and the second field is the process ID. The awk command. The commands. The kill statement refers to the variable that appeared in the read statement in the while condition. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . but it could be anything. which reads one at the top of each iteration. This causes the user name and program name to be included in the listing.Bash Shell Scripting: while Syntax: while condition do commands done Example: ps -ef | grep -i oracle |\ awk '{print $2}' |\ while read PID do kill -9 ${PID} done Copyright © 2007. The ps command lists every process on the system. So. in full format. regardless of case. which is actually a programming language in itself. Here. Each of those process IDs is read by the while loop and fed to a kill command. Bash Shell Scripting: while The while statement specifies a loop to execute as long as a certain condition remains true. Oracle. work together to filter out the process IDs thus: 1. only the process ID is piped into the while loop.25 . There is nothing special about the variable name. see the man pages. In the example in the slide. This. a series of commands are run to filter down to the list of process IDs that have anything to do with oracle. Note: For more information about awk. All rights reserved. The first field is the username. until they are exhausted. 3. The grep command searches for and outputs only those lines that contain the string oracle. in effect. outputs only the second field of the listing.

just for visual separation. In this case. If a list is specified. In the loop. That is done with the –n parameter of the echo command. A space is also printed. the mount point is printed without a carriage return. that list is processed. the in-list is a command. Oracle. the list of arguments supplied on the command line is processed. but the –l parameter causes it to count the lines instead. In example number two. The list can be the output of a command. So. do echo -n $mnt ' ' ls -l $mnt | wc -l done Copyright © 2007. The in-list syntax takes a list of items as input for processing in the loop. the df command generates a list of mount points. the values are taken from the command line provided as the shell was invoked. If no list is specified. just the mount point is passed into the for loop. This does a word count.26 . the number of entries in the mount point is printed using the ls command. All rights reserved. and the entries are counted using the wc command. each on a line by itself. Then the awk statement prints the mount point itself. and each of those values is passed through the for loop separately. which are filtered down to only the mount points by searching for a slash. The command generates a set of values. do echo $args done Example: 2 for mnt in `df | grep / | awk '{print $6}'`. such as /dev/shm. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . Bash Shell Scripting: In-List Syntax of for There are two types of syntax for the for statement. because it is simply a variable name in the in-list. In the first example in the slide. Then. this would in effect display the white-space delimited arguments. So.Bash Shell Scripting: In-List Syntax of for Syntax: for var [ in list ] do commands done Example: 1 for args. That is needed to remove the headings from the df output.

j<=8. file4. upon which cond depends. j+=2)) do grep my_name file$j done Copyright © 2007. This is usually a statement that increments or decrements a counter variable.27 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 . execution continues with the commands in the loop body. cond. then the loop is immediately exited. If it is false. and execution continues after the done statement. file8. At the bottom of each loop iteration.Bash Shell Scripting: Controlled Loop Syntax of for Syntax: for (init. at the top of the first iteration of the loop. If it is true. At the top of each loop iteration (including the first). The init expression is evaluated once. cond (which is the condition for which to remain in the loop) is evaluated. All rights reserved. file6. stmt) do commands done Example: for ((j=2. Oracle. Bash Shell Scripting: Controlled Loop Syntax of for The controlled loop syntax is made up of three specifications that control the loop duration. stmt is executed. The example in the slide looks for the string “my_name” in the following files: file2.

Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 .Summary In this lesson. you should have learned how to: • Interpret Linux kernel version information • Identify a tainted kernel • Use common Linux commands • Write a simple bash shell script Copyright © 2007.28 . All rights reserved.

All rights reserved.29 . Oracle.Practice 1 Overview: Working with Linux This practice covers the following topics: • Identifying the kernel type • Using Linux commands • Writing a simple shell script Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 1 .

ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

All rights reserved. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m .Preparing Linux for Oracle Copyright © 2007.

Objectives After completing this lesson. you should be able to: • Use the package manager to determine and update package support • Set up the operating system environment for Oracle Database • Create the necessary groups and users for Oracle Database Copyright © 2007. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .2 . All rights reserved.

The subdirectory names and the file name combine to define the parameter entry as it appears in the /etc/sysctl. Setting Kernel Parameters The kernel parameters can be set in either the /proc/sys file system or the /etc/sysctl.conf file. In the /etc/sysctl.Setting Kernel Parameters # cd /proc/sys # ls debug dev fs kernel net proc sunrpc vm # cd net # ls core ethernet ipv4 ipv6 token-ring unix # cd core # ls rmem* rmem_default rmem_max # cat rmem_max 262144 Entry in the /etc/sysctl.core. Also.conf entry is shown as net.conf file. the corresponding /etc/sysctl. All rights reserved.conf file.core.rmem_max = 262144 Copyright © 2007.conf file net. each entry corresponds hierarchically to one of the files in the /proc/sys directory. The difference between these two methods of changing kernel parameters is explained in the following slides.rmem_max. the current value of the rmem_max parameter can be viewed by looking at the /proc/sys/net/core/rmem_max file. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .3 . In the example in the slide. Oracle.

to change the SHMMAX parameter for this boot session only.4 . if the system is rebooted. The following is an example of an edited line in the sysctl.shmmax = 2147483648 ra O le c kernel. edit the appropriate line in the /etc/sysctl. use: echo 2147483648 >/proc/sys/kernel/shmmax After that. use the sysctl utility: # sysctl –a To change a kernel parameter that will be effective only until the next reboot.conf file: Alternatively. Persistent: Set during each startup Setting Kernel Parameters (continued) To view the current values of kernel parameters.Setting Kernel Parameters New value /proc/sys/…/<file> Non persistent Or /etc/sysctl.conf + # sysctl -p Copyright © 2007. you can issue the following command.shmmax = 2147483648 le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . Oracle. and then issue the sysctl –p command. For example.conf file. this change is gone. All rights reserved. This effectively makes the change persistent because it is reapplied during each boot sequence. and the same persistent setting will be done: sysctl -w kernel. you can make the parameter change such that it is reapplied each time the system is rebooted. write the new value into the appropriate file in the /proc/sys file system. Further. To do this.

The different runlevels will be discussed in detail in the lesson titled “Customizing Oracle on Linux.conf file is not run. the /etc/sysctl. then you must start Linux in the single-user runlevel (runlevel 1).Setting Kernel Parameters (continued) You must have root privileges to perform these operations.” ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . At this runlevel. Note: If you make a mistake with a parameter setting and your system does not start.5 .

Linux Shared Memory: Overview Shared memory can be accessed by multiple processes. Oracle. and thus is used for the System Global Area (SGA). Semaphores and Shared Memory – An Overview. All rights reserved. • Segments have a maximum size. Copyright © 2007. it is only as big as is allocated. The maximum size of each segment is determined by SHMMAX. If a process needs a larger shared memory area than can be allocated in one segment. then it may allocate multiple segments. Shared memory is allocated in segments. For more information. The maximum number of segments to which one process may attach is set by SHMSEG. refer to the MetaLink note 15566. TECH: Unix Semaphores and Shared Memory Explained. A segment is not necessarily as large as the maximum size.1. • A limited number of segments can be allocated. It has the following characteristics: • Shared memory is allocated in segments. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . Database instances often allocate multiple segments to accommodate a large SGA. The maximum number of systemwide shared memory segments is set by the SHMMNI kernel parameter.6 . For details about setting shared memory parameters for your Oracle database. refer to the MetaLink note 153961. Linux Shared Memory: Overview The shared memory system on Linux works much like the shared memory on other UNIX platforms.1.

Shared Memory Parameters for 32-Bit Linux Definition Default Oracle Oracle Minimum Recommendation Requirement 2097152 (0x200000) 2097152 (0x200000) shmall Max number of shared memory pages Max shared segment size in bytes Max number of shared segments 2097152 (0x200000) shmmax 33554432 (0x2000000) Half the size of physical memory 4096 2147483648 (0x80000000) shmmni 4096 4096 Copyright © 2007. it will allocate non-contiguous segments. While they are separate. Too large a setting could result in failed attempts to allocate the memory segments. Too small a setting would result in a high number of segments. This has been shown to be the setting that provides the greatest efficiency in Oracle’s shared memory management. Shared Memory Parameters for 32-Bit Linux There are three memory-related kernel parameters. All rights reserved. the shmmax parameter is the only one that needs to be modified from its default value. which is sufficient for a 4 GB RAM system. The recommended number shown in the slide is 2 GB. they are returned to the requesting database instance as a single segment. if you have 16 GB of RAM. then this parameter should be set to: ra O le c le ac r O ly l & On na se er U nt I c A de a y m (17179869184 * . The maximum value of this parameter is 4 GB. The shmall parameter defines the maximum amount of shared memory that may be in use at any time on the system. The default allows for over two million pages. Oracle. divided by the page size. and a 4 KB page size. you see out-of-memory errors because the needed memory is not allowed to be allocated. Oracle is forced to attempt other mechanisms that allocate separate shared memory segments. For example.7 . the SGA is made up of multiple memory segments.9 ) / 4096 = 3774873 KB Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . This parameter limits the size of each of the shared memory segments on the system. otherwise. If that is not possible. It should be equal to or larger than the largest SGA on the system. Oracle will attempt to allocate contiguous segments first. requiring more work in managing them. In that case. This value should always be at least 90% of the physical RAM. If this is too small. For Oracle Database.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .2) for Linux x86.8 . refer to the Oracle Database Installation Guide 10g Release 2 (10. This is because any larger SGA would instead require an increase in the size of each shared memory segment.Shared Memory Parameters for 32-Bit Linux (continued) The shmmni parameter defines the maximum number of shared memory segments across the system. The default 4096 value is sufficient for any size SGA. Note: For details about these kernel parameters.

code. and clearing). Semaphores Semaphores are a robust method of controlling access to critical resources. Note: For details about setting semaphore parameters for your Oracle instance. This set must allocate at least as many semaphores as the value of PROCESSES. then the instance does not start. testing.9 . If it does not. All rights reserved. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . and shared memory: • semmsl: Maximum number of semaphores per set • semmns: Total number of semaphores in the system • semopm: Maximum number of operations per semop call • semmni: Maximum number of semaphore sets Copyright © 2007. setting.Semaphores Semaphores control access to critical resources. If the instance cannot allocate enough semaphores (either in one set or in multiple sets). Semaphores are allocated based on the PROCESSES initialization parameter. A semop call is a call to a function that actually uses the semaphores (for example. refer to the Oracle Database installation guide for your particular platform. the Oracle instance gets more sets to satisfy the number of semaphores that it needs. Each Oracle instance tries to allocate one semaphore set at startup. The Oracle instance uses semaphores primarily to control access to shared memory.

Copyright © 2007. All rights reserved.10 . You must test and adjust these depending on your system: For semmsl – 250 or the largest PROCESSES parameter of an Oracle database plus 10 For semmns – 32000 or sum of the PROCESSES parameters for each Oracle database. Setting Semaphore Parameters Changing the kernel parameters for semaphores works the same way as the shared memory parameters.sem 250 32000 100 128 semmsl semmns semopn semmni Semaphore settings in /proc/sys/kernel/sem and sysctl. that is. Oracle.conf are positional. Here are some general recommendations for the settings of the semaphore parameters on Enterprise Linux. and adding an additional 10 for each database For semopm – 100 For semmni – 128 ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . adding the largest one twice.Setting Semaphore Parameters kernel. the sem file in the /proc/sys/kernel directory. All four of the semaphore parameters are set in a single file.

Setting the File Handles Parameter File Handles is the parameter that determines the maximum number of file handles that the Linux kernel will allocate.533 data files. so you can leave that as it is. The default value is 65536.file-max 65536 Copyright © 2007. This value is set in /proc/sys/fs/file-max. Oracle. All rights reserved. the alert log.file-max needs to be high enough to include all the data files within your database. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . The Oracle10g Release 2 database can have up to 65. and other supporting files. The Oracle database background processes open all the data files in addition to redo logs.11 . fs.Setting the File Handles Parameter fs. and all supporting files. So.

Setting Other Parameters net.12 .core. Ports below 1024 are reserved for processes running with root privileges. Setting TCP/IP Window Size Parameters Set the four TCP/IP window sizing–related parameters to values greater than or equal to the values shown in the slide.rmem_default net. These define the read (rmem) and write (wmem) window sizes for a TCP/IP packet. Oracle. The IP port is used to communicate with the user process. the range available is 32768 through 61000.core.wmem_max 1048576 1048576 262144 262144 Copyright © 2007.core. These ports may be used for Oracle Net connections. Setting Other Parameters Setting Socket Parameters An IP port is assigned to a database-dedicated server process when it starts.ip_local_port_range 1024 Minimum 65000 Maximum net.core. They are not adjusted beyond the specified maximum value. the sizes are allowed to adjust upward to attain compatibility.rmem_max net. In some databases with a very large number of users. the IP port range is set to be from port 1024 through 65000. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .ipv4. and because TCP/IP communications occur with other machines. the default range of ports that are available to non-root processes may not be adequate. Defaults are defined. By default. All rights reserved.wmem_default net. In the example in the slide.

• nproc: The maximum number of processes a given user can run at once. • nofile: The maximum number of files the user can have open at one time. redo log files.Shell Limits Processes Files Copyright © 2007. There is little to be gained by not setting each of these to a conservatively high value. The oracle user opens initialization files. data files. so this should be set high enough to have those files open simultaneously.13 . Shell Limits Oracle-Related Limits Two limits must be set in order for an Oracle database to function properly. server processes. So you just need to set this parameter high enough to manage the highest number of sessions. and possibly the parallel query and dispatcher processes. These apply to the oracle Linux user. and so on. This is set very close to the maximum number of database files in a single database. All rights reserved. The oracle Linux user owns and starts all the background processes. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . This number must be set high enough to accommodate that. The typical increase in process count comes from the number of sessions in the database. Oracle. plus some for other processes.

there is a soft limit and a hard limit. The soft limit serves as the limit for the resource at any given time. the user may not exceed that. But the soft limit can be changed by the user. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . but never exceeding the root-defined hard limit. So allowing the soft limit to be adjusted by the user.14 . where resources are being used up beyond what was intended by the processes running in the user space.Shell Limits (continued) Soft Limit Versus Hard Limit For each of these settings. The hard limit can be changed only by the root user. up to the value of the hard limit. provides flexibility along with control. The purpose of a limit is to prevent runaway situations.

It is used to set system resource limits.so is a Pluggable Authentication Module (PAM). the user cannot set either the hard limit or the soft limit above the hard limit. Setting Shell Limits The root user can define the hard and soft limits for each user in a configuration file. and the soft limit cannot be increased above the hard limit.so required pam_limits. /etc/pam. For the example shown in the slide. To make these changes.so pam_limits. le c le ac r O ly l & On na se er U nt I nproc nproc nofile nofile 2047 16384 1024 65536 c A de a y m /lib/security/pam_limits. see the man pages for pam. the ulimit command has no effect.so Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . All rights reserved.d/login file: required required ra O pam_limits.15 . it is setting the hard limit and soft limit to the same value they have already been set to. Add or edit the following lines in the /etc/pam. Oracle.so /etc/security.conf oracle oracle oracle oracle soft hard soft hard nproc 2047 nproc 16384 nofile 1024 nofile 65536 The user can set hard and soft shell limits for its session within the bounds already set by root. the user can use the ulimit command to set the hard limit and soft limit for this specific shell.conf file: oraclesoft oraclehard oraclesoft oraclehard session session 2. The hard limit cannot be increased after it is set.d/login session session required /lib/security/pam_limits. Add the following to the /etc/security/limits. perform the following steps: 1. The hard limits can be changed only by root. For more information. $ whoami oracle $ ulimit -u 16384 -n 65536 Copyright © 2007. After an OS user has started a shell.Setting Shell Limits root can set hard and soft shell limits for each user.

Setting Shell Limits (continued) If it were to issue the ulimit –Sn 50 command (which sets the soft limit for number of open files to 50). ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . However.16 . which would result only in errors when the number of open file requests exceeds 100. this cannot be set higher than the hard limit. any processes would have to be restarted for them to take effect. The user could still set it higher (for example. ulimit –Sn 100). the Oracle database would have to be shut down and restarted. then any attempt to open more than that would result in an error. So. so if you change the settings. for example. Note: A process inherits these settings from the shell from which it is started at the time it is started.

and query packages. upgrade. a command-line utility with several options for querying. Managing Packages The recommended method for installing operating system patches and additional functionality is to apply packages from the distribution vendor. Oracle. All rights reserved. verifying. This utility is used to install. Apply packages with rpm. remove.17 . upgrading. and removing packages.Managing Packages Patches for Enterprise Linux are managed with the Red Hat Package Manager (rpm) utility. • To determine whether or not a package is installed: # rpm –q <package name> • To install a package: # rpm –ivh <package name> • To remove a package: # rpm –e <package name> Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . installing.

rpm -Uh kernel-2.27.i686. 1:my_new_package ####################################### [100%] ####################################### [100%] • -e: Erases/removes the selected package. -qa.9-e.1 • -i: Installs the named package. 1:kernel-2. Optional arguments –h and –v can also be used.4. The optional –h argument shows hash marks on the screen to indicate progress. It removes the current package and replaces it with a different version. This list can then be filtered by piping to a grep command.0-14. lists all installed packages. Note: The replacement happens without removing any existing configuration files.18 .rpm Preparing.96-108.. For example: #rpm -qa |grep gcc gcc-2. For example: # rpm -ev IBMJava2-JRE • -U: Upgrades the current package. For example: #rpm -ivh my_new_package-1..4.rpm Preparing.. The optional –v argument generates verbose output.Managing Packages (continued) The rpm utility accepts several command-line arguments including: • -q: Queries the system for a package..9-e27 ####################################### [100%] ####################################### [100%] ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . A special argument.i386. This is used when upgrading kernel packages because you cannot remove the existing kernel before installing a new one.

3 # rpm -q compat-libstdc++-296 compat-libstdc++-296-2.3-47. Then. Required Software The Oracle Database Installation Guide lists the required packages and version numbers for your Linux distribution.0. you can see that there must be more to the package name than compat-libstdc++. All rights reserved.96-132. you see that it is installed as that package name. The –q option queries the repository of installed packages looking for the exact package name you supply.19 .15.2 compat-libstdc++-33-3.2 Copyright © 2007. you see that it is not installed. Initially. and then grep for the package name or portion thereof. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .7. it is reported as not installed. when you query all packages.92. If you query for compat-libstdc++-296.96-132.2. The result shows that it is indeed installed. You can determine whether your Linux installation meets those package requirements by using the rpm command.7. The first example in the slide shows a query of the binutils package. if it is wrong.92.0.2-15. You must supply the package name exactly as it appears in the repository. Oracle.15. The second example shows a query for the compat-libstdc++ package. and the version number is 2.2-15 You may have to query all of the packages and grep for part of the name if you are unsure of the exact name: # rpm -q compat-libstdc++ package compat-libstdc++ is not installed # rpm -qa | grep compat-libstdc++ compat-libstdc++-296-2.Required Software Check that the required packages are installed: # rpm -q binutils binutils-2.

8.4.9 glibc-common-2.20 .4.4-2.1.1.14-30 sysstat-5.2.25-9 compat-libstdc++-296-2.1.3-22.3-22.6-1 Note: This list shows the required RPMs at the time of printing. refer to the Oracle Database Installation Guide for your Linux distribution.2.3.0.2 control-center-2.3-22. To ensure that this has not changed.1 libstdc++-devel-3.5-1 setarch-1.4.96-132. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .4.7.1.EL44 glibc-2.15.0-12 gcc-3.9 gnome-libs-1.EL4 gcc-c++-3.1 libstdc++-3.80-5 pdksh-5.92.2-13.1 make-3.3-22.Required Software (continued) The following are the required packages and versions for Oracle Database 10gR2 on Enterprise Linux: binutils-2.90-44.EL4 compat-db-4.4-2.3.0.4.

The latest patches should be applied. but supply patches for components. see Oracle Database 2 Day DBA 10g Release 2. Enterprise Linux is supported by Unbreakable Linux Network. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . especially the kernel patches and the security patches. • Other distribution vendors have patch channels. Each distribution vendor has a subscription service and a method for distributing patches. Note: Oracle Enterprise Manager Database Control and Grid Control provide an interface for finding and applying patches for the OS and for the database. For details. All rights reserved. Copyright © 2007.Linux Patches Apply the patches recommended by the distribution vendor: • Unbreakable Linux Network (ULN) supplies patches automatically.21 . Linux Patches Linux distribution vendors do not supply megapatches like other UNIX vendors. The latest version of all the patches are tested to work together. Oracle.

Before the installation: • Determine the monitor model number • Determine the graphics card model number or chipset Copyright © 2007.22 . the video memory size. You must know the monitor model number. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .Configuring the X Window System Install and configure the X Window System with the distribution installation. and the chipset before configuring these items. So the X Window System must be enabled. where the X Window System configuration information is kept. With this information. you are able to configure your system correctly. Configuring the X Window System Oracle Universal Installer (OUI) is a Java-based product. All rights reserved. Oracle. the graphics card model. there are several files. If the X Window System configuration needs to be changed after the installation. such as /etc/X11/XF86Config. This is usually accomplished during the installation of the Linux distribution. and Java calls the X Window System on UNIX and Linux operating systems.

– Set and export: — — DISPLAY=hostname:0. As the owner of the display (the logged-in user). For the X server to accept the display from another machine. the wiring. The ping. and dig utilities can provide good diagnostic information for solving connection problems. host. X server is the machine in which you view the output. All rights reserved. If telnet does not work. In the case of the OUI. execute xhost +<hostname> where hostname is the name or IP address of the database server where the installer is running.23 . Testing the X Window System The X server is the machine where you are viewing the screen. After a telnet connection is established to the database server where the Oracle software will be installed. xhost must be executed on the machine where the display is viewed. and X client is the machine where the installer runs the database server. The DISPLAY variable contains the host name or IP address and the display number. and the host resolution. This variable directs the Oracle Installer where to display the install screens. Oracle.Testing the X Window System Test the X Window System with an X client: • Set the DISPLAY variable: – Get the host name of the X server. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . first verify that the X server has connectivity to the database server. you must set and export the DISPLAY variable. The X client is a process (running somewhere) that sends the display to where you will be viewing it.0 Export DISPLAY • Check xhosts: — xhost +hostname • Run xclock: — xclock Copyright © 2007. check the hardware. The host names are translated into IP addresses by either a domain name server (DNS) or through the /etc/hosts file. To make sure that the installer runs in this configuration. and use telnet to make a connection.

add the name of the database server to the X access control list. With xhost +<hostname>. refer to Appendix C. In the following example. the machine jspiller-us is the X server where the installer will display the output. the machine delphi is the database server where the installer will be running: $ hostname jspiller-us $ xhost Access control enabled. Connect to the database server.24 . set the DISPLAY variable and start an X client. or the man and info pages on your Linux system. In this example. The DISPLAY variable may also be set by using the IP address instead of the name as: $ DISPLAY=192. Check which hosts are allowed to connect to the X server machine with xhosts.Testing the X Window System (continued) On the X server. $ $ $ $ telnet delphi DISPLAY=jspiller-us:0. For further information about the commands used in this lesson.2:0.0 export DISPLAY xclock The xclock client should appear on the X server screen or an error message will appear in the telnet session. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .0 This method is sometimes helpful when the host name resolution must be bypassed.1. issue a hostname command to find the name of the X server. with telnet.168. only authorized clients can connect $ xhost +delphi Delphi being added to access control list.

Oracle.Creating Groups Group Oracle Inventory OSDBA Description Identifies the owner of the Oracle software Identifies OS accounts that have database administration privileges (SYSDBA) Identifies OS accounts that have limited database administration privileges (SYSOPER) Common Name oinstall dba OSOPER oper Copyright © 2007. OSDBA.25 . The Oracle Inventory group has privileges on the software. Creating Groups The Oracle Database installation guide names three group identifiers: the Oracle Inventory group. then this group may be the same as the Oracle Inventory group for all the databases on this server. An OSDBA group must be created to manage the database files. By default this group is dba. The OSOPER group uses the same mechanism to connect with AS SYSOPER with a restricted set of privileges. All rights reserved. A DBA that is a member of both OSDBA and the Oracle Inventory group has privileges in specific database instances and the ability to access and upgrade the software through the Oracle Inventory group. and OSOPER. but this name is arbitrary. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . The members of the OSDBA group own the database files and have the privilege to connect to the database without a password. using AS SYSDBA through OS authentication. Each database may have its own OSDBA and OSOPER groups. If only one group of DBAs administers the databases on this server.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . This allows each DBA to have privileges in the database of responsibility but not in other databases. This group is commonly called oinstall.26 . create an additional OSDBA group. each administering different databases on the same server. For each set of databases that will have a common set of DBAs. you should create a separate Oracle Inventory group to own the Oracle software.Creating Groups (continued) When there are multiple groups of DBAs.

IDs below 500 are typically reserved for system accounts.vncuser bin:x:1:root.27 . All rights reserved. To verify whether the group was created.Creating and Viewing a Group To create and view the necessary groups: # groupadd –g 503 oinstall # groupadd dba # groupadd oper [root@edrsr9p1 local]# cat /etc/group root:x:0:root.daemon . . Creating and Viewing a Group The root user can execute the groupadd command to create a group. . Oracle. In the X Window System environment. oinstall:x:503: dba:x:504:oracle oper:x:505:oracle Copyright © 2007. view the /etc/group file. Enterprise Linux provides the system-config-users GUI tool. The group ID or gid must be unique. -g is optional. there are multiple tools available to manage users and groups. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .bin. then the first available group ID above 499 will be assigned. if the group ID is not specified. This command places an entry in the /etc/group file.

then the Oracle user must also be a member of that group. the primary group can be set. that would require root access every time Oracle software maintenance has to be done. The primary group is set to the Oracle Inventory group. this user is named oracle.505(oper) ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . Creating the Oracle Software Owner The user that runs the Oracle Universal Installer to install Oracle Database is the Oracle software owner. Oracle. When this user is created. All rights reserved. The name of this user is commonly oracle. $ id uid=501(oracle) gid=503(oinstall) groups=502(oracle). but this name is arbitrary. Do not run the installer as root. In the following examples.28 .503(oinstall).504(dba). Membership in other groups is set in the /etc/groups file. If the OSDBA group is different. The ownership of the installed files is set based on that user. The primary group is the one listed in the /etc/passwd file.Creating the Oracle Software Owner The user that owns the Oracle software: • Must be created • Has the Oracle Inventory group as its primary group • Must be a member of an OSDBA group • Is commonly named oracle Copyright © 2007.

a user named oracle is created with a primary group of oinstall.oper. If the -D option is used with no other options. then the user gets the first available ID above 99. Oracle. The useradd command places an entry in /etc/passwd and /etc/shadow if shadow passwords are being used. In this example. Oracle Database 10g: Managing Oracle on Linux for DBAs 2 . refer to the man pages for useradd. which is acceptable. These defaults may be overridden in the command line. because IDs below 99 are typically reserved for system accounts. You do not need to override it with the -D option. the default home directory is /home/<username>.oracle oracle 3 # passwd oracle Changing password for user oracle. If the group is not specified. The user ID must be unique. If the user ID is not specified. use system-config-users. # Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Most Linux distributions are shipped with a graphical user management tool.Creating the Oracle Software Owner 1 # useradd oracle 2 # usermod -g oinstall -G dba. Creating the Oracle Software Owner (continued) The root user can execute the useradd command to create a user. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. On Enterprise Linux. For Enterprise Linux. In this example. the -s option is not required because for Enterprise Linux the bash shell is the default shell. The –m option creates the user’s home directory and copies a skeleton set of login profiles from /etc/skel to the home directory. then useradd will show the system defaults. For more information. The -s option sets the user login shell. completely specified or changed with -D followed by the new default. All rights reserved.29 . then a group with the same name as the user is created and set as the primary group. The -g option sets the primary group.

The system administrator. If the nobody user does not exist. It is common to use 99 as the user ID and group ID. Oracle. So this user starts out with no privileges. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .30 . and perform many other privileged tasks. create it. Oracle Scheduler is one feature that can initiate external jobs. There are times when the database requests that jobs run at the OS level. • Should be allowed to have only minimal privileges # id nobody uid=99(nobody) gid=99(nobody) groups=99(nobody) Copyright © 2007. Simply allowing these programs to run as the oracle user would be too liberal a policy. The nobody User The nobody user exists to satisfy the need for a minimally privileged OS user. All rights reserved. Any programs that are invoked this way are owned by. because the oracle user is able to shut down the database. and run under the permissions granted to. based on the tasks those external programs must perform. the nobody user. can add any necessary groups to this user as needed.The nobody User The nobody user: • Is an unprivileged user • Is used for executing external jobs – The oracle user would be too powerful. and this is the user under which the job runs. as root.

Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .31 .Summary In this lesson. All rights reserved. you should have learned how to: • Use the package manager to determine and update package support • Set up the operating system environment for Oracle Database • Create the necessary groups and users for Oracle Database Copyright © 2007.

32 . Oracle.Practice 2 Overview: Preparing Linux for Oracle This practice covers the following topics: • Using the package manager to determine and update package support • Creating groups and users in preparation for an Oracle database installation • Setting up the operating system environment for Oracle Database 10gR2 Copyright © 2007. All rights reserved. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 2 .

ra O le c le ac r O ly l & On na se er U nt I c A de a y m . All rights reserved. Oracle.Installing Oracle on Linux Copyright © 2007.

2 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . you should be able to: • Describe the Linux file system security • Install multiple versions of the Oracle Database software on the same server • Accommodate multiple Oracle homes on one database server Copyright © 2007. Oracle. All rights reserved.Objectives After completing this lesson.

Note: Execute permission applies to binary programs. World permissions: This indicates whether all other users (besides the owner and the file’s group members) are able to read it. Owner permissions: This indicates whether the owner of the file is able to read it. It has no meaning for other file types. from left to right. 4. and directories. from left to right. from left to right. In the case of a directory. respectively. Directory indicator: If this is a “d.sql 1 root root 24 Feb 15 2006 postinst. and search it. 3. 1. write to it. or execute it. shell script files. or denied. respectively. All rights reserved.sh Copyright © 2007. There is a set of ten indicators that specify this permission information.3 . or execute it. File System Security Linux file system security is based on permissions attached to each file and directory.” it indicates that the entry is a directory. as they appear in a listing produced by the ls –l command. list the contents of it. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . then that permission or attribute is false. write to it. Group permissions: This indicates whether members of the group that owns the file are able to read it. are shown below. respectively. from left to right. If the positional attribute does not apply to the entry. if a user has the execute privilege on a directory. write to it. 2. that means they can cd to it.File System Security d rwx rwx rwx Owner Directory indicator Group World $ ls -l total 3 drwxr-xr-x -rwxr-xr-x -rwx------ 2 oracle oinstall 4096 Sep 17 13:02 backup 1 oracle dba 87 Dec 22 2006 lab_01. or execute it. Their meanings.

only root can read. This information. That. Regarding the items listed in the slide: • The first belongs to the oracle user. Also. determines who is allowed to do what with each given file or directory.sql -rwx-----drwxr-xr-x 1 root root 24 Feb 1 2006 postins. and execute permissions on this file. • The third entry is a directory. shown in that order as displayed by the ls –l command. any user in the dba group can execute or read this file. • The second belongs to root.sh 2 oracle oinstall 4096 Sep 17 13:02 backup Owner Group Copyright © 2007. write. or execute this file. All rights reserved. based on the last three indicators.File Security Attributes -rwxr-xr-x 1 oracle dba 87 Dec 2 2006 lab_01. which means that those accesses are denied. which is also the case for all other users. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 .4 . and its group is dba. combined with the permissions indicators means that the oracle user has read. write. they cannot do anything with this file because the group permission indicators are all dashes. but cannot write to it. and the group is also root. Based on the permissions indicators. Oracle. Even if there are other users in the root group. combined with the permissions indicators on the previous slide. File Security Attributes Each file or directory entry has an owner and a group assigned to it.

anyone can execute oradism. every action the oradism program attempts will be evaluated. Regarding the example of the oradism executable file shown in the slide. for the user and the group.5 . and when they do.conf Copyright © 2007. SUID Bits When the letter “s” appears in place of the “x” or dash in the permissions bit string. There is a /etc/xyz. All rights reserved. oinstall is the group and root is the owner.conf file which is owned by root. it has a special meaning. But if the oradism program accesses that file. anyone who invokes that program will succeed in accessing that file.SETUID and SETGID Bits The SETUID and SETGID bits indicate that others are allowed to execute a program as though they were the owning user or group. suppose that the tbest user is in the tbest and users groups only. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . permissions-wise. Oracle. The tbest user cannot access that file at all. and its group is root. An “s” appears in the executable bit position. based on the fact that the requesting user is root and the requesting group is oinstall. That is.conf file is made based on the fact that the requestor is the root user. This is because the decision to allow access to the /etc/xyz. For example. -r-sr-s--1 root oinstall 0 Jul 1 2005 oradism oradism SETUID SETGID tbest xyz. it will be run using the permissions of the user or group that owns it. It indicates that as this program is invoked.

There are at least four different shells in the default EL installation. that are not available in the Bourne shell. oidca. and is compiled. A first line of #!/bin/sh indicates that the script uses the Bourne shell. • bash is the Bourne-again shell: – It is Bourne shell compatible.Choosing a Shell There are many shells available for Linux: • Oracle shell scripts are Bourne shell scripts. Choosing a Shell Linux has many popular features. • Most shell scripts specify the shell that is required. • The C shell is preferred by many. The C shell has many user-friendly features. bash. use the echo $0 command. The Bourne-again shell. The Korn shell is a superset of the Bourne shell with command history. Some Oracle installation actions require a Korn shell such as the Oracle Internet Directory configuration script. • The working-level shell is a matter of preference. The C shell was the BSD UNIX shell. But the C shell was interpreted.6 . Most Oracle shell scripts specify the shell that is required in the first line of the script. It is intended to be POSIX compliant. One of the most popular features is that the user interface can be easily customized. such as command history. Copyright © 2007. is the standard shell that the Oracle database uses for scripting. On Linux. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . and not compiled like the Bourne shell. and is consequently slower. Oracle. – It is POSIX compliant. /bin/sh is usually a link to the Bourne-again shell (bash). was written to be Bourne shell compatible. with features of both the Korn and C shells. • Korn is a superset of Bourne: – The Korn shell is required for certain actions. All rights reserved. one of the first shells that was available on AT&T UNIX. To view the shell that you are currently in. The Bourne shell.

cshrc. Example: For the bash shell.login script does not need to be edited for ordinary use with the oraenv script. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . In each shell. .profile. Setting Environment Variables Each shell has a specific syntax for setting an environment variable.bashrc. and then execute '. • The C shell runs . The Oracle environment variables must be set in the last script to run in each case. do a chmod 755 so that it can be executed. This has the advantage that after installation the .profile. All rights reserved.7 . • Bourne. and bash shell syntax: ORACLE_SID=orcl. For example. and . must be set at each login.Setting Environment Variables The shells have specific syntaxes for setting environment variables.bash_profile. • The Bourne shell runs . export ORACLE_SID • C shell syntax: setenv ORACLE_SID orcl Copyright © 2007. The environment variables are session specific and. create a file instenv with the environment variables. • The bash shell runs . there are specific login scripts that are executed. therefore./instenv' to run the script without forking a new shell. The most common syntax for each shell and an example for the ORACLE_SID variable are shown.bashrc or . • The Korn shell runs .kshrc.bashrc script. Korn.profile and .login and . . set ORACLE_SID in the . Oracle.bashrc and source it in the shell that will be running the installer. Oracle Support recommends that you create a shell script in the same format as.

by default.8 . place a line as shown below: umask -S u=rwx. umask is set to u=rwx. For EL. Oracle. • View the mask with umask -S. • Set the mask with umask -S u=rwx. The example above indicates that the files that are created have permissions set as follows: read.g=rx. and read and execute permissions for the other (o). and execute a file. execute for the owner (u).o=rx. All rights reserved.o=rx. The umask must be verified before running the Oracle Universal Installer (OUI) and set for the oracle user in the .bashrc script for the oracle user. Copyright © 2007. For example.g=rx. 022 is the equivalent of the above example. In the . But if it is not set to this value. write.bashrc file. it can be changed. The two bits that are on in the octal value represent the only two permissions that are not allowed: write for group and write for other. read and execute permissions for the group (g).o=rx The umask can optionally be specified as an octal value.User File Creation Mask Every file that a user creates has a set of permissions controlled by a mask. write. User File Creation Mask Every file that is created by a user receives a default set of permissions. The permissions determine who can read. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 .g=rx. which specifies which permission bits should be off.

Setting Oracle Environment Variables For the oracle user. you must set the following shell variables before the installer is run: • DISPLAY (required) – Location of the X Window System server • PATH (required) – Location of the OS linker and compiler – Location of the Oracle database executables Copyright © 2007. then set it in the . then the DISPLAY is usually set properly in login scripts. Setting Oracle Environment Variables Only two shell variables need to be initialized before the installer is run: the DISPLAY variable and the PATH variable. If it is not. It adds $ORACLE_HOME/bin to the end of the existing PATH variable. The DISPLAY variable must be set to the location of the X Window System server. If X-based terminal windows are being used. Usually. Oracle. base PATH is set to /usr/bin:/bin:/usr/bin/X11R6:/usr/local/bin by default. After the installation.bashrc file. If the '$ORACLE_HOME' string is used instead of a full path to set the PATH variable. the PATH variable for any database user on Linux can be set by using the supplied oraenv script.9 . Before installation. then the ORACLE_HOME variable must be set before its use. set the PATH variable manually or with a script in the shell where the Oracle Installer is invoked to include the $ORACLE_HOME/bin directory. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . All rights reserved. Other variables can be initialized to facilitate the installation.

10 . The methods described here are the basics of OFA. All rights reserved. You can use OFA to: • Distribute files across multiple mount points: – Balance I/O for performance – Increase reliability • Handle large and growing directories • Administer multiple releases Copyright © 2007.Optimal Flexible Architecture Optimal Flexible Architecture (OFA) was introduced to optimize the relationship between the database files and the host operating system. For details about the goals and implementation of OFA.2) for Linux x8664. OFA makes use of the operating system (OS) and disk subsystems capabilities to create an easy-to-administer configuration that allows maximum flexibility for growing and high performance databases. Optimal Flexible Architecture Optimal Flexible Architecture (OFA) is a method for configuring the Oracle database and other databases. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . Oracle. refer to the Oracle Database Administrator’s Guide 10g Release 2 and the Oracle Database Installation Guide 10g Release 2 (10.

Oracle. • Safeguards Against Drive Failures: By distributing applications across more than one drive. • Distributed I/O loads: I/O loads are distributed across enough disk drives to prevent performance bottlenecks. • Distribution of Oracle home directories: The collection of home directories. or delete login home directories without having to revise programs that refer to them. move. you do not require new hardware to implement the Optimal Flexible Architecture standard. creating databases. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . OFA Characteristics The OFA characteristics translate into specific recommendations for the management of database files. They are listed here: • File system organization: The file system is organized to enable easy administration and to facilitate adding data into existing databases. and the structure of the host file systems and directory structure. All rights reserved. and adding hardware. • Hardware support: In most cases. the contents of each individual home directory can be distributed across disk drives. drive failures affect as few applications as possible. and further. • Integrity of login home directories: You can add. adding users.OFA Characteristics Copyright © 2007.11 .

• I/O loads tuned across all drives: I/O loads are tuned across all drives. • Supports concurrent execution of application software: You can run multiple versions of Oracle software simultaneously. enabling you to test and use a new release before retiring the previous release.Control files. including drives storing Oracle data in either Automatic Storage Management disk groups or in raw devices.Database files are easy to distinguish from other files . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . redo log files. • Separate administrative information for each database: The ability to separate administrative information for each database ensures a reasonable structure for the organization and storage of administrative data. and data files can be identified as such .The association of data file to tablespace is clearly indicated • Separation of tablespace contents: Tablespace contents are separated to minimize tablespace free space fragmentation. and maximize administrative flexibility.OFA Characteristics (continued) • Independence of UNIX directory subtrees: Categories of files are separated into independent UNIX directory subtrees so that files in one category are minimally affected by operations on files in other categories.12 . Transferring to a new release after an upgrade is simple for the administrator and transparent for the user. • Consistent database file naming: Database files are named so that: .Files belonging to one database are easy to distinguish from files that belong to another database . minimize I/O request contention.

Each partition requires a mount point. disks can be very large. m is a unique identifier (2 to 4 digit number). For example. The Oracle Installer requests two directories. that is. the database requires two mount points: • Mount points are listed in /etc/fstab. you do not want to neglect your Oracle database files just because they were stored under a mount point called /backup01.” Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . Note: The usage of Automatic Storage Management (ASM) eliminates many of the concerns about mount points.Mount Points To be OFA compliant. then a later upgrade may result in a name that is deceptive. if you choose a name that corresponds to a particular disk controller. The installer does not know if you are supplying mount points or directories. The naming of the database software directory was performed when you created the ORACLE_HOME environment variable. In the original OFA. the concept of a mount point almost always referred to a single physical disk. it is usually a good idea to avoid names that map to hardware. ASM is covered in detail in the lesson titled “Automatic Storage Management and Automatic Storage Management Library Driver. • Examples: – /u01 – /u02/oradata/orcl – /sales01 Copyright © 2007. For example. All rights reserved. q indicates Oracle database files (default oradata). In today’s environment. db is the database name. Although there are many correct names that you can use. and they are partitioned to useful sizes. • Name mount point /pm or /pm/q/db. – – – – p is a string. You should not use names that suggest that a mount point is devoted to one application’s data unless it is true. It is much easier to separately track hardware to logical name mappings. Mount Points A database that is fully OFA compliant has at least two mount points: one for the software and at least one for database files. Oracle.13 ra O le c le ac r O ly l & On na se er U nt I c A de a y m . each disk had one mount point.

It identifies the directory that has the proper release distribution and binaries for the database.2.0/db_1 Copyright © 2007. and those scripts continue to work on other machines or reconfigured machines and possibly on other releases of the database. The directory does not have to exist but the directory structure above it must exist and be owned by the user named oracle. It can be used by shell scripts that you create. your data files and administration files are located below this point. ORACLE_BASE=/u01/app/oracle ORACLE_HOME=$ORACLE_BASE/product/10.2. The ORACLE_HOME variable is typically in the following ORACLE_BASE directory: ORACLE_HOME=$ORACLE_BASE/product/10. Typically.ORACLE_HOME and ORACLE_BASE These are directories to implement an OFA-compliant installation. Oracle. ORACLE_HOME and ORACLE_BASE What Is ORACLE_HOME Used For? The ORACLE_HOME directory is used by any user who wants to use the particular database.14 . it can be set during the installation process. It also identifies the default location of the parameter file that launches the database. What Is ORACLE_BASE Used For? The ORACLE_BASE directory is typically a higher-level directory than ORACLE_HOME. This allows shell scripts to be created that are not dependent on the particular tree structure. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . All rights reserved.0. The ORACLE_HOME variable does not have to be preset as an environment variable.

The ownership of the directory must be assigned to the oracle user and the oinstall group. Following the examples in previous slides. Oracle. The ORACLE_HOME directory is successfully created by the OUI as long as the permissions on the ORACLE_BASE directory are correct. Repeat this procedure for the directories that are designated to hold database files.2. use the command chown oracle:oinstall /u01/app/oracle.Creating the Oracle Directories ORACLE_BASE /u01/app/oracle product flash_recovery_area oradata <version> ORACLE_HOME /u01/app/oracle/product/10. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 .15 . All rights reserved. Creating the Oracle Directories The ORACLE_BASE directory must be created by root.0/db_1 Copyright © 2007.

0 /u02/app/oracle/product/9. You must store only the files that are installed by the OUI in the ORACLE_HOME directory.Installing New Releases • Provide a separate tree for each release. This tree is deleted after an upgrade (when it is no longer in use).0 • Maintain the /etc/oratab file. which lists the existing ORACLE_HOME directories. change the oratab file so that users find the proper ORACLE_HOME directory.0: prod:/u05/app/oracle/product/10.2. where: – h is the ORACLE_BASE directory – v is the version identifier or release number Example: — — /u05/app/oracle/product/10. All rights reserved.0:Y When the 9. Each instance on a machine specifies the release that it uses in the /etc/oratab file.2. Therefore.2. As new releases are added.2. the release directory should contain only files that are specific to that release.0 database is removed. to move prod to 10.0:N When a database is upgraded to use a different release. Oracle.16 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 .0:Y dev:/u05/app/oracle/product/10. Copyright © 2007.2.2. For example: prod:/u02/app/oracle/product/9. For example. Installing a new release often results in multiple databases running under different releases.2. • Place releases in a directory named h/product/v. the directory is no longer needed and can be removed. Installing New Releases Each new release gets its own directory. the old release directories can be removed.

• Use Oracle-supplied scripts to set the environment. remaining users switch to using the new release after your applications have been determined to be stable there. An upgrade from one version of the Oracle Database to another can be very difficult if not planned properly. Simply installing to ORACLE_HOME is not sufficient. One common problem involves setting the user environment to access a particular database. Oracle. For example. This is especially true during the period when multiple versions of the database software are on the system.Managing Multiple Versions Set the user environment when several versions of the database software exist on the same machine. and possibly several databases on the same machine are running from different ORACLE_HOME directories. oraenv ORAENV_ASK= Copyright © 2007. PATH=/usr/bin:/bin:/usr/bin/X11/:/usr/local/bin ORACLE_SID=orcl ORAENV_ASK=NO . Later. All rights reserved. but without the proper version of supporting software libraries defined in ORACLE_HOME. These problems and the solution on the following page apply only to users that have OS logins on the database server machine. Managing Multiple Versions You may want to update from your installed version of the Oracle Database to the current release. a small group of users or developers use the new release initially. You should have a plan to allow easy configuration for multiple database users. the program will usually fail. This requires that you can run multiple releases simultaneously. Often. Another problem has to do with providing proper support libraries for executables. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 .17 . • Use generic login scripts. you can execute a program such as SQL*Plus from a different directory.

which looks up the ORACLE_HOME associated with the ORACLE_SID in the /etc/oratab file. If the ORAENV_ASK variable is not set.18 . the login script would be . returning to the calling shell. Without the source command. and presents a default of ORACLE_SID in the user’s environment. the script executes and exits. In that case. then oraenv does not prompt the user.' command sources the oraenv script. Korn. A call to the Oracle-supplied oraenv script from the login script finds and sets the proper ORACLE_HOME and other site-specific. the user is asked to provide ORACLE_HOME for the SID. coraenv is provided for C shell users. The default location is /usr/local/bin. If ORAENV_ASK is set to anything other than NO (including a blank). then the user will be prompted. In the slide. required environment variables. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . causing it to run in the current shell. without requiring user interaction. such as the instance SID that the user accesses. This makes the switching over of all users to a different ORACLE_HOME much simpler. dbhome. the DBA can modify oraenv and alter all the users’ environments without changing every login script. This is a convenient way for users to change their environments or access multiple databases. For the bash shell. Generic Login Script Each user should have a login script that includes only the environment variables that are specific to that user. The oraenv script calls another script. The login script that is used depends on the user login shell. setting ORACLE_SID and ORAENV_ASK=NO in .Managing Multiple Versions (continued) The solution is to embed a call in each user’s login script to a separate file that determines the environment for the user’s preferred database.sh script at installation. then the oraenv script prompts the user for ORACLE_SID that the user wants to set. Bourne. The oraenv script should be customized for each site. If ORAENV_ASK is set to NO. and bash shell users can use the oraenv script.bashrc sets a default environment for this user. An example of calling oraenv from a login script is: PATH=/usr/local/bin:/$PATH ORACLE_SID=orcl export PATH ORACLE_SID ORAENV_ASK=NO . If the site requirements change. Other variations can be set to suit your environment. oraenv ORAENV_ASK= Note: The '.bashrc. but sets ORACLE_HOME and other variables unless ORACLE_SID is set to a value not specified in the /etc/oratab file. oraenv The oraenv script is provided with the database software and is relocated by the root. This allows the oraenv script to set environment variables in this shell. the parent forks a new shell.

used for servers with multiple network cards • ORACLE_DOC: The location of Oracle documentation • LANG: System language Copyright © 2007. You can set the ORACLE_SID in the Database Creation Wizard. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . there will be a root directory for all the Oracle software and database files. All rights reserved. and the TMP variable to redirect the commands that would normally use the /tmp directory. The ORACLE_BASE variable is set to reduce typing errors during the installation. The default directory is $ORACLE_HOME/ocommon/nls/admin/data. and the OS commands that are run by the installer can use an additional 100 MB of space.nlb message files and character set files are placed in a directory other than the default directory. ORA_NLS10 is required to be set only if the . The OUI can use up to 400 MB of space in the /tmp directory. If there is not enough space in /tmp. Setting Oracle Environment Variables In an OFA-compliant installation. This directory must exist and be owned by oracle with group dba before the installer is started. ORACLE_DOC is an optional environment variable that is used to specify the installation location of the Oracle online documentation. This often has the form of /<mount_point>/app/oracle and is $ORACLE_BASE.19 . then use the TMPDIR variable to direct the OS commands to use an alternative directory.Setting Oracle Environment Variables Additional optional environment variables: • ORACLE_BASE: The root of the Oracle software directory structure • ORACLE_SID: The initial instance name • ORA_NLS10: The location of the character set files • TMPDIR and TMP: An optional location for temporary space if required • ORACLE_HOSTNAME: The name of the host on which to install the software.

Setting Oracle Environment Variables (continued) LANG is a mandatory system environment variable that may optionally be changed for the Oracle user. the LANG variable will be set to something like en_US. the character set (utf8) should be omitted so that the environment variable is just en_US. For the oracle user. including the abilities to: • Store preferred credentials • Run jobs • Access reports LD_LIBRARY_PATH specifies the path to C libraries. that path normally includes the system default (/usr/lib and /usr/X11R6/lib). Normally. Failure to set this variable for the oracle user will limit Oracle Enterprise Manager functionality. as well as the following: • $ORACLE_HOME/jdk/jre/lib/i386 • $ORACLE_HOME/jdk/jre/lib/i386/lib • $ORACLE_HOME/rdbms/lib • $ORACLE_HOME/lib ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . For the oracle user.utf8 when you install your operating system.20 .

including the navigator. close the navigator. The current CD-ROM cannot be unmounted or ejected if any process. 2. Insert the CD-ROM marked Disk 1. Do not make your working directory the CD mount point. Mounting the CD-ROM Log in as the Oracle software owner. If a file navigator is displayed. During the installation. is accessing it. the second and third CD-ROMs will have to be mounted. This allows faster installations and network installations. All rights reserved. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . perform the following steps: 1.21 .Mounting the CD-ROM To mount the CD-ROM with the Oracle software. Oracle. Insert CD into the CD drive on the server. The commands to mount and unmount a CD-ROM are: # mount -t iso9660 /dev/cdrom /media/cdrom # umount /media/cdrom If /etc/fstab has the default settings for mounting /dev/cdrom. then the mount command can be simplified to the following: # mount /media/cdrom ra O Staging the CDs On machines that have sufficient disk space. the CD-ROMs can be copied to disk. Click the CD-ROM icon or start the User Mount tool. another terminal session logged in as root may be needed to mount and unmount the CD-ROM. Start the User Mount tool or click the CD-ROM icon. Copyright © 2007. Depending on your access privileges.

issue the runInstaller command. Using the oracle user created previously.Starting the Installer • Start the OUI from the user’s home directory.22 . Do not run the runInstaller command from the CD-ROM mount point. Starting the Installer The cd command with no arguments changes your working directory to your $HOME directory. If you do. Oracle. All rights reserved. you will not be able to eject and insert the CDs when requested by the Oracle Universal Installer (OUI). ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . • At the prompt. $ cd $ pwd /home/oracle $ /media/cdrom/database/runInstaller Copyright © 2007. this would be /home/oracle.

If there are prior Oracle installations on this server. You must go to a separate window as root and run this script. then the /etc/oraInst. do not remove the oraInst.loc file. You require this file for removal or upgrading. you are prompted to do the following: 1. After the Welcome screen and before the File Location screen. 2. If the installation fails after this script is run. Provide the Inventory Location. so it is the same across all platforms that Oracle supports. contact Oracle Support. The oraInst. All rights reserved.23 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . Run the two specified scripts. 3.loc file contains a pointer to the location of the inventory and the ORAINVENTORY group name. Provide the Linux Group for the Oracle Inventory user.loc file must be removed for successful reinstallation. Oracle. Oracle Universal Installer The Oracle Universal Installer is Java based.Oracle Universal Installer Copyright © 2007. This defaults to $ORACLE_BASE/oraInventory. Follow the instructions in the pop-up window.

Oracle. All rights reserved..0. Copyright © 2007.log installActions2005-07-07_01-42-01AM.2.. All rights reserved.2.1. Starting iSQL*Plus .0/db_1/bin/isqlplusctl start iSQL*Plus 10.Installation Log Files The log files for the Oracle Universal Installer are in this directory: $ORACLE_BASE/oraInventory/logs $ cd $ORACLE_BASE/oraInventory/logs $ ls *. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 .log INFO: Configuration assistant "Oracle Database Configuration Assistant" succeeded INFO: Command = /u01/app/oracle/product/10.0 Copyright (c) 2003. 2005. Oracle.24 .

25 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 .4-35. found binutils-2. found libaio-0. .Prerequisite Check Results The results of the installation prerequite checks are in this file: /u01/app/oracle/oraInventory/logs/results/db .2. Passed Check complete.3.96-3.14. .0.2.96.90. The overall result of this check is: Passed Copyright © 2007. Checking for binutils-2.3-42.14. Oracle. Passed Checking for gcc-3. Passed Checking for libaio-0.3. All rights reserved. found gcc-3.

There can be no other instance of OPatch or OUI running in order for OPatch to succeed. fuser is usually located in /sbin for Linux distributions and must be copied to the OPatch directory with operating system permissions changed so the Oracle user can execute it. • A Java Runtime Environment (JRE). OPatch updates the inventory to reflect interim patches. Oracle Patch Utility The Perl-based OPatch allows the application and rolling back of temporary patches. you must have: • Perl interpreter version 5.6 is preferred. • Exclusive control of the Oracle Inventory directory.Oracle Patch Utility Use OPatch to: • Apply other temporary patches • Roll back temporary patches • List installed Oracle components and temporary patches • Attach an installed ORACLE_HOME to a central inventory $ opatch apply . it can be found under the $ORACLE_HOME/OPatch directory.005_03 or later installed. OPatch is installed as part of the Oracle 10g Database installation. OPatch succeeded. Version 5.. Oracle. OPatch uses fuser to check that no Oracle database processes are running before it applies a patch. It is automatically installed with Oracle Database 10g Release 2.. All rights reserved.26 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . • Execute privileges on the fuser utility. Copyright © 2007. To install a patch with OPatch.

Apply temporary patches: Use the apply command to apply a temporary patch. This may be necessary if the Oracle Database software was transferred from one system to another without the inventory. which is a nonstandard. The optional -all argument may be used in place of the -oh argument to display the contents of ALL ORACLE_HOMEs registered with the inventory. then OPatch applies the patch to ORACLE_HOME defined by $ORACLE_HOME. You can add the optional flag –oh <ORACLE_HOME> if you want to remove the patch from a different ORACLE_HOME. unsupported installation method. use the –help argument: $ opatch –help $ opatch attach –help ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . For help on any of the OPatch commands. Attach an installed ORACLE_HOME to a central inventory: Use the attach command to add an ORACLE_HOME to an existing inventory. then OPatch looks for the patch in the current directory. OPatch removes the patch from ORACLE_HOME specified by the $ORACLE_HOME environment variable. If the <ORACLE_HOME> argument is not supplied. $ opatch apply <patch directory> <ORACLE_HOME> If the <patch directory> argument is not supplied. Remove temporary patches: Use the rollback command to remove a temporary patch that has been applied by OPatch. $ opatch attach –name <OH name> -oh <ORACLE_HOME> If ORACLE_HOME is not specified. $ opatch lsinventory –oh <ORACLE_HOME> -all The -oh <ORACLE_HOME> argument can be omitted if you want to display the inventory for the ORACLE_HOME defined by $ORACLE_HOME.Oracle Patch Utility (continued) You can use OPatch to: List currently installed components: Use the lsinventory command to list all installed components for your current ORACLE_HOME including any temporary patches already applied via OPatch. The patch ID and patch directory arguments are mandatory to remove a patch. $ opatch rollback –id <patch id> -ph <patch directory> By default.27 . then OPatch uses ORACLE_HOME defined by $ORACLE_HOME.

but must be performed manually when: • An OS upgrade has occurred • A change has been made to the OS system libraries. 2. rman. 3. Execute the appropriate relink command to relink the appropriate binaries: – – – – – relink all: All Oracle executables relink oracle Database executables relink network: Listener. This guarantees a reliable integration with functions provided by the OS system libraries. Oracle Relink Utility The Oracle Database 10g software is not distributed as a group of complete executables. This can occur during the application of an OS patch. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . tkprof. names relink oemagent: Intelligent Agent relink utilities: SQL*Loader. then Oracle executables should be relinked to create updated executables properly integrated with the operating system. Instead. cman. expdp. • A new installation failed during the relinking phase. If the operating system or Oracle object files change. Oracle. perform the following steps: 1. exp – relink ctx: Oracle Text Copyright © 2007. Explicit relink instructions are usually either included in README or integrated into the patch install script. and some source files which then get “linked” at the operating system level during installation to create usable executables. Verify whether ORACLE_HOME is correctly set. All rights reserved.28 . library archives of object files. Oracle distributes individual object files. Relinking occurs automatically when a patch set is installed. imp. impdp.Oracle Relink Utility To relink Oracle executables. • An individual Oracle patch has been applied. Set LD_LIBRARY_PATH to include $ORACLE_HOME/lib.

relink succeeded.Oracle Relink Utility (continued) To relink.29 . or manually relink with the make command. Unlike OPatch. Unless you receive an error message. you can use the relink utility as shown in the preceding slide. the relink utility does not return positive feedback. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 .

The OUI is very convenient to use. Kernel parameters errors. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 . and the installer environment cannot be changed while the installer is running. The only errors that cannot be fixed in this manner are the environment variables. or an OS error indicating that there is not enough shared memory or semaphores. fix the problem. The directory to be used as the ORACLE_BASE must exist and be owned by the user that is running the installer. Oracle. The C compiler and supporting utilities must be installed and the directory must be included in the PATH environment variable. and restart the installer. Environment variables can lead to a variety of errors again due to incorrect typing. These usually show up when the Database Creation Assistant tries to start an instance. then you must exit the OUI.Troubleshooting If you have problems during the installation: • Check the kernel parameter settings • Check the environment variables • Check directory permissions • Verify that the required packages are installed Copyright © 2007. often the result of typographic errors. If you discover that the problem is with environment variables.30 . The installer inherits the environment when it starts. change the variable. The error pop-up windows normally allow you to go to another window. can cause ORA-3113 End of File on communication channel. All rights reserved. and click Retry. Troubleshooting There are some common problems with the installation. Many are the result of missing a step in the preinstallation setup.

Oracle. you should have learned how to: • Describe the Linux file system security • Install Multiple versions of Oracle Database software on the same server • Accommodate multiple Oracle homes on one database server Copyright © 2007.31 . All rights reserved. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 3 .Summary In this lesson.

Practice 3 Overview: Installing Oracle on Linux
This practice covers the following topics: • Working with Linux users and groups • Installing Oracle on Linux

Copyright © 2007, Oracle. All rights reserved.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 3 - 32

Managing Storage

Copyright © 2007, Oracle. All rights reserved.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Objectives

After completing this lesson, you should be able to: • Distinguish the differences between certified and supported file systems • Select a file system

Copyright © 2007, Oracle. All rights reserved.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 4 - 2

Certified and Supported File Systems
• Linux supports multiple file systems. • Oracle supports some of the file systems. • Oracle certifies three file systems:
– ext3 – Automatic Storage Management – Oracle Cluster File System/Oracle Cluster File System 2

• Criteria for choosing a particular file system are:
– Reliability – Performance – Security

Copyright © 2007, Oracle. All rights reserved.

ra O

Certified and Supported File Systems One of the most interesting features of the Linux OS is its support for multiple file systems. File systems can be defined and built on a partition basis; ext3, XFS, and ReiserFS file systems can coexist on the same Linux system, along with several other file systems and raw partitions. Your choice of which one to use should be based on supportability, reliability, security, and performance. To be acceptable for database use, the file system must perform certain minimum functions such as write acknowledge, write-thru cache, and file permissions. Examples of file systems that are not normally acceptable for database use are XFS, and Virtual File Allocation Table (VFAT), which lack file permissions. There is an important distinction between supported and certified file systems. Oracle only certifies ext3, Oracle Automatic Storage Management (ASM), and Oracle Cluster File System/Oracle Cluster File System 2 (OCFS/OCFS2). If it is determined that an issue is caused by the file system and the file system is certified, then Oracle Support will work on the issue. If you choose to run on other file systems, such as ReiserFS, and have a file system issue, you will be supported, but it will be the OS vendor providing the file system support.

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 4 - 3

Disk Partitioning

Linux uses disk partitions effectively to segregate directories and ease recovery: • /boot • / • /var/log • /tmp • /home • /<mount_point>/oracle

Copyright © 2007, Oracle. All rights reserved.

ra O

Disk Partitioning Disk partitioning is not required by Linux or by Oracle software. However, disk partitioning can reduce the time consumed in operations such as planning for recovery, upgrades, and backups. The larger the partition the longer a file system check (fsck) operation takes on bootup. Much of this time can be avoided by using a journaled file system, such as ext3. Having a small /boot partition that holds only the current kernels separates the tasks of booting the machine and recovering a partition. A typical size of this partition is from 10 MB to 100 MB. For Enterprise Linux, it is recommended that you have approximately 100 MB for the boot partition. The / partition should hold only a few directories that are created with the distribution installation. These directories are overwritten with a new installation or upgrade. (Keep track of any customized configuration files that you place under this partition, because they will also be overwritten during a new installation or upgrade.) The /var/log and /tmp should be separate partitions to isolate the effects of runaway processes. The /tmp partition should be at least 400 MB.

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 4 - 4

Disk Partitioning (continued) If these separate partitions become full, the process dies or stops logging. If these directories become full when they are on the / partition, the system can crash. If /home is a separate partition, it can be backed up and restored separately. An OS upgrade need not touch this partition.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 4 - 5

Comparing File Systems

Linux supports multiple file systems: • Operating system (OS) is file system independent. • Multiple file systems can be on the same server.
– Cross-platform compatibility – Performance – Special requirements: Oracle Cluster File System (OCFS)

Copyright © 2007, Oracle. All rights reserved.

ra O

Comparing File Systems The Linux kernel is file system independent. It has a file system API. If the file system uses the API, it can be supported. A variety of file systems are available with the standard distribution. Some are just for compatibility with other systems, such as FAT32 for MS Windows compatibility. Others are included for historical reasons, such as minix which was the first file system supported by Linux. The most popular file systems are ext3 and ReiserFS. There are other file systems available from various sources. Most of these should be considered experimental. Oracle provides Automatic Storage Management (ASM) and Oracle Cluster File System/Oracle Cluster File System 2 (OCFS/OCFS2). The OCFS is designed for use with Linux clusters running the Real Application Clusters (RAC) database. This file system overcomes the limitations of raw devices on Linux. OCFS2 has been designed to be a general purpose cluster file system. With it, you can store not only database-related files on a shared disk, but also store Oracle binaries and configuration files (shared Oracle home) making management of RAC even easier. OCFS2 began shipping as part of the Linux kernel in version 2.6.16. Oracle recommends using ASM for database files.

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 4 - 6

File System Characteristics

Certain characteristics are better for database use: • Write-thru-cache ability • Write acknowledgement • Security • Journaling • High Performance

Copyright © 2007, Oracle. All rights reserved.

ra O

File System Characteristics In choosing a file system, performance is important, but not the primary consideration. It does not matter how fast the file system is if the data is corrupted, lost, or compromised. To achieve this end, the Oracle database does not support database files on file systems that do not have a write-thru-cache capability. Supported file systems must acknowledge writes. There are security requirements as well. Oracle server and the database files require special file permissions that are not available on certain file systems. When these file permissions are not set correctly, the Oracle server does not function properly. Data files should be accessible only to the database owner, and all other access should be controlled by the database itself. Journaling is a popular characteristic. The major benefit is that the changes to the file system are recorded in a journal file similar to database redo logs. If the server crashes or shuts down without synchronizing the disks, then the journal file can be applied to the file system, thus restoring the file system integrity very quickly. This effect can be seen on bootup. The fsck command checks journaled file systems more quickly than nonjournaled file systems. Oracle Database must be able to verify that writes to a disk are completed successfully. Standard NFS, including file systems on NAS devices, may not be able to guarantee that writes to a disk are completed successfully, and this may lead to possible data file corruption.

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 4 - 7

8 .html If a storage device is supported. If you use NFS.oracle. This list is available from the following Web site: http://www.File System Characteristics (continued) Oracle recommends that you do not store files on standard NFS. then you can use it to store Oracle software files. or both. it is recommended you use a storage vendor and storage device listed in the Oracle Storage Compatibility Program list. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 4 .com/technology/deploy/availability/htdocs/oscp. Oracle database files.

Automatic Storage Management can be used with single instance or RAC. Managing multiple file systems and hundreds or thousands of files for a large database can be very cumbersome. ASM spreads database files evenly across available disks. With ASM. You need to manage only the disks. you assign large pools of disks in disk groups to ASM. All rights reserved. Oracle. not the files. Disk space can be added or removed while the database is online. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 4 . ASM enables you to nonintrusively add or remove storage.Automatic Storage Management • Provides a vertical integration of the file system and volume manager for Oracle database files • Spreads database files across available storage for optimal performance and resource utilization • Enables simple and nonintrusive resource allocation • Provides automatic rebalancing • Works in single instance and Real Application Cluster (RAC) databases Copyright © 2007. then allow ASM to manage the files stored on those disks. Automatic Storage Management Automatic Storage Management (ASM) provides an integrated file system and volume manager specifically for Oracle database files.9 .

data=writeback (the lowest) and data=ordered (the default). but do not seem to be faster. • ext3 is a journaled file system. ra O ext2 and ext3 The differences between the ext2 and ext3 file systems are important. In general. ext2 has. in computer terms. journaling is slower than nonjournaled file systems. would be expected to yield performance benefits at the expense of reliability. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 4 . where metadata with increased integrity is written. ext3. a long history of improvements and reliability. which does the least journaling. but preliminary results indicate that setting data=journal is the fastest and most reliable. but ext3 optimizes the disk head movement to give excellent performance. All rights reserved. ext3 has three journaling levels that may be set with the -o option in the mount command or in the options section of /etc/fstab. • ext3 can be mounted as an ext2 file system. In several tests that compared ext2. • ext3 has several performance enhancements. ext3 starts with the same base and adds journaling and speed. The other levels of journaling.ext2 and ext3 The ext2 and ext3 file systems are closely related: • ext2 can be converted to ext3.10 . The highest level—the one that does the most journaling is data=journal—writes the journal entries for all the data and metadata changes. The lowest level. Oracle. ext3 was the fastest. Comparing ext3 at different journaling levels has not been as thoroughly documented. ReiserFS. is data=writeback with only metadata being written. Copyright © 2007. The default is data=ordered. and raw.

All rights reserved.oracle.Oracle Clustered File System 2 Oracle Corporation makes OCFS2 available under the General Public License (GPL) for use with Linux. http://oss.oracle.11 .oracle. Oracle. Copyright © 2007.com.com. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 4 . Oracle Clustered File System 2 Oracle Clustered File System 2 (OCFS2) is designed to be a general-purpose cluster file system. and the Oracle Technology Network http://otn. as well as binaries and configuration files.com • More information about OCFS2 and other products from Oracle’s Linux Projects Development group can be found at Oracle’s home for Open Source projects. It can store data files. • OCFS2 is a general purpose cluster file system that shares between files nodes of a cluster: • OCFS2 can be downloaded from: — http://oss.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 4 .com/technology/deploy/availability/htd ocs/vendors_nfs.oracle.html • Oracle Storage Compatibility Program (OSCP) – http://www. Network File System Oracle supports only NFS protocol with network file servers.12 .html Copyright © 2007.oracle. All rights reserved. Oracle does not support CIFS protocol because CIFS protocol cannot guarantee certain write block size and data commitment to disk or cache. Members in OSCP test and verify their products compatibility with the Oracle product.Network File System • Oracle Compatible Network Attached File Servers – http://www. Oracle. Oracle does not recommend using an NFS device unless the NFS vendor is a member of the Oracle Storage Compatibility Program (OSCP).com/technology/deploy/availability/htd ocs/oscp.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 4 .13 . you should have learned how to: • Distinguish between certified and supported file systems • Choose a file system Copyright © 2007. All rights reserved.Summary In this lesson. Oracle.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m . All rights reserved.Automatic Storage Management and Automatic Storage Management Library Driver Copyright © 2007.

you should be able to: • Install and initialize Automatic Storage Management Library Driver (ASMLib) • Mark disks for ASMLib • Create an Automatic Storage Management instance Copyright © 2007. All rights reserved.2 .Objectives After completing this lesson. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 . Oracle.

Each disk device can be an individual physical disk. All rights reserved. An ASM instance must be configured and running before a database instance can access Automatic Storage Management files. Disk Group A disk group is a set of disk devices that ASM manages as a single unit. ASM spreads data evenly across all the devices in the disk group to optimize performance and utilization. if not identical. You can add or remove disk devices from a disk group without shutting down the database. in addition to regular file storage activities. disk groups consist of one or more individual physical disks. ASM rebalances the files across the disk group. such as backup and recovery operations. To enable ASM to balance I/O and storage efficiently within the disk group.3 . You can create multiple disk groups to handle specific tasks. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 . ra O Automatic Storage Management Instance The Automatic Storage Management (ASM) instance is a special Oracle instance that manages disks in disk groups. However. When you add or remove disks. in most cases.Automatic Storage Management • Instance • Disks • Disk groups • Files Copyright © 2007. or even a partition on a physical disk. you must ensure that all devices in the disk group have similar. a multiple disk device such as a redundant array of inexpensive disks (RAID) storage array or logical volume. This configuration is performed automatically if the Database Configuration Assistant is used for database creation. storage capacity and performance. Oracle.

All rights reserved. If you intend to use Automatic Storage Management for database storage for Linux. and use them to configure candidate disks. Oracle.4 . A disk that is configured for use with Automatic Storage Management is known as a candidate disk. Automatic Storage Management Library Driver (ASMLib) The Automatic Storage Management library driver (ASMLib) simplifies the configuration and management of the disk devices by eliminating the need to rebind raw devices used with ASM each time the system is restarted. then each disk device that you want to use must be bound to a raw device. If you do not use the Automatic Storage Management library driver.Automatic Storage Management Library Driver (ASMLib) • Simplifies configuration and management of disks • Eliminates the need for binding raw devices • Download RPMs from http://www. then Oracle recommends that you install the ASMLib driver and associated utilities.com Copyright © 2007.oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 .

Installing and Configuring ASMLib To install ASMLib.d/oracleasm enable Copyright © 2007. All rights reserved.com.d/oracleasm configure # /etc/init. typically dba. execute /etc/init. you need to download three RPMs from http://www. rpm –Uvh oracleasm* After the RPMs are installed. • Default user to own the driver interface • Default group to own the driver interface • Start Oracle ASM library driver on boot • Fix permissions of Oracle ASM disks on boot The user who owns the driver interface should be the same user who owns the software installation.oracle. After it is configured.Installing and Initializing ASMLib # rpm –Uvh oracleasm* Preparing… 1: oracleasm-support 2: oracleasm-2. install the RPMs with the Uvh option. After downloading. to enable ASM. /etc/init.d/oracleasm configure ra O You will be prompted four times. Oracle.EL 3: oracleasmlib ##################### ##################### ##################### ##################### [100%] [ 33%] [ 67%] [100%] # /etc/init. which are specific to your kernel.6.9-22. typically oracle. run the oracleasm utility with the enable option. You will want ASMLib to start when the system boots and to fix permissions of ASM disks.5 . The group to own the driver interface should be the group used for DBAs.d/oracleasm with the configure option. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 .

The partprobe command searches for partitions information and informs the kernel of partition table changes. Use either fdisk or parted to create a single whole-disk partition on the disk devices that you want to use. # /sbin/partprobe Copyright © 2007. Oracle. Configuring Disks Oracle recommends that you create a single whole-disk partition on each disk that you want to use.Configuring Disks Oracle recommends that you create a single whole-disk partition on each disk that you want to use. /sbin/partprobe ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 .6 . /sbin/fdisk /dev/sdc The kernel may be unaware of the partition changes after partitioning the disks. run the partprobe command after partitioning all disks. All rights reserved. # /sbin/fdisk /dev/sdc # /sbin/fdisk /dev/sdd To ensure that the kernel is aware of the partition changes.

Oracle. Disks are marked by using the createdisk option with /etc/init.7 .Marking Disks As Automatic Storage Management Disks # # # # /etc/init. When choosing names for drives. you will have an easier time assigning disks to disk groups when creating the ASM instance.d/oracleasm /etc/init.d/oracleasm: /etc/init. you must assign a name to the disk.d/oracleasm scandisks ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 . You may create multiple disk groups.d/oracleasm scandisks Copyright © 2007. In the process of marking a disk.d/oracleasm createdisk createdisk createdisk createdisk DF1 /dev/sda1 DF2 /dev/sdb1 FRA1 /dev/sde1 FRA2 /dev/sdf1 # /etc/init. All rights reserved. disks must be marked for ASM usage.d/oracleasm createdisk DF1 /dev/sda1 To make the disks available. use the scandisks option: /etc/init. consider using the physical location of the drive in the name.d/oracleasm /etc/init. By providing descriptive names to each disk. Marking Disks As Automatic Storage Management Disks When using ASMLib.d/oracleasm /etc/init. Meaningful names can be assigned for each disk.

Separate disk groups may be created for each. You then assign disks to disk groups within DBCA. • Create two disk groups: – Database – Flash recovery area Copyright © 2007. an ASM instance is created and started. Creating an ASM Instance An ASM instance manages ASM disk groups.8 .Creating an ASM Instance • Use DBCA to create the ASM instance. If you create multiple single-instance databases on a node. Before starting or creating a database instance. a single ASM instance can handle all the disk groups for the databases on the node. When you choose Automatic Storage Management as a database storage mechanism in the Database Configuration Assistant (DBCA).2. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 . Oracle. Oracle recommends that you use ASM for database files and the flash recovery area. which uses ASM to manage its disks. • Run the $ORACLE_HOME/bin/localconfig add command when prompted: $ su – # /u01/app/oracle/product/10. Note: Screenshots for using DBCA to create an ASM instance can be found in the lab solutions for this lesson in Appendix B. All rights reserved. • Select Configure Automatic Storage Management. the ASM instance must be running.0/db_1/bin/localconfig add • Default parameters for the initialization parameter file are sufficient for a single instance database.

• Create the ASM instance using the Database Configuration Assistant. Copyright © 2007. • Run oracleasm scandisks to make the disks available. • Run oracleasm configure.9 .ASM and ASMLib Installation and Configuration Summary • Download and install the ASMLib RPMs. Oracle. • Create a single whole-disk partition on each disk. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 . All rights reserved. • Run oracleasm enable. • Run partprobe to ensure that the kernel is aware of the new partitions. • Mark disks as Automatic Storage Management disks.

The ASM instance will manage storage for all databases on the node. Oracle. A separate ORACLE_HOME allows independent upgrades of the ASM and the database. Create only one ASM instance per node.ASM Installation: Best Practices • Install ASM in a separate ORACLE_HOME from the ORACLE_HOME database: – This provides higher availability and manageability. – It allows independent upgrades of the database and ASM. Creating the ASM Instance from the same ORACLE_HOME as the databases creates a single point of failure. All rights reserved. Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 .10 . – Deinstallation of the database software can be performed without impacting the ASM instance • Create one ASM instance per node. The database or ASM can be upgraded without upgrading the other. ASM Installation: Best Practices Install Automatic Storage Management in a separate ORACLE_HOME from the ORACLE_HOME(s) database. The ORACLE_HOMEs database can be deinstalled without affecting the ASM instance.

Automatic Storage Management performs load balancing. using two will be easier to manage. However. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 . Disk Group: Best Practices Create two disk groups: one for the database area and the other for the flash recovery area.11 . more disk groups can be created. Using disks with the same size and performance characteristics will assist ASM to properly balance the files across the disks.Disk Group: Best Practices • Create two disk groups: – Database area – Flash recovery area • Create disk groups using large numbers of similar type disks: – Same size characteristics – Same performance characteristics Copyright © 2007. Oracle. All rights reserved.

12 . you should have learned how to: • Install and initialize ASMLib • Mark disks for ASMLib • Create an ASM instance Copyright © 2007. All rights reserved. Oracle.Summary In this lesson. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 .

13 .Practice 5 Overview: Installing and Configuring ASMLib and ASM This practice covers the following topics: • Installing Oracle ASMLib RPMs • Configuring ASMLib • Configuring disks • Marking disks for ASM • Creating an ASM instance Copyright © 2007. All rights reserved. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 5 . Oracle.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

Oracle. All rights reserved.Creating the Database Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 .Objectives After completing this lesson. All rights reserved. you should be able to: • Create an Oracle database that uses ASM • Identify the location of various Oracle files • Implement OS authentication Copyright © 2007. Oracle.2 .

Oracle. either in silent mode or via a graphical interface. and the storage mechanism to use.3 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . Some of the questions are regarding the name of the database. and then the creation process starts. Using the graphical interface. you answer about 12 questions. All rights reserved.Creating a Database $ dbca Copyright © 2007. Creating a Database You can use DBCA to create a database. passwords for users.

then there must be an ASM instance running at the time.” If you choose Automatic Storage Management.Choosing the Storage Mechanism Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 .4 . Oracle. Choosing the Storage Mechanism You have three options for your database’s storage: File System. These options are explained in detail in the lesson titled “Managing Storage. Automatic Storage Management (ASM). All rights reserved. and Raw Devices.

then you are presented with a list of existing ASM disk groups. Oracle. In this case.Specifying the ASM Disk Groups Copyright © 2007. All rights reserved. so both are selected.5 . Select the disk groups that you plan to use for this database. for example. you may intend to use DF for the data files and FRA for the flash recovery area for this database. there are two disk groups displayed: DF and FRA. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . In the example in the slide. Specifying the ASM Disk Groups If you choose ASM for the storage mechanism.

After specifying that. you can specify if there is a flash recovery area. Oracle.Assigning ASM Disk Groups Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . All rights reserved. In this example. This example is following the Oracle-recommended practice of having a separate disk group for the flash recovery area. Assigning ASM Disk Groups Now that dbca is aware of the ASM disk groups that are to be used for this database. and the +DF disk group is to contain those files. OracleManaged Files is being used. you can assign them to be used for database file locations and the flash recovery area.6 . and where it is to be stored.

during and after the creation of the database: • Creation of the database objects • Configuration of Enterprise Manager • Importing of example schemas Copyright © 2007.7 .01 via conventional path About to import transportable tablespace(s) metadata.02. import done in US7ASCII character set and AL16UTF16 NCHAR character set .0 . which shows the log of the import of the EXAMPLE tablespace: $ head tts_example_imp. Oracle. importing SYS's objects into SYS . importing HR's objects into HR ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 .Production With the Partitioning.dbca Log Files The $ORACLE_HOME/cfgtoollogs/dbca/<SID> directory contains text log files of the following.2.1.0.log Connected to: Oracle Database 10g Enterprise Edition Release 10.. Here are some sample contents of the tts_example_imp. All rights reserved. OLAP and Data Mining options Export file created by EXPORT:V10.. you can navigate to the $ORACLE_HOME/cfgtoollogs/dbca/<SID> directory and view the log files there.log file. using a text editor. importing SYS's objects into SYS . dbca Log Files To see the details of the dbca execution.

Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . called +ASM. The slide shows there are two instances in this case. All rights reserved.The Instance admin Directory The files that serve as diagnostics are located in $ORACLE_BASE/admin: $ cd $ORACLE_BASE/admin $ ls +ASM orcl The orcl database instance The ASM instance There is a subdirectory for each instance.8 . The Instance admin Directory In the $ORACLE_BASE/admin directory. orcl. Oracle. the ASM instance. and the conventional database instance. there is a subdirectory for each instance.

Here is an example of the contents of two of the subdirectories: $ ls -l * +ASM: total 16 drwxr-x--drwxr-x--drwxr-x--drwxr-x--orcl: total 24 drwxr-x--drwxr-x--drwxr-x--drwxr-x--drwxr-x--drwxr-x--- ra O le c le ac r O ly l & On na se er U nt I 2 2 2 2 oracle oracle oracle oracle oinstall oinstall oinstall oinstall 4096 4096 4096 4096 Sep Sep Sep Sep 26 25 26 26 2 2 2 2 2 2 oracle oracle oracle oracle oracle oracle oinstall oinstall oinstall oinstall oinstall oinstall 4096 4096 4096 4096 4096 4096 Sep Sep Sep Sep Sep Sep 26 26 26 26 26 26 c A de a y m 05:38 08:16 05:13 05:38 bdump cdump pfile udump 06:05 05:39 05:16 05:16 05:26 05:39 adump bdump cdump dpdump pfile udump Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . These can be referred to when looking for information such as trace files and core dumps. Oracle. among other things.Parameter and Dump Files The following subdirectories are in the $ORACLE_BASE/admin/$ORACLE_SID directory: • adump: Audit files • bdump: Background process trace files • cdump: Core dump files • udump: User process trace files • dpdump: Default Data Pump output directory • pfile: Oracle database initialization parameter files Copyright © 2007. All rights reserved. Parameter and Dump Files There is a set of diagnostic directories under each of these instance subdirectories.9 .

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 .ini file contains all of the port number information for Oracle-related applications. The portlist.The portlist.10 . including: • iSQL*Plus • Enterprise Manager Console $ cd $ORACLE_HOME/install $ cat portlist. this portlist.ini File The portlist.ini file is in the $ORACLE_HOME/install directory and contains the record of port numbers that are used for browser-based applications. Oracle. For example.ini File The portlist.ini file indicates that 1158 is the port number for Enterprise Manager Console for the orcl instance.ini iSQL*Plus HTTP port number =5560 Enterprise Manager Console HTTP Port (orcl) = 1158 Enterprise Manager Agent Port (orcl) = 3938 Copyright © 2007. All rights reserved.

enter the following command as the owner of the Oracle software installation (for example. All rights reserved. oracle): $ emctl start dbconsole ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . iSQL*Plus URL: http://EDRSR9P1:5560/isqlplus iSQL*Plus DBA URL: http://EDRSR9P1:5560/isqlplus/dba Enterprise Manager 10g Database Control URL: http://EDRSR9P1:1158/em http://EDRSR9P1:1158/em http://EDRSR9P1:1158/em Copyright © 2007.11 .URL Deployment Information $ cd $ORACLE_HOME/install $ cat readme.txt file in the $ORACLE_HOME/install directory lists the URLs for any J2EE applications that have been deployed.txt The following J2EE Applications have been deployed and are accessible at the URLs listed below. URL Deployment Information The readme. To start the Enterprise Manager Database Control application. Oracle.

If Oracle products have already been installed on the system. located in the $ORACLE_HOME/bin directory. oraenv ORACLE_SID = [orcl] ? <Enter> Show the current ORACLE_HOME directory setting: $ dbhome /u01/app/oracle/product/10.loc inventory_loc=/u01/app/oracle/oraInventory inst_group=oinstall Set up the Oracle environment: $ .0/db_1 Copyright © 2007. This directory gets created automatically when using the Oracle Universal Installer (OUI). but it must be created and populated manually if you are performing a silent installation. Oracle. All rights reserved. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . sets up your Oracle environment for you based on the value of ORACLE_SID.loc file contains a pointer to the Oracle software inventory directory.2. Miscellaneous Files The /etc/oraInst. It also specifies the Linux group name that owns the Oracle software. and it does not already exist. The oraenv script.Miscellaneous Files Show the record of installations on this system: $ cat /etc/oraInst.12 . The dbhome script reports the current Oracle home directory. This is useful to run if you need to switch from one database to another on the same system. then it exists already.

Background Processes There are several processes that make up the executable part of an Oracle instance. . So. All rights reserved. The ASM instance process names all start with _asm and end with the string _<SID>. So. You can list these in Linux by issuing the ps command. if you are interested in the orcl instances processed. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . Copyright © 2007.Background Processes $ ps -eo pid -o command | grep _orcl | grep ora_ 3900 ora_pmon_orcl 3902 ora_psp0_orcl 3904 ora_mman_orcl 3906 ora_dbw0_orcl 3908 ora_lgwr_orcl 3910 ora_ckpt_orcl 3912 ora_smon_orcl 3948 ora_q001_orcl 14072 ora_o000_orcl 21647 ora_j000_orcl . grepping as shown in the slide shows you that. Oracle. you can use grep to filter the information out. Just listing all processes will be too much information. if you want to see only the processes that belong to a single instance.13 . All the database instance process names start with the string ora_ and end with the string _<SID>. . . So. . the following command shows you the processes for the +ASM instance: $ ps -eo pid -o command | grep _+ASM | grep asm_ 6985 asm_pmon_+ASM 6987 asm_psp0_+ASM 6989 asm_mman_+ASM 6991 asm_dbw0_+ASM 6993 asm_lgwr_+ASM .

program from v$process 2 where program like '%(DBW0)' or 3 program like '%(LGWR)'. this is referred to as the PID. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . SPID -----3908 3906 PROGRAM ---------------------oracle@EDRSR9P1 (LGWR) oracle@EDRSR9P1 (DBW0) $ ps -eo pid -o command | grep _orcl | \ > grep -e lgwr -e dbw0 3906 ora_dbw0_orcl 3908 ora_lgwr_orcl Copyright © 2007. Oracle. or in Linux. All rights reserved.14 . Background Processes (continued) After the instance is run.Background Processes SQL> select spid. The SPID column of the v$process view contains the OS process ID. you can map the process IDs from the v$process view to the process IDs listed by OS commands.

That is because it came through the listener. You can see server processes appear and disappear from the Linux process list. all the server processes are named with this pattern: “oracle<SID>”. Server Processes In an instance that is running in dedicated server mode. In the example in the slide. there are two sessions. The server process for that session is 5112. refer to the Oracle Database Administrator’s Guide.15 . called dispatchers. as sessions are created and disconnected. with the purpose of executing commands and returning results. in this case. A server process is the process that gets started that is dedicated to accessing the data files on behalf of a database session. all the server process names are oracleorcl. Then another SQL*Plus session was established. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . which resulted in process 4422 being spawned. So. ra O Note: For shared server mode. where the instance name is orcl. this time without using a service name. Oracle. On Linux. Note that the argument says LOCAL=NO. there is a one-to-one correspondence of session to server process. For more information about shared server mode. and there is no longer a one-to-one correspondence of session to server process. and the argument indicates that LOCAL=YES. there are other processes involved. All rights reserved.Server Processes $ sqlplus hr/hr@orcl SQL> $ sqlplus hr/hr SQL> $ ps kpid -eo pid -o args | grep oracleorcl 4422 oracleorcl (LOCAL=NO) 5112 oracleorcl (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) 5120 oracleorcl (LOCAL=NO) 24673 oracleorcl (LOCAL=NO) 24675 oracleorcl (LOCAL=NO) 24677 oracleorcl (LOCAL=NO) 25270 oracleorcl (LOCAL=NO) 25293 oracleorcl (LOCAL=NO) Copyright © 2007. One was started with a service name specifier.

which is the SQL*Plus process. You can continue to follow the process hierarchy until you get to the init process. which started the operating system at boot time. The SQL*Plus program was invoked from inside the bash shell (running in the Gnome windowing system). identified by a process ID of 18557. So. This can be observed in Oracle Database processes if you list the parent process IDs in Linux.Process Hierarchy PID PPID COMMAND 1 0 init [5] 6474 1 gnome-terminal 17664 6474 bash 18556 17664 sqlplus as sysdba 18557 18556 oracleorcl (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) Copyright © 2007. and the spawned process is referred to as the child process. The example in the slide shows the session details for a particular session that was created using SQL*Plus. So. the SQL*Plus process is the parent of the server process. the first process is referred to as the parent. Oracle.16 . in the ps listing. the database records the client process ID as 18556. All rights reserved. This process started the dedicated server process. which was invoked by the init process. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . Process Hierarchy When one process starts another process.

By default. 2. All rights reserved. Now. rather than the database requiring username and password information. allowing access to it. Implementing OS Authentication for DBAs Provisioning of access is the process of authenticating a user to the database. Create the needed OS accounts for users. you can log in. can connect to the database with “/ as SYSDBA” included in the connect string. A privileged user is granted the SYSDBA or SYSOPER privilege. Define the OSDBA and OSOPER operating system groups. as one of those users. named dba by default. including AS SYSDBA or AS SYSOPER in the connect string. Oracle. Set REMOTE_LOGIN_PASSWORDFILE parameter to NONE. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 . Any OS user that is a member of the OSDBA group. The database considers the OS to be trusted to provide the authentication service. The configuration shown is for privileged users and is configured by default when using the Oracle Universal Installer. that is. Copyright © 2007. 4. Operating system authentication is a type of access provisioning that imposes the operating system credentials onto the database. Assign those groups to the users you want authenticated. 3. and is implemented by doing the following: 1.Implementing OS Authentication for DBAs OS authentication is the provisioning of access to the database based on the OS username rather than a database username. the database is configured to allow certain users to connect without a password. allowing the database to discern access based on that.17 .

Oracle.Summary In this lesson. you should have learned how to: • Create an Oracle database that uses ASM • Identify the location of various Oracle files • Implement OS authentication Copyright © 2007. All rights reserved.18 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 .

Practice 6 Overview: Creating a Database This practice covers the following topics: • Creating a database that uses ASM storage • Interrogating the installation Copyright © 2007. All rights reserved. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 6 .19 . Oracle.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

Customizing Oracle on Linux Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m . All rights reserved. Oracle.

2 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . you should be able to: • Create automated startup/shutdown scripts • Automate tasks using scheduling tools • Configure Linux startup and shutdown sequence Copyright © 2007.Objectives After completing this lesson. Oracle. All rights reserved.

3 . The next few pages discuss how to start the Oracle database and related services automatically.Controlling Oracle Database After a server restart. In order for the database server to be used. All rights reserved. they must be started in one of the following ways: • Manually • Automatically Copyright © 2007. Depending on your needs you will want to start all or some of the following services: • Database Listener • ASM Instance • Database Instance • DB Console • iSQL*Plus These can be started manually through standard commands: • • • • lsnrctl start sqlplus “/ as sysdba” and then execute the startup command emctl start dbconsole isqlplusctl start ra O Or. all Oracle processes will be stopped by default. Controlling Oracle Database By default. the database instance and its related services do not start when the Linux server is started. they can be started automatically. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . Oracle.

BIOS initializes the hardware on the motherboard and much of the hardware that is attached to the motherboard in preparation for loading the actual operating system. BIOS resides in a ROM chip. ra O Linux Startup Sequence Although there are distribution-specific differences. As soon as the boot loader is found. this is where you are offered the chance to select which operating system [OS] will be used. There are other boot loaders available such as the Linux Loader (LILO). le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . which can load Linux.Linux Startup Sequence Kernel BIOS Copyright © 2007. The first step is to initialize the Built-In Operations System (BIOS). Oracle. When it finds a bootable device. but none as flexible as GRUB. The boot loader displays a menu of boot options from the MBR. (In a dual boot system. it checks the Master Boot Record (MBR) of that disk for a boot loader. BIOS will also look for a bootable device. usually on the system motherboard. Windows. most servers running Linux will start up basically in the same way.4 . BIOS loads the code into memory and passes control of the system over to the boot loader. and more.) It then uses the settings found in the MBR to load the selected operating system kernel. Enterprise Linux uses the GRand Unified Bootloader (GRUB). All rights reserved. searching in the order defined within the BIOS program.

rather there are links to the scripts.sysinit. In Enterprise Linux. then the init process would run scripts located in rc5. if you were to boot to runlevel 5 (the default). it checks /sbin and starts the init process.d. and what services are available.d/rc.Linux Startup Sequence (continued) After the kernel is loaded. you will find that the scripts are not actually in these directories. Here is where you become concerned as the administrator. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . which contains instructions telling the kernel to run a basic setup script that describes actions such as how to set the system clock. the init process continues reading /etc/inittab and makes its decisions on what to do next based on which of the seven runlevels you have booted to.d with names such as rc0. This is process number one. where the swap file is located.d…rc6. In Enterprise Linux. and what the global environment variables are. The runlevel you select will determine who can log on.d. there are a series of directories under /etc/rc. For example. The runlevels are described in detail later in the lesson. how many users can be logged on. On most systems. that basic setup script is /etc/rc. rc1. The init process reads /etc/inittab.d.5 . After the basic setup script is run.

Runlevel 0 is the system halt state.d rc4. In this case.d rc3. Scripts beginning with a “K” (for “kill”) are intended to stop services. From runlevels 1–5.Linux Startup Sequence rc0.d rc5.d rc6. These files are from rc5. Runlevel 6 initiates a system restart. as runlevel 5 is entered. Linux Startup Sequence Each runlevel is associated with its own subdirectory. Within any given level’s subdirectory. Oracle.d Power off • • • Runlevels 1 through 5 are available on boot. including the two special runlevels 0 and 6. rc2.sysinit rc1.d: K02NetworkManager K05saslauthd K10dc_server K10psacct K12dc_client K12FreeWnn K20nfs K24irda K35smb K35vncserver ra O The scripts are executed in alphabetical sequence as the runlevel is entered. the script S01sysstat is executed. Linux allows movement between runlevels through the init command. Runlevel 0 enters the system halt state (all services stopped) and is used to properly shut the system down before the power is turned off.d/rc. then S05kudzu. entered from runlevels 1–5 before shutdown. le c le ac r O ly l & On na se er U nt I K74nscd K74ntpd K87auditd K89netplugd K90bluetooth K94diskdump S01sysstat S05kudzu S08arptables_jf S08iptables c A de a y m S10network S12syslog S13irqbalance S13portmap S14nfslock S15mdmonitor S25netfs S26apmd S28autofs S55sshd S56rawdevices S56xinetd S80sendmail S85gpm S90canna S90crond S95anacron S95atd S97messagebus S99local Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . All rights reserved. Runlevel 6 initiates a system reset. you can move to any other runlevel.6 .d Copyright © 2007.d init /etc/rc. you will see scripts with names like these. scripts beginning with an “S” (for “start”) are intended to start services. and so on until all scripts have completed.

Only root may log in. # init 3 Copyright © 2007. but for Enterprise Linux it is as follows: • Runlevel 0: Halt. • Runlevel 1: Single-user (maintenance) mode.Linux Runlevels Runlevels determine which services are available. Linux Runlevels Linux uses runlevels to determine which services to start or stop. X • The default runlevel is usually 5 but can be changed. • Servers usually use runlevel 3. This shuts everything down and then starts it back. All rights reserved. Oracle. you press [E] then scroll down to select the kernel. text-based console only • Runlevel 3: Multiuser mode with networking • Runlevel 4: For custom use • Runlevel 5: The default mode. then press [B]. press the spacebar. multiuser with networking and active X session • Runlevel 6: Reboot. It is used to shut down the system. enter the runlevel you want to boot to.7 . at certain runlevels the graphic user interface might not be started. For example. The meaning and services started at the different runlevels is distribution dependent. press [E] again. Your current and previous runlevel can be found with the runlevel command. • Runlevels can also be changed with the init command. For Enterprise Linux. • Linux runlevels: – – – – 0 = halt 1 = single user 3 = multiuser. • Runlevel 2: Multiuser mode. network 5 = multiuser. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . Booting to a Nondefault Runlevel The GRand Unified Bootloader (GRUB) provides a way to specify the runlevel on startup from the OS selection menu.

d directory. Create a Script Named dbora The name of this script is arbitrary. Oracle. Start the listener first. next the ASM instance.Database Startup and Shutdown Create a dbora service script to automate startup and shutdown. Naming it dbora can be convenient because the name of the script is echoed to the console during the boot process. Startup Database Shutdown Copyright © 2007. All rights reserved. the database and related services can be started automatically. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . If a server crashes. the order in which the processes are started is important. This script can start all the databaserelated processes as is shown in the example. and finally DB Console (because it connects to a repository in the database on startup). or the script may be broken into multiple scripts that start and stop the processes separately. • Use chkconfig to set the runlevels. and the system administrator may not be familiar with the commands for doing a proper shutdown of the database. • Create a script named dbora. ra O Database Startup and Shutdown Most servers are not shut down often.8 . Because of this. By placing startup scripts in each of the proper runlevel directories. you want the database to be open as soon as possible after the machine is started. This ensures that the database does a proper shutdown without DBA involvement. • Place it in the /etc/rc. In this example. then the database.d/init. it is a good idea to provide a script to shut down the database in each of the runlevel directories.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . Any process that is not stopped here is stopped by the killall command later during the shutdown process.9 . The stop script runs only if the lock file exists.Database Startup and Shutdown (continued) The stop commands are in sequence and the database is stopped in the end. Enterprise Linux uses a subsystem lock file at /var/lock/subsys/<service_name>.

Administrative Scripts Oracle provides a set of administrative scripts. A colon.0/db_1:Y ASM and database instances created without using DBCA will not appear in the oratab file. Example of the entries in /etc/oratab : ra O le c le ac r O ly l & On na se er U nt I c A de a y m +ASM:/u01/app/oracle/product/10. All rights reserved. • Start up and shut down databases by using: – dbstart – dbshut Copyright © 2007.sh and updated by the Database Configuration Assistant (DBCA) when creating a database. The third field indicates to the dbstart utility whether the database should be brought up at system boot time.2. The oratab file is created by root. These scripts read the oratab file. “#”. Entries are of the form: $ORACLE_SID:$ORACLE_HOME:<N|Y> The first and second fields are the system identifier and home directory of the database. respectively. determine which databases participate in automated startup or shutdown. Lines beginning with a pound sign. are comments.10 . meaning yes or no. Administrative Scripts Oracle provides the dbstart and dbshut scripts that must be modified for your site. “:”. is used as the field terminator. Entries will need to be made manually in the file for those instances.2. A new line terminates the entry. respectively. indicated by Y or N. and start up or shut down these databases. Oracle Database 10g: Managing Oracle on Linux for DBAs 7 .0/db_1:Y orcl:/u01/app/oracle/product/10. Oracle.

Edit $ORACLE_HOME/bin/dbstart 2. When found the instances are started.Administrative Scripts (continued) dbstart dbstart first starts the listener. Values of $ORACLE_SID which start with a “+” denote an ASM instance. This mode terminates all connections and then shuts down the database. perform the following steps: 1. To solve this problem. Databases that use ASM for managing storage require the ASM instance to be started before the database instance.2.11 . The dbshut script can be modified to shut down DB Console before shutting down the database. This would allow for a faster shutdown of the database.0 contains an error. The dbstart script that is provided with 10. Execute dbstart. 3. On the first scan.1 documents this issue. The Metalink note 336299. then scans oratab twice. The script can be customized to start other utilities. 5. Save the file and exit the editor. the script looks for database instances with a “Y” in the third field. Go to line 78.0.1. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . dbshut The dbshut performs shutdown immediate. dbstart looks for ASM instances with a “Y” in the third field. On the second scan. Replace the line with: ORACLE_HOME_LISTNER=$ORACLE_HOME 4. such as DB Control.

1.Managing Services with chkconfig # chkconfig: 2345 99 10 # description: starts and stops oracle instances rc0. A service script named dbora can have the following comment lines. 4. which provides a simple way to add and delete services to runlevels. rc4.d rc5. K10dbora. With these comment lines in place. 1. and 6. chkconfig --del dbora removes the links and chkconfig --list dbora shows the runlevels and the state of the dbora service at each runlevel. The start scripts will be present at the runlevels 2. the chkconfig --add dbora command adds the links to the script into the appropriate directories. # chkconfig: 2345 99 10 # description: starts and stops oracle instances ra O This says that the links to this script should be named S99dbora and K10dbora. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . rc2. The kill scripts will be present at the runlevels 0. 3.d Copyright © 2007.d rc6. A manual creation of these links is time consuming and prone to errors. You can also use the graphical tool system-config-services to manage services. Managing Services with chkconfig System administrators must create a link in each runlevel directory for each service that should be available at that runlevel.d rc1.d rc3. All rights reserved. S99dbora. A tool called chkconfig is provided in Linux distributions modeled after a tool on IRIX. and 6. in runlevels 2 through 5.d • Create a startup script. and 5. in runlevels 0.12 .d • Create a kill script. These comment lines specify the runlevels and the order numbers for the start and kill. Oracle.

In many companies.Automating Jobs Automate the following jobs to leverage your time: • Backups • Database startup and shutdown • Gathering database statistics • Monitoring database health • Monitoring processes: listener. you are asked to support more databases and more hours of the day or night. Automating Jobs Much of your work as a DBA must be done outside normal working hours. agent. All rights reserved. HTTP server Copyright © 2007. or at least during offpeak hours. and more importantly make sure that the database does a proper shutdown before the machine is shut down. These routine jobs include: • Doing backups and maintaining backup scripts • Starting up and shutting down the database • Gathering statistics on the database and OS • Monitoring the health of the database and related processes Ensure that the database starts up when the machine boots. Oracle.13 . Automating routine jobs is a way of reducing the work load. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . Monitor the database and related processes so that you are aware of a problem before the users start contacting you.

cron The system cron daemon is started as part of the boot process. users listed in the /etc/cron. /etc/cron. or a GUI for one of these tools. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 .deny files. Only users listed in the /etc/cron.daily. only the superuser is allowed to use cron. All rights reserved. In Enterprise Linux. If the system administrator puts an executable script into one of these directories. If neither of these files exist.hourly. Task Scheduler is one of these user interfaces that makes cron and at easier to use. /etc/cron.allow file are allowed to use cron.OS Scheduling Tools Linux offers the standard UNIX tools for scheduling: • cron and anacron • at and batch • Task Scheduler Copyright © 2007. and /etc/cron. The cron daemon checks the system-level schedule in the /etc/crontab file and user-level schedules in the /var/spool/cron directory. there is also a set of directories /etc/cron.allow and /etc/cron.deny file cannot use cron. OS Scheduling Tools Linux offers several scheduling tools that usually are a variation of the standard cron and at tools. then cron runs the script at the appropriate interval.monthly that hold executable scripts.weekly. Security for cron is handled by the system administrator by using the /etc/cron.14 . Oracle.

anacron executes the command specified after waiting for the number of minutes specified in the Delay field. The anacron daemon periodically checks the /etc/anacrontab file.” A crontab entry to run a backup script might look like the following: 14 22 * * 1-5 su . The batch commands wait until the system load average drops below 0. and then executes the given commands.8. Task Scheduler There are GUI task schedulers available that are front ends for cron in both the Gnome and the K(ommon) Desktop Environment (KDE). The atd daemon runs the at commands and the batch commands.15 . If not. If any of these fields has a “*”. at and batch The at command executes a command once at a specified time. log in as the oracle owner and execute backup. then the meaning is “every. the bit bucket.OS Scheduling Tools (continued) cron (continued) The format of an entry in the crontab file is <minute> <hour> <day> <month> <weekday> <cmd>. Monday through Friday. The command says. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 .oracle -c /usr/local/bin/backup. every weekday of every month. and standard error to the same place. and verifies whether the task has been executed within the time specified in the Period field of the configuration file.m. sending the standard out to /dev/null. as opposed to cron that executes recurring commands.cmd. anacron It is an interesting variation of cron that does not require the system to be running continuously.cmd >/dev/null 2>&1 This command runs 14 minutes after 10 p.

OS commands. All rights reserved. a PL/SQL block. Using Oracle Enterprise Manager Grid Control to manage your node and database provides even greater flexibility in the types of jobs that can be created. and save jobs.16 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . Job Capabilities of DB Console Using DB Console. register. Each job can be run against the database instance or the node. execute. You can use the Job Wizard to create. PERL scripts. Oracle. DB Console uses dbms_scheduler from the database providing a convenient way to centralize your recurring jobs. You can schedule: • SQL scripts • PL/SQL blocks • Stored procedures • RMAN scripts • PERL scripts • OS commands Copyright © 2007.Job Capabilities of DB Console DB Console provides a way to schedule jobs against the database or node. A job can be SQL scripts. you can schedule a job to run at a particular time or interval. RMAN scripts. or a stored procedure.

cpio. Backup ra O Database Backups Backups are required by most businesses. The method should be chosen based on availability requirements. or the tablespaces put into backup mode before the back up takes place. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . Many vendors provide an Oracle database agent module to provide this functionality. User-Managed Backups with OS Tools Backups can be created by using standard OS tools. Oracle.Database Backups Database backups are essential. The options for backing up your database are: • User-managed backup with OS tools • User-managed backup with third-party tools • Server-managed backup with RMAN Database Copyright © 2007. and cp. The database must be shut down. and mean time to recover (MTTR). Server-Managed Backups with RMAN Oracle Corporation provides an integrated tool called Recovery Manager (RMAN) to perform backups or use the DB Console interface to RMAN. The most important consideration is whether the tool you choose coordinates with the Oracle database. The method and the frequency are often dictated by business requirements. By doing this. It is the user’s responsibility to understand the limitations of these tools. performance. This tool works with the database instance to make reliable backups. convenience. such as tar. Note: Use the full pathname to invoke RMAN: $ORACLE_HOME/bin/rman. There is a different Linux utility named rman. User-Managed Backups with Third-Party Tools There are several third-party backup solutions. All rights reserved. you avoid any path problems.17 .

It uses the instance to facilitate the backup. All rights reserved.18 . Recovery Manager has a full range of commands that allow detailed control of the backup. Oracle Secure Backup delivers tape data protection for the Oracle database and file systems in distributed Linux and Network Attached Storage (NAS) environments.Backing Up with RMAN Recovery Manager is the recommended solution. ra O Backing Up with RMAN The Recovery Manager tool is bundled with every installation of the Oracle database. RMAN backups are covered in the Oracle Database 10g: Administration Workshop II and the Oracle Database 10g: Backup and Recovery course and in the Backup and Recovery Basics and Backup and Recovery Advanced User’s Guide. Oracle Secure Backup is also available for backups. Oracle. because it: • Provides tight integration with the Oracle database • Understands raw partitions • Can be scripted and scheduled • Allows finer-grained recovery options • Is required to back up an ASM-based database RMAN> BACKUP DATABASE. RMAN can be scripted and scheduled from OS schedulers or as an Enterprise Manager Job. Oracle Secure Backup leverages the proven security technologies of secure sockets layer (SSL) and encryption. Safeguarding data and access to the backup domain. A full database backup can be simple (such as the command shown in the slide) or complex. depending on your requirement. You should use the available tools to make the backups self-scripting so that the backup scripts have zero maintenance. Copyright © 2007. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . RMAN handles raw partitions in the same manner that the database instance does. Automatic Storage Management requires RMAN for taking backups.

Oracle. is spfile<SID>. you can store and manage your initialization parameters persistently in a server-side disk file. but it is not written to by the server. the default name of the SPFILE is spfile<sid>. ra O Initialization Parameter Files When you start the instance. There are two types of parameter files: • Server parameter file: This is the preferred type of initialization parameter file.ora. • The default location for the SPFILE with ASM is <diskgroup>/<sid>/.ora with the file located in <diskgroup>/<sid>/ (for example. It is a binary file that can be written to and read by the database server and must not be edited manually.ora) • Text initialization parameter file: This type of initialization parameter file can be read by the database server. It is recommended that you create a server parameter file (SPFILE) as a dynamic means of maintaining initialization parameters. +DF/orcl/spfileorcl. The initialization parameter settings must be set and changed manually by using a text editor so that they are persistent across shutdown and startup. is init<SID>. It resides in the server that the Oracle database is executing on. This is often referred to as an SPFILE. For a database using ASM. Copyright © 2007.19 le c le ac r O ly l & On na se er U nt I c A de a y m . All rights reserved. and is persistent across shutdown and startup. • The STARTUP command always uses the same SPFILE. you can use a server parameter file SPFILE or the initialization parameter file PFILE: • An SPFILE is recommended. an initialization parameter file is read.Server Parameter File With an Oracle 10g database. The default name of this file.ora located in $ORACLE_HOME/dbs. which is automatically sought at startup if an SPFILE is not found. which is automatically sought at startup. Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . • SPFILE is maintained by the server. The default name of this file. By using a server parameter file.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 . All rights reserved. Oracle.Summary In this lesson.20 . you should have learned how to: • Create automated startup/shutdown scripts • Automate tasks using scheduling tools • Configure Linux startup and shutdown sequence Copyright © 2007.

Practice 7 Overview: Automating Tasks This practice covers the following topics: • Automating the startup and shutdown of the database • Adding starting and stopping DB Control to dbstart and dbshut Copyright © 2007. Practice 7 Overview: Automating Tasks For detailed instructions on performing this practice. Oracle.21 . All rights reserved. see Practice 7 in Appendix A. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 7 .

ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

ra O le c le ac r O ly l & On na se er U nt I c A de a y m . Oracle.Managing Memory Copyright © 2007. All rights reserved.

2 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . All rights reserved. you should be able to: • List the memory models available in Linux kernels • Implement hugepages • Describe /proc/meminfo contents • List the implications of Linux memory configuration on Oracle Database • Identify the issues regarding 32-bit OS versus 64-bit OS Copyright © 2007. Oracle.Objectives After completing this lesson.

or RAM. swap space is set up.3 .Swap Space The swap space makes more memory available to the system even when physical memory is limited. Swap Space Often there are demands for more memory than what is actually installed on the machine. To mitigate the effects of this limitation. it may need to allocate some memory in RAM to support the new process. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . Oracle. as needed. instead of failing the process. Swap space is an area of disk that is set aside to hold some of the contents of physical memory. The result is that there is effectively more memory available for processes to use. Linux continually swaps the contents of physical RAM and disk. All rights reserved. Physical memory Swap space (virtual memory) Total available memory Copyright © 2007. at certain times. If there is not enough RAM available. As Linux switches from running one process to another. This process of copying memory contents from RAM to disk and back again is why this disk area is referred to as swap space. Linux copies the contents of some of the RAM to the swap space.

the swap out operation may not require that the page be written to disk again. then it is reloaded from the cache. The details of the processes that write a page out and read a page in follow. while it was swapped out onto disk. Likewise. swap overwrites the old pages. The older a page. and then later. there is no need to write it to disk again. The purpose of this is to short-circuit any unnecessary I/O. If the page had not been modified at all while it was swapped in. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . RAM Swap cache Swap space Copyright © 2007. the more likely it is to be overwritten. and then swapped out. If a page is needed again before being moved from the cache to disk. If.Swap Cache The swap cache tracks the state of swapped pages and reduces the swap I/O activity. where a page is swapped out to disk. or discarded if they are not dirty. it ages. Consider the page out operation. These pages are moved to the swap cache in memory if they are dirty. Otherwise. whether they have been written to since that time. and thus. If there is a demand for free pages. it gets flushed from the cache to the disk after a period of time. if a page is swapped in. The swap cache is an area of RAM that is set aside to track the pages that are swapped out to disk. then its contents still match what is already stored on disk. it is already in memory. Oracle. Swap Cache A closer look at the RAM/swap space interaction reveals the swap cache mechanism.4 . then there is no need to read the page back in from disk. Page Out Operation If a page residing in memory is not used. All rights reserved. is needed back in memory. The swap looks for the oldest pages in each process every few seconds. and. the in-memory page was not reused for anything else.

Swap Cache (continued) Page In Operation If the process tries to access a page that is not mapped into physical memory.5 . A page fault causes the process to suspend. To bring a page into memory. a free page must exist. The swap process works to keep a pool of free pages available for these page in operations. The page is read from a disk or a swap cache. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . Then the process is placed on the run queue. a page fault occurs. The page is loaded into a free page of memory. This page is mapped to the Translation Lookaside Buffer (TLB).

5 GB Swap Total = 2.5 GB Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . Note: Diagram sizes are not to scale. and also to see how much of it is being used. respectively: • <= 2 GB: 150% of the RAM size • Between 2 GB and 8 GB: Equal to the RAM size • > 8 GB: 75% of the RAM size Some examples are shown in the slide.6 . You can use the free command to see the size of the swap space. Sizing Swap Space The amount of swap space to allocate depends on the amount of RAM installed on the machine. All rights reserved. You can also view the contents of /proc/swaps.5 GB Swap 4 GB RAM = Swap 10 GB RAM 4 GB 7. Oracle.Sizing Swap Space Swap space should be sized based on the amount of RAM installed. 1 GB RAM 1.5 GB Total = 8 GB Total = 17. The following conditions show the RAM size followed by the reasonable swap space size.

/proc/meminfo The /proc/meminfo virtual file shows the current state of memory for the Linux kernel. • MemFree: Total amount of memory that is currently free • Cached: Memory in the pagecache (diskcache) minus SwapCached. Oracle. it is already in the swap file. The following information can be found there: • MemTotal: The total physical memory in the system. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . but is still in the swap file. All rights reserved. This does not include SwapCache. This saves I/O. This is a performance feature because if memory is needed it does not need to be swapped out again. All of your server's physical memory should be reported here at all times./proc/meminfo The most useful high-level statistics found in the /proc/meminfo file are: • MemTotal: Total usable physical RAM • MemFree: RAM that is currently free • Cached: Memory in the page cache • SwapCached: Memory that was swapped back in after being swapped out Copyright © 2007.7 . • SwapCached: Memory that once was swapped out and has been swapped back in.

top and free Some of the used memory that the top command reports is actually being used for cache. the situation seems dire because it appears that almost all memory is being used: Mem: 16124948K used. and that will be reflected in a higher used value. If another process starts up. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . So. That means that it is available to be reassigned if another process requires it. But the free command reports that 13 GB is currently being used for cache. 42724K free But the free command shows that 13 GB of this memory is cache. but not all of it is always necessary. By the nature of caching. Oracle. then some of this cache memory can be allocated to those memory requests. or an existing one requests more memory than is reported in the free category of the top command. which is available to processes as needed: shared 1710184 buffers 351312 cached 13330324 total 16167672 used 16129820 free 37852 Copyright © 2007.Evaluating Free Memory As reported by top. All rights reserved. It appears that only 42 MB of memory is free. that memory buffer is useful.8 . The slide illustrates how the top command memory information can be misleading. there is more memory available for use by processes than appears as reported by the top command. and a lower cached value.

All rights reserved. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 .9 . for performance • Hugetlb: An entry in the TLB that point to a hugepage • Hugetlbfs: An in-memory file system introduced in the 2.Memory Terminology Some terminology: • Page table: A data structure that maps virtual addresses to physical addresses • Translation Lookaside Buffer (TLB): Cache in the CPU that contains part of the page table.6 Linux kernel • Page Address Extentions (PAE): A technique for adding 4 bits onto the memory address value. allowing a 32-bit machine to address 64 GB instead of 4 GB Copyright © 2007.

In order to get above 4 GB virtual memory on IA-32 architecture. Page Address Extensions (PAE) A 64-bit Linux system can address 16 exabytes. It is a method that translates 32-bit (2**32 = 4 GB) linear addresses to 36-bit (2**36 = 64 GB) physical addresses. the support is provided through a compile time option that produces two separate kernels: the SMP kernel which supports only up to 4 GB VM and the enterprise kernel that can go up to 64 GB VM (also called Very Large Memory [VLM]).967.296 4 GB 2^36 = 68.476. This means applications such as Oracle can make use of the large memory and scale up to a large number of users without loss of performance or reliability.736 64 GB Very Large Memory (VLM) Copyright © 2007.Page Address Extensions (PAE) 2^32 = 4. The enterprise kernel is able to use up to 64 GB pagecache without any modifications. All rights reserved.294. a technique known as Page Address Extensions (PAE) is used. because 2 raised to the thirtysecond power is roughly 4 billion. But a 32-bit system can address only 4 GB of memory.10 . an extension of the addressing system is not necessary. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . Oracle. In the Linux kernel.719.

hugepages are not swapped out. A smaller page size like this not only limits the amount of memory that can be addressed. because the number of page table entries can remain the same.Hugepages 4 MB 4 KB 4 MB 4 KB 4 KB Page table Page table 4 MB Copyright © 2007. and thus provide for better performance because they remain in physical memory. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . All rights reserved. this provides for a lot more addressable memory. without the extra overhead. but it also causes more overhead in the management of the page table entries because there are more entries required. Oracle. If you increase the page size to 4 MB.11 . That means each entry in the page table can point to a 4 KB size page. Hugepages The regular page size in Linux is 4 KB. This is referred to as hugepages. Also.

Check the permissions of /dev/shm: 7. 4.local and add the following: umount /dev/shm mount -t ramfs ramfs /dev/shm chown oracle:oinstall /dev/shm where oracle is the Oracle owner and oinstall is the group for Oracle owner account. 5. All rights reserved. You must configure DB_CACHE_SIZE instead. Reboot the server. Check whether /dev/shm is mounted with the type ramfs: # mount | grep shm 6. Implementing Hugepages on 32-Bit Linux To configure hugepages. Oracle. Log on as root. Copyright © 2007.conf and add: O ra le c * * # ls -ld /dev/shm soft hard le ac r O ly l & On na se er U nt I memlock memlock 3145728 3145728 c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . 3.Implementing Hugepages on 32-Bit Linux To implement the hughpages feature: • Configure Linux to mount ramfs at boot time • Increase locked memory limit • Configure instance parameters for VLM • Set the hugepages kernel parameter Note: Using this feature removes the ability to configure automatic shared memory management. 2. perform the following steps: 1. Configure Linux to mount ramfs over /dev/shm at every boot. Edit /etc/rc.12 . Log on as root. Edit /etc/security/limits. Increase max locked memory limit.

Remove SGA_TARGET if set. a. d. Get Hugepagesize from: $ grep Hugepagesize /proc/meminfo b. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . Examine the memory allocation: $ ls -l /dev/shm $ ipcs -m 13. Start up the instance. Set parameter for every boot. Check available hugepages (1 or 2 pages free) $ grep Huge /proc/meminfo Note: If the setting of nr_hugepages is not effective. Configure SGA size according to needs. 9. 16. Check max locked memory limit: $ ulimit –l 3145728 10. Convert the DB_CACHE_SIZE.Implementing Hugepages on 32-Bit Linux (continued) 8. Add the USE_INDIRECT_DATA_BUFFERS=TRUE parameter. Compute nr_hugepages = max(ipcs -m) / (Hugepagesize * 1024) + 1. Set kernel parameter: # sysctl -w vm. Edit /etc/sysctl. c. c. Restart the instance. 11.nr_hugepages=<value from above> d. Log in as the oracle Linux user. you may need to reboot the server. 12. Check the available hugepages: $ grep Huge /proc/meminfo 15. b. Configure hugepages.conf for vm. DB_xK_CACHE_SIZE parameters to DB_BLOCK_BUFFERS.nr_hugepages=<value from above> 14.13 . Configure instance parameters for VLM: a.

Kernel Limitations A 32-bit processor cannot access more than 232 bytes (4 GB) of RAM without assistance.7 GB). These methods can be combined.7 GB (up to about 2. Those chunks are accessed through an extra layer of memory address translation. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . The theoretical limit for a Linux SGA is 62 GB. One of those is a process limitation and the other is a kernel limitation. practical limitations are closer to 20 GB. • Relocate the Database Buffer Cache so it uses a memory-based file system (up to 60 GB). Implementing a Large SGA There are two Linux memory limitations that affect the maximum size of the SGA.Implementing a Large SGA There are two methods to implement a large SGA under Linux: • Alter the Linux memory map so the SGA can use more than 1.14 . enabling very large SGAs. All rights reserved. That assistance comes in the form of PAE that breaks up the memory into chunks that can be handled by the 32-bit processor. Copyright © 2007.

The starting point in the memory map for shared libraries and process memory is controlled by mapped_base. Oracle. The kernel takes up a fairly small amount of RAM at the base of the memory map (the diagram in the slide is not to scale).25 GB Oracle SGA Shared libraries 1. a section for application memory. such as PMON. whereas the SGA resides in the application memory area. All rights reserved. such as Oracle Database. and DBWn.25 GB to 2.98 GB OS Disk Buffer and Page cache Process memory 1. the Linux kernel will normally divide it up as shown in the slide. SMON. giving the SGA a maximum size of around 1. The application area is divided into three sections: a section for application code.0 GB lib*. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . Standard Linux Memory Map With 4 GB of RAM.Standard Linux Memory Map 4.0 GB Kernel use 2. and a section for shared libraries. user processes Kernel (not paged) Copyright © 2007. The kernel will also reserve the top portion of the memory map for disk buffer caching and memory page table maintenance. The only way to accommodate the SGA is to take away space from other application area sections.15 . With Oracle. As you can see. reside in the application code area. user processes and background processes.so mapped_base Application code 128 MB Oracle Executables. The area in between is left for applications.98 GB. process memory can occupy the section from about 1.7 GB.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 .98 GB OS Disk Buffer and Page cache Process memory Oracle SGA 336 MB 256 MB 128 MB Shared libraries Application code Kernel (not paged) mapped_base Oracle Executables. Ensure that you leave enough room below mapped_base for your applications to run. user processes lib*.so shared library files is where shared libraries are mapped. The kernel will still take up about 128 MB at the base of the map as well as the upper 1 GB. Oracle.7 GB. The lowest address for the ld*.so Copyright © 2007. All rights reserved. Modified Linux Memory Map It is possible to modify the Linux memory map and allocate more memory to the SGA. you have to worry about shrinking the space for application code too much because it does little good to have a large SGA if your users cannot create sessions to access it. As you can see in the slide. You can check the memory mappings by looking at a /proc/<pid>/maps file for any process ID.0 GB Kernel use 2. The theoretical limit for the SGA using this method is approximately 2.16 .Modified Linux Memory Map 4. lowering mapped_base expands the area available to the SGA at the expense of room for shared libraries and application code. From a practical standpoint. but the three application areas can be redistributed by changing the mapped_base.

and 10. and so on).1 or 9. Remember that you need to leave room for application code.s. If you perform these steps incorrectly. you would probably set the mapped_base higher. and so on) can be increased in size. so even as this example maximizes the SGA in real life. This is not especially difficult. or server processes just dying. Altering the Linux Memory Map to Accommodate a Larger SGA This procedure is used for setting an SGA larger than 1. • It works with any 8.7 GB and smaller than 2.2. • It requires a thorough understanding to be implemented correctly. Modify shmmax.0. Modify a shell for starting the database instance by lowering mapped_base.x. Disadvantages: • Local startup/shutdown of the database is allowed only from a modified Linux shell. 9. Lowering mapped_base and Relocating the SGA Method Advantages: • You can increase the SGA from the default of 1. Modify ksms. All rights reserved.Altering the Linux Memory Map To alter the Linux Memory Map and implement an SGA between 1.1 and 10. b. Relink the database executables. Copyright © 2007. you will receive unexpected error messages (ORA-3113.2 database.7 GB up to 2. • The entire SGA (shared pool. 2.7 GB. but you have to be careful. 3.17 .7 GB and 2. buffer cache. • Less virtual memory remains available for the PGA. attach errors. perform the following steps: 1.7 GB on a machine with 4 GB or less of real memory.7. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . Oracle.7 GB.1. so activities such as sorting need to be tuned differently. Relocate the SGA: a.

and the kernel and OS caches must be sized to be allocated without excessive paging. the process memory. but unless you want to repeat the change every time you reboot the server. Lowering the mapped base is a requirement for every shell that spawns an Oracle server process on the server. The larger memory addresses are considered lower in memory. Start a shell as the oracle user. The sum of the SGA.conf file. The mapped_base parameter is set on a per process basis.Altering the Linux Memory Map to Accommodate a Larger SGA (continued) Modifying shmmax The shmmax parameter can be changed dynamically. you should enter the change in the /etc/sysctl. In the shell. This includes any shell that is used to connect locally to the database and the shell used to start the listener. so it cannot be set during boot up. (This way.18 . find the process ID by using ps or echo $$. a larger shared memory allocation up to 2. It is assumed that the amount of SGA needed has already been determined. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 .7 GB is possible. listener-spawned processes inherit a lowered mapped_base. By starting the search at a lower address. The mapped_base parameter is inherited by any process spawned by a shell that has mapped_base lowered. Lowering mapped_base The mapped_base is an address in virtual memory where the mmap starts looking for a chunk of memory to allocate to the shared memory.) This step will have to be performed every time you start the instance. The amount of process memory needed is also known. This means you will not be able to start the instance using Oracle Enterprise Manager or other tools. The previous rule of thumb of limiting shmmax to half of real memory does not apply here. Start another shell as the root user and lower the mapped_base with the following command: # echo 268435456 > /proc/<your process ID>/mapped_base where 268435456 is decimal for 0 x 10000000. or for the entire system.

use the following command to return to the default installed value: $ genksms > ksms.s did not exist. and lower addresses may be usable down to about 0x12000000.Relocating the SGA Execute the following commands as the Oracle software owner: $ cd $ORACLE_HOME/rdbms/lib $ cp ksms.s ksms.s existed before you began this process: $ cp ksms. and the database executable is relinked to use a lowered address for the SGA.s library is modified. Relocating the SGA In this procedure.s exists.o $ make -f ins_rdbms. the ksms. back it up first.s After you restore or regenerate ksms. The address of 0X15000000 is safe. but these lower addresses must be thoroughly tested.s $ make -f ins_rdbms.mk ioracle Copyright © 2007. After these changes have been made. Reversing the Change If things go wrong and you want to return to your original values. Other Oraclesupplied executables may use addresses below 0X15000000 and can be incompatible with these changes.*/ $ genksms -s 0x15000000 > ksms. then you can do one of the following: • If ksms.mk ksms. Oracle.s • If ksms.s: $ make -f ins_rdbms.s_orig /* if ksms.s_orig ksms. an SGA of approximately 2.7 GB can be allocated.mk ksms. All rights reserved.19 .o $ make -f ins_rdbms.mk ioracle ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 .

Enable shared memory file system. All rights reserved.20 . To do this. Oracle. or 4 GB: # echo 4000000000 > /proc/sys/kernel/shmmax Again. 5.Relocating the Database Buffer Cache These steps relocate the database buffer cache so that instead of occupying a portion of the application area within memory. 4. Relocating the Database Buffer Cache It is possible to relocate the position of the database buffer cache so that it does not occupy space with the rest of the SGA in the application area of the memory map.conf. Set the initialization parameters and restart the instance. set the shmmax kernel parameter to half the size of physical RAM available on your system.shmmax in /etc/sysctl. perform the following steps: 1.7 GB limit for other areas of the SGA such as the shared or Java pools. set it at boot up by setting kernel. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . it resides in a virtual file system. Enable hugepages for performance boost. 3. 2.) Copyright © 2007. The value for shmmax cannot exceed 4294967295. This not only allows for much larger database buffer caches. Set shmmax to hold the entire SGA. Setting shmmax to Hold the Entire SGA From any root Linux shell. (Dynamic SGA parameters are not available. but also frees up memory within the 2.

see the Oracle Database Performance Tuning Guide.21 . Implementing a Large SGA Mounting a Shared Memory File System (SHMFS) As root. a file is created in /dev/shm that corresponds to the SGA database buffer cache. The memory allocated to DB_BLOCK_BUFFERS will now be consumed from the shared file system located at (in this example) /dev/shm leaving up to 2.8 GB cache: USE_INDIRECT_BUFFERS = TRUE DB_BLOCK_BUFFERS = 475000 Note: Multiple database buffer cache block sizes and the dynamic SGA buffer cache parameters cannot be used with INDIRECT_BUFFERS. When the database instance is started with the extended buffer cache feature enabled. The size parameter accepts the “k”and “m” multipliers as well. then do not forget to reset mapped_base before starting the instance. Note: It is possible to make your buffer cache too large to the point where it defeats any performance gains. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . If you are using this method in conjunction with altering the Linux memory map.Relocating the Database Buffer Cache (continued) Ensuring that hugepages Are Enabled Ensure that hugepages are enabled. mount a shared memory file system and mount it at every boot up by changing the /etc/fstab file: # mount -t shm shmfs -o size=8g /dev/shm Add the following line to the /etc/fstab file: none /dev/shm tmpfs size=8g 0 0 This creates an shmfs file system on /dev/shm of 8 GB size. For details. The database buffer cache size must be set with DB_BLOCK_BUFFERS. assuming an 8 KB block size and 3. Verify that the following initialization parameters are not set: DB_CACHE_SIZE DB_2K_CACHE_SIZE DB_4K_CACHE_SIZE DB_8K_CACHE_SIZE DB_16K_CACHE_SIZE DB_32K_CACHE_SIZE Start up the Oracle database instance. Configure the Instance to Use the Shared Memory File System Set the following initialization parameters. as described earlier in this lesson.7 GB for other SGA areas.

So even if you have only 12 GB. but it also provides up to 4 GB of memory per process. That is because the hugemem kernel not only provides for addressing up to 64 GB of memory. then the hugemen kernel can be beneficial.6 GB SGA without implementing VLM Copyright © 2007. but you have a process that requires a large amount of memory for itself. hugemem Kernel The hugemem kernel is provided by the kernel-hugemem package. It can even provide some benefit on systems with as little as 6 GB of memory.22 . Oracle. but if you have processes that can take advantage of up to 4 GB of address space. All rights reserved.hugemem Kernel The hugemem kernel: • Can address up to 64 GB of RAM • Is required in order to address more than 16 GB of RAM • Supports multiple processors • Makes use of Physical Address Extension (PAE) • Allows up to 4 GB to be used per process • Provides for a 3. then this kernel may provide some advantage. There is no definite RAM size that defines where the cutoff of benefit is. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . It is a kernel that was developed to take advantage of memory greater than 16 GB.

23 . All rights reserved. you should have learned how to: • List the memory models available in Linux kernels • Implement hugepages • Describe /proc/meminfo contents • List implications of Linux memory configuration on Oracle Database • Identify issues regarding 32-bit OS versus 64-bit OS Copyright © 2007.Summary In this lesson. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 .

Practice 8 Overview: Managing Memory This practice covers the following topics: • Understanding the contents of /proc/meminfo • Viewing shared memory segment information Copyright © 2007.24 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 8 . Oracle. All rights reserved.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m .Using Linux Measurement Tools Copyright © 2007. Oracle. All rights reserved.

Oracle. All rights reserved.Objectives After completing this lesson. you should be able to: • Use Linux monitoring tools • Interpret memory measurements • Interpret I/O measurements Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 .2 .

Basic Tuning Methodology Tune the database for the hardware. you may need to tune your database.3 . Copyright © 2007. you have to work in a cycle. Tune the hardware for the database. When evaluating new hardware. and CPU power. First. storage I/O capability. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . In most cases. Be ready to reevaluate your hardware configuration as system requirements change. your primary considerations should be based on memory. All rights reserved. This process continues for the life of your system. For this. Over time. you start with a given hardware configuration where you deploy your Oracle database. the requirements should be evaluated in that order. you work with this hardware and tune it for best performance. Basic Tuning Methodology When you tune your system. For most systems. your system requirements change and you need to modify your hardware. Oracle.

Because Oracle processes share the System Global Area (SGA). like every operating system (OS). It shows the CPU load averages. memory usage. The tools mentioned here are the ones that are available across most UNIX and Linux environments. Many of those are traditional tools adopted from the UNIX environment.Standard Measurement Tools Linux has measurement tools that are common to UNIX platforms: • Top Resource Consumers: top • System Activity Reporter: sar • Virtual Memory Statistics: vmstat • I/O Statistics: iostat • System Log files: /var/log/messages Copyright © 2007. including shared memory. The Open Source community has developed a series of tools that measure almost everything that you want to measure. CKPT. and CPU utilization. These tools are either installed by default with your distribution or freely available via the World Wide Web. top is particularly useful for diagnosing CPU and I/O issues. I/O waits. has tools available for measuring system performance. However. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . and the other Oracle processes. All rights reserved. this is not an all-inclusive list. SMON. The same shared memory segment will show up as belonging to PMON. Although top’s aggregate memory statistics are dependable.4 . though not as reliable for Oracle memory issues. Top Resource Consumers: top The real-time monitoring tool top is available on almost every flavor of UNIX/Linux. Oracle. Use top to begin your tuning and then drill down with other tools. and a detailed listing of the top processes sorted by some resource. ra O Standard Measurement Tools Linux. by default. it shows up multiple times. Memory statistics for a process show all allocated memory. individual process memory numbers should not be relied upon.

5 . interrupts./syslog The operating system maintains various log files that can be of use in monitoring and tuning the system. A full month’s worth of statistics are retained so that the administrator can use sar to view past statistics as well as current. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . In addition to providing real-time metrics.. overlapping and extending the disk statistics available from sar. sar collects regular samples of statistics to a file that can be queried for particular activity at particular times. network and so on. Unlike sar. the vmstat program reports information about processes. disk queue lengths. System Log Files: /var/log/message . It is usually executed with two arguments: $ vmstat <interval> <count> with <interval> being the number of seconds between statistics samplings and <count> being the number of samples to take. block I/O. It is usually executed with three arguments: $ sar <options> <interval> <count> The <options> flag determines what the output of sar will be. and hot spots are all important pieces of information for tuning the I/O related to the database. The iostat program provides these statistics. check the man pages to verify the options because they are different on Linux. and CPU activity. traps. to view the CPU statistics for the 23rd of the month: sar –u 2 4 –f /var/log/sa/sa23 Virtual Memory Statistics: vmstat Probably the best tool for monitoring memory usage. (You can give a –n option before the interval to suppress the report page header. sar samples the /proc file system at 10-minute intervals and records the data in /var/log/sa as a sa# file where # is the day of the month. paging. memory. I/O. system processes.Standard Measurement Tools (continued) System Activity Reporter: sar sar provides a variety of ways to look at the system activity including memory. In addition to viewing snapshots of system activity. the vmstat report allows very little customization.) I/O Statistics: iostat Disk activity. If you are already familiar with sar from some other UNIX variant. I/O. and CPU usage. For example. The report can include statistics on memory use.

6 . SuSE and UnitedLinux install xosview by default. Virtual Process File System: /proc The /proc file system is a virtual file system that provides a look into the background workings of the operating system. ra O Linux Tools Graphical Measurement Tools For Linux systems running the X Window System (X). there are a variety of graphical tools that can be installed to monitor performance. disk. they may not be the most accurate measurements of CPU usage. X-Operating System View: xosview The xosview tool shows CPU. The package for xosview is distributed with Enterprise Linux. They have the advantage of being easy to interpret. You can think of it as the Linux equivalent to Oracle’s v$ views. Note: Remember that X-based tools tend to influence the output by their own load on the CPU. All rights reserved. because of this. as well as the shared memory and buffers used by the kernel. The /proc file system exists in many UNIX variants. but is not part of the default installation. Free Memory: free The free command displays the total amount of free and used physical and swap memory in the system.Linux Tools Linux also has tools that are specific to this operating system: • X-based tools: xosview • The /proc virtual file system • Free and used memory: free Copyright © 2007. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . Oracle. and network activity. whereas its contents are greatly expanded under Linux. memory.

7 . -c) 0 data seg size (kbytes. -f) unlimited max locked memory (kbytes. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . chances are that there is a Linux package already written to measure it. you can see that there are two Xvnc processes running.Linux Tools (continued) Process Tree: pstree This tool displays the relationship between processes in a tree structure. Consult your distribution-specific documentation for more information. This tool is shell dependent. it will always appear to the left. with the C shell you would use limit –h instead. Resource Limits: ulimit This tool shows the resources available to your shell. /> bash # ulimit –a (the –a flag shows all current limits) core file size (blocks. Many more utilities may be available depending on your distribution and which packages you have installed. with parents to the left and children to the right: $ pstree init-+-2*[Xvnc] |-apmd |-oafd |-26*[oracle] |-perl-+-emagent---emagent---4*[emagent] `-java---java---52*[java] Because the init process is system process number 1. -v) unlimited And many more If it is measurable. Also. each of which has started several other processes. In this snippet from the pstree output. -s) 10240 cpu time (seconds. 26 Oracle process running. -t) unlimited max user processes (-u) 7168 virtual memory (kbytes. and that the perl process has started two children. -m) unlimited open files (-n) 1024 pipe size (512 bytes. -p) 8 stack size (kbytes. -l) 4 max memory size (kbytes. Oracle provides Oracle Enterprise Manager DB Control. which provides a great deal of performancemonitoring information about the systems it is monitoring. -d) unlimited file size (blocks.

and can be one of the most difficult to tune. disk I/O. Most depend on external connections either from clients or middle-tier machines. If CPU performance is poor it does not matter what else you tune. and network. How fast and reliably can you move data to and from a disk? This is often the slowest factor in a system. Central Processing Unit (CPU) The CPU is the heart of your system. Disk Input/Output (I/O) Although other device I/O can affect performance. Any running process consumes some memory. ra O Common Areas to Tune System performance depends on how efficiently system resources are used. the key resources that affect performance are CPU. Memory Memory is a common system bottleneck. It is usually divided into two generic categories: real and virtual (swap). your system will be slower than it could be.Common Areas to Tune CPU I/O Memory Network Copyright © 2007. Network The network is the gateway into your system. In most systems.8 . Oracle. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . disk I/O is usually the most critical type of I/O. All rights reserved. Few modern systems are self-contained within a single server. memory.

If CPU is a problem for your system. For this step.Monitoring and Tuning CPU Tools for monitoring and tuning CPU include: • top • pstree • vmstat • mpstat –p All • sar -u • xosview • xload Copyright © 2007. /proc Virtual File System All the tools mentioned in the slide use the /proc virtual file system as a source of performance information.9 . such as xosview and xload. All rights reserved. Oracle. then you drill down to find the source of that bottleneck with finegrained tools such as sar or vmstat. pstree. or one of the many graphical utilities available for Linux. you must identify if the CPU is a bottleneck for system performance. Monitoring and Tuning CPU Before you start tuning the CPU. Interesting files include: • /proc/cpuinfo • /proc/stat • /proc/loadavg ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . you normally use high-level tools such as top. The raw data contained within /proc exposes a wealth of information about CPU resources.

but would not be something to worry about on a four or more processor box. These numbers would be a matter for concern on a uniprocessor box (or even a twoprocessor box). The output from top shows you the load average for the past 10 minutes with three samples (now.72 • What is the load factor for your system? The load average does not mean a lot taken by itself. 0 stopped cpu states: 69. investigate • Partial output from top: 09:11:01 up 59 min.8% user 4. 5. To calculate the load factor.Is the CPU a Bottleneck? Is the CPU a bottleneck? • How many CPUs does the machine have? • What is the load average? • What is the load factor? – <1: CPU probably not a bottleneck – Between 1 and 2: Running at capacity – >2: CPU may be a bottleneck. 12 running. but the easiest is to use top.0% iowait 23. you have to know a few things about your system: • How many CPUs does your machine have? You can find this by checking /proc/cpuinfo or with commands such as mpstat.03. load avg: 4.32.03. 5.10 . All rights reserved. 4.32. load average: 4. ra O Is the CPU a Bottleneck? To answer this. 12 users. divide the load average by the number of CPUs: load average = load factor #CPUs le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . and 10 minutes ago).9% idle Copyright © 2007. It gives only the number of processes receiving service from the CPUs at any given time.72 320 processes: 307 sleeping. Oracle.6% system 1.5% nice 0. • What is the average load on your system? There are many ways to find this. 1 zombie. Load factor is a more relevant metric. 5 minutes ago. 4.

7 0. 475496k free PID 1973 2487 2816 2126 3218 3028 2061 1675 2602 1426 2329 15 3008 2212 2262 USER PRI root 25 oracle 15 susan 15 oracle 16 root 16 oracle 25 oracle 15 root 15 oracle 15 root 15 root 15 root 15 root 15 root 15 rlowenth 15 NI 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 SIZE 23480 29596 21768 1080 1504 2820 5852 1800 8284 200 25876 0 12612 26124 5836 RSS SHARE STAT %CPU %MEM 9872 956 R 59.8% user 4.>2. ra O le c le ac r O ly l & On na se er U nt I TIME CPU COMMAND 4:28 0 X 1:41 0 jre 0:15 0 jre 0:56 0 top 0:02 0 top 0:06 0 sproingies 0:08 0 rhn-applet-gui 0:12 0 snmpd 0:30 0 dbsnmp 0:08 0 syslogd 6:52 0 X 0:09 0 kjournald 0:04 0 rhn-applet-gui 9:01 0 X 0:12 0 rhn-applet-gui.4 2.2 1504 860 R 2. 303648k used. 378740k used. you can enter “?” to see a list of options.3 5.1 6452 1552 S 0. your system is running at capacity . 12 users.1 1048 420 S 2. 12 running. When top is run by root.3 3.6 2168 1100 S 0. 1 zombie.1 2. if you enter “u” and then type in “oracle” then your list of processes would include only processes started by oracle. 0 stopped CPU states: 69.6 0 0 SW 0.1 0. 6372k free. c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . 4.6% system 1. From within top. 287620k actv.3 0.5% nice 0.5 2.0 9M 824 R 0.32. 5.7 2144 1084 S 0.<1. For example. and you should investigate further using other tools such as sar or vmstat Full Output from the top Command 09:11:01 up 59 min.0 10M 812 R 0. you can kill processes directly from within top by using the “k” command.Is CPU a Bottleneck? (continued) • If your load factor is: .9% idle 37812k buff 90592k cached Many people do not realize that top is an interactive utility.5 728 540 S 0. you have CPU capacity to spare and it is unlikely that you are CPU bound .72 320 processes: 307 sleeping. but you can change that interval with the “s” command.0 11M 7864 S 0. 6384k in_c Swap: 779144k av. load average: 4.5 23.1 0.3 2636 2052 R N 1.9 0. CPU may be a bottleneck in your system.6 19M 1036 S 2.5 6.11 . The top displays’ default refresh rate is every two seconds.7 1.6 164 116 R 0. 0k in_d.5 0.03.1 0.Between 1 and 2.5 0.5 24M 1576 S 2. One more useful interactive command is “u” which allows you to identify a single user for the top display output.0% iowait Mem: 385112k av. 0k shrd.

All rights reserved. the ones listed in the slide are the most important. If you are experiencing performance problems. such as high rates of disk I/O or memory swap. User time indicates the time that is spent in executing code in the user space. Every application has a characteristic ratio of user to system. then there may be inefficiencies in the application code. ra O CPU Measurements Although there are dozens of different CPU measurements that you can look at. CPU Idle Time This indicates the amount of time that CPU is in an idle state. id (under the CPU heading) in vmstat. look for system activity. and CPU shows high idle time. These have the same meaning but slightly different labels depending on the tool that is used to view them. Idle time is labeled %idle in sar.12 . CPU Time Spent Executing User and System Codes These statistics have to be considered together. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . If the user code percent is significantly higher. System time measures the time that is spent in executing system calls. If the system code percentage is significantly higher.CPU Measurements Identify the following CPU statistics and interpret them: • CPU idle time • CPU time spent executing user code • CPU time spent executing system code • Processes waiting for CPU time (run-queue) Copyright © 2007. then the system is not CPU bound. Together they represent the useful work that is being done by the CPU. and idle in top. you should expect a ratio of approximately 60% user code to 40% system code. With an Oracle database. Oracle.

All the processes in the run queue are waiting for a time slice of the CPU. If the run queue size is more than one. mpstat. Obtaining CPU Measurements There are several ways to obtain the key CPU metrics.CPU Measurements (continued) run-queue size The run queue size indicates the number of processes that are ready to run. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . # vmstat <interval> <count> # mpstat -P <CPU> <interval> <count> # sar -u <interval> <count> # sar -q <interval> <count> # iostat -c <interval> <count> vmstat. Each of these tools gives a slightly different view of the same information about the CPU activity. Processes that are blocked (waiting on I/O or for other reasons) are not counted in the run queue.13 . performance could probably be increased by adding additional CPUs. and iostat get their information directly from the /proc file system.

In the partial listing in the slide: • cpu / us = CPU time spent executing user code • cpu / sy = CPU time spent executing system code • cpu / id = Idle CPU time • procs / r = Processes waiting for CPU (run-queue size) Other CPU metrics shown are: • procs / b = Processes in uninterruptible sleep • procs / w = Processes swapped out. All rights reserved. but runnable • system / in = Interrupts per second • system / cs = Context switches per second A full example of the vmstat command follows: ra O # vmstat 2 2 procs r b w swpd 0 0 0 78748 1 0 0 78748 le c le ac r O ly l & On na se er U nt I memory buff cache 97540 453688 97540 453688 swap si so 0 0 0 0 bi 4 0 io bo 60 8 in 11 106 c A de a y m free 48720 48716 system cs 42 141 us 3 0 sy 1 1 cpu id 96 99 Oracle Database 10g: Managing Oracle on Linux for DBAs 9 .Measuring CPU Activity with vmstat # vmstat <interval> <count> # vmstat procs r b w 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 2 5 … … … … … … system in cs 11 42 106 141 109 134 103 146 107 125 cpu us sy 3 1 0 1 0 0 7 1 0 0 id 96 99 100 92 100 Note: Memory and IO statistics removed for readability Copyright © 2007.14 . Oracle. Measuring CPU Activity with vmstat The output of vmstat shows the key CPU metrics measured over the specified interval and time period.

Measuring CPU Activity with mpstat Unlike the vmstat command.00 74.9-e. In a multiprocessor system.25 23.4.00 08:09:22 AM 1 12. the mpstat command allows you to drill down into CPU statistics by processor.25 32.00 42.3enterprise (delphi) 04/01/2003 08:12:14 AM 08:12:16 AM 08:12:18 AM 08:12:20 AM 08:12:22 AM 08:12:24 AM Average: cpu all all all all all all %user 30.00 0.00 31.3enterprise (delphi) 04/01/2003 08:09:21 AM cpu %user %nice %system %idle intr/s 08:09:22 AM all 19.00 111.00 08:09:22 AM 0 27. A full example of the mpstat command is as follows: $ mpstat -P ALL 1 1 Linux 2. this can give you a more detailed picture of what your CPUs are doing other than vmstat.00 0.50 1.25 65.00 31. Like the mpstat command.00 111. mpstat will not show you the run-queue size.50 39.70 %nice 0. the sar command returns information about the division of work within the system.15 .75 65.75 1.00 1.00 0.00 67.9-e.00 0.80 y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 .25 62.00 0.00 0.75 59.00 Measuring CPU Activity with sar You can also use the System Activity Reporter (sar) command to retrieve information about CPU performance.75 36.00 0.00 21.75 33.50 49.4. $ sar -u 2 5 Linux 2.75 1.50 0.50 ra O le c le ac r O ly l & On na se er U nt I c A de a %idle 67.00 %system 1.50 1.00 111. Unfortunately.

61 c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 .17 1.98 0.98 Also shown with sar -q are: plist-sz: Process list size showing the number of processes running in memory ldavg: The load average for the last minute and the last five minutes Measuring CPU Activity with iostat Although it is normally used to measure data flow to and from disk devices.98 0.16 . iostat also produces basic CPU statistics. $ iostat -c 2 3 Linux 2.98 0.3enterprise (delphi) 04/01/2003 avg-cpu: %user 3.16 1.50 ra O le c le ac r O ly l & On na se er U nt I %nice 0. you can use the sar –q command.05 %sys 0.3enterprise (delphi) 04/01/2003 08:12:30 AM 08:12:32 AM 08:12:34 AM 08:12:36 AM 08:12:38 AM 08:12:40 AM Average: runq-sz 1 1 2 1 1 1 plist-sz 79 79 79 79 79 79 ldavg-1 1.16 1. including the run-queue (displayed with sar as runq-sz).4.9-e.17 1.16 ldavg-5 0.83 %idle 95.Measuring CPU Activity with sar (continued) To monitor the processor queue.16 1.98 0.4.9-e.98 0. #sar -q 2 5 Linux 2.

Therefore. • On a properly sized system. %system is larger. the run-queue size should seldom be more than the number of CPUs. then it indicates that the application code must be tuned. A large run-queue size indicates a CPU bottleneck. ra O Interpreting CPU Measurements The key to understanding the CPU measurements is that CPU is consumed on behalf of the application. observe cases where the system has: • High idle time with poor response time • Too much time spent executing user code • Too much time spent executing system code • Run-queue size more than double the number of CPUs • Extremely high context requests per second Copyright © 2007. If the ratio is much lower.Interpreting CPU Measurements When interpreting CPU measurements. and swapping should be checked. • If the %user to %system ratio on the Oracle server processes is much greater than the 60:40 ratio expected. check the database application and tune the SQL. network. This means I/O. then look for I/O or virtual memory problems. This could indicate an undersized system or possibly insufficient memory. that is.17 . if an Oracle instance and processes are consuming all the CPU resources. Oracle. Some key points to consider when interpreting CPU measurements are: • High idle time with poor response time indicates that the processes are getting blocked. All rights reserved. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . then check sar -wW or vmstat for swapping and switching activity. If the run-queue size is greater than two times the number of CPUs available.

This situation is called thrashing. more memory is required. and more CPU overhead is required to process the paging and context switching requests. paging takes place.Interpreting CPU Measurements (continued) • Each process takes virtual memory. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 .18 . This can continue until the CPU spends most of its time paging and switching. As more processes are added. When more process memory is required than is available in real memory.

For example. and batch jobs could run at night rather than during the day. but it is usually difficult or expensive unless you are working in a grid system. The use of system process priority manipulation to assign resources to more important processes is not recommended for Oracle processes because Oracle has its own built-in process management system. and that too many batch jobs cannot be started simultaneously. Therefore. ra O Reducing CPU Bottlenecks CPU is usually a finite resource. index rebuilds. you usually concentrate on either using existing resources more efficiently or offloading unnecessary work to other systems. Using Your CPU More Efficiently There are some basic things you can do to make your CPU more efficient: • Schedule non-time-critical jobs to run during times when CPU is less loaded.Reducing CPU Bottlenecks If you determine that CPU is the limiting factor in your system: • Increase CPU resources • Decrease CPU demand • Schedule CPU demand more efficiently Copyright © 2007. Oracle.19 . Sometimes it is possible to increase CPU resources (upgrade the processor or add additional processors). • Reduce the demand on your CPU by eliminating unnecessary work or offloading work to a different server. • Employ a resource management system (such as Oracle Resource Manager) to ensure that your most important jobs are serviced first. database backups. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . All rights reserved. optimizer statistics collection.

All rights reserved. Monitoring and Tuning Memory In addition to the tools listed in the slide.Monitoring and Tuning Memory Tools for monitoring and tuning memory include: • top • free • vmstat • sar -B • xosview • System Monitor Gnome System Monitor Copyright © 2007. a great deal of information about system memory use can be obtained from the /proc virtual file system. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . Oracle.20 .

A context switch takes place each time the CPU starts working on a different process. A well-tuned memory reduces the I/Os by caching frequently used pages. Physical memory is labeled mem in these tools. Context Switches Context switches can be seen in vmstat under the system group of columns. They are in the column labeled cs. Poorly tuned or insufficient memory often shows up first as an I/O bottleneck with high activity on the swap partition. Significant memory statistics include: • Total memory • Context switches • Pages in and out • Inactive pages • Demand rate Page out Page in Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . All rights reserved. or cat /proc/meminfo to find the total memory on your system. Oracle.21 . Total Memory Use free. and other housekeeping details are taken care of. In a context switch. the TLB is reloaded for the new process. Linux uses the buffer cache and page cache memory to increase performance.Measuring Memory Usage Measure memory utilization and paging. Measuring Memory Usage The instance uses SGA memory to increase performance. top.

it may indicate that the SGA is too large. It is shown as the inatarpg column with sar -B. A page in operation occurs when a memory page is pulled from virtual memory back to RAM. If the pages in increases significantly after an increase in SGA size. the system needed to make “free” to meet memory demands. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . Inactive Pages This is also known as free or freeable memory. Inactive “dirty” pages are free but must be written to disk before they can be used. within the last minute. The swap process frequently moves a few pages out to swap to be sure that free pages are always available for page in operations.22 . Demand Rate This is also known as “Inactive Page Target. This is the goal the kernel tries to reach to make sure that there are enough inactive pages available. the pages in increase.Measuring Memory Usage (continued) Pages Out Pages out and pages in are measured in 1 KB blocks.” This is one of the most important memory statistic. Inactive “clean” pages can be immediately replaced by other memory pages. This is a key measurement when adjusting the SGA size for the database. even though the memory page size is 4 KB. As more processes start and require memory. This value may also be seen as inact_target in /proc/meminfo. The value shown is the average number of pages per second. This means that all the processes fit in real memory. a page in is registered. Pages In The number of pages in is a good measure of RAM shortage. and should not be a cause for concern as some “page out” activity is normal. Ideally. the number of pages moved to swap increases. the average pages in over time is near zero. As more pages of real memory are needed. Pages out are seldom zero. As processes access pages that are not mapped or have been paged out.

0% idle Mem: 512284K av.33 235 processes: 231 sleeping. In the header portion. 0. Remember that individual process memory reported with top is meaningless for Oracle processes because shared memory is reported for each process. All rights reserved.65.4 0 1188 1188 832 R 0. memory used. 0.7% system.0 0. 0 zombie.5 13. 508348K used. 3936K free.23 .2 0 508 460 460 S 0. the Mem line shows total physical memory. 4 users. 115088K used. 0 stopped cpu states: 40. 59.7 1.Measuring Total Memory #top #free #cat /proc/meminfo Copyright © 2007. 4 running. and amount of memory in the page cache in kilobytes.3 0. shared memory. 0. Oracle.0% nice.0 0 0 0 0 SW 0.0 0.2% user.0 0 86360 67M 54228 S 0. 0. 5200K shrd.02. load average: 1. #top 9:12pm up 15:44. free memory. Measuring Total Memory The top command gives an excellent overview of the system activity. amount of memory in the buffer cache. 67428K buff Swap:522072K av.0 c A de a y m TIME 2:10 0:10 0:00 0:04 0:00 COMMAND Xvnc java top init keventd Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . 406984K free 242740K cached PID 1017 20866 1212 1 2 ra O le c USER root oracle root root root le ac r O ly l & On na se er U nt I PRI 15 15 16 15 15 NI SIZE RSS SHARE STAT %CPU %MEM 0 5944 5544 4360 S 0.

# cat /proc/meminfo total: used: free: shared: Mem: 1054806016 1029685248 25120768 0 Swap: 534601728 22032384 512569344 MemTotal: 1030084 kB MemFree: 24532 kB MemShared: 0 kB Buffers: 133740 kB Cached: 585920 kB SwapCached: 17272 kB Active: 674312 kB ActiveAnon: 214892 kB ActiveCache: 459420 kB Inact_dirty: 0 kB Inact_laundry: 159476 kB Inact_clean: 14016 kB Inact_target: 169560 kB HighTotal: 130524 kB HighFree: 2032 kB LowTotal: 899560 kB LowFree: 22500 kB SwapTotal: 522072 kB SwapFree: 500556 kB HugePages_Total: 0 HugePages_Free: 0 Hugepagesize: 4096 kB buffers: 136949760 cached: 617668608 ra O A few key statistics from the meminfo output are: • Mem: The current state of physical RAM in the system. • Active: The total amount of buffer or page cache memory that is in active use • Inact_dirty: Buffers that might need writing to disk or swap. free. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 .24 . • SwapFree: The total amount of swap free. This is the goal the kernel tries to reach to make sure that there are enough inactive pages available. It should be relatively low.Measuring Total Memory (continued) The free command also shows total memory and swap usage. shared. The -/+ buffers/cache line indicates the adjustment to free and used memory by the kernel’s disk buffers and page cache (how much a process could get if it requested it—the kernel will dump its own page cache and disk buffers to support running processes): #free total Mem: 512284 -/+ buffers/cache: Swap: 522072 used 506880 198700 114884 free 5404 313584 407188 shared 5200 buffers 68196 cached 239984 All the utilities that collect statistics gather information from the /proc file system. buffered. including a full breakdown of total. • Inact_target: Demand rate. The virtual meminfo “file” gives an instantaneous snapshot of memory usage. used. It is usually very low. and cached memory utilization in bytes • MemFree: The amount of physical RAM left unused by the system. It should not stay below 20% of SwapTotal.

# sar -B 2 3 Linux 2. sar The System Activity Reporter (sar) has many options.00 420. The inactive target is the demand rate.00 11680.3 (EDD1R28P1) 08:19:03 08:19:05 08:19:07 08:19:09 Average: PM PM PM PM 02/26/2003 activepg 85630 85968 88629 87859 pgpgin/s pgpgout/s 1994.25 .40 ra O le c le ac r O ly l & On na se er U nt I inadtypg 18848 23722 4175 12015 c A de a y m inaclnpg 4802 3605 20266 12492 inatarpg 32733 32733 32733 32733 Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . inaclnpg.00 940. and inactive target pages (inadtypg. inactive clean.00 1898. inatarpg).00 126. the number of active pages (activepg).Measuring Memory with sar #sar -B <frequency> <count> #sar -R <frequency> <count> #sar -B 2 3 #sar -R 2 3 Copyright © 2007. Oracle. pgpgout/s).9-e. All rights reserved.80 5554. The -B option shows pages in and pages out per second (pgpgin/s. and the inactive dirty.4.00 2934.

00 -1. # vmstat procs r b w 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 2 5 swpd 296004 296004 296004 296004 296004 free 3092 3076 3076 3072 3076 buff 73268 73268 73268 73268 73268 memory cache 61324 61324 61324 61316 61300 si 0 0 0 0 0 swap so 3 0 0 0 0 bi 11 0 0 0 2 io bo 51 2 32 24 10 system in cs 135 588 109 372 109 199 110 331 107 373 ra O le c le ac r O ly l & On na se er U nt I c A us 10 66 59 40 51 de a sy 4 34 41 60 49 cpu id 86 0 0 0 0 y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 .9-e.26 . vmstat samples every two seconds for a total of five samples. frmpg/s. Pages in are represented by “si” and pages out are shown with “so. and count is the number of samples to take. The following example shows a loaded system.00 0.50 -4. Frequency is the number of seconds between samples. and campg/s.30 vmstat The vmstat command has two parameters: frequency and count.00 0.50 140. and cache pages used.00 -1.00 0.10 shmpg/s 0.10 campg/s -109.” Note: The first line of output includes all activity since the last vmstat report.50 -4.00 02/26/2003 bufpg/s 0. the number of additional shared memory pages.00 -61.4.sar (continued) The -R option shows the number of pages freed per second.50 -93.00 0. Negative values indicate fewer pages used. # sar -R 2 3 Linux 2. bufpg/s. shmpg/s.3 (EDD1R28P1) 08:18:47 08:18:49 08:18:51 08:18:53 Average: PM PM PM PM frmpg/s 0. In this example. buffer pages. but with little swapping. The first output line of vmstat shows all the activity since the last reboot.50 3.

The key to using memory statistics is measurement over a period of time. (Earlier Linux kernels did not release file cache quickly enough. observe cases where the system has: • High swap memory usage • Kernel file cache that continue to be allocated despite low system memory • High page ins/page outs • Low inactive pages Copyright © 2007.) ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . This. You can use the average demand rate (when the system performance is acceptable) as a baseline to compare with when the system performs poorly. Kernel File Cache Continues to Be Allocated Despite Low System Memory This may be an indication of kernel problems. High Swap Memory Usage Indicates memory demand is too high for the available RAM. Interpreting Memory Measurements Remember that a single measurement is meaningless.27 .Interpreting Memory Measurements When interpreting memory measurements. If this is consistently high. may indicate memory problems. then consider adding RAM. Oracle. All rights reserved. along with the pages in over the same time periods.

or that the SGA needs to be “locked” into RAM. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . The best solution is to increase RAM. then set lock_sga=true to lock the SGA into RAM.28 .Interpreting Memory Measurements (continued) High Page Ins This can indicate that the SGA is too large for available memory. then use the hugepages feature. Note that this requires the oracle user to have the CAP_IPC_LOCK privilege granted through and advanced permissions management system such as the Linux Intrusion Detection System (LIDS). If using a nonenterprise kernel. Low Inactive Pages This indicates that you do not have enough memory. If you are using a supported enterprise distribution.

• Use Linux hugepages. • Identify nonessential memory consumption and eliminate it. Reducing Memory Bottlenecks All the solutions are in the form of Use less memory or Get more memory. Without restricting the number of users.29 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . • Reducing the SGA is not usually acceptable. Are you using the Java Virtual Machine (JVM)? If not. • Reduce the number of user processes. then: • Increase memory resources • Decrease memory demand Copyright © 2007. the number of user processes can be reduced by using shared servers if the workload supports them. reduce JAVA_POOL_SIZE to zero. your server certainly will. Look for running non-Oracle processes and eliminate those you can do without. • Reduce the amount of process memory with PGA_AGGREGATE_TARGET. • Add memory to your server. but check the installation and configuration. Can your buffer cache be reduced without affecting performance? Although the SGA would not complain about excessive pool sizes (within reason). Oracle.Reducing Memory Bottlenecks If you determine that memory is the limiting factor in your system. All rights reserved.

HP/Compaq. Network Appliance. such as sar and iostat. All rights reserved. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . but tend to show I/O measurements from the operating system’s point of view rather than from a hardware standpoint. If you are using the Just a Bunch Of Disks (JBOD) technology. Tools such as sar and iostat are common. and Veritas.Monitoring and Tuning I/O You should monitor the I/O across all devices to balance which device gives the best overall performance. Oracle. such as EMC. If your hardware includes large storage arrays from vendors. then the information provided by operating system tools. should be sufficient. Tools for monitoring I/O include: • /proc file system • sar -d • iostat –d -p • vmstat • xosview Copyright © 2007. Monitoring and Tuning I/O Which tools you use to tune disk I/O really depend on your storage system.30 . then you will normally use monitoring tools provided by your vendor.

you should troubleshoot it as a memory issue first.31 . Remember that virtual memory is maintained on disk.Is I/O a Bottleneck? Is I/O a bottleneck? • Take and retain baseline I/O measurements. Oracle. Most I/O measurements are meaningless without a baseline. If you spot high I/O statistics on the swap partition. Disk I/O is the single largest performance cost. All rights reserved. and will also show up as I/O. then address it as an I/O issue. Is I/O a Problem? With databases. I/O monitoring should be done over time. • I/O issues with the swap partition should be treated as memory problems first. Copyright © 2007. • Individual measurements (snapshots) are usually of little value. When you notice performance degradation. so ensure that you capture and retain that. look for high queue and wait statistics to determine whether I/O is the culprit. disk I/O is a primary concern. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 .

and service time (how long does each I/O operation take from start to finish). Volume Obviously. ra O I/O Measurements I/O measurements usually concentrate on either the volume of data being handled or the speed with which that data is handled. the wait time is the most important from a database performance standpoint.32 . if your tools allow you to view it.I/O Measurements I/O measurements concentrate on volume and speed: • Read I/O operations • Write I/O operations • Request queue size • Transfer rate • Wait time • Service time Copyright © 2007. monitor sequential operations as compared with random access. Oracle. look for transfer rate (bytes per second). Speed When monitoring speed. All rights reserved. Of these three. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . Also. look at read and write volume separately. wait time (how much time was spent waiting for I/O to respond). It is usually quicker to write 1 MB of sequential data than to write 20 KB in multiple locations on the disk because of the time required for disk head positioning. When you measure volume. the more work that is being done the longer it will take to do that work.

Volume measurements for read and write operations can be seen in the blk_wrtn and blk_read columns. The first report provides statistics concerning the time since the system was booted. Subsequent reports cover the time since the previous report.33 . use: iostat –d -p <interval> <count> ra O The iostat -p command presents the I/O statistics by partition with the same statistics that can be seen from V$FILESTAT on database files. To see I/O activity by partition. -x and –p are mutually exclusive and cannot be used together): iostat –d –x <interval> <count> le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 . Oracle. Blk_read/s and Blk_wrtn/s columns.01 60104671 102704241 • I/O activity by partition iostat –d -p <interval> <count> Copyright © 2007. To view I/O statistics by device. use (the –d option suppresses CPU statistics): iostat -d <interval> <count> Transfer rate is shown by the tps. Measuring I/O with iostat The iostat command is used for monitoring system I/O device loading by observing the time the devices are active in relation to their average transfer rates.Measuring I/O with iostat I/O measurements concentrate on volume and speed: • Read I/O operations • I/O statistics by device iostat -d <interval> <count> #iostat -d 2 2 Linux 2. All rights reserved.16 84. use (the -d –x option.6.EL (HOSTNAME) 10/27/2006 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn hda 4.9-22. To display extended statistics by device.85 49.

26 8.50 wkB/s 41. Service time. and sectors handled per second as rsec/s and wsec/s.40 rkB/s 24.99 svctm 2.02 0.51 0.34 70.6.44 10/27/2006 w/s 2.39 rsec/s 48. ra O le c le ac r O ly l & On na se er U nt I Blk_read/s 49.00 0.08 0.52 Blk_read 59993375 15083 1595 2806293 57168926 Blk_wrtn 102593945 5179 70 2932664 99656032 As you can see in the above example.Measuring I/O with iostat (continued) Speed measurements are shown in three ways: merged requests as rrqm/s and wrqm/s (how many operations were performed).83 %util 1.60 10/27/2006 Blk_wrtn/s 83.89 wsec/s 83. avgqu-sz is a key metric that shows the length of the request queue (this is the I/O equivalent of CPU load).77 c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 9 .EL (EDRSR24P1) Device: hda hda1 hda2 hda3 hda5 tps 4.34 .92 <would normally appear on same line as above> Device: avgrq-sz avgqu-sz await hda 27. hda5 is the only partition that is really affecting system performance.08 #iostat -d -p 2 2 Linux 2. %util is the percentage of time the CPU spends handling I/O requests.EL (EDRSR24P1) Device: hda rrqm/s wrqm/s 0. appears as svctm. another key metric. The output of the following command has been reformatted to fit the page.09 r/s 2.9-22.await gives the average wait time for requests.93 0.59 12.40 81. requests as r/s and w/s (how many requests were made of the I/O system).30 46. # iostat –d -x 2 2 Linux 2.00 2.9-22.00 0.01 0.6.84 0.00 2. Volume statistics are shown including average requests size avgrq-sz.

Measuring I/O with sar sar –b shows transfer rate as tps. The transfers are broken down into read/write with rtps/wtps showing the number of requests per second and bread/s and bwrtn/s showing the number of data blocks per second. sar –d shows transfer rates and blocks per second per device. # sar -d 2 2 02:57:44 PM DEV tps blks/s 02:57:46 PM dev3-0 6.50 96.00 02:57:46 PM 02:57:48 PM Average: Average: DEV dev3-0 DEV dev3-0 tps 1.50 tps 4.00 blks/s 112.00 blks/s 104.00

Remember that sar can show history information for up to one month in the past, so this tool allows you to easily compare current rates with historical figures. Measuring I/O with vmstat vmstat provides information on overall I/O throughput. • bo: Blocks sent to the storage array (write) • bi: Blocks received from the storage array (read)
# vmstat 3 3 procs r b w swpd 1 0 0 424800 2 0 0 424800 3 0 0 424800 memory cache 376516 376516 376516 swap si so 0 0 0 0 0 0 io bo 58 11 56

ra O

le c

le ac r O ly l & On na se er U nt I

free 12540 12536 12536

buff 84636 84636 84636

bi 10 0 0

system in cs us 3 31 12 107 451 1 110 451 1

c A

de a

y m

cpu sy id 5 24 0 99 0 99

Oracle Database 10g: Managing Oracle on Linux for DBAs 9 - 35

Interpreting I/O Measurements

Look for changes from baseline measurements, especially in queue size or wait times: • High volume or queue size across multiple devices • High volume or queue size for one device • High wait times without corresponding high queue sizes

Copyright © 2007, Oracle. All rights reserved.

Interpreting I/O Measurements Like memory measurements, the key to using I/O statistics is measurement over a period of time. Take periodic measurements of I/O volume and speed so that when performance degrades, you can identify probable problem devices. High Request Volume or Queue Size Overall This indicates that the I/O devices are unable to handle the rate of I/O requests. This means that there are either not enough channels to I/O devices or that existing channels are too slow. High Request Volume or Queue Size for One Device It indicates that I/O may not be properly balanced across available devices. High Wait Times If wait times are high and queue size is not, verify whether asynchronous I/O is being used if the storage arrays supports it. If not, ensure that I/O slaves are in use. This may also be indicative of hardware problems.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 9 - 36

Reducing I/O Bottlenecks

To reduce I/O as a bottleneck: • Reduce the volume of I/O through application and memory tuning • Increase I/O throughput by parallelizing I/O
– Multiple disk controllers – Multiple disks – Multiple data bus adapters

• Select your hardware carefully, and build your storage arrays with performance in mind • Separate redo, data, and index files

Copyright © 2007, Oracle. All rights reserved.

ra O

Reducing I/O Bottlenecks A good rule of thumb is to tune the application and memory to reduce or eliminate I/O as much as possible. When this is accomplished, balance the remaining I/O across all the available drives and controllers. In general, the more disks and controllers you are working with, the greater your I/O performance can be. Carefully consider how your storage arrays are built. If you mix drives with different performance characteristics, keep the fastest drives on a different bus than the slowest drives. The controller bus speed is limited to the speed of the slowest device. More data channels means more data bandwidth. Consider adding additional Host Bus Adapters (HBAs). If you are using Redundant Arrays of Inexpensive Disks (RAID), choose hardware-based RAID over software-managed RAID. Software-managed RAID consumes CPU and memory resources and seldom performs as well as hardware-based RAID. Additionally, RAID 5 generally performs well for read operations, but poorly for write due to the parity calculations required. Try to minimize the number of stripe columns in RAID 5. More columns means more calculations to generate the parity bit. Remember to place files with different requirements on different disks. For example, your redo log members should be placed on separate disks (away from data and control files) and should be on your fastest disks, bus, and controllers.

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 9 - 37

Summary

In this lesson, you should have learned how to: • Use Linux monitoring tools • Interpret memory measurements • Interpret I/O measurements

Copyright © 2007, Oracle. All rights reserved.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 9 - 38

Practice 9 Overview: Using Linux Measurement Tools
This practice covers using: • sar to measure CPU loads • vmstat to measure memory usage • iostat to measure disk I/O loads

Copyright © 2007, Oracle. All rights reserved.

Practice 9 Overview: Using Linux Measurement Tools For detailed instructions on performing this practice, see Practice 9 in Appendix A.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 9 - 39

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Tuning Oracle on Linux

Copyright © 2007, Oracle. All rights reserved.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Objectives

After completing this lesson, you should be able to do the following: • Tune supported file systems • Configure initialization parameters • Implement asynchronous input/output (I/O) • Implement advanced memory management techniques

Copyright © 2007, Oracle. All rights reserved.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs 10 - 2

This decreases the I/O requirements for the system tablespace. depending on the application. Size the cache according to the db_cache_advice feature in Oracle Enterprise Manager. Use a larger database buffer cache (within reason). Starting with Oracle9i Release 2. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 . The larger the cache. each database block that can be cached and reused improves performance. even the system tablespace may be locally managed.3 . • Use Automatic Shared Memory Management. LMT reduces I/O by managing the extent allocation within a file with a bitmap in that data file instead of updating tables in the data dictionary. the more data blocks can be cached. • • • • • Copyright © 2007. Basic Oracle Database Optimizations Oracle Database has a set of well-known (but often overlooked) features that enhance performance. Use an appropriately sized database block. Performance increases of 2% to 15% have been documented using LMT. Do not make the cache so large that paging increases or (in extreme cases) it takes longer to search for a block in memory than it would have to just read the block from disk. Because a disk access takes much longer than a memory access. Use multiple database writer processes on Symmetric Multiprocessing (SMP) machines. Locally Managed Tablespaces Locally Managed Tablespaces (LMT) are the default in Oracle Database 10g.Basic Oracle Database Optimizations Use locally managed tablespaces (default). Larger Database Buffer Cache The database instance caches the most recently used blocks in the database buffer cache. All rights reserved. Use a larger redo log buffer. Performance gains depend on the amount of reuse in the data blocks.

Tests have shown that the best block size is usually 8 KB. As the blocks get larger. If your application has these characteristics.Sizing Database Blocks The DB_BLOCK_SIZE parameter should be set according to the type of application: • 8 KB block size gives good overall performance. the page size is 4 KB but (as discussed in the lesson titled “Linux Measurement Tools”) can be increased to 2 or 4 MB using hugepages. which then reduces the likelihood of concurrent access. Sizing Database Blocks The size of the database block has a large impact on the performance of the application. • Larger blocks reduce the amount of overhead for data warehouse/decision support system (DW/DSS) applications. The database block should also be the same size or a multiple of the file system block size. Copyright © 2007. The database block must always be the same size or a multiple of the memory page size. Oracle. OLTP Applications An online transaction processing (OLTP) application is characterized by a large number of concurrent users and relatively small transactions. • Smaller blocks give better concurrency with OLTP applications. Smaller blocks reduce the number of rows in the block. The block size on the ext3 file system is 4 KB. This leads to “buffer busy” waits. All rights reserved. because only one process can access a block at a time. then consider setting DB_BLOCK_SIZE to 4 KB. Other file systems may use other block sizes. the probability of two or more users requesting access to the same block simultaneously also increases. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 . On Linux.4 .

a 20-level index is chosen to simplify the mathematics. an index would seldom get that large. meaning n should be three or less. To illustrate the effect of the block size on an index. assume a 2 KB block size and a 20-level index. Ideally. so that half as many leaf blocks would be used. If this index were in a database with 4 KB block size. consider a very large OLTP application such as credit card processing. This lookup may require n I/Os for an n-level index. Because of this. The first-level branch blocks would hold twice as many leaf pointers. use the largest block size available (16 KB on 32-bit Linux). The indexes may get quite large.5 . Continuing with this exponential reduction in branches would reduce the number of levels to five. This significantly improves the performance of index lookups. the index is no more than three levels deep. and increases the number of rows per block. This reduces the percentage of space used by block headers.Sizing Database Blocks (continued) DSS/DW Applications Data warehouse–type applications are characterized by large data sets and frequent full table scans. or consider using partitioned indexes. but there would be only half as many leaf blocks. finally reaching the leaf block. then each leaf would hold at least twice as many index row entries. thus reducing the number of I/Os by packing more data into the same number of bytes. Realistically. so the number of first-level branch blocks would be reduced to 1/4 of the original index. if the blocks needed are not already in the cache. In the following example. Effect of Block Size on Indexes In databases with large tables and small database blocks. In this case. The first index required 20 reads for an index lookup. and the rebuilt index requires five reads. This process continues to the n-1 level branch. you may want to use a larger block size if the application has very large indexes. the set must be read from disk. Because the data sets are so large that the database buffer cache cannot hold the full set. Index lookups are always done serially: first the root block is accessed. which is the nth level. and then the first-level branch block is accessed. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 .

If the LGWR process cannot write to the log files fast enough to clear space in the log buffer for other processes that are attempting to execute DML statements. there will be a log buffer space wait event. The server process does not report Commit complete to the user until the redo information has been written to the redo log file. Increasing the size of the LOG_BUFFER can reduce or eliminate these waits. For example. An optimal setting for LOG_BUFFER varies with application. When the current log file is full. • Increase the size of the LOG_BUFFER parameter. if there is no space in the log buffer at the time an attempt is made to write to it.6 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 .LOG_BUFFER and Redo Log File Increasing the size of the redo log components can help the performance of high data manipulation language (DML) applications. High-volume DML applications can benefit from a LOG BUFFER set to something higher than the default value. All rights reserved. then various wait statistics are incremented. The minimum LOG_BUFFER size is 64 KB. Oracle. • Tune the redo log file and archive log file transfers first. a log file switch occurs. Copyright © 2007. LOG_BUFFER and Redo Log File Every DML statement produces some amount of redo information. This data must be written to the redo log files on commit. • Examine performance reports for waits on the redo log components.

You want to eliminate these waits and at the same time. For details. the processes trying to write into the LOG_BUFFER have to wait. Redo log files in the range of tens to hundreds of megabytes are considered reasonable. A tentative guideline is to size them such that the log file switch occurs every 20 to 30 minutes.LOG_BUFFER and Redo Log File (continued) Sizing redo log files is dependent on the speed at which redo is generated. do not want to size the files so large that they become unmanageable. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 . and a wait event log file completion is recorded. refer to the Oracle Database 10g: Performance Tuning course and the Oracle Database 10g Performance Tuning Guide.7 . If the switch is delayed for any reason.

Advanced Features of Oracle Server There are a few advanced initialization parameters that affect performance on Linux: • DB_WRITER_PROCESSES • DBWR_IO_SLAVES • PRE_PAGE_SGA Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 . Advanced Features of Oracle Server The parameters listed here are considered advanced parameters. The parameters listed in the slide are the ones that are most affected by the OS. Oracle.8 . All rights reserved. Very few initialization parameters depend on the OS.

If your CPU_COUNT = 20. then all the DBWR processes make use of it. For example. DB_WRITER_PROCESSES is set to one. but this may not be enough. All rights reserved. up to 20. The next step is to increase the number of DB_WRITER_PROCESSES. Release 2.Multiple DBWR Processes DB_WRITER_PROCESSES: • These processes are set to no more than CPU_COUNT.9 . This starts the specified number of DBWR processes. Too many DB_WRITERS_PROCESSES can cause contention for the controller channel. The usual first step is to increase the DB_CACHE_SIZE. The value of DB_WRITER_PROCESSES must be adjusted incrementally. Oracle. with between one and eight CPUs. When increasing the number of DB_WRITER_PROCESSES. the standard configuration of the DBWR process may not be able to write changed data blocks back to the disk fast enough to maintain the pool of free buffers for new blocks coming into the database buffer cache. then DB_WRITER_PROCESSES is set to three. • Multiple DBWR processes write from LRU to disk. consider the number of disk controllers that are available and monitor the disk I/O queues. • These processes can use asynchronous I/O. The default value for DB_WRITER_PROCESSES is (CPU_COUNT+7)/8. Each DBWR process handles one or more LRU lists moving dirty buffers to the disk for those lists. Multiple DBWR Processes In high-volume OLTP databases. LRU lists DBWR processes Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 . • These processes are best used in OLTP environments. This can be up to 20 as of Oracle9i. If asynchronous I/O is turned on.

Note: The use of multiple DBWR processes and I/O slaves are mutually exclusive. This area is taken from the large pool if it is configured. the overhead of all the processes may outweigh the benefit of the additional processes. and sets the number of slave processes used by the ARCH and LGWR processes to four.10 . consider the number of disk controllers and monitor the disk I/O queues for contention. Turning on DBWR_IO_SLAVES forces DB_WRITER_PROCESSES to one. Even though I/O slaves are generally used to simulate asynchronous I/O. Oracle. or from the shared pool if the large pool does not exist. the database instance provides a way to simulate asynchronous I/O with the DBWR_IO_SLAVES.DB Writer Slaves DBWR_IO_SLAVES: • Used to simulate asynchronous I/O • One DBWR. because each of these processes has an overhead cost. the slaves use asynchronous I/O if it is turned on. add only a few at a time. multiple writers to disk Buffer cache DBWR I/O slaves Copyright © 2007. when increasing the number of slaves. If you add too many at once. Also. When increasing DBWR_IO_SLAVES. All rights reserved. Set this parameter to no more than two times the number of disks that the database is spread across. Each slave must have a communication area for I/O buffers. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 . DB Writer Slaves On systems without asynchronous I/O capability.

Unused pages in the SGA are not mapped to physical memory until they are used. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 . – The SGA could slow connection processing. so that when they are required later.Changing SGA Behavior • Normally. and pages in the SGA that are not frequently used may be paged out. Copyright © 2007. Set PRE_PAGE_SGA = true only when there is sufficient real memory to hold the entire SGA. If some pages are swapped out. All rights reserved. unused memory allocated to the System Global Area (SGA) is not mapped to the physical memory until it is used. The disadvantage is that with large number of pages. further reducing performance. thus increasing the connection time. This in turn may force other more active pages to swap. The PRE_PAGE_SGA initialization parameter causes each server process that starts to touch every page of the SGA. they will be already mapped. • To touch all the SGA at startup. Oracle. use PRE_PAGE_SGA: – The SGA is mapped to physical memory.11 . those pages have to be swapped in for the touch. This has the advantage of mapping all the SGA pages to physical memory. Changing SGA Behavior The normal behavior is that shared memory up to SGA_MAX_SIZE is allocated and set up in virtual memory at startup. each server process that starts touches all the pages. and infrequently used pages are paged out.

12 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 . For example. and relieves you of having to configure these components manually. When the data analysis and reporting batch job starts up later. the ASMM feature significantly simplifies Oracle database administration by introducing a more dynamic. Automatic Shared Memory Management Automatic Shared Memory Management (ASMM) is another key self-management enhancement in the Oracle database. when the OLTP job runs. the memory is automatically migrated to the large pool so that it can be used by parallel query operations without producing memory overflow errors.Automatic Shared Memory Management • Automatically adapts to workload changes • Maximizes memory utilization • Helps eliminate out-of-memory errors Buffer cache Example: Large pool Shared pool Java pool Streams pool Online users Shared pool Java pool Streams pool Batch jobs Buffer cache Large pool Copyright © 2007. in a system that runs large online transactional processing (OLTP) jobs during the day (requiring a large buffer cache) and runs parallel batch jobs at night (requiring a large value for the large pool). flexible. the buffer cache grabs most of the memory to allow for good I/O performance. This functionality automates the management of the most important shared memory structures used by an Oracle database instance. and adaptive memory management scheme. Oracle. you would have to simultaneously configure both the buffer cache and the large pool to accommodate your peak requirements. All rights reserved. Besides making more effective use of available memory and thereby reducing the cost incurred for acquiring additional hardware memory resources. With ASMM.

• Use the latest supported kernel. For database files. change it for a file system by changing the /etc/fstab file and adding the noatime option to the fourth column. Oracle. this is not an important statistic and you can turn it off to reduce the number of I/Os. This ensures that you are using the most efficient kernel available. By default.noatime 1 1 ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 .rpm files provided by the distribution vendor.13 . Copyright © 2007. Basic Linux Optimizations Apply the latest supported kernel patches through the . the last time-read attribute (atime) is updated every time a file is read. This parameter can be set for a file with chattr +A <filename> or for a directory with chattr R +A <directory name>. /dev/hdb7 /u3/app/oracle/ ext3 rw. To make this change persistent across reboots. • Turn off last time-read updates for the database files. All rights reserved.Basic Linux Optimizations Basic changes to the Linux default setup can give some performance improvements.

3. the installer chooses an smp kernel. and install the kernel that uses your hardware and gives a good performance. then the three-level page table is an extra overhead that is not required. then use the smp kernel. so if you have less than 4 GB of physical RAM. Copyright © 2007. The uniprocessor kernel handles up to 4 GB of physical memory on a single processor. (Note that there is no special designator. For multiprocessor machines.) An enterprise or smp kernel may be used on a uniprocessor machine. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 . • Otherwise. For machines with more than 4 GB of physical memory. If you have to choose which kernel to use. an enterprise kernel is required. but has extra overhead associated with the unused features. This includes a three-level memory page table. The enterprise kernel includes the Physical Address Extensions (PAE) that are required to address more than 4 GB of physical memory. All rights reserved. then use the enterprise or hugemem kernel.9-e. The smp kernel has the required extensions to handle scheduling processes on more than one CPU. follow these guidelines.Choosing a Kernel Choose the appropriate kernel for best performance: • If you have more than 4 GB of physical memory. An example of the uniprocessor name is 2.4.14 . use the uniprocessor kernel. • If you have more than one CPU. Choosing a Kernel The Linux installers tend to make good choices about which kernel to install.

you should have learned how to: • Evaluate file systems • Tune supported file systems • Configure initialization parameters • Implement asynchronous input/output (I/O) • Implement advanced memory management techniques Copyright © 2007. Oracle. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 . All rights reserved.Summary In this lesson.15 .

16 . Oracle. All rights reserved. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 10 .Practice 10 Overview: Tuning Performance This practice covers the following topics: • Adjusting the block size of database objects • Identifying poorly performing sessions at the operating system level Copyright © 2007.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m . All rights reserved. Oracle.Debugging Oracle on Linux Copyright © 2007.

All rights reserved. Oracle.2 . you should be able to: • Install and configure OS Watcher • Use Oracle Support’s Remote Diagnostics Agent • Trace programs and processes with strace • Gather required information for resolving ORA-600 and ORA-7445 errrors Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 .Objectives After completing this lesson.

The MetaLink note contains the link for downloading OS Watcher. netstat and iostat.1. Oracle. Note: For more details. refer to the OS Watcher user’s guide in MetaLink note 301137. collecting information about: • Processes • I/O • Memory • Network Copyright © 2007. All rights reserved.OS Watcher OS Watcher (OSW) is a set of scripts that continually run in the background.3 . invoking such utilities as vmstat. OS Watcher OS Watcher (OSW) is a collection of shell scripts intended to collect and archive operating system and network metrics to aid support of generic performance issues. OSW operates as a set of background processes on the server and gathers OS data on a regular basis. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 .

At that point.sh 14 2005 tarupfiles.net 5 2005 OSWatcherFM.4 . The parent directory of all the extracted files is called osw. All rights reserved.sh 21 2005 oswsub.Installing OSW $ tar -xf osw.tar file. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . Untar the osw.sh 16 2004 stopOSW.sh 22 2005 README 18 2005 startOSW. the software is installed. Oracle.sh 18 2005 topaix.tar $ cd osw $ ls -gG total 56 drwxr-xr-x 11 4096 -rwxr-xr-x 1 1731 -rwxr-xr-x 1 4451 -rwxr-xr-x 1 10231 -rwxr-xr-x 1 334 -rwxr-xr-x 1 401 -rw-r--r-1 3029 -rwxr-xr-x 1 1101 -rwxr-xr-x 1 560 -rwxr-xr-x 1 57 -rwxr-xr-x 1 409 Sep Mar Apr Aug Mar Mar Mar Mar Dec Jun Mar 30 13:50 archive 29 2005 Exampleprivate.sh Copyright © 2007. which creates the directory structure under the current directory.sh 2 2005 OSWatcher.sh 28 2005 oswnet. Installing OSWatcher Installation is very simple.

All rights reserved. the commands. are listed. the output from iostat with the –x option.sh file: ######################################################### # CONFIGURATION Determine Host Platform ######################################################### case $PLATFORM in Linux) IOSTAT='iostat -x 1 3' VMSTAT='vmstat 1 3' TOP='eval top -b -n 1 | head -50' PSELF='ps -elf' MPSTAT='mpstat 1 3' MEMINFO='cat /proc/meminfo' SLABINFO='cat /proc/slabinfo' Copyright © 2007.sh script. which are stored in the OSWatcher.Configuring OSW Configure OSW by changing the command that it runs. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . Oracle. The default setting for the Linux platform is shown in the slide. You could change the –x option to –p /dev/hda and the output would show the individual partitions. along with their arguments. shows the statistics of the hard drive but not the partitions. Here. You can edit these here to cause the behavior and output of the commands to change. as shown above. For example.5 . Configuring OSW OSWatcher can be configured by editing the CONFIGURATION section of the OSWatcher.

VMSTAT found on your system. simply invoke the startOSW. data is being sampled every 30 seconds. IOSTAT found on your system.Running OSW $ .sh script: startOSW. after three samples have been taken (90 seconds have passed) the stopOSW.. But. Discovery completed. Oracle../startOSW. All rights reserved.sh script is run to stop the data collection. you can run the stopOSW. MPSTAT found on your system. Even if the number of hours has not been reached. and hours is the number of hours for which to collect data.6 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . TOP found on your system.sh Running OSW To run OSW. In the example in the slide. osw:Sat Sep 30 13:50:30 PDT 2006 osw:Sat Sep 30 13:51:01 PDT 2006 osw:Sat Sep 30 13:51:31 PDT 2006 Terminated Copyright © 2007. With SnapshotInterval = 30 With ArchiveInterval = 24 Starting Data Collection. Starting OSWatcher V1. NETSTAT found on your system../stopOSW..sh 30 24 Testing for discovery of OS Utilities..3.sh <snapshot_interval> <hours> where the snapshot_interval is the number of seconds there should be between each data sample.2 on Sat Sep . Snapshot interval in seconds Hours to run $ .sh script to stop it at any time.. and the script will run for 24 hours.

The subdirectory names are made up by prepending the string “osw” to the command name.Viewing OSW Output The archive subdirectory contains the output of an OSW execution.dat zzz ***Sat Sep 30 13:50:31 PDT 2006 MemTotal: 1035320 kB MemFree: 451920 kB Buffers: 1020 kB Copyright © 2007. $ ls oswiostat oswmpstat oswprvtnet oswslabinfo oswvmstat oswmeminfo oswnetstat oswps oswtop $ head -4 oswmeminfo/EDRSR9P1_meminfo_09.7 .30. All rights reserved. In that directory is a subdirectory for each command that is being repeatedly run during the session. The names of those files follow this pattern for organizational purposes: <hostname>_<command>_<timestamp>.1300. Viewing OSW Output The only directory immediately under the osw installation directory is called archive.06. Oracle. They are: • oswiostat • oswmeminfo • oswmpstat • oswnetstat • oswprvtnet • oswps • oswslabinfo • oswtop • Oswvmstat ra O Under each of those directories are the files that contain the collected data.dat le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . That is where all output is stored. categorized into directories related to each command that runs.

including Linux parameters. migration. and running the RDA. database settings. and ORA-3113 errors • Upgrade.Remote Diagnostics Agent The Remote Diagnostics Agent (RDA) is a tool you can run on your database server that gathers information relevant to: • Performance issues • Installation/configuration issues • ORA-600. Note: See MetaLink Note 314422. This makes it easy to send the information to Oracle Support for analysis. installing. All rights reserved. Remote Diagnostics Agent (RDA) The Remote Diagnostics Agent is a tool that you can use to gather comprehensive information about your database server. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . and so is easily browseable by category. It is also a good way for you to see a summary of your entire system. Oracle. and network information.1 for details on downloading. This information is compiled into HTML. which are also collected into a single ZIP file. and so on.8 . ORA-7445. The output is written in the form of HTML files. and linking issues Copyright © 2007.

and then untar the extracted tar file. Oracle.1 4087 Jul 6 01:58 drwxr-xr-x 2 4096 Sep 30 12:07 drwxr-xr-x 2 4096 Sep 30 12:07 drwxr-xr-x 4 4096 Sep 30 12:07 -r-xr-xr-x 1 3415 Apr 25 05:50 -r-xr-xr-x 1 40066 Sep 8 08:03 -r-xr-xr-x 1 3442 Apr 25 05:50 -r--r--r-.Installing the RDA $ gunzip rda_4. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 .1 14539 Aug 4 06:41 -r--r--r-.5-060912.tar $ cd rda $ ls -gG total 112 -r--r--r-.9 .txt Copyright © 2007. At that point. All rights reserved. the software is installed.txt README_VMS.txt hcve modules RDA rda.1 13101 Aug 4 06:41 DISCLAIM.1 13103 Aug 4 06:41 -r--r--r-.5-060912. there is no need to run an installation script.cmd rda. The parent directory of all the extracted files is called rda.gz $ tar -xf rda_4.txt README_Windows.tar. Installing the RDA Installation is very simple. Extract the gzip file using gunzip.pl rda. which creates the directory structure under the current directory.sh README_Unix.

/rda. Processing CFG module .10 . .. Processing Sampling module . As each area (referred to as module) is interrogated.” When running rda. Gather data: This step actually collects the data about your system..sh as the root OS user...Running the RDA Prompts with several questions $ . Gathers data Running the RDA There are two steps involved in running the RDA: 1. Processing OS module . $ . Note: Root cannot connect to a database as “/ as sysdba... This prompts you for information about your installation including Oracle home directories. Oracle. choose a different schema for connecting to the database./rda.. Processing OCM module .sh -v Collecting diagnostic data . Copyright © 2007. All rights reserved.. 2. --------------------------------------------------------RDA Data Collection Started 22-Sep-2006 11:59:37 AM --------------------------------------------------------Processing Initialization module ..sh –S . ASM instance information.sh script with the –S parameter to perform the setup. the name is output on the command line... Setup: Run the rda.. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . and location of certain files such as the initialization file.

All rights reserved. an example of which is shown in the slide.11 . That displays the main page. Viewing the RDA Output Run a browser. There are frames to easily navigate to the various categories of information. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . Oracle. and open the file that is referenced at the end of the data collection run.Viewing the RDA Output Copyright © 2007.

12 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . All rights reserved. Navigating the RDA Output In the example in the slide. and then choose Miscellaneous Linux Information. you see that you can choose to look at the Operating System Setup.Navigating the RDA Output Copyright © 2007. Oracle.

out Copyright © 2007. All rights reserved. Oracle. you can see a sample of the output from strace.strace • • • • Diagnostic utility Records system calls Trace a specified command Trace an existing process $ strace –aef –Ttt –o /tmp/date.13 ./helloworld.” and then exits. and the signals.sh le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . strace Strace is a utility that intercepts and records the system calls. its arguments and its return value are printed on standard error or to the file specified with the -o option.out date $ strace –p 1287 –o /tmp/ora_pmon_orcl. Script helloworld. The name of each system call.sh shell script: #!/bin/bash echo “Hello World!” exit 0 The shell script is executed using strace: ra O le c strace –o /tmp/helloworld. strace can trace running background processes or be used when executing a program. Using a simple shell script. helloworld.sh invokes a bash shell. which are received by a process. echoes “Hello World!. which are called by a process.out .

"#!/bin/bash\necho \"Hello World!\"\n". open(". MAP_PRIVATE|MAP_ANONYMOUS. . SEEK_CUR) = 0 rt_sigprocmask(SIG_BLOCK. st_size=39. []. F_SETFD. rlim_max=64*1024}) = 0 dup2(3. 4096) = 0 exit_group(0) = ? ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 ...strace (continued) The full output of the trace is 102 lines. NULL. NULL. SNDCTL_TMR_TIMEBASE or TCGETS. -1. {rlim_cur=64*1024. 8) = 0 munmap(0xb7de3000. {st_mode=S_IFCHR|0620. st_rdev=makedev(136. 0. 8) = 0 read(255. PROT_READ|PROT_WRITE.. 0xbffb28c8) = -1 ENOTTY (Inappropriate ioctl for device) _llseek(3.. 5). SEEK_SET) = 0 getrlimit(RLIMIT_NOFILE. 8) = 0 fstat64(1. NULL.}) = 0 mmap2(NULL./helloworld. 13) = 13 rt_sigprocmask(SIG_BLOCK.. [0]. 0. [0]. 0. O_RDONLY|O_LARGEFILE) = 3 ioctl(3.. F_GETFL) = 0x8000 (flags O_RDONLY|O_LARGEFILE) fstat64(255. "#!/bin/bash\necho \"Hello World!\"\n".. . {st_mode=S_IFREG|0755. 39) = 39 rt_sigprocmask(SIG_BLOCK.sh". 80) = 39 _llseek(3.. SEEK_CUR) = 0 read(3. FD_CLOEXEC) = 0 fcntl64(255.}) = 0 _llseek(255. 255) = 255 close(3) = 0 fcntl64(255. . []. NULL. The listing below contains the last few lines of the trace. .14 . []. 4096. . 8) = 0 rt_sigprocmask(SIG_SETMASK. 0) = 0xb7de3000 write(1.. []. "Hello World!\n". [0]..

[]. The error is also written in the alert log with the name of the trace file. or other conditions. [] Copyright © 2007.ORA-600 Errors Alert log entry: Tue Oct 3 05:13:08 2006 Errors in file /u01/app/oracle/admin/orcl/udump/orcl_ora_18464. The first of these arguments tells us from where in the code the error was caught and thus is the key information in identifying the problem. [1]. With the ORA-600 error comes a list of arguments in square brackets. it might be caused by problems with the operating system. All rights reserved. When an ORA-600 error is raised a trace file is generated in either USER_DUMP_DEST or BACKGROUND_DUMP_DEST depending on whether the error was caught in a user or a background process. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . Oracle. [62720]. The trace file contains vital information about what led to the error condition. [62721].15 . The remaining arguments are used to supply further information such as values of internal variables. This argument is either a number or a character string. ORA-600 ORA-600 errors are raised from the kernel code of the Oracle Database software when an internal inconsistency is detected or an unexpected condition is met. lack of resources. [3932239]. arguments: [kcfrbd_3]. [1]. This situation is not necessarily a bug. hardware failures.trc: ORA-00600: internal error code.

the offending process will be sent a fatal signal. however. SIGKILL.trc: ORA-07445: exception encountered: core dump [0046A7A2] [SIGSEGV] [unknown code] [0x4A49] [] [] Copyright © 2007. the signals seen are SIGBUS (signal 10. Typically.ORA-7445 Errors Alert log entry: Tue Oct 3 05:26:06 2006 Errors in file /u01/app/oracle/admin/orcl/udump/orcl_ora_18732. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . There are other Linux signals and exceptions that may happen. bus error) and SIGSEGV (signal 11. segmentation violation). and create a core dump in CORE_DUMP_DEST. and can occur from anywhere in the Oracle code. Examples of other signals are SIGINT. To protect the system. those are likely caused by an OS program rather than a problem in the Oracle database.16 . The precise location of the error is identified by the trace file it produces. The process will normally write an error to the alert log. There are many “illegal” operations the operating system can trap. An ORA-7445 is a generic error. Oracle. a common example is a process writing to an invalid memory location. and SIGSYS. All rights reserved. ORA-7445 Error An ORA-7445 error is raised by an Oracle server process when it has received a fatal signal from the operating system. The error may be raised in either a foreground or background process. write a trace file in either USER_DUMP_DEST or BACKGROUND_DUMP_DEST.

Power failures • Data generated by the Remote Diagnostic Agent The trace file generated contains a call stack trace.Resolving ORA-600/ORA-7445 Errors File a service request with Oracle Support providing: • The database alert log located in BACKGROUND_DUMP_DEST • The trace file mentioned in the alert log • Recent changes to the system environment – – – – Hardware modifications Operating system upgrades Restore of data files Power failures • Data generated by RDA Copyright © 2007. you should open a service request and supply the following information: • The database alert log located in BACKGROUND_DUMP_DEST • The trace file mentioned in the alert log • Recent changes to the system environment: .Operating system upgrades . To help Oracle Support determine what caused the error. Oracle. The stack trace in the trace file is a small portion of the trace starting with the header “Call Stack Trace. ra O Resolving ORA-600/ORA-7445 Errors Unless you are able to identify the cause and possible fix for an ORA-600 error using the references mentioned below. with the most recently called routine at the top of the list. The name and location of the trace file is also written to alert.Hardware modifications . A call stack trace or stack trace is the list of routine calls. it should be considered as a potentially serious issue and reported to Oracle Support for identification.Restore of data files . Every ORA-600 and ORA-7445 error generates a trace file.17 .” le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 . All rights reserved.log.

Doing so will assist Support in resolving the issue.Resolving ORA-600/ORA-7445 Errors (continued) Trace file stack trace: ----.18 .--------------ksedst()+27 call ksedst1() ksedmp()+557 call ksedst() ksfdmp()+19 call ksedmp() kgerinv()+177 kgesinv()+52 ksesin()+46 call 00000000 call kgerinv() call kgesinv() argument values in hex (? means dubious value) ---------------------------0 ? 1 ? 0 ? 0 ? 0 ? 0 ? 0 ? 0 ? 3 ? BFFFADD0 ? AC05C15 ? CBC2A40 ? 3 ? CB740C0 ? CBC2A40 ? 3 ? CBC2A40 ? B72A0020 ? C50DAE0 ? 5 ? BFFFAE34 ? CBC2A40 ? B72A0020 ? C50DAE0 ? 5 ? BFFFAE34 ? C50DAE0 ? 5 ? BFFFAE34 ? C50DAE0 ? 5 ? 0 ? 1 ? 0 ? 0 ? 2 ? BFFFAED4 ? 1 ? 3C004F ? kcfrbd()+444 kco_blkchk()+815 1 ? 0 ? kcb_blkchk()+247 call ksesin() call kcfrbd() call kco_blkchk() 291A37A4 ? 24580000 ? 0 ? 2000 ? 0 ? kcb_apply()+870 call kcb_blkchk() 291A37A4 ? 247EE40C ? 0 ? ktichg_noundo()+770 call kcb_apply() BFFFB014 ? BFFFB02C ? 0 ? 1 ? 29166220 ? 0 ? 292C95D0 ? 0 ? ktbchgro()+351 call ktichg_noundo() 29166220 ? 0 ? 1 ? BFFFB02C ? BFFFB014 ? 291A37A4 ? ktsfbfmt()+808 call ktbchgro() 0 ? 1 ? CC0F4A4 ? 291A37A4 ? Copy the call stack trace from the trace file into the service request filed with Oracle Support.Call Stack Trace ----calling call entry location type point ------------------. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 .---.

All rights reserved. Oracle.Summary In this lesson. you should have learned how to: • Use OS Watcher • Use the Oracle Support’s Remote Diagnostics Agent • Trace programs and processes with strace • Gather information for resolving ORA-600 and ORA-7445 errors Copyright © 2007. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 .19 .

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs 11 .Practice 11 Overview: Debugging Oracle on Linux This practice covers the following topics: • Installing and configuring OS Watcher • Gathering OS and database information using RDA • Tracing programs and processes using strace • Forcing ORA-600 and ORA-7445 errors. Oracle. All rights reserved. and then gathering the needed information for Oracle Support Copyright © 2007.20 .

Appendix A Practices ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

2 .Practice for Lesson 1 ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .

on a separate line./showargs.sh abc 123 xyz abc 123 xyz 9) Determine why the showargs. Test this by changing to the /stage/labs directory. 1) Determine the complete version number of your Linux kernel. What is the primary group? 4) What other users are in this group? 5) Display information about disk storage on your database server. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . 8) Write a shell script called showargs. 3) Find out what groups the user you are logged in as belongs to. Note: Your prompt will look different from those shown here because of the specific machine name being shown. 10) Determine how long the system has been up.sh script did not run. You will also write a simple shell script. For example: .Practice 1-1: Working with the Linux Kernel This practice enables you to gather some information about the Linux operating system you are using. and run it successfully with test input.sh that displays each space-delimited parameter passed to it. and record it here: 2) Determine if your kernel is tainted. correct that. and disk partitions. Question: Why does the prompt still end with a hash sign when you have specified it to be a dollar sign? You may need to check the bash man page to answer this. This includes the kernel version. How much disk space do you have free in the root partition? 6) Using the /proc file system. users and groups. display the list of partitions. Compare your result to the value returned by the uptime command. using the virtual file system. 7) Change your prompt string to include the full directory path instead of just the last subdirectory name.3 .

you will set up the data structure that supports that search. In this practice.Practice 1-2: Setting Up locatedb There are times during these practices when you may need to locate a file. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .4 . 1) Run the locate command to find all rpm files.

5 .Practice for Lesson 2: Preparing Linux for Oracle ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .

Use the lab_02_01_01. you will determine whether all the packages required by Oracle Database 10g R2 are installed. Then verify that all the required packages are installed. 2) Install any missing RPMs. The necessary RPM files can be found in the labs directory also.sh script to check for missing packages. and install them if needed.Practice 2-1: Installing Linux Packages In this practice. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .6 . 1) Use the rpm command to determine whether the correct packages are installed to support Oracle Database 10g R2. Note: Scripts for this practice are in the /stage/labs directory.

Practice 2-2: Creating the oracle User Now you will create the oracle user and set up its environment. All lab files are in the /stage/labs directory. copy the script files into their proper place in the oracle home directory. which are currently in the /stage directory. Do this for the labs and solutions directories only.sh script: 3) Now that the oracle user exists. References to script files will be to the new labs directory from this point on. 1) Verify that there is no oracle user already on the system. 4) Verify that the nobody user exists.7 . 2) Create the oracle user by running the lab_02_02_02. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .

1) As the root user. The correct settings should be: Semaphores: 250 32000 100 128 File Handles: 65536 Local port range: 1024 65000 net.wmem_default: 262144 net. view the kernel memory parameters.core. hard = 16384 Number of open file handles: soft = 1024.core.core.wmem_max: 262144 4) Set the shell limits according to the following: Number of processes: soft = 2047. file handle.Practice 2-3: Configuring Kernel Parameters You now need to view and modify kernel parameters to meet the requirements of an Oracle database installation. 3) Change the kernel parameters for the semaphore. hard = 65536 ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . What are their names and values? Are they adequate for the Oracle database installation? Name __________ __________ __________ Value ____________ ____________ ____________ Adequate? __Y/N_ __Y/N_ __Y/N_ 2) Update any of the kernel parameters that are not set correctly.core. and network settings.rmem_default: 1048576 net.rmem_max: 1048576 net.8 .

9 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . This should be named /u01/app/oracle. and create the directory that will serve as ORACLE_BASE. 1) Determine a mount point that has enough space.Practice 2-4: Creating Oracle Directories Set up the needed directories and environment variables for the Oracle software installation.

To avoid this error.sh script to correct it. 2) Verify that the host name has been set correctly. If it does not include the domain name. before you begin installation. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . run the hostname.Practice 2-5: Setting Up the Host Name When you run Oracle Universal Installer.10 . an error may occur if name resolution is not set up. 1) Verify that the /etc/hosts file is used for name resolution. you must ensure that host names are resolved only through the /etc/hosts file.

11 .Practice for Lesson 3: Installing Oracle on Linux ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .

The password is oracle. Use oracle for any passwords. 1) Exit all windows of the current session. The database software is staged in the /stage/database directory. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . 3) Open a new terminal window.Practice 3-1: Installing Oracle Database on Linux Install Oracle Database. Perform the installation. and run the installer program that is in the /stage/database directory. and log out of the root session. selecting the Basic option. Use the default settings for everything except for these options: Set the UNIX DBA Group to oinstall Do not create the starter database 4) In the End of Installation window.12 . 2) Log in to the machine as the oracle user. click Exit to quit the installation.

13 .Practice 3-2: Configuring the Listener Configure and start the listener. 1) Run the Network Configuration Assistant (netca) to configure the listener. Use the default settings on every screen. 2) Verify that the listener has been started. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .

14 .Practice for Lesson 4 There is no practice for lesson 4. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .

15 .Practice for Lesson 5: Automatic Storage Management ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .

d/oracleasm configure command. When prompted within fdisk. enter these values: Command (new partition): Primary partition: Partition number: First cylinder: Last cylinder: Last command (write): n p 1 1 130 w 4) Repeat the step above. In this case. The RPMs are located in /home/oracle/labs.16 . Use the following settings: Owning user: Owning group: Start on boot: Fix permissions: oracle dba y y 3) Use the fdisk command to create a single partition on the disks to be used with ASM. 2) Configure ASM by executing the /etc/init. running partprobe ensures that the kernel is aware the disks have been partitioned. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . you install and configure ASMLib. and then create an ASM instance. 6) Enable ASMLib.Practice 5-1: Installing and Configuring ASMLib In this practice. install the three RPMs required for ASMLib. creating partitions for each of the following devices: /dev/sdk /dev/sdl /dev/sdm /dev/sdn /dev/sdo /dev/sdp /dev/sdq 5) Run the partprobe command. This informs the kernel of partition table changes. 1) As root.

17 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . Use the oracleasm utility to do this.Practice 5-1: Installing and Configuring ASMLib (continued) 7) Create the ASM disk for storing the database’s data files and flash recovery area files. Map the ASM disk names to devices: 8) Make the ASM disks available using the scandisks option of the oracleasm utility.

you can create the ASM instance that uses them. and for the flash recovery area. In this practice. and define the ASM disk groups that it is to use for data.18 . you will create an ASM instance. 1) Use DBCA to configure Automatic Storage Management. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .Practice 5-2: Creating an ASM Instance Now that the ASM disks are set up.

Practice for Lesson 6: Creating the Database ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .19 .

it will display the information about the database that was just created. It has a Global Database Name of orcl.20 .Practice 6-1: Creating a Database Create a database to be used in the instance already installed. The SID is orcl. and set its password to hr. for data file and flash recovery area storage. All initial accounts should have the password of oracle.us.com. It is configurable using Database Control. The flash recovery area should be 4 GB in size. It should use Oracle Managed Files (OMF). 1) Use the Database Creation Assistant to create a database with these attributes: It is a general-purpose database. It should have the sample schemas installed. The database will use the ASM you already configured.oracle. Database Control URL: http://edt3r12p1:1158/em______________ 5) Set the ORACLE_SID environment variable so that it is set for every terminal session that the oracle user starts. Make note of this information here: SID: __________ Sever Parameter File name: _____________________________ Database Control URL: ________________________________ SID: ___orcl_______ Sever Parameter File name: _+DF/orcl/spfileorcl.ora 3) Unlock the HR account. 4) Click Exit to exit DBCA. The database should use ASM as its storage mechanism. Set it to orcl. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . 2) When DBCA finishes. The database should be in ARCHIVELOG mode.

21 .Practice 6-2: Backing Up Your Database It is good to have a backup of the database you are working with. 1) Back up the database. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . Take a backup of the database that has just been created.

22 .Practice for Lesson 7: Customizing Oracle on Linux ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .

in this practice.0/db_1/bin/dbstart to fix the known issue with starting the listener. should be executed first. Lastly. configure the ASM and orcl instances to be automatically started and stopped when the operating system is started and stopped. On line 78. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . The shutdown. 5) Establish links in the dbora script such that it will be invoked during the OS startup and shutdown in runlevels 3 and 5. Make the following changes. 4) Set the permissions for the dbora script to 750.23 . 2) View the /home/oracle/labs/dbora script to see what it does. 1) By editing the /etc/oratab file. The resulting line should look like this: Change line 255 to look like this: Change line 88. In addition. Remove the first word of the line. you will view a demo of the installation of Enterprise Linux. 6) Edit /u01/app/oracle/product/10. you will edit the dbstart and dbshut scripts to include starting and stopping DB Control. it is good to have your database start up automatically. This provides higher database availability and reduces the chance of error. check whether they are still running.Practice 7-1: Configuring Automatic Startup and Shutdown of the Database For dealing with reboots. then fully edited and correct versions of these files are located in /home/oracle/solutions. and set the group to dba. you will configure the database to start and stop when the OS boots and shuts down. change the value for ORACLE_HOME_LISTNER to this value: Correct automatic ASM startup by editing line 59. Then insert a line under 88 that looks like this: 7) Test stopping the database instances using dbora. and then save the file.2. Remove the –s option from the LOGMSG value. or “kill” scripts. either planned or unplanned. Check for pmon_orcl and pmon_+ASM processes. and dbshut_edited. export. Note: If you do not want to manually edit the dbstart dbshut files. ra O 8) While the databases are being shut down. What scripts does it invoke? ________________ ________________ 3) Copy the dbora script from the /home/oracle/labs directory to a directory such that it will be invoked during startup and shutdown of the OS. and startup scripts should be executed last. In this practice. The files are named dbstart_edited.

Practice 7-1: Configuring Automatic Startup and Shutdown of the Database (continued) When the commands return no results. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . 9) Test starting the database with dbora. 10) Test that these scripts will be called and will function properly during a reboot. First shut down the listener to set up the environment. as it would be at normal boot-up time.24 . the instances have been shut down.

You need to configure DB Console to start and stop when the database starts up and shuts down. then you do not need to do this practice.us. is: 2) Configure DB Control to stop when the database is shut down. is: ra O 3) Test the automatic shutdown of DB Control by issuing a dbora stop command. then Line 95: SQLDBA=svrmgrl Line 96: VERSION="internal" Line 97: else Line 98: SQLDBA="sqlplus /nolog" Line 99: fi Line 100: fi Note: You can either edit this file manually (the text above is in a file named lab_07_02_02.com_orcl If DB Control is available in this version of the database. It is best to start DB Control after the database has successfully started. If DB Control has been configured for an instance. So position the commands in the dbstart script to be after a test for a successful start of the database.oracle. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . Add the following text to the dbstart script. The copy command to use. then the executable emctl exists under the $ORACLE_HOME/bin directory.txt) or simply copy the dbshut_edited file from the solutions directory to $ORACLE_HOME/bin/dbshut.25 . which is following these lines: Line 94: if [ -f $ORACLE_HOME/bin/svrmgrl ] . Do this by editing the dbshut script. then there exists a directory under $ORACLE_HOME with the format FullyQualifiedHostname_SID.txt) or simply copy the dbstart_edited file from the solutions directory to $ORACLE_HOME/bin/dbstart. as the oracle user. 5) Test the automatic restart by rebooting the system. which is following these three lines: Line 218: if test $? -eq 0 . Insert it at line 221. The copy command to use. then Line 219: echo "" Line 220: echo "$0: ${INST} \"${ORACLE_SID}\" warm started. 1) Configure DB Control to start with the database. For example: textbox. adding the following text at line 101." Note: You can either edit this file manually (the text above is in a file named lab_07_02_01.Practice 7-2: Configuring Automatic Startup and Shutdown of DB Control (optional) Note: If you have already copied the dbstart_edited and dbshut_edited files as described in practice 7-1. 4) Test the automatic startup of DB Control by issuing a dbora start command. as the oracle user.

html file. you will run a viewlet of the process of installing Enterprise Linux. What is the mount point for the swap partition? ________________________ c. Is creating a root user optional? ________________________ ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . 2) Answer the following questions: a. Why was a graphical environment not installed by default? __________________________________________________________________ b. Are sar and iostat installed by default? ________________________ d. 1) Launch the viewlet using the install_el4u4_launcher.26 .Practice 7-3: Installing Linux In this practice.

Practice for Lesson 8: Managing Memory ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .27 .

and how much is in use? 5) What is the device name that is being used for the swap space? ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . 1) View the current memory settings and status for the kernel. how much memory is currently in use? 3) How much of this used memory is being used for cache. and swap space. You will look at statistics and behavior regarding physical memory. How much total memory is on your system? Note: You may see different memory related values from those shown here. which means that it is available to be used for noncache uses such as new process starting up. 2) According to the top command.28 .Practice 8-1: Managing Memory In this practice you will inspect your system’s memory parameters. depending on the type of machine you are on. or new requests for memory allocation? 4) How much swap space is there.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . 1) Display the list of shared memory segments belonging to the oracle user on your system.Practice 8-2: Managing Shared Memory Now you will view the state and behavior of shared memory segments on your system. Note: The numbers you see will most likely be different from those shown here. and how they relate to an Oracle database instance. 2) Note the largest shared memory segment.29 . What is it being used for? Prove your answer. 3) What does the next highest oracle shared memory segment belong to? 4) What is the meaning of the nattch column? Prove it by demonstrating how it changes.

Practice for Lesson 9 ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .30 .

ldavg. hda5 is the / partition. sect/s Free. Disk activity by partition.Practice 9-1: Gather Statistics Using iostat. A table of commands is provided for your reference. you will measure CPU.%sys. sar -d 5 3 vmstat 5 3 iostat -p /dev/hda 5 3 avgqu-sz. %idle rps. Measurement sar -uq AVERAGE runq-sz sar -uq AVERAGE ldavg sar -uq AVERAGE sar -uq AVERAGE %user sar -uq AVERAGE %sys sar -uq AVERAGE %idle sar -d AVERAGE dev3-0 tps ra O sar -d AVERAGE dev3-0 rd_sec/s sar -d AVERAGE dev3-0 wr_sec/s vmstat memory free le c le ac r O ly l & On na se er U nt I Quiet Database Activity I/O Activity c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . Pick a representative section other than the first to record. Diagnostic sar -uq 5 3 Measures runq-sz. %user.31 . svctm Record your measurements in the following table. await. and vmstat In this practice. sar. First line is all activity since last report. First output section is all activity since last report. si Notes On the system the averages provide a baseline Overall activity by device Swapping information also includes disk and CPU. and I/O usage on your system. virtual memory. Note hda is sum of hda* lines. Pick a representative line other than the first to record.

4) Use the iostat command to report I/O statistics for the root partition. The script is monitor. Use the same repeat interval and count as above. In the Quiet column of the table above. you can simply use the script that runs the commands you ran before.32 le c le ac r O ly l & On na se er U nt I c A de a y m .sh. using the same interval as above.sql script run. ra O 8) Stop the dd command by pressing [Ctrl] + [C].sql script ran.sql script to put a load on the system. 7) While the catproc. 9) Review the results recorded in the chart. Oracle Database 10g: Managing Oracle on Linux for DBAs A . but this time. and when the dd command executed. Note the differences when the catproc. Record the results in the Quiet column of the table above. sar. 2) Use the sar command to report on device statistics.sql script is running. use the df command to find out the device name of the root partition. Record the results in the Quiet column of the previous table.Practice 9-1: Gather Statistics Using iostat. run the following dd command to generate I/O activity. 3) Use the vmstat command to measure virtual memory statistics.sql script is still running. Do not interrupt the catproc. and vmstat (continued) vmstat swap si iostat -p hda5 tps iostat -p hda5 Blk_read/s iostat -p hda5 Blk_wrtn/s 1) Use the sar command to measure system stats including: Run queue size Load average Percent CPU utilization for user processes Percent CPU utilization for system (kernel) processes Percent CPU is idle Take three measurements at an interval of five seconds. It should complete in order for the database objects to end up in a consistent state. take measurements on your system again (as earlier). Record the results in the Quiet column of the previous table.sh script again and record the results in the I/O Activity column of the chart mentioned earlier. 6) While the catproc. Note: In order to determine the if parameter for the dd command. record the amount of free virtual memory and the amount of virtual memory swapped in (si). Then run the monitor. 5) Run the $ORACLE_HOME/rdbms/admin/catproc.

and disk I/O. using the xosview-1.8.2-1. as root.rpm file. 3) Run xosview by entering the xosview command. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .Practice 9-2: Using Graphical Monitoring Tools This practice enables you to install and use xosview to monitor CPU. 2) Install xosview as root. memory. 1) Attempt to run xosview. This will fail because xosview is not installed by default.33 .i386.

34 .Practice for Lesson 10: Tuning Performance ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .

35 . In this practice. you will increase the size of the SGA. do not change anything.Practice 10-1: Adjusting the SGA Size Often increasing the size of the Shared Global Area (SGA) improves performance by allowing more data to be resident in memory rather than having to be read from disk frequently. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . 1) Adjust the SGA size to at least 400 MB. Note: If it is already greater than 400 MB.

4) Create the TS16 tablespace in ASM. 6) Using SQL*Plus. depending on the type of activity on the tablespace.36 . and that can affect performance. Compare the times between each of the tables. 3) Create the TS2 tablespace in ASM. and is 128 MB in size. This practice illustrates the difference in performance different block sizes can have. 9) Use EM to view the statistics for each of these two statement executions. which has a 2 KB block size. which has a 16 KB block size. is NOLOGGING. putting in a comment to force a reparse of each statement. Which is faster? 7) Turn on SQL tracing for this HR session. 1) Set the cache size to 128 MB for tablespaces with 2 KB block size.Practice 10-2: Adjusting Block Sizes You can select different block sizes for each tablespace. and repeatedly select count(*) from each of these tables using a WHERE clause that forces each row to be read. 8) Rerun each of the two statements once. respectively. is NOLOGGING.sql script to create and populate the T2 and T16 tables. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . 2) Set the cache size to 128 MB for the 16 KB block size. 5) Run the lab_10_02_05. which are created in the TS2 and TS16 tablespaces. turn on timing. and is 128 MB in size.

1) Run the lab_10_03_01.37 . you will identify a resource-consuming operating system process.Practice 10-3: Identifying Sessions in Linux At times you need to correlate database sessions to specific processes running at the operating system level. and take action to correct it. Find the session associated with that process. determine which database session it belongs to.sh script to generate some HR sessions that do some work in the database. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . and kill it. 2) Run the top command to see the oracle session that is consuming many system resources. In this practice.

Practice for Lesson 11: Diagnosing Oracle on Linux ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .38 .

tar file. 1) Install OS Watcher. It is useful for gathering historical data for comparison and for providing OS information about your system to Oracle Support Services. and then run it.39 . reviewing the results from the generated reports. into the new directory.sh to start the tool. Extract the tar OSW. Make the tool run as a background process. 6) Stop OSW.Practice 11-1: Install and Configure OS Watcher OS Watcher is a utility that collects statistics about the operating system. 5) View the OSW generated output for other types of data you see in the archive directory. Provide parameters such that data is sampled every 10 seconds. located in /home/oracle/labs directory. Create a directory for OS Watcher named osw under the /home/oracle directory. and the last 10 hours of data is logged to archive files. 3) Verify that the script is running by checking the Linux process listing. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . You will now install and configure OS Watcher. The output is being written to the archive directory where OSW has been installed. 4) View the iostat report that has been created by OSW so far. 2) Use startOSW.

2) Configure RDA by running the rda. If RDA is run under the Oracle software owner’s ID. which drive partition contains swap? 6) Under ASM > File/Space Related Information > Files Stored in Diskgroup. the RDA runs.5-060912.gz. Extract it into the /oracle/home directory. Open this file in the browser.ORA located on this machine (Y/N)? Press [Enter] to accept the default (Y): n Is the Database Control for 10G in use on this node (Y/N)? Press [Enter] to accept the default (N): y 3) After the last question is answered. After it is finished.tar. note the URL for the HTML file to open and to view the results. For each question. and view the output. In this practice. what is the fully qualified location of the SYSTEM tablespace? ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . operating system. enter a “/” here. The file containing the software is /home/oracle/labs/rda_4. This takes several minutes. press [Enter] to accept the default. Press [Enter] to accept the default (system):/ Is “/” a sysdba user (will connect as sysdba) (Y/N)? Press [Enter] to accept the default (N): y Is ASM (Automatic Storage Management) in use (Y/N)? Press [Enter] to accept the default (N): y Is the ASM INIT. and database that can be useful for diagnosing problems. you will install it. run it. except for the following questions: Is INIT.pl script in the rda directory. 1) Install RDA.ORA for the database to be analyzed located on this machine? (Y/N) Press [Enter] to accept the default (Y): n Enter an Oracle User ID (user ID only) to view DBA_ and V$ tables.40 .Practice 11-2: Install and Configure RDA The Remote Diagnostic Agent (RDA) collects information about your machine. 4) Under Overview > System Information what are the values for Total Physical Memory and Swap: In Use? ________________________ ________________________ __________________________ 5) Under Operating System Setup > Disk Drives. and select Y at the SYSDBA prompt to avoid being prompted for the database password at run time.

3) Execute the helloworld. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A .sh script to find the process ID of PMON.sh script using strace.sh script. Run the lab_11_03_04_a. review the output. First you look at the output of a simple shell script.Practice 11-3: Using strace In this practice. It is used in the next practice. you will look at the output of the strace command.out file. Then you use strace on a running process and send the output to a file. 1) View the contents of the helloworld.41 . 4) Trace the PMON process execution using strace. 2) Execute the helloworld. Do not cancel this tail command.sh test script. 5) View the output file by using the tail command. Send the output of the trace to the /tmp/orcl_pmon. After tracing the script.

sh script to generate the error.42 . 4) Now that both an ORA-600 and ORA-7445 have been generated. which is being viewed using the tail command. with the output being sent to a file. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs A . noting the trace file names. Do this by issuing a kill –11 command for the PID of the PMON process.pl finishes running. you started a strace of the PMON process. you caused the database instance to crash. These are the trace files for both the ORA-600 and ORA-7445 errors. In the window with the tail of the strace output. look at the alert log file for the instance. Look at the terminal window that contains the tail of the strace. All of the strace was written to the output file. Restart it. 3) In Practice 11-3. which frequently require diagnosis at the operating system level. 1) Force an ORA-600 error. 2) Force an ORA-7445 error. press [Ctrl] + [C] to stop the tail output. Use the lab_11_04_01. you investigate ORA-600 and ORA-7445 errors. Note the Last Errors section. click Alert. 5) Note that each of the entries for the ORA-600 and ORA-7445 errors point to a trace file. but it takes longer to scroll to the screen. 8) After rda. open the following URL in a browser: 9) Click RDBMS Log/Trace Files. 6) By killing the PMON process.Practice 11-4: Diagnosing ORA-600 and ORA-7445 Errors In this practice. 7) Run the RDA script to have it collect data about the trace files that were just generated. and then locate the errors.log. To find the file names of the specific trace files for each error.

Appendix B Practice Solutions ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

2 .Practice Solutions for Lesson 1 ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .

0.Solutions for Practice 1-1: Working with the Linux Kernel This practice enables you to gather some information about the Linux operating system you are using. 4) What other users are in this group? Answer: 1. 1) Determine the complete version number of your Linux kernel. Enter the following at the OS prompt: # cat /proc/sys/kernel/tainted 0 3) Find out what groups the user you are logged in as belongs to. What is the primary group? Answer: 1.3(sys).0. Answer: 1.0. which is root.10(w heel) The primary group is root because it is listed as gid=. le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .0.2(daemon).Elsmp 2) Determine if your kernel is tainted. the displayed version is: 2.6. You will also write a simple shell script. users and groups.9-42. Enter the following at the OS prompt: # grep root: /etc/group root:x:0:root.3 .1. This includes the kernel version. Enter the following at the OS prompt.4(adm). and selecting Open Terminal. They are root and vncuser.0.1.6. Then enter the following at the OS prompt: # uname -r 2.vncuser ra O 5) Display information about disk storage on your database server.EL Note: If you are using an SMP machine. Start a terminal session by right-clicking in the desktop area. and disk partitions. to see the group list for the current user. and not just in the groups= list.9-42. How much disk space do you have free in the root partition? le c There are two users in the root group. # id uid=0(root) gid=0(root) groups=0(root).1(bin). and record it here: Answer: 1.6(disk).0.

The available space on this system is approximately 12 GB.4 . 7) Change your prompt string to include the full directory path instead of just the last subdirectory name. Test this by changing to the /stage/labs directory.0G 54% /mnt/cdrive The root partition is always mounted on “/”. you may see different output from that shown. Enter the following at the OS prompt: # df -h Filesystem /dev/hda5 /dev/hda2 none /dev/hda1 Size 25G 23M 506M 11G Used Avail Use% Mounted on 12G 12G 51% / 4. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .8G 5. Note: Your prompt will look different from those shown here because of the specific machine name being shown. 6) Using the /proc file system. Enter the following at the OS prompt: # cat /proc/partitions major minor #blocks name 3 3 3 3 3 3 7 7 7 7 7 7 7 7 # 0 1 2 3 4 5 0 1 2 3 4 5 6 7 39082680 11269566 24097 2048287 1 25736098 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576 hda hda1 hda2 hda3 hda4 hda5 loop0 loop1 loop2 loop3 loop4 loop5 loop6 loop7 Note: Depending on your system. display the list of partitions. Answer: 1.Solutions for Practice 1-1: Working with the Linux Kernel (continued) Answer: 1. Question: Why does the prompt still end with a hash sign when you have specified it to be a dollar sign? You may need to check the bash man page to answer this. you may see different output from that shown. Note: Depending on your system.0M 18M 19% /boot 0 506M 0% /dev/shm 5.

[root@EDT3R12P1 ~]# cd /stage/labs [root@EDT3R12P1 /stage/labs]# 4. in which case display the hash sign.5 . enter the following to find that section (case is important): /PROMPTING ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . To answer the question. When the string is found. keep entering [N] until you see the following: 7. Note that the directory specifier is \W. So.Solutions for Practice 1-1: Working with the Linux Kernel (continued) Answer: 1. Make this change by entering the following: [root@stctestbox03 ~]# PS1="[\u@\h \w]\\$ " 3. Note that in order to make the last character a hash sign. Note that you are directed to see the section on PROMPTING. When the man page appears. to represent the entire current directory path name. which means display the dollar sign. Test this by changing the directory to /stage/labs as shown in the following box. Note that the prompt now displays the full current working directory. search for the PS1 string by entering the following: /PS1 6. which represents the last subdirectory of the current directory. enter the following on the command line to see the bash man page: # man bash 5. Enter the following at the OS prompt to see the current setting: [root@EDT3R12P1 ~]# echo $PS1 [\u@\h \W]\$ 2. you must enter two backslashes before the dollar ($) sign. unless the user is root. The two backslashes will be reduced to one resulting in the final string having \$. Change that to \w.

on a separate line./showargs. Enter [q] to quit the man page display. Oracle Database 10g: Managing Oracle on Linux for DBAs B . Note that the description for the \$ string is that it will cause a dollar sign to be displayed unless the user ID is 0 (root) in which case the hash sign is displayed. 8) Write a shell script called showargs. Answer: The prompt still ends with a hash sign because the \$ string indicates that hash is to be used if the user is root. 10.6 . For example: . Enter [j] repeatedly to scroll down to the section describing the \$ string. The following screen is displayed: 9.sh that displays each space-delimited parameter passed to it. Use an editor to create and edit the /tmp/showargs.sh file.sh abc 123 xyz abc ra O Answer: le c 123 xyz le ac r O ly l & On na se er U nt I c A de a y m 1.Solutions for Practice 1-1: Working with the Linux Kernel (continued) 8.

Compare your result to the value returned by the uptime command.sh # ls -l showargs. correct that. Note that the script does not run. enter the following to run the script with some test arguments: # cd /tmp # ./showargs./showargs.sh a b c bash: . enter the following to display the /proc/uptime contents.sh -rwxr-xr-x 1 root root 43 Oct 3. Answer: 1. Enter the following lines into the file: for fname in $*. Your results will vary from those shown.1 root root 43 Oct 9 03:30 showargs. At the OS prompt. 9) Determine why the showargs. Reattempt executing the script by entering the following: # . using the virtual file system. check the permissions on the file by entering the following command while in the /tmp directory: # ls -l showargs.sh 2.32 1404257./showargs. do echo $fname done 3. and run it successfully with test input. Answer: 1. At the OS prompt. ra O le c le ac r O ly l & On na se er U nt I 9 03:30 showargs. Note that none of the execute permissions are enabled for this file. Save the file. Enable them and verify that by entering the following commands: # chmod +x showargs.sh: Permission denied 5.sh a b c a b c 10) Determine how long the system has been up.Solutions for Practice 1-1: Working with the Linux Kernel (continued) # gedit /tmp/showargs. The error is that permission was denied.sh c A de a y m # cat /proc/uptime 1595093.sh script did not run.sh & 2.sh -rw-r--r-.62 Oracle Database 10g: Managing Oracle on Linux for DBAs B . So. 4.7 .

11:04. At the OS prompt. enter the following to run the uptime command: $ uptime 18:33:36 up 18 days.46 days. 0. The returned number of seconds of uptime is 1595093.Solutions for Practice 1-1: Working with the Linux Kernel (continued) 2. load average: 3.32. which is the number of seconds in a day. 1. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .8 .20.09 5 users.75. 0. Note: Your numbers will most certainly vary from those given here. which comes to about 18 days and 11 hours. Dividing that by (60*60*24). results in approximately 18.

conf to enable the daily cron job. you will set up the data structure that supports that search.Solutions for Practice 1-2: Setting Up locatedb There are times during these practices when you may need to locate a file. # 2. In this practice.db: No such file or directory warning: You need to run the 'updatedb' command (as root) to create the database . This will take about two minutes to run. Please have a look at /etc/updatedb. Enter the following at the OS prompt: # locate rpm warning: locate: could not open database: /var/lib/slocate/slocate. Initialize it by entering the following command. Note that the locate command is not able to perform the search because the locate DB cannot be initialized. # updatedb ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .9 . 1) Run the locate command to find all rpm files. Answer: 1.

10 .Practice Solutions for Lesson 2: Preparing Linux for Oracle ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .

Note that.rhel4.14-30.sh binutils-2.6-3.1. sysstat-5. 1) Use the rpm command to determine whether the correct packages are installed to support Oracle Database 10g R2.rpm: (SHA1) DSA sha1 md5 (GPG) NOT OK (MISSING KEYS: GPG#b38a8516) le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .6-3.i386.0. and install them if needed.0-12.Solutions for Practice 2-1: Installing Linux Packages In this practice.4.i386.2-21 compat-db-4. Then verify that all the required packages are installed.15.3.92. Answer: 1.5-11.2 control-center-2.1.12 package setarch is not installed # Note the two missing packages.1 libstdc++-devel-3. Note: Scripts for this practice are in the /stage/labs directory. Enter the following at the OS prompt to install the sysstat package: # rpm -iv sysstat-5.5-11.2.5 gcc-3. Check the key on the rpm file by entering the following: # rpm --checksig sysstat-5.6-3.2.1 glibc-2.5-11.4-2.rhel4 ra O 2.0.4..4.25 glibc-common-2. key ID b38a8516 Preparing packages for installation. you will determine whether all the packages required by Oracle Database 10g R2 are installed. although the package is installed successfully.i386.rpm sysstat-5.80-6. there is a warning about a missing key.96-132.1 gcc-c++-3.25 gnome-libs-1.0.25-9 compat-libstdc++-296-2. 2) Install any missing RPMs.90-44.3 package sysstat is not installed xscreensaver-4.rhel4.4.rhel4. The necessary RPM files can be found in the labs directory also.rhel4.rpm warning: sysstat-5./lab_02_01_01.i386.. Answer: 1.18-5.0.3.7.EL4 pdksh-5.4-2.rhel4. Run the following script to determine whether the RPMs that Oracle Database needs are installed: # cd /stage/labs # .0.6-3.rpm: V3 DSA signature: NOKEY. Use the lab_02_01_01.5-11.2 libstdc++-3.11 .1 make-3.sh script to check for missing packages.5-11.rhel4.8.4.0.

rhel4 xscreensaver-4.i386.0.7. Locate the key file that needs to be imported by entering the following: # locate GPG /usr/share/rhn/BETA-RPM-GPG-KEY /usr/share/rhn/RPM-GPG-KEY /usr/share/rhn/RPM-GPG-KEY-fedora /usr/share/rhn/RPM-GPG-KEY-fedora-test /usr/share/rhn/RPM-GPG-KEY-oracle /usr/share/doc/enterprise-release-4/RPM-GPG-KEY-enterprise /usr/share/doc/enterprise-release-4/RPM-GPG-KEY /usr/share/doc/rpm-4.6-3.2. 4.4.25 glibc-common-2.rhel4.1.90-44.0.i386.1 gcc-c++-3.6-1 7. Do this by entering the following at the OS prompt: # .5-11.2.15. Rerun the labs_02_01_01.rhel4. setarch-1.18-5.4-2.3.5 gcc-3.sh binutils-2.rpm: (sha1) dsa sha1 md5 gpg OK 6..5-11.3/RPM-GPG-KEY /usr/share/doc/rpm-4./lab_02_01_01.2 libstdc++-3.80-6.2-21 compat-db-4.EL4 pdksh-5.4.6-1.4.25 gnome-libs-1.12 .96-132.6-3.sh script to verify that all the needed packages are now installed.3/BETA-GPG-KEY # Note the oracle key file.1 make-3.rpm sysstat-5.1 glibc-2.4.1.3.rpm Preparing packages for installation. Oracle Database 10g: Managing Oracle on Linux for DBAs B .25-9 compat-libstdc++-296-2.4-2.rhel4.1 libstdc++-devel-3.6-1 # ra O le c le ac r O ly l & On na se er U nt I c A de a y m Note that now there are no missing packages. Recheck the key by entering the following: # rpm --checksig sysstat-5.rhel4. Enter the following at the OS prompt to install the setarch package: # rpm -iv setarch-1.0.3 sysstat-5.0-12.5-11.Solutions for Practice 2-1: Installing Linux Packages (continued) 3.4.i386. Import the oracle key file by entering the following: # rpm --import /usr/share/rhn/RPM-GPG-KEY-oracle 5..0.3.12 setarch-1.14-30.92.3.6-3.6-3.2 control-center-2.8.

sh script: # .. Attempt to change the user to oracle by entering the following at the OS prompt: # su . Changing password for user oracle.Solutions for Practice 2-2: Creating the oracle User Now you will create the oracle user and set up its environment. enter the following at the OS prompt to copy the directories: # cp -R /stage/labs ~oracle # cp -R /stage/solutions ~oracle 2. Answer: 1. Answer: ra O 1. 2) Create the oracle user by running the lab_02_02_02. Answer: 1. 1) Verify that there is no oracle user already on the system.13 . which are currently in the /stage directory.. Enter the following at the OS prompt: $ id nobody uid=99(nobody) gid=99(nobody) groups=99(nobody) $ le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . # 3) Now that the oracle user exists. Enter the following at the OS prompt to change the owner of the directories and files to oracle: # chown -R oracle ~oracle/labs # chown -R oracle ~oracle/solutions 3.oracle su: user oracle does not exist Note that the attempt fails with the error that the oracle user does not exist. copy the script files into their proper place in the oracle home directory. References to script files will be to the new labs directory from this point on. As root. Enter the following at the OS prompt to change the group for these files and directories: # chgrp -R oinstall ~oracle/labs # chgrp -R oinstall ~oracle/solutions 4) Verify that the nobody user exists./lab_02_02_02. passwd: all authentication tokens updated successfully. Do this for the labs and solutions directories only. All lab files are in the /stage/labs directory.sh Creating user and groups.

conf file and enter a line defining the value for shmmax as 2147483648.Solutions for Practice 2-3: Configuring Kernel Parameters You now need to view and modify kernel parameters to meet the requirements of an Oracle database installation. enter the following at the OS prompt to go to the virtual directory where the shared memory parameters can be viewed: # cd /proc/sys/kernel 3.1 root root 0 Nov 27 01:13 shmmni 4. # Shared Memory size.1 root root 0 Nov 27 01:13 shmall -rw-r--r-.1 root root 0 Nov 27 01:13 shmmax -rw-r--r-. If still logged in as the oracle user. Edit the /etc/sysctl. As the root user. 2) Update any of the kernel parameters that are not set correctly. Answer: O ra 1. What are their names and values? Are they adequate for the Oracle database installation? Name __________ __________ __________ Answer: 1. to support Oracle DB. Note that all these settings are sufficient except for shmmax. Save the file when finished editing.shmmax = 2147483648 le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . Enter the following to list the virtual files that are related to shared memory kernel parameters: # ls -l shm* -rw-r--r-. 1) As the root user. enter the following to exit that session and go back to the root session: $ exit Value ____________ ____________ ____________ Adequate? __Y/N_ __Y/N_ __Y/N_ 2. kernel.14 . view the kernel memory parameters. View the contents of each of these files using the cat command: # cat shmall 2097152 # cat shmmax 33554432 # cat shmmni 4096 5.

and network settings. The correct settings should be: Semaphores: 250 32000 100 128 File Handles: 65536 Local port range: 1024 65000 net. # cat /proc/sys/kernel/sem 250 32000 32 128 2. To make that change persistent.core.accept_source_route = 0 kernel.sem = 250 32000 100 128 3.sysrq = 0 kernel.core_uses_pid = 1 kernel.rmem_default: 1048576 net.ipv4.wmem_default: 262144 net.core.default.core.Solutions for Practice 2-3: Configuring Kernel Parameters (continued) 2. Save the file when done. Verify that the new value is reflected in the /proc/sys/kernel/shmmax file by entering the following: # cat /proc/sys/kernel/shmmax 2147483648 # 3) Change the kernel parameters for the semaphore.default. It must be set to 100.accept_source_route = 0 kernel.core_uses_pid = 1 kernel.rmem_max: 1048576 net.ipv4.ip_forward = 0 net.core. Note that the third number for semopn is too low.conf.default.ipv4.shmmax = 2147483648 kernel. Enter the following at the OS prompt to set the new value for shmmax: # /sbin/sysctl -p net.ipv4.ip_forward = 0 net.sysrq = 0 kernel.rp_filter = 1 net.shmmax = 2147483648 # 3.ipv4.sem = 250 32000 100 128 # ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .conf.ipv4. Enter the following at the OS prompt to see what the current settings are for the semaphores. file handle.wmem_max: 262144 Answer: 1.default. enter the following at the OS prompt: # /sbin/sysctl -p net.conf.rp_filter = 1 net.15 .conf.conf file to make that change: kernel. Enter the following line in the /etc/sysctl.

ipv4.core. Enter the following at the OS prompt to see the current settings for the local port range: # cat /proc/sys/net/ipv4/ip_local_port_range 32768 61000 Note that it is not correct. Edit the /etc/sysctl.wmem_default = 262144 net. make sure that the file has been saved.ipv4.ip_forward = 0 net.Solutions for Practice 2-3: Configuring Kernel Parameters (continued) 4.default.wmem_max = 262144 10. Enter the following at the OS prompt to see what the values for the file handle limit are: # cat /proc/sys/fs/file-max 102714 5. and then enter the following line: fs.conf file. 7.rp_filter = 1 net.core. Enter the following to check the current values for the TCP/IP window size parameters: # cat /proc/sys/net/core/rmem_default 110592 # cat /proc/sys/net/core/rmem_max 131071 # cat /proc/sys/net/core/wmem_default 110592 # cat /proc/sys/net/core/wmem_max 131071 # Note that all these are too small.conf.ipv4. Edit the /etc/sysctl.core.16 .rmem_max = 1048576 net.rmem_default = 1048576 net. 9.conf file.sysrq = 0 kernel.sem = 250 32000 100 128 le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .conf file and enter the following line: net.ip_local_port_range = 1024 65000 8. Now that all the correct entries have been made in the /etc/sysctl.default. Edit the /etc/sysctl.accept_source_route = 0 kernel.core_uses_pid = 1 kernel.ipv4.file-max = 65536 6.conf. and then issue the following OS command to make them effectively permanent: ra O le c # sysctl -p net.core.conf file and enter the following lines: net.shmmax = 2147483648 kernel.

ipv4. and make the following entries.rmem_max = 1048576 net.d/login file. Edit the /etc/security/limits.core. and then save the file: oracle oracle oracle oracle soft hard soft hard nproc 2047 nproc 16384 nofile 1024 nofile 65536 2. Add the following lines to the /etc/pam. hard = 65536 Answer: 1.wmem_max = 262144 # 65000 4) Set the shell limits according to the following: Number of processes: soft = 2047. and then save it: ulimit -u 16384 -n 65536 ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .wmem_default = 262144 net.core.Solutions for Practice 2-3: Configuring Kernel Parameters (continued) fs. and then save it: session session required required /lib/security/pam_limits. Add the following lines to the /etc/profile file.17 .so 3.core.core. hard = 16384 Number of open file handles: soft = 1024.so pam_limits.conf file.rmem_default = 1048576 net.file-max = 65536 net.ip_local_port_range = 1024 net.

enter the following to create the Oracle base directory and set the permissions appropriately: # mkdir -p /u01/app/oracle # chown –R oracle:oinstall /u01/app/oracle # chmod 775 /u01/app/oracle 3. Answer: 1. after they are installed: export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/10. 1) Determine a mount point that has enough space. This should be named /u01/app/oracle. you may see different output from that shown.2.0M 18M 19% /boot 0 506M 0% /dev/shm 5.Solutions for Practice 2-4: Creating Oracle Directories Set up the needed directories and environment variables for the Oracle software installation. Add the following lines to the ~oracle/.8G 5. As the root user. and create the directory that will serve as ORACLE_BASE. Enter this at the OS prompt to see the disk space available: # df -h Filesystem /dev/hda5 /dev/hda2 none /dev/hda1 Size 25G 23M 506M 11G Used Avail Use% Mounted on 12G 12G 51% / 4. 2. and to adjust the PATH variable to include the Oracle binaries.bash_profile file to set the ORACLE_BASE and ORACLE_HOME directories.0G 54% /mnt/cdrive Note: Depending on your system.0/db_1 export PATH=$PATH:$ORACLE_HOME/bin ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .18 .

2. Run the ~oracle/labs/hostname.us. You can verify this by entering the hostname command as follows: # hostname EDT3R12P1 Note that the host name is in uppercase.com ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .conf #hosts: db files ldap nis dns hosts: files dns Note that there is a files entry. If it does not include the domain name.sh script to correct it. 1) Verify that the /etc/hosts file is used for name resolution. so this needs to be fixed.conf file as follows: # grep hosts /etc/nsswitch.oracle. To avoid this error. run the hostname.sh 3.Solutions for Practice 2-5: Setting Up the Host Name When you run Oracle Universal Installer. 2) Verify that the host name has been set correctly. which means that host names are resolved only through the /etc/hosts file. an error may occur if name resolution is not set up. This will cause a warning during the installation. Verify that the host name is corrected by entering the hostname command again: # hostname edt3r12p1.sh script to correct the host name setting by entering the following command: # ~oracle/labs/hostname. and is not fully qualified. you must ensure that host names are resolved only through the /etc/hosts file.19 . You can verify this by checking the hosts file entry in the nsswitch. Answer: 1. Answer: 1. before you begin installation.

Practice Solutions for Lesson 3: Installing Oracle on Linux ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .20 .

The password is oracle. Type the following in any OS terminal windows. and then click Next. click Install. Use oracle for any passwords.0/db_1/root./runInstaller 2. 3. run each of the two scripts shown. Use the default settings for everything except for these options: Set the UNIX DBA Group to oinstall Do not create the starter database Answer: 1. The install activity begins now. as root. and run the installer program that is in the /stage/database directory. Perform the installation. Choose the menu item in Applications > System Tools > Terminal. and that the operating system group name is oinstall. 6. make sure that they have all passed. and log out of the root session. After the prerequisite checks are run.sh script. deselect the Create Starter Database option. Answer: 1. 2) Log in to the machine as the oracle user.Solutions for Practice 3-1: Installing Oracle Database on Linux Install Oracle Database. and then click Next.21 . On the “Specify inventory directory and credentials” page. The execution of the script is complete # /u01/app/oracle/product/10. The database software is staged in the /stage/database directory. Then enter the following at the OS prompt: $ cd /stage/database $ . 5. Enter the following to log in as root. Changing groupname of /u01/app/oracle/oraInventory to oinstall. Click “X” in the upper right corner of any remaining windows. and run the scripts: $ su Password:oracle # /u01/app/oracle/oraInventory/orainstRoot. 1) Exit all windows of the current session.sh Running Oracle10 root. 4. # exit 2. selecting the Basic option. On the Installation Method page.2..sh Changing permissions of /u01/app/oracle/oraInventory to 770. Then click Next. When the Execute Configuration Scripts page appears. change the UNIX DBA Group to oinstall. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . On the Summary page. 3) Open a new terminal window.. make sure that the inventory directory is set to $ORACLE_BASE/oraInventory.

.2... Click OK after running the scripts. Creating /etc/oratab file. # 7. click Exit to quit the installation.. Copying coraenv to /usr/local/bin . Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root. Now product-specific root actions will be performed. 4) In the End of Installation window.0/db_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: Copying dbhome to /usr/local/bin . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .Solutions for Practice 3-1: Installing Oracle Database on Linux (continued) The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/10.22 .. Copying oraenv to /usr/local/bin ..sh script...

Oracle. Enter the following at the OS prompt.2. 39 sec ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .0 .Production on 11DEC-2006 10:39:32 Copyright (c) 1991. All rights reserved. Answer: 1. 2) Verify that the listener has been started. Answer: 1. as the oracle user: $ netca 2. 2005. 5 min.Solutions for Practice 3-2: Configuring the Listener Configure and start the listener. Use the default settings on every screen.23 .0.0. Click Finish. Click Next on each of the netca wizard screens.Production Start Date 11-DEC-2006 10:33:53 Uptime 0 days 0 hr. Enter the following at the OS prompt: $ lsnrctl status LSNRCTL for Linux: Version 10.0 . 1) Run the Network Configuration Assistant (netca) to configure the listener. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edt3r12p1)(PORT= 1521))) STATUS of the LISTENER -----------------------Alias LISTENER Version TNSLSNR for Linux: Version 10. until you see Finish.2.1.1.

Practice Solutions for Lesson 4 There is no practice for lesson 4. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .24 .

25 .Practice Solutions for Lesson 5: Automatic Storage Management ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .

in /home/oracle/labs. in the example a kernel version is not given. Note.d/oracleasm configure command. Use the kernel version from the uname -r command.0. $ su – Password: # cd /home/oracle/labs # rpm -Uvh oracleasm-<kernel version>-2.3-2. Use the following settings: Owning user: Owning group: Start on boot: Fix permissions: Answer: oracle dba y y 1. Answer: 1. enter the following at the OS prompt: ra O le c le ac r O ly l & On na se er U nt I c A de a y m [root@edt3r12p1 labs]# /etc/init.rpm \ > oracleasmlib-*. $ ls /home/oracle/labs/oracleasm* 2. you install and configure ASMLib. Install the three RPMs..0. 1) As root.6. install the three RPMs required for ASMLib. List the RPMs.rpm \ > oracleasm-support*.i686. containing the kernel version in the name of the RPM. The RPMs are located in /home/oracle/labs. Three need to be installed: oracleasm. for Oracle ASMLib. $ uname -r 3. RPM oracleasm is dependent on the kernel version. As root.########################################### [ 67%] 3:oracleasmlib ########################################### [100%] # 2) Configure ASM by executing the /etc/init.Solutions for Practice 5-1: Installing and Configuring ASMLib In this practice. This will configure the on-boot properties of the Oracle ASM library Oracle Database 10g: Managing Oracle on Linux for DBAs B .0.26 . oracleasmlib.942. and oracleasm-support.. Use the uname -r command to determine the kernel version. and then create an ASM instance.rpm Preparing.d/oracleasm configure Configuring the Oracle ASM library driver. Five RPMs exist in /home/oracle/labs for Oracle ASMLib. ########################################### [100%] 1:oracleasm-support ########################################### [ 33%] 2:oracleasm-2.

When prompted within fdisk. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) ra O le c Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-130. SGI or OSF disklabel Building a new DOS disklabel. Default user to own the driver interface []: oracle Default group to own the driver interface []: dba Start Oracle ASM library driver on boot (y/n) [n]: y Fix permissions of Oracle ASM disks on boot (y/n) [y]: y Writing Oracle ASM library driver configuration: [ Creating /dev/oracleasm mount point: [ Loading module "oracleasm": [ Mounting ASMlib driver filesystem: [ Scanning system for ASM disks: [ # OK OK OK OK OK ] ] ] ] ] 3) Use the fdisk command to create a single partition on the disks to be used with ASM.27 le ac r O ly l & On na se er U nt I c A de a y m . Enter the following at the OS prompt: # /sbin/fdisk /dev/sdj Device contains neither a valid DOS partition table. The following questions will determine whether the driver is loaded on boot and what permissions it will have. The current values will be shown in brackets ('[]'). the previous content won't be recoverable. default 1): <press ENTER> Oracle Database 10g: Managing Oracle on Linux for DBAs B . nor Sun. until you decide to write them. of course. Hitting <ENTER> without typing an answer will keep that current value. Changes will remain in memory only. Ctrl-C will abort. After that.Solutions for Practice 5-1: Installing and Configuring ASMLib (continued) driver. enter these values: Command (new partition): Primary partition: Partition number: First cylinder: Last cylinder: Last command (write): n p 1 1 130 w Answer: 1.

The new table will be used at the next reboot. Answer: 1. running partprobe ensures that the kernel is aware the disks have been partitioned. The kernel still uses the old table. WARNING: Re-reading the partition table failed with error 22: Invalid argument. # 4) Repeat the step above.Solutions for Practice 5-1: Installing and Configuring ASMLib (continued) Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-130.28 . Note: The responses are not shown here. # # # # # # # /sbin/fdisk /sbin/fdisk /sbin/fdisk /sbin/fdisk /sbin/fdisk /sbin/fdisk /sbin/fdisk 5) Run the partprobe command. This informs the kernel of partition table changes. Enter the following commands at the OS prompt. and respond with the exact same values for the /dev/sdj set up. Enter the following at the OS prompt: ra O le c le ac r O ly l & On na se er U nt I /dev/sdk /dev/sdl /dev/sdm /dev/sdn /dev/sdo /dev/sdp /dev/sdq c A de a y m # partprobe 6) Enable ASMLib. default 130): <press ENTER> Using default value 130 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. In this case. Syncing disks. creating partitions for each of the following devices: /dev/sdk /dev/sdl /dev/sdm /dev/sdn /dev/sdo /dev/sdp /dev/sdq Answer: 1. Oracle Database 10g: Managing Oracle on Linux for DBAs B .

29 .d/oracleasm createdisk Marking disk "/dev/sdl1" as an ASM # /etc/init.d/oracleasm scandisks Scanning system for ASM disks: le ac r O ly l & On na se er U nt I c A de a y m [ OK ] Oracle Database 10g: Managing Oracle on Linux for DBAs B . Enter the following at the OS prompt: # /etc/init.d/oracleasm createdisk Marking disk "/dev/sdp1" as an ASM # /etc/init.d/oracleasm createdisk Marking disk "/dev/sdj1" as an ASM # /etc/init. Enter the following at the OS prompt: # /etc/init. Map the ASM disk names to devices: DF1 DF2 DF3 DF4 FRA1 FRA2 FRA3 FRA4 Answer: 1.d/oracleasm createdisk Marking disk "/dev/sdq1" as an ASM DF1 /dev/sdj1 disk: . Answer: 1. DF2 /dev/sdk1 disk: DF3 /dev/sdl1 disk: DF4 /dev/sdm1 disk: FRA1 /dev/sdn1 disk: FRA2 /dev/sdo1 disk: FRA3 /dev/sdp1 disk: FRA4 /dev/sdq1 disk: [ [ [ [ [ [ [ [ OK OK OK OK OK OK OK OK ] ] ] ] ] ] ] ] /dev/sdj1 /dev/sdk1 /dev/sdl1 /dev/sdm1 /dev/sdn1 /dev/sdo1 /dev/sdp1 /dev/sdq1 8) Make the ASM disks available using the scandisks option of the oracleasm utility.d/oracleasm createdisk Marking disk "/dev/sdk1" as an ASM # /etc/init.d/oracleasm createdisk Marking disk "/dev/sdm1" as an ASM # /etc/init.d/oracleasm createdisk Marking disk "/dev/sdn1" as an ASM # /etc/init.d/oracleasm createdisk Marking disk "/dev/sdo1" as an ASM # /etc/init. Enter the following at the OS prompt: ra O le c # /etc/init.d/oracleasm enable Writing Oracle ASM library driver configuration: Scanning system for ASM disks: [ [ OK OK ] ] 7) Create the ASM disk for storing the database’s data files and flash recovery area files.Solutions for Practice 5-1: Installing and Configuring ASMLib (continued) Answer: 1. Use the oracleasm utility to do this.

1) Use DBCA to configure Automatic Storage Management. click Next. you can create the ASM instance that uses them. Exit from the root session by entering the following at the OS prompt: # exit 2. As the oracle user. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . 4. On the Operations screen. select Configure Automatic Storage Management. you will create an ASM instance. and define the ASM disk groups that it is to use for data. Answer: 1. On the Welcome screen. enter the following to start the database configuration assistant: $ dbca 3. and then click Next. In this practice.30 .Solutions for Practice 5-2: Creating an ASM Instance Now that the ASM disks are set up. and for the flash recovery area.

Solutions for Practice 5-2: Creating an ASM Instance (continued) 5. Creating OCR keys for user 'root'. STOP. While the warning screen is still displayed. Oracle Database 10g: Managing Oracle on Linux for DBAs B . Creating it now. Then enter the following command: ra O le c le ac r O ly l & On na se er U nt I c A de a y m # /u01/app/oracle/product/10. go to a terminal window as the root user. On the Warning screen.. Operation successful. do not click OK yet. 6.31 . privgrp 'root'.2. Note that it says that you need to start the Oracle Cluster Synchronization Service (CSS) before proceeding. You may need to start a new terminal and log in as root.0/db_1/bin/localconfig add /etc/oracle does not exist. Successfully accumulated necessary OCR keys.

click Next. Oracle CSS service is installed and running under init(1M) # exit 7.32 . On the Operations page. Return to the CSS warning window and click OK. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .. Checking the status of new Oracle init process. CSS is active on these nodes. edt3r12p1 CSS is active on all nodes.Solutions for Practice 5-2: Creating an ASM Instance (continued) Configuration for local CSS has been initialized Adding to inittab Startup will be queued to init within 90 seconds. 8.. Expecting the CRS daemons to be up within 600 seconds.

11. The Database Configuration Assistant dialog box says that you are about to create the ASM instance. Click OK.33 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .Solutions for Practice 5-2: Creating an ASM Instance (continued) 9. On the Create ASM Instance page. On the ASM Disk Groups page. Click Create New to create one. enter oracle (twice) as the SYS password for the new instance. Then click Next. 10. note that there are no groups created yet.

On the Create Disk Group page. DF2. DF3. name the group DF. and DF4).34 .Solutions for Practice 5-2: Creating an ASM Instance (continued) 12. change Redundancy to External. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . and select the four data file disks (DF1. Then click OK.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . Note that the DF disk group is now listed. Click Create New again to create the disk group for the flash recovery area.35 .Solutions for Practice 5-2: Creating an ASM Instance (continued) 13.

and select all four of the remaining disks.36 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . Then click OK.Solutions for Practice 5-2: Creating an ASM Instance (continued) 14. change the Redundancy to External. Name the disk group FRA.

showing both disk groups. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .37 . Click Finish. After the FRA disk group is created.Solutions for Practice 5-2: Creating an ASM Instance (continued) 15. the ASM Disk Groups page appears again.

Solutions for Practice 5-2: Creating an ASM Instance (continued) 16. Click No when asked if you want to perform another operation.38 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .

39 .Practice Solutions for Lesson 6: Creating the Database ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .

7. and click Next. The database should be in ARCHIVELOG mode. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .Solutions for Practice 6-1: Creating a Database Create a database to be used in the instance already installed. The flash recovery area should be 4 GB in size. 5. Click Next on the Welcome page. Select the Create a Database option. Enter oracle for both password fields on the Database Credentials page.oracle. It should have the sample schemas installed. as the oracle user: $ dbca 2.oracle. The database should use ASM as its storage mechanism. 4. and click Next.us.us. and click Next. The database will use the ASM you already configured. for data file and flash recovery area storage. Select General Purpose for the template to use. 8. Click Next on the Management Options page. Answer: 1.com. On the Storage Options page. All initial accounts should have the password of oracle. It is configurable using Database Control. 1) Use the Database Creation Assistant to create a database with these attributes: It is a general-purpose database. and then click Next. The SID is orcl.com 6.40 . orcl. On the Database Identification page. It has a Global Database Name of orcl. select Automatic Storage Management. Enter the following at the OS prompt. It should use Oracle Managed Files (OMF). 3. enter the following for the Global Database Name.

Select the DF disk group to be used for storage in this database. and then click OK. and then click Next.Solutions for Practice 6-1: Creating a Database (continued) 9.41 . 10. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . Enter oracle as the password in the ASM Credentials window.

which means that the Database Area is the +DF disk group. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .42 . On the Database File Locations page. Then click Next. leave the settings as the defaults.Solutions for Practice 6-1: Creating a Database (continued) 11.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .Solutions for Practice 6-1: Creating a Database (continued) 12.43 . On the Recovery Configuration page. Also. click Browse to select the FRA disk group to serve as the Flash Recovery Area. and click Next. Then select the Enable Archiving option. which is all of the free space in +FRA. set the Flash Recovery Area Size to 4040.

This will take several minutes to complete. 15. and then click OK. 14.44 . On the Creation Options page. Select the Sample Schemas option on the Database content page. The information displayed on the final DBCA page is similar to: ra O le c le ac r O ly l & On na se er U nt I c A de a y m SID: ___orcl_______ Sever Parameter File name: _+DF/orcl/spfileorcl.Solutions for Practice 6-1: Creating a Database (continued) 13. click Next. 16. click Finish. On the Database Storage page. On the Initialization Parameters page. 2) When DBCA finishes. At this point. and then click Next. Make note of this information here: SID: __________ Sever Parameter File name: _____________________________ Database Control URL: ________________________________ Answer: 1. it will display the information about the database that was just created. 17.ora Database Control URL: http://edt3r12p1:1158/em______________ Oracle Database 10g: Managing Oracle on Linux for DBAs B . DBCA begins creating the database. click Next. Review the information on the Confirmation page.

and check the ORACLE_SID variable by entering the following: $ echo $ORACLE_SID ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . Set it to orcl. 5) Set the ORACLE_SID environment variable so that it is set for every terminal session that the oracle user starts. Exit from all open terminal shells.45 .bash_profile file. 4. and set its password to hr. deselect the Lock Account column for the HR username. 4) Click Exit to exit DBCA.Solutions for Practice 6-1: Creating a Database (continued) 3) Unlock the HR account. Then click OK. On the Password Management page. and log out of the machine. and then add the following line: export ORACLE_SID=orcl 2. Enter hr for the New Password and the Confirm Password fields. Log in as the oracle user again. 2. Answer: 1. 3. Answer: 1. Edit the . Click Password Management. Start a terminal shell.

Enter the following at the RMAN prompt: RMAN> backup database. .46 . Answer: 1. RMAN> exit ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . .Solutions for Practice 6-2: Backing Up Your Database It is good to have a backup of the database you are working with. Enter the following as the oracle user. Take a backup of the database that has just been created. at the OS prompt: $ rman target / 2. . 1) Back up the database.

Practice Solutions for Lesson 7: Customizing Oracle on Linux ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .47 .

48 . either planned or unplanned. 1) By editing the /etc/oratab file.2.d/init. In addition. in this practice. enter the following command at the OS prompt: # cp /home/oracle/labs/dbora /etc/rc.0/db_1:Y 2) View the /home/oracle/labs/dbora script to see what it does. then fully edited and correct versions of these files are located in /home/oracle/solutions. The files are named dbstart_edited. As the root user. The shutdown. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . Answer: 1. and startup scripts should be executed last. 3) Copy the dbora script from the /home/oracle/labs directory to a directory such that it will be invoked during startup and shutdown of the OS. configure the ASM and orcl instances to be automatically started and stopped when the operating system is started and stopped. This provides higher database availability and reduces the chance of error.d/init.d 4) Set the permissions for the dbora script to 750. and set the group to dba. enter the following command at the OS prompt: # chmod 750 /etc/rc. Lastly. should be executed first. Answer: 1. from N to Y.d/init. and dbshut_edited. What scripts does it invoke? ________________ Answer: ________________ 1. The resulting lines should look like this: +ASM:/u01/app/oracle/product/10. you will edit the dbstart and dbshut scripts to include starting and stopping DB Control. you will view a demo of the installation of Enterprise Linux. As root.2. As the oracle user. changing the third field. Answer: 1. edit the /etc/oratab file. it is good to have your database start up automatically. or “kill” scripts. you will configure the database to start and stop when the OS boots and shuts down.d/dbora # chgrp dba /etc/rc.0/db_1:Y orcl:/u01/app/oracle/product/10. delimited by a colon.Solutions for Practice 7-1: Configuring Automatic Startup and Shutdown of the Database For dealing with reboots. Note: If you do not want to manually edit the dbstart dbshut files. The /home/oracle/labs/dbora script invokes dbstart and dbshut.d/dbora ra O 5) Establish links in the dbora script such that it will be invoked during the OS startup and shutdown in runlevels 3 and 5. In this practice.

check whether they are still running. enter the following commands: # # # # ln ln ln ln -s -s -s -s /etc/rc. within the script.d/dbora /etc/rc. Remove the first word of the line. change the value for ORACLE_HOME_LISTNER to this value: /u01/app/oracle/product/10.d/dbora /etc/rc. le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .d/init.d/dbora stop ra O 8) While the databases are being shut down. export.2.0/db_1/bin/dbstart to fix the known issue with starting the listener. As root.d/dbora /etc/rc.2. On line 78. Remove the –s option from the LOGMSG value. dbshut is called with an ampersand following it. Enter the following as the root user: # /etc/rc.d/K01dbora Note that the startup scripts start with S99 forcing them to run last.49 .d/dbora /etc/rc3.Solutions for Practice 7-1: Configuring Automatic Startup and Shutdown of the Database (continued) Answer: 1. Check for pmon_orcl and pmon_+ASM processes. le c Note that shutdown is in progress even though the dbora command returns immediately.d/init.d/init. causing it to run in the background.d/S99dbora /etc/rc5. Make the following changes. This is because.d/init.d/S99dbora /etc/rc3.d/K01dbora /etc/rc5. and then save the file.0/db_1 Correct automatic ASM startup by editing line 59. The resulting line should look like this: LOGMSG="logger -puser.alert" Change line 255 to look like this: COUNT=`expr $COUNT + 1` Change line 88. Answer: 1. 6) Edit /u01/app/oracle/product/10. Then insert a line under 88 that looks like this: export VER10LIST 7) Test stopping the database instances using dbora.d/init. The kill scripts start with K01 forcing them to run first.

to stop the listener: $ lsnrctl stop LSNRCTL for Linux: Version 10. as the oracle user. Oracle. Run the following two commands until the only result returned is the grep command itself. as the root user: # reboot ra O le c The system reboots.2. Enter the following at the OS prompt. Run the dbstart script by entering the following as root: # /etc/rc. 2005. As the system reinitializes. as it would be at normal boot-up time.d/init. First shut down the listener to set up the environment. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edt3r12p1)(PORT= 1521))) The command completed successfully $ 2. check for the pmon processes using the ps commands used previously. le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .Solutions for Practice 7-1: Configuring Automatic Startup and Shutdown of the Database (continued) Answer: 1.0.d/dbora start 3. Check for the instances to be started by looking for the pmon processes to appear in the process listing. Enter the following. # ps -ef | grep pmon_orcl # ps -ef | grep pmon_+ASM When the commands return no results. the instances have been shut down.50 .Production on 11DEC-2006 14:27:30 Copyright (c) 1991.1. 9) Test starting the database with dbora.0 . All rights reserved. Answer: 1. Answer: 1. Do that by entering the following commands: # ps -ef | grep pmon_orcl # ps -ef | grep pmon_+ASM 10) Test that these scripts will be called and will function properly during a reboot.

then there exists a directory under $ORACLE_HOME with the format FullyQualifiedHostname_SID." else $LOGMSG "" $LOGMSG "Error: DB Control for fi --. If DB Control has been configured for an instance.us.Solutions for Practice 7-2: Configuring Automatic Startup and Shutdown of DB Control (optional) Note: If you have already copied the dbstart_edited and dbshut_edited files as described in practice 7-1." $ cp ~/solutions/dbstart_edited $ORACLE_HOME/bin/dbstart Oracle Database 10g: Managing Oracle on Linux for DBAs B . then the executable emctl exists under the $ORACLE_HOME/bin directory. So position the commands in the dbstart script to be after a test for a successful start of the database. then echo "" echo "$0: DB Console for \"${ORACLE_SID}\" started.End of text to add --- ra O Note: You can either edit this file manually (the text above is in a file named lab_07_02_01. then Line 219: echo "" Line 220: echo "$0: ${INST} \"${ORACLE_SID}\" warm started. The copy command to use. as the oracle user. 1) Configure DB Control to start with the database. For example: textbox. is: le c le ac r O ly l & On na se er U nt I c A de a y m \"${ORACLE_SID}\" NOT started.then echo "$0: Starting DB Control" ${ORACLE_HOME}/bin/emctl start dbconsole fi if test $? -eq 0 . then you do not need to do this practice.txt) or simply copy the dbstart_edited file from the solutions directory to $ORACLE_HOME/bin/dbstart. which is following these three lines: Line 218: if test $? -eq 0 ." --. You need to configure DB Console to start and stop when the database starts up and shuts down.Beginning of text to add --HOSTNAME_SID=${ORACLE_HOME}/`hostname --long`_${ORACLE_SID} if [ -d ${HOSTNAME_SID} ] && [ -f ${ORACLE_HOME}/bin/emctl ]. Add the following text to the dbstart script. Insert it at line 221.51 .oracle. It is best to start DB Control after the database has successfully started.com_orcl If DB Control is available in this version of the database.

Check the status of the DB Control.Solutions for Practice 7-2: Configuring Automatic Startup and Shutdown of DB Control (optional) (continued) 2) Configure DB Control to stop when the database is shut down." else $LOGMSG "" $LOGMSG "Error: DB Console for fi --. Note that you must become the oracle user by exiting the root session. Do this by editing the dbshut script. which is following these lines: Line 94: if [ -f $ORACLE_HOME/bin/svrmgrl ] . then \"${ORACLE_SID}\" NOT stopped. as the oracle user. The copy command to use. As root. then echo "" echo "$0: DB Console for \"${ORACLE_SID}\" stopped.d/dbora stop Oracle Database 10g: Managing Oracle on Linux for DBAs B . le c le ac r O ly l & On na se er U nt I c A de a y m # /etc/init. then Line 95: SQLDBA=svrmgrl Line 96: VERSION="internal" Line 97: else Line 98: SQLDBA="sqlplus /nolog" Line 99: fi Line 100: fi --. Also.End of text to add --[ -f ${ORACLE_HOME}/bin/emctl ]. enter the following at the OS prompt: O ra 2. stop the listener.txt) or simply copy the dbshut_edited file from the solutions directory to $ORACLE_HOME/bin/dbshut. and the database instance by entering the following." Note: You can either edit this file manually (the text above is in a file named lab_07_02_02.52 . adding the following text at line 101.Beginning of text to add --HOSTNAME_SID=${ORACLE_HOME}/`hostname --long`_${ORACLE_SID} echo ${HOSTNAME_SID} if [ -d ${HOSTNAME_SID} ] && echo "$0: Stop DB Console" ${ORACLE_HOME}/bin/emctl stop dbconsole fi if test $? -eq 0 . Answer: 1. the listener. is: $ cp ~/solutions/dbshut_edited $ORACLE_HOME/bin/dbshut 3) Test the automatic shutdown of DB Control by issuing a dbora stop command.

1.0/db_1/startup.d/dbora start 4. In the oracle user’s window.2.0 . One is logged in as oracle and the other as root. Answer: 1.2.Production on 12DEC-2006 06:24:11 Copyright (c) 1991.log $ tail -f /u01/app/oracle/product/10. 2005. check that the database. Answer: 1. $ touch /u01/app/oracle/product/10. Note that DB Control and the database are stopped. Press [Ctrl] + [C] to break the tail command first. Then enter the following: $ lsnrctl status $ tnsping orcl $ emctl status dbconsole 5) Test the automatic restart by rebooting the system. enter the following to view the startup log in real time. In the root user’s window. 2. All rights reserved. Enter the following to stop it: $ lsnrctl stop LSNRCTL for Linux: Version 10. In the oracle user’s window. listener. Enter the following in the root user’s window: ra O le c le ac r O ly l & On na se er U nt I c A de a y m # reboot Oracle Database 10g: Managing Oracle on Linux for DBAs B .2.53 .Solutions for Practice 7-2: Configuring Automatic Startup and Shutdown of DB Control (optional) (continued) # $ $ $ exit emctl status dbconsole ps -ef|grep -i smon lsnrctl status 3.log 3. Oracle.0/db_1/startup. Open two terminal windows. It is not stopped by dbora.0. but the listener is still running. enter the following to start the test: # /etc/init. and DB Control have started. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edt3r12p1)(PORT= 1521))) The command completed successfully $ 4) Test the automatic startup of DB Control by issuing a dbora start command.

54 . After the system reboots. enter the following to check whether DB Control has restarted: $ emctl status dbconsole ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .Solutions for Practice 7-2: Configuring Automatic Startup and Shutdown of DB Control (optional) (continued) 2.

and asks you for the password. b.55 . you will run a viewlet of the process of installing Enterprise Linux. No. you must have a root user. click the link that appears on the page. d. sar and iostat are not installed by default. What is the mount point for the swap partition? ________________________ c. While in the ~oracle/labs directory. Is creating a root user optional? ________________________ Answer: 1. 2) Answer the following questions: a. The viewlet begins running. It is not actually a file system.html file. Following are the answers to the questions listed: a. Use the navigation buttons at the bottom of the screen to pause. restart. You have to select those from the System Tools list of packages. The graphical environment was not installed by default because you chose a Server type installation.Solutions for Practice 7-3: Installing Linux In this practice. and thus is not mounted. 1) Launch the viewlet using the install_el4u4_launcher. and so on. No. Answer: 1. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . When the browser window appears. Are sar and iostat installed by default? ________________________ d. c. enter the following at the OS prompt: $ htmlview install_el4u4_launcher. Why was a graphical environment not installed by default? __________________________________________________________________ b.html 2. 3. You do not specify the mount point for a swap partition. The installation process creates the user.

56 .Practice Solutions for Lesson 8: Managing Memory ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .

and swap space. depending on the type of machine you are on.57 . how much memory is currently in use? ra O le c le ac r O ly l & On na se er U nt I kB c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . 2) According to the top command.Solutions for Practice 8-1: Managing Memory In this practice you will inspect your system’s memory parameters. You will look at statistics and behavior regarding physical memory. 1) View the current memory settings and status for the kernel. Note that there is about 1 GB total memory on this system. # cat /proc/meminfo MemTotal: 1035208 MemFree: 15680 Buffers: 34100 Cached: 603772 SwapCached: 60 Active: 596128 Inactive: 371704 HighTotal: 130524 HighFree: 1736 LowTotal: 904684 LowFree: 13944 SwapTotal: 2048276 SwapFree: 2048208 Dirty: 1592 Writeback: 0 Mapped: 539544 Slab: 19520 CommitLimit: 2565880 Committed_AS: 1647784 PageTables: 12164 VmallocTotal: 106488 VmallocUsed: 6184 VmallocChunk: 99316 HugePages_Total: 0 HugePages_Free: 0 Hugepagesize: 4096 kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB kB 2. as root. Answer: 1. Enter the following at the OS prompt. How much total memory is on your system? Note: You may see different memory related values from those shown here.

Depending on the type of device on your machine.58 . Note that top reports. 5) What is the device name that is being used for the swap space? Answer: 1. there is about 2 GB of swap space allocated. Enter the following at the OS prompt: # top 2. Enter the following command to see the information about the swap space allocation: ra O le c # cat /proc/swaps Filename Type /dev/hda3 partition le ac r O ly l & On na se er U nt I Size Used 2048276 1036 c A de a y m Priority -1 Note: The swap space is allocated on /dev/hda3. in this case. and how much is in use? Answer: 1. or new requests for memory allocation? Answer: 1. as shown below: # free total used free shared buffers cached Mem: 1035208 1021648 13560 0 34168 604576 -/+ buffers/cache: 382904 652304 Swap: 2048276 112 2048164 # 2. which means that it is available to be used for noncache uses such as new process starting up. 1017792 KB of memory is currently being used. Oracle Database 10g: Managing Oracle on Linux for DBAs B . approximately 604 MB of the memory in use is being used for cache. Run the free command. 3) How much of this used memory is being used for cache. 4) How much swap space is there. such as /dev/sda3. and 112 KB is being used right now.Solutions for Practice 8-1: Managing Memory (continued) Answer: 1. According to the free output. in this case. you may see a different value here. Note that.

Shut down the Oracle database instance by entering the following: ra O 2. and how they relate to an Oracle database instance. 1) Display the list of shared memory segments belonging to the oracle user on your system. It belonged to the Oracle database. Note: The numbers you see will most likely be different from those shown here.Shared Memory Segments -------key shmid owner perms bytes le c $ sqlplus / as sysdba SQL> shutdown le ac r O ly l & On na se er U nt I c A de a y m nattch status Oracle Database 10g: Managing Oracle on Linux for DBAs B .Solutions for Practice 8-2: Managing Shared Memory Now you will view the state and behavior of shared memory segments on your system. Enter the following at the OS prompt: $ ipcs -m -----.Shared Memory Segments key shmid owner status 0x00000000 65536 vncuser 0x00000000 98305 vncuser 0x00000000 131074 vncuser 0x351b2710 458763 oracle 0x00000000 589836 oracle 0x00000000 622605 oracle 0x00000000 655374 oracle 0x00000000 688143 oracle 0x00000000 720912 oracle 0x00000000 753681 oracle 0x00000000 786450 oracle 0x00000000 819219 oracle 0x00000000 851988 oracle 0x00000000 884757 oracle 0x00000000 917526 oracle 0x00000000 3571735 oracle 0xbe3bb918 3768344 oracle 0x00000000 2129945 oracle 0x00000000 2654237 oracle [oracle@EDRSR9P1 labs]$ -------perms bytes 644 644 644 640 644 644 644 600 600 600 600 600 600 600 600 600 640 600 600 151552 122880 790528 88080384 151552 122880 790528 196608 196608 196608 196608 196608 196608 196608 196608 196608 423624704 196608 196608 nattch 2 2 2 12 2 2 2 2 2 2 2 2 2 2 2 2 29 2 2 dest dest dest dest dest dest dest dest dest dest dest dest dest dest dest dest dest 2) Note the largest shared memory segment. What is it being used for? Prove your answer. Rerun the ipcs –m command as above. Note that the largest shared memory segment is gone from the list. Answer: 1.59 . Answer: 1. $ ipcs -m -----.

The nattch column is the number of processes that are attached to this shared memory segment. You can prove this by creating and disconnecting from database sessions and observing the number as it changes accordingly. Answer: 1. 4) What is the meaning of the nattch column? Prove it by demonstrating how it changes. Note that it has increased by one. enter the following to establish another database session: 3.Shared Memory Segments -------key shmid owner perms bytes nattch 0xbe3bb918 983064 oracle 640 289406976 27 2.Shared Memory Segments -------- ra O le c $ sqlplus / as sysdba le ac r O ly l & On na se er U nt I c A de a y m status Oracle Database 10g: Managing Oracle on Linux for DBAs B .Solutions for Practice 8-2: Managing Shared Memory (continued) 0x00000000 0x00000000 0x00000000 0x351b2710 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 65536 98305 131074 458763 589836 622605 655374 688143 720912 753681 786450 819219 851988 884757 917526 3571735 2129945 vncuser vncuser vncuser oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle oracle 644 644 644 640 644 644 644 600 600 600 600 600 600 600 600 600 600 151552 122880 790528 88080384 151552 122880 790528 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 2 2 2 11 2 2 2 2 2 2 2 2 2 2 2 2 2 dest dest dest dest dest dest dest dest dest dest dest dest dest dest dest dest 3. Rerun the ipcs command to see if the nattch number has increased. In a separate oracle terminal window. $ ipcs –m -----. 3) What does the next highest oracle shared memory segment belong to? Answer: 1. Restart your database instance. Only the largest segment is shown here. $ ipcs –m -----. and rerun the ipcs command to see the shared memory segment reappear in the list. It belongs to the ASM instance.60 . Enter the following to get a baseline number for the orcl instance shared memory segment. Note that there are 27 processes attached to this segment.

Solutions for Practice 8-2: Managing Shared Memory (continued) key shmid owner perms 0xbe3bb918 983064 oracle 640 bytes nattch 289406976 28 status 4. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .61 . Exit the SQL*Plus session and note that the number of processes attached to the segment returns to the original value.

62 .Practice Solutions for Lesson 9 ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .

First output section is all activity since last report. you will measure CPU. svctm Record your measurements in the following table. First line is all activity since last report.Solutions for Practice 9-1: Gather Statistics Using iostat. Disk activity by partition. Note hda is sum of hda* lines. hda5 is the / partition.63 . Pick a representative line other than the first to record. %user. sect/s Free. await. ldavg. sar. A table of commands is provided for your reference. and I/O usage on your system. %idle rps. Pick a representative section other than the first to record. Measurement Quiet sar -uq AVERAGE runq-sz sar -uq AVERAGE ldavg sar -uq AVERAGE sar -uq AVERAGE %user sar -uq AVERAGE %sys sar -uq AVERAGE %idle ra O sar -d AVERAGE dev3-0 tps sar -d AVERAGE dev3-0 rd_sec/s sar -d AVERAGE dev3-0 wr_sec/s le c le ac r O ly l & On na se er U nt I Database Activity c A de a y m I/O Activity Oracle Database 10g: Managing Oracle on Linux for DBAs B .%sys. Diagnostic sar -uq 5 3 Measures runq-sz. and vmstat In this practice. virtual memory. sar -d 5 3 vmstat 5 3 iostat -p /dev/hda 5 3 avgqu-sz. si Notes On the system the averages provide a baseline Overall activity by device Swapping information also includes disk and CPU.

00 ldavg-15 0. Note: The numbers shown here may differ for your system. $ sar -uq 5 3 Linux 2.Solutions for Practice 9-1: Gather Statistics Using iostat. The –u option reports on all CPU utilization.09 %iowait 0.20 0. So.80 Oracle Database 10g: Managing Oracle on Linux for DBAs B . enter the following command.64 .13 %nice %system 3.6.com) 12/12/2006 09:35:09 AM 09:35:14 AM CPU all %user 1.20 %idle 78. and vmstat (continued) vmstat memory free vmstat swap si iostat -p hda5 tps iostat -p hda5 Blk_read/s iostat -p hda5 Blk_wrtn/s 1) Use the sar command to measure system stats including: Run queue size Load average Percent CPU utilization for user processes Percent CPU utilization for system (kernel) processes Percent CPU is idle Take three measurements at an interval of five seconds.10 %iowait 0.60 c A de a y m plist-sz ldavg-1 ldavg-5 214 0.1.40 %idle 82.13 %nice %system 3.00 2. The numeric arguments to sar indicate the time interval and the number of samples. Record the results in the Quiet column of the previous table.00 %iowait 0.41 09:35:09 AM runq-sz 09:35:14 AM 0 09:35:14 AM 09:35:19 AM CPU all ra O le c le ac r O ly l & On na se er U nt I %user 11. So.0.9-42.04 %idle 93. depending on the type of machine you are using.us. sar.0.80 %nice %system 3. Answer: 1.79 1.0. respectively.78 CPU all %user 15.18 0.EL (edt3r12p1.59 09:35:14 AM runq-sz 09:35:19 AM 3 09:35:19 AM 09:35:24 AM plist-sz ldavg-1 ldavg-5 215 0.59 2. as the root user.oracle.00 ldavg-15 0. you use 5 and 3 for that. and the –q option reports on the run queue size.

00 0.00 0.00 0.00 0.00 0.13 %user 9.00 0.00 0.00 0.00 0.00 0.09 %idle 84.00 0.00 0.00 0.EL (edt3r12p1.00 0.00 0.00 0.00 0.20 0.00 0.6.00 0.00 0.00 0.00 rd_sec/s 0.00 0.00 0.00 0. Enter the following command at the OS prompt: $ sar -d 5 3 Linux 2.00 0.00 0. Answer: 1.00 0. and vmstat (continued) 09:35:19 AM runq-sz 09:35:24 AM 0 Average: Average: CPU all plist-sz ldavg-1 ldavg-5 215 0.00 0.00 0.00 wr_sec/s 0.0.00 0.13 ldavg-15 0.com) 12/12/2006 10:07:07 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 10:07:12 .oracle.00 0.00 0.00 0.Solutions for Practice 9-1: Gather Statistics Using iostat.00 0.00 0.00 0.0.00 0.00 0.9-42.00 0.00 0.00 0.00 0.00 0.00 0.00 ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .00 0. Record the results in the Quiet column of the previous table. AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM AM DEV dev1-0 dev1-1 dev1-2 dev1-3 dev1-4 dev1-5 dev1-6 dev1-7 dev1-8 dev1-9 dev1-10 dev1-11 dev1-12 dev1-13 dev1-14 dev1-15 dev3-0 dev22-0 dev2-0 dev9-0 dev7-0 dev7-1 dev7-2 dev7-3 dev7-4 dev7-5 dev7-6 dev7-7 tps 0.00 0.00 0.00 0.00 0.1. Use the same repeat interval and count as above.07 ldavg-15 0.00 0.00 0.13 [oracle@edt3r12p1 postpilot]$ 2) Use the sar command to report on device statistics.00 0.0.65 .00 0.00 0.80 0.00 0.00 0. sar.72 %nice %system 3.00 0.00 0.00 0.00 0.00 0.00 0.18 0.00 0.00 1.09 %iowait 0.00 0.46 2.00 0.00 0.00 0.00 0.00 67.us.00 0.17 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.62 Average: runq-sz plist-sz ldavg-1 ldavg-5 Average: 1 215 0.

using the same interval as above. 3) Use the vmstat command to measure virtual memory statistics.0.10 0.oracle.46 %nice 3.67 68.-----io---.57 tps 5. le c Device: hda hda5 hda4 hda3 hda2 hda1 .sql script to put a load on the system.09 0.66 .us. Answer: 1.31 c A de a y m %idle 89.08 0.---swap-.63 0. record the amount of free virtual memory and the amount of virtual memory swapped in (si).0. sar.00 0.Solutions for Practice 9-1: Gather Statistics Using iostat. Answer: 1.00 1697 23 0.11 0. .6. Enter the following at the OS prompt: $ iostat -p /dev/hda 5 3 Linux 2. Record the results in the Quiet column of the table above.25 2211 4294 Oracle Database 10g: Managing Oracle on Linux for DBAs B .9-42. and vmstat (continued) .----cpu---r b swpd free buff cache si so bi bo in cs us sy id wa 3 0 1780 18184 40352 587688 0 0 56 54 1110 694 8 2 90 1 0 0 1780 16816 40356 587712 0 0 2 58 1103 947 8 2 90 0 0 0 1780 16716 40356 587712 0 0 0 29 1106 912 5 1 94 0 $ 4) Use the iostat command to report I/O statistics for the root partition.1.22 1915 3784 0.19 11.42 %sys %iowait 1. In the Quiet column of the table above.13 0. .0. Enter the following command: $ vmstat 5 3 procs -----------memory---------.EL (edt3r12p1.-system-.61 0. le ac r O ly l & On na se er U nt I %user 4.93 Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn 75.com) 12/12/2006 avg-cpu: ra O 5) Run the $ORACLE_HOME/rdbms/admin/catproc.00 0.29 1279844 1170544 0. .00 4 0 0.07 68.76 1286721 1178645 74.

Enter the following to generate the load. Note: In order to determine the if parameter for the dd command.67 .sh.sql script is still running.sql script run. ra O 9) Review the results recorded in the chart.8G 56% /mnt/cdrive Oracle Database 10g: Managing Oracle on Linux for DBAs B .sql 6) While the catproc.0M 18M 19% /boot 0 506M 0% /dev/shm 6. enter the following at the command prompt: $ cd $ORACLE_HOME/rdbms/admin $ sqlplus / as sysdba SQL> @catproc. Record the results in the Database activity column of the chart given previously. Note the differences when the catproc.Solutions for Practice 9-1: Gather Statistics Using iostat.8G 58% / 4. you can simply use the script that runs the commands you ran before.1G 4. while in the ~oracle/labs directory: $ . le c le ac r O ly l & On na se er U nt I Size 25G 23M 506M 11G c A de a y m Used Avail Use% Mounted on 14G 9. The script is monitor.sh 2. As the oracle user./monitor. Enter the following in a command window. Provide the correct if parameter value based on the output of the above command. Answer: 1. Do not interrupt the catproc.sql script is running. Answer: 1. and when the dd command executed. Then run the monitor. but this time. take measurements on your system again (as earlier). use the df command to find out the device name of the root partition. and vmstat (continued) Answer: 1. run the following dd command to generate I/O activity.sh script again and record the results in the I/O Activity column of the chart mentioned earlier. # dd if=/dev/hda5 of=/dev/null conv=ebcdic bs=1024000 8) Stop the dd command by pressing [Ctrl] + [C]. It should complete in order for the database objects to end up in a consistent state. sar.sql script ran. Enter the following to determine the filesystem of the root partition: # df -h Filesystem /dev/hda5 /dev/hda2 none /dev/hda1 # dd if=<root partition> of=/dev/null conv=ebcdic bs=1024000 2. 7) While the catproc.

Solutions for Practice 9-2: Using Graphical Monitoring Tools This practice enables you to install and use xosview to monitor CPU. Answer: 1. ########################################### [100%] 1:xosview ########################################### [100%] # 3) Run xosview by entering the xosview command. Answer: 1. Answer: 1. memory.2-1. as root. at the command line: # xosview 2.i386.2-1. 1) Attempt to run xosview.8.rpm file. Enter the following. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .2-1. As the root user. showing various statistics. using the xosview-1. and disk I/O. as root...68 . Enter the following at the OS prompt: # xosview -bash: xosview: command not found # 2) Install xosview as root. Note the graphic that appears.8. enter the following at the OS prompt: # cd /home/oracle/labs # rpm -ivh xosview-1. This will fail because xosview is not installed by default. key ID 4f2a6fd2 Preparing.i386.rpm warning: xosview-1.rpm: V3 DSA signature: NOKEY.8.i386.

Although GUI tools do not provide any information that could not have been obtained through viewing the /proc virtual file system.Solutions for Practice 9-2: Using Graphical Monitoring Tools (continued) Remember that xosview is just one of many GUI performance monitoring tools for the Linux operating system. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . they can make monitoring your system much easier.69 .

70 .Practice Solutions for Lesson 10: Tuning Performance ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .

Note: If it is already greater than 400 MB. Enter 400 for the Total SGA size.71 . If it is already at least 400 MB. 9. and then click Yes to proceed with the restart. Enter oracle and oracle for the Host Username and Password. Connect as SYSDBA. oracle. In this practice. and click Apply. 6. respectively. If the value for Maximum SGA Size is less than 400 MB. 1) Adjust the SGA size to at least 400 MB. Start the browser by clicking the Web browser icon at the top of the screen. 5. 7. 2. to verify that it is now 400 MB. Click Memory Parameters on the Administration tabbed page. Log in to Enterprise Manager as the SYS user with the password. Navigate to the following URL: http://<machine name>:1158/em 3. 4. Click Refresh after a minute until the database is restarted. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .Solutions for Practice 10-1: Adjusting the SGA Size Often increasing the size of the Shared Global Area (SGA) improves performance by allowing more data to be resident in memory rather than having to be read from disk frequently. Click Yes to confirm that the database is to be restarted. Answer: 1. Click OK. and then click Apply. enter 400 for it. 8. you can skip this step and the remainder of this practice (10-1). Then log in as SYS again. do not change anything. you will increase the size of the SGA. and check the maximum SGA size setting.

and then click Apply. Click OK. Note: You can optionally run this statement in SQL*Plus: CREATE SMALLFILE TABLESPACE "TS2" DATAFILE'+DF' SIZE 128M LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO BLOCKSIZE 2048 4) Create the TS16 tablespace in ASM. 6. 5.Solutions for Practice 10-2: Adjusting Block Sizes You can select different block sizes for each tablespace. Set the File Size to 128 MB. Set the Block Size to 2048. 3) Create the TS2 tablespace in ASM. click All Initialization Parameters on the Administration tabbed page. 2) Set the cache size to 128 MB for the 16 KB block size. 4. 3. Note: You can optionally run this statement in SQL*Plus: le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . except naming it TS16. enter 2k in the Name field. and is 128 MB in size. On the Initialization Parameters page. Click Tablespaces on the Administration tabbed page. Answer: ra O 1. Perform the same steps as you did for the TS2 tablespace. Answer: 1. On the Tablespaces page. click Create. Answer: 1.72 . For the db_2k_cache_size variable. and is 128 MB in size. and that can affect performance. enter 128M for the value. which has a 2 KB block size. 3. and setting the block size to 16384. and then click Add in the Datafiles section. Perform the same steps as for the 2k setting. In Enterprise Manager (EM). and then click Continue. which has a 16 KB block size. and click Go. depending on the type of activity on the tablespace. This practice illustrates the difference in performance different block sizes can have. is NOLOGGING. except making the change to the db_16k_cache_size variable. 2. Enter TS2 for the Name. 7. Click the Storage tab. is NOLOGGING. 1) Set the cache size to 128 MB for tablespaces with 2 KB block size. Answer: 1. 2.

In the Results list.73 . Then click Go. Enter the following at the OS prompt. Enter the following: $ sqlplus hr/hr SQL> set timing on SQL> select count (*) from t2 where last_name like '%a%'. click the SID value for the returned HR session. 4. Answer: 1.36 SQL> 7) Turn on SQL tracing for this HR session. Click OK to confirm it. Click Enable SQL Trace at the top of the Session Details page. ra O 5.sql script to create and populate the T2 and T16 tables. putting in a comment to force a reparse of each statement. le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . Change the search criteria filter to DB User. which are created in the TS2 and TS16 tablespaces.sql 6) Using SQL*Plus. and repeatedly select count(*) from each of these tables using a WHERE clause that forces each row to be read. respectively.59 SQL> select count (*) from t16 where last_name like '%a%'. Which is faster? Answer: 1. click Search Sessions on the Performance tabbed page. 3. Answer: 1.Solutions for Practice 10-2: Adjusting Block Sizes (continued) CREATE SMALLFILE TABLESPACE "TS16" DATAFILE'+DF' SIZE 128M LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO BLOCKSIZE 16384 5) Run the lab_10_02_05. turn on timing. In EM. 8) Rerun each of the two statements once. as the oracle user: $ sqlplus /nolog @lab_10_02_05. 2. COUNT(*) ---------668976 Elapsed: 00:00:00. COUNT(*) ---------668976 Elapsed: 00:00:00. and enter HR for the value. Compare the times between each of the tables.

Run each of the statements only once. In EM. 2. Edit and rerun each of the statements to look similar to the following. Click the SQL ID that corresponds to one of the statements you just ran. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .Solutions for Practice 10-2: Adjusting Block Sizes (continued) Answer: 1. It is important to put a comment in to make the statement get reparsed. Answer: 1. and note the time-related statistics. SQL> select /* 1 */ count (*) from t2 where last_name like '%a%'.74 . On the SQL Details page.36 9) Use EM to view the statistics for each of these two statement executions. click the Activity tab. click the Statistics tab. in the section labeled Detail for Selected 5 Minute Interval. COUNT(*) ---------668976 Elapsed: 00:00:00. COUNT(*) ---------668976 Elapsed: 00:00:00. on the Session Details page. 3.59 SQL> select /* 1 */ count (*) from t16 where last_name like '%a%'.

Scroll down to see the data statistics for this statement execution. 6. Click Previous SQL to see the other SQL statement.75 . ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .Solutions for Practice 10-2: Adjusting Block Sizes (continued) 4. 7. 5. Click the General tab on the Session Details page. Navigate to the session details page for the HR session.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .76 .Solutions for Practice 10-2: Adjusting Block Sizes (continued) Note that the query against the T16 table takes up less CPU time. and performs far fewer Buffer Gets.

according to Enterprise Manager. load average: 4. and kill it. 2 zombie Cpu(s): 70. and note the highest resource-consuming process that is an oracle process. .0 0.33 oracle 8:01.7% ni. 8:52. you will identify a resource-consuming operating system process.16:21:02 up 18 days.68.4% us. 1. Enter the following at the OS prompt to run the top command.4% wa. le c le ac r O ly l & On na se er U nt I PR NI 17 0 0 -20 VIRT 497m 0 RES 79m 0 SHR S %CPU %MEM 75m S 50. 6392k free. 315516k used.3% sy. 2. In this practice. 1732760k free. Find the session associated with that process. $ top top .6 7. 5 users. 9. 15. 2.77 . 4. determine which database session it belongs to. 0 stopped. Click Kill Session. . 656712k cached PID USER 3593 oracle 3377 root . and take action to correct it. 1) Run the lab_10_03_01.2Tasks: 167 total. 1588k buffers Swap: 2048276k total. 1 running. Click the General tab to verify that the OS Process ID for the Server process (to the left of the page) matches that reported in the top output. ra O 6. In the Top Sessions region. 5. 0. 1028928k used. Click Top Activity in the Additional Monitoring Links region. 0.Solutions for Practice 10-3: Identifying Sessions in Linux At times you need to correlate database sessions to specific processes running at the operating system level.50.2% hi. Note: The numbers you see will probably differ from those shown here. 164 sleeping.0 c A de a y m TIME+ COMMAND 1:06. Watch it for several seconds to clearly identify the oracle process that is consistently appearing at the top of the list. 0.0% Mem: 1035320k total. Answer: 1.79 loop1 Oracle Database 10g: Managing Oracle on Linux for DBAs B . select “Kill immediate. navigate to the Performance tabbed page. click the session ID for the most active HR session listed.sh script to generate some HR sessions that do some work in the database.9 0 D 7.0% id.” and then click Yes to go through with the kill operation. Note that the session is now expired. 3. In Enterprise Manager. 4. 7. 2) Run the top command to see the oracle session that is consuming many system resources.

Solutions for Practice 10-3: Identifying Sessions in Linux (continued) 8. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .78 . View the top output again. and ensure that the process in question is no longer there.

Practice Solutions for Lesson 11: Diagnosing Oracle on Linux ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .79 .

/topaix. Enter the following at the OS prompt. Answer: 1./stopOSW. as the oracle user: $ mkdir -p /home/oracle/osw $ cd /home/oracle/osw $ tar xvf /home/oracle/labs/OSW.sh $ 2) Use startOSW. Answer: 1. You will now install and configure OS Watcher.sh .sh 60 10 oracle 6454 6431 0 13:11 pts/4 /usr/bin/ksh ./OSWatcher. 1) Install OS Watcher./oswsub./startOSW.tar .80 ./OSWatcherFM./OSWatcherFM.sh 60 10 & 3) Verify that the script is running by checking the Linux process listing./startOSW.net . Enter the following at the OS prompt: $ nohup ./OSWatcher./oswnet.sh 10 oracle 6621 4953 0 13:12 pts/4 osw $ le ac r O ly l & On na se er U nt I c A de a y m 00:00:00 00:00:00 00:00:00 grep -i Oracle Database 10g: Managing Oracle on Linux for DBAs B . into the new directory. located in /home/oracle/labs directory.sh . and the last 10 hours of data is logged to archive files. to list processes and search for OSW: O ra le c $ ps -ef | grep -i osw oracle 6431 1 0 13:10 pts/4 /usr/bin/ksh . reviewing the results from the generated reports./Exampleprivate.tar file.sh .sh ./tarupfiles.sh to start the tool.sh . Answer: 1. Enter the following at the OS prompt./README . Provide parameters such that data is sampled every 10 seconds.jar .sh . and then run it. It is useful for gathering historical data for comparison and for providing OS information about your system to Oracle Support Services.Solutions for Practice 11-1: Install and Configure OS Watcher OS Watcher is a utility that collects statistics about the operating system.sh ./OSWg. Create a directory for OS Watcher named osw under the /home/oracle directory./OSWgREADME ./ . Make the tool run as a background process. Extract the tar OSW.

us.13.oracle.81 . Enter the following to change to that directory and view the collected data: $ cd oswiostat $ ls edt3r12p1.us.com_iostat_12. Answer: 1.dat $ cat edt3r12p1.13.06.06. Note the oswiostat directory.oracle.1300. Answer: 1.sh ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B ./stopOSW.com_iostat_12. Enter the following to change to the archive directory and list the contents: $ cd archive $ ls -l total 36 drwxr-xr-x 2 drwxr-xr-x 2 drwxr-xr-x 2 drwxr-xr-x 2 drwxr-xr-x 2 drwxr-xr-x 2 drwxr-xr-x 2 drwxr-xr-x 2 drwxr-xr-x 2 $ oracle oracle oracle oracle oracle oracle oracle oracle oracle oinstall oinstall oinstall oinstall oinstall oinstall oinstall oinstall oinstall 4096 4096 4096 4096 4096 4096 4096 4096 4096 Dec Dec Dec Dec Dec Dec Dec Dec Dec 13 13 13 13 13 13 13 13 13 13:11 13:11 13:11 13:11 13:10 13:11 13:11 13:11 13:11 oswiostat oswmeminfo oswmpstat oswnetstat oswprvtnet oswps oswslabinfo oswtop oswvmstat 2.dat 5) View the OSW generated output for other types of data you see in the archive directory.Solutions for Practice 11-1: Install and Configure OS Watcher (continued) 4) View the iostat report that has been created by OSW so far. Enter the following at the OS prompt: $ cd /home/oracle/osw $ . The output is being written to the archive directory where OSW has been installed. 6) Stop OSW.1300.

1 oracle README_VMS. and select Y at the SYSDBA prompt to avoid being prompted for the database password at run time. installs RDA: $ cd /home/oracle $ tar xzf /home/oracle/labs/rda_4.txt $ oinstall 4087 Jul 6 04:58 13 13 13 25 8 25 4 13:33 13:33 13:33 2006 11:03 2006 09:41 hcve modules RDA rda.sh oinstall 4096 Dec oinstall 4096 Dec oinstall 4096 Dec oinstall 3415 Apr oinstall 40066 Sep oinstall 3442 Apr oinstall 13103 Aug oinstall 14539 Aug oinstall 13101 Aug 4 09:41 4 09:41 2) Configure RDA by running the rda. 1) Install RDA.pl rda.1 oracle README_Windows.tar. enter a “/” here.txt drwxr-xr-x 2 oracle drwxr-xr-x 2 oracle drwxr-xr-x 4 oracle -r-xr-xr-x 1 oracle -r-xr-xr-x 1 oracle -r-xr-xr-x 1 oracle -r--r--r-. Press [Enter] to accept the default (system):/ Is “/” a sysdba user (will connect as sysdba) (Y/N)? Press [Enter] to accept the default (N): y ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B . and database that can be useful for diagnosing problems.5-060912.ORA for the database to be analyzed located on this machine? (Y/N) Press [Enter] to accept the default (Y): n Enter an Oracle User ID (user ID only) to view DBA_ and V$ tables.txt -r--r--r-. The file containing the software is /home/oracle/labs/rda_4.txt -r--r--r-. except for the following questions: Is INIT.gz 2. For each question. and view the output. Note the new rda directory created under the current directory: $ ls -l rda total 112 -r--r--r-. press [Enter] to accept the default.pl script in the rda directory.gz.cmd rda. operating system. run it.82 . If RDA is run under the Oracle software owner’s ID. In this practice.1 oracle DISCLAIM.Solutions for Practice 11-2: Install and Configure RDA The Remote Diagnostic Agent (RDA) collects information about your machine.5-060912. Answer: 1. Enter the following at the OS prompt to extract the tar file. in effect. Extract it into the /oracle/home directory. which.tar. you will install it.1 oracle README_Unix.

ORA located on this machine (Y/N)? Press [Enter] to accept the default (Y): n Is the Database Control for 10G in use on this node (Y/N)? Press [Enter] to accept the default (N): y 3) After the last question is answered. View the main page: 4) Under Overview > System Information what are the values for Total Physical Memory and Swap: In Use? ________________________ ra O 5) Under Operating System Setup > Disk Drives.Solutions for Practice 11-2: Install and Configure RDA (continued) Is ASM (Automatic Storage Management) in use (Y/N)? Press [Enter] to accept the default (N): y Is the ASM INIT. Open this file in the browser. This takes several minutes. In the browser. start a new tab by pressing [Ctrl] + [t].htm 2. Answer: 1.83 . which drive partition contains swap? ________________________ le c le ac r O ly l & On na se er U nt I c A de a y m __________________________ Oracle Database 10g: Managing Oracle on Linux for DBAs B . the RDA runs. note the URL for the HTML file to open and to view the results. and then open the indicated HTML file by entering the following URL: file:///home/oracle/rda/output/RDA__start. After it is finished.

what is the fully qualified location of the SYSTEM tablespace? ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs B .84 .Solutions for Practice 11-2: Install and Configure RDA (continued) 6) Under ASM > File/Space Related Information > Files Stored in Diskgroup.

1) View the contents of the helloworld.. Answer: 1. MAP_PRIVATE|MAP_ANONYMOUS.Solutions for Practice 11-3: Using strace In this practice.85 le ac r O ly l & On na se er U nt I c A de a y m .oracle.sh". Enter the following at the OS prompt. -1./helloworld. . []. [".. R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.}) = 0 brk(0) = 0x867f000 access("/etc/ld. read(255.. . First you look at the output of a simple shell script.com". Enter the following at the OS prompt: ra O le c $ strace ./helloworld. 39) = 39 rt_sigprocmask(SIG_BLOCK. Answer: 1.sh script using strace. as the oracle user: $ cd $ cd labs $ cat helloworld./helloworld.. . st_rdev=makedev(136. review the output.sh execve(". Answer: 1. "#!/bin/bash \necho \"Hello World!\"". .sh #!/bin/bash echo "Hello World!" exit 2) Execute the helloworld. After tracing the script. 4)./helloworld.us. O_RDONLY) = 3 .sh"]..}) = 0 mmap2(NULL. [/* 32 vars */]) = 0 uname({sys="Linux".so. NULL. you will look at the output of the strace command. Enter the following at the OS prompt: $ .so. Then you use strace on a running process and send the output to a file.sh test script.sh script.sh Hello World! $ 3) Execute the helloworld.preload". 0) = 0xb7d49000 Oracle Database 10g: Managing Oracle on Linux for DBAs B . PROT_READ|PROT_WRITE...sh $ strace . node="edt3r12p1./helloworld. {st_mode=S_IFCHR|0620. 8) = 0 fstat64(1.cache". 4096.

Solutions for Practice 11-3: Using strace (continued)
write(1, "Hello World!\n", 13Hello World! ) = 13 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 exit_group(0) = ? Process 14548 detached $

4) Trace the PMON process execution using strace. Send the output of the trace to the /tmp/orcl_pmon.out file. Run the lab_11_03_04_a.sh script to find the process ID of PMON. Answer: 1. Enter the following at the OS prompt. Note that your PID is different from that shown.
$ ./lab_11_03_04_a.sh 2841 $

2. Use the PID to run strace, by entering the following, substituting the appropriate PID for your PMON process:

$ strace -p 2841 -o /tmp/orcl_pmon.out & [1] 14960 [oracle@edt3r12p1 labs]$ Process 2841 attached - interrupt to quit

5) View the output file by using the tail command. Do not cancel this tail command. It is used in the next practice. Answer: 1. Enter the following command at the OS prompt:

ra O

le c

$ tail -f /tmp/orcl_pmon.out . . . read(19, "8655 (oracle) S 1 8655 8655 0 -1"..., 999) = 197 close(19) = 0 kill(8659, SIG_0) = 0 open("/proc/8659/stat", O_RDONLY) = 19 read(19, "8659 (oracle) S 1 8659 8659 0 -1"..., 999) = 187 close(19) = 0 times(NULL) = 439078492 times(NULL) = 439078492 times(NULL) = 439078492 gettimeofday({1160845334, 130251}, NULL) = 0 gettimeofday({1160845334, 130315}, NULL) = 0 poll(

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs B - 86

Solutions for Practice 11-4: Diagnosing ORA-600 and ORA-7445 Errors
In this practice, you investigate ORA-600 and ORA-7445 errors, which frequently require diagnosis at the operating system level. 1) Force an ORA-600 error. Use the lab_11_04_01.sh script to generate the error. Answer: 1. Enter the following at the OS prompt:
$ ./lab_11_04_01.sh SQL*Plus: Release 10.2.0.1.0 - Production on Wed Dec 13 16:01:47 2006 Copyright (c) 1982, 2005, Oracle. SQL> Connected. SQL> Table created. SQL> Session altered. SQL> 1 row created. All rights reserved.

SQL> ERROR: ORA-00603: ORACLE server session terminated by fatal error

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options (with complications) $

2) Force an ORA-7445 error. Do this by issuing a kill –11 command for the PID of the PMON process. Answer: 1. Enter the following at the OS prompt, filling in the appropriate PID for your system. You can run the lab_11_03_04_a.sh script again to find it out, if needed. 3) In Practice 11-3, you started a strace of the PMON process, with the output being sent to a file, which is being viewed using the tail command. Look at the terminal window that contains the tail of the strace. All of the strace was written to the

ra O

le c

$ kill –11 2841

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs B - 87

Solutions for Practice 11-4: Diagnosing ORA-600 and ORA-7445 Errors (continued) output file, but it takes longer to scroll to the screen. In the window with the tail of the strace output, press [Ctrl] + [C] to stop the tail output. 4) Now that both an ORA-600 and ORA-7445 have been generated, look at the alert log file for the instance. Answer: 1. Enter the following at the OS command prompt:
$ cd $ORACLE_BASE/admin/orcl/bdump $ tail -15 alert_orcl.log Errors in file /u01/app/oracle/admin/orcl/udump/orcl_ora_16084.trc: ORA-00603: ORACLE server session terminated by fatal error ORA-00600: internal error code, arguments: [kcoapl_blkchk], [4], [515], [2], [], [], [], [] Wed Dec 13 16:01:58 2006 Corrupt Block Found TSN = 4, TSNAME = USERS RFN = 4, BLK = 515, RDBA = 16777731 OBJN = 53303, OBJD = 53303, OBJECT = T, SUBOBJECT = SEGMENT OWNER = HR, SEGMENT TYPE = Table Segment Wed Dec 13 16:41:58 2006 Errors in file /u01/app/oracle/admin/orcl/bdump/orcl_pmon_2841.trc: ORA-07445: exception encountered: core dump [007BD7A2] [SIGSEGV] [unknown code] [0x42EC] [] [] Wed Dec 13 16:42:57 2006 DBW0: terminating instance due to error 472 Instance terminated by DBW0, pid = 2847 [oracle@edt3r12p1 bdump]$

5) Note that each of the entries for the ORA-600 and ORA-7445 errors point to a trace file. 6) By killing the PMON process, you caused the database instance to crash. Restart it. Answer: 1. Enter the following at the OS prompt:
$ sqlplus / as sysdba SQL> startup SQL> exit

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs B - 88

Solutions for Practice 11-4: Diagnosing ORA-600 and ORA-7445 Errors (continued) 7) Run the RDA script to have it collect data about the trace files that were just generated. Answer: 1. Enter the following at the OS prompt:
$ cd /home/oracle/rda $ ./rda.pl -----------------------------------------------------------------------------RDA Data Collection Started 13-Dec-2006 04:56:52 PM -----------------------------------------------------------------------------Processing Initialization module ... Processing CFG module ... Processing Sampling module ... . . .

8) After rda.pl finishes running, open the following URL in a browser:
file:///home/oracle/rda/output/RDA__start.htm

9) Click RDBMS Log/Trace Files. Note the Last Errors section. These are the trace files for both the ORA-600 and ORA-7445 errors. To find the file names of the specific trace files for each error, click Alert.log, and then locate the errors, noting the trace file names.

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

Oracle Database 10g: Managing Oracle on Linux for DBAs B - 89

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

___________________

Appendix C Basic Linux and vi Commands
___________________

ra O

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

vi Commands
The Visual Interpreter/Editor (vi) is the most widely used text editor available for the UNIX environment. Although almost everybody curses its unwieldy command syntax, it is still the only editor almost certain to be included with every version of the UNIX and Linux operating system. The following is a partial list of available vi commands. vi has two modes. Command line (where anything typed is taken as an editing command) and input mode (where everything typed will be treated as part of the file being edited. To enter input mode, type a, A, i, I, o, O, c, C, s, S, r, or R. To return to command-line mode, use the <ESC> key. To access the vi editor from SQL*Plus, enter the following command: SQL> define _editor=vi To edit a file from the SQL*Plus prompt, type edit <filename> and press [Enter]. To edit a file from the Linux command prompt, type vi <filename> and press [Enter]. To MOVE the cursor:
h - move left j - move down k - move up e - end of current word l - move right

w - one word forward b - one word backward

W, B, or E - same as lowercase but ignores punctuation 0 (zero) - Move to the beginning of current line $ - move to the end of current line G - go to last line of file L - go to last line on screen H - go to top line on the screen

M - go to bottom line on the screen

/<string> - search forward to the next occurrence of <string>

?<string> - search backward to the next occurrence of <string> n - repeat previous search

<ctrl> f - scroll forward one page

To UNDO previous changes:

u - undo the most recent change

:e! - re-edit current file without saving any changes made since last change

To ENTER NEW text:

a - append text after the current cursor position.

ra O

A - append text to the end of a line (jumps to end of line and begin appending). c - change object C - change from current cursor position to end of the line

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

N - repeat previous search in opposite direction <ctrl> b - scroll backward one page

U - undo the most recently deleted text

Oracle Database 10g: Managing Oracle on Linux for DBAs C - 2

i - insert text before the current cursor position. I - insert text at the beginning of a line. o - insert a blank line BELOW the current cursor position. O - insert a blank line ABOVE the current cursor position. r - replace character at current cursor position s - substitute text for character under cursor :s/A/B/opt substitutes string B for string A. %s/A/B/opt is global replace options include: g (change all occurences on current line) p (print changed lines) . <period> - repeat last change To leave the input mode, press <ESC> c (confirm prior to each change) S - Substitute entire line to the end n. <integer><period> repeat last change n times R - replace all characters until <ESC> is pressed

To DELETE existing text:
x - delete the character directly under the current cursor location. dd - delete the entire line where the cursor is located. dnd (where n is some integer) delete n lines from current cursor position dw - delete current word D - delete to end of current line

J - delete return at end of current line. Join this line and the next <int> J - join the next <int> lines

COPY, CUT, and PASTE: vi uses a single buffer where the last changed or deleted text is stored. This text may be manipulated with the following commands: Y - yank a copy of the current line y <integer> - yank a copy of next <int> lines yb - yank a copy of the previous word

yw - yank a copy of the current word p - put buffer contents after cursor

Also, see the s and S commands under the input section

To SAVE edited changes to an operating system file:
zz - terminate edit mode.

:wq - write all changes and quit the edit mode

ra O

To QUIT without saving changes:
ZZ - terminate edit mode. :q! - terminate the file without saving changes.

le c

le ac r O ly l & On na se er U nt I

c A

de a

y m

P - put buffer contents before cursor

:w filename - save changes to the filename specified.

Oracle Database 10g: Managing Oracle on Linux for DBAs C - 3

your Linux documentation. Shows all the manual entries that contain this <string>. Views a file a page at a time. consult the man pages. The default directory is the current working directory. -r reverses sort. or other Linux command reference books.Basic Linux Commands This appendix is meant to serve only as a quick reference while you are in class. Makes a directory default into the current working directory. -a shows hidden files. Changes the name of a file or moves it to a different directory. This is a GNU version of more or pg. -t sorts by time. -R recursive. Files and Directories Command manual Linux Commands man <command> Description/Comments Finds the manual entry for this <command>. For more details about these commands. Oracle Database 10g: Managing Oracle on Linux for DBAs C . Prints the named file to the terminal screen. Displays the manual page for man. Shows the information system entry for this command. cd with no parameters changes to $HOME. full path may be specified. Copies a source file to a destination file.4 . Changes the working directory to specified directory. Views a file a page at a time (BSD version) man –k <string> man man info <command> Command information Print to standard out List users Change working directory Copy a file View a file View a file List directory cat <file> cat /etc/password cd <directory> cp <source_file> <destination_file> less <file> more <file> Create a directory Move or rename a file ra O le c le ac r O ly l & On na se er U nt I ls <directory> mkdir <directory> mv <old_file> <new_file> c A de a y m Options –l provides long listing. Using info info shows a tutorial of the info documentation system.

which has features to replace rsh. rsh is not secure. grep <option> <pattern> <file> Searches a <file> or stream for a Search a file for a pattern regular expression defined by <pattern> and show the line that contains that pattern. Remote shell telnet <host> Starts a terminal session on <host>. Prints to stdout the current working directory. Shows all processes on the system with a full listing. use ssh instead. Many options exist. ssh <host> Remote shell Invokes a secure shell. and –f force (including subdirectories) are very dangerous. Normal behavior is for the script to run in a child shell. rsh <host> <command> Remote shell Executes a <command> on <host>. and telnet. rcp. telnet is not secure. Use ssh instead. and returns the IP address of the machine name. Oracle Database 10g: Managing Oracle on Linux for DBAs C .’ forces the script to run in the shell.Process List ps ps -ef Print working directory Remove or erase a file pwd rm <file> Shows the processes report. Options are: –r recursive. <script_file> le c le ac r O ly l & On na se er U nt I c A de a y m netstat –a| grep ESTABLISHED In the bash shell. Often the rm command is aliased with rm –i The option –i asks “Are you sure?” Creates a file. ftp. See the man page for details. Removes a file. Removing a file on Linux is permanent.5 . Returns the name of the machine Create an empty touch <file> file hostname Name of the machine The IP address host <machine_name> of the machine Queries the Domain Name Server. A common option is –i for case insensitive. grep can accept input from a file or stdin through a pipe as in: ra O Source a script . this command ‘.

Most Linux commands write to stdout by default unless redirected. A GPL editor with extensive customizable features available on most UNIX and Linux distributions A full-screen editor.” Sorts a file.An interpreter awk Sort a file sort Command line sed editor Visual editor vi <file> Gnu editor emacs <file> WSIWIG editor gedit <file> WSIWIG kate <file> Terminal output stdout Terminal input stdin (keyboard) ra O Alias le c le ac r O ly l & On na se er U nt I alias <command> <alias> This is a macro language for reformatting or interpreting input. Makes a substitution. Available under KDE. Standard in (stdin). When a user types <command>. a variety of actions can be taken. is not a command but a concept. A full-screen editor. c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs C . Takes input from stdin or a filename argument. Most Linux commands read from stdin by default unless redirected. There are many options to sort by a particular column.6 . For each line of input. and so on. requiring X. is not a command but a concept. <alias> is substituted. Standard out (stdout). Terminal-based editor available on every UNIX system. that is a superset of vi. See the man page. A common alias is alias ‘rm’ ‘rm –i’. requires X. May be referred to as nawk – for “new awk. an improved vi. sed is a command-line editor. Linux provides vim. field. Available under Gnome. with many possible commands and options that are very good for editing from a shell script.

ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs C .bashrc file.Show shell variables set Aliases are often set in the . Prints all the variables that are currently defined in the shell.7 .

Shows the current access control in place. An environment variable has been “exported” so that it will be inherited by child processes. Often used to test the X windows system. all are allowed. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs C .8 .g=rx. If no <Xclient> is given. An X client that shows a clock on the screen.o=rx Clock X access control xclock xhost xhost +<Xclient> Prints all the environment variables. Add an X client that is allowed to access the local DISPLAY. Sets the default permissions for all files created by this shell or its children. The –S option uses the symbolic notation. the numeric notation is obsolete.Show environment variables File Creation mask printenv or env umask –S u=rwx.

mouse. such as sax2. The file that sets the X server settings for your video card. The location of most system log files. even with encrypted passwords this can be a security hole. Any configuration file that you change after installation should be included in the backup. System Administrators often have a cron job to remove everything periodically. Configuration files are located per the application. A small partition to hold the kernel images and boot loader instructions. The /etc/shadow file holds the encrypted passwords and is readable only by root. primary group for a user is defined in the /etc/passwd file. The /etc/groups file defines the groups on a server and the users that are members of the group.System Linux Commands Administration Root file system / Home Directory /home Description/Comments The root directory for the system directory tree Typically the directory in which all user home directories are placed (for example. monitor. Tmp directory /tmp Boot directory /boot Log directory Sample configuration files /var/log /etc/inittab Password files /etc/passwd /etc/shadow Groups file ra O X configuration /etc/X11/XF86Config file le c le ac r O ly l & On na se er U nt I /etc/group c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs C . Do not put anything here you want to keep. Usually set up with a vendorsupplied tool. /home/oracle) A temporary storage area. The /etc/passwd file holds user information and must be readable by others. and keyboard.9 .

Edit the file to specify a script to run at a particular frequency. The –D option alone shows the defaults.4. You start by rebooting the machine.10 .img boot passwd root c A de a y m The second procedure uses the grub boot loader.4. optionally after a set TIME. Oracle Database 10g: Managing Oracle on Linux for DBAs C . then during the LILO boot. Create new user useradd ra O le c le ac r O ly l & On na se er U nt I ro root=/dev/hda8 initrd /initrd-2. –D with other options changes the defaults options. Unmount a file umount <dev> Unmount the file system or device. press and hold [Ctrl] + [X] to get a {grub} prompt and command LILO to c kernel vmlinuz-2.crontab -e Schedule a command to run at a regularly scheduled time /etc/anacrontab Schedule a script to run at a particular frequency at <options> TIME Schedule a command to run at a single specified time batch <options> <TIME> Schedule a command Use this command to edit the crontab file. without –D override. (See man anacrontab for details. umount <mount_point> system Maximum # of 65535 user ID Recover root {lilo} This is a procedure to recover the control-x password root password if it is lost.8.9-13.9-13 single boot Linux to runlevel S. This linux S requires physical access to the passwd root machine and system console. the default (for example. Run a command when the load average drops below . to create the specification for the cron daemon to use. mount <opt> <dev> <mount_point> Mount a file system on device Mount a file system <dev> at <mount_point> with the options specified by <dev>. –g) sets a primary group.) Runs a job specified by <options> at a specified TIME parameter.

c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs C . Files owned by deleted group must be manually changed with chown. This directory holds scripts executed as part of the boot up sequence by rc. Forces the buffer cache and page cache to write all dirty buffers to disk. and limited system errors could overwrite boot information after a time. halt.11 . This log is circular. shut down processes. include the name of the local machine and loopback IP.conf Remove a user and optionally all files belonging to the user. The init command causes the rcN.Delete user Modify user account Create new group Delete group userdel usermod groupadd groupdel Change run levels init <runlevel> Synchronize the sync disks Shutdown the Linux system shutdown <mode> <delay> Error logs Network IP configuration Hosts IP addresses ra O Name service switch le c le ac r O ly l & On na se er U nt I dmesg /etc/sysconfig/networkscripts/ /etc/hosts /etc/nsswitch. Change the /etc/password information. Used just before a reboot to prevent disk corruption. The delay is a required parameter is a number in seconds or ‘now’.sysinit. run all shutdown scripts. and sync disks. at minimum. Remove a group from the system. May not remove a group that is a primary group for a user. A list of hosts that your machine knows about.d scripts to be evaluated. init 6 forces a reboot. The modes are –r. Do a graceful shutdown of the system. View boot messages. Option shutdown warning message may be sent as well. reboot and –h. default is first free value above 500. for the change in run level. It must. –g sets the group ID.

file-max Banner message user sees when issued the login prompt. c A de a y m Shows the value of maximum number of file descriptor per process. Erase package –e. Display information about kernel modules: –l shows license. Finds and attaches to an NIS server for name resolution and other services. i686) Shows kernel version Shows previous and current runlevel Show settings of all settable kernel parameters. All –a. Show all the network devices currently configured. Shows CPU level (for example. Oracle Database 10g: Managing Oracle on Linux for DBAs C .12 . lists all installed packages. Install -i. with progress hash marks –h. Load a loadable module. verbose –v. List all the files that are part of a package. List the package when given the full file name. –p parameters. Compares installed files with the rpm database information. will not uninstall if dependencies exist. Query -q.Network parameters Routing daemon NIC Configurations Secondary IP Address Login prompt sysctl -a | grep net routed ifconfig -a modprobe ip_alias ifconfig eth0:1 IP /etc/issue View all net parameters that are set for the kernel. Unload a loadable module. YP/NIS service /sbin/ypbind binder Module information List modules Load module Unload module Install Software Uninstall software List installed software Verify installed software List all files modinfo <options> <module> lsmod insmod rmmod rpm -ivh package rpm -e package rpm -qa Package owner rpm -qf file Machine model uname -m OS Level Run Level uname -r runlevel ra O Kernel Parameters Max # File Descriptors le c le ac r O ly l & On na se er U nt I rpm -V package rpm -ql package sysctl -a sysctl fs. –d description. Show currently loaded modules.

The default file is /etc/sysctl. c A de a y m Releases the shared memory segment identified by <shmid>.conf. Show the shmmax parameter. Users can make limits more restrictive./etc/sysctl. –a shows all. the –p option reads the setting from a file and sets them. Options: –u sets number of processes.shmmax Change Kernel sysctl –w <parameter>=<value> Parameter Set Process limits ulimit <option> <value> Show process ulimit limits ipcs <option> Interprocess Communication (Shared Memory and Semaphores) ipcrm shm <shmid> Remove a shared memory segment ra O le c le ac r O ly l & On na se er U nt I Compiled in kernel parameters. Set the value of the maximum size of a shared memory segment. Change a kernel parameter. –n number of file handles. Oracle Database 10g: Managing Oracle on Linux for DBAs C . You can corrupt a database that is using the segment that is released. Options: –m the current usage of shared memory. Set limits on a shell and processes started by the shell. generally only root can make limit less restrictive. many others (see man bash).13 . some options require root privilege.conf Kernel parameter settings Change Kernel echo <value> > </proc/<file> Parameter echo 2147483648 >/proc/sys/kernel/shmmax Shared Memory sysctl kernel. This is very dangerous. Without options ulimit show the current limit settings. may be reset at bootup by setting them in this file Write the new value of a kernel parameter into the /proc file system. –s usage of semaphores.

–c CPU activity. dentries. – u CPU utilization. –n DEV network device activity. The interval is in seconds. Options: –d device activity. It may be changed or added to. Return CPU statistics for particular processor or all CPUs in an smp system. Multiple swap devices may be created. Kernel slab allocator statistics: frequently allocated cache objects such as inode. Maximum physical RAM requires enterprise kernel Shows devices currently in use for swap. Virtual Memory vmstat <interval> <count> statistics Virtual Memory cat /proc/meminfo statistics Kernel Cache cat /proc/slabinfo statistics I/O statistics iostat <option> <interval> <count> Multiprocessor mpstat –P <cpu> <count> <interval> Statistics Physical RAM 64 GB(Theoretical) Swap device swapon -s ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs C .System Performance Performance monitor System activity reporter Linux Commands top sar –<options> <interval> <count> Description/Comments View real-time OS and process statistics. many more (see man page). Shows instantaneous virtual memory usage. and asynchronous IO buffers.14 . The swap device is arbitrary designated at install. Interval is in seconds. –d device activity. Interval is in seconds. –x extended disk activity statistics. Options: –q shows CPU queue. swap size should be at least as large as physical memory.

cat /proc/ide/ide0/hda/model Print network statistics xosview Graphical system statistics viewer netstat <options> View IDE disk information. ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs C . use –m for MB units.Display swap free size Activate Swap swapon -a Free disk blocks df -k Device listing Disk information Show the current memory and swap usage. Print a wide variety of network statistics (see man netstat). cat /proc/scsi/scsi0/sda/model View SCSI disk information. An X-based display of recent OS statistics. Measured in KB. cat /proc/devices List devices known to the system by major and minor number.15 . Turn on swap.

Mounts these file systems at bootup {4KB block size} dumpe2fs <device> File System Block size Filesystem table /etc/fstab Journal Filesystem types Disk Label Extend File system Backup Restore Prepare boot volumes Startup script Kernel Kernel Bits ext3 reiserfs fdisk -l resize2fs fdisk is not available on all ra O le c le ac r O ly l & On na se er U nt I resize_reiserfs tar cvf /dev/rst0 / tar xvf /dev/rst0 /sbin/lilo /etc/rc.d/rc /boot/vmlinuz getconf WORD_BIT distributions. others vary kernel) 2 GB {512B block size} File size can not exceed file system 2 TB The Oracle database can create files up to 64 GB with a 16 KB database block size.16 .Misc System Information NFS exported NFS Client mounted directories Max File System Max File Size Linux Commands /etc/exports /var/lib/nfs/xtab Description/Comments Database file is not supported on simple NFS. The 32-bit kernel limits file and block devices to 2 TB. Extending a file system is applicable to only some file system types. Dump the file system properties to stdout. Must be run after changing /etc/lilo.conf to push changes to boot loader. c A de a y m POSIX call to get kernel information. There are many other variables besides WORD_BIT. 2 TB with 4KB block size (on 32 With ext3 and ext2. Restore the root / file system. Create a backup of the root / file system. Oracle Database 10g: Managing Oracle on Linux for DBAs C .

and prepare the executable for use.17 .Boot single user {lilo} control-x linux S {grub} c kernel vmlinuz-2. Time zone Management SW Directory Devices CPU Whole Disk CDROM CDROM file type Floppy drive System information /etc/sysconfig/clock /var/lib/rpm /dev cat /proc/cpuinfo /dev/sda /dev/cdrom iso9660 /dev/fd0 /proc Directory where rpm database is kept. Use a make file <file> to determine which parts of a large program need to be recompiled. Use GRUB Boot Loader. c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs C .9-13. Shows CPU static information. Device name Usually mounted at /mnt/cdrom Compile and link a executable ra O le c le ac r O ly l & On na se er U nt I make –f <file> <command> Usually mounted at /mnt/floppy The /proc file system is a memory-based file system that allows access to process and kernel settings and statistics.4.4. link. This directory holds all the device files.9-13 single ro root=/dev/hda8 initrd /initrd-2.img boot Use LILO facility. and issue the commands required to compile.

Display volume vgdisplay -v group Modify physical pvchange volume Prepare physical pvcreate disk pvdisplay List physical volume vgreduce Remove disk from volume group pvmove Move logical volumes to another physical volumes Create volume vgcreate group Remove volume vgremove group Volume group vgchange availability Restore volume vgcfgrestore group ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs C . logical volume A set of logical extents taken from a volume group and presented to the OS as a disk volume. These extents may be striped across multiple disks. then grouped into a physical volume with vgcreate. LVM LVM Concepts logical extents A logical volume is made up of logical extents. volume group A set of physical disk partitions created by fdisk or the like.Linux (UnitedLinux) LVM Description/Comments Logical Volume Manager This is provided in Enterprise Linux. initialized with pvcreate.18 .

19 .Exports volume group Imports volume group Volume group listing Change logical volume characteristics List logical volume Make logical volume Extend logical volume Reduce logical volume Remove logical volume Create striped volumes vgexport vgimport vgscan lvchange lvdisplay lvcreate lvextend lvreduce lvremove lvcreate -i 3 -I 64 ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs C .

ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

Index ra O le c le ac r O ly l & On na se er U nt I c A de a y m .

6-9. 4-3. 5-5. 6-6. 7-3. 3-12. 11-3. 11-16. 5-7. 5-9. 6-4. 10-9 chkconfig 7-8. 11-15. 5-3. 7-15 Archive 10-6. 8-20. 7-10 ASM Instance 5-3. 5-2. 7-15 ra O D le c le ac r O ly l & On na se er U nt I c A de a y m Data file 3-12. 5-3. 5-8. 11-14 Buffer cache 8-14. 8-13. 7-11. 4-7. 10-3. 7-12 CKPT 6-13. 5-1. 5-8. 8-21. 4-3. 5-4. 6-4. 9-29. 5-13. 10-9. 7-18 B BACKGROUND_DUMP_DEST 11-15. 3-13. 4-6. 10-3 Oracle Database 10g: Managing Oracle on Linux for DBAs Index . 5-5. 11-4. 7-10 CORE_DUMP_DEST 11-16 Corruption 4-7 CPU_COUNT 10-9 cron 7-14. 6-2. 6-13. 10-3. 4-9. 6-4. 6-18. 9-5. 7-16. 9-23. 10-3. 11-7 ASM 1-22. 6-8. 5-10. 7-3. 6-13. 4-12 Configuration assistant 3-24. 6-8. 5-11. 7-11. 6-13. 6-8. 7-19. 4-11 CMAN 3-28 COMPATIBLE 3-6. 9-4 Cluster 4-3. 10-5.2 . 5-13 ASMM 10-12 Audit 6-9 Automatic Shared Memory Management 8-12. 5-12. 3-13. 7-8. 5-9. 5-7. 10-12 C Channel 3-30. 5-4. 10-12 Automatic Storage Management 1-3. 11-17 Block 4-12. 11-17 anacron 7-14. 5-10. 5-9. 5-4. 7-10. 4-6. 5-9. 5-7. 10-4. 10-5.A Alert 2-11. 5-10. 8-17. 4-9. 5-7. 4-6. 11-10 +ASM 1-22. 7-18. 6-19. 5-12. 6-5. 10-16. 11-16. 5-8. 5-11. 11-10 ASMLib 5-2. 4-9. 5-12. 5-3. 5-8. 7-8. 6-9. 5-9. 9-21. 5-13. 8-21.

6-10. 6-16 disk group 5-3. 8-21 DB_BLOCK_SIZE 10-4 DB_CACHE_ADVICE 10-3 DB_CACHE_SIZE 8-12. 6-15. 6-6 ra O H hugemem 1-9. 10-6.D Database Control 2-21. 6-11. 10-3 Enterprise Manager Database Control 2-21. 3-30 EVENT 1-6.3 . 4-6. 9-10. 2-27. 6-6. 10-10 DBA 2-21. 3-20. 3-14. 2-26. 7-11. 7-16. 8-18. 8-21. 2-25. 3-13. 7-10 dbshut 7-10. 7-21 DBWn 8-15 DBWR_IO_SLAVES 10-8. 6-11. 6-5. 7-21 dbstart 7-10. 4-4. 7-13 DBCA 5-8. 10-4. 10-13 ext2 4-10 F Factor 1-22. 10-9 DB_WRITER_PROCESSES 10-8. 2-29. 6-7. 6-3. 6-6 DISPATCHERS 6-15 DML 10-6 E emctl 6-11. 10-10 Dedicated server 2-12. 3-18. 6-17. 7-11. 3-19. 9-8. 4-10. 8-22. 3-19. 3-27. 5-11. 9-11. 3-3. 6-7. 3-20. 7-8. 5-11. 6-11 Environment variable 3-7. 7-3 Enterprise Manager 2-21. 10-7 ext3 4-3. 10-9. 9-7. 9-19. 7-18. 9-29 fdisk 5-6 Flash recovery area 5-8. 8-13. 10-14 le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs Index . 3-4. 6-11 Database writer 10-3 DB_BLOCK_BUFFERS 8-13. 5-5. 2-28.

9-6. 5-2. 8-21. 1-8. 8-21. 8-18. 7-4. 3-18. 1-9. 9-21. 8-18 Lock 7-9. 8-13. 8-12.H hugepages 8-2. 10-2. 8-13. 1-17. 2-6. 7-8. 6-10. 1-5. 9-21. 7-3. 1-10. 8-20. 5-5. 7-11. 7-5. 2-4. 8-23. 8-23. 8-14. 9-13. 9-23. 1-16. 11-5. 2-21. 11-5 le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs Index . 9-29. 1-7. 5-9. 8-18. 8-20. 10-3. 5-8. 10-13. 2-18. 2-10. 6-15. 8-22. 9-22. 10-8. 6-4. 2-7. 3-26. 7-7. 7-19. 4-6. 8-24. 3-30. 8-21. 5-9. 8-12. 4-9. 8-7. 5-12. 10-15 Instance 1-16. 2-7. 7-18. 8-13. 6-13. 10-12. 9-37. 1-29. 7-16. 5-10. 7-3 isqlplusctl 3-24. 7-18. 5-7. 2-3. 7-16. 7-17. 8-2. 10-12 K kernel 1-2. 11-3. 8-7. 9-22. 9-17. 8-15. 11-15 L Large pool 10-10. 7-13. 10-5 Initialization parameters 7-19. 8-20. 9-39. 3-30. 6-9. 9-5. 8-11. 10-10. 10-7 ra O M meminfo 1-16. 8-12. 6-10. 6-15. 7-3 J Java pool 10-12 JAVA_POOL_SIZE 9-29 job 2-30. 2-9. 2-5. 1-22. 6-8. 8-17. 1-6. 5-6. 8-20. 9-27. 9-34. 2-8.4 . 5-13. 5-3. 3-19. 3-16. 9-33. 9-28 LOCK_SGA 9-28 LOG_BUFFER 10-6. 7-8. 8-10. 8-16. 10-12 Listener 3-28. 11-6 IPC 9-28 iSQL*Plus 3-24. 9-16. 10-4 I Index 9-19. 11-10 iostat 9-4. 9-24. 9-24. 9-28. 9-24. 7-11. 8-9. 6-11. 9-28. 6-14. 8-13. 9-30. 7-3. 1-11. 1-28. 2-11. 10-14.

6-9. 4-7. 4-6. 4-3. 3-16. 9-13. 5-9 orcl 1-22. 3-13. 3-28. 5-11. 3-26. 3-18. 9-3. 3-7. 2-28. 6-10. 10-12. 2-26. 3-19. 3-18. 3-30. 3-19. 6-8. 3-20. 7-17. 9-27. 8-12 opatch 3-26. 7-19. 9-34 MMAN 6-13 MTTR 7-17 N NLS 3-19 nobody 2-30 O ocfs2 4-3. 6-12 P ra O Package 1-6. 8-10. 11-13. 6-9 ORACLE_HOME 3-9. 11-16 OUI 2-22. 9-31. 7-10. 3-17. 3-27. 5-9. 3-15. 3-16. 3-4. 4-10. 2-32. 9-21. 5-8.5 . 7-17. 2-27. 7-10. 8-22. 9-7 partition 3-13. 3-19. 3-13. 3-11. 6-12. 7-11 oracleasm 1-11. 9-31. 3-22. 11-8 le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs Index . 3-12. 11-3. 9-32. 9-29. 2-23. 6-12. 6-9. 10-14. 9-21. 5-7. 5-10. 9-7. 8-19 ORACLE_SID 3-7. 7-19. 3-8. 3-30. 7-10. 4-5. 6-17 Performance 1-3. 6-9. 2-19. 2-29. 8-20. 10-16. 9-12. 5-3. 9-6. 4-9. 6-12. 6-12. 3-18. 10-7. 5-6. 9-4. 3-10. 2-18. 8-7. 3-17. 10-11. 3-13. 9-33. 2-17. 3-5. 3-15. 10-8. 3-15. 11-15. 6-13. 10-6. 3-17. 10-3. 6-15. 3-11. 3-19 OINSTALL 1-15. 8-9. 9-8. 6-7.M Metric 9-10. 1-14. 6-11. 3-23. 3-3. 10-5. 9-15. 5-5. 3-14. 3-26. 8-11. 2-25. 6-10. 8-21. 6-14. 4-6. 5-3. 7-11. 9-37. 10-4. 9-9. 3-24. 2-2. 3-29 Optimizer statistics 9-19 Oracle Net 2-12 ORACLE_BASE 3-14. 9-34 Password 2-25. 4-3. 9-30. 10-13. 3-16. 9-36. 9-6. 3-19. 2-31. 4-4. 6-8. 3-15. 4-11 ofa 3-10. 3-14. 2-29. 3-27. 9-34.

2-18. 3-26. 9-28 Procedure 3-15. 8-15.6 . 6-16. 9-24. 9-13. 9-22. 9-20. 9-18. 6-13. 5-5. 9-7. 9-15. 9-4. 7-16. 7-13. 4-4. 9-29 PGA_AGGREGATE_TARGET 9-29 Pipe 1-18. 11-2. 2-13. 9-26. 11-19. 9-16. 7-6. 7-8. 9-37 runInstaller 3-22 runlevel 2-5. 9-7 PMON 1-22. 10-7 Redo log buffer 10-3 relink 3-28. 9-4. 1-25. 9-12. 9-11. 10-7. 4-7. 6-17. 1-21. 10-9. 9-16. 9-17. 2-6. 7-16. 7-17. 9-9. 11-13 PRE_PAGE_SGA 10-8. 8-17. 9-29. 2-13. 11-20 Profile 3-7 pstree 9-7. 6-13. 10-3. 8-19 PROCESSES 1-14. 2-7. 7-5. 6-14. 9-35. 9-12. 9-37. 10-6. 10-8. 8-17. 7-3. 7-12 S ra O sar 9-4. 8-17 REMOTE_LOGIN_PASSWORDFILE 6-17 Resource Manager 9-19 RMAN 3-28. 9-22. 7-8. 9-5. 9-4 le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs Index . 9-10. 10-3. 2-17. 2-11. 7-18 Redo 2-11. 9-23. 7-7. 2-19. 2-10. 11-3. 9-13. 9-9 R Recovery Manager 7-17. 7-18 rpm 1-6. 3-29. 8-22. 10-14. 9-39 scandisks 5-7. 7-15. 9-25. 9-30. 10-10. 8-24. 2-14. 8-16. 9-14. 1-25. 5-9 Scheduler 2-30. 3-12. 9-19. 8-18. 9-17. 8-8. 2-12.P PGA 8-17. 2-8. 9-11. 8-15. 8-3. 10-6. 7-14. 2-16. 10-11 Privilege 2-25. 6-15. 7-16 Schema 11-10 Segment 1-16. 11-13. 8-4. 2-6. 9-5. 2-9. 3-3. 10-13 Rule 8-18.

9-5. 6-12. 9-14. 7-10. 9-4. 9-22. 9-19. 8-17. 11-5 strace 11-2. 7-11. 10-16 SGA 2-6. 10-6. 10-11 SGA_MAX_SIZE 10-11 SGA_TARGET 8-13 Shared pool 8-17. 8-7. 11-10 SYSOPER 2-25. 8-15. 6-16. 3-17. 6-17. 8-21. 6-9. 6-15. 6-7. 1-28 Trace Files 6-9 TRANSACTIONS 10-4 U ra O umask 3-8 unbreakable 2-21 USE_INDIRECT_DATA_BUFFERS 8-13 USER_DUMP_DEST 11-15. 9-21. 1-10. 9-21. 10-8. 2-7. 9-4 Snapshot 9-24. 1-17. 8-14. 6-17 SYSTEM tablespace 10-3 T Tablespace 3-12. 9-28. 9-29. 11-19. 9-16. 6-7. 6-15. 8-16. 8-19. 7-4. 8-20. 6-16 Statistics 1-16. 8-16. 9-36. 9-4. 7-13. 6-15. 8-15. 9-24.S semaphore 2-9. 6-13. 2-8. 9-27. 11-13. 7-9. 9-31. 11-6 SPFILE 7-19 SQL*Loader 3-28 SQL*Plus 3-17. 2-25. 3-18. 8-18. 7-5. 2-10 Sequence 2-4. 10-3 tainted 1-2. 7-6. 8-13. 10-12 Shared server 6-15 SID 3-7. 7-20 SESSIONS 2-13.7 . 11-20 Streams pool 10-12 SYSDBA 1-24. 7-2. 9-33. 1-11. 8-22. 9-15. 10-10. 7-19 SMON 6-13. 3-19. 9-34. 7-3. 9-12. 11-16 le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs Index . 11-14.

10-7 X xload 9-9 xosview 9-6. 9-13. 11-5. 9-9.8 . 9-32. 9-21. 9-30 ra O le c le ac r O ly l & On na se er U nt I c A de a y m Oracle Database 10g: Managing Oracle on Linux for DBAs Index . 9-5.V V$FILESTAT 9-33 V$PROCESS 6-14 View 1-8. 11-3. 9-12. 9-20. 9-13. 9-20. 9-30. 1-17. 6-14. 2-23. 2-27. 9-9. 9-14. 9-12. 9-26. 9-33 vmstat 9-4. 6-7. 9-15. 3-8. 9-5. 9-35. 11-6 W Wait event 10-6. 9-11. 3-6. 8-6. 2-4. 9-30. 9-6. 9-17. 9-39.

Sign up to vote on this title
UsefulNot useful