Вы находитесь на странице: 1из 382

Oracle Database 11g:

Administration Workshop I

Volume 2 - Student Guide


m y
d e
c a
e A
c l
r a
O ly
l & On
D50102GC10

n a e
Edition 1.0
September 2007

t e r U s
D52684

I n
c l e ®

r a
O
Authors Copyright © 2007, Oracle. All rights reserved.

Priya Vennapusa Disclaimer

James Spiller This document contains proprietary information and is protected by copyright and
Maria Billings 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
Technical Contributors 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
and Reviewers express authorization of Oracle.
Christian Bauwens 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,
Sangram Dash
500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
Andy Fortunak warranted to be error-free.

Gerlinde Frenzen Restricted Rights Notice

Steve Friedberg 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
Joel Goodman applicable:

Magnus Isaksson U.S. GOVERNMENT RIGHTS


The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or
Akira Kinutani disclose these training materials are restricted by the terms of the applicable Oracle
license agreement and/or the applicable U.S. Government contract.
Pete Jones
Trademark Notice
Pierre Labrousse
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other
Gwen Lazenby

y
names may be trademarks of their respective owners.
Hakan Lindfors
Srinivas Putrevu

e m
Andreas Reinhardt
Ira Singer
a d
Jenny Tsai
A c
Editors
Richard Wallis
c l e
Amitha Narayan
r a
Graphic Designer O ly
Rajiv Chandrabhanu
l & On
Publishers
n a e
Nita Brozowski

t
Michael Sebastian Almeida e r U s
I n
c l e
r a
O
Contents

I Introduction
Course Objectives I-2
Suggested Schedule I-3
Oracle Products and Services I-4
Oracle Database 11g: “g” Stands for Grid I-5
Course Examples: HR Sample Schema I-7

1 Exploring the Oracle Database Architecture


Objectives 1-2
Oracle Database 1-3
Connecting to a Server 1-4
Oracle Database Architecture: Overview 1-6
Connecting to the Database 1-7
Interacting with an Oracle Database 1-8
Oracle Database Server Structures 1-10
m y
Oracle Database Memory Structures 1-11
d e
Database Buffer Cache 1-13
Redo Log Buffer 1-14
ca
Shared Pool 1-15

e
Allocation and Reuse of Memory in the Shared Pool 1-17 A
Large Pool 1-19
c l
Process Architecture 1-21r a
Java Pool and Streams Pool 1-20

Process Structures 1-22


O ly
l & On
Database Writer Process (DBWn) 1-24
LogWriter Process (LGWR) 1-26

n a e
Checkpoint Process (CKPT) 1-28

t e r U s
System Monitor Process (SMON) 1-29
Process Monitor Process (PMON) 1-30

I n
Recoverer Process 1-31
Archiver Processes (ARCn) 1-32

c l e
Other Processes 1-33

r a Server Process and Database Buffer Cache 1-35


Database Storage Architecture 1-36

O Logical and Physical Database Structures 1-38

iii
Tablespaces and Data Files 1-40
SYSTEM and SYSAUX Tablespaces 1-41
Segments, Extents, and Blocks 1-42
Database Architecture: Summary of Structural Components 1-43
Summary 1-44
Practice 1: Overview 1-45

2 Preparing the Database Environment


Objectives 2-2
Tasks of an Oracle Database Administrator 2-3
Tools for Administering an Oracle Database 2-4
Installation: System Requirements 2-6
Checking the System Requirements 2-7
Optimal Flexible Architecture (OFA) 2-8
Optimal Flexible Architecture: Naming Scheme 2-9
Setting Environment Variables 2-11
Oracle Universal Installer (OUI) 2-13
Installing the Oracle Software 2-14
Database Configuration Options 2-15
Executing Configuration Scripts 2-16
m y
Advanced Installation Options 2-17
Installation Option: Silent Mode 2-18
d e
Summary 2-19
ca
Practice 2 Overview: Preparing the Database Environment 2-20

e A
3 Creating an Oracle Database
c l
Objectives 3-2
Planning the Database 3-3
r a
Databases: Examples 3-4
O ly
Configuring the Listener 3-5

l & On
Database Configuration Assistant (DBCA) 3-8

a e
Using the DBCA to Create a Database 3-9
n
t e r
Password Management 3-15

U s
Creating a Database Design Template 3-16

I n
Using the DBCA to Delete a Database 3-17
Using the DBCA for Additional Tasks 3-19

l e
Summary 3-20

c
Practice 3 Overview: Using the DBCA 3-21

r a
O
iv
4 Managing the Oracle Instance
Objectives 4-2
Management Framework 4-3
Starting and Stopping Database Control 4-4
Oracle Enterprise Manager 4-5
Accessing Oracle Enterprise Manager 4-6
Database Home Page 4-7
Other Oracle Tools 4-8
Using SQL*Plus 4-9
Calling SQL*Plus from a Shell Script 4-10
Calling a SQL Script from SQL*Plus 4-11
Initialization Parameter Files 4-12
Simplified Initialization Parameters 4-14
Initialization Parameters: Examples 4-15
Using SQL*Plus to View Parameters 4-19
Changing Initialization Parameter Values 4-21
Changing Parameter Values: Examples 4-23
Database Startup and Shutdown 4-24
Starting Up an Oracle Database Instance 4-25
Starting Up an Oracle Database Instance: NOMOUNT 4-26
m y
Starting Up an Oracle Database Instance: MOUNT 4-27

d e
Starting Up an Oracle Database Instance: OPEN 4-28
Startup Options: Examples 4-29
ca
Shutting Down an Oracle Database Instance 4-30
Shutdown Modes 4-31
e A
Shutdown Options 4-32
c l
Shutdown Options 4-34
r a
Shutdown Options: Examples 4-33

O ly
Using SQL*Plus to Start Up and Shut Down 4-35

l & On
Blackout Administration 4-36
Viewing the Alert Log 4-38

a e
Viewing the Alert History 4-40
n
t e r
Using Trace Files 4-41

U s
Dynamic Performance Views 4-43

I n
Dynamic Performance Views: Usage Examples 4-44
Dynamic Performance Views: Considerations 4-45

c l e
Data Dictionary: Overview 4-46

r a Data Dictionary Views 4-47


Data Dictionary: Usage Examples 4-49

O Summary 4-50
Practice 4 Overview: Managing the Oracle Instance 4-51

v
5 Configuring the Oracle Network Environment
Objectives 5-2
Oracle Net Services 5-3
Oracle Net Listener 5-4
Establishing Net Connections 5-5
Establishing a Connection 5-6
User Sessions 5-7
Tools for Configuring and Managing the Oracle Network 5-8
Listener Control Utility 5-10
Listener Control Utility Syntax 5-11
Listener Home Page 5-13
Net Services Administration Pages 5-14
Creating a Listener 5-15
Adding Listener Addresses 5-16
Database Service Registration 5-17
Naming Methods 5-19
Easy Connect 5-20
Local Naming 5-21
Directory Naming 5-22
External Naming Method 5-23
m y
Configuring Service Aliases 5-24
Advanced Connection Options 5-25
d e
Testing Oracle Net Connectivity 5-27
c a
User Sessions: Dedicated Server 5-28
User Sessions: Shared Servers 5-29
e A
SGA and PGA 5-30
c l
r a
Shared Server: Connection Pooling 5-31
When Not to Use a Shared Server 5-32

O ly
Configuring Communication Between Databases 5-33

Summary 5-35
l & On
Connecting to Another Database 5-34

a e
Practice 5 Overview: Working with Oracle Network Components 5-36
n
6
t e r U s
Managing Database Storage Structures
Objectives 6-2
I n
Storage Structures 6-3

l e
How Table Data Is Stored 6-4

c
Database Block: Contents 6-5

r aTablespaces and Data Files 6-6

O Space Management in Tablespaces 6-7


Exploring the Storage Structure 6-8

vi
Creating a New Tablespace 6-9
Storage for Locally Managed Tablespaces 6-11
Tablespaces in the Preconfigured Database 6-13
Altering a Tablespace 6-15
Actions with Tablespaces 6-17
Dropping Tablespaces 6-19
Viewing Tablespace Information 6-20
Gathering Storage Information 6-21
Viewing Tablespace Contents 6-22
Oracle Managed Files (OMF) 6-23
Enlarging the Database 6-24
Automatic Storage Management 6-25
ASM: Key Features and Benefits 6-26
ASM: Concepts 6-27
Summary 6-28
Practice 6 Overview: Managing Database Storage Structures 6-29

7 Administering User Security


Objectives 7-2
Database User Accounts 7-3
m y
Predefined Accounts: SYS and SYSTEM 7-5
Creating a User 7-6
d e
Authenticating Users 7-7
c a
Administrator Authentication 7-9

e A
Unlocking a User Account and Resetting the Password 7-10
Privileges 7-11
c l
System Privileges 7-12
Object Privileges 7-14
r a
O ly
Revoking System Privileges with ADMIN OPTION 7-15

l & On
Revoking Object Privileges with GRANT OPTION 7-16
Benefits of Roles 7-17

a e
Assigning Privileges to Roles and Assigning Roles to Users 7-18
n
t e r
Predefined Roles 7-19

U
Creating a Role 7-20 s
I n
Secure Roles 7-21
Assigning Roles to Users 7-22

c l e
Profiles and Users 7-23

r a Implementing Password Security Features 7-25


Creating a Password Profile 7-27

O Supplied Password Verification Function: VERIFY_FUNCTION_11G 7-28

vii
Assigning Quotas to Users 7-29
Summary 7-31
Practice 7 Overview: Administering Users 7-32

8 Managing Schema Objects


Objectives 8-2
What Is a Schema? 8-3
Accessing Schema Objects 8-5
Naming Database Objects 8-6
Specifying Data Types in Tables 8-8
Creating and Modifying Tables 8-11
Understanding Data Integrity 8-13
Defining Constraints 8-15
Constraint Violations 8-16
Constraint States 8-17
Constraint Checking 8-19
Creating Constraints with SQL: Examples 8-21
Viewing the Columns in a Table 8-23
Viewing the Contents of a Table 8-24
Actions with Tables 8-25
m y
Dropping a Table 8-26
Truncating a Table 8-27
d e
Indexes 8-28
ca
Types of Indexes 8-29
B-Tree Index 8-30
e A
Bitmap Indexes 8-32
c l
Index Options 8-34
Creating Indexes 8-36
r a
Views 8-37
O ly
Creating Views 8-38
Sequences 8-39
l & On
Creating a Sequence 8-40
n a e
Using a Sequence 8-42

t e
Temporary Tables 8-43 r U s
Summary 8-45 I n
Temporary Tables: Considerations 8-44

l e
Practice 8 Overview: Administering Schema Objects 8-46

c
9
r aManaging Data and Concurrency

O Objectives 9-2
Manipulating Data by Using SQL 9-3

viii
INSERT Command 9-4
UPDATE Command 9-5
DELETE Command 9-6
MERGE Command 9-7
COMMIT and ROLLBACK Commands 9-9
PL/SQL 9-10
Administering PL/SQL Objects 9-11
PL/SQL Objects 9-12
Functions 9-13
Procedures 9-14
Packages 9-15
Package Specification and Body 9-16
Built-in Packages 9-17
Triggers 9-18
Triggering Events 9-19
Locks 9-20
Locking Mechanism 9-21
Data Concurrency 9-22
DML Locks 9-24
Enqueue Mechanism 9-25
m y
Lock Conflicts 9-26
d e
Possible Causes of Lock Conflicts 9-27
Detecting Lock Conflicts 9-28
c a
Resolving Lock Conflicts 9-29

e
Resolving Lock Conflicts with SQL 9-30 A
Deadlocks 9-31
c l
Summary 9-32
r a
Practice 9 Overview: Managing Data and Concurrency 9-33
O ly
10 Managing Undo Data
Objectives 10-2
l & On
n a e
Data Manipulation 10-3
Undo Data 10-4

t e r U s
Transactions and Undo Data 10-6

I n
Storing Undo Information 10-7
Undo Data Versus Redo Data 10-8

c l e
Managing Undo 10-9

r a Configuring Undo Retention 10-10


Guaranteeing Undo Retention 10-12

O Changing an Undo Tablespace to a Fixed Size 10-13

ix
General Undo Information 10-14
Using the Undo Advisor 10-15
Viewing System Activity 10-16
Summary 10-17
Practice 10 Overview: Managing Undo Segments 10-18

11 Implementing Oracle Database Security


Objectives 11-2
Industry Security Requirements 11-3
Separation of Responsibilities 11-5
Database Security 11-6
Principle of Least Privilege 11-8
Applying the Principle of Least Privilege 11-9
Protect Privileged Accounts 11-11
Monitoring for Compliance 11-12
Standard Database Auditing 11-13
Enabling Auditing 11-14
Uniform Audit Trails 11-15
Specifying Audit Options 11-16
Enterprise Manager Audit Page 11-17
m y
Using and Maintaining Audit Information 11-18
Value-Based Auditing 11-19
d e
Fine-Grained Auditing 11-21
c a
FGA Policy 11-22
Audited DML Statement: Considerations 11-24
e A
FGA Guidelines 11-25
c l
DBA Auditing 11-26

r
Maintaining the Audit Trail 11-27 a
Security Updates 11-28
O ly
Summary 11-30
l & On
Applying Security Patches 11-29

a e
Practice 11 Overview: Implementing Oracle Database Security 11-31
n
t
12 Database Maintenance
e r U s
Objectives 12-2
I n
Database Maintenance 12-3

l e
Terminology 12-4

c
Oracle Optimizer: Overview 12-5

r a
Optimizer Statistics 12-6

O Using the Manage Optimizer Statistics Page 12-7


Gathering Optimizer Statistics Manually 12-8

x
Statistic Levels 12-10
Preferences for Gathering Statistics 12-11
Automatic Workload Repository (AWR) 12-13
AWR Infrastructure 12-14
Baselines 12-15
Enterprise Manager and the AWR 12-16
Managing the AWR 12-17
Automatic Database Diagnostic Monitor (ADDM) 12-18
ADDM Findings 12-19
ADDM Recommendations 12-20
Advisory Framework 12-21
Enterprise Manager and Advisors 12-23
DBMS_ADVISOR Package 12-24
Automated Maintenance Tasks 12-25
Automated Maintenance Tasks Configuration 12-27
Server-Generated Alerts 12-28
Setting Thresholds 12-29
Creating and Testing an Alert 12-30
Alerts Notification 12-31
Reacting to Alerts 12-33
m y
Alert Types and Clearing Alerts 12-34
Summary 12-35
d e
Practice 12 Overview: Proactive Maintenance 12-36
c a
13 Performance Management
e A
Objectives 13-2
c l
Performance Monitoring 13-3

r a
Enterprise Manager Performance Page 13-4
Active Session Page 13-5
O ly
l & On
Performance Page: Throughput 13-6
Performance Monitoring: Top Sessions 13-7

a e
Performance Monitoring: Top Services 13-8
n
t e r U s
Managing Memory Components 13-9
Enabling Automatic Memory Management (AMM) 13-10

I n
Enabling Automatic Shared Memory Management (ASMM) 13-11
Automatic Shared Memory Advisor 13-12

c l e
Setting Shared Memory Components Manually 13-13
Using Memory Advisors 13-14

r a Dynamic Performance Statistics 13-16

O Troubleshooting and Tuning Views 13-18


Invalid and Unusable Objects 13-19

xi
Summary 13-21
Practice 13 Overview: Monitoring and Improving Performance 13-22

14 Backup and Recovery Concepts


Objectives 14-2
Part of Your Job 14-3
Categories of Failure 14-4
Statement Failure 14-5
User Process Failure 14-6
Network Failure 14-7
User Error 14-8
Instance Failure 14-10
Understanding Instance Recovery: Checkpoint (CKPT) Process 14-11
Understanding Instance Recovery: Redo Log Files and LogWriter 14-12
Understanding Instance Recovery: Archiver (ARCn) Process 14-13
Understanding Instance Recovery 14-14
Phases of Instance Recovery 14-15
Tuning Instance Recovery 14-16
Using the MTTR Advisor 14-17
Media Failure 14-18
m y
Configuring for Recoverability 14-19
Configuring the Flash Recovery Area 14-20
d e
Multiplexing Control Files 14-21
c a
Redo Log Files 14-23
Multiplexing the Redo Log 14-24
e A
Archive Log Files 14-25
c l
Enabling ARCHIVELOG Mode 14-28
r a
Archive Log File: Naming and Destinations 14-26

Summary 14-29
O ly
& On
Practice 14 Overview: Configuring for Recoverability 14-30

l
a e
15 Performing Database Backups
n
Objectives 15-2

t e r U s
Backup Solutions: Overview 15-3

I n
Oracle Secure Backup 15-4
User-Managed Backup 15-5

l e
Terminology 15-6

c
Recovery Manager (RMAN) 15-8

r a
Configuring Backup Settings 15-9

O Scheduling Backups: Strategy 15-11


Scheduling Backups: Options 15-12

xii
Scheduling Backups: Settings 15-13
Scheduling Backups: Schedule 15-14
Scheduling Backups: Review 15-15
Backing Up the Control File to a Trace File 15-16
Managing Backups 15-17
Viewing Backup Reports 15-18
Monitoring the Flash Recovery Area 15-19
Using the RMAN Command Line 15-20
Summary 15-21
Practice 15 Overview: Creating Database Backups 15-22

16 Performing Database Recovery


Objectives 16-2
Opening a Database 16-3
Keeping a Database Open 16-5
Data Recovery Advisor 16-6
Loss of a Control File 16-8
Loss of a Redo Log File 16-9
Loss of a Data File in NOARCHIVELOG Mode 16-10
Loss of a Noncritical Data File in ARCHIVELOG Mode 16-11
m y
Loss of a System-Critical Data File in ARCHIVELOG Mode 16-12
d e
Data Recovery Advisor 16-13
Assessing Data Failures 16-14
c a
Data Failures 16-15
Data Failure: Examples 16-16
e A
Listing Data Failures 16-17
c l
Advising on Repair 16-18
Executing Repairs 16-19
r a
O ly
Data Recovery Advisor Views 16-20
Summary 16-21

l & On
Practice 16 Overview: Performing Database Recovery 16-22

n a e
17 Moving Data

t e
Objectives 17-2 r U s
I n
Moving Data: General Architecture 17-3
Directory Objects: Overview 17-4

c l e
Creating Directory Objects 17-5

r a SQL*Loader: Overview 17-6


Loading Data with SQL*Loader 17-8

O SQL*Loader Control File 17-9

xiii
Loading Methods 17-11
External Table Population 17-13
Using External Tables 17-14
External Table Population with ORACLE_DATAPUMP 17-15
External Table Population with ORACLE_LOADER 17-16
Oracle Data Pump: Overview 17-17
Oracle Data Pump: Benefits 17-18
Data Pump Export and Import: Overview 17-20
Data Pump Utility: Interfaces and Modes 17-21
Fine-Grained Object Selection 17-22
Advanced Feature: Sampling 17-23
Export Options: Files 17-24
Data Pump File Locations 17-25
Scheduling and Running a Job 17-27
Data Pump File Naming and Size 17-28
Data Pump Import 17-29
Data Pump Import: Transformations 17-30
Data Pump: Performance Considerations 17-32
Performance Initialization Parameters 17-33
Data Pump Access Path: Considerations 17-34
m y
Using Enterprise Manager to Monitor Data Pump Jobs 17-35
d e
Data Dictionary 17-36
Summary 17-37
ca
Practice 17 Overview: Moving Data 17-38

e A
18 Enhancing Database Capabilities
c l
Objectives 18-2
Using the Support Workbench 18-3
r a
O ly
Viewing Critical Error Alerts in Enterprise Manager 18-4
Viewing Problem Details 18-5

l & On
Viewing Incident Details: Dump Files 18-6

a e
Viewing Incident Details: Checker Findings 18-7
n
t e r U s
Creating a Service Request 18-8
Packaging and Uploading Diagnostic Data to Oracle Support 18-9

I n
Tracking the Service Request and Implementing Repairs 18-10
Closing Incidents and Problems 18-12

l e
Incident Packaging Configuration 18-13

c
Working with Oracle Support 18-14

r a
MetaLink Integration 18-15

O Using MetaLink 18-16


Researching an Issue 18-18

xiv
Logging Service Requests 18-20
Managing Patches 18-22
Applying a Patch Release 18-23
Using the Patch Advisor 18-24
Using the Patch Wizard 18-25
Applying a Patch 18-26
Staging a Patch 18-27
Summary 18-28
Practice 18 Overview: Using EM Tools for Alerts and Patches 18-29

Appendix A: Practices and Solutions


Appendix B: Basic Linux and vi Commands
Appendix C: SQL Statement Syntax
Appendix D: Acronyms and Terms
Appendix E: Next Steps: Continuing Your Education

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
xv
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Performing Database Backups

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Objectives

After completing this lesson, you should be able to:


• Create consistent database backups
• Back up your database without shutting it down
• Create incremental backups
• Automate database backups
• Manage backups and view backup reports
• Monitor the flash recovery area

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 15 - 2
Backup Solutions: Overview

Backups can be performed by using:


• Recovery Manager
• Oracle Secure Backup
• User-managed backup

Target
Data files database Image copies

Backup pieces
Archive
log files
Redundant Backup data
archive log
files Flash recovery area

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Backup Solutions: Overview

e A
method of backing up your Oracle database.
c l
As you will see in the remainder of this lesson, Recovery Manager (RMAN) is the recommended

r a
Oracle Secure Backup complements existing functionality by adding backup to tape and network
backup capabilities.
O ly
User-managed backups are based on scripts that a DBA must write. This option is being phased out

l
because it is more labor intensive.& On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 15 - 3
Oracle Secure Backup

• Oracle Secure Backup and RMAN provide an


end-to-end backup solution for Oracle environments:
– Centralized tape backup management for file system data
and the Oracle database
– Most well-integrated media management layer for RMAN
backups
– Backup of any data anywhere on the network
• A single technical support resource for the entire
backup solution expedites problem resolution.
• This ensures reliable data protection at lower cost and
complexity.

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Oracle Secure Backup

e A
c l
Oracle’s current backup and recovery product for the database is Recovery Manager. Oracle Secure
Backup complements existing functionality in the following ways:

r a
• Complete backup solution: Oracle Secure Backup provides data protection for the database
and nondatabase data to protect the entire Oracle environment.
O ly
• Media management: Oracle Secure Backup provides the media management layer for RMAN

l & On
database backups to tape. Before Oracle Secure Backup, customers had to purchase expensive
third-party media management products offering integration with RMAN tape backups.
a e
• Backup anywhere on the network: Oracle Secure Backup backs up data from multiple
n
t e r s
network-attached computer systems to tertiary storage resources on the network. Oracle Secure
Backup supports diverse configurations of servers, clients, Network Attached Storage (NAS)
U
I n
servers, and tertiary storage devices and protects network storage environments.
The combination of RMAN and Oracle Secure Backup provides an end-to-end backup solution that

l e
is entirely within the Oracle product stack. This solution makes better customer support possible

c
because Oracle Corporation is responsible for the entire backup solution.

r a
O
Oracle Database 11g: Administration Workshop I 15 - 4
User-Managed Backup

A user-managed scenario:
• Is a manual process of tracking backup needs and
status
• Typically uses your own written scripts
• Requires that database files be put in the correct mode
for backup
• Relies on operating system commands to make
backups of files

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
User-Managed Backup

e A
c l
A user-managed backup can be performed interactively. However, most often it entails the writing of
scripts to perform the backup. There are several scenarios that can be run, and scripts must be written
to handle them.
r a
O ly
Some of the actions that scripts must take:
• Querying v$datafile to determine the data files that need to be backed up and their current
state
l & On
• Querying v$logfile to identify the online redo log files

n a e
• Querying v$controlfile to identify the control file to back up

t e r U s
• Placing each tablespace in online backup mode
• Querying v$backup to see what data files are part of a tablespace that has been placed in
online backup mode
I n
• Issuing operating system copy commands to copy the data files to the backup location

l e
• Bringing each tablespace out of online backup mode

c
r a
O
Oracle Database 11g: Administration Workshop I 15 - 5
Terminology

• Backup strategy may include:


– Entire database (whole)
– Portion of the database (partial)
• Backup type may indicate inclusion of:
– All data blocks within your chosen files (full)
– Only information that has changed since a previous
backup (incremental)
— Cumulative (changes up to last level 0)
— Differential (changes up to last incremental)
• Backup mode may be:
– Offline (consistent, cold)
– Online (inconsistent, hot)
Data files
Control
files
Database
Online
redo log
m y
d e
files

Copyright © 2007, Oracle. All rights reserved.

c a
Terminology

e A
control files in a database are identical.)
c l
Whole database backup: Includes all data files and at least one control file (Remember that all

r a
Partial database backup: May include zero or more tablespaces and zero or more data files; may or
may not include a control file
O ly
Full backup: Makes a copy of each data block that contains data and that is within the files being
backed up
l & On
n a e
Incremental backup: Makes a copy of all data blocks that have changed since a previous backup.
The Oracle database supports two levels of incremental backup (0 and 1). A level 1 incremental

e r s
backup can be one of two types: cumulative or differential. A cumulative backup backs up all

t U
changes since the last level 0 backup. A differential backup backs up all changes since the last

I n
incremental backup (which could be either a level 0 or level 1 backup).

l e
Offline backups (also known as “cold” or consistent backup): Are taken while the database is not
open. They are consistent because, at the time of the backup, the system change number (SCN) in
c
r a
data file headers matches the SCN in the control files.
Online backups (also known as “hot” or inconsistent backup): Are taken while the database is open.

OThey are inconsistent because, with the database open, there is no guarantee that the data files are
synchronized with the control files. To be used, inconsistent backups require recovery.

Oracle Database 11g: Administration Workshop I 15 - 6


Terminology

Backups may be stored as:


• Image copies
• Backup sets
Data file #1 Data file #1 Data file #2

Data file #2 Data file #3 Data file #4


Data file #5 Data file #6
Data file #3
Backup set
Data file #4
(Binary, compressed files in
Data file #5 Oracle proprietary format)

Data file #6
Image copies
(Duplicate data and log files in OS format)

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Terminology (continued)

e A
using operating system commands)
c l
Image copies: Are duplicates of data or archived log files (similar to simply copying the files by

r a
Backup sets: Are collections of one or more binary files that contain one or more data files, control

O ly
files, server parameter files, or archived log files. With backup sets, empty data blocks are not stored,
thereby causing backup sets to use less space on the disk or tape. Backup sets can be compressed to
& On
further reduce the space requirements of the backup.
l
tape.
n a e
Image copies must be backed up to the disk. Backup sets can be sent to the disk or directly to the

e r s
The advantage of creating a backup as an image copy is improved granularity of the restore
t U
operation. With an image copy, only the file or files need to be retrieved from the tape. With backup

I n
sets, the entire backup set must be retrieved from the tape before you extract the file or files that are
needed.

c l e
The advantage of creating backups as backup sets is better space usage. In most databases, 20% or

r a
more of the data blocks are empty blocks. Image copies back up every data block, even if the data
block is empty. Backup sets significantly reduce the space required by the backup. In most systems,

Othe advantages of backup sets outweigh the advantages of image copies.

Oracle Database 11g: Administration Workshop I 15 - 7


Recovery Manager (RMAN)

• Powerful control and scripting language


• Integrated with Enterprise Manager
• Published API that enables interface with most popular
backup software
• Backing up data, control, archived log, and server
parameter files
• Backing up files to the disk or tape

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Recovery Manager (RMAN)

e A
c l
RMAN is the component of the Oracle database that is used to perform backup and recovery
operations. It can make consistent and inconsistent backups, perform incremental and full backups,

r a
and back up either the whole database or a portion of it.

O ly
RMAN uses its own powerful job control and scripting language, as well as a published API that
interfaces RMAN with many popular backup software solutions.

l & On
RMAN can store backups on the disk for quick recovery or place them on the tape for long-term

n a e
storage. For RMAN to store backups on the tape, you must either use Oracle Secure Backup or
configure an interface to the tape device known as a Media Management Library (MML).

e r s
Enterprise Manager supplies a graphical interface to the most commonly used RMAN functionality.
t U
Advanced backup and recovery operations are accessible through RMAN’s command-line client. For

I n
more information about advanced RMAN capabilities, see the course titled Oracle Database 11g:

c l e
Administration Workshop II or consult the Oracle Backup and Recovery Advanced User’s Guide.

r a
O
Oracle Database 11g: Administration Workshop I 15 - 8
Configuring Backup Settings

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Configuring Backup Settings

e A
c l
Select Enterprise Manager > Availability > Backup Settings. Here you can manage the persistent
backup settings that are used for creating backups. There are separate settings for the disk and the

r a
tape. Tape settings depend on the media management library capabilities. Disk settings include:
• Parallelism: How many separate streams of backup information do you want to create? The best
O ly
setting for parallelism depends on your hardware. As hardware resources increase, the

l & On
appropriate degree of parallelism also increases. Generally, you want to set your parallelism to
the number of disks that your disk backup location is striped over. For tape backup, you want to
a e
set your parallelism to the same number of tape drives that you have.
n
t e r s
• Disk backup location: Where should backups be stored? The default is the flash recovery area.
If you change this, click Test Disk Backup to verify that RMAN can write to the new location.
U
I n
• Disk backup type: Select Backup Set, Compressed Backup Set, or Image Copy.
Click the Backup Set tab to set the maximum file size of backup pieces and to specify redundancy for

l e
tape backups. Host credentials are required for Enterprise Manager to save changes to the backup
settings.
c
r a
O
Oracle Database 11g: Administration Workshop I 15 - 9
Configuring Backup Settings

Best practice

Backup
pieces
Change
tracking Recovery
Data files file area

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Configuring Backup Settings (continued)

e A
Click the Policy tab to:
c l
• Automatically back up the control file and server parameter file (SPFILE) with each backup.

r a
You can also specify a location for these backups if you do not want them to go to the flash
recovery area.
O ly
• Optimize backups by not backing up files that exactly match a file that is already part of the

l & On
retained backups. This setting enables you to skip read-only and offline data files.
• Enable block change tracking and specify a location for the tracking file. If you intend to create
a e
incremental backups, this setting can decrease the time required to choose which blocks to
n
t e r s
include in the incremental backup.
• Exclude tablespaces from a whole database backup. Some administrators choose not to back up
U
I n
tablespaces containing data or objects that can be easily re-created (such as indexes or data that
is batch-loaded frequently).

c l e
• Specify a retention policy: How long should RMAN keep your backups? If you are using the
flash recovery area to store backups, RMAN automatically deletes old backups to make room

r afor new ones (if the retention policy allows it). By default, only the last backup is retained. The
retention policy can be specified as a number of backups or a number of days.

O
Oracle Database 11g: Administration Workshop I 15 - 10
Scheduling Backups: Strategy

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Scheduling Backups: Strategy

e A
c l
Select Enterprise Manager > Availability > Schedule Backup. Select either the Oracle-Suggested
Backup strategy or your own customized strategy. The Oracle-Suggested Backup strategy makes a

r a
one-time whole-database backup, which is performed online. This is a baseline incremental level 0
backup. The automated backup strategy then schedules incremental level 1 backups for each
successive day. O ly
& On
By clicking Schedule Customized Backup, you gain access to a wider range of configuration options.
l
n a e
Select the objects that you want to back up—the whole database (the default) or individual
tablespaces, data files, archived logs, or any Oracle backups currently residing on the disk (to move
them to the tape).

t e r U s
Both strategies enable you to set up encrypted backups.

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 15 - 11
Scheduling Backups: Options

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Scheduling Backups: Options

e A
c l
Select full or incremental backup type. If you are performing a full database backup, you can select
“Use as the base of an incremental backup strategy” to make the full database backup an incremental

r a
level 0 backup. If you are using image copies, you can select “Refresh the latest datafile copy on disk
to the current time using the incremental backup” to update the existing backup rather than create a
new image copy. O ly
& On
Select Online Backup if you want to perform this task while users are continuing to use the database.
l
n a e
If users do not need access, select “Offline Backup,” which is performed with a mounted instance.
Select “Delete obsolete backups” to remove any backups that fall outside the retention policy that

t e r U s
you configured earlier. RMAN automatically removes obsolete backups if you are backing up to the
flash recovery area. Details about the advanced options and encryption are discussed in the course

I n
titled Oracle Database 11g: Administration Workshop II and in the backup and recovery
documentation.

c l e
r a
O
Oracle Database 11g: Administration Workshop I 15 - 12
Scheduling Backups: Settings

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Scheduling Backups: Settings

e A
c l
Select whether the backup is to go to the disk or to the tape.
To create a one-time backup (in addition to your regularly scheduled backups), click Override

r a
Current Settings and specify your backup settings.

O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 15 - 13
Scheduling Backups: Schedule

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Scheduling Backups: Schedule

e A
recurring process.
c l
Choose how you want the backup to be scheduled—either as a one-time job or as an automated,

r a
To configure a database for maximum recoverability, Oracle suggests regularly scheduled backups.

O ly
Automating backups can simplify the administrator’s workload.
When you select Repeating, the page displays additional scheduling details.

l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 15 - 14
Scheduling Backups: Review

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Scheduling Backups: Review

e A
c l
RMAN uses its own command syntax and scripting language.
Using this page, you can customize the RMAN scripts (if needed) or copy them for recording
purposes.
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 15 - 15
Backing Up the Control File to a Trace File

Control files have an additional backup option.

Control file trace backups may


be used to recover from loss
of all control files.
m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Backing Up the Control File to a Trace File

e A
c l
Select Enterprise Manager > Server > Control Files to manage your database’s control files. Control
files have an additional backup option; they may be backed up to a trace file. A control file trace

r a
backup contains the SQL statement required to re-create the control files in the event that all control
files are lost.
O ly
Although it is very unlikely that a properly configured database (with multiple copies of the control
& On
file placed on separate disks and separate controllers) would lose all control files at the same time, it
l
n a e
is possible. Therefore, the administrator should back up the control file to a trace file after each
change to the physical structure of the database (adding tablespaces or data files, or adding additional
redo log groups).

t e r U s
Trace copies of the control file can be created by using Enterprise Manager (as shown in the slide) or

I n
with the following SQL command:
SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;

l e
The trace backup is created in the location specified by the USER_DUMP_DEST initialization
c
parameter (for example, /u01/app/oracle/diag/rdbms/orcl/orcl/trace with a file

r a
name such as orcl_vktm_8400.trc).

OYou can view information from within the control file on the Advanced tab of the Control Files page.

Oracle Database 11g: Administration Workshop I 15 - 16


Managing Backups

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Managing Backups

e A
c l
Select Enterprise Manager > Availability > Manage Current Backup to manage your existing
backups. On this page, you can see when a backup was completed, where it was created (disk or

r a
tape), and whether it is still available.

O ly
At the top of the Manage Current Backups page, four buttons enable you to work with existing
backups:
& On
• Catalog Additional Files: Although RMAN (working through Enterprise Manager) is the
l
n a e
recommended way to create backups, you might have image copies or backup sets that were
created by some other means or in some other environment with the result that RMAN is not

t e r U s
aware of them. This task identifies those files and adds them to the catalog.
• Crosscheck All: RMAN can automatically delete obsolete backups, but you can also delete

I n
them by using operating system commands. If you delete a backup without using RMAN, the
catalog does not know whether the backup is missing until you perform a cross-check between

l e
the catalog and what is really there.

c
• Delete All Obsolete: This deletes backups older than the retention policy.

r a
• Delete All Expired: This deletes the catalog listing for any backups that are not found when the
cross-check is performed.
O
Oracle Database 11g: Administration Workshop I 15 - 17
Viewing Backup Reports

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Viewing Backup Reports

e A
c l
Information about backup jobs can also be viewed by selecting Enterprise Manager > Availability >
Backup Reports. The content is based on the control file. The backup report contains summary

r a
information as well as detailed information about the input and output of a specific job, including
timing, SCN, sizing, compression, corruption (if any), and so on.
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 15 - 18
Monitoring the Flash Recovery Area

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Monitoring the Flash Recovery Area

e A
c l
If you have configured your archived logs to be written to this location, it is important to monitor this
space to ensure that it does not reach its capacity. If the instance is unable to create an archived log

r a
because of lack of space, it pauses until the administrator corrects the situation.

O ly
Select Enterprise Manager > Availability > Recovery Settings. On this page, you can:
• Verify how much of the flash recovery area has been consumed
& On
• Specify the location of the flash recovery area
l
n
• Configure Flashback Database a e
• Specify the size of the flash recovery area

t e r
• Specify the retention time

U s
The retention time determines when files are obsolete (that is, when they are no longer needed to

I n
meet your data recovery objectives). The Oracle database automatically manages this storage,
deleting files that are no longer needed. When you back up the recovery area, RMAN can fail over to

l e
other archived redo log destinations if the archived redo log in the flash recovery area is inaccessible
c
or corrupted.

r a
Periodically copying backups to tape frees space in the flash recovery area for other files, but

Oretrieving files from tape causes longer database restoration and recovery times.

Oracle Database 11g: Administration Workshop I 15 - 19


Using the RMAN Command Line

1 $ rman target /
2 RMAN> CONFIGURE …
3 RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

Copies of

Control
Control Archived log SPFILE
Data files file
files file

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Using the RMAN Command Line

e A
2. Execute configuration commands:
c l
1. In a terminal session, start RMAN and connect to the target database.

r a
- CONFIGURE DEFAULT DEVICE TYPE TO disk;

O ly
- CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY;
- CONFIGURE CONTROLFILE AUTOBACKUP ON;

l & On
3. A whole database backup is a copy of all data files and the control file. You can optionally
include the server parameter file (SPFILE) and archived redo log files. Using RMAN to make
a e
an image copy of all the database files simply requires mounting or opening the database,
n
t e r s
starting RMAN, and entering the BACKUP command shown in the slide.
Optionally, you can supply the DELETE INPUT option when backing up archive log files.
U
I n
That causes RMAN to remove the archive log files after backing them up. This is useful
especially if you are not using a flash recovery area, which would perform space management

c l e
for you, deleting files when space pressure grows. In that case, the command in the slide would
look like the following:

r a RMAN> BACKUP DATABASE PLUS ARCHIVELOG DELETE INPUT;


You can also create a backup (either a backup set or image copies) of previous image copies of

O all data files and control files in the database by using the following command:
RMAN> BACKUP COPY OF DATABASE;

Oracle Database 11g: Administration Workshop I 15 - 20


Summary

In this lesson, you should have learned how to:


• Create consistent database backups
• Back up your database without shutting it down
• Create incremental backups
• Automate database backups
• Manage backups and view backup reports
• Monitor the flash recovery area

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 15 - 21
Practice 15 Overview:
Creating Database Backups

This practice covers the following topics:


• Backing up your database while the database is open
for user activity
• Scheduling automatic nightly incremental backups for
your database

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 15 - 22
Performing Database Recovery

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Objectives

After completing this lesson, you should be able to:


• Determine the need for performing recovery
• Access different interfaces (such as Enterprise
Manager and command line)
• Describe and use available options, such as Recovery
Manager (RMAN) and the Data Recovery Advisor
• Perform recovery:
– Control file
– Redo log file
– Data file

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 2
Opening a Database

To open a database:
• All control files must be present and synchronized
• All online data files must be present and synchronized
• At least one member of each redo log group must be
present

OPEN
STARTUP
MOUNT

NOMOUNT

SHUTDOWN
m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Opening a Database

e A
checks with the following stages:
c l
As a database moves from the shutdown stage to being fully open, it performs internal consistency

r a
• NOMOUNT: For an instance to reach the NOMOUNT (also known as STARTED) status, the
instance must read the initialization parameter file. No database files are checked while the
instance enters the NOMOUNT state.O ly
l & On
• MOUNT: As the instance moves to the MOUNT status, it checks whether all control files listed in
the initialization parameter file are present and synchronized. If even one control file is missing
a e
or corrupt, the instance returns an error (noting the missing control file) to the administrator and
n
t e r
remains in the NOMOUNT state.
s
• OPEN: When the instance moves from the MOUNT state to the OPEN state, it does the following:

U
I n
- Checks whether all redo log groups known to the control file have at least one member
present. Any missing members are noted in the alert log.

c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 3
Opening a Database (continued)
- Verifies that all data files known to the control file are present unless they have been
taken offline. Offline files are not checked until the administrator tries to bring them
online. The administrator may take a data file offline and open the instance if the data
file does not belong to the SYSTEM or UNDO tablespaces. If any files are missing, an
error noting the first missing file is returned to the administrator and the instance
remains in the MOUNT state. When the instance finds files that are missing, only the
first file causing a problem appears in the error message. To find all files that need
recovery, the administrator can check the v$recover_file dynamic performance
view to get a complete list of the files that need attention:
SQL> startup
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 775608 bytes
Variable Size 145762888 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 4 - see DBWR trace
file
ORA-01110: data file 4: '/oracle/oradata/orcl/users01.dbf'
SQL> SELECT name, error
2 FROM v$datafile
3 JOIN v$recover_file
m y
4 USING (file#);
NAME ERROR
d e
----------------------------------- ------------------
/oracle/oradata/orcl/users01.dbf FILE NOT FOUND
c a
/oracle/oradata/orcl/example01.dbf FILE NOT FOUND

e A
- Verifies that all data files that are not offline or read-only are synchronized with the

c l
control file. If necessary, instance recovery is automatically performed. However, if a

r a
file is out of synchronization to the extent that it cannot be recovered by using the
online redo log groups, then the administrator must perform media recovery. If any

O ly
files require media recovery, an error message noting the first file requiring recovery is
returned to the administrator and the instance remains in the MOUNT state:

l & On
ORA-01113: file 4 needs media recovery

n a e
ORA-01110: data file 4: '/oracle/oradata/orcl/users01.dbf'
Again, v$recover_file gives a complete list of files that need attention. Files that

t e r U s
are present and require media recovery are listed, but no error message is displayed.

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 4
Keeping a Database Open

After the database is open, it fails in the case of the loss


of:
• Any control file
• A data file belonging to the system or undo
tablespaces
• An entire redo log group
(As long as at least one member of the group is
available, the instance remains open.)

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Keeping a Database Open

e A
c l
After a database is open, instance failure can be caused by media failure: for example, by the loss of
a control file, the loss of an entire redo log group, or the loss of a data file belonging to the SYSTEM
or UNDO tablespaces.
r a
O ly
In many cases, the failed instance does not completely shut down but is unable to continue to
perform work. Recovering from these types of media failure must be done with the database down.
& On
As a result, the administrator must use the SHUTDOWN ABORT command before beginning recovery
l
efforts.

n a e
The loss of data files belonging to other tablespaces does not cause instance failure, and the database

t e r U s
can be recovered while open, with work continuing in other tablespaces.
These errors can be detected by inspecting the alert log file or by using the Data Recovery Advisor.

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 5
Data Recovery Advisor

• Fast detection, analysis, and repair of failures


• Down-time and run-time failures
• Minimizing disruptions for users
• User interfaces:
– Enterprise Manager
GUI (several paths)
– RMAN command line
• Supported database configurations:
– Single instance
– Not RAC
– Supporting failover to standby, but not analysis and
repair of standby databases
m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Functionality of the Data Recovery Advisor

e A
c l
The Data Recovery Advisor automatically gathers data failure information when an error is
encountered. In addition, it can proactively check for failures. In this mode, it can potentially detect

r a
and analyze data failures before a database process discovers the corruption and signals an error.
(Note that repairs are always under human control.)
O ly
Data failures can be very serious. For example, if your current log files are missing, you cannot open
& On
your database. Some data failures (like block corruptions in data files) are not catastrophic because
l
n a e
they do not take the database down or prevent you from opening the Oracle instance. The Data
Recovery Advisor handles both cases: the one when you cannot start up the database (because

t
discovered during run time.
e r U s
required database files are missing, inconsistent, or corrupted) and the one when file corruptions are

I n
The preferred way to address serious data failures is as follows:
1. Fail over to a standby database if you are in a Data Guard configuration. This allows users to

l e
come back online as soon as possible.
c
2. Repair the primary cause of the data failure (fortunately, this does not affect your users).

r a
O
Oracle Database 11g: Administration Workshop I 16 - 6
Functionality of the Data Recovery Advisor (continued)
User Interfaces
The Data Recovery Advisor is available from Enterprise Manager (EM) Database Control and
Grid Control. When failures exist, there are several ways to access the Data Recovery Advisor.
The following examples all begin on the Database Instance home page:
• Availability tabbed page > Perform Recovery > Advise and Recover
• Active Incidents link > on the Support Workbench “Problems” page: Checker Findings
tabbed page > Launch Recovery Advisor
• Database Instance Health > click specific link (for example, ORA 1578) in the Incidents
section > Support Workbench, Problems Detail page > Data Recovery Advisor
• Database Instance Health > Related Links section: Support Workbench > Checker Findings
tabbed page: Launch Recovery Advisor
• Related Link: Advisor Central > Advisors tabbed page: Data Recovery Advisor
• Related Link: Advisor Central > Checkers tabbed page: Details > Run Detail tabbed page:
Launch Recovery Advisor
You can also use the Data Recovery Advisor by using the RMAN command line:
rman target / nocatalog
rman> list failure all;
Supported Database Configurations

Application Clusters databases are not supported.


m y
In the current release, the Data Recovery Advisor supports single-instance databases. Oracle Real

d e
The Data Recovery Advisor cannot use blocks or files transferred from a standby database to
repair failures on a primary database. Furthermore, you cannot use the Data Recovery Advisor to

c
support failover to a standby database as a repair option (as mentioned above).
a
diagnose and repair failures on a standby database. However, the Data Recovery Advisor does

e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 7
Loss of a Control File

If a control file is lost or corrupted, the instance normally


aborts. You must then perform the following steps:
1. Shut down the instance (if it is still open).
2. Restore the missing control file by copying an existing
control file.
3. Start the instance.

Control files

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Loss of a Control File

e A
by performing the following steps:
c l
Recovering from the loss of a control file (if at least one control file remains) can be accomplished

r a
1. If the instance has not already failed, shut it down by using SHUTDOWN ABORT.
2. Copy one of the remaining control files to the missing file’s location. If the media failure is due
O ly
to the loss of a disk drive or controller, copy one of the remaining control files to some other

l & On
location and update the instance’s parameter file to point to the new location. Alternatively, you
can delete the reference to the missing control file from the initialization parameter file.
a e
Remember that Oracle recommends having at least two control files at all times.
n
3. Start the instance.

t e r U s
Recovering from the loss of all control files is covered in the course titled Oracle Database 11g:

n
Administration Workshop II.
I
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 8
Loss of a Redo Log File

If a member of a redo log file group is lost and if the group


still has at least one member, note the following results:
• Normal operation of the instance is not affected.
• You receive a message in the alert log notifying you
that a member cannot be found.
• You can restore the missing log file by copying one of
the remaining files from the same group.

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Loss of a Redo Log File

e A
To perform this recovery: c l
Recovering from the loss of a single redo log group member should not affect the running instance.

r a
1. Determine whether there is a missing log file by examining the alert log.

O ly
2. Restore the missing file by copying one of the remaining files from the same group.
3. If the media failure is due to the loss of a disk drive or controller, rename the missing file.
& On
4. If the group has already been archived, or if you are in NOARCHIVELOG mode, you may choose
l
n a e
to solve the problem by clearing the log group to re-create the missing file or files. Select the
appropriate group and then select the Clear Logfile action. You can also clear the affected group

t e r U s
manually with the following command:
SQL> ALTER DATABASE CLEAR LOGFILE GROUP #;

I n
Note: Database Control does not allow you to clear a log group that has not been archived. Doing so
breaks the chain of redo information. If you must clear an unarchived log group, you should

l e
immediately take a full backup of the whole database. Failure to do so may result in a loss of data if
c
another failure occurs. To clear an unarchived log group, use the following command:

O ra SQL> ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP #;

Oracle Database 11g: Administration Workshop I 16 - 9


Loss of a Data File
in NOARCHIVELOG Mode

If the database is in NOARCHIVELOG mode and if any data


file is lost, perform the following tasks:
1. Shut down the instance if it is not already down.
2. Restore the entire database—including all data and
control files—from the backup.
3. Open the database.
4. Have users reenter all changes that were made
since the last backup.

User User User User User


m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Loss of a Data File in NOARCHIVELOG Mode

e A
c l
The loss of any data file from a database in NOARCHIVELOG mode requires complete restoration of
the database, including control files and all data files.

r a
With the database in NOARCHIVELOG mode, recovery is possible only up to the time of the last

O ly
backup. So users must reenter all changes made since that backup.
To perform this type of recovery:

l & On
1. Shut down the instance if it is not already down.

n a e
2. Click Perform Recovery on the Maintenance properties page.
3. Select Whole Database as the type of recovery.

e r s
If you have a database in NOARCHIVELOG mode that has an incremental backup strategy, RMAN
t U
first restores the most recent level 0 and then RMAN recovery applies the incremental backups.

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 10
Loss of a Noncritical Data File
in ARCHIVELOG Mode

If a data file is lost or corrupted, and if that file does not


belong to the SYSTEM or UNDO tablespace, you restore and
recover the missing data file.

Users
m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Loss of a Noncritical Data File in ARCHIVELOG Mode

e A
c l
With the database in ARCHIVELOG mode, the loss of any data file not belonging to the SYSTEM or
UNDO tablespaces affects only the objects that are in the missing file. The rest of the database

r a
remains available for users to continue work.

O ly
To restore and recover the missing data file:
1. Click Perform Recovery on the Maintenance properties page.
& On
2. Select Datafiles as the recovery type, and then select “Restore to current time.”
l
n a e
3. Add all data files that need recovery.
4. Determine whether you want to restore the files to the default location or (if a disk or controller

t e r
is missing) to a new location.

U s
5. Submit the RMAN job to restore and recover the missing files.

I n
Because the database is in ARCHIVELOG mode, recovery is possible up to the time of the last
commit and users are not required to reenter any data.

c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 11
Loss of a System-Critical Data File
in ARCHIVELOG Mode

If a data file is lost or corrupted, and if that file belongs to


the SYSTEM or UNDO tablespace, perform the following
tasks:
1. The instance may or may not shut down automatically.
If it does not, use SHUTDOWN ABORT to bring the
instance down.
2. Mount the database.
3. Restore and recover the missing data file.
4. Open the database.

Users
m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Loss of a System-Critical Data File in ARCHIVELOG Mode

e A
c l
Data files belonging to the SYSTEM tablespace or containing UNDO data are considered system
critical. A loss of one of these files requires the database to be restored from the MOUNT state (unlike

r a
other data files that may be restored with the database open).
To perform this recovery:
O ly
1. If the instance is not already shut down, shut it down.
2. Mount the database.
l & On
n a e
3. Click Perform Recovery on the Maintenance properties page.
4. Select Datafiles as the recovery type, and then select “Restore to current time.”

t e r U s
5. Add all data files that need recovery.
6. Determine whether you want to restore the files to the default location or (if a disk or controller

I n
is missing) to a new location.
7. Submit the RMAN job to restore and recover the missing files.

l e
8. Open the database. Users are not required to reenter data because the recovery is up to the time

c
of the last commit.

r a
O
Oracle Database 11g: Administration Workshop I 16 - 12
Data Recovery Advisor

1. Assess data failures. Health Monitor

2. List failures by severity.


Data
Recovery
3. Advise on repair. Advisor

4. Choose and execute repair.

5. Perform proactive checks. DBA

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Data Recovery Advisor

e A
c l
The automatic diagnostic workflow in Oracle Database 11g performs workflow steps for you. With
the Data Recovery Advisor you only need to initiate an advise and a repair.

r a
1. Health Monitor automatically executes checks and logs failures and their symptoms as
“findings” into the automatic diagnostic repository (ADR). For details about Health Monitor, see
the Diagnostics eStudy. O ly
l & On
2. The Data Recovery Advisor consolidates findings into failures. It lists the results of previously
executed assessments with failure severity (critical or high).
a e
3. When you ask for repair advice on a failure, the Data Recovery Advisor maps failures to
n
advice.
t e r U s
automatic and manual repair options, checks basic feasibility, and presents you with the repair

you.
I n
4. You can execute a repair manually, or you can request the Data Recovery Advisor to do it for

c l e
5. In addition to the automatic, primarily “reactive” checks of Health Monitor and the Data
Recovery Advisor, Oracle recommends using the VALIDATE command as a “proactive” check.

r a
O
Oracle Database 11g: Administration Workshop I 16 - 13
Assessing Data Failures

1 Database instance health 3 Problem details


... 2 Error link

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Assessing Data Failures

e A
and the Data Recovery Advisor.
c l
The example in the slide shows one of several possible ways to see the interaction of Health Monitor

r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 14
Data Failures

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Data Failures

e A
c l
Data failures are detected by checks, which are diagnostic procedures that asses the health of the
database or its components. Each check can diagnose one or more failures, which are then mapped to
a repair.
r a
O ly
Checks can be reactive or proactive. When an error occurs in the database, reactive checks are
automatically executed. You can also initiate proactive checks (for example, by executing the
VALIDATE DATABASE command).
l & On
n a e
In Enterprise Manager, select Availability > Perform Recovery or click the Perform Recovery button
if you find your database in a “down” or “mounted” state.

t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 15
Data Failure: Examples

• Inaccessible components: Missing data


files at the OS level, incorrect access
permissions, offline tablespace
• Physical corruptions: Block checksum failures,
invalid block header field values
• Logical corruptions: Inconsistent dictionary;
corrupt row piece, index entry, or transaction
• Inconsistencies: Control file older or newer
than the data files and online redo logs
• I/O failures: Limit on the number of open files
exceeded, inaccessible channels, network or I/O error

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Data Failure: Examples

e A
issues.
c l
The Data Recovery Advisor can analyze failures and suggest repair options for a growing list of

r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 16
Listing Data Failures

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Listing Data Failures

e A
c l
On the Perform Recovery page, click “Advise and Repair.”
This “View and Manage Failures” page is the home page for the Data Recovery Advisor. The

r a
example in the screenshot shows how the Data Recovery Advisor lists data failures and details.

O ly
Activities that you can initiate include advising, setting priorities, and closing failures.
The underlying RMAN LIST FAILURE command can also display data failures and details.

l & On
Failure assessments are not initiated here; they are executed and stored in the ADR.

a e
Failures are listed in decreasing priority order: CRITICAL, HIGH, LOW. Failures with the same

n
t e r
priority are listed in order of increasing time stamps.

U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 17
Advising on Repair

(1) After manual repair


(2) Automatic repair

2a

2b

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Advising on Repair

e A
c l
On the “View and Manage Failures” page, the Data Recovery Advisor generates a manual checklist
after you click the Advise button. Two types of failures can appear.

r a
• Failures that require human intervention: An example is a connectivity failure when a disk cable
is not plugged in.
O ly
• Failures that are repaired faster if you can undo a previous erroneous action: For example, if you

RMAN restoration from backup.


l & On
renamed a data file by error, it is faster to rename it back to its previous name than to initiate

n a e
You can initiate the following actions:

t e r U s
• Click “Re-assess Failures” after you perform a manual repair. Resolved failures are implicitly
closed; any remaining failures are displayed on the “View and Manage Failures” page.

I n
• Click “Continue with Advise” to initiate an automated repair. When the Data Recovery Advisor
generates an automated repair option, it generates a script that shows how RMAN plans to repair

l e
the failure. Click Continue if you want to execute the automated repair. If you do not want the

c
Data Recovery Advisor to automatically repair the failure, you can use this script as a starting

r a point for your manual repair.

O
Oracle Database 11g: Administration Workshop I 16 - 18
Executing Repairs

. . . in less than
1 second

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Executing Repairs

e A
less than one second.
c l
The Data Recovery Advisor displays these pages. In the example, a successful repair is completed in

r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 19
Data Recovery Advisor Views

Querying dynamic data dictionary views


• V$IR_FAILURE: Listing of all failures, including closed
ones (result of the LIST FAILURE command)
• V$IR_MANUAL_CHECKLIST: Listing of manual advice
(result of the ADVISE FAILURE command)
• V$IR_REPAIR: Listing of repairs (result of the ADVISE
FAILURE command)
• V$IR_FAILURE_SET: Cross-reference of failure and
advise identifiers

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Data Recovery Advisor Views

e A
Usage Example
c l
Suppose that you need to display all failures that were detected on June 21, 2007.
SELECT * FROM v$ir_failure
r a
O ly
WHERE trunc (time_detected) = '21-JUN-2007';
See the Oracle Database Reference for details about the dynamic data dictionary views used by the
Data Recovery Advisor.
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 20
Summary

In this lesson, you should have learned how to:


• Determine the need for performing recovery
• Access different interfaces (such as Enterprise
Manager and command line)
• Describe and use available options, such as Recovery
Manager (RMAN) and the Data Recovery Advisor
• Perform recovery:
– Control file
– Redo log file
– Data file

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 21
Practice 16 Overview:
Performing Database Recovery

This practice covers recovering from the loss of a:


• Control file
• Redo log file
• Noncritical data file
• System-critical data file

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 16 - 22
Moving Data

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Objectives

After completing this lesson, you should be able to:


• Describe ways to move data
• Create and use directory objects
• Use SQL*Loader to load data from a non-Oracle
database (or user files)
• Use external tables to move data via platform-
independent files
• Explain the general architecture of Oracle Data Pump
• Use Data Pump Export and Import to move data
between Oracle databases

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 2
Moving Data:
General Architecture

SQL*Loader expdp impdp Other clients

Data Pump

DBMS_DATAPUMP
Data/Metadata Movement Engine

Oracle Oracle
Loader DataPump Direct Path API Metadata API

External Table API


m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Moving Data: General Architecture

e A
Major functional components:

c l
• DBMS_DATAPUMP: Contains the API for high-speed export and import utilities for bulk
data and metadata movement
r a
• Direct Path API (DPAPI): Oracle Database 11g supports a Direct Path API interface that
O ly
minimizes data conversion and parsing at both unload and load time.

l & On
• DBMS_METADATA: Used by worker processes for all metadata unloading and loading.
Database object definitions are stored using XML rather than SQL.
a e
• External Table API: With the ORACLE_DATAPUMP and ORACLE_LOADER access
n
e r
drivers, you can store data in external tables (that is, in platform-independent files). The
s
SELECT statement reads external tables as though they were stored in an Oracle database.
t U
• SQL*Loader: Has been integrated with external tables, providing automatic migration of

I n
loader control files to external table access parameters

c l e
• expdp and impdp: Thin layers that make calls to the DBMS_DATAPUMP package to
initiate and monitor Data Pump operations

r a
• Other clients: Applications (such as Database Control, replication, transportable
tablespaces, and user applications) that benefit from this infrastructure. SQL*Plus may

O also be used as a client of DBMS_DATAPUMP for simple status queries against ongoing
operations.
Oracle Database 11g: Administration Workshop I 17 - 3
Directory Objects: Overview .

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Directory Objects: Overview

e A
c l
Directory objects are logical structures that represent a physical directory on the server’s file
system. They contain the location of a specific operating system directory. This directory

r a
object name can be used in Enterprise Manager so that you do not need to hard-code directory
path specifications. You thus get greater file management flexibility. Directory objects are
O ly
owned by the SYS user. Directory names are unique across the database because all the

l & On
directories are located in a single name space (that is, SYS).
Directory objects are required when you specify file locations for Data Pump because it
a e
accesses files on the server rather than on the client.
n
t e r U s
In Enterprise Manager, select Schema > Database Objects > Directory Objects.
To edit or delete a directory object, select the object and click the appropriate button.

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 4
Creating Directory Objects

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Creating Directory Objects

e A
c l
1. On the Directory Objects page, click the Create button.
2. Enter the name of the directory object and the OS path to which it maps. OS directories

r a
should be created before they are used. You can test this by clicking the Test File System
button. For the test, provide the host login credentials (that is, the OS user who has
O ly
privileges on this OS directory).

l & On
3. Permissions for directory objects are not the same as OS permissions on the physical
directory on the server file system. You can manage user privileges on individual
a e
directory objects. This increases the level of security and gives you granular control over
n
e r
these objects. On the Privileges page, click Add to select the user to which you give read
s
or write privileges (or both).
t U
4. Click Show SQL to view the underlying statements.

I n
5. Click OK to create the object.

c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 5
SQL*Loader: Overview

Input data files Control file

SQL*Loader Rejected
Field processing
Discarded Accepted
Record selection
Selected
Bad
Oracle server file
Discard file Rejected
Inserted
(optional)

Log file

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
SQL*Loader: Overview

e A
c l
SQL*Loader loads data from external files into tables of an Oracle database. It has a powerful
data parsing engine that puts little limitation on the format of the data in the data file.
SQL*Loader uses the following files:
r a
O ly
Input data files: SQL*Loader reads data from one or more files (or operating system
equivalents of files) that are specified in the control file. From SQL*Loader’s perspective, the
& On
data in the data file is organized as records. A particular data file can be in fixed record format,
l
n a e
variable record format, or stream record format. The record format can be specified in the
control file with the INFILE parameter. If no record format is specified, the default is stream
record format.

t e r U s
Control file: The control file is a text file that is written in a language that SQL*Loader

I n
understands. The control file indicates to SQL*Loader where to find the data, how to parse and
interpret the data, where to insert the data, and so on. Although not precisely defined, a control
l e
file can be said to have three sections.
c
• The first section contains such session-wide information as the following:

r a - Global options, such as the input data file name and records to be skipped

O - INFILE clauses to specify where the input data is located


- Data to be loaded

Oracle Database 11g: Administration Workshop I 17 - 6


SQL*Loader: Overview (continued)
• The second section consists of one or more INTO TABLE blocks. Each of these blocks
contains information about the table (such as the table name and the columns of the table)
into which the data is to be loaded.
• The third section is optional and, if present, contains input data.
Log file: When SQL*Loader begins execution, it creates a log file. If it cannot create a log
file, execution terminates. The log file contains a detailed summary of the load, including a
description of any errors that occurred during the load.
Bad file: The bad file contains records that are rejected, either by SQL*Loader or by the
Oracle database. Data file records are rejected by SQL*Loader when the input format is
invalid. After a data file record is accepted for processing by SQL*Loader, it is sent to the
Oracle database for insertion into a table as a row. If the Oracle database determines that the
row is valid, the row is inserted into the table. If the row is determined to be invalid, the record
is rejected and SQL*Loader puts it in the bad file.
Discard file: This file is created only when it is needed and only if you have specified that a
discard file should be enabled. The discard file contains records that are filtered out of the load
because they do not match any record-selection criteria specified in the control file.
For more information about SQL*Loader, see the Oracle Database Utilities guide.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 7
Loading Data with SQL*Loader

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Loading Data with SQL*Loader

e A
database.
c l
Use the “Load Data from User Files Wizard” to load data from a flat file into an Oracle

r a
To display the wizard, select Enterprise Manager Data Movement > Move Row Data > Load
Data from User Files.
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 8
SQL*Loader Control File

The SQL*Loader control file instructs SQL*Loader about:


• Location of the data to be loaded
• Data format
• Configuration details:
– Memory management
– Record rejection
– Interrupted load handling details
• Data manipulation details

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
SQL*Loader Control File

e A
c l
The SQL*Loader control file is a text file that contains data definition language (DDL)
instructions. DDL is used to control the following aspects of a SQL*Loader session:

r a
• Where SQL*Loader finds the data to load
• How SQL*Loader expects that data to be formatted
O ly
• How SQL*Loader is being configured (including memory management, selection and

l & On
rejection criteria, interrupted load handling, and so on) as it loads the data
• How SQL*Loader manipulates the data being loaded

n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 9
SQL*Loader Control File (continued)
1 -- This is a sample control file
2 LOAD DATA
3 INFILE ’SAMPLE.DAT’
4 BADFILE ’sample.bad’
5 DISCARDFILE ’sample.dsc’
6 APPEND
7 INTO TABLE emp
8 WHEN (57) = ’.’
9 TRAILING NULLCOLS
10 (hiredate SYSDATE,
deptno POSITION(1:2) INTEGER EXTERNAL(3)
NULLIF deptno=BLANKS,
job POSITION(7:14) CHAR TERMINATED BY WHITESPACE
NULLIF job=BLANKS "UPPER(:job)",
mgr POSITION(28:31) INTEGER EXTERNAL
TERMINATED BY WHITESPACE, NULLIF mgr=BLANKS,
ename POSITION(34:41) CHAR
TERMINATED BY WHITESPACE "UPPER(:ename)",
empno POSITION(45) INTEGER EXTERNAL
TERMINATED BY WHITESPACE,
sal POSITION(51) CHAR TERMINATED BY WHITESPACE
"TO_NUMBER(:sal,’$99,999.99’)",
comm INTEGER EXTERNAL ENCLOSED BY ’(’ AND ’%’
":comm * 100"

y
)
The explanation of this sample control file (by line numbers) is as follows:
1. Comments can appear anywhere in the command section of the file, but they must not
e m
appear in the data. Precede any comment with two hyphens. All text to the right of the
double hyphen is ignored until the end of the line.
a d
A c
2. The LOAD DATA statement indicates to SQL*Loader that this is the beginning of a new
data load. If you are continuing a load that has been interrupted in progress, use the
CONTINUE LOAD DATA statement.

l e
3. The INFILE keyword specifies the name of a data file containing data that you want to
load.
c
r a
4. The BADFILE keyword specifies the name of a file into which rejected records are
placed.
O ly
5. The DISCARDFILE keyword specifies the name of a file into which discarded records
are placed.
l & On
6. The APPEND keyword is one of the options that you can use when loading data into a
a e
table that is not empty. To load data into a table that is empty, use the INSERT keyword.
n
t e r s
7. The INTO TABLE keyword enables you to identify tables, fields, and data types. It
defines the relationship between records in the data file and tables in the database.
U
I n
8. The WHEN clause specifies one or more field conditions that each record must match
before SQL*Loader loads the data. In this example, SQL*Loader loads the record only if

c l e
the 57th character is a decimal point. That decimal point delimits dollars and cents in the
field and causes records to be rejected if SAL has no value.

r a
9. The TRAILING NULLCOLS clause prompts SQL*Loader to treat any relatively
positioned columns that are not present in the record as null columns.

O 10. The remainder of the control file contains the field list, which provides information about
column formats in the table that is being loaded.
Oracle Database 11g: Administration Workshop I 17 - 10
Loading Methods

Data Block
insert writes

Table
HWM

Conventional Load Direct Path Load


Uses COMMIT Uses data saves (faster operation)

Always generates redo entries Generates redo only under specific


conditions
Enforces all constraints Enforces only PRIMARY KEY, UNIQUE, and
NOT NULL
Fires INSERT triggers Does not fire INSERT triggers

Can load into clustered tables Does not load into clusters

Allows other users to modify


tables during load operation
Prevents other users from making changes
to tables during load operation
m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Comparing Direct and Conventional Path Loads

e A
Method of Saving Data

c l
Conventional path loads use SQL processing and a database COMMIT operation for saving

r a
data. The insertion of an array of records is followed by a COMMIT operation. Each data load
may involve several transactions.
O ly
Direct path loads use data saves to write blocks of data to Oracle data files. This is why the
& On
direct path loads are faster than the conventional ones. The following features differentiate a
l
data save from COMMIT:

n a e
• During a data save, only full database blocks are written to the database.

t e r U s
• The blocks are written after the high-water mark (HWM) of the table.
• After a data save, the HWM is moved.

I n
• Internal resources are not released after a data save.
• A data save does not end the transaction.

l e
• Indexes are not updated at each data save.

c
Note: Direct path and parallel direct path loads are so similar (regarding DML activities) that

r a
they are not separated in this comparison.

O
Oracle Database 11g: Administration Workshop I 17 - 11
Comparing Direct and Conventional Path Loads (continued)
Logging Changes
Conventional path loading generates redo entries that are similar to any DML statement. When
using a direct path load, redo entries are not generated if:
• The database is in NOARCHIVELOG mode
• The database is in ARCHIVELOG mode but logging is disabled
(Logging can be disabled by setting the NOLOGGING attribute for the table or by using
the UNRECOVERABLE clause in the control file.)
Enforcing Constraints
During a conventional path load, all enabled constraints are enforced in the same way that they
are during any DML operation.
During direct path loads, the constraints are handled as follows:
• NOT NULL constraints are checked when arrays are built.
• FOREIGN KEY and CHECK constraints are disabled, and they can be enabled at the end of
the load by using the appropriate commands in the control file. The FOREIGN KEY
constraints are disabled because they reference other rows or tables, and the CHECK
constraints are disabled because they may use SQL functions. If only a small number of
rows are to be inserted into a large table, use conventional loads.
• PRIMARY KEY and UNIQUE constraints are checked during and at the end of the load,
and they can be disabled if they are violated.
m y
Firing the INSERT Triggers

d e
The WHILE INSERT triggers are fired during conventional loads; they are disabled before a

c a
direct path load and reenabled at the end of the load. They may remain disabled if a referenced
object is not accessible at the end of the run. Consider using conventional path loads to load
data into tables with the INSERT triggers.

e A
Loading into Clustered Tables

c l
Direct loads cannot be used to load rows into clustered tables. Clustered tables can be loaded
with conventional path loads only.
r a
Locking
O ly
l & On
While a direct path load is in progress, other transactions cannot make changes to the tables
that are being loaded. The only exception to this rule is when several parallel direct load

a e
sessions are used concurrently.

n
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 12
External Table Population

• Unloading data to external files with the


ORACLE_DATAPUMP access driver
• No modifications of external tables

CREATE TABLE … AS SELECT INSERT … SELECT

Unloading Loading

Tables
External files
(proprietary format) Tables
m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
External Table Population

e A
c l
An external table is composed of proprietary format (that is, Direct Path API) flat files that are
operating system independent. As data is extracted from the Oracle database and “unloaded”

r a
into files, it is transparently converted from its Oracle internal representation into an
equivalent Oracle native external representation (that is, DPAPI).
O ly
You can use the CREATE TABLE AS SELECT command to populate an external table. After

l & On
an external table has been created and populated, no rows may be added, updated, or deleted
from the external table. Any attempt to modify the data in the external table fails. An external
table may not have indexes.
n a e
t e r U s
The Data Pump access driver enables the unloading and loading operations for external tables.
In Oracle Database 11g, you can compress and encrypt data before it is written to the dump
file set.
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 13
Using External Tables

• Data can be used directly from the external file or


loaded into another database.
• Resulting files can be read only with the
ORACLE_DATAPUMP access driver.
• You can combine generated files from different sources
for loading purposes.

From Oracle Database From external file

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Using External Tables

e A
c l
The data files created for the external table can be moved and used as the data files for another
external table in the same database or different database. They can be read only by the

r a
ORACLE_DATAPUMP access driver. You can choose to have your applications directly access
external tables with the SELECT command, or you can choose to have data loaded first into a
target database.
O ly
l & On
Data files that are populated by different external tables can all be specified in the LOCATION
clause of another external table. This provides an easy way of aggregating data from multiple
a e
sources. The only restriction is that the metadata for all the external tables must be exactly the
n
same.

t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 14
External Table Population with ORACLE_DATAPUMP

CREATE TABLE emp_ext


(first_name, last_name, department_name)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_DATAPUMP
DEFAULT DIRECTORY ext_dir
LOCATION ('emp1.exp','emp2.exp','emp3.exp')
)
PARALLEL
AS
SELECT e.first_name,e.last_name,d.department_name
FROM employees e, departments d
WHERE e.department_id = d.department_id AND

y
d.department_name in
('Marketing', 'Purchasing');

e m
Copyright © 2007, Oracle. All rights reserved.
a d
External Table Population with ORACLE_DATAPUMP
A c
l e
This example shows you how the new external table population operation can help to export a

c
selective set of records resulting from the join of the EMPLOYEES and DEPARTMENTS tables.

r a
Because the external table can be large, you can use a parallel populate operation to unload

O ly
your data to an external table. As opposed to a parallel query from an external table, the degree
of parallelism of a parallel populate operation is constrained by the number of concurrent files

l & On
that can be written to by the access driver. There is never more than one parallel execution
server writing into one file at a particular point in time.

n a e
The number of files in the LOCATION clause must match the specified degree of parallelism

t e r U s
because each input/output (I/O) server process requires its own file. Any extra files that are
specified are ignored. If there are not enough files for the specified degree of parallelism, the

I n
degree of parallelization is lowered to match the number of files in the LOCATION clause.
Note: For more information about the ORACLE_DATAPUMP access driver parameters, see the

l e
Oracle Database Utilities guide.
c
r a
O
Oracle Database 11g: Administration Workshop I 17 - 15
External Table Population with ORACLE_LOADER

CREATE TABLE extab_employees


(employee_id NUMBER(4),
first_name VARCHAR2(20),
last_name VARCHAR2(25),
hire_date DATE)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER DEFAULT DIRECTORY extab_dat_dir
ACCESS PARAMETERS
( records delimited by newline
badfile extab_bad_dir:'empxt%a_%p.bad'
logfile extab_log_dir:'empxt%a_%p.log'
fields terminated by ','
missing field values are null
( employee_id, first_name, last_name,
hire_date char date_format date mask "dd-mon-yyyy“))
LOCATION ('empxt1.dat', 'empxt2.dat') )
PARALLEL REJECT LIMIT UNLIMITED;
m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
External Table Population with ORACLE_LOADER

e A
c l
The ORACLE_LOADER access driver uses the SQL*Loader syntax to create external tables.
The example in the slide shows three directory objects (extab_dat_dir, extab_bad_dir,

r a
and extab_log_dir) that are created and mapped to existing OS directories to which the user
is granted access.
O ly
Best-practice tip: If you have a lot of data to load, enable PARALLEL for the load operation:

l & On
ALTER SESSION ENABLE PARALLEL DML;

n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 16
Oracle Data Pump: Overview

As a server-based facility for high-speed


data and metadata movement, Oracle Data Pump:
• Is callable via DBMS_DATAPUMP
• Provides the following tools:
– expdp
– impdp
– Web-based interface
• Provides data access methods:
– Direct path
– External tables
• Detaches from and reattaches to long-running jobs
• Restarts Data Pump jobs
m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Oracle Data Pump: Overview

e A
c l
Oracle Data Pump enables very high-speed data and metadata loading and unloading of Oracle
databases. The Data Pump infrastructure is callable via the DBMS_DATAPUMP PL/SQL

r a
package. Thus, custom data movement utilities can be built by using Data Pump.

O ly
Oracle Database 11g provides the following tools:
• Command-line export and import clients called expdp and impdp, respectively

& On
• A Web-based export and import interface that is accessible from Database Control
l
n a e
Data Pump automatically decides the data access methods to use; these can be either direct
path or external tables. Data Pump uses direct path load and unload when a table’s structure

t e r U s
allows it and when maximum single-stream performance is desired. However, if there are
clustered tables, referential integrity constraints, encrypted columns, or a number of other

I n
items, Data Pump uses external tables rather than direct path to move the data.
The ability to detach from and reattach to long-running jobs without affecting the job itself

l e
enables you to monitor jobs from multiple locations while they are running. All stopped Data
c
Pump jobs can be restarted without loss of data as long as the metainformation remains

r a
undisturbed. It does not matter whether the job is stopped voluntarily or involuntarily due to a
crash.
O
Oracle Database 11g: Administration Workshop I 17 - 17
Oracle Data Pump: Benefits

• Fine-grained object and data selection


• Explicit specification of database version
• Parallel execution
• Estimation of export job space consumption
• Network mode in a distributed environment
• Remapping capabilities during import
• Data sampling and metadata compression
• Compression of data during an export
• Security through encryption
• Remapping of data
• Ability to export XMLType data as CLOBs
m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Oracle Data Pump: Benefits

e A
data selection.
c l
The EXCLUDE, INCLUDE, and CONTENT parameters are used for fine-grained object and

r a
You can specify the database version for objects to be moved (using the VERSION parameter)
to create a dump file set that is compatible with a previous release of the Oracle database that
supports Data Pump.
O ly
l & On
You can use the PARALLEL parameter to specify the maximum number of threads of active
execution servers operating on behalf of the export job.

n a e
You can estimate how much space an export job would consume (without actually performing
the export) by using the ESTIMATE_ONLY parameter.

e r s
Network mode enables you to export from a remote database directly to a dump file set. This
t U
can be done by using a database link to the source system.

I n
During import, you can change the target data file names, schemas, and tablespaces.

l e
In addition you can specify a percentage of data to be sampled and unloaded from the source

c
database when performing a Data Pump export. This can be done by specifying the SAMPLE

r a
parameter.
You can use the COMPRESSION parameter to indicate whether the metadata should be

O compressed in the export dump file so that it consumes less disk space. If you compress the
metadata, it is automatically uncompressed during import.

Oracle Database 11g: Administration Workshop I 17 - 18


Data Pump Enhancements in Oracle Database 11g
In Oracle Database 11g, new features have been added that enable you to:
• Compress both data and metadata, only data, only metadata, or no data during an export
• Specify additional encryption options in the following areas:
- You can choose to encrypt both data and metadata, only data, only metadata, no data,
or only encrypted columns during an export.
- You can specify a specific encryption algorithm to use during an export.
- You can specify the type of security to use for performing encryption and decryption
during an export. For example, perhaps the dump file set will be imported into a
different or remote database and it must remain secure in transit. Or perhaps the
dump file set will be imported onsite using the Oracle Encryption Wallet but it may
also need to be imported offsite where the Oracle Encryption Wallet is not available.
• Perform table mode exports and imports using the transportable method; specify how
partitioned tables should be handled during import operations
• Overwrite existing dump files during an export operation
• Rename tables during an import operation
• Specify that a data load should proceed even if nondeferred constraint violations are
encountered (This is valid only for import operations that use the external tables access
method.)
• Specify that XMLType columns are to be exported in uncompressed CLOB format
regardless of the XMLType storage format that was defined for them
m y
• During an export, specify a remap function that takes as a source the original value of the
e
designated column and returns a remapped value that will replace the original value in the
d
dump file
• Remap data as it is being imported into a new database
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 19
Data Pump Export and Import: Overview
expdp Database
client link

Source Target

Data Pump Server


job process
Database Database

Master Dump Dump Master


table file set file set table

“Network mode”

Server Data Pump


process job

impdp
client
m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Data Pump Export and Import: Overview

e A
c l
Data Pump Export is a utility for unloading data and metadata into a set of operating system
files called dump file sets. Data Pump Import is used to load metadata and data stored in an

r a
export dump file set into a target system.

O ly
The Data Pump API accesses its files on the server rather than on the client.
These utilities can also be used to export from a remote database directly to a dump file set, or
& On
to load the target database directly from a source database with no intervening files. This is
l
source database.
n a e
known as network mode. This mode is particularly useful to export data from a read-only

e r s
At the center of every Data Pump operation is the master table (MT), which is a table created
t U
in the schema of the user running the Data Pump job. The MT maintains all aspects of the job.

I n
The MT is built during a file-based export job and is written to the dump file set as the last
step. Conversely, loading the MT into the current user’s schema is the first step of a file-based
l e
import operation and is used to sequence the creation of all objects imported.
c
r a
Note: The MT is the key to Data Pump’s restart capability in the event of a planned or
unplanned stopping of the job. The MT is dropped when the Data Pump job finishes normally.

O
Oracle Database 11g: Administration Workshop I 17 - 20
Data Pump Utility: Interfaces and Modes

• Data Pump Export and Import interfaces:


– Command line
– Parameter file
– Interactive command line
– Enterprise Manager
• Data Pump Export and Import modes:
– Full
– Schema
– Table
– Tablespace
– Transportable tablespace

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Data Pump Utility: Interfaces and Modes

e A
c l
You can interact with Data Pump Export and Import by using one of the following interfaces:
• Command line interface: Enables you to specify most of the export parameters directly
on the command line
r a
• Parameter file interface: Enables you to specify all command line parameters in a
O ly
parameter file. The only exception is the PARFILE parameter.

l & On
• Interactive-command interface: Stops logging to the terminal and displays the export or
import prompts, where you can enter various commands. This mode is enabled by
a e
pressing [Ctrl] + [C] during an export operation that is started with the command line
n
e r
interface or the parameter file interface. Interactive-command mode is also enabled when
s
you attach to an executing or stopped job.
t U
• Web interface: On the Database Control home page, click the Maintenance tab, and then

I n
select one of the following links from the Utilities region: Export to Files, Import from

c l e
Files, or Import from Database.
Data Pump Export and Import provide different modes for unloading and loading different

r a
portions of the database. The mode is specified on the command line by using the appropriate
parameter. The available modes are listed in the slide and are the same as in the original export
O and import utilities.

Oracle Database 11g: Administration Workshop I 17 - 21


Fine-Grained Object Selection .

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Fine-Grained Object Selection

e A
c l
The Data Pump job can include or exclude virtually any type of object.
The EXCLUDE parameter enables any database object type to be excluded from an export or

r a
import operation. The optional name qualifier enables you to have finer selectivity within each

O ly
object type that is specified, as in these examples:
EXCLUDE=VIEW
EXCLUDE=PACKAGE

l & On
EXCLUDE=INDEX:"LIKE 'EMP%'"

a e
The INCLUDE parameter includes only the specified object types and objects in an operation.
n
t e r U s
Syntax: INCLUDE = object_type[:"name_expr"]
The CONTENT parameter enables you to request the current operation, only the metadata, only

I n
the data, or both metadata and data.
Syntax: CONTENT = ALL | METADATA_ONLY | DATA_ONLY

c l e
The QUERY parameter operates in a similar manner as the original export utility, with two

r a
significant enhancements: It can be qualified with a table name so that it applies to only that
table, and it can be used during import as well. Here is an example:

O QUERY=hr.employees:"WHERE department_id in (10,20) and


salary < 1600 ORDER BY department_id"

Oracle Database 11g: Administration Workshop I 17 - 22


Advanced Feature: Sampling

• Task: Create test data.


• Method: Specify a percentage of data to be sampled
and unloaded from the source database.
Example: To unload 44% of the HR.EMPLOYEES table
SAMPLE="HR"."EMPLOYEES":44

Example: To unload 30% of the entire export job (because


no table name is specified)
expdp hr/hr DIRECTORY=DATA_PUMP_DIR
DUMPFILE=sample1.dmp SAMPLE=30

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Advanced Feature: Sampling

e A
c l
With the SAMPLE parameter, you can specify a percentage of data to be sampled and unloaded
from the source database when performing a Data Pump export.

r a
Syntax: SAMPLE=[[schema_name.]table_name:]sample_percent

O ly
The sample percentage indicates the likelihood that a block of rows will be included. The
range of values for sample_percent is .000001 to (but not including) 100.

l & On
Note: The SAMPLE parameter is not valid for network exports.

n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 23
Export Options: Files

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Export Options: Files

e A
c l
Three types of files are managed by Data Pump jobs:
• Dump files for data and metadata that is to be moved
• Log files for messages
r a
• SQL files for the output of a SQLFILE operation
O ly
Because Data Pump is server based rather than client based, Data Pump files are accessed

& On
relative to Oracle directory paths. Absolute paths are not supported for security reasons.
l
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 24
Data Pump File Locations

Order of precedence of file locations:


• Per-file directory
• DIRECTORY parameter
• DATA_PUMP_DIR environment variable
• DATA_PUMP_DIR directory object
m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Data Pump File Locations

e A
c l
The slide shows you the order of precedence used by Data Pump clients to locate files.
• Per-file directory objects may be specified for each dump file, log file, and SQL file. If

r a
specified, they are separated from the file name by a colon (:).
• The Data Pump Export and Import clients provide a DIRECTORY parameter, which
O ly
specifies the name of a directory object. These directory objects describe the location in

l & On
which the files are accessed.
• You can alternatively define an environment variable, DATA_PUMP_DIR, to specify the

a e
directory object name rather than use the DIRECTORY parameter. The Data Pump clients
n
e r
look for this environment variable if no explicit directory object is specified.
s
• A default directory object is created for every database. This directory object is named
t U
DATA_PUMP_DIR. Access to the DATA_PUMP_DIR directory is granted automatically

I n
to the EXP_FULL_DATABASE and IMP_FULL_DATABASE roles.

c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 25
Data Pump File Locations (continued)
• You do not need to create a directory object manually before using Data Pump Export.
A default directory object named DATA_PUMP_DIR is created for every database,
whether newly created or upgraded by a script on UNIX or Windows platforms. Access to
the DATA_PUMP_DIR directory is granted automatically to the EXP_FULL_DATABASE
and IMP_FULL_DATABASE roles. The DATA_PUMP_DIR directory is created in one of
the following locations:
- <ORACLE_BASE>/admin/DB_UNIQUE_NAME
- <ORACLE_HOME>/admin/DB_UNIQUE_NAME
The exact directory path specification for DATA_PUMP_DIR varies depending on the
value of the ORACLE_BASE and ORACLE_HOME system environment variables and on
the existence of the DATA_PUMP_DIR subdirectory. If ORACLE_BASE is defined on the
target system, that value is used. Otherwise, the value of ORACLE_HOME is used. If the
DATA_PUMP_DIR subdirectory is for some reason not found, the following default path
is used:
ORACLE_HOME/rdbms/log
Note: In all cases, you must have the appropriate access privileges to the directory object for
the attempted operation. For export, you need write access for all files; for import, you need
read access for dump files and write access for log files and SQL files.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 26
Scheduling and Running a Job

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Scheduling and Running a Job

e A
Manager Database Control.
c l
Data Pump jobs (created through this wizard) are scheduled as repeatable jobs by Enterprise

r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 27
Data Pump File Naming and Size

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Data Pump File Naming and Size

e A
c l
The DUMPFILE parameter specifies the names and (optionally) directories of disk-based
dump files. Multiple file specifications may be provided as a comma-separated list or in

r a
separate DUMPFILE parameter specifications. File names may contain the substitution
variable %U, which implies that multiple files may be generated. %U is expanded in the
O ly
resulting file names into a two-character, fixed-width, monotonically increasing integer

l & On
starting at 01. If no DUMPFILE is specified, expdat.dmp is used by default. Created dump
files are autoextensible by default.
a e
If FILESIZE is specified, each file is FILESIZE bytes in size and nonextensible. If more
n
t e r U s
dump space is required and a template with %U has been supplied, a new file is automatically
created with FILESIZE bytes; otherwise, the client receives a message to add a new file.

I
PARALLEL parameter. n
If a template with %U is specified, the number of files that are initially created is equal to the

l e
Preexisting files that match the resulting file names are not overwritten. Instead, they result in
c
an error and cause the job to be aborted.

r a
Note: If multiple dump file templates are provided, they are used to generate dump files in a

O circular fashion.

Oracle Database 11g: Administration Workshop I 17 - 28


Data Pump Import

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Data Pump Import

e A
c l
Data Pump Import is a utility for loading an export dump file set into a target system. The
dump file set comprises one or more disk files that contain table data, database object

r a
metadata, and control information. The files are written in a proprietary binary format. During
an import operation, Data Pump Import uses these files to locate each database object in the
dump file set.
O ly
interactive-command mode:
l & On
You can interact with Data Pump Import by using a command line, a parameter file, or an

a e
• You can use the impdp command and specify parameters directly on the command line.
n
t e r U s
• You can enter command line parameters in a file (the PARFILE parameter is excluded
because parameter files cannot be nested).

I n
• In interactive-command mode, the current job continues running, but logging to the
terminal is stopped and the Import prompt is displayed. You can, for example, attach

l e
additional jobs to an executing or stopped job.

c
r a
O
Oracle Database 11g: Administration Workshop I 17 - 29
Data Pump Import: Transformations

You can remap:


• Data files by using REMAP_DATAFILE
• Tablespaces by using REMAP_TABLESPACE
• Schemas by using REMAP_SCHEMA

REMAP_DATAFILE = 'C:\oradata\tbs6.f':'/u1/tbs6.f'

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Data Pump Import: Transformations

e A
c l
Because object metadata is stored as XML in the dump file set, it is easy to apply
transformations when DDL is being formed during import. Data Pump Import supports several
transformations:
r a
• REMAP_DATAFILE is useful when moving databases across platforms that have

O ly
different file-system semantics.

l & On
• REMAP_TABLESPACE enables objects to be moved from one tablespace to another.
• REMAP_SCHEMA provides the old FROMUSER /TOUSER capability to change object
ownership.
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 30
Data Pump Import: Transformations

Using TRANSFORM, you can also :


• Exclude from tables and indexes
– STORAGE and TABLESPACE clauses
– STORAGE clause only
• Re-create object identifiers of abstract data types
• Change extent allocations and file size
TRANSFORM =
SEGMENT_ATTRIBUTES|STORAGE|OID|PCTSPACE:{y|n|v}[:object type]

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Data Pump Import: Transformations (continued)

e A
c l
The TRANSFORM parameter enables you to alter the object-creation DDL for specific objects
or for all applicable objects being loaded. Specify the TRANSFORM parameter as shown in the

r a
slide. Note the following possible options:
• SEGMENT_ATTRIBUTES: If the value is specified as Y, segment attributes (physical

O ly
attributes, storage attributes, tablespaces, and logging) are included.

l & On
• STORAGE: If the value is specified as Y, the STORAGE clauses are included.
• OID: Determines whether the object ID (OID) of abstract data types is reused or created

a e
as new. If the value is specified as N, the generation of the export OID clause for object
n
e r
types is suppressed. This is useful when you need to duplicate schemas across databases
s
by using export and import, but you cannot guarantee that the object types will have
t U
identical OID values in those databases.

I n
• PCTSPACE: Reduces the amount of space that is required for tablespaces by performing

c l e
a shrink operation on tablespace storage allocation. The value supplied for this
transformation must be a number greater than zero. It represents the percentage multiplier

r a that is used to alter extent allocations and the size of data files.

O
Oracle Database 11g: Administration Workshop I 17 - 31
Data Pump: Performance Considerations

Maximizing job performance with the PARALLEL parameter

Master coordinator

Parallel
execution

Generated
files
Example:
expdp hr/hr FULL=y
DUMPFILE=dp_dir1:full1%U.dmp, dp_dir2:full2%U.dmp
FILESIZE=2G PARALLEL=3
LOGFILE=dp_dir1:expfull.log JOB_NAME=expfull
m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Data Pump: Performance Considerations

e A
c l
You can improve job throughput with the PARALLEL parameter. The parallelism setting is
enforced by the master process, which allocates work to be executed to worker processes that

r a
perform the data and metadata processing in an operation. These worker processes operate in
parallel. In general, the degree of parallelism should be set to more than twice the number of
O ly
CPUs on an instance. To maximize parallelism, you must supply at least one file for each

l & On
degree of parallelism. If there are not enough dump files, the performance will not be optimal
because multiple threads of execution will try to access the same dump file. The degree of
a e
parallelism can be reset at any time during a job.
n
t e r U s
The example in the slide shows a full database export. All data and metadata in the database
will be exported. Dump files (full101.dmp, full201.dmp, full102.dmp, and so on)

I n
will be created in a round-robin fashion in the directories pointed to by the dp_dir1 and
dp_dir2 directory objects. For best performance, these should be on separate I/O channels.

l e
Each file will be up to 2 GB in size (as necessary). Up to three files will be created initially,

c
and more files will be created if needed. The job and master table have the same name:

a
expfull. The log file will be written to expfull.log in the dp_dir1 directory.
r
O
Oracle Database 11g: Administration Workshop I 17 - 32
Performance Initialization Parameters

• Data Pump performance can be affected by:


– DISK_ASYNCH_IO
– DB_BLOCK_CHECKING
– DB_BLOCK_CHECKSUM
• Set the following high to enable maximum parallelism:
– PROCESSES
– SESSIONS
– PARALLEL_MAX_SERVERS
• Size generously:
– Shared pool
– Undo tablespace

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Performance Initialization Parameters

e A
c l
You can try using the parameters listed in the slide to improve performance, although the
results may not be the same on all platforms.

r a
Additionally, the SHARED_POOL_SIZE and UNDO_TABLESPACE initialization parameters

O ly
should be generously sized. The exact values will depend upon the size of your database.
Turning off DB_BLOCK_CHECKING and DB_BLOCK_CHECKSUM only to improve Data

corruption.
l & On
Pump performance is not recommended because this will affect the detection of block

n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 33
Data Pump Access Path: Considerations

Data Pump automatically selects one of


the following access paths: Database
• Direct path
• External tables if data includes:
– Encrypted columns External Direct
tables path
– Clustered tables
– Different partition at unload and
load time
– Others Database

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Data Pump Direct Path: Considerations

e A
c l
Data Pump automatically selects the appropriate access method for each table.
Direct path: Data Pump uses direct path load and unload when a table’s structure allows it

r a
and when maximum single-stream performance is desired.

O ly
External tables: Data Pump uses external tables for any of the following conditions:
• Tables with fine-grained access control enabled in insert and select modes
& On
• Domain index for a LOB column
l
n a e
• Tables with active triggers defined
• Global index on partitioned tables with a single-partition load

t e r
• BFILE or opaque type columns

U s
• Referential integrity constraint

I n
• VARRAY columns with an embedded opaque type
Note: Because both methods support the same external data representation, data that is
l e
unloaded with one method can be loaded using the other method.
c
r a
O
Oracle Database 11g: Administration Workshop I 17 - 34
Using Enterprise Manager to Monitor
Data Pump Jobs

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Using Enterprise Manager to Monitor Data Pump Jobs

e A
c l
You can use the Enterprise Manager graphical user interface (GUI) to monitor all Data Pump
jobs, including those created by using the expdp or impdp command line interfaces or by
using the DBMS_DATAPUMP package.
r a
You can view the current status of the job and change the status to EXECUTE, STOP, or
SUSPEND. O ly
& On
To access the “Export and Import Jobs” page, click the “Monitor Export and Import Jobs” link
l
a e
in the Move Row Data region on the Maintenance page.

n
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 35
Data Dictionary

View information about external tables in:


• [DBA| ALL| USER]_EXTERNAL_TABLES
• [DBA| ALL| USER]_EXTERNAL_LOCATIONS
• [DBA| ALL| USER]_TABLES
• [DBA| ALL| USER]_TAB_COLUMNS

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Data Dictionary

e A
c l
The data dictionary views in the slide list the following table information:
[DBA| ALL| USER]_EXTERNAL_TABLES: Specific attributes of external tables in the
database
r a
O ly
[DBA| ALL| USER]_EXTERNAL_LOCATIONS: Data sources for external tables

l & On
[DBA| ALL| USER]_TABLES: Descriptions of the relational tables in the database
[DBA| ALL| USER]_TAB_COLUMNS: Descriptions of the columns of tables, views, and
clusters in the database
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 36
Summary

In this lesson, you should have learned how to:


• Describe ways to move data
• Create and use directory objects
• Use SQL*Loader to load data from a non-Oracle
database (or user files)
• Use external tables to move data via
platform-independent files
• Explain the general architecture of Oracle Data Pump
• Use Data Pump Export and Import to move data
between Oracle databases

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 37
Practice 17 Overview:
Moving Data

This practice covers the following topics:


• Using the Data Pump Export Wizard to select database
objects to be exported
• Monitoring a Data Pump Export job
• Using the Data Pump Import Wizard to import tables to
your database
• Using the Load Data Wizard to load data into your
database
• Loading data by using the command line

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 17 - 38
Enhancing Database Capabilities

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Objectives

After completing this lesson, you should be able to:


• Use the Enterprise Manager Support Workbench
• Work with Oracle Support
• Search MetaLink
• Log service requests (SR)
• Manage patches
– Apply a patch
– Stage a patch

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 2
Using the Support Workbench

View critical
1 error alerts in
Enterprise Manager.

7 Close incidents. 2 View problem


details.

Track the service Gather additional


6 request and 3 diagnostic
implement repairs. information.

Package and upload


4
Create a
diagnostic data service request.
to Oracle Support.
5
m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Using the Support Workbench

e A
c l
Using the Enterprise Manager Support Workbench, you can investigate, report, and (in some cases)
resolve a problem by performing the following general steps:

r a
1. On the Database Home page in Enterprise Manager, review critical error alerts. View the details
by selecting an alert.
O ly
2. Examine the problem details and view a list of all incidents that were recorded for the problem.

l & On
Display findings from any health checks that were automatically run.
3. (Optional) Run additional health checks and invoke the SQL Test Case Builder, which gathers
a e
all required data related to a SQL problem and packages the information in a way that enables
n
t e r s
the problem to be reproduced at Oracle Support.
4. Create a service request with MetaLink and (optionally) record the service request number with
U
I n
the problem information.
5. Invoke the Incident Packaging Service, which packages all gathered diagnostic data for a

l e
problem and (optionally) uploads the data to Oracle Support. You can edit the data to remove

c
sensitive information before uploading.

r a
6. You can maintain an activity log for the service request in the Support Workbench. Run Oracle
advisors to help repair SQL failures or corrupted data.

O 7. Set the status for one, some, or all incidents for the problem to be closed.

Oracle Database 11g: Administration Workshop I 18 - 3


Viewing Critical Error Alerts
in Enterprise Manager

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Viewing Critical Error Alerts in Enterprise Manager

e A
c l
You begin the process of investigating problems (critical errors) by reviewing critical error alerts on
the Database Home page. To view critical error alerts, access the Database Home page in Enterprise

r a
Manager. On the Home page, you can click the Active Incidents link in the Diagnostic Summary
section if there are incidents. You can also use the Alerts section and look for critical alerts that are
flagged as Incidents. O ly
& On
When you click the Active Incidents link, you access the Support Workbench page, where you can
l
n a e
retrieve details about all problems and corresponding incidents. From there, you can also retrieve all
Health Monitor checker findings and created packages.

t e r U s
Note: The tasks described in this section are all performed in Enterprise Manager. You can also
accomplish all of these tasks with the ADRCI command-line utility. See the Oracle Database

I n
Utilities guide for more information on the ADRCI utility.

c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 4
Viewing Problem Details

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Viewing Problem Details

e A
c l
From the Problems subpage on the Support Workbench page, click the ID of the problem that you
want to investigate. This takes you to the corresponding Problem Details page.

r a
On this page, you can see all incidents that are related to your problem. You can associate your

O ly
problem with a MetaLink service request and bug number. In the “Investigate and Resolve” section
of the page, you see a Self Service subpage that has direct links to the operations that you can
& On
perform for this problem. In the same section, the Oracle Support subpage has direct links to
l
MetaLink.

n a e
The Activity Log subpage shows you the system-generated operations that have occurred on your

problem.
t e r U s
problem so far. This subpage enables you to add your own comments while investigating the

I n
On the Incidents subpage, you can click a related incident ID to access the corresponding Incident
Details page.

c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 5
Viewing Incident Details:
Dump Files

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Viewing Incident Details: Dump Files

e A
c l
When you access the Incident Details page, the Dump Files subpage lists all corresponding dump
files. You can then click the eyeglass icon for a particular dump file to visualize the file content with
its various sections.
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 6
Viewing Incident Details:
Checker Findings

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Viewing Incident Details: Checker Findings

e A
c l
On the Incident Details page, click Checker Findings to view the Checker Findings subpage. This
page displays findings from any health checks that were automatically run when the critical error was

r a
detected. You will usually have the opportunity to select one or more findings and invoke an advisor
to fix the issue.
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 7
Creating a Service Request

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Creating a Service Request

e A
c l
Before you can package and upload diagnostic information for the problem to Oracle Support, you
must create a service request (SR). To create a service request, you first access Oracle MetaLink.

r a
MetaLink can be accessed directly from the Problem Details page when you click the “Go to
MetaLink” button in the “Investigate and Resolve” section of the page. Once on MetaLink, log in
O ly
and create a service request in the usual manner.

& On
When finished, you have the opportunity to enter that service request for your problem. This is
l
n a e
entirely optional and is for your reference only.
In the Summary section, click the Edit button that is adjacent to the SR# label. In the window that

t e r U s
opens, enter the SR# and then click OK.

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 8
Packaging and Uploading Diagnostic Data
to Oracle Support

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Packaging and Uploading Diagnostic Data to Oracle Support

e A
c l
The Support Workbench provides two methods for creating and uploading an incident package: the
Quick Packaging method and the Advanced Packaging method. The example in the slide shows how
to use Quick Packaging.
r a
O ly
Quick Packaging is a more automated method with a minimum of steps. You select a single problem,
provide an incident package name and description, and then schedule the incident package upload,
& On
either immediately or at a specified date and time. The Support Workbench automatically places
l
n a e
diagnostic data related to the problem into the incident package, finalizes the incident package,
creates the ZIP file, and then uploads the file. With this method, you do not have the opportunity to

t e r U s
add, edit, or remove incident package files or add other diagnostic data such as SQL test cases.
To package and upload diagnostic data to Oracle Support:

I n
1. On the Problem Details page, in the Investigate and Resolve section, click Quick Package.
The Create New Package page of the Quick Packaging wizard appears.

l e
2. Enter a package name and description.
c
3. Enter the service request number to identify your problem.

r a
4. Click Next, and then proceed with the remaining pages of the Quick Packaging Wizard. Click

O Submit on the Review page to upload the package.

Oracle Database 11g: Administration Workshop I 18 - 9


Tracking the Service Request
and Implementing Repairs

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Tracking the Service Request and Implementing Repairs

e A
c l
After uploading diagnostic information to Oracle Support, you can perform various activities to track
the service request and implement repairs. Among these activities are the following:

r a
• Add an Oracle bug number to the problem information. On the Problem Details page, click the
Edit button that is adjacent to the Bug# label. This is for your reference only.
O ly
• Add comments to the problem activity log:

l & On
1. Access the Problem Details page for the problem.
2. Click Activity Log to display the Activity Log subpage.
a e
3. In the Comment field, enter a comment and then click Add Comment.
n
t e r s
Your comment is recorded in the activity log.
• Respond to a request by Oracle Support to provide additional diagnostics. Your Oracle Support
U
n
representative can provide instructions for gathering and uploading additional diagnostics.
I
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 10
Tracking the Service Request
and Implementing Repairs

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Tracking the Service Request and Implementing Repairs (continued)

e A
c l
From the Incident Details page, you can run an Oracle advisor to implement repairs. Access the
suggested advisor in one of the following places:

r a
• On the Self-Service tab of the “Investigate and Resolve” section of the Problem Details page
• On the Checker Findings subpage of the Incident Details page (as shown in the slide)
O ly
The advisors that help you repair critical errors are:
& On
• Data Recovery Advisor: Corrupted blocks, corrupted or missing files, and other data failures
l
a e
• SQL Repair Advisor: SQL statement failures

n
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 11
Closing Incidents and Problems

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Closing Incidents and Problems

e A
c l
When a particular incident is no longer of interest, you can close it. By default, closed incidents are
not displayed on the Problem Details page. All incidents, whether closed or not, are purged after 30

r a
days. You can disable purging for an incident on the Incident Details page.
To close incidents:
O ly
1. Access the Support Workbench home page.
& On
2. Select the desired problem, and then click View.
l
n a e
The Problem Details page appears.
3. Select the incidents to close, and then click Close.

t e r
A confirmation page appears.

U s
4. Click Yes on the Confirmation page to close your incident.

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 12
Incident Packaging Configuration

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Incident Packaging Configuration

e A
c l
You can configure retention rules and packaging generation. Access the Incident Packaging
configuration page from the Related Links section of the Support Workbench page by clicking the

r a
Incident Package Configuration link. Here are the parameters you can change:
• Incident Metadata Retention Period: Metadata is information about the data. For incidents, it
O ly
includes the incident time, ID, size, and problem. Data is the actual content of an incident (such
as traces).
l & On
• Cutoff Age for Incident Inclusion: This value includes incidents for packaging that are in the
a e
range to now. When you set the cutoff date to 90, the system includes only those incidents that
n
t e r
are within the last 90 days.
s
• Leading Incidents Count and Trailing Incidents Count: For every problem included in a
U
I n
package, the system selects a certain number of incidents from the problem from the beginning
(leading) and the end (trailing). For example, if the problem has 30 incidents and the leading

l e
incident count is 5 and the trailing incident count is 4, the system includes the first 5 incidents

c
and the last 4 incidents.

r a
• Correlation Time Proximity: This parameter is the time interval that defines “happened at the
same time.” Correlating incidents (or problems) with certain other incidents or problems helps

O you answer the question “Which problems seem to have a connection with each other?” One
criterion for correlation is time correlation: Find the incidents that happened at the same time as
the incidents in a certain problem.
Oracle Database 11g: Administration Workshop I 18 - 13
Working with Oracle Support

• Oracle Support Services (OSS) provides 24 × 7 solution


support.
• Support is delivered in the following ways:
– MetaLink Web site
– Telephone
– Oracle Direct Connect (ODC) remote diagnostic tool
• The Customer Support Identifier (CSI) number is used
to track the software and support that are licensed to
each customer.

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Working with Oracle Support

e A
c l
Oracle Support Services (OSS) provides 24 × 7 solution support to all Oracle customers throughout
the world. OSS has support centers around the globe to provide this coverage whenever it is required,
365 days a year.
r a
O ly
Support is delivered to Oracle customers through the MetaLink Web site, on the telephone, and by
using the Oracle Direct Connect (ODC) remote diagnostic tool.

l & On
After purchasing Oracle software, customers are provided with a Customer Support Identifier (CSI)

n a e
number. This number is used to track the software and support licensed to each customer. The CSI
number provides access to all the available patches, documentation, and troubleshooting information

t e r U s
on MetaLink. The CSI number enables customers to log a service request (SR) with OSS.
Note: Service requests were formerly called technical assistance requests (TARs).

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 14
MetaLink Integration

• Enterprise Manager automatically alerts users to new


critical patches.
• The Enterprise Manager patch wizard can be used to
select an interim patch.
• You can review the patch’s README file from within
Enterprise Manager.
• You can download the selected patches from MetaLink
into the Enterprise Manager patch cache.

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
MetaLink Integration

e A
c l
Oracle Enterprise Manager (Enterprise Manager) significantly facilitates software patching with its
built-in MetaLink integration. Enterprise Manager automatically alerts users to new critical patches

r a
and flags all systems that require a specific patch. You can invoke the Enterprise Manager patch
wizard to determine what interim patches are available for installation. Alternatively, you can use the
O ly
patch wizard to select an interim patch and determine whether any of your systems require that patch.

Manager.
l & On
You can review the patch details and README patch notes directly from within Enterprise

n a e
You can use the Enterprise Manager patch wizard to download interim patches from MetaLink into

t e r U s
the Enterprise Manager patch cache, eliminating the need for repeated downloads. You can stage
appropriate patches on the destination system or systems for manual application at a later time. To

I n
further automate the patching process, you can also provide a customizable patch application script
that is executed on the destination system at a user-defined time by the resident Enterprise Manager

l e
agents. As patches are applied to a system, the corresponding Oracle Universal Installer (OUI)

c
inventory is automatically updated to keep track of the systems’ correct patch level.

r a
Click Patch in the Deployments region of the Maintenance page to access the patch wizard.

O
Oracle Database 11g: Administration Workshop I 18 - 15
Using MetaLink

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Using MetaLink

e A
c l
To register for MetaLink, go to http://MetaLink.oracle.com/ and select First Time User. At the
prompt, enter your CSI number and answer a few basic questions. After registering, you are ready to

r a
use MetaLink. Note that each CSI number has an administrator designated by the customer who
controls new-user access to MetaLink. Customers must designate this individual, and then new users
O ly
must work with this individual to create new accounts and grant appropriate MetaLink access.

& On
MetaLink has a variety of tools and methods available for researching problems.
l
n a e
Searching for answers on MetaLink through the standard and advanced search engines is relatively
straightforward. A common problem is that too many results are returned. The following are some

t e r U s
simple steps that can improve the quality and relevance of search results:
• Use full and exact error text when performing your search. For example, ORA-1400:

I n
mandatory (NOT NULL) column returns more relevant answers than ORA-1400.
• When researching errors in Oracle E-Business Suite, enter the name of the code as part of the

l e
search criteria. For example, APXINWKB ORA-1400: mandatory (NOT NULL)
c
column returns fewer and better results than if you supply only the error message.

r a
O
Oracle Database 11g: Administration Workshop I 18 - 16
Using MetaLink (continued)
You can use the Knowledge tab if you prefer a drill-down method of searching for information
rather than searching by keyword. The Knowledge tab provides easy-to-use access to OSS’s
most frequently used technical content.
The following information is available on the Knowledge tab pages:
• User documentation
• Electronic technical reference manuals (eTRMs)
• Frequently asked questions (FAQs)
• Listing of educational offerings
• Self-service toolkits (SSTK)
• Business flows
• Resolution flows
MetaLink Forums (Forums) enable you to interact with other Oracle customers to share ideas
and discuss Oracle products. You can use MetaLink Forums to find out how other customers
perform complex tasks or meet various business requirements with Oracle products. You should
not use Forums as a substitute for logging an SR.
Customers can use the patch engine to search for patches by using a variety of methods. The
following are the most common patch searches:
• Patch Number: If you know the patch number, you can enter it.
• Latest Consolidated Patch: You can use this when upgrading to determine the latest
patches for the products you are using.

m
• Includes File: When a problem is encountered in a specific piece of code, a patch is often y
d e
available to fix the issue. For this reason, support representatives often recommend that
customers apply a patch to update code to the most current version available for the release.

c a
You can find and apply the latest versions of Oracle software by identifying the name and
version of the code and then using the patch search utility to find out whether a more current
version of the code is available.

e A
c l
Note: For detailed information about performing these searches, refer to MetaLink Technical
Note 166650.1 (“Working Effectively with Global Customer Support”).

r a
You can use the BUGs link to search the BUG database when researching issues. A variety of

O ly
methods are available for searching the BUG database.

l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 17
Researching an Issue

To research an issue on Oracle MetaLink, perform the


following steps:
1. Perform a keyword search.
2. Review the documentation.
3. Use the self-service toolkits.
4. Use the automated diagnostic tests and business
flows.
5. Search for applicable patches.
6. Log a service request (SR).

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Researching an Issue

e A
c l
Oracle MetaLink provides several resources that can be used to research an issue. The following
steps outline basic troubleshooting techniques that use MetaLink resources:

r a
1. Keyword search: Most issues can be resolved quickly and easily by using the keyword search
utility on MetaLink. Effective searches can provide much information about a specific problem
and its solutions. O ly
l & On
2. Documentation: If keyword searching fails to yield a solution, you should review the
documentation to ensure that setup problems are not the root cause. Setup issues account for
a e
more than one-third of all service requests; it is always good to review setups early in the
n
t e r s
troubleshooting process. Documentation consists of user guides and implementation manuals
published in PDF format as well as product README files and installation notes published in
U
I n
HTML. Both of these document types are available on MetaLink and can be accessed through
the self-service toolkits for each product.

c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 18
Researching an Issue (continued)
3. Self-service toolkits: Self-service toolkits (SSTKs) provide a wealth of information about
each product. In most cases, they contain FAQs, patch listings, and other helpful
information that can assist you in researching and troubleshooting the issues that you are
facing. Because SSTKs contain the most frequently used content about each product, you
should reference them periodically to identify known issues before they cause problems
within your environment.
4. Diagnostics and flows: Many recent innovations in Oracle Support Services have been in
the area of automated diagnostic tests and business flows. Tests and flows have been created
for you to check the setup of your system or gather information about a problem. In the case
of diagnostic tests, this can be done by running a Java or SQL script. The output of these
tests can help you in resolving issues and can also help Oracle Support Services identify the
cause of your problem if it becomes necessary to log a service request.
5. Patches and BUGs: There are times when BUGs are found in Oracle products, and patches
are required to correct the problem. When troubleshooting a problem, you should review
your system to see whether patches are available to provide you with a more recent release
of the product. With the patch search tool, you can search for patches that contain specific
files. Searching for the latest code and patching your environment to the most recent version
improves the troubleshooting process by eliminating existing BUGs that could be possible
candidates for the problem. You should also leverage the BUG search engine to see whether
a BUG has been logged for your issue but not yet fixed.
6. Logging a service request (SR): When all self-service options fail, it may become
necessary to engage a support representative to assist in resolving your issue.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 19
Logging Service Requests

• Log an SR by clicking the Service Request tab on the


MetaLink home page.
• MetaLink performs searches based on the CSI number
and SR profile.
• Provide the following information when logging an SR:
– Explanation of the issue, including error messages
– Steps taken to troubleshoot the issue
– Software version
– Steps required to reproduce the problem
– Business impact of the issue

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Logging Service Requests

e A
c l
You may research an issue on MetaLink, but may be unable to locate a solution. In this case, you
should log a service request (SR) through MetaLink. You can log an SR by clicking the Service
Request tab on the MetaLink home page.
r a
O ly
The first step in creating an SR is the selection of a CSI number and SR profile. After the required
profile information has been submitted, MetaLink gathers some specifics about the problem,
& On
including the problem type, error message, brief summary of the issue, and language preference.
l
n a e
MetaLink performs a search by using this information and attempts to find a solution.
The search conducted during this phase may provide different results than the searches you have

t e r U s
performed earlier. Both searches retrieve notes and BUGs from the same database; however, the
search engines and weighting are slightly different. Because the search results can differ, it is

I n
important that the search results are reviewed during the SR creation process, even if previous
searches have been conducted by using the MetaLink search engine.

c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 20
Logging Service Requests (continued)
If the search results fail to resolve the issue, the SR creation process continues with a series of
questions and requests for information. After the questions are answered, the SR is submitted
electronically and routed to a support representative who analyzes the issue further. Any files,
screenshots, or other additional information must be uploaded immediately after the SR is logged
by using the upload utility provided in the SR section of MetaLink.
You must ensure that the following items are clearly documented in the SR. By providing the
following information, you can equip the support representative effectively to prioritize and
work on the issue:
• Clear explanation of the problem, including exact error messages
• Explanation of the steps taken to troubleshoot the problem and the findings
• Exact versions of the software
• Steps required to reproduce the problem
• Business impact of this issue, including milestones, dates, and costs
Each SR is assigned a unique identifier called the SR number. When you log an SR, MetaLink
provides you with the SR number (or your support representative advises you about the SR
number if you log the SR by telephone). The support representative subsequently receives the SR
in his or her queue through an automated allocation process that Oracle Support Services uses to
distribute all phone and Web-sourced service requests. This automated process ensures that all
SRs are assigned to the support representative who is best able to work on the specific issue that
is being reported.
Note: For more information, refer to MetaLink Technical Note 166650.1 (“Working Effectively
m y
with Global Customer Support”).

d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 21
Managing Patches

Kinds of patches
• Interim patches
– For specific issues
– No regression testing
• CPUs (Critical Patch Updates)
– Critical security issues
– Regression testing
– Does not advance version number
• Patch releases

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Managing Patches

e A
c l
You can apply different kinds of patches at different times for different reasons.
• Interim patches (also known as one-off or one-of patches) are created to solve a specific

r a
problem. They do not go through a full regression test. Interim patches are typically installed
with the opatch utility. The Enterprise Manager Patching Wizard can help automate the
O ly
patching process by downloading, applying, and staging the patches. This wizard uses the

l & On
opatch utility in the background.
• CPU patches (Critical Patch Update patches) include security patches and dependent non-
a e
security patches. The CPU patches are cumulative, which means fixes from previous Oracle
n
t e r s
security alerts and critical patch updates are included. It is not required to have previous security
patches applied before applying the CPU patches. However, you must be on the stated patch set
U
I n
level. CPU patches are for a specific patch release level (such as 10.2.0.3). CPU patches are
installed with the opatch utility or through EM Patching Wizard. The CPU patches are issued

l e
quarterly. CPU patches and interim patches can also be removed from your system with

c
opatch rollback -id <patch id>.

r aOracle does extensive testing of Critical Patch Updates with our own applications, as well as
running regression tests for the Critical Patch Updates themselves. To verify that a patch has

O been applied, query the inventory with opatch -lsinventory and see if the patch is
listed.

Oracle Database 11g: Administration Workshop I 18 - 22


Applying a Patch Release

• Patch releases are fully tested product fixes that:


– Do not include new functionality
– Affect only the software residing in your Oracle home on
installation
– Contain individual bug fixes
– Carry version numbers
• To apply a patch:
1. Determine your Oracle software environment.
2. Set your Oracle MetaLink login credentials.
3. Stage the patch release.

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Applying a Patch Release

e A
c l
Software management involves keeping your Oracle software up-to-date with the latest product
fixes. Periodically, Oracle issues patch releases (product fixes) for its software. Patch releases are

r a
fully tested product fixes only; they do not include new functionality. Application of a patch release
affects only the software residing in your Oracle home, with no upgrade or change to the database.
O ly
Patches are individual bug fixes. Patch sets are a collection of bug fixes up to the time of the patch
& On
set release. All patch and patch set releases carry version numbers. For example, if you bought
l
n a e
Oracle Database 11g Release 11.1.0.2, an available patch set is 11.1.0.3. Every patch or patch set
also has a patch number to identify it. Every patch release has an associated README file that

t e r U s
describes its bug fixes. The README also has instructions for manually applying the patch.
Enterprise Manager enables you to find the latest patch release on the Oracle MetaLink Web site and

I n
download it to your Oracle home.

c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 23
Using the Patch Advisor

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Using the Patch Advisor

e A
c l
The Patch Advisor shows you Critical Patch Updates and recommended patches for your system. The
recommendation can be based on features usage, or you can display all available patches. The Patch

r a
Setup must be configured, and the RefreshFromMetalink job must run before the patches are
visible.
O ly
Click Patch Setup in the Related links section of the Patch Advisor page to navigate to the Patch
Setup page.
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 24
Using the Patch Wizard

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Using the Patch Wizard

e A
Support” page, the Patch Wizard is invoked.
c l
When you click Apply Patch in the Database Software Patching section of the “Software and

r a
The first step is Select Patches. Click Add Patch to select more patches to apply in this scheduled
run.
O ly
l & On
The Target List step is reserved for patching RAC and is skipped in Oracle Database 11g Release 1.
The Library Step Properties are skipped unless the customer has customized the deployment

a e
procedures with custom variables. In the latter case, the Library Step properties are not skipped, and
n
t e r
the user enters values for the custom variable.
s
In the next step, you provide the credentials for running the patch job and for determining if the job
U
I n
should run immediately or at a later time.
You then review the job and submit it.

c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 25
Applying a Patch

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Applying a Patch

e A
l
You can find and apply a patch, CPU, or patch release by using the “Software and Support” page.
c
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 26
Staging a Patch

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Staging a Patch

e A
Support” page, the Patch Wizard is invoked.
c l
When you click Stage Patch in the Database Software Patching section of the “Software and

r a
The first step is to select the patch either by number or by criteria.

O ly
You then select the destination. In this step, you can choose from a list of available targets.

l & On
In the third step, provide the credentials of the OS user that is to do the patching, It is recommended
that this be the user that owns the software installation.

a e
In the next step, you can choose either to stage the patch or to stage and apply the patch.
n
t e r
The fifth step schedules the job.

U s
The final step enables you to review and submit the patch job.

I n
The staged patches are stored in the $ORACLE_HOME/EMStagedPatches_<sid> directory on

l e
UNIX and Linux platforms, and in the %ORACLE_HOME%\EMStagedPatches_<sid>
directory on Windows platforms.
c
r a
O
Oracle Database 11g: Administration Workshop I 18 - 27
Summary

In this lesson, you should have learned how to:


• Use the Support Workbench
• Work with Oracle Support
• Search MetaLink
• Log service requests
• Manage patches
– Apply a patch release
– Stage a patch release

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 28
Practice 18 Overview:
Using EM Tools for Alerts and Patches

This practice covers the following topics:


• Using the Support Workbench to investigate a critical
error
• Staging a patch to be applied later

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I 18 - 29
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Appendix A
Practices and Solutions

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Table of Contents
Practices for Lesson 1 ......................................................................................................... 3
Practice 1-1: Exploring the Oracle Database Architecture ............................................. 4
Practices for Lesson 2 ......................................................................................................... 7
Practice 2-1: Installing the Oracle Database Software ................................................... 8
Practices for Lesson 3 ....................................................................................................... 12
Practice 3-1: Creating an Oracle Database ................................................................... 13
Practices for Lesson 4 ....................................................................................................... 19
Practice 4-1: Managing the Oracle Instance ................................................................. 20
Practices for Lesson 5 ....................................................................................................... 25
Practice 5-1: Configuring the Oracle Network Environment ....................................... 26
Practices for Lesson 6 ....................................................................................................... 32
Practice 6-1: Managing Database Storage Structures................................................... 33
Practices for Lesson 7 ....................................................................................................... 38
Practice 7-1: Administering User Security ................................................................... 39
Practices for Lesson 8 ....................................................................................................... 45
Practice 8-1: Managing Schema Objects ...................................................................... 46
Practices for Lesson 9 ....................................................................................................... 55
Practice 9-1: Managing Data and Concurrency ............................................................ 56
Practices for Lesson 10 ..................................................................................................... 59
Practice 10-1: Managing Undo Data............................................................................. 60
m
Practices for Lesson 11 ..................................................................................................... 64
y
Practice 11-1: Implementing Database Security........................................................... 65
d e
Practices for Lesson 12 ..................................................................................................... 68

c a
Practice 12-1: Database Maintenance........................................................................... 69
Practices for Lesson 13 ..................................................................................................... 75
A
Practice 13-1: Managing Performance.......................................................................... 76
e
c l
Practices for Lesson 14 ..................................................................................................... 82
Practice 14-1: Configuring Your Database for Recovery............................................. 83

r a
Practices for Lesson 15 ..................................................................................................... 90
Practice 15-1: Performing Database Backups............................................................... 91
O ly
Practices for Lesson 16 ..................................................................................................... 98

l & On
Practice 16-1: Performing Database Recovery ............................................................. 99
Practices for Lesson 17 ................................................................................................... 114

n a e
Practice 17-1: Moving Data ........................................................................................ 115
Practices for Lesson 18 ................................................................................................... 119

t e r U s
Practice 18-1: Investigating a Critical Error ............................................................... 120
Practice 18-2: Staging a Patch .................................................................................... 124

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 2
Practices for Lesson 1
Background: In this practice, you review concepts about Oracle architecture components
and answer questions to test your knowledge of the concepts learned in the lesson.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 3
Practice 1-1: Exploring the Oracle Database Architecture
Fill in the blanks with the correct answers.

1) The two main Components of an Oracle RDBMS are:


_________________________ and _______________________

2) The Instance consists of _____________________and


_____________________processes.

3) A session is a connection between the _______________process and the


______________process.

4) Name the components of the SGA


• ___________________________
• ___________________________
• ___________________________
• ___________________________
m y
• ___________________________
d e


___________________________
____________________________ c a
e A
5) The main background processes are:
c l

r
___________________________
a

O ly
___________________________

• l & On
___________________________
___________________________

n a e
___________________________

t e r U s
___________________________

I n
c l e
6) The _______________________process writes the dirty buffers to the data files.

r a
7) The _______________________process writes the redo logs to the log files.

O
Oracle Database 11g: Administration Workshop I A - 4
Practice 1-1: Exploring the Oracle Database Architecture
(continued)
8) A Checkpoint happens when ________________________________________.
9) The primary files associated with an Oracle database are:
• ___________________________
• ___________________________
• ___________________________
• ___________________________
• ___________________________
• ___________________________
• ____________________________

10) The logical storage structures of an Oracle database are:


• ___________________________
• ___________________________


___________________________
___________________________
m y
• ___________________________
d e


___________________________
____________________________ ca
e A
c l
11) The ___________________process copies the redo log files to an archive destination.

r a
O ly
12) The _____________________ contains data and control information for a server or
background process.

l & On
a e
13) The logical tablespace structure is associated with the physical
n
t e r U s
____________________files on disk.

I n
14) LGWR writes when:

•c l e
___________________________
___________________________

r a• ___________________________
O • ____________________________

Oracle Database 11g: Administration Workshop I A - 5


Practice 1-1: Exploring the Oracle Database Architecture
(continued)
15) State whether the following statements are true or false.
a) The SGA includes the Database buffer cache and Redo log buffer. ____
b) Each server process and background process has its own PGA. ____
c) The buffers in the database buffer cache are organized in two lists: the most
recently used list and the least recently used (LRU) list. ____
d) User processes run the application or Oracle tool code. ____
e) Oracle Database processes include server processes and background processes.
____
f) Checkpoints are recorded in log file headers. ___

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 6
Practices for Lesson 2
Background: In the practices of this course, you assume the role of a database
administrator (DBA). The operating system (OS) accounts on your computer are:
• The oracle user with a password of oracle
• The root user with a password of oracle
The system administrator has set up the OS so that it is ready for the installation, and the
installation media is staged at /stage/db11g/db/Disk1. Perform the following
tasks as the default oracle OS user, unless otherwise indicated.
Note: Completing this practice is critical for all following practice sessions.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 7
Practice 2-1: Installing the Oracle Database Software
1) Install the Oracle database software as the oracle user. Navigate to the
/stage/db11g/db/Disk1 directory, and start the Oracle Universal Installer
(OUI) by entering ./runInstaller.
a) Double-click the XTerm icon on your desktop, and then enter:
$ cd /stage/db11g/db/Disk1
$ ./runInstaller

2) Select your installation method for OUI.


a) On the Select a Product page select Oracle Database 11g. On the Installation
Method page, select Basic Installation, and confirm the following settings:
Object Setting
Database Home Location /u01/app/oracle/product/11.1.0/db_1
Installation Type Enterprise Edition
UNIX DBA Group DBA
Create Starter Database Deselected

Note: Ensure that you deselect the Create Starter Database option.
b) Click Next.
c) You are now on the page titled “Specify Inventory directory and credentials.”
m y
Accept /u01/app/oracle/oraInventory as inventory directory and
oinstall as Operating System group name. Click Next.
d e
c a
OUI is loading the products list and checking product-specific prerequisites.

e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 8
Practice 2-1: Installing the Oracle Database Software (continued)

m y
d e
Prerequisite Checks” page, click Next.
c a
d) After OUI has finished its prerequisite checks on the “Product-Specific

A
3) When the prerequisite checks are finished, the Summary page is displayed.

e
l
a) Click Install to begin your installation.
c
r a
Estimated installation time is 10–15 minutes. However, varying environments can
greatly influence this estimate.

O ly
4) When the “Execute Configuration scripts” page appears, follow the instructions on

installation with OUI.


l & On
that page, accept the default for the local bin directory, and then finish your

n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 9
Practice 2-1: Installing the Oracle Database Software (continued)

a) Double-click the XTerm icon on your desktop.


m y
d
b) Run the orainstRoot.sh and root.sh scripts as root, and then click e
Continue.
c a
$ su
A
# password: oracle <root password, does not appear on the

e
screen>
# cd /u01/app/oracle/oraInventory
c l
# ./orainstRoot.sh

r a
# cd /u01/app/oracle/product/11.1.0/db_1
# ./root.sh
O ly
& On
c) Accept the default for the local bin directory.

l
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 10
Practice 2-1: Installing the Oracle Database Software (continued)

d) Enter exit to exit the root OS user.


e) Close the XTerm window, and then click OK on the “Execute Configuration
scripts” page.
The End of Installation page appears.
f) Click Exit, and then click Yes to leave OUI.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 11
Practices for Lesson 3
Background: You are about to begin creating your first Oracle database. You anticipate
that several similar databases will be needed in the near future. Therefore, you decide to
create your ORCL database, as well as a database template and the database creation
scripts. Locate the scripts in the /home/oracle/labs directory (which is the
directory that you use most often throughout this course).

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 12
Practice 3-1: Creating an Oracle Database
1) Execute the command netca at the command prompt. Accept the defaults for
listener name, protocol, and port to create a listener. Now you are ready to create the
database.

$ netca

Note: You can also use lab_02_05.sh script, which is in the


/home/oracle/labs directory. This script uses the netca utility in silent mode to
create a listener for you.
Note: Completing the database creation is critical for all following practice sessions.

2) Start the Database Configuration Assistant (DBCA).


a) Open a terminal window as the oracle user; that is, double-click the XTerm
icon on your desktop.
b) To start the DBCA, enter:
$ dbca

3) Begin the ORCL database creation. Use the General Purpose database template.
m y
a) In the DBCA, click Next on the Welcome page.
b) On the Operations page, select Create a Database, and then click Next.
d e
c a
c) On the Database Templates page, select General Purpose, and then click Show
Details.

e A
d) Review the template’s details and answer the following questions.

c l
Question 1: How many control files are created?
Answer: Three
r a
O ly
Question 2: Would it maximize database availability to multiplex them?

& On
Answer: Yes. (This will be done in a later practice.)

l
Answer: Three
n a e
Question 3: How many redo log groups are created?

t e r U s
Question 4: Would it maximize database availability to mirror them?

I n
Answer: It depends. No, it would not maximize database availability in class because
there are already three groups and you have only one physical storage device. But

l e
yes, it would maximize database availability if you could put each group on a
c
different physical storage device.

r aQuestion 5: What is the database block size (db_block_size)?


O Answer: 8 KB

Oracle Database 11g: Administration Workshop I A - 13


Practice 3-1: Creating an Oracle Database (continued)

Question 6: What is the value of Sample Schemas?


Answer: Sample Schemas is set to False.
Note: You will change this setting later in this practice to create the HR sample
schema.

Question 7: What is the template default for the Database Character Set?
Answer: WE8ISO8859P1
Note: You will change this setting later in this practice to use a Unicode database
character set.
e) Click Close to close the Template Details window.
f) Click Next.
4) Create the ORCL database, as well as the ORCL template and the database generation
scripts.
a) On the Database Identification page, enter orcl.oracle.com as Global Database
Name. The SID defaults to the database name orcl. Click Next.
b) On the Management Options page, ensure that the following items are selected:
- Configure Enterprise Manager
- Configure Database Control for local Management
c) Click Next.
m y
d) On the Database Credentials page, select Use the Same Password for All
d e
c
e) On the Storage Options page, select File System, and then click Next. a
Accounts and enter oracle as Password and Confirm Password. Then click Next.

A
f) On the Database File Locations page, select Use Database file location from

e
c l
template. Make a note of the file location variables. Click Next.
g) On the Recovery Configuration page, select Specify Flash Recovery Area, and
then click Next.
r a
O ly
h) On the Database Content page, select Sample Schemas, and then click Next.

l & On
i) On the Memory tabbed page of the Initialization Parameters page, select Custom
and set the value for SGA size as 404 M and PGA size as 150 M and then select

a e
Automatic Shared Memory Management for the Memory Management field.
n
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 14
Practice 3-1: Creating an Oracle Database (continued)

j) On the “ Character Sets” tabbed page, select Use Unicode (AL32UTF8).

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
k) Review the Sizing and Connection Mode tabbed pages, but do not change any
values. Then click Next.

c l e
l) On the security page, accept the 11g security settings and click Next.

Ora m) On the automatic Maintenance tasks page, select Enable Automatic


maintenance tasks and then click Next

Oracle Database 11g: Administration Workshop I A - 15


Practice 3-1: Creating an Oracle Database (continued)
n) On the Database Storage page, review your file names and locations. Then click
Next.
o) On the Creation Options page, select Create Database.

m y
d e
p) Optionally, select all creation options and enter orcl as the Name for the

c
database template, ORCL Database template as the Description, and a
e A
/home/oracle/labs as the Destination Directory. Then click Finish.
q) The Confirmation page appears. Review options and parameters, such as Sample

c l
Schemas (true), db_block_size (8KB), sga_target (404MB),

r a
undo_management (AUTO), Database Character Set
(AL32UTF8), and then click OK.

O ly
r) Click OK to acknowledge that the template has been created. Then acknowledge

& On
the generation of the database scripts (if you selected those options).

l
n a e
s) The DBCA displays the progress of the various installation steps. When the
database itself has been created, the DBCA displays essential information about

t e r U s
the database. Make note of this information. The Database Control URL will be
used in several of the following practice sessions.

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 16
Practice 3-1: Creating an Oracle Database (continued)

t) Click the Password Management button.


m y
e
u) Scroll down the Password Management page until you see the HR username.
d
Password. Then click OK.
c a
v) Deselect Lock Account? and enter hr as the New Password and Confirm

e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 17
Practice 3-1: Creating an Oracle Database (continued)

w) Click Exit to close the DBCA.


m y
and database generation scripts.
d e
You completed your task to create a database and (optionally) a database template

c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 18
Practices for Lesson 4
Background: You have just installed the Oracle software and created a database. You
want to ensure that you can start and stop the database and see the application data.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 19
Practice 4-1: Managing the Oracle Instance
1) Invoke Enterprise Manager, and log in as the SYS user. Which port number does this
database use? You noted this in Practice 3.
Answer: 1158
a) Double-click the Web Browser icon on your desktop to open your Web browser
as the oracle user.
b) Your Web browser opens a window.
c) Enter the URL that you wrote down in Practice 3. It has the following format:
https://hostname:portnumber/em
The Oracle Enterprise Manager window appears.
d) Log in by entering sys as User Name and oracle as Password, and selecting
SYSDBA as Connect As. Then click Login.

m y
d e
c a
e) You may receive a security warning. In class, deselect Alert me whenever I

e A
submit information that’s not encrypted, and then click Continue.
2) View the initialization parameters and set the JOB_QUEUE_PROCESSES parameter

c l
to 15. What SQL statement is run to do this?

r a
a) Select Server > Initialization Parameters.

O ly
l & On
n a e
t e r U s
I n
b) Enter job in the Name field, and then click Go.

c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 20
Practice 4-1: Managing the Oracle Instance (continued)

c) When the JOB_QUEUE_PROCESSES initialization parameter appears, change its


value to 15.
d) Click Show SQL and note the SQL statement that is going to be run next.

e) Click Return, and then click Apply.


3) Question: What is the significance of a check in the Dynamic column?
Answer: A “dynamic” parameter can be modified while the database is active.
4) Shut down the database instance by using Enterprise Manager.
Question: What SQL is executed to do this?
m y
a) In the Enterprise Manager browser session, click the Database tab.
d e
b) Click Shutdown.
c a
e
d) Click OK. The “Startup/Shutdown: Confirmation” page appears.A
c) For Host Credentials, enter oracle as Username and oracle as Password.

c l
e) Click Advanced Options to see the mode for shutting down, but do not change

a
the mode; it should remain as “Immediate.”
r
O ly
f) Click Cancel to return to the previous page.
g) Click Show SQL to view the SQL that is going to be executed to perform the
shutdown operation.
l & On
a e
Question: What SQL is executed to do this?
n
t e r U s
Answer: SHUTDOWN IMMEDIATE

I n
c l e
r ah) Click Return.
O i) Click Yes to confirm the shutdown operation.

Oracle Database 11g: Administration Workshop I A - 21


Practice 4-1: Managing the Oracle Instance (continued)
j) Click Refresh. If you see an error during the refresh, click OK and continue to
refresh. The error will resolve itself.
k) Note that the Status of the instance is now “Down.”

5) Using SQL*Plus, verify that you are not able to connect as the HR user to a database
that has been shut down.
a) In the Linux command window, enter the following to attempt to log in to the
database:
$ sqlplus hr

b) Enter hr for the password.


c) Note the “ORACLE not available” error message.
d) Press [Ctrl], [D] to exit the username prompt.
m y
d e
6) Use Enterprise Manager to restart the database instance, and then log in as the SYS
user again.
Question: What SQL is run to accomplish the database startup? c a
a) In Enterprise Manager, click the Startup button.
e A
c l
b) Enter oracle for both Username and Password in the Host Credentials
region.
c) Click OK. r a
O ly
d) The “Startup/Shutdown: Confirmation” page appears. Click Show SQL to view
& On
the SQL that is about to run.
l
a e
Question: What SQL is run to accomplish the database startup?

n
Answer: STARTUP

t e r U s
I n
c l e
r ae) Click Return.
O f) Click Yes to confirm the startup operation.

Oracle Database 11g: Administration Workshop I A - 22


Practice 4-1: Managing the Oracle Instance (continued)
g) The “Startup/Shutdown: Activity Information” page appears. Wait for the login
page to appear, at which time you can log in as SYS user with the oracle
password and the SYSDBA privilege.
7) In the alert log, view the phases that the database went through during startup. What
are they?
a) Select Database > Related Links > Alert Log Content. Click Go.
b) Scroll toward the bottom of the log and review the phases of the database during
startup. Your alert log may look different from this screenshot, based on different
system activities.

m y
d e
c a
e A
c l
r a
c) Note that the modes that the database goes through during startup are MOUNT and
OPEN.
O ly
l & On
d) Locate and view the text version of the alert log.
Connect to the database with SQL*Plus or another query tool, such as SQL
a e
Developer. Query the V$DIAG_INFO view. To view the text-only alert log
n
t e r s
without the XML tags, complete these steps: In the V$DIAG_INFO query results,
note the path that corresponds to the Diag Trace entry, and change directory to
U
that path.
I n
e) Open file alert_orcl.log with a text editor.

c l e
Note: The file will be named alert_<sid>.log in other databases, where
<sid> is the instance name.

r af) Try to locate the entries for the shutdown and startup performed earlier in the

O practice.

Oracle Database 11g: Administration Workshop I A - 23


Practice 4-1: Managing the Oracle Instance (continued)

8) Connect to the database using SQL*Plus as sysdba.


$ sqlplus / as sysdba

9) Use the SHOW PARAMETER command to verify the settings for SGA_TARGET,
PGA_AGGREGATE_TARGET, DB_CACHE_SIZE, and SHARED_POOL_SIZE.

SQL> SHOW PARAMETER SGA_TARGET


SQL> SHOW PARAMETER PGA_AGGREGATE_TARGET
SQL> SHOW PARAMETER DB_CACHE_SIZE
SQL> SHOW PARAMETER SHARED_POOL_SIZE

10) Check the value of JOB_QUEUE_PROCESSES.

SQL> SHOW PARAMETER JOB_QUEUE_PROCESSES

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 24
Practices for Lesson 5
Background: Users need to connect to your ORCL database. Work with them to enable
connections by using different methods. Ensure that users can use connect-time failover
to take advantage of a backup listener.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 25
Practice 5-1: Configuring the Oracle Network Environment
1) Make a copy of your listener.ora and tnsnames.ora files. They are in the
$ORACLE_HOME/network/admin directory.
a) In an XTerm window, enter cd $ORACLE_HOME/network/admin to
navigate to the
/u01/app/oracle/product/11.1.0/db_1/network/admin
directory.
b) Enter cp listener.ora listener.old to create a copy of the
listener.ora file.
c) Enter cp tnsnames.ora tnsnames.old to create a copy of the
tnsnames.ora file.
d) Enter ls -l, if you want to see the copies and their privileges in your directory.
2) Navigate to the Net Services Administration page. Start by clicking the Listener
link on the Database home page.
a) Invoke Enterprise Manager as theSYS user in the SYSDBA role for your ORCL
database.
b) On the Database Instance – Home page, click the Listener link in the General
region.
c) In the Related Links region, click Net Services Administration.
m y
d e
3) Modify your local Names Resolution file so that you can connect to another database.
Name the connection to a partner’s ORCL database testorcl.

c
a) On the Net Services Administration page, select Local Naming from the a
Administer drop-down list, and then click Go.

e A
l
The Netservices Administration: Host Login page appears.

c
r a
b) If you previously saved the oracle username and oracle password as
preferred credentials for your host login, they appear on the screen. If not, enter

O ly
oracle as Username and Password, select the Save as Preferred Credential
check box, and then click Login.

l & On
c) On the Local Naming page, click Create to enter a new network service name.

a e
d) Enter testorcl as Net Service Name.
n
t e r U s
e) Select Use SID, and enter orcl as SID.

I n
Note: You can also choose to enter a service name by choosing Use service name
option. In this case you must enter orcl.oracle.com.

l e
f) Select Database Default.

c
r a
O
Oracle Database 11g: Administration Workshop I A - 26
Practice 5-1: Configuring the Oracle Network Environment
(continued)

g) Click Add in the Addresses region.


m y
in?”
d e
Click No if you are asked, “Do you want to remember the values you filled

h) On the Add Address page, select the following values:


c a
- Protocol: TCP/IP
- Port: 1521
e A
c l
- Host: <Enter the host name or IP address of your partner’s computer. It could
be something like edrsr9p1.us.oracle.com or like 139.185.35.109.>

r a
O ly
l & On
n a e
t e r U s
I n
c l e
i) Click OK to return to the Create Net Service Name properties page.

r a
j) Click OK.

O The Creation Message appears: Net Service “testorcl” created successfully.

Oracle Database 11g: Administration Workshop I A - 27


Practice 5-1: Configuring the Oracle Network Environment
(continued)
4) In Enterprise Manager, test access to your partner’s ORCL database as the system
user with the oracle password by using the testorcl Local Naming.
a) Select testorcl on the Local Naming page, and then click Test Connection.
The message “Test Connection To Net Service Name: testorcl” appears.
b) Enter system as Username and oracle as Password, and then click Test.
The Processing page displays status information. It is followed by a success
message. If you receive any errors or warnings, resolve them.

m y
d e
5) Test your changes to the network configuration by using SQL*Plus or iSQL*Plus.

c
Again, use: system/oracle@testorcl. To see your partner’s information, a
table.
e A
select the instance_name and host_name columns from the v$instance

a) In an XTerm window, enter:


c l
r a
$ sqlplus system/oracle@testorcl

O ly
The Oracle SQL*Plus window opens. If you receive any errors or warnings, resolve
them.

l & On
b) At the SQL> prompt, enter the following command:

n a e
SQL> select instance_name, host_name from v$instance;

t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 28
Practice 5-1: Configuring the Oracle Network Environment
(continued)
6) Create a LISTENER2 listener to support connect-time failover. Use port 1561 for
this listener. First, log out of Enterprise Manager and run the lab_05_06.sh script
to configure the NetProperties file.
a) Log out of Enterprise Manager.
b) Run the lab_05_06.sh script at the operating system command prompt.
c) Log in to Enterprise Manager as the DBA1 user in the SYSDBA role for your
ORCL database.
d) On the Database Instance – Home page, click the Listener link in the General
region.
e) In the Related Links region, click Net Services Administration.
f) On the Net Services Administration page, select Listeners from the Administer
drop-down list, and then click Go. Enter host credentials as oracle and
oracle for username and password, and then click Login.
g) On the Listeners page, which gives you an overview of the existing listeners, click
the Create button.
The Create Listener page appears.
h) Enter LISTENER2 as Listener Name, and then click Add to add a listener
m y
address.
i) Enter or confirm the following values:
d e
- Protocol: TCP/IP
c a
- Port: 1561
- Host: <Your computer’s host name; for example,
e A
edrsr30p1.us.oracle.com>
c l
j) Click OK.
r a
O ly
l & On
n a e
t e r U s
I n
c l e
Ora k) Click the Static Database Registration tab, and then click the Add button to
connect the new listener with your ORCL database.
l) Enter the following values:

Oracle Database 11g: Administration Workshop I A - 29


Practice 5-1: Configuring the Oracle Network Environment
(continued)
- Service Name: orcl
- Oracle Home Directory: /u01/app/oracle/product/11.1.0/db_1
- Oracle System Identifier (SID): orcl

m) Click OK to add the database service.


n) Click OK to create the LISTENER2 listener.

m y
d e
c a
e A
c l
7) Start the LISTENER2 listener.
r a
O ly
a) Confirm that the LISTENER2 listener and Start/Stop Actions are selected, and
then click Go.
l & On
a e
b) Click OK on the Start/Stop page.

n
t e r
A confirmation message appears with a View Details link.

U s
c) Optionally, click the View Details link, review the listener status information, and

I n
use the Back icon of your browser to return to the previous page.
8) Stop your default listener and check the status of the new listener

c l e
a) Issue the following commands at the command prompt

Ora $ lsnrctl stop


$ lsnrctl status
$ lsnrctl status LISTENER2

Oracle Database 11g: Administration Workshop I A - 30


Practice 5-1: Configuring the Oracle Network Environment
(continued)
b) Connect to your database using the new listener using an easy connect connect
string.
$ sqlplus hr/hr@ ip_address:1561/orcl.oracle.com

Your connection is through your failover listener.


c) Restart your default listener using the following command:
$ lsnrctl start LISTENER

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 31
Practices for Lesson 6
Background: You need to create a new tablespace for the INVENTORY application. You
also need to create a database user to perform all administrative tasks without using the
SYS and SYSTEM accounts.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 32
Practice 6-1: Managing Database Storage Structures
1) Enter ./lab_06_01.sh to run a script that creates the DBA1 user. It is located at
/home/oracle/labs. The password for DBA1 is oracle.
a) Start a Linux command shell by double-clicking the XTerm icon on your desktop.
b) Change the current directory to the labs directory by entering:
$ cd labs

c) Enter the following command to run the script that creates the DBA1 user:
$ ./lab_06_01.sh

d) Leave the command shell window open. You will use it again later.
2) Use the Setup link in the top-right corner of Enterprise Manager (EM) to define the
DBA1 user as one who can perform administrative tasks in EM. When the non-SYS
user is configured, log out as the SYS user and log in as the DBA1 user. Use the
DBA1 user to perform the rest of these tasks, unless otherwise indicated.
a) In the far top-right corner of the EM window, click Setup and then on the Setup
page select Administrators.

m y
d e
c a
A
b) Click Create to add the DBA1 user to the Administrators list. This will enable the
DBA1 user to perform management tasks by using Enterprise Manager.
e
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r ac) Enter dba1 as Name, and oracle as Password and Confirm Password. Leave
Email Address blank, and leave Super Administrator selected, and then click

O Review.

Oracle Database 11g: Administration Workshop I A - 33


Practice 6-1: Managing Database Storage Structures (continued)
d) On the “Create Administrator: Review” page, click Finish.
e) Now that there is a non-SYS user, click Logout in the top-right corner, and then
click Login.
f) Enter DBA1 as User Name and ORACLE as Password, and select SYSDBA as
Connect As. Then click Login.
The first time you log in as a new user, the licensing page appears.
g) To acknowledge this information, click I agree at the bottom of the page.
The Database Home page appears.
3) Using Enterprise Manager, view information about the EXAMPLE tablespace. Answer
the following questions about it:
a) In Enterprise Manager, select Server > Storage > Tablespaces.
b) Click the EXAMPLE tablespace name.
c) Question 1: What percentage of free space can be used up before the Warning
threshold is reached?
Answer: 85%

m y
d e
c a
e A
d) From the Actions drop-down list, select Show Tablespace Contents, and then
click Go.
c l
a
e) The Show Tablespace Contents page appears.
r
O ly
l & On
n a e
t e r U s
I n
l e
f) Question 2: How many segments are there in the EXAMPLE tablespace?

c Answer: 390 (your answer may vary)

r ag) Select INDEX from the Type drop-down list in the Search region, and then click

O Go.

Oracle Database 11g: Administration Workshop I A - 34


Practice 6-1: Managing Database Storage Structures (continued)

h) Question 3: Which index in the EXAMPLE tablespace takes up the most space?
Answer: SH.CUSTOMERS_PK
Question 4: Which segment is stored physically first in the tablespace? That is,
which one is stored right after the tablespace header?
i) Scroll to the bottom of the page, and then click the plus icon to the left of the
Extent Map label.
j) After several seconds, the extent map appears. Note that the map legend indicates
that pink is the tablespace header.
k) Scroll back to the top of the page, select All Types from the Type drop-down list,
and then click Go.
l) Click the extent just to the right of the tablespace header extent.

m y
d e
c a
e A
c l
r a
m) Scroll to the top of the page again, and note the segment that is being pointed to:

O ly
l & On
n a e
Answer: HR.REGIONS

t e r U s
4) Create a new, locally managed tablespace (LMT) called INVENTORY of size 5 MB.

I n
Note: The INVENTORY tablespace will be used in later practice sessions during this

l e
class.

c
a) In Enterprise Manager, select Server> Storage > Tablespaces.

r ab) Click Create.

O
Oracle Database 11g: Administration Workshop I A - 35
Practice 6-1: Managing Database Storage Structures (continued)
c) Enter INVENTORY as the tablespace name, and verify that Extent Management
is Locally Managed, Type is Permanent, Status is Read Write, and Use Bigfile
tablespace is not selected.
d) Click Add in the Datafiles region.
e) On the Add Datafile page, enter inventory01.dbf for File Name, and 5 MB as File
Size.
f) Click Continue.
g) Click the Storage tab, and verify that Extent Allocation is Automatic, Segment
Space Management is Automatic, and Logging is enabled.
h) Click the General tab.
i) Click Show SQL to see the SQL that will be run, and then click Return
j) Click OK, and a successful Update Message appears.
5) As the DBA1 user, run the lab_06_05.sql script to create and populate a table
(called X) in the INVENTORY tablespace. What error do you eventually see?
a) Open a terminal window to start a command shell, and then enter:
$ cd labs

b) Enter the following to run the script:

m y
$ sqlplus dba1/oracle @lab_06_05.sql

d e
c) Note that there is eventually an error ORA-01653 stating that the table cannot be

inserted.
c a
extended. There is not enough space to accommodate all of the rows to be

e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
6) Go to the Enterprise Manager window and define space for 72 MB in the tablespace
instead of 5 MB, while keeping the same single data file in the tablespace. What is the

r aALTER statement that is executed to make this change?


a) Select Server> Storage > Tablespaces.
O b) Select the INVENTORY tablespace, and then click Edit.

Oracle Database 11g: Administration Workshop I A - 36


Practice 6-1: Managing Database Storage Structures (continued)
c) In the Datafiles region, click Edit.
d) Change File Size from 5 MB to 72 MB.
e) Click Continue to return to the General tabbed page.
f) Click Show SQL to see the SQL that will be run. Note that it is an ALTER
DATABASE statement. Click Return.

g) Click Apply.
7) Go back to the terminal window and run the lab_06_07.sql script. It drops the
table and reexecutes the original script that previously returned the space error.
a) Go to the SQL*Plus window.
b) Enter the following to run the script:
$ sqlplus dba1/oracle @lab_06_07.sql

c) Note that the same number of row inserts are attempted, and there is no error
because of the increased size of the tablespace.
8) In a terminal window, run the lab_06_08.sql script to clean up the tablespace for
m y
later practice sessions.
d e
a) Enter the following to run the script:
c a
$ sqlplus dba1/oracle @lab_06_08.sql

e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 37
Practices for Lesson 7
Background: You need to create a user account for Jenny Goodman, the new human
resources department manager. There are also two new clerks in the human resources
department, David Hamby and Rachel Pandya. All three must be able to log in to the
ORCL database and to select data from, and update records in, the HR.EMPLOYEES
table. The manager also needs to be able to insert and delete new employee records.
Ensure that if the new users forget to log out at the end of the day, they are automatically
logged out after 15 minutes. You also need to create a new user account for the inventory
application that you are installing.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 38
Practice 7-1: Administering User Security
In this practice, you create the INVENTORY user to own the new Inventory application.
You create a profile to limit the idle time of users. If a user is idle or forgets to log out
after 15 minutes, the user session is ended.
1) Mandatory task: Review and run the lab_07_01.sh script (located in the
/home/oracle/labs directory) to create the INVENTORY user, which you will
use in the next practice.
a) In a terminal window enter:
$ cd $HOME/labs
$ cat lab_07_01.sh
# Oracle Database 11g: Administration Workshop I
# Oracle Server Technologies - Curriculum Development
#
# ***Training purposes only***
#***Not appropriate for production use***
#
# Start this script as OS user: oracle
# This script creates the INVENTORY schema user
# The DROP command fails the first time
# you execute the script.
# The error can be ignored.

sqlplus / as sysdba << EOF


m y
drop user inventory cascade;
d e
create user inventory identified by verysecure
c a
default tablespace inventory;

e A
grant connect, resource to inventory;

c l
exit;
EOF
r a
$ ./lab_07_01.sh
O ly
21:18:27 2007
l & On
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Jul 26

n a e
t e r
Copyright (c) 1982, 2007, Oracle.

U s
All rights reserved.

Connected to:
I n
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -

l e
Production

c
With the Partitioning, Oracle Label Security, OLAP, Data

r aMining
and Real Application Testing options

O SQL> SQL> drop user inventory cascade

Oracle Database 11g: Administration Workshop I A - 39


Practice 7-1: Administering User Security (continued)
*
ERROR at line 1:
ORA-01918: user 'INVENTORY' does not exist

SQL> SQL> 2
User created.

SQL> SQL>
Grant succeeded.

SQL> SQL> Disconnected from Oracle Database 11g Enterprise


Edition Release 11.1.0.6.0 - Production
With the Partitioning, Oracle Label Security, OLAP, Data
Mining
and Real Application Testing options
$

2) Create a profile named HRPROFILE that allows only 15 minutes idle time.
a) Invoke Enterprise Manager as the SYS user in the SYSDBA role for your ORCL
database.
b) Click the Server tab, and then click Profiles in the Security section.
c) Click the Create button.
m y
d) Enter HRPROFILE in the Name field.
e) Enter 15 in the Idle Time (Minutes) field.
d e
f) Leave all the other fields set to DEFAULT.
c a
A
g) Click the Password tab, and review the Password options, which are currently all

e
set to DEFAULT.

c l
h) Optionally, click the Show SQL button, review your underlying SQL statement,
and then click Return.
r a
O ly
i) Finally, click OK to create your profile

limits are enforced.


l & On
3) Set the RESOURCE_LIMIT initialization parameter to TRUE so that your profile

a e
a) Click the Server tab, and then click All Initialization Parameters in the
n
t e r U s
Database Configuration section.
b) Enter RESOURCE_LIMIT in the Filter field, and then click Go.

I n
c) Select TRUE from the Value drop-down list, and then click Apply.

l e
4) Create the role named HRCLERK with SELECT and UPDATE permissions on the

c
HR.EMPLOYEES table.

r aa) Click the Server tab and then click Roles in the Security section.

O b) Click the Create button at the top-right of the page.

Oracle Database 11g: Administration Workshop I A - 40


Practice 7-1: Administering User Security (continued)
c) Enter HRCLERK in the Name field. This role is not authenticated.
d) Click Object Privileges tab.
e) Select Table from the Select Object Type drop-down list, and then click Add.
f) Enter HR.EMPLOYEES in the Select Table Objects field.
g) Move the SELECT and UPDATE privileges to the Selected Privileges box. Click
OK.
h) Click the Show SQL button, and review your underlying SQL statement.

i) Click Return, and then click OK to create the role.


5) Create the role named HRMANAGER with INSERT and DELETE permissions on the
HR.EMPLOYEES table. Grant the HRCLERK role to the HRMANAGER role.
a) Click the Server tab, and then click Roles in the Security section.
b) Click Create.
c) Enter HRMANAGER in the Name field. This role is not authenticated.
d) Click Object Privileges tab.
m y
e
e) Select Table from the Select Object Type drop-down list, and then click Add.
d
f) Enter HR.EMPLOYEES in the Select Table Objects field.
c a
g) Move the INSERT and DELETE privileges to the Selected Privileges box. Click
OK.
e A
l
h) Click the Roles tab, and then click Edit List.
c
a
i) Move the HRCLERK role into the Selected Roles box, and then click OK.
r
O ly
j) Click the Show SQL button, and review your underlying SQL statement.

l & On
n a e
t e r s
k) Click Return, and then click OK to create the role.
U
I n
6) Create an account for David Hamby, a new HR clerk.

c l e
a) Click the Server tab, and then click Users in the Security section.
b) Click Create, and enter DHAMBY in the Name field.

Ora c) Select HRPROFILE for the Profile.

Oracle Database 11g: Administration Workshop I A - 41


Practice 7-1: Administering User Security (continued)
d) Select Password Authentication, and enter newuser as password. Enter it into
the Confirm Password field also. Select the Expire Password now check box so
that David will have to change the password the first time he logs in.
e) Click the Roles tab. Notice that the CONNECT role has automatically been
assigned to the user.
f) Add the HRCLERK role by clicking Edit List and moving the HRCLERK role into
the Selected Roles box. Click OK to close the Modify Roles window.
g) Click OK again to create the user.
7) Create an account for Rachel Pandya, another new HR clerk. Repeat the steps under
task 6 with RPANDYA as the username.
8) Create an account for Jenny Goodman, the new HR manager. Repeat the steps under
task 6 with JGOODMAN as the username and selecting the HRMANAGER role instead
of the HRCLERK role.
a) Click the Show SQL button and review your underlying SQL statement.

b) Click Return, and then click OK to create the user.


m y
d
Use oracle as the new password. Select the row with EMPLOYEE_ID=197 from e
9) Test the new users in SQL*Plus. Connect to the ORCL database as the DHAMBY user.

“insufficient privileges” error.)


c a
the HR.EMPLOYEES table. Then attempt to delete it. (You should get the

a) In a terminal window, enter:


e A
sqlplus dhamby/newuser
c l
r a
or if you are already in SQL*Plus, use the CONNECT command. If you reconnect
as dhamby in SQL*Plus, the login and change-of-password session looks like
this:next O ly
l & On
SQL> CONNECT dhamby/newuser

ERROR:
n a e
t e r U s
ORA-28001: the password has expired

Changing password for dhamby

I n
New password: oracle <<<Password does not appear on screen
Retype new password: oracle <<<Password does not appearon screen

l e
Password changed

c
r aConnected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 –

O Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining

Oracle Database 11g: Administration Workshop I A - 42


Practice 7-1: Administering User Security (continued)
and Real Application Testing options
SQL>

b) Select the salary for EMPLOYEE_ID=197 from the HR.EMPLOYEES table.


SQL> SELECT salary FROM hr.employees WHERE EMPLOYEE_ID=197;

SALARY
----------
3000

c) Now attempt to delete the same record from the hr.employees table.
SQL> DELETE FROM hr.employees WHERE EMPLOYEE_ID=197;
DELETE FROM hr.employees WHERE EMPLOYEE_ID=197
*
ERROR at line 1:
ORA-01031: insufficient privileges

10) Repeat the test as the JGOODMAN user. After deleting the row, issue a rollback, so
that you still have the original 107 rows.
a) Connect to the ORCL database as the JGOODMAN user.
SQL> connect jgoodman/newuser
ERROR:
ORA-28001: the password has expired
m y
<Change the password as shown above>

b) Select the row with EMPLOYEE_ID=197 from the HR.EMPLOYEES table.


d e
SQL> SELECT salary FROM hr.employees WHERE EMPLOYEE_ID=197;
c a
SALARY

e A
----------
3000
c l
r a
c) Now delete the same row from the HR.EMPLOYEES table.
SQL> DELETE FROM
O ly
hr.employees WHERE EMPLOYEE_ID=197;

1 row deleted.
l & On
a e
d) Roll back the delete operation (because this was just a test).
n
SQL> rollback;

t e r U s
I n
Rollback complete.

e) Confirm that you still have 107 rows in this table.

c l e
SQL> SELECT COUNT(*) FROM hr.employees;

Ora COUNT(*)
----------
107

Oracle Database 11g: Administration Workshop I A - 43


Practice 7-1: Administering User Security (continued)

SQL>

Question 1: Where was the row stored after deletion?

Answer: It was stored in the Undo tablespace.

Question 2: When you created the new users, you did not select a default or
temporary tablespace. What determines the tablespaces that the new users will use?

Answer: The system-defined default permanent and temporary tablespaces

Question 3: You did not grant the CREATE SESSION system privilege to any of the
new users, but they can all connect to the database. Why?

Answer: Because Enterprise Manager automatically assigns the CONNECT role to the
new users, and CREATE SESSION is contained within that role
11) Use SQL*Plus to connect to the ORCL database as the RPANDYA user. Change the
password to oracle. (You must change the password, because this is the first
connection as RPANDYA.) Leave RPANDYA connected during the next lesson or at
the end of the day. HRPROFILE specifies that users whose sessions are inactive for
more than 15 minutes will automatically be logged out. Verify that the user was
automatically logged out by trying to select from the HR.EMPLOYEES table again.
m y
ERROR at line 1:
d e
ORA-02396: exceeded maximum idle time, please connect again

c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 44
Practices for Lesson 8
Background: You need to create schema objects for the new inventory application.
Work as the DBA1 user in the SYSDBA role for your ORCL database.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 45
Practice 8-1: Managing Schema Objects
1) Return to the Enterprise Manager browser session, or invoke EM as the DBA1 user in
the SYSDBA role for your ORCL database.
2) In the INVENTORY tablespace, create the PRODUCT_MASTER table in the
INVENTORY schema. The specifications of the table are:
PRODUCT_ID number(7). This is the primary key field. (Constraint name: PK_INV)
PRODUCT_NAME varchar2(50) with a Not NULL constraint
CODE varchar2(10) with a Not NULL constraint
REORDER_THRESHOLD number(5) with a check constraint ensuring that the number
is always greater than zero (Constraint name: CHK_REORDER)
COST number(5,2)
PRICE number(5,2)
a) Select Schema > Database Objects > Tables.
b) Click Create.
c) Leave the default table type to be Standard, Heap Organized permanent, and
then click Continue.
d) Enter PRODUCT_MASTER as table name and set Schema to INVENTORY, and
leave the Tablespace setting as the default for the user, which is INVENTORY.
e) Enter the first five columns’ information (including Data Type, Size, Scale, and
m y
Not NULL); but no constraints yet.

d e
f) Click Add 5 Table Columns, and then enter the last column, PRICE, along with
its type and size.
c a
g) Click the Constraints tab.

e A
c l
h) Set the drop-down list value to PRIMARY, and then click Add.
i) Give the constraint a name by entering PK_INV in the Name field.

r a
j) Double-click PRODUCT_ID in the left list to move it to the right list, to make it

O ly
alone the primary key. Then click Continue.

& On
k) Set the constraint type drop-down list value to CHECK, and then click Add.
l
a e
l) Enter CHK_REORDER for the name of the check constraint.

n
t e r
m) Enter “reorder_threshold > 0” (without the quotation marks) in the
Check Condition field.
U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 46
Practice 8-1: Managing Schema Objects (continued)

n) Leave the Attributes settings at their default settings, and then click Continue.
o) Your constraint list should now look like this:

m y
d e
OK again.
c a
p) Click OK to create the table. If you receive errors, correct them, and then click

A
3) In the INVENTORY tablespace, create the PRODUCT_ON_HAND table in the

e
c l
INVENTORY schema. You have been given the lab_08_03.sql script to create
the table, but there is a problem with it (intentionally created to enhance your

r a
learning experience). Fix the problem, and run the script. If you cannot find the error
right away, run the original script in SQL*Plus to see the error message. This helps

O ly
you discover and solve the problem. The specifications of the table are:

l & On
PRODUCT_ID number(7). This field should have a foreign key constraint linking
it to the PRODUCT_ID field in the PRODUCT_MASTER table.
QUANTITY number(5)
n a e
t e
LAST_UPDATE dater U s
WAREHOUSE_CITY varchar2(30)

I n
a) Edit the lab_08_03.sql in the /home/oracle/labs directory. It has an
error in it. If you can spot the error, make the change to correct it. Run the script

c l e
to create the table by entering this on the OS command line:

r a $ sqlplus dba1/oracle @lab_08_03.sql

b) The error in the script is that “(PRODUCT_ID)” is missing after “FOREIGN KEY.” So,
O add “(PRODUCT_ID) .”

Oracle Database 11g: Administration Workshop I A - 47


Practice 8-1: Managing Schema Objects (continued)

(PRODUCT_ID)

c) Remove the prompt commands:


prompt There is an error in this statement. It will not
prompt run successfully unless fixed.
d) Run the script. The table should be created without error.

4) In the INVENTORY tablespace, create the OBSOLETE_PRODUCTS table in the m y


INVENTORY schema. This table definition is very much like that of the
d e
c a
PRODUCT_MASTER table, so you can use Enterprise Manager’s ability to “Define
Using SQL” rather than using “Column Specification.” The specifications of the table
are:

e A
c l
PRODUCT_ID number(7). This is the primary key field.
PRODUCT_NAME varchar2(50) with a Not Null constraint

COST number(5,2)
r a
CODE varchar2(20) with a Not Null constraint

PRICE number(5,2)
O ly
b) Click Create. l & On
a) In Enterprise Manager, select Schema > Database Objects > Tables.

n a e
c) Leave the default setting for Table Organization, and then click Continue.

t e r s
d) Enter OBSOLETE_PRODUCTS for Name.
U
I n
e) Enter INVENTORY for Schema.

c l e
f) Leave the Tablespace setting as the default for this schema.
g) Set the Define Using drop-down list to SQL.

Ora h) In the SQL region, enter the following statement:


SELECT product_id, product_name, code, cost, price
FROM inventory.product_master

Oracle Database 11g: Administration Workshop I A - 48


Practice 8-1: Managing Schema Objects (continued)

i) Click OK to create the table.


5) In the INVENTORY tablespace, create an index called OBS_CODE on the CODE
column of the OBSOLETE_PRODUCTS table in the INVENTORY schema. Choose an
appropriate index type either B-tree or Bitmap. Explain the reason for your choice.
a) Question: Which type of index is appropriate, and why?
Answer: B-tree, because the CODE column can contain many different values, not
m y
just a small, finite set.
b) Select Schema > Database Objects > Indexes, and the click Create.
d e
c) Enter OBS_CODE as Name.
c a
d) Enter INVENTORY as Schema.
e A
l
e) Enter INVENTORY.OBSOLETE_PRODUCTS as Table Name.
c
r a
f) Click Populate Columns. The column names have been filled into the table. If
your browser prompts you to remember entered values, click No.
O ly
g) Enter an ORDER value of 1 for the CODE column.

l & On
h) Click Show SQL, confirm the SQL statement looks like the statement below, and
then click Return.

n a e
t e r U s
I n
i) Click OK to create the index.

c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 49
Practice 8-1: Managing Schema Objects (continued)
6) In the INVENTORY tablespace, create an index called PROD_NAME_CODE on the
combined PRODUCT_NAME and CODE columns of the PRODUCT_MASTER table.
Use the lab_08_06.sql script (which contains an error, intentionally created to
enhance your learning experience). Correct the error and run the script. If you cannot
find the error right away, run the original script in SQL*Plus to see the error message.
This will help you discover and solve the problem.
a) Edit the lab_08_06.sql in the /home/oracle/labs directory. It has an
error in it. If you can spot the error, make the change to correct it.

The corrected statement is:

b) Remove the prompt commands:


m y
prompt There is an error in this script.
d e
prompt
prompt
Correct the error to have the index
created successfully.
c a
A
c) Run the script to create the index by entering the following on the OS command

e
line:

c l
r a
$ sqlplus dba1/oracle @lab_08_06.sql

d) The error in the script is that it should not have the word “COMPOSITE.” Delete
O ly
the word, run the script, and the index should be created without error.

l & On
7) In the INVENTORY tablespace, use SQL*Plus to create a combined index on the
PRODUCT_ID and QUANTITY columns of the PRODUCT_ON_HAND table. The

n a e
index name should be POH_PROD_ID_QTY.

e r s
a) At the SQL*Plus prompt, enter the following command:
t U
I n
SQL> create index inventory.poh_prod_id_qty on
2> inventory.product_on_hand(product_id, quantity);

l e
8) You receive an update for the inventory application that requires you to add two
c
columns to the PRODUCT_MASTER table. Add a column called PRIMARY_SOURCE

r aof the data type varchar2(50). Add another column called


SECONDARY_SOURCE of the data type varchar2(50). What is the SQL that
O executes to do this?

Oracle Database 11g: Administration Workshop I A - 50


Practice 8-1: Managing Schema Objects (continued)
a) Select Schema > Database Objects > Tables.
b) Enter INVENTORY in the Schema field, and then click Go.
c) Select the PRODUCT_MASTER table, and then click Edit.
d) Enter PRIMARY_SOURCE in the Name field under PRICE, and set Data Type to
VARCHAR2, and Size to 50.
e) Enter SECONDARY_SOURCE in the next available Name field, and set Data
Type to VARCHAR2, and Size to 50.
f) Click Show SQL.

g) Click Return, and then click Apply.


9) You receive another update for the inventory application. This change request
instructs you to drop the OBSOLETE_PRODUCTS table and add the OBSOLETED
column to the PRODUCT_MASTER table, with data type DATE. Do this using EM.
What clause is added to the end of the DROP TABLE statement to also remove the
table constraints?
a) Select Schema > Database Objects > Tables.
m y
b) Enter INVENTORY in the Schema field, and then click Go.
d e
c a
c) Select the OBSOLETE_PRODUCTS table, and then click Delete With Options.
d) Keep the default settings for performing DROP, and then click Show SQL to see
the CASCADE CONSTRAINTS option.

e A
c l
r a
e) Click Return, and then click Yes.
O ly
f) Select the PRODUCT_MASTER table, and then click Edit.

l & On
g) In the first empty Name field, enter OBSOLETED, and set Data Type to DATE.
h) Click Apply.
n a e
t e r U s
10) Another change request to the inventory application instructs you to create a view
called WAREHOUSE_VW (Navigation aid: Administration > Views). The view is in

I n
the INVENTORY schema and displays (in this order):

c

l
• e The name of the product
The amount of “product on hand”

r a • The warehouse city name

O You will have to join two tables together to create this view.

Oracle Database 11g: Administration Workshop I A - 51


Practice 8-1: Managing Schema Objects (continued)
a) Select Schema > Database Objects > Views.
b) Click Create.
c) Enter WAREHOUSE_VW in the Name field, and INVENTORY in the Schema field.
d) Enter the following in the Query Text field:
select product_name, quantity, warehouse_city
from product_master pm, product_on_hand poh
where pm.product_id = poh.product_id

m y
d e
e) Click OK.
c a
e A
11) You receive a notice from developers that there is a certain type of query that will be
run very frequently, and they want to be sure that it runs in less than one second. You
l
need to run the query and see how it performs. First, run the lab_08_11_a.sql
c
r a
script to generate some test data of the volume indicated in the request. Then run the
query in the lab_08_11_b.sql script several times to see the average run time.

O ly
Note that it takes several seconds to run each time. Create a function-based index on
the CODE_FUNC column that will improve the performance of this query.

l & On
a) Open a terminal window and enter the following at the command prompt to

a e
populate the table with test data. This will take three to five minutes to run.

n
t e r
$ cd /home/oracle/labs

U s
$ sqlplus dba1/oracle @lab_08_11_a.sql

I n
b) Enter the following on the command line to run the test query.

c l e
SQL> @lab_08_11_b.sql

c) Enter / (a slash), and press [Enter] to run it again. Repeat this several times until

r a you establish an average run time. It should take several seconds each time.

O d) Select Schema > Database Objects > Indexes.

Oracle Database 11g: Administration Workshop I A - 52


Practice 8-1: Managing Schema Objects (continued)
e) Click Create.
f) Enter CODE_FUNC in the Name field.
g) Enter INVENTORY in the Schema field.
h) Enter INVENTORY.PRODUCT_MASTER in the Table Name field.
i) Click Populate Columns.
j) Click Add Column Expression.
k) Enter upper(substr(code,5,2)) in the newly added empty Column
Name field.
l) Enter 1 in the Order field beside the expression that you just entered.
m) Click Show SQL to confirm that the SQL statement looks like this:

n) Click Return.
o) Click OK.
p) Return to the SQL*Plus command line and run the benchmark query a few more
times. Note that the execution time is greatly reduced.
m y
d e
12) Use SQL*Plus to identify the data dictionary view name that you would use to list all
constraints that the INVENTORY user can see.

c
a) From a terminal window, log in to SQLPlus as inventory as Username anda
verysecure as the Password.

e A
c l
b) You are looking for things that the INVENTORY user has access to. So you must
use a view with the ALL_ prefix. You can assume that the name of the view that

r a
shows constraint information begins with “ALL_CON.” Enter the following query:
$ sqlplus
O ly
l & On
SQL*Plus: Release 11.1.0.3.0 - Beta on Thu May 31 23:38:32
2007

n a e
t e r U s
Copyright (c) 1982, 2006, Oracle. All rights reserved.

n
Enter user-name: inventory/verysecure

e I
Connected to:

c lOracle Database 11g Enterprise Edition Release 11.1.0.3.0 -


Beta

r a With the Partitioning, OLAP and Data Mining options

O SQL> column comments format a15 wrap


SQL> SELECT * FROM dictionary

Oracle Database 11g: Administration Workshop I A - 53


Practice 8-1: Managing Schema Objects (continued)
WHERE table_name like ‘ALL_CON%’
ORDER BY table_name;

TABLE_NAME COMMENTS
------------------------------ ---------------
ALL_CONSTRAINTS Constraint defi
nitions on acce
ssible tables

ALL_CONS_COLUMNS Information abo


ut accessible c
olumns in const
raint definitio
ns

ALL_CONS_OBJ_COLUMNS List of types a


c) Review the returned rows. One of them has the COMMENTS value “Constraints
definitions on accessible tables.” The object name is ALL_CONSTRAINTS.
13) How many indexes are owned by the INVENTORY user? You are looking for
database objects owned by the INVENTORY user, so you know that the data
dictionary view begins with the “USER_” prefix. The view name is
USER_INDEXES. m y
a) In the SQL*Plus enter the following query:
d e
SELECT count(*) FROM user_indexes;
c a
b) Click the Execute button.

e A
l
How many indexes are owned by the INVENTORY user?
c
Answer: Four
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 54
Practices for Lesson 9
Background: The Help desk just received a call from Susan Mavris, an HR
representative, complaining that the database is “frozen.” Upon questioning the user, you
find that she was trying to update John Chen’s personnel record with his new phone
number, but when she entered the new data, her session froze and she could not do
anything else. SQL script files are provided for you in the /home/oracle/labs
directory.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 55
Practice 9-1: Managing Data and Concurrency
1) Make an uncommitted update to the row in question by running the
lab_09_01.sql script. Do not worry if the session seems to “hang”—this is the
condition you are trying to create.
a) Enter the following to run the script. When the script completes executing, you
will see a note stating that an uncommitted update has been made.
$ sqlplus dba1/oracle @lab_09_01.sql

2) Make an attempt to update the same row in a separate session by running, in a


separate terminal window, the lab_09_02.sql script. Make sure you see the
message “Update is being attempted now” before moving on.
a) Open a terminal window to start another command shell, and enter the following
m y
to run the second script.

d e
a
$ sqlplus dba1/oracle @lab_09_02.sql

A c
c l e
r a
O ly
l & On
3) Using the Blocking Sessions link on the Performance page, detect which session is
a e
causing the locking conflict.
n
t e r U s
a) In Enterprise Manager, click the Performance page.
b) The first time you invoke the Performance page, a Software License Agreement is

I n
displayed. Press [A] to accept and continue.

l e
c) Click Blocking Sessions in the Additional Monitoring Links area.

c
r a
O
Oracle Database 11g: Administration Workshop I A - 56
Practice 9-1: Managing Data and Concurrency (continued)

4) What was the last SQL statement that the blocking session executed?
a) Select the NGREENBERG session, and then click View Session.
b) Click the hash value link named “Previous SQL.”

m y
d e
c a
e A
c l
r a
c) Note the SQL that was most recently run.

O ly
l & On
n a e
t e r U s
5) Resolve the conflict in favor of the user who complained, by killing the blocking
session. What SQL statement resolves the conflict?

I n
a) Click the browser’s Back button.

c l e
b) Now, on the Session Details: NGREENBERG page, click Kill Session.
c) Leave the Options set to Kill Immediate, and then click Show SQL to see the

r a statement that is going to be executed to kill the session.

O Note: Your session and serial number are most likely to be different from those
shown here.

Oracle Database 11g: Administration Workshop I A - 57


Practice 9-1: Managing Data and Concurrency (continued)

d) Click Return, and then click Yes to carry out the KILL SESSION command.
6) Return to the SQL*Plus command window, and note that SMAVRIS’s update has
now completed successfully. It may take a few seconds for the success message to
appear.

a) Try issuing a SQL select statement in the NGREENBERG session. What do you
see?
SQL> SELECT sysdate from Dual;

Answer: The session has been disconnected.


Close all open SQL sessions by entering exit, and then close the terminal windows.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 58
Practices for Lesson 10
Background: The business users and management in your organization decide, that they
need to have a 48-hour retention of undo in the Oracle database to support their flashback
needs. Your task is to configure the orcl database to support this requirement.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 59
Practice 10-1: Managing Undo Data
In this practice, you first view your system activity regarding undo, and then you
configure the orcl database to support 48-hour retention for flashback operations.
1) In Enterprise Manager as SYS user, view the undo related system activity.
a) Click the Server tabbed page and select “Automatic Undo Management” in the
Database Configuration section.
b) Click the System Activity tabbed page.

m y
d e
c a
A
Note: Your information will look different on all analysis screenshots, based on your
e
l
analysis period and the system activity during this period.
c
encounter?
r a
c) Question: Looking at the preceding screenshot, how many errors did this system

Answer: None O ly
running query? l & On
d) Question: Looking at the preceding screenshot, what is the duration of the longest

n
Answer: 15 minutes a e
e r s
e) Click the Plus icon to show related graphs.
t U
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 60
Practice 10-1: Managing Undo Data (continued)

m y
d e
c a
e A
c l
r a
f) Question: How many graphs are displayed?

O ly
Answer: Three. (Undo Tablespace Usage, Undo Retention Auto-Tuning, and
Undo Generation Rate)

l & On
g) Question: Looking at the preceding Undo Retention Auto-Tuning graph, could
a e
this system support flashback above and beyond the current longest running
n
query?

t e r U s
Answer: Yes, (but most likely not enough to support the required 48 hours).

I n
2) Calculate the undo tablespace size to support the requested 48-hour retention.

l e
a) Click the General tab to go back to the General Automatic Undo Management

c page.

Ora b) Under the Undo Advisor section, select “Specified manually to allow for longer
duration queries or flashback.”
c) Enter 48 hours as Duration and click the Run Analysis button.

Oracle Database 11g: Administration Workshop I A - 61


Practice 10-1: Managing Undo Data (continued)

d) When the Undo Advisor is finished, click the Show SQL button in the top right m y
corner of the General Automatic Undo Management page.
d e
c a
e A
c l
r a
O ly
e) Review the SQL statement and click Return.

l & On
3) Modify the undo tablespace size to support the requested 48-hour retention.

a e
a) On the General Automatic Undo Management page, click Apply. Then you
n
t e r
should see a similar message to the following one:

U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 62
Practice 10-1: Managing Undo Data (continued)

b) Question: Which Flashback operations are potentially affected by this change?


Answer: Flashback query, Flashback transaction, and Flashback table.
c) Question: Do undo data survive the shutdown of a database?
Answer: Yes, undo is persistent.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 63
Practices for Lesson 11
Background: You have just been informed of suspicious activities in the HR.JOBS table
in your ORCL database. The highest salaries seem to fluctuate in a strange way. You
decide to enable standard database auditing and monitor data manipulation language
(DML) activities in this table.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 64
Practice 11-1: Implementing Database Security
Log in as the SYS user (with oracle password, connect as SYSDBA) and perform the
necessary tasks either through Enterprise Manager Database Control or through
SQL*Plus. All scripts for this practice are in the /home/oracle/labs directory.
1) Use Enterprise Manager to enable database auditing. Set the AUDIT_TRAIL
parameter to XML.
a) Invoke Enterprise Manager as the SYS user in the SYSDBA role for your ORCL
database.
b) Click the Server tab, and then click Audit Settings in the Security section.
c) Click the value of Audit Trail, the DB link.
d) On the Initialization Parameters page, click the SPFile tab.
e) Enter audit in the Name field and then click Go.
f) For the audit_trail parameter, select the XML value.
g) Click Show SQL.
h) Review the statement and then click Return.
i) On the Initialization Parameters page, click Apply.
2) Because you changed a static parameter, you must restart the database. Do so by
running the lab_11_02.sh script.
m y
a) In a terminal window, enter:
d e
$ cd /home/oracle/labs
$ ./lab_11_02.sh
c a
A
b) Continue with the next step when you see that the database is restarted and the
e
l
script has exited out of SQL*Plus.
c
r a
3) Back in Enterprise Manager, select HR.JOBS as the audited object and DELETE,
INSERT, and UPDATE as Selected Statements. Gather audit information by session.

O ly
a) Click logout in the upper right corner of the Enterprise Manager window.

& On
b) Log in as the SYS user in the SYSDBA role for your ORCL database
l
n a e
c) Click the Database home page tab to ensure that Enterprise Manager had time to
update the status of the database and its agent connections. Because the database

e r s
has been restarted, you have to log in to EM again as the SYS user.
t U
I n
d) Click the Server tab, and then click Audit Settings in the Security section.
e) Click the Audited Objects tab, and then click the Add button.

l e
f) On the Add Audited Object page, ensure that the Object Type is Table, and enter
c
r a HR.JOBS in the Table field (or use the flashlight icon to retrieve this table).
g) Move DELETE, INSERT, and UPDATE into the Selected Statements area by
O double-clicking each of them.

Oracle Database 11g: Administration Workshop I A - 65


Practice 11-1: Implementing Database Security (continued)
h) Click Show SQL.
i) Review the statement, and then click Return.
j) Click OK to activate this audit.
4) Provide input for the audit, by executing the lab_11_04.sh script. This script
creates the AUDIT_USER user, connects to SQL*Plus as this user, and multiplies the
values in the MAX_SALARY column by 10. Then the HR user connects and divides
the column values by 10. Finally, the AUDIT_USER user is dropped again.
a) In a terminal window, enter:
$ cd /home/oracle/labs
$ ./lab_11_04.sh

5) In Enterprise Manager, review the audited objects.


a) Click the Server tab, and then click Audit Settings in the Security section.
b) Click Audited Objects in the Audit Trails area, which is on the right side of the
page.
c) On the Audited Objects page, review the collected information, and optionally
click Show SQL.
Question: Can you tell which user increased and which user decreased the salaries?
Answer: The standard audit records only show which user accessed the table.
m y
d) Click Return.
d e
database by using the lab_11_06.sh script.
c a
6) Undo your audit settings for HR.JOBS, disable database auditing, and then restart the

a) On the Audit Settings page, click the Audited Objects tab.


e A
c l
b) Enter HR as Schema, and then click Search.

r a
c) Select all three rows, and then click Remove.

O ly
d) On the Confirmation page, click Show SQL.

l & On
e) Review the statements, and then click Yes to confirm your removal.
f) On the Audit Settings page, click XML in the Configuration region.

n a e
g) On the Initialization Parameters page, click the SPFile tab.

e r s
h) On the SPFile page, enter audit in the Name field, and then click Go.
t U
I n
i) For the audit_trail parameter, select the DB value.
j) Click Show SQL.

c l e
k) Review the statement, and then click Return.

Ora l) On the Initialization Parameters page, click Apply.


m) Because you changed a static parameter, you must restart the database. Do so by
running the lab_11_06.sh script. In a terminal window, enter:

Oracle Database 11g: Administration Workshop I A - 66


Practice 11-1: Implementing Database Security (continued)
$ cd /home/oracle/labs
$ ./lab_11_06.sh

7) Maintain your audit trail: Because you are completely finished with this task, backup
and delete all audit files from the /u01/app/oracle/admin/orcl/adump
directory.
a) In a terminal window, enter:
$ cd /u01/app/oracle/admin/orcl/adump
$ ls

b) Create a backup of the audit trail files, and then remove the files
$ tar –czf $HOME/audit_today.tar.z *
$ rm –f *

Close the terminal window.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 67
Practices for Lesson 12
Background: You want to proactively monitor your ORCL database so that common
problems can be fixed before they affect users. This practice session invents some issues
so that you can familiarize yourself with the tools that are available. First, execute scripts
to set up your database environment for this exercise.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 68
Practice 12-1: Database Maintenance
1) Create a new, locally managed tablespace called TBSSPC. It has a spc1.dbf data
file of 50 MB. Ensure that the TBSSPC tablespace does not use Automatic Segment
Space Management (ASSM). Execute the lab_12_01.sh script to perform these
tasks.
In a terminal window, enter:
$ cd /home/oracle/labs
$ cat lab_12_01.sh

sqlplus / as sysdba << END

set echo on

drop tablespace TBSSPC including contents and datafiles;

CREATE SMALLFILE TABLESPACE "TBSSPC"


DATAFILE 'spc1.dbf' SIZE 50M
LOGGING
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT MANUAL;

exit;
END
m y
$ ./lab_12_01.sh
d e
c a
2) Create a new SPCT user, identified by spct. Assign the TBSSPC tablespace as
default tablespace. Assign the TEMP tablespace as temporary tablespace. Grant the
A
following roles to the SPCT user: CONNECT, RESOURCE, and DBA. Execute the

e
In a terminal window, enter:
c l
lab_12_02.sh script to perform these tasks.

$ cat lab_12_02.sh
r a

sqlplus / as sysdba << END O ly
set echo on
l & On
n a e
t e r
drop user spct cascade;

U s
create user spct identified by spct

I n
default tablespace TBSSPC
temporary tablespace temp;

c l e
grant connect, resource, dba to spct;

Ora exit;
END

Oracle Database 11g: Administration Workshop I A - 69


Practice 12-1: Database Maintenance (continued)
$ ./lab_12_02.sh
3) Use the DBMS_ADVISOR package to set the database activity time to 30 minutes. As
the SPCT user, drop and create the SPCT table and gather statistics for this table.
Create a snapshot in Automatic Workload Repository (AWR). Execute the
lab_12_03.sh script to perform these tasks.
In a terminal window, enter:
$ cat lab_12_03.sh

sqlplus / as sysdba << EOF

set echo on

exec
dbms_advisor.set_default_task_parameter('ADDM','DB_ACTIVITY_MI
N',30);

connect spct/spct

drop table spct purge;


create table spct(id number, name varchar2(2000));

exec DBMS_STATS.GATHER_TABLE_STATS(-
ownname=>'SPCT', tabname=>'SPCT',-
m y
estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);

d e
exec DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT();

c a
exit;
EOF

e A
$ ./lab_12_03.sh

c l
r a
4) Create activity to be analyzed. Execute the lab_12_04.sh script to perform these
tasks.
O ly
l & On
In a terminal window, enter the following. You may have to press [Enter] after
you see that several PL/SQL procedures have completed, in order to see the

a e
command prompt again.

n
$ ./lab_12_04.sh

t e r U s
5) In Enterprise Manager, review the Performance page as a user connected as SYSDBA.

I n
View performance data in real time with a 15-seconds refresh cycle. After a while,
you should see a spike on the “Average Active Sessions” graph. This is your activity

l e
to be analyzed. Looking at the graph, you can already determine that this instance is

c
suffering from concurrency problems.

r aa) Invoke Enterprise Manager as the SYS user in the SYSDBA role for your ORCL

O database.

Oracle Database 11g: Administration Workshop I A - 70


Practice 12-1: Database Maintenance (continued)
b) Click the Performance tab.
If this is the first time that you accessed the Performance page, you need to accept
the Adobe license agreement. Follow the directions in the pop-up window to
accept the agreement.

Note: Depending on when you run the workload, you may see differences
between your graph and the one provided as a possible solution.
After the spike is finished, execute the lab_12_05.sh script. This script forces
the creation of a new snapshot and gathers statistics on your SPCT table.
c) After the spike has finished, in a terminal window, enter:
$ ./lab_12_05.sh

6) Look at the Performance Analysis findings in order of their impact. There are
m y
several access paths to this information.

d e
c a
e A
c l
r a
O ly
l & On
n a e
e r s
Looking at the Performance Analysis section, you see that the first finding (in the
t U
SQL Tuning Recommendations category) has a 100% impact on the system. So

I n
your first impulse is to look at this finding in more detail. However, looking at
this SQL statement does not yet help you to understand the concurrency problem

c l e
of your database.

r a Investigate the next finding. Under Schema Recommendations: Read and write
contention of database blocks was consuming significant database time. Here

O you are advised to use the Automatic Segment Space Management (ASSM)
feature for your SPCT table.

Oracle Database 11g: Administration Workshop I A - 71


Practice 12-1: Database Maintenance (continued)
a) Navigate to the Database home page, and then click Advisor Central at the
bottom of the page.
b) Your ADDM task should already be displayed. If not, search for it and display it
on this page.
c) Select the task, and then click the View Result button (or alternatively, click the
name of the task).

Looking at the Performance Analysis section, you see that the first finding has a
100% impact on the system. So your first impulse is to look at this finding in
more detail.
m y
d e
d) Click the ‘SQL statements consuming significant database time were found’ link.

c
looking at this SQL statement does not yet help you to understand the a
e) Review the recommendations on the Performance Finding Details page. However,

A
concurrency problem of your database. Click the Back icon in your Web browser.

e
c l
f) On the “Automatic Database Diagnostic Monitor (ADDM)” page, there should be
two links that say ‘Buffer Busy’. One entry has a finding of “A hot data block

r a
with concurrent read and write activity was found” finding appears as type
Schema under the Recommendations heading. This finding recommends that
O ly
you investigate the application logic

l & On
The other link that says, ‘Buffer Busy’ has a finding of “Read and write
contention on database blocks was consuming significant database time” appears

a e
as type Schema under the Recommendations heading. This finding recommends
n
table.
t e r
that you use the Automatic Segment Space Management feature for your SPCT

U s
I n
7) To implement the recommendation, you must re-create the object. Create a new,
locally managed tablespace, called TBSSPC2 with a 50 MB data file, called

l e
spc2.dbf. Ensure that the TBSSPC2 tablespace uses the Automatic Segment Space

c
Management feature. Then execute the lab_12_07.sh script to drop the SPCT

r atable, to re-create it in the new tablespace, to gather statistics and to take a new
snapshot.
O
Oracle Database 11g: Administration Workshop I A - 72
Practice 12-1: Database Maintenance (continued)
a) In Enterprise Manager, click the Server tab, and then Tablespaces in the Storage
section.
b) Click Create.
c) Enter TBSSPC2 as the tablespace name, and verify that Extent Management is
Locally Managed, Type is Permanent, Status is Read Write, and Use Bigfile
tablespace is not selected.
d) Click Add in the Datafiles region.
e) On the Add Datafile page, enter spc2.dbf for File Name, and 50 MB as File
Size.
f) Click Continue.
g) Click the Storage tab, and verify that Extent Allocation is Automatic, Segment
Space Management is Automatic, and Logging is enabled.
h) Click the General tab.
i) Click Show SQL, and view the SQL that will be run, and then click Return.
j) Click OK, and a successful Update Message appears.
k) In a terminal window, enter:
$ ./lab_12_07.sh

8) Execute your workload again. (Use the lab_12_04.sh script.)


m y
d e
In a terminal window, enter the following. You may have to press [Enter] after you

prompt again.
c a
see that several PL/SQL procedures have completed, in order to see the command

$ ./lab_12_04.sh

e A
c l
9) In Enterprise Manager, review the Performance page as a user connected as SYSDBA.

r a
View performance data in real time with a 15-seconds refresh cycle. After a while,
you should see a spike on the “Average Active Sessions” graph.

O ly
After the spike is finished, execute the lab_12_05.sh script again. This script

& On
forces the creation of a new snapshot and gathers statistics on your ADDM table.

l
database.
n a e
a) Invoke Enterprise Manager as the sys user in the SYSDBA role for your ORCL

e r s
b) Click the Performance tabbed page.
t U
n
c) After the spike is finished, enter the following in a terminal window:
I
e
$ ./lab_12_05.sh

c l
10) Review the Performance Analysis on the Database home page.

Ora a) Navigate to the Database home page, and then click Advisor Central at the
bottom of the page.
b) Click the topmost ADDM task name.

Oracle Database 11g: Administration Workshop I A - 73


Practice 12-1: Database Maintenance (continued)
c) You see that there are no longer any schema-related recommendations. By
moving the ADDM table to the locally managed TBSSPC2 tablespace, which uses
the Automatic Autoextend Segment feature, you obviously fixed the root cause of
this problem.
11) To not affect other practice session, execute the lab_12_11.sh script to clean up
your environment.
In a terminal window, enter:
$ ./lab_12_11.sh

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 74
Practices for Lesson 13
Background: Users are complaining about slower-than-normal performance for
operations involving the human resources and order-entry applications. When you
question other members of the DBA staff, you find that maintenance was recently
performed on some of the tables belonging to the HR schema. You need to troubleshoot
and make changes as appropriate to resolve the performance problems. SQL script files
are provided for you in the /home/oracle/labs directory. Other directories are
individually named.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 75
Practice 13-1: Managing Performance
1) Log in to SQL*Plus as the SYS user and perform maintenance on tables in the HR
schema by running the lab_13_01.sql script.
$ cd labs
$ sqlplus / as sysdba
SQL> @lab_13_01.sql

2) You get calls from HR application users saying that a particular query is taking longer
than normal to execute. The query is in the lab_13_02.sql script. Run it.
Enter the following in SQL*Plus:
SQL> CONNECT hr/hr
SQL> @lab_13_02.sql

3) Using Enterprise Manager, locate the HR session in which the above statement was
just executed, and view the execution plan for that statement.
a) In Enterprise Manager, click the Performance tab, and the click Search Sessions
in the Additional Monitoring Links section.
b) On the Search Sessions page, change the Search criteria to “DB User,” enter HR
in the field to the right of that, and then click Go.
c) Click the SID number in the Results listing.

m
d) You now see the Session Details page for this session. Click the hash value link to
y
the right of the Previous SQL label in the Application section.
d e
c a
e) On the SQL Details page, you see the details for the last SQL statement executed
by that session, which is the one in question. Click the Plan tab to see the
execution plan for the query.

e A
c l
f) You see in the Operation column that this query is doing a full table scan
(TABLE ACCESS FULL). Because you know that the query’s condition is an

r a
equality comparison on the primary key (EMPLOYEE_ID), you decide to
investigate the status of the primary key index.

O ly
4) Using Enterprise Manager, check to see the status of the EMPLOYEE table’s index on

& On
EMPLOYEE_ID. See if it is VALID.
l
a e
a) From the Database Home page, click the Schema tab, and then Indexes.

n
t e r
b) Select Table Name as the Search By value.

U
c) Enter HR as Schema Name.s
I n
d) Enter employees for Object Name.

l e
e) Click Go, and the list of six indexes appears.

c
f) Click the index named EMP_EMP_ID_PK.

r ag) On the View Index page, notice that the status of the index is UNUSABLE.

O
Oracle Database 11g: Administration Workshop I A - 76
Practice 13-1: Managing Performance (continued)
5) Now that you have seen one index with a non-VALID status, you decide to check all
indexes. Using SQL*Plus, as the HR user, find out which HR schema indexes do not
have STATUS of VALID. To do this, you can query a data dictionary view with a
condition on the STATUS column.
a) Go to the SQL*Plus session where you are still logged in as the HR user, and run
this query:
SQL> select index_name, table_name, status
from user_indexes where status <> ‘VALID’;

b) See that the output lists six indexes, all on the EMPLOYEES table.

m y
d e
marked as UNUSABLE. c a
6) Using Enterprise Manager, reorganize all the indexes in the HR schema that are

e A
a) In Enterprise Manager, on the page displaying the EMP_EMP_ID_PK index,
l
select Reorganize in the Actions list, and then click Go.
c
r a
b) On the Reorganize Objects pages, click Add, to add each of the other five indexes
to the reorganization operation.
O ly
c) In the Add screen, choose Indexes for the Type drop-down list, and enter hr in

& On
the Schema field. Click Search.
l
a e
d) Select the five other indexes whose names start with “EMP_.”

n
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 77
Practice 13-1: Managing Performance (continued)

m y
d e
c a
e A
e) Click OK.

c l
f) Click Next.

r a
g) Keep all the default settings for Options, and then click Next. The reorganize
O ly
script generation occurs, and then the Impact Report appears.

& On
h) Note that there are no problems reported on Impact Report, and then click Next.
l
n a e
i) On the Schedule page, enter oracle and oracle for Username and Password
under Host Credentials.
j) Click Next.
t e r U s
I n
k) On the Review page, click Submit Job.
l) After the Confirmation page appears, click the View job Details to see the job

c l e
status. Click Reload on your browser until you see the job has succeeded.

r a
O
Oracle Database 11g: Administration Workshop I A - 78
Practice 13-1: Managing Performance (continued)
7) Return to the SQL*Plus session where the HR user is logged in, and run the
lab_13_07.sql script to execute the same kind of query. Then repeat the steps to
see the plan of the last SQL statement executed by this session, to see if the plan has
changed.
a) Enter the following at the SQL*Plus prompt:
SQL> @lab_13_07.sql

b) Repeat the tasks listed in step 3. Now the icon indicates the use of an index. Click
View Table. Note that the plan now uses an index unique scan.
c) Quit the SQL*Plus session.
8) What is the difference in execution plans, and why?
Answer: The statement execution uses a unique index scan instead of a full table scan,
because the index is usable after your index reorganization.
9) Simulate a working load on your instance by running the lab_13_09.sql script as
the SYS user. Please note the SID value that is reported.
Possible answer: 98 (Your answer is most likely a different one.)
10) This script takes about 20 minutes to complete. So, run it in a separate terminal
window and continue with this practice exercise while it runs.
Note: Because this script generates a fairly heavy load in terms of CPU and disk I/O,
m y
you will notice that response time for Database Control is slower.

d e
a
$ sqlplus / as sysdba

c
SQL> @lab_13_09.sql

performance.
e A
a) In Enterprise Manager, navigate to the Performance page, and investigate system

c l
b) You may need to wait a minute or two to see the effects of the load generation
script appear on the graphs.
r a
O ly
l & On
n a e
t e r U s Wait to see the beginning of a

I n spike in the Average Active

c l e Sessions graph before


proceeding.

r aQuestion 1: In the Average Active Sessions graph, which are the two main categories
O that active sessions are waiting for?

Oracle Database 11g: Administration Workshop I A - 79


Practice 13-1: Managing Performance (continued)
Answer: System I/O and CPU Used

Question 2: In the Configuration category of waits, what is one of the contributors to


the wait time? Click Configuration to see the graph.

Answer: Any one of these:

Question 3: Click Back, and then click Settings on the Performance page. For the
Detail Chart Settings select I/O for Default Veiw, and I/O Function for I/O Chart
Settings, and then click OK. Determine which process is doing the most writing to
the disk.

Answer: LGWR
c) Click Back.
d) Click Top Activity in the Additional Monitoring Links region.
e) Click the SQL ID of the first SQL statement listed in the Top SQL region.

m y
f) See the first SQL statement.

d e
11) Kill the session that is generating the load. Use the session ID recorded in step 9. The
a
session ID is listed in the SID column of the Detail for Selected 5 Minute Interval.
c
heading Detail for Selected 5 Minute Interval.
e A
a) Click the SID number for the session ID recorded earlier. This is found under the

l
b) On the Session Details page, click Kill Session, and then click Yes to confirm.
c
r a
Note: If you remain on this Session Details page long enough for a few automatic
refreshes to be done, you may see a warning, “WARNING, Session has expired.”
O ly
This warning means you are attempting to refresh information about a session that’s

l & On
already been killed. You can ignore this warning.
c) Click Top Activity in the navigation history at the top of the page. Note that the
a e
session activity in the database has declined considerably.
n
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 80
Practice 13-1: Managing Performance (continued)

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 81
Practices for Lesson 14
Background: Your ORCL database is ready to move from test or development into
production.
Configure your database to reduce the chances of failure or data loss. To do so, perform
the following tasks:
• Ensure redundancy of control files and backup the control file to trace
• Review the flash recovery area configuration
• Ensure that there are at least two redo log members in each group
• Place your database in ARCHIVELOG mode
• Configure redundant archive log destinations

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 82
Practice 14-1: Configuring Your Database for Recovery
In this practice, you configure your database to reduce the chances of failure or data loss.
Note: Completing this practice is a prerequisite for all following backup and recovery
practices.
1) Verify that you have at least two control files to ensure redundancy and backup the
control file to trace.
a) Invoke Enterprise Manager as the SYS user in the SYSDBA role for your ORCL
database.
b) Click Server > Control Files (in the Storage section).

m y
d e
Question 1: On the Control Files: General page, how many control files do you have?
Answer: Three (in the preceding example).
c a
A
Question 2: How would you add another control file if you needed to?

e
• Shut down the database
c l
Answer: Adding a control file is a manual operation. To perform this, you must:

r a
• Use the operating system to copy an existing control file to the location where
you want your new file to be.
O ly
• Start the database by using Enterprise Manager. Unlike a normal startup, you

l & On
would use Advanced Options to select a different startup mode. Select “Start
the instance” to leave the instance in the NOMOUNT state.

control file.
n a e
• Edit the CONTROL_FILES initialization parameter to point to the new

e r s
• Continue the STARTUP database operation until the database is in an open
state.
t U
I n
Note: This answer does not apply to an OMF database, because the control files in

c l e
that case would have to all be re-created.
c) Click Backup to Trace.

r ad) When you receive the success message, note the trace directory location, and then

O click OK.

Oracle Database 11g: Administration Workshop I A - 83


Practice 14-1: Configuring Your Database for Recovery
(continued)

e) Optionally, use a terminal window, logged in as the oracle user to view the
trace file name at the end of the alert log by executing the following command:
cd /u01/app/oracle/diag/rdbms/orcl/orcl/trace
tail alert_orcl.log
The following output shows only the last few lines:
$ cd /u01/app/oracle/diag/rdbms/orcl/orcl/trace
$ tail alert_orcl.log
Wed Aug 15 02:00:00 2007
Clearing Resource Manager plan via parameter
Wed Aug 15 04:10:09 2007
ALTER DATABASE BACKUP CONTROLFILE TO TRACE
Backup controlfile written to trace file
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_19841.trc
m y
Completed: ALTER DATABASE BACKUP CONTROLFILE TO TRACE
Wed Aug 15 04:13:03 2007
d e
$
c a
the Record Section tabbed page.
e A
f) Optionally, to view information about the physical structure of the database, click

c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 84
Practice 14-1: Configuring Your Database for Recovery
(continued)
g) Your numbers could look different. For additional information, click Help in the
top-right corner of the page.
2) Review the flash recovery area configuration and change the size to 8 GB.
a) In Enterprise Manager, select Availability > Recovery Settings in the Setup
section.
b) Scroll to the bottom of the page.

m y
d e
c a
e A
l
c) Question: Is the flash recovery area enabled?
c
Answer: Yes, by default.
r a
d) Note the location of the flash recovery area.
O ly
For example: /u01/app/oracle/flash_recovery_area

l & On
e) Question: Which essential DBA tasks can you perform in this section?

a e
Answer: You can change the location, size or retention time for the flash recovery
n
t e r U s
area, as well as enable the Flashback Database functionality.
f) Question: Does changing the size of the flash recovery area require the database

n
to be restarted?
I
c l e
Answer: No, a restart is not required for this change.
g) Change the size of the Flash Recovery Area to 8 GB, by entering 8 into the

r a “Flash Recovery Area Size” field.


h) Optionally, click Show SQL, review the statement and click Return.
O
Oracle Database 11g: Administration Workshop I A - 85
Practice 14-1: Configuring Your Database for Recovery
(continued)

i) Click Apply.
3) Check how many members each redo log group has. Ensure that there are at least two
redo log members in each group. One set of members should be stored in the flash
recovery area.
a) Click Server > Redo Log Groups, and note how many members are in the “# of
Members” column.
Answer: There is only one member in each group.

m y
d e
c a
e A
c l
r a
b) To add a member to each group, perform the following steps for each group:

O ly
i) Select the group (for example, 1) and click the Edit button.

l & On
ii) On the Edit Redo Log Group page, note the File Name, for example
“redo01.log” and click the Add button.

n a e
iii) On the Edit Redo Log Group: Add Redo Log Member page, enter a file name

t e r U s
by adding the letter “b” to the end of the name (before the dot). For example,
enter redo01b.log as File Name and enter your flash recovery area, for

I n
example, /u01/app/oracle/flash_recovery_area/ as File
Directory.

c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 86
Practice 14-1: Configuring Your Database for Recovery
(continued)
iv) Click Continue.
v) On the Edit Redo Log Group page, review the current members.
Note: If you forget to add the last slash to the directory name, the system does
it for you.

vi) Optionally, click Show SQL to review the command, and then Return.

m y
d e
vii) Click Apply.
c a
e A
viii) You should receive a success message. Return to the Redo Log Groups page
and repeat the above sequence of steps (under 3 b) for the next redo log
group.
c l
r a
c) You are finished with this task, when the # of members displays 2 for each group.

O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 87
Practice 14-1: Configuring Your Database for Recovery
(continued)

d) Note: In a production database, you want to ensure that the two members are on
different hard drives, preferably with different disk controllers, to minimize the
risk of any single hardware failure destroying an entire log group.
4) You notice that, for each log group, the Archived column has a value of No. This
means that your database is not retaining copies of redo logs to use for database
m y
e
recovery, and in the event of a failure, you will lose all data since your last backup.
d
Place your database in ARCHIVELOG mode, so that redo logs are archived.

c
Note: You must continue with step 5, so that your changes are applied. a
section.
e A
a) In Enterprise Manager, select Availability > Recovery Settings in the Setup

c l
b) In the Media Recovery region, select the ARCHIVELOG Mode check box.

r a
c) Verify that Log Archive Filename Format contains %t, %s, and %r.

O ly
l & On
n a e
t e r U s
I n
l e
5) Configure redundant archive log destinations—one to the flash recovery area and the

c
other to /u01/app/oracle/product/11.1.0/db_1/dbs/arch. Notice

r athat the database is preconfigured to save archived logs to the flash recovery area
(Archive Log Destination 10), as well as to a redundant location (Archive Log
O Destination 1).

Oracle Database 11g: Administration Workshop I A - 88


Practice 14-1: Configuring Your Database for Recovery
(continued)
Note: If you add archive log destinations, you must create the directory, if it does not
already exist.
a) Click Apply.
b) When prompted whether you want to restart the database now, click Yes.
c) Enter the credentials to restart the database (oracle as the Host Credentials, and
sys/oracle as SYSDBA as Database Credentials), and then click OK.
d) When asked to confirm, click Yes again.
e) Should you receive an error during the shutdown and startup activity, click OK to
acknowledge the error, and then click Refresh again. (You might have been
simply faster than the database.)
6) Optionally, use SQL*Plus to check if your database is in ARCHIVELOG mode. In a
terminal window, execute the following commands:
sqlplus / as sysdba
archive log list
exit

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
Now that your database is in ARCHIVELOG mode, it will continually archive a

I n
copy of each online redo log file before reusing it for additional redo data.

c l e
Note: Remember that this consumes space on the disk and that you must regularly
back up older archive logs to some other storage.

r a
O
Oracle Database 11g: Administration Workshop I A - 89
Practices for Lesson 15
Background: Your database is ready to move from development and testing into
production. Ensure that your database is configured so that recovery is possible without
loss of data. Establish the backup policy to automatically back up the SPFILE and
control file. Perform an immediate backup to disk and schedule nightly backup jobs that
repeat indefinitely.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 90
Practice 15-1: Performing Database Backups
In this practice, you perform an immediate backup to disk and schedule a nightly backup
job.
1) What is the difference between a backup set and an image copy?
Answer: A backup set contains data and archive log files packed in an Oracle
proprietary format. Files must be extracted before use. Image copies are the
equivalent of operating system file copies and can be used to restore operations
immediately.
2) What is the destination of any disk backups that are done?
a) In Enterprise Manager, select Availability > Backup Settings.

m y
d e
c a
e A
c l
b) Note the message under the Disk Backup Location that says the flash recovery

r a
area is the current disk backup location.

O ly
3) Establish the backup policy to automatically backup the SPFILE and control file.

& On
a) Click the Policy tab under the Backup Settings pages.
l
n a e
b) Click Automatically backup the control file and server parameter file
(SPFILE) with every backup and database structural change.

t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 91
Practice 15-1: Performing Database Backups (continued)

c) Scroll to the bottom and enter oracle and oracle for Host Credentials
Username and Password for your server, and click “Save as Preferred
Credential.”
4) Test making a backup to disk, as a backup set, with oracle for Host Credentials.
a) Click the Device tab under the Backup Settings pages.

m y
b) Select Backup Set as your Disk Backup Type.
c) Scroll to the bottom and ensure the Host Credentials are set to oracle.
d e
d) Scroll to the top of the page and click Test Disk Backup.
c a
A
e) A processing message appears. When the test finishes, click OK.

e
c l
5) Back up your entire database, without archived logs, while the database is open for
user activity. This backup should be the base for an incremental backup strategy.

r a
a) Question: What prerequisite must be met to create a valid backup of a database
without shutting it down?
O ly
l & On
Answer: The database must be in ARCHIVELOG mode. Backups made with the
database open, but not in ARCHIVELOG mode, cannot be used for recovery.

a e
b) Select Availability > Schedule Backup (in the Manage section).
n
t e r U s
If you find that the Oracle-Suggested Backup strategy fits your needs exactly, you
would chose this option. For practice purposes, you will schedule a customized
backup
I n
c l e
c) Select Whole Database as the object to be backed up.
d) Confirm or enter oracle and oracle for Host Credentials Username and

r a Password for your server.

O e) Click Schedule Customized Backup.

Oracle Database 11g: Administration Workshop I A - 92


Practice 15-1: Performing Database Backups (continued)
f) On the Schedule Customized Backup: Options page, select Full Backup for your
Backup Type, and select the Use as the base of an incremental backup strategy
check box.
g) Select Online Backup as Backup Mode.
h) In the Advanced section, select “Also back up all archived logs on disk” and
“Delete all archived logs from disk after they are successfully backed up”,
and then click Next to continue.
i) On the Schedule Customized Backup: Settings page, select Disk for your backup
location. (Notice that your Disk Backup Location is retained and that you could
override the current settings for a one-off backup. But do not click it this time.)

m y
d e
c a
e A
j) Click Next.
c l
r
then click Next to continue.a
k) Accept all the defaults on the Schedule Customized Backup: Schedule page and

O ly
Note: Schedule Type should be One Time (Immediately).

l & On
l) On the Schedule Customized Backup: Review page, review the RMAN script,
and then click Submit Job.

n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 93
Practice 15-1: Performing Database Backups (continued)

m) Click View Job to monitor the status of the backup job. The time for this backup
depends on your hardware and system resources.
n) Click your browser’s Refresh or Requery button until the job is completed.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 94
Practice 15-1: Performing Database Backups (continued)
6) Schedule nightly disk-based incremental online backups for your whole database,
without archived logs. Schedule it for execution at 11:00 PM. The schedule should be
in effect indefinitely.
a) In Enterprise Manager, select Availability > Schedule Backup (in the Manage
section).
b) Select Whole Database as the object to be backed up.
c) Confirm or enter oracle and oracle for Host Credentials Username and
Password for your server, and then click Schedule Customized Backup.
d) On the Schedule Customized Backup: Options page, select Incremental Backup
as your Backup Type.
e) Select Online Backup as Backup Mode.
f) In the Advanced region, select “Also backup all archived logs on disk” and
“Delete all archived logs from disk after they are successfully backed up”,
and then click Next to continue.
g) On the Schedule Customized Backup: Settings page, select Disk as your backup
location, and then click Next to continue.
h) On the Schedule Customized Backup: Schedule page, change Job Name to
Nightly_Backup and accept the default value for Job Description.
i) Select Repeating in the Schedule region. Notice how additional context sensitive
m y
details are displayed.

d e
j) Select By Days from the Frequency Type drop-down list, enter 1 in the Repeat

c a
Every field, confirm that Indefinite is selected as the Repeat Until value, and enter
11 PM as Time.

e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 95
Practice 15-1: Performing Database Backups (continued)

m y
k) Click Next to continue.
d e
RMAN script.
c a
l) On the Schedule Customized Backup: Review page, review your Settings and

e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
l e
m) Click Submit Job, and then click OK.
c
r a
n) Click Jobs on the Availability page in the Related Links section to see the
scheduled job in the Job Activity list.

O
Oracle Database 11g: Administration Workshop I A - 96
Practice 15-1: Performing Database Backups (continued)

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 97
Practices for Lesson 16
Background: Many failures of the Oracle database can be traced to some sort of media
failure, such as disk or controller failure. Recover your database from a variety of
simulated media failures, such as recovering form the loss of a control file, a redo log
member, a data file, and a file in the SYSTEM tablespace.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 98
Practice 16-1: Performing Database Recovery
In this practice, you encounter a number of problems from which you need to recover the
database.
• Recover from the loss of a control file.
• Recover from the loss of a redo log member.
• Recover from the loss of a data file.
• Recover from the loss of a file in the SYSTEM tablespace
SQL script files are provided for you in the /home/oracle/labs directory. If
needed, use the appendixes for Linux and for SQL syntax. After you set up a failure with
a SQL script, you must complete the recovery before continuing with any other practice.
Note: Your system may have different OS file names than shown here. Your output
might look different. (To conserve space, blank lines have been removed.)
1) Before setting up an individual problem, you need to navigate to your working
directory and (in SQL*Plus) execute the lab_16_01.sql script as the SYS user.
This script prepares some procedures to be called by the rest of this practice.
cd /home/oracle/labs
sqlplus / as sysdba
@lab_16_01.sql

$ cd /home/oracle/labs
$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Wed Aug 15


m y
07:57:04 2007
Copyright (c) 1982, 2007, Oracle. All rights reserved.
d e
Connected to:
c a
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
e A
Testing options
c l
With the Partitioning, OLAP, Data Mining and Real Application

SQL> @lab_16_01.sql
r a
Connected.
O ly
& On
Java created.

l
Procedure created.

a e
PL/SQL procedure successfully completed.

n
PL/SQL procedure successfully completed.

r s
PL/SQL procedure successfully

e
PL/SQL procedure successfully

t U
PL/SQL procedure successfully
completed.
completed.
completed.

I n
PL/SQL procedure successfully
Synonym created.
completed.

l e
Grant succeeded.

c
SQL>

r a
2) Lose a control file and the recover from the loss.

O a) Continue in your SQL*Plus session as the SYS user. Execute the


lab_16_02.sql script. This script deletes one of your control files.

Oracle Database 11g: Administration Workshop I A - 99


Practice 16-1: Performing Database Recovery (continued)
@lab_16_02.sql

SQL> @lab_16_02.sql

PL/SQL procedure successfully completed.

"Control file deleted."


SQL>

b) The Help desk begins receiving calls saying that the database appears to be down.
Troubleshoot and recover as necessary. Use Enterprise Manager to try to start up
the database, and use SQL*Plus if needed.
i) In Enterprise Manager, navigate to the Database home page. It reports that the
database is down and offers you the chance to start it up again.
ii) Click Startup. If you see a Connection Refused message, ignore it; the
connection will eventually be established.
iii) Enter oracle as Username and Password for Host Credentials, enter
sys/oracle as SYSDBA as Database Credentials, and click OK.
iv) Click Yes to confirm your attempted startup.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 100
Practice 16-1: Performing Database Recovery (continued)

m y
d e
c a
A
c) The startup of the instance fails with Enterprise Manager. Click View Details for
e
more information.

c l
d) Note the following, and then click OK:

r a
ORA-00205: error in identifying control file, check alert
log for more info
O ly
l & On
e) Alternatively, in a new SQL*Plus session, check the current status of the instance
as the SYS user and attempt to mount it with the following commands:

n a e
select status from v$instance;

t e r
alter database mount;

U s
I n
sqlplus / as sysdba
SQL> select status from v$instance;

e
STATUS

l
------------

c
STARTED

r a
SQL> alter database mount;

O alter database mount


*

Oracle Database 11g: Administration Workshop I A - 101


Practice 16-1: Performing Database Recovery (continued)
ERROR at line 1:
ORA-00205: error in identifying control file, check alert log
for more info

f) The instance cannot move to the mount stage because it cannot find one of the
control files. To find the locations of the alert log and of diagnostic information,
enter:
SELECT NAME, VALUE FROM V$DIAG_INFO;

NAME
--------------------------------------------------------------
VALUE
--------------------------------------------------------------
Diag Enabled
TRUE

ADR Base
/u01/app/oracle

ADR Home
/u01/app/oracle/diag/rdbms/orcl/orcl

Diag Trace
/u01/app/oracle/diag/rdbms/orcl/orcl/trace
m y
Diag Alert
d e
/u01/app/oracle/diag/rdbms/orcl/orcl/alert

c a
Diag Incident
/u01/app/oracle/diag/rdbms/orcl/orcl/incident

e A
Diag Cdump
c l
a
/u01/app/oracle/diag/rdbms/orcl/orcl/cdump

r
Health Monitor
O ly
/u01/app/oracle/diag/rdbms/orcl/orcl/hm

Default Trace File


l & On
a e
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_17234.trc

n
e r
Active Problem Count
0
t U s
I n
Active Incident Count
0

c l e
r a
11 rows selected.
SQL>

O
Oracle Database 11g: Administration Workshop I A - 102
Practice 16-1: Performing Database Recovery (continued)
g) To look at the last 25 lines in the log.xml file, enter the following command
(on one line):
host tail -25
/u01/app/oracle/diag/rdbms/orcl/orcl/alert/log.xml

SQL> host tail -25


/u01/app/oracle/diag/rdbms/orcl/orcl/alert/log.xml
</msg>
<msg time='2007-08-15T08:42:25.983+07:00' org_id='oracle'
comp_id='rdbms'
msg_id='opiexe:2924:4222364190' client_id=''
type='NOTIFICATION'
group='admin_ddl' level='16'
module='sqlplus@edt3r10p1.us.oracle.com (TNS V1-V3)'
pid='4143'>
<txt>alter database mount
</txt>
</msg>
<msg time='2007-08-15T08:42:25.990+07:00' org_id='oracle'
comp_id='rdbms'
client_id='' type='UNKNOWN' level='16'
module='' pid='3767'>
<txt>ORA-00210: cannot open the specified control file
ORA-00202: control file:
&apos;/u01/app/oracle/oradata/orcl/control02.ctl&apos;
m y
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
d e
Additional information: 3
</txt>
c a
</msg>

e
<msg time='2007-08-15T08:42:28.983+07:00' org_id='oracle' A
comp_id='rdbms'

c l
msg_id='opiexe:2986:2780954927' client_id=''
type='NOTIFICATION'
group='admin_ddl' level='16'
r a
O ly
module='sqlplus@edt3r10p1.us.oracle.com (TNS V1-V3)'

& On
pid='4143'>

</txt>
l
<txt>ORA-205 signalled during: alter database mount...

a e
</msg>
SQL>
r n s
t e U
h) Note that in the preceding example, the control02.ctl file is missing. This

n
I
might be different in your environment. Restore the control file that is missing for
your database by copying an existing control file. Enter the following command
e
c l
with your correct file names (on one line):

r a host cp /u01/app/oracle/oradata/orcl/control01.ctl
/u01/app/oracle/oradata/orcl/control02.ctl

O
Oracle Database 11g: Administration Workshop I A - 103
Practice 16-1: Performing Database Recovery (continued)
SQL> host cp /u01/app/oracle/oradata/orcl/control01.ctl
/u01/app/oracle/oradata/orcl/control02.ctl

SQL>
i) (Optional) To view the content of the directory, enter:
host ls /u01/app/oracle/oradata/orcl

SQL> host ls /u01/app/oracle/oradata/orcl


control01.ctl example01.dbf redo03.log temp01.dbf
control02.ctl redo01.log sysaux01.dbf undotbs01.dbf
control03.ctl redo02.log system01.dbf users01.dbf
SQL>

j) Now mount and open the database with the following commands:
connect / as sysdba
alter database mount;
alter database open;

SQL> connect / as sysdba


Connected.
SQL> alter database mount;

Database altered.
m y
SQL> alter database open;
d e
Database altered.
c a
SQL>
e A
c l
k) Why did you have to use two commands to move the instance state from
NOMOUNT to OPEN?
r a
O ly
Answer: Because the ALTER DATABASE command enables you to change only
one state level for each command

l & On
l) Why did you use operating system commands to restore the control file instead of

a e
using Oracle Recovery Manager?

n
t e r
Answer: Because all control files are identical. As long as any one control file is
s
intact, it can be used to restore the others.
U
I n
m) Exit all sessions and close all windows
3) Recover from the loss of a redo log member. Navigate to your working directory and
l e
in SQL*Plus execute the lab_16_03.sql script as the SYS user. The
c
lab_16_03.sql script deletes one of your redo log files. See the error in the alert

r alog and recover from it.

O a) Enter the following commands:

Oracle Database 11g: Administration Workshop I A - 104


Practice 16-1: Performing Database Recovery (continued)
cd /home/oracle/labs
sqlplus / as sysdba
@lab_16_03.sql

$ cd /home/oracle/labs
$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Wed Aug 15


09:22:07 2007

Copyright (c) 1982, 2007, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options

SQL> @lab_16_03.sql

PL/SQL procedure successfully completed.

"One member of redo log group deleted."


SQL>
m y
d e
b) The database continues to function normally, and no users are complaining. Log
in to Enterprise Manager as sys/oracle as SYSDBA. On the Database home
page, view alerts similar to the following ones:
c a
e A
c l
r a
O ly
& On
c) Click Availability > Perform Recovery (in the Manage section).

l
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 105
Practice 16-1: Performing Database Recovery (continued)

d) On the Perform Recovery page, you see the Failure Description and could directly
m y
e
begin correcting the failure. But for practice purposes, you follow the steps in the
d
the ways to invoke the Data Recovery Advisor).
c a
Data Recovery Advisor. Click the “Advise and Recover” button (which is one of

e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 106
Practice 16-1: Performing Database Recovery (continued)
e) On the View and Manage Failures page, ensure that the failure is selected, and
click Advise.

f) The Manual Actions page suggests to manually restore it. In the preceding
example redo03.log is deleted. Do not click any button at this point in
time.

g) In a new terminal window as the oracle user, copy an existing redo log from
the same to the missing file. Make sure that you are replacing the file names as
m y
appropriate for your failure.
d e
cd /u01/app/oracle/oradata/orcl
ls
c a
cp /u01/app/oracle/flash_recovery_area/redo03b.log redo03.log
ls

e A
exit

c l
r
$ cd /u01/app/oracle/oradata/orcl
$ ls a
control02.ctl redo01.log O ly
control01.ctl example01.dbf sysaux01.dbf undotbs01.dbf
system01.dbf users01.dbf
control03.ctl redo02.log

l & On
temp01.dbf
$ cp /u01/app/oracle/flash_recovery_area/redo03b.log redo03.log
$ ls

n a e
r
control02.ctl redo01.log

t
control03.ctl redo02.log
U s
control01.ctl example01.dbf redo03.log

e
temp01.dbf
sysaux01.dbf undotbs01.dbf
system01.dbf users01.dbf
$ exit
I n
c l e
h) Now return to your Manual Actions page in Enterprise Manager and click the
“Re-assess Failures” button.

r a
i) Note that the failure is closed.
j) Question: Why did the database not crash?
O
Oracle Database 11g: Administration Workshop I A - 107
Practice 16-1: Performing Database Recovery (continued)
k) Answer: Because a single missing member is noncritical and does not affect the
operation of the database. As long as there is at least one good member for each
log group, the database operation continues.
4) Recover from the loss of an application data file.
a) In a SQL*Plus session as the SYS user, execute the lab_16_04.sql script
from your working directory. This script deletes one of your application data files.
sqlplus / as sysdba
@lab_16_04.sql

$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Thu Jul 5


21:57:58 2007

Copyright (c) 1982, 2007, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options

SQL> @lab_16_04.sql
m y
PL/SQL procedure successfully completed.
d e
"Data file deleted. Database should be open."
c a
SQL>

e A
b) The Help desk has received a call from a user who is unable to access the
l
COUNTRIES table in the HR application schema. Count the rows in the table to
c
r a
determine whether there is a problem.
SQL> select count(*) from HR.COUNTRIES;

O ly
select count(*) from HR.COUNTRIES

ERROR at line 1:
*

l & On
n
ORA-01110: data file 5:
a e
ORA-01116: error in opening database file 5

t e r U s
'/u01/app/oracle/oradata/orcl/example01.dbf'
ORA-27041: unable to open file

n
Linux Error: 2: No such file or directory

I
Additional information: 3

e
l
SQL>

c
r ac) Troubleshoot and recover as necessary. The error message suggests that the
example01.dbf data file is corrupt or missing.

O d) In Enterprise Manager, click Availability > Perform Recovery.

Oracle Database 11g: Administration Workshop I A - 108


Practice 16-1: Performing Database Recovery (continued)
e) Click Advise and Recover.
f) On the View and Manage Failures page, click the plus (+) icon under failure
description. You should see a failure like the following:

g) With the failure selected, click Advise.

h) Because the file was not just renamed or moved, but deleted, you continue by
clicking “Continue with Advise”.

m y
d e
c a
e A
c l
r a
O ly
l & On
i) On the Recovery Advise page, you see the RMAN script. Click Continue.

a e
j) On the Review page you see the failure and the suggested solution. Click
n
t e r
“Submit Recovery Job.”

U s
k) A Processing window appears, followed by the Job Activity page. You should see

I n
a message that the job was successfully created. (Your link name is probably
different.)

c l e
r a
O l) Click the job name link.

Oracle Database 11g: Administration Workshop I A - 109


Practice 16-1: Performing Database Recovery (continued)
m) On the Job Run page, check the Status in the Summary section. If it is Running,
use you browser’s Refresh or Requery button until the job is completed.

n) In your SQL*Plus session, verify that the HR.COUNTRIES table is now


accessible.
SQL> select count(*) from HR.COUNTRIES;

COUNT(*)
----------
25

5) Recover from the loss of a system data file.


a) Why is recovery from the loss of a system data file or a data file belonging to an
undo tablespace different from recovering an application data file?
Answer: Because recovery of system or undo data files must be done with the

m
database closed, whereas recovery of an application data file can be done with the y
database open and available to users

d e
b) As the SYS user, execute the lab_16_05.sql script in your working directory.
This script deletes the system data file.
c a
SQL> @lab_16_05.sql

e A
l
PL/SQL procedure successfully completed.

c
r a
"File in the SYSTEM tablespace deleted. Crash the database."
SQL>

O ly
c) In Enterprise Manager, review the Database home page. If you see a message that

the browser.
l & On
says the connection was refused, dismiss it and reenter the EM home page URL in

n a e
t e r U s
I n
c l e
r a
O d) The database is shut down, so you click Startup to try to open it.

Oracle Database 11g: Administration Workshop I A - 110


Practice 16-1: Performing Database Recovery (continued)
e) On the ‘Startup/Shutdown:Specify Host and Target Database Credentials’ page,
enter oracle and oracle as Host Credentials. Enter SYS, oracle, and
SYSDBA as the Database Credentials, and then click OK.
f) On the Startup/Shutdown:Confirmation page, click Yes.
g) A progress page appears, followed by an error message.

h) Note that the database is in a mounted state. Click Perform Recovery.


m y
i) Enter oracle and oracle as Host Credentials, and click Continue.
d e
a
j) On the Database Login page, enter SYS, oracle, and SYSDBA and click Login.
c
A
On the Perform Recovery page, you could choose the Oracle Advised Recovery,
but for practice purposes, continue with a User Directed Recovery.
e
l
k) Select Datafiles from the Recovery Scope drop-down list and “Recover to
c
r a
current time” as Operation Type. Enter oracle and oracle as Host
Credentials, and then click Recover.

O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 111
Practice 16-1: Performing Database Recovery (continued)

l) On the Perform Object Level Recovery: Datafiles page, you should see the
missing data file. Click Next.
m) Because the problem is simply a deleted file rather than a bad hard drive, there is
no need to restore to a different location. Select “No. Restore the files to the
default location” and then click Next.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
n) On the Perform Object Level Recovery: Review page, view your current options

c l e
and the data file. Click Edit RMAN Script to review the RMAN commands.

r a
O
Oracle Database 11g: Administration Workshop I A - 112
Practice 16-1: Performing Database Recovery (continued)

o) Click Submit.
p) A processing page appears, followed by the Perform Recovery: Result page. The
duration of this operation depends on your system resources. The recovery
operation should be successful.

m y
d e
c a
e A
c l
r a
O ly
l & On
q) On the Perform Recovery: Result page, click Open Database.

a e
r) After you see the success message, click OK.
n
t e r U s
s) Verify that the database is open and operating normally by logging into EM as
SYS/oracle as SYSDBA, and reviewing the Database home page.

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 113
Practices for Lesson 17
Background: In the recent past, you received a number of questions about the HR
schema. To analyze them without interfering in daily activities, you decide to use the
Data Pump Wizard to export the HR schema to file. When you perform the export, you
are not sure into which database you will be importing this schema.

In the end, you learn that the only database for which management approves an import is
the ORCL database. So you perform the import with the Data Pump Wizard, remapping
the HR schema to DBA1 schema.

Then you receive two data load requests for which you decide to use SQL*Loader.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 114
Practice 17-1: Moving Data
1) Review the lab_17_01.sql script, which grants the DBA1 user privileges on the
DATA_PUMP_DIR directory
a) Double-click the oracle’s Home icon on your desktop, double-click labs, and
then double-click lab_17_01.sql to review this script. Close the
lab_17_01.sql window.
2) Execute the lab_17_02.sh script.
a) Double-click the XTerm icon on your desktop, and navigate to the
/home/oracle/labs directory by entering cd labs.
b) Enter ./lab_17_02.sh
3) Log in to Enterprise Manager as the DBA1 user in the Normal role and export the
HR schema.
a) Invoke Enterprise Manager as the DBA1 user in the Normal role for your ORCL
database. The Connect As setting should be Normal.
If this is the first time that the DBA1 user logs in, click I agree to accept the
licensing agreement.
b) Select Data Movement > Move Row Data > Export to Export Files.
c) Select Schemas, enter oracle as Username and Password, select Save as
m y
Preferred Credential, and then click Continue.

d e
d) On the Export: Schemas page, click Add, select the HR schema, and then click the
Select button.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I
e) Click Next.
n
c l e
f) On the “Export: Options” page, select DATA_PUMP_DIR from the Directory
Objects drop-down list, and enter hrexp.log as Log File.

Ora g) Review Advanced Options (but do not change), and then click Next.
h) On the “Export: Files” page, select DATA_PUMP_DIR from the Directory
Object drop-down list, enter HREXP%U.DMP as File Name, and then click Next.

Oracle Database 11g: Administration Workshop I A - 115


Practice 17-1: Moving Data (continued)
i) On the “Export: Schedule” page, enter hrexp as Job Name and Export HR
schema as Description, accept the immediate job start time, and then click
Next.
j) On the “Export: Review” page, click Show PL/SQL and review the PL/SQL that
the Export Wizard helped you to create.
k) Click Submit to submit the job
4) As the DBA1 user, import the exported HR schema back into the ORCL database.
a) To get a feeling for the command line interface, you can use the impdp utility
from the command line to import the EMPLOYEES table into the DBA1 user
schema. (Enter the following without pressing [Enter] before reaching the end of
the command.)
$ impdp dba1/oracle DIRECTORY= data_pump_dir DUMPFILE=HREXP01.DMP
REMAP_SCHEMA= hr:dba1 TABLES= employees

b) Verify that the import succeeded by viewing the log file.


Note: You may see errors on constraints and triggers not being created because only
the EMPLOYEES table is imported and not the other objects in the schema. These
errors are expected.
$ cat /u01/app/oracle/product/11.1/db_1/rdbms/log/empimport.log

c) Using SQL*Plus, connect to the database as the DBA1 user. m y


$ sqlplus DBA1/oracle
d e
c a
d) Select data from tables in the DBA1 schema, for verification of the import.
SQL> select * from employees;

e A
c l
5) As the DBA1 user, load data into the PRODUCT_MASTER table by using
SQL*Loader via Enterprise Manager Database Control.

r a
a) Invoke Enterprise Manager as the DBA1 user in the Normal role for your ORCL
database.
O ly
& On
b) Select Data Movement > Move Row Data > Load Data from User Files.
l
a e
c) Click Use Existing Control File.

n
t e r
d) If you have not done so before, enter oracle as Username and as Password,
s
click Save as Preferred Credential, and then click Continue.
U
I n
e) On the “Load Data: Control File” page, enter
/home/oracle/labs/lab_17_05.ctl as control file name and path, or

c l e
use the flashlight icon to select this control file. Click Next.
f) On the “Load Data: Data File” page, click Provide the full path and name on

r a the database server machine and enter

O /home/oracle/labs/lab_17_05.dat as data file name and path, or use


the flashlight icon to select this data file. Click Next.

Oracle Database 11g: Administration Workshop I A - 116


Practice 17-1: Moving Data (continued)
g) On the “Load Data: Load Method” page, accept Conventional Path, and then
click Next.
h) On the “Load Data: Options” page, accept all defaults, but enter
/home/oracle/labs/lab_17_05.log as log file name and path.
i) Review the advanced options, but do not change any, and then click Next.
j) On the “Load Data: Schedule” page, enter lab_17_05 as Job Name and Load
data into the PRODUCT_MASTER table as Description. Let the job
start immediately, and then click Next.

m y
d e
c a
parameters, and then click Submit Job.
e A
k) On the “Load Data: Review” page, review the loading information and

c l
l) Confirm your results by viewing your lab_17_05.log file in your
/home/oracle/labs directory.
r a
6) As the INVENTORY user, load data into the PRODUCT_ON_HAND table by using
SQL*Loader command line. O ly
& On
a) Invoke a terminal window and navigate to the /home/oracle/labs directory.
l
a e
b) Enter the following SQL*Loader command (in continuation, without pressing
n
t e r
[Enter] before reaching the end of the command):

U s
$ sqlldr userid=inventory/verysecure control=lab_17_06.ctl

n
log=lab_17_06.log data=lab_17_06.dat.

I
c l e
$ sqlldr userid=inventory/verysecure control=lab_17_06.ctl
log=lab_17_06.log data=lab_17_06.dat

Ora SQL*Loader: Release 11.1.0.1.0 - Production on Tue Jun 12


22:24:44 2007

Copyright © 1982, 2005, Oracle. All rights reserved.

Oracle Database 11g: Administration Workshop I A - 117


Practice 17-1: Moving Data (continued)
Commit point reached – logical record count 64
Commit point reached – logical record count 82
Commit point reached – logical record count 83

c) Confirm your results by viewing your lab_17_06.log file in your


/home/oracle/labs directory.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 118
Practices for Lesson 18

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 119
Practice 18-1: Investigating a Critical Error
In this practice, you investigate a critical error. A data block has been corrupted. Use the
Enterprise Manager Support Workbench, Health Checkers, and advisors to react to the
error.
1) Set up the database for the practice. The setup places the database in ARCHIVELOG
mode, creates a tablespace for the practice, and performs a tablespace backup. These
actions place the database in a mode that more closely resembles a production
database. Run the setup_p18.sh script. The scripts for this practice are in the
$HOME/labs directory.
$ cd $HOME/labs
$ ./setup_p18.sh

2) Run the cr_critical.sql script from SQL*Plus connected as sysdba to


create the critical error. The script prompts you for a block number; enter the block
number given by the script. Notice the error message. In our scenario, the error
message could originally be seen by anyone and not reported immediately to the
DBA.
$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Fri Aug 10


18:29:13 2007

m y
e
Copyright (c) 1982, 2007, Oracle. All rights reserved.

a d
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
A c
c l e
With the Partitioning, OLAP and Data Mining options

a
SQL> @cr_critical.sql
Connected.

FILE_NO BLOCK_NO
r
O ly
---------- ----------
6 12
l & On
n a e
'Enter Block number when prompted'

0+1 records in
t e r U s
Enter value for block_no: 12

n
0+1 records out

e I
0+1 records in
0+1 records out

c l
r aSystem altered.

O SELECT * from js.jscopy


*

Oracle Database 11g: Administration Workshop I A - 120


Practice 18-1: Investigating a Critical Error (continued)
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 6, block # 12)
ORA-01110: data file 6:
'/u01/app/oracle/oradata/orcl/jstbs01.dbf'

Disconnected from Oracle Database 11g Enterprise Edition


Release 11.1.0.6.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@edtdr10p0 P18]$
3) View the alerts on the EM database home page and investigate the alert details. When
the incident appears in the alerts, click the Active Incidents link.
You should see one or more critical alerts. Depending on the timing you may see one
or more of the following:

m y
The number of Active Incidents may not match the number of alerts immediately.
Click the Active Incidents link.
d e
c a
e A
c l
r a
O ly
l & On
a e
4) Investigate the details of the problem.

n
t e r
description ORA 1578.
U s
On the Support Workbench page and Problems tab, expand the problem with the

I n
Click the incident number of the most recent (first listed) incident.

e
5) Examine the Incident Details page. Notice that the SQL text of the statement that
l
received the error is listed, and the session information. Depending on the error this
c
information can be very helpful in troubleshooting the error.

r a
6) View a trace file.

O
Oracle Database 11g: Administration Workshop I A - 121
Practice 18-1: Investigating a Critical Error (continued)
Click the eyeglasses icon to view the first trace file listed. If you are prompted for
Host Login Credentials, enter user oracle and password oracle.
On the Contents page, you can see the trace file. Sections of the trace file can be
expanded or collapsed. The trace file is intended for Oracle internal use. Click OK.
Click Support Workbench link in the breadcrumb at the top of the page to return to
the Support Workbench page.
7) Determine how to resolve the problem.
Click Id of the ORA 1578 problem. When the problem details page appears, notice
that the Investigate and Resolve section has two tabs that allow you to pursue the
solution yourself or enlist the aid of Oracle Support.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 122
Practice 18-1: Investigating a Critical Error (continued)

Get Checker information about the problem. Click Support Workbench in the
breadcrumb at the top of the page to return to the Support Workbench page. Click
Checker Findings tab.
8) Get advise. Under the Checker Findings tab, in the Data Corruption section, Select
the finding with the description that starts with “Datafile …” and click Launch
Recovery Advisor.
Note: The data file number given in the description is the same as the FILE_NO
m y
shown in the cr_critical.sql script in step 2.
d e
selected, and then click Advise.
c a
a) On the View and Manage Failures page, confirm that the failure “Datafile …” is

e
perform a block media recovery. Click Continue. A
b) The Recovery Advice page recommends an RMAN script. This script will

c l
c) The Review page shows the failures that will be resolved. Click Submit
Recovery Job.
r a
O ly
d) The Processing page may appear briefly, after which the Job Activity page
appears. The Job Status shows Running. Refresh the page after a few moments
& On
and repeat until the page shows No Jobs Found.
l
a e
9) Navigate to the Database Home page. Notice that the alerts have been cleared.

n
directory.
t e r U s
10) When finished, run the cleanup_p18.sh script from the $HOME/labs

I n
$ cd $HOME/labs
$ ./cleanup_p18.sh

c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 123
Practice 18-2: Staging a Patch
In this practice, you stage a patch for later installation. The patch has been downloaded
from MetaLink to a local directory.
1) Upload a patch file from the local machine at $HOME/labs/p6198642.zip to
the Enterprise Manager patch cache.
a) On the Database home page of Enterprise Manager, click the Software and
Support tab, and then click View Patch Cache.
b) On the Patch Cache page, click Upload Patch File.
c) On the Create Oracle Software Update Component page, click Browse to find the
patch file. Select the $HOME/labs/p6198642.zip file in the File Upload
window and then click Open.
d) From the README.txt file inside the zipped patch file the following information
has been obtained. Enter the following on the Create Oracle Software Update
Component page. The Release field cannot be selected from the pulldown menu.
Most of the other values may be selected from a list.
Patch Number : 6198642
Patch Type : Patch
Created On : 07-JUL-2007
Description : Dummy Patch for testing
m y
Product Family : Oracle Database
d e
Product : Oracle Database
Release : 11.1.0.6
c a
Platform : Linux x86
e A
Language : American English
c l
a
e) Select Add Patch File to Patch Cache.
r
f) Click Upload.
O ly
l & On
2) Apply the patch to your database using the EM Apply Patch wizard.
a) From the Database home page, and the Software and Support tab, click Apply
Patch.
n a e
t e r U s
b) On the Select Patches page, click Add Patches.
c) On the Search And Select Patches page, confirm that Search Software Library

I n
is selected, and Click Go.

c l e
d) Select the patch that matches the one you uploaded in the previous steps.
e) Click Select.

r af) On the Select Patches page, click Next.

O
Oracle Database 11g: Administration Workshop I A - 124
Practice 18-2: Staging a Patch (continued)
g) On the Credentials and Schedule page, select Override Preferred, and enter the
Host credentials for the oracle software owner. In this practice, the username is
oracle and the password is oracle. In the Schedule section select One Time
(Immediately). Click Next.
h) On the Review page, check the parameters and click Finish.
i) On the Deployment Procedure Manager page, the Patch Oracle Standalone
Database job is shown with a status of running. The patch procedure stops the
dbconsole, so you cannot view the progress of the job from EM. The LISTENER
and database will be stopped, and the software will be patched. The database
components will be restarted.
3) View the patches that are installed.
a) When the Enterprise Manager is available, Navigate to the Patch Advisor page.
b) On the Patch Advisor page, click Interim Patches Applied in the Related Links
sections.
c) The Oracle Home: /u01/app/oracle/product/11.1.0/db_1 (OraDb11g_home1) page
is displayed with a list of components, patches applied, and targets.
d) Exit Enterprise Manger.
4) Remove the patch from the database with $HOME/labs/cleanup_patch.sh.
$ $HOME/labs/cleanup_patch.sh
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I A - 125
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
___________________

Appendix B
Basic Linux and
vi Commands
___________________

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
vi Commands

The Visual Interpreter/Editor (vi) is the most widely used text editor available for the UNIX environment.
While 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 are 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 the input mode, type a, A,
i, I, o, O, c, C, s, S, r, or R. To return to the command line mode, use the <ESC> key. To access the vi
editor from SQLPlus, enter the following command:

SQL>define _editor=vi

To edit a file from SQLPlus prompt, edit <filename> (press enter), from the Linux command prompt, vi
<filename> (press enter)

To MOVE the cursor:

h - move left j - move down k - move up l - move right

w - one word forward b - one word backward e - end of current word

W, B, or E - same as lower case but ignores punctuation

m y
0 (zero) - Move to beginning of current line $ - end of current line

d e
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


c a
e
/<string> - Search forward to the next occurrence of <string> A
c l
?<string> - Search backward to the next occurrence of <string>

n - Repeat previous search


r a N - Repeat previous search in opposite direction

<ctrl> f - Scroll forward one page


O ly <ctrl> b - Scroll backward one page

To UNDO previous changes:


l & On
n a e
u - Will undo the most recent change. U - Will undo the most recently deleted text.

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

t U
To ENTER NEW text:
I n
l e
a - Append text after the current cursor position.

c
r aA - 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

O i - Insert text before the current cursor position. I - Insert text at the beginning of a line.

Oracle Database 11g: Administration Workshop I B - 2


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 R - Replace all characters until <ESC> is pressed

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) c (confirm prior to each change)

p (print changed lines) S - Substitute entire line to the end

. <period> - repeat last change n. <integer><period> repeat last change n times

To leave the input mode, press <ESC>

To DELETE existing text:

x - Will delete the character directly under the current cursor location.

dd - Will delete the entire line where the cursor is located.

dnd (where n is some integer) will delete n lines from current cursor position

dw - delete current word D - delete to end of current line


m y
J - Delete return at end of current line. Join this line and the next
d e
<int> J - Join the next <int> lines
c a
manipulated with the following commands:
e A
COPY, CUT, and PASTE: vi uses a single buffer where the last changed or deleted text is stored. This text may be

Y - Yank a copy of the current line


c l y <integer> - Yank a copy of next <int> lines

yw - Yank a copy of the current word r a yb - Yank a copy of the previous word

p - Put buffer contents after cursorO ly P - Put buffer contents before cursor

l & On
Also, see the s and S commands under the input section

n a e
To SAVE edited changes to an operating system file:

t e r
zz - Will terminate edit mode.
U s :w filename - Will save changes to the filename specified.

I n
:wq - Write all changes and quit the edit mode

l e
To QUIT without saving changes:

c
ra
ZZ - Will terminate edit mode. :q! - Will terminate the file without saving changes.

O
Oracle Database 11g: Administration Workshop I B - 3
Basic Linux Commands

This appendix is meant to serve only as a quick reference while you are in class. For more
details on these commands, consult the man pages, your Linux documentation, or other
Linux command reference books.
Files and Linux Commands Description/Comments
Directories
Command man <command> Find the manual entry for this
manual <command>.
man –k <string> Show all the manual entries that
contain this <string>.
man man Displays the manual page for
man.
Command info <command> Show the information system entry
information for this command. Using info
info shows a tutorial of the info
documentation system.
Print to cat <file>
Concatenate and print – print the
standard out
named file to the terminal screen.
List users
Change
cat /etc/password
cd <directory> Change working directory to
m y
working
directory
specified directory

d e
cd with no parameters changes to

Copy a file cp <source_file>


$HOME.
c a
Copy a source file to a destination
<destination_file>

e
file.
A
View a file
l View a file a page at a time. This
less <file>

View a file
a c is a GNU version of more, or pg.
View a file a page at a time. BSD
r
more <file>
version.
List directory ls <directory>
O ly Options –l long listing, -R

l & On recursive, -a show hidden files, -t


sort by time, -r reverse sort,

n a e default directory is current

Create a
t e r U s
mkdir <directory>
working directory.
Make a directory defaults into the
directory
I n current working directory, full
path may be specified.

c l
Move or
e
rename a file
mv <old_file> <new_file> Move changes the name of a file
or moves it to a different directory.

r a
O
Oracle Database 11g: Administration Workshop I B - 4
Process List ps Shows the processes report
ps -ef Shows all processes on the system
with a full listing. Many option
exist see the man page for details.
Print working pwd Print to stdout the current working
directory directory.
Remove or rm <file> Removing a file on Linux is
erase a file permanent. Options –r recursive,
and –f force (including
subdirectories) are very
dangerous. Often the rm
command is aliased with rm –i
The option –i asks ‘Are you sure?’
Create an empty touch <file> Create a file.
file
Name of the hostname Returns the name of the machine.
machine
The IP address host <machine_name>
of the machine
Queries the Domain Name Server,
and returns the IP address of the
m y
machine name.
d e
Remote shell rsh <host> <command>
a
Execute a <command> on <host>.

c
Rsh is not secure, use ssh instead.
Remote shell ssh <host>

e A
Secure shell, has features to
replace rsh, rcp, ftp, and telnet.
Remote shell telnet <host>

c l Start a terminal session on <host>.

r a Telnet is not secure use ssh


instead.
Search a file for
a pattern
grep <option>
O ly
<pattern> <file> Search a <file> or stream for a
regular expression defined by

l & On <pattern> and show the line that


contains that pattern. A common

n a e option is –i for case insensitive.

t e r U s grep can accept input from a file


or stdin through a pipe as in:

I n
Source a script . <script_file>
netstat –a| grep ESTABLISHED
In the bash shell this command ‘.’

c l e forces the script to run in the shell.


Normal behavior is for the script

r a to run in a child shell.

O
Oracle Database 11g: Administration Workshop I B - 5
An interpreter awk A macro language for reformatting
or interpreting input. For each line
of input, a variety of actions can
be taken. May be referred to as
nawk – for “new awk.”
Sort a file sort Sort a file takes input from stdin or
a filename argument, many
options to sort by a particular
column, field, etc. See man page.
Command line sed Sed is a command line editor, with
editor many possible commands and
options that are very good for
editing from a shell script.
Visual editor vi <file> Terminal based editor available on
every Unix system, Linux provides
vim, an improved vi, that is a
superset of vi.
Gnu editor emacs <file> This is a GPL editor with
extensive customizable features
m y
Linux distributions.
d e
available on most UNIX and

WSIWIG editor gedit <file>


a
A full-screen editor, requiring X.
c
Available under Gnome.
WSIWIG kate <file>

e A
A full-screen editor, requires X.
Available under KDE
Terminal output stdout
c l Standard out (stdout), is not a

r a command but a concept, most


Linux commands write to stdout

O ly by default unless redirected.


Terminal input stdin
(keyboard)
l & On Standard in (stdin), is not a
command but a concept, most

n a e Linux commands read from stdin


by default unless redirected.
Alias

t e r s
alias <command> <alias>

U
Make a substitution when a user
types <command> substitute and

I n execute <alias>, common alias is


alias ‘rm’ ‘rm –i’. These aliases

c l e
Show shell set
are set in the .bashrc file.
Prints all of the variables that are

r a
variables currently defined in the shell.

O
Oracle Database 11g: Administration Workshop I B - 6
Show printenv or env Prints all the environment
environment variables – an environment
variables variable has been ‘exported’ so
that it will be inherited by child
processes.
File Creation umask –S u=rwx,g=rx,o=rx Set the default permissions for all
mask files created by this shell or its
children. The –S option uses the
symbolic notation, the numeric
notation is obsolete.
Clock xclock An X client that shows a clock on
the screen. Often used to test the X
windows system.
X access xhost Show the current access control in
control xhost +<Xclient> place.
Add a Xclient that is allowed to
access the local DISPLAY, if no

y
<Xclient> is given all are allowed.

m
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I B - 7
System Linux Commands Description / Comments
Administration
Substitute user su - username Change the user that is currently
performing the work. This can be
used by any user to change who is
the effective id of the session user.
normal users must provide a
password, root does not. The ‘-‘
parameter is optional. It runs the
new users login scripts.
Limited root sudo The root user may configure which
privileges users can execute certain
commands as root, and whether a
password is required or not. Useful
for allowing specific users to
perform certain root commands
e.g. mount and unmount
removable volumes such as
CDROMs.
m y
Root file system /
e
The root directory for the system
directory tree.
d
Home Directory /home
a
Typically the directory in which

c
all user home directories placed.

Tmp directory /tmp


e A
For example: /home/oracle.
A temporary storage area. Do

c l notput anything here you want to

r a keep. SA often have a cron job to


remove everything periodically.
Boot directory /boot
O ly A small partition to hold the kernel
image(s) and boot loader

l & On instructions.
Log directory /var/log

n a e The location of most system log


files.
Sample
configuration e r
/etc/inittab

t U s Configuration files are located per


the application. Any configuration
files
I n file that you change after
installation should be included in

c l e
Password files /etc/passwd
the backup.
The /etc/passwd file holds

r a /etc/shadow
user information and must be
readable by others; even with
O encrypted passwords this can be a

Oracle Database 11g: Administration Workshop I B - 8


security hole. The /etc/shadow
file holds the encrypted passwords
and is only readable by root.
Groups file /etc/group The /etc/groups file defines
the groups on a server and the
users that are members of the
group; primary group for a user is
defined in the /etc/passwd
file.
X configuration /etc/X11/XF86Config The file that sets the X server
file settings for your video card,
monitor, mouse, and keyboard.
Usually set up with a OS vendor
supplied tool.

Schedule a crontab -e Use this command to edit the


command to run crontab file, to create the
at a regularly specification for the cron daemon
scheduled time to use.
Schedule a
script to run at a
/etc/anacrontab

m
run at a particular frequency (see
y
Edit the file to specify a script to

particular
frequency e
man anacrontab for details).

d
Schedule a
command to run
at <options> TIME

c a
Runs a job specified by <options>
at a specified TIME parameter.
at a single

e A
specified time
Schedule a
c l
batch <options> <TIME> Run a command when the load
command
r a average drops below .8, optionally
after a set TIME.
Mount a file
O ly
mount <opt> <dev> <mount_point> Mount a file system on device
system

l & On <dev> at <mount_point> with the


options specified by <dev>.
Unmount a file umount <dev>
n a e Unmount the file system or device.

r
system umount <mount_point>

Maximum # of 65535
user ID
t e U s
I n
Recover root {lilo} This is a procedure to recover the

e
password control-x root password if is lost. This

c l linux S
passwd root requires physical access to the

r a machine and system console. You


start by rebooting the machine,

O then during the LILO boot press


and hold [Ctrl] + [x] to get a

Oracle Database 11g: Administration Workshop I B - 9


{grub} prompt and command LILO to
c boot linux to runlevel S.
kernel vmlinuz-2.4.9-13 single
ro root=/dev/hda8
initrd /initrd-2.4.9-13.img The second procedure uses the
boot grub boot loader.
passwd root
Create new user useradd The –D option alone shows the
defaults.
–D with other options changes the
defaults options; without –D
override, the default (e.g., –g) sets
a primary group.

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I B - 10
Delete user userdel Remove a user and optionally all
files belonging to the user.
Modify user usermod Change /etc/password
account information.
Create new groupadd –g sets the group id; default is first
group free value above 500.
Delete group groupdel Remove a group from the system.
May not remove a group that is a
primary group for a user. Files
owned by deleted group must be
manually changed with chown.
Change run init <runlevel> The init command causes the
levels rcN.d scripts to be evaluated, for
the change in run level. init 6
forces a reboot.
Synchronize the sync Forces the buffer cache and page
disks cache to write all dirty buffers to
disk. Used just before a reboot to
prevent disk corruption.
m y
Shutdown the
Linux system
shutdown <mode> <delay>

d e
Do a graceful shutdown of the
system, shut down processes, run

c a
all shutdown scripts, and sync
disks. The modes are –r, reboot

e A
and –h, halt. The delay is a

c l required parameter is a number in


seconds or ‘now’. Option

r a shutdown warning message may


be sent as well.
Error logs dmesg
O ly View boot messages. This log is

l & On circular, and limited system errors


could overwrite boot information

Network IP
n a e after a time.
This directory holds scripts
r
/etc/sysconfig/network-
configuration scripts/

t e U s executed as part of the boot up


sequence by rc.sysinit.
Hosts IP
addresses I n
/etc/hosts A list of hosts that your machine
knows about. Must at minimum

c l e include the name of the local


machine and loopback IP.

Ora Name service


switch
/etc/nsswitch.conf

Oracle Database 11g: Administration Workshop I B - 11


Network sysctl -a | grep net View all net parameters that are
parameters set for the kernel.
Routing routed
daemon
NIC ifconfig -a Show all the network devices
Configurations currently configured.
Secondary IP modprobe ip_alias
Address ifconfig eth0:1 IP
Login prompt /etc/issue Banner message user sees when
issued the login prompt.
YP/NIS service /sbin/ypbind Finds and attaches to a NIS server
binder for name resolution and other
services.
Module modinfo <options> <module> Display information about kernel
information modules: –l shows license, –p
parameters, –d description.
List modules
Load module
lsmod
insmod
Show currently loaded modules.
Load a loadable module.
m y
Unload module
Install Software
rmmod
rpm -ivh package
d e
Unload a loadable module.
Install –i, verbose –v, with

c a
progress hash marks –h.
Uninstall
software
rpm -e package

e A
Erase package –e; will not
uninstall if dependencies exist.
List installed
software
rpm -qa

c l Query –q, All –a, lists all installed

Verify installed rpm -V package r a packages.


Compares installed files with the
software
O ly rpm database information.
List all files rpm -ql package

l & On List all the files that are part of a


package.
Package owner rpm -qf file
n a e List the package when given the

Machine model uname -m


t e r U s full file name.
Shows CPU level (e.g., i686).
OS Level
Run Level
I n
uname -r
runlevel
Shows kernel version.
Shows previous and current

c
Kernell e sysctl -a
runlevel.
Show settings of all settable kernel

r a
Parameters
Max # File sysctl fs.file-max
parameters.
Shows the value of maximum number

O Descriptors of file descriptor per process.

Oracle Database 11g: Administration Workshop I B - 12


Kernel /etc/sysctl.conf Compiled in kernel parameters;
parameter may be reset at bootup by setting
settings them in this file.
Change Kernel echo <value> > </proc/<file> Write the new value of a kernel
Parameter parameter into the /proc file
system.
echo 2147483648 Set the value of the maximum size
>/proc/sys/kernel/shmmax of a shared memory segment.
Shared Memory sysctl kernel.shmmax Show the shmmax parameter.
Change Kernel sysctl –w <parameter>=<value> Change a kernel parameter; the –p
Parameter option reads the setting from a file
and sets them. The default file is
/etc/sysctl.conf
Set Process ulimit <option> <value> Set limits on a shell and processes
limits started by the shell. Users can
make limits more restrictive;
generally only root can make limit
less restrictive; some options

m y
require root privilege. Options: –u

d e
sets number of processes, –n
number of file handles; many

Show process ulimit


c a
others (see man bash).
Without options ulimit show the
limits

e A
current limit settings.
Interprocess
l Options: –m the current usage of
ipcs <option>
Communication
(Shared
a c shared memory; –s usage of
semaphores; –a shows all.
Memory and
Semaphores) r
O ly
Remove a
& On Releases the shared memory
ipcrm shm <shmid>
shared memory
segment l
a e
segment identified by <shmid>.
This is very dangerous. You can

r n s
corrupt a database that is using the
segment that is released.

n t e U
e I
c l
r a
O
Oracle Database 11g: Administration Workshop I B - 13
System Linux Commands Description / Comments
Performance
Performance top View real-time OS and process
monitor statistics.
System activity sar –<options> <interval> Options: –q shows CPU queue, –u
reporter <count> CPU utilization, –d device
activity, –n DEV network device
activity, many more (see man
page). Interval is in seconds.
Virtual Memory vmstat <interval> < count> Interval is in seconds.
statistics
Virtual Memory cat /proc/meminfo Shows instantaneous virtual
statistics memory usage.
Kernel Cache cat /proc/slabinfo Kernel slab allocator statistics:
statistics frequently allocated cache objects
such as inode, dentries, and
asynchronous IO buffers.
I/O statistics iostat <option> <interval>
<count>
Options: –d device activity, –c
CPU activity, –x extended disk
m y
seconds.
d e
activity statistics. The interval is in

Multiprocessor mpstat –P <cpu> <count>


Statistics <interval>
c a
Return CPU statistics for
particular processor or all CPUs in

e A
an smp system.
Physical RAM 64 GB(Theoretical)

c l Maximum physical RAM requires


enterprise kernel (Red Hat

r a Enterprise Linux AS 21 only


supports up to 16 GB).
Swap device swapon -s
O ly Shows devices currently in use for

l & On swap. The swap device is arbitrary


designated at install. It may be

n a e changed or added to. Multiple


swap devices may be created;

t e r U s swap size should be at least as


large as physical memory.

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I B - 14
Display swap free Show the current memory and
size swap usage.
Activate Swap swapon -a Turn on swap.
Free disk blocks df -k Measured in KB; use –m for MB
units.
Device listing cat /proc/devices List devices known to the system
by major and minor number.
Disk cat /proc/scsi/scsi0/sda/model View SCSI disk information.
information
cat /proc/ide/ide0/hda/model View IDE disk information.
Print network netstat <options> Print a wide variety of network
statistics statistics (see man netstat).
Graphical xosview An X-based display of recent OS
system statistics statistics.
viewer

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I B - 15
Misc System Linux Commands Description / Comments
Information
NFS exported /etc/exports Database file are not supported on
simple NFS.
NFS Client /var/lib/nfs/xtab
mounted
directories
Max File 2 TB with 4KB block size (on 32 With ext3 and ext2, others vary.
System kernel)

Max File Size 2 GB {512B block size} The oracle database can create
files up to 64 GB with a 16 KB
File size can not database block size.
exceed file
system 2 TB {4KB block size} The 32-bit kernel limits file and
block devices to 2 TB.
File System dumpe2fs <device> Dump the file system properties to
Block size stdout.
Filesystem table /etc/fstab Mounts these file systems at boot
up.
m y
Journal
Filesystem
ext3

d e
types
Disk Label
reiserfs

c a
A
fdisk is not available on all
fdisk -l
distributions.
Extend File
system
resize2fs
resize_reiserfs
c l e Extending a file system is
applicable to only some file

Backup r a system types.


Create a backup of the root / file
O ly
tar cvf /dev/rst0 /
system.
Restore
Prepare boot & On
tar xvf /dev/rst0

l
Restore the root / file system.
Must be run after changing
a e
/sbin/lilo
volumes

r n s
/etc/lilo.conf to push
changes to boot loader.
Startup script
t e
/etc/rc.d/rc

n U
Kernel
Kernel Bits
e I
/boot/vmlinuz
getconf WORD_BIT POSIX call to get kernel

c l information. There are many other


variables besides WORD_BIT.

r a
O
Oracle Database 11g: Administration Workshop I B - 16
Boot single user {lilo} Use LILO facility.
control-x
linux S

{grub}
c Use GRUB Boot Loader.
kernel vmlinuz-2.4.9-13 single
ro root=/dev/hda8
initrd /initrd-2.4.9-13.img
boot

Time zone /etc/sysconfig/clock


Management
SW Directory /var/lib/rpm Directory where rpm database are
kept.
Devices /dev This directory holds all the device
files.
CPU cat /proc/cpuinfo Shows CPU static information.
Whole Disk /dev/sda Device name.
CDROM /dev/cdrom Usually mounted at
/mnt/cdrom.
m y
CDROM file
type
iso9660

d e
Floppy drive /dev/fd0
c
Usually mounted at a
System /proc

e A
/mnt/floppy.
The /proc filesystem is a memory-
information
c l based file system that allows
access to process and kernel

Compile and r a settings and statistics.


Use a make file <file> to
O ly
make –f <file> <command>
link a determine which parts of a large
executable

l & On program need to be recompiled,


and issue the commands required

n a e to compile, link, and prepare the

t e r U s executable for use.

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I B - 17
LVM Linux (UnitedLinux) Description / Comments
LVM Logical Volume Manager This package is not provided by Red Hat
Enterprise Linux AS 2.1 and may not be
added without tainting the kernel. Kernel
support is provided in United Linux.
LVM Concepts logical extents A Logical volume is made up of logical
extents.
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.
volume group A set of physical disk partitions created by
fdisk or the like, initialized with
pvcreate, then grouped into a physical
volume with vgcreate.
Display volume vgdisplay -v
group
Modify physical
volume
pvchange

m y
Prepare physical
disk
pvcreate

d e
List physical
volume
pvdisplay

c a
Remove disk vgreduce

e A
from volume
group
c l
Move logical
volumes to
pvmove

r a
another physical
O ly
volumes
Create volume vgcreate
l & On
group

n a e
Remove volume
group
Volume group
t e r
vgremove

U s
n
vgchange
availability

e
Restore volumeI vgcfgrestore
group
c l
r a
O
Oracle Database 11g: Administration Workshop I B - 18
Exports volume vgexport
group
Imports volume vgimport
group
Volume group vgscan
listing
Change logical lvchange
volume
characteristics
List logical lvdisplay
volume
Make logical lvcreate
volume
Extend logical lvextend
volume
Reduce logical lvreduce
volume
Remove logical
volume
lvremove

m y
Create striped lvcreate -i 3 -I 64

d e
volumes

c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I B - 19
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
____________________
Appendix C
SQL Statement Syntax
____________________

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
SQL Statements
This excerpt from the Oracle Database SQL Quick Reference guide presents the syntax for
Oracle SQL statements. SQL statements are the means by which programs and users access data
in an Oracle database.

Table 1 shows each SQL statement and its related syntax. Table 2 shows the syntax of the
subclauses found in the table 1.

See Also: Oracle Database SQL Reference for detailed information about Oracle SQL

Table 1: Syntax for SQL Statements

SQL Statement Syntax


ALTER CLUSTER ALTER CLUSTER [ schema. ]cluster
{ physical_attributes_clause
| SIZE size_clause
| allocate_extent_clause
| deallocate_unused_clause
| { CACHE | NOCACHE }
}
m y
e
[ physical_attributes_clause

d
| SIZE size_clause
| allocate_extent_clause
| deallocate_unused_clause
| { CACHE | NOCACHE }
c a
]...
[ parallel_clause ] ;

e A
c l
a
ALTER DATABASE ALTER DATABASE [ database ]

r
{ startup_clauses
| recovery_clauses

O ly
| database_file_clauses
| logfile_clauses

l & On
| controlfile_clauses
| standby_database_clauses

n a e
| default_settings_clauses
| redo_thread_clauses

t e r U s
| security_clause
} ;

ALTER DIMENSION
I n ALTER DIMENSION [ schema. ]dimension

c l e { ADD
{ level_clause
| hierarchy_clause

r a | attribute_clause
| extended_attribute_clause

O }
[ ADD

Oracle Database 11g: Administration Workshop I C - 2


SQL Statement Syntax
{ level_clause
| hierarchy_clause
| attribute_clause
| extended_attribute_clause
}
]...
| DROP
{ LEVEL level
[ RESTRICT | CASCADE ]
| HIERARCHY hierarchy
| ATTRIBUTE attribute
[ LEVEL level [ COLUMN column
[, COLUMN column ]... ]
}
[ DROP
{ LEVEL level
[ RESTRICT | CASCADE ]
| HIERARCHY hierarchy
| ATTRIBUTE attribute
[ LEVEL level [ COLUMN column
[, COLUMN column ]... ]
}
]...
| COMPILE
} ;

m y
ALTER DISKGROUP ALTER DISKGROUP
d e
{ disk_clauses | diskgroup_clauses }

c a
[ { disk_clauses | diskgroup_clauses } ]... ;

ALTER FUNCTION
e
ALTER FUNCTION [ schema. ]function A
c l
COMPILE [ DEBUG ]
[ compiler_parameters_clause

r a
[ compiler_parameters_clause ] ... ]
[ REUSE SETTINGS ] ;

O ly
ALTER INDEX ALTER
{ {
l & On
INDEX [ schema. ]index
deallocate_unused_clause

a e
| allocate_extent_clause
| shrink_clause

r n |

s
parallel_clause

e
| physical_attributes_clause

I n t |
}
U logging_clause

[ deallocate_unused_clause

c l e | allocate_extent_clause
| shrink_clause
| parallel_clause

r a | physical_attributes_clause
| logging_clause

O ]...
| rebuild_clause

Oracle Database 11g: Administration Workshop I C - 3


SQL Statement Syntax
| PARAMETERS ('ODCI_parameters')
| { ENABLE | DISABLE }
| UNUSABLE
| RENAME TO new_name
| COALESCE
| { MONITORING | NOMONITORING } USAGE
| UPDATE BLOCK REFERENCES
| alter_index_partitioning
} ;

ALTER INDEXTYPE ALTER INDEXTYPE [ schema. ]indextype


{ { ADD | DROP }
[ schema. ]operator (parameter_types)
[, { ADD | DROP }
[ schema. ]operator (parameter_types)
]...
[ using_type_clause ]
| COMPILE
} ;

ALTER JAVA ALTER JAVA


{ SOURCE | CLASS } [ schema. ]object_name
[ RESOLVER
( ( match_string [, ] { schema_name | - } )
m y
]...
d e
[ ( match_string [, ] { schema_name | - } )

]
)

{ { COMPILE | RESOLVE }
c a
| invoker_rights_clause
} ;
e A
c l
r a
ALTER MATERIALIZED VIEW ALTER MATERIALIZED VIEW
[ schema. ](materialized_view)

O ly
[ physical_attributes_clause
| table_compression

l & On
| LOB_storage_clause
[, LOB_storage_clause ]...

a e
| modify_LOB_storage_clause
[, modify_LOB_storage_clause ]...

r n s
| alter_table_partitioning

e
| parallel_clause

I n t U
| logging_clause
| allocate_extent_clause
| shrink_clause

e
| { CACHE | NOCACHE }

c l ]
[ alter_iot_clauses ]

r a [ USING INDEX physical_attributes_clause ]


[ MODIFY scoped_table_ref_constraint

O | alter_mv_refresh
]

Oracle Database 11g: Administration Workshop I C - 4


SQL Statement Syntax
[ { ENABLE | DISABLE } QUERY REWRITE
| COMPILE
| CONSIDER FRESH
] ;

ALTER MATERIALIZED VIEW ALTER MATERIALIZED VIEW LOG [ FORCE ]


LOG ON [ schema. ]table
[ physical_attributes_clause
| alter_table_partitioning
| parallel_clause
| logging_clause
| allocate_extent_clause
| shrink_clause
| { CACHE | NOCACHE }
]
[ ADD
{ { OBJECT ID
| PRIMARY KEY
| ROWID
| SEQUENCE
}
[ (column [, column ]...) ]
| (column [, column ]... )
}
[, { { OBJECT ID
m y
| PRIMARY KEY
| ROWID
d e
| SEQUENCE
}
c a
A
[ (column [, column ]...) ]
| (column [, column ]...)
}
]...

c l e
[ new_values_clause ]
] ;
r a
ALTER OPERATOR
O ly
ALTER OPERATOR [ schema. ]operator

l & On
{ add_binding_clause
| drop_binding_clause

n a e
| COMPILE
} ;

ALTER OUTLINE
t e r U s
ALTER OUTLINE

I n [ PUBLIC | PRIVATE ] outline


{ REBUILD

c l e | RENAME TO new_outline_name
| CHANGE CATEGORY TO new_category_name
| { ENABLE | DISABLE }

r a }
[ REBUILD

O | RENAME TO new_outline_name
| CHANGE CATEGORY TO new_category_name

Oracle Database 11g: Administration Workshop I C - 5


SQL Statement Syntax
| { ENABLE | DISABLE }
]... ;

ALTER PACKAGE ALTER PACKAGE [ schema. ]package


COMPILE [ DEBUG ]
[ PACKAGE | SPECIFICATION | BODY ]
[ compiler_parameters_clause
[ compiler_parameters_clause ] ... ]
[ REUSE SETTINGS ] ;

ALTER PROCEDURE ALTER PROCEDURE [ schema. ]procedure


COMPILE [ DEBUG ]
[ compiler_parameters_clause
[ compiler_parameters_clause ] ... ]
[ REUSE SETTINGS ] ;

ALTER PROFILE ALTER PROFILE profile LIMIT


{ resource_parameters | password_parameters }
[ resource_parameters | password_parameters
]... ;

ALTER RESOURCE COST ALTER RESOURCE COST

m y
e
{ CPU_PER_SESSION
| CONNECT_TIME
| LOGICAL_READS_PER_SESSION
| PRIVATE_SGA
a d
}
integer
[ { CPU_PER_SESSION
A c
l e
| CONNECT_TIME

c
| LOGICAL_READS_PER_SESSION

a
| PRIVATE_SGA
}
r
integer

O ly
] ... ;

ALTER ROLE
l & On
ALTER ROLE role

n a e
{ NOT IDENTIFIED
| IDENTIFIED

t e r U s
{ BY password
| USING [ schema. ]package
| EXTERNALLY

I n | GLOBALLY
}

c l e } ;

r a
ALTER ROLEBACK SEGMENT ALTER ROLLBACK SEGMENT rollback_segment
{ ONLINE

O | OFFLINE
| storage_clause

Oracle Database 11g: Administration Workshop I C - 6


SQL Statement Syntax
| SHRINK [ TO integer [ K | M ] ]
};

ALTER SEQUENCE ALTER SEQUENCE [ schema. ]sequence


{ INCREMENT BY integer
| { MAXVALUE integer | NOMAXVALUE }
| { MINVALUE integer | NOMINVALUE }
| { CYCLE | NOCYCLE }
| { CACHE integer | NOCACHE }
| { ORDER | NOORDER }
}
[ INCREMENT BY integer
| { MAXVALUE integer | NOMAXVALUE }
| { MINVALUE integer | NOMINVALUE }
| { CYCLE | NOCYCLE }
| { CACHE integer | NOCACHE }
| { ORDER | NOORDER }
]... ;

ALTER SESSION ALTER SESSION


{ ADVISE { COMMIT | ROLLBACK | NOTHING }
| CLOSE DATABASE LINK dblink
| { ENABLE | DISABLE } COMMIT IN PROCEDURE
| { ENABLE | DISABLE } GUARD
m y
e
| { ENABLE | DISABLE | FORCE } PARALLEL
{ DML | DDL | QUERY } [ PARALLEL integer ]
| { ENABLE RESUMABLE
[ TIMEOUT integer ] [ NAME string ]
a d
| DISABLE RESUMABLE
}
| alter_session_set_clause
A c
} ;

c l e
ALTER SYSTEM
a
ALTER SYSTEM

r
{ archive_log_clause

O ly
| checkpoint_clause
| check_datafiles_clause

l & On
| DUMP ACTIVE SESSION HISTORY [ MINUTES integer ]
| distributed_recov_clauses

n a e
| restricted_session_clauses
| FLUSH { SHARED_POOL | BUFFER_CACHE }

t e r s
| end_session_clauses
| SWITCH LOGFILE

U
| { SUSPEND | RESUME }

I n | quiesce_clauses
| shutdown_dispatcher_clause

c l e | REGISTER
| SET alter_system_set_clause
[ alter_system_set_clause ]...

r a | RESET alter_system_reset_clause
[ alter_system_reset_clause ]...

O } ;

Oracle Database 11g: Administration Workshop I C - 7


SQL Statement Syntax
ALTER TABLE ALTER TABLE [ schema. ]table
[ alter_table_properties
| column_clauses
| constraint_clauses
| alter_table_partitioning
| alter_external_table_clauses
| move_table_clause
]
[ enable_disable_clause
| { ENABLE | DISABLE }
{ TABLE LOCK | ALL TRIGGERS }
[ enable_disable_clause
| { ENABLE | DISABLE }
{ TABLE LOCK | ALL TRIGGERS }
]...
] ;

ALTER TABLESPACE ALTER TABLESPACE tablespace


{ DEFAULT
[ table_compression ] storage_clause
| MINIMUM EXTENT integer [ K | M ]
| RESIZE size_clause
| COALESCE
| RENAME TO new_tablespace_name
| { BEGIN | END } BACKUP
m y
| datafile_tempfile_clauses
| tablespace_logging_clauses
d e
| tablespace_group_clause
| tablespace_state_clauses
c a
A
| autoextend_clause
| flashback_mode_clause

l e
| tablespace_retention_clause
} ;

c
ALTER TRIGGER
r a
ALTER TRIGGER [ schema. ]trigger

O ly
{ ENABLE
| DISABLE

l & On
| RENAME TO new_name
| COMPILE [ DEBUG ]

n a e[ compiler_parameters_clause
[ compiler_parameters_clause ] ... ]

t e r } ;

U s
[ REUSE SETTINGS ]

ALTER TYPE
I n ALTER TYPE [ schema. ]type

c l e { compile_type_clause
| replace_type_clause
| { alter_method_spec

r a | alter_attribute_definition
| alter_collection_clauses

O | [ NOT ] { INSTANTIABLE | FINAL }


}

Oracle Database 11g: Administration Workshop I C - 8


SQL Statement Syntax
[ dependent_handling_clause ]
} ;

ALTER USER ALTER USER


{ user
{ IDENTIFIED
{ BY password [ REPLACE old_password ]
| EXTERNALLY
| GLOBALLY AS ’external_name’
}
| DEFAULT TABLESPACE tablespace
| TEMPORARY TABLESPACE
{ tablespace | tablespace_group_name }
| QUOTA { integer [ K | M ]
| UNLIMITED
} ON tablespace
[ QUOTA { integer [ K | M ]
| UNLIMITED
} ON tablespace
]...
| PROFILE profile
| DEFAULT ROLE { role [, role ]...
| ALL [ EXCEPT

| NONE
role [, role ]... ]

m y
}
| PASSWORD EXPIRE
d e
| ACCOUNT { LOCK | UNLOCK }
}
c a
A
(continued)
UPDATE MANUALLY too big to fit on page, split

(cont.) ALTER USER


manually
[
c l e
{ IDENTIFIED

r a { BY password [ REPLACE old_password ]


| EXTERNALLY

O ly
| GLOBALLY AS ’external_name’
}

l & On | DEFAULT TABLESPACE tablespace


| TEMPORARY TABLESPACE

a e
{ tablespace | tablespace_group_name }
| QUOTA { integer [ K | M ]

r n s
| UNLIMITED

e
} ON tablespace

I n t U [ QUOTA { integer [ K | M ]
| UNLIMITED
} ON tablespace

c l e ]...
| PROFILE profile
| DEFAULT ROLE { role [, role ]...

r a | ALL [ EXCEPT
role [, role ]... ]

O | NONE
}

Oracle Database 11g: Administration Workshop I C - 9


SQL Statement Syntax
| PASSWORD EXPIRE
| ACCOUNT { LOCK | UNLOCK }
}
]...
| user [, user ]... proxy_clause ;
UPDATE MANUALLY too big to fit on page, split
manually
ALTER VIEW ALTER VIEW [ schema. ]view
{ ADD out_of_line_constraint
| MODIFY CONSTRAINT constraint
{ RELY | NORELY }
| DROP { CONSTRAINT constraint
| PRIMARY KEY
| UNIQUE (column [, column ]...)
}
| COMPILE
} ;

ANALYZE ANALYZE
{ TABLE [ schema. ]table
[ PARTITION (partition)

y
| SUBPARTITION (subpartition)
]
| INDEX [ schema. ]index
[ PARTITION (partition)
e m
d
| SUBPARTITION (subpartition)

a
]

c
| CLUSTER [ schema. ]cluster
}
{ validation_clauses

e A
| LIST CHAINED ROWS [ into_clause ]

c l
| DELETE [ SYSTEM ] STATISTICS
| compute_statistics_clause

} ;
r a
| estimate_statistics_clause

O ly
& On
ASSOCIATE STATISTICS ASSOCIATE STATISTICS WITH
{ column_association | function_association } ;

l
a e
AUDIT

r n
AUDIT

s
{ sql_statement_clause | schema_object_clause }

n t e U
[ BY { SESSION | ACCESS } ]
[ WHENEVER [ NOT ] SUCCESSFUL ] ;

e I
l
CALL CALL

c
{ routine_clause
| object_access_expression

r a }
[ INTO :host_variable

O [ [ INDICATOR ] :indicator_variable ] ] ;

Oracle Database 11g: Administration Workshop I C - 10


SQL Statement Syntax
COMMENT COMMENT ON
{ TABLE [ schema. ]
{ table | view }
| COLUMN [ schema. ]
{ table. | view. | materialized_view. } column
| OPERATOR [ schema. ] operator
| INDEXTYPE [ schema. ] indextype
| MATERIALIZED VIEW materialized_view
}
IS 'text' ;

COMMIT COMMIT [ WORK ]


[ COMMENT 'text'
| FORCE 'text' [, integer ]
] ;

CREATE CLUSTER CREATE CLUSTER [ schema. ]cluster


(column datatype [ SORT ]
[, column datatype [ SORT ] ]...
)
[ { physical_attributes_clause
| SIZE size_clause
| TABLESPACE tablespace
| { INDEX
m y
| [ SINGLE TABLE ]
HASHKEYS integer [ HASH IS expr ]
d e
}
}

[ physical_attributes_clause
c a
| SIZE size_clause

e
| TABLESPACE tablespace A
c l
| { INDEX
| [ SINGLE TABLE ]

r
} a
HASHKEYS integer [ HASH IS expr ]

]
O ly
]...

l & On
[ parallel_clause ]
[ NOROWDEPENDENCIES | ROWDEPENDENCIES ]

n a e
[ CACHE | NOCACHE ] ;

CREATE CONTEXT

t e r s
CREATE [ OR REPLACE ] CONTEXT namespace

U
USING [ schema. ] package

I n [ INITIALIZED { EXTERNALLY | GLOBALLY }


| ACCESSED GLOBALLY

c l e ] ;

r a
CREATE CONTROLFILE CREATE CONTROLFILE
[ REUSE ]

O
[ SET ]
DATABASE database

Oracle Database 11g: Administration Workshop I C - 11


SQL Statement Syntax
[ logfile_clause ]
{ RESETLOGS | NORESETLOGS }
[ DATAFILE file_specification
[, file_specification ]... ]
[ { MAXLOGFILES integer
| MAXLOGMEMBERS integer
| MAXLOGHISTORY integer
| MAXDATAFILES integer
| MAXINSTANCES integer
| { ARCHIVELOG | NOARCHIVELOG }
| FORCE LOGGING
}
[ MAXLOGFILES integer
| MAXLOGMEMBERS integer
| MAXLOGHISTORY integer
| MAXDATAFILES integer
| MAXINSTANCES integer
| { ARCHIVELOG | NOARCHIVELOG }
| FORCE LOGGING
]...
]
[ character_set_clause ] ;

CREATE DATABASE CREATE DATABASE [ database ]


{ USER SYS IDENTIFIED BY password
m y
| USER SYSTEM IDENTIFIED BY password
| CONTROLFILE REUSE
d e
| MAXDATAFILES integer
| MAXINSTANCES integer
c a
A
| CHARACTER SET charset
| NATIONAL CHARACTER SET charset
| SET DEFAULT

c l e
{ BIGFILE | SMALLFILE } TABLESPACE
| database_logging_clauses

r a
| tablespace_clauses
| set_time_zone_clause
}... ;
O ly
CREATE DATABASE LINK
l & On
CREATE [ SHARED ] [ PUBLIC ] DATABASE LINK dblink

n a e
[ CONNECT TO
{ CURRENT_USER

t e r }
U s
| user IDENTIFIED BY password
[ dblink_authentication ]

I n | dblink_authentication
]

c l e [ USING 'connect_string' ] ;

r a
CREATE DIMENSION CREATE DIMENSION [ schema. ]dimension
level_clause

O [ level_clause ]...
{ hierarchy_clause

Oracle Database 11g: Administration Workshop I C - 12


SQL Statement Syntax
| attribute_clause
| extended_attribute_clause
}
[ hierarchy_clause
| attribute_clause
| extended_attribute_clause
]... ;

CREATE DIRECTORY CREATE [ OR REPLACE ] DIRECTORY directory


AS 'path_name' ;

CREATE DISKGROUP CREATE DISKGROUP diskgroup_name


[ { HIGH | NORMAL | EXTERNAL } REDUNDANCY ]
[ FAILGROUP failgroup_name ]
DISK qualified_disk_clause
[, qualified_disk_clause ]...
[ [ FAILGROUP failgroup_name ]
DISK qualified_disk_clause
[, qualified_disk_clause ]...
]... ;

CREATE FUNCTION CREATE [ OR REPLACE ] FUNCTION [ schema. ]function


[ (argument [ IN | OUT | IN OUT ]
[ NOCOPY ] datatype
m y
[, argument [ IN | OUT | IN OUT ]
[ NOCOPY ] datatype
d e
]
)
]...

c a
RETURN datatype

e
[ { invoker_rights_clause A
c l
| DETERMINISTIC
| parallel_enable_clause
}

r a
[ invoker_rights_clause

O ly
| DETERMINISTIC
| parallel_enable_clause

]
l & On
]...

n a e
{ { AGGREGATE | PIPELINED }
USING [ schema. ]implementation_type

t e r s
| [ PIPELINED ]
{ IS | AS }

U
{ pl/sql_function_body | call_spec }

I n } ;

c l e
CREATE INDEX CREATE
ON {
[ UNIQUE | BITMAP ] INDEX [ schema. ]index
cluster_index_clause

r a |
|
table_index_clause
bitmap_join_index_clause

O
} ;

Oracle Database 11g: Administration Workshop I C - 13


SQL Statement Syntax
CREATE INDEXTYPE CREATE [ OR REPLACE ] INDEXTYPE
[ schema. ]indextype FOR
[ schema. ]operator (paramater_type
[, paramater_type ]...)
[, [ schema. ]operator (paramater_type
[, paramater_type ]...)
]...
using_type_clause ;

CREATE JAVA CREATE [ OR REPLACE ]


[ AND { RESOLVE | COMPILE } ]
[ NOFORCE ]
JAVA { { SOURCE | RESOURCE }
NAMED [ schema. ]primary_name
| CLASS [ SCHEMA schema ]
}
[ invoker_rights_clause ]
[ RESOLVER
((match_string [,] { schema_name | - })
[ (match_string [,] { schema_name | - }) ]...
)
]
{ USING { BFILE (directory_object_name ,
server_file_name)
| { CLOB | BLOB | BFILE }
m y
subquery
| 'key_for_BLOB'
d e
}
| AS source_text
c a
A
} ;

CREATE LIBRARY
l e
CREATE [ OR REPLACE ] LIBRARY [ schema. ]libname

c
{ IS | AS } 'filename' [ AGENT 'agent_dblink' ] ;

CREATE MATERIALIZED
r a
CREATE MATERIALIZED VIEW
VIEW
O ly
[ schema. ]materialized_view
[ OF [ schema. ]object_type ]

l & On
[ (scoped_table_ref_constraint) ]
{ ON PREBUILT TABLE

n a e
[ { WITH | WITHOUT } REDUCED PRECISION ]
| physical_properties materialized_view_props

t e r }

U s
[ USING INDEX

n
[ physical_attributes_clause

e I | TABLESPACE tablespace
]

c l [ physical_attributes_clause
| TABLESPACE tablespace

r a ]...
| USING NO INDEX
]

O [ create_mv_refresh ]

Oracle Database 11g: Administration Workshop I C - 14


SQL Statement Syntax
[ FOR UPDATE ]
[ { DISABLE | ENABLE }
QUERY REWRITE
]
AS subquery ;

CREATE MATERIALIZED CREATE MATERIALIZED VIEW LOG


VIEW LOG ON [ schema. ] table
[ physical_attributes_clause
| TABLESPACE tablespace
| logging_clause
| { CACHE | NOCACHE }
[ physical_attributes_clause
| TABLESPACE tablespace
| logging_clause
| { CACHE | NOCACHE }
]...
]
[ parallel_clause ]
[ table_partitioning_clauses ]
[ WITH { OBJECT ID
| PRIMARY KEY

y
| ROWID
| SEQUENCE
| (column [, column ]...)
}
em
[, { OBJECT ID
| PRIMARY KEY

a d
c
| ROWID
| SEQUENCE

e A
| (column [, column ]...)

]...

c l
[ new_values_clause ]
] ;

r a
CREATE OPERATOR
O ly
CREATE [ OR REPLACE ] OPERATOR
[ schema. ] operator binding_clause ;

l & On
a e
CREATE OUTLINE CREATE [ OR REPLACE ]
[ PUBLIC | PRIVATE ] OUTLINE [ outline ]

r n [ FROM [ PUBLIC | PRIVATE ] source_outline ]

s
e
[ FOR CATEGORY category ]

CREATE PACKAGE
I n t U
[ ON statement ] ;

CREATE [ OR REPLACE ] PACKAGE [ schema. ]package

c l e [ invoker_rights_clause ]
{ IS | AS } pl/sql_package_spec ;

Ora
CREATE PACKAGE BODY CREATE [ OR REPLACE ] PACKAGE BODY
[ schema. ]package
{ IS | AS } pl/sql_package_body ;

Oracle Database 11g: Administration Workshop I C - 15


SQL Statement Syntax
CREATE PFILE CREATE PFILE [= 'pfile_name' ]
FROM SPFILE [= 'spfile_name'] ;

CREATE PROCEDURE CREATE [ OR REPLACE ] PROCEDURE [ schema. ]procedure


[ (argument [ IN | OUT | IN OUT ]
[ NOCOPY ]
datatype
[, argument [ IN | OUT | IN OUT ]
[ NOCOPY ]
datatype
]...
)
]
[ invoker_rights_clause ]
{ IS | AS }
{ pl/sql_subprogram_body | call_spec } ;

CREATE PROFILE CREATE PROFILE profile


LIMIT { resource_parameters
| password_parameters
}
[ resource_parameters
| password_parameters
]... ;
m y
d e
CREATE ROLE CREATE ROLE role
[ NOT IDENTIFIED
| IDENTIFIED { BY password
c a
e
| EXTERNALLY A
| USING [ schema. ] package

c l | GLOBALLY
}
] ;

r a
O ly
CREATE ROLEBACK SEGMENT CREATE [ PUBLIC ] ROLLBACK SEGMENT rollback_segment

& On
[ { TABLESPACE tablespace | storage_clause }

l
[ TABLESPACE tablespace | storage_clause ]...

a e
];

r n s
e
CREATE SCHEMA CREATE SCHEMA AUTHORIZATION schema

I n t U
{ create_table_statement
| create_view_statement
| grant_statement

e
}

c l [ create_table_statement
| create_view_statement

r a | grant_statement
]... ;

O
Oracle Database 11g: Administration Workshop I C - 16
SQL Statement Syntax
CREATE SEQUENCE CREATE SEQUENCE [ schema. ]sequence
[ { INCREMENT BY | START WITH } integer
| { MAXVALUE integer | NOMAXVALUE }
| { MINVALUE integer | NOMINVALUE }
| { CYCLE | NOCYCLE }
| { CACHE integer | NOCACHE }
| { ORDER | NOORDER }
]
[ { INCREMENT BY | START WITH } integer
| { MAXVALUE integer | NOMAXVALUE }
| { MINVALUE integer | NOMINVALUE }
| { CYCLE | NOCYCLE }
| { CACHE integer | NOCACHE }
| { ORDER | NOORDER }
]... ;

CREATE SPFILE CREATE SPFILE [= 'spfile_name' ]


FROM PFILE [= 'pfile_name' ] ;

CREATE SYNONYM CREATE [ OR REPLACE ] [ PUBLIC ] SYNONYM


[ schema. ]synonym
FOR [ schema. ]object [ @ dblink ] ;

CREATE TABLE { relational_table | object_table | XMLType_table }


m y
CREATE TABLESPACE CREATE
d e
[ BIGFILE | SMALLFILE ]
{ permanent_tablespace_clause
c a
| temporary_tablespace_clause
| undo_tablespace_clause

e A
l
} ;

CREATE TRIGGER
a c
CREATE [ OR REPLACE ] TRIGGER [ schema. ]trigger

r
{ BEFORE | AFTER | INSTEAD OF }

O ly
{ dml_event_clause
| { ddl_event [ OR ddl_event ]...

l}
& On
| database_event [ OR database_event ]...

a e
ON { [ schema. ]SCHEMA

n
| DATABASE

t e r }

U s
}

[ WHEN (condition) ]

I n { pl/sql_block | call_procedure_statement } ;

c l e
CREATE TYPE {
|
create_incomplete_type
create_object_type

r a |
|
}
create_varray_type
create_nested_table_type

O
Oracle Database 11g: Administration Workshop I C - 17
SQL Statement Syntax
CREATE TYPE BODY CREATE [ OR REPLACE ] TYPE BODY [ schema. ]type_name
{ IS | AS }
{ subprogram_declaration
| map_order_func_declaration
}
[; { subprogram_declaration
| map_order_func_declaration
}
]...
END ;

CREATE USER CREATE USER user


IDENTIFIED { BY password
| EXTERNALLY
| GLOBALLY AS 'external_name'
}
[ DEFAULT TABLESPACE tablespace
| TEMPORARY TABLESPACE
{ tablespace | tablespace_group_name }
| QUOTA { integer [ K | M ]
| UNLIMITED
}
ON tablespace
[ QUOTA { integer [ K | M ]
| UNLIMITED
m y
}
ON tablespace
d e
]...
| PROFILE profile
c a
A
| PASSWORD EXPIRE
| ACCOUNT { LOCK | UNLOCK }

c l e
[ DEFAULT TABLESPACE tablespace
| TEMPORARY TABLESPACE
{ tablespace | tablespace_group_name }

r a
| QUOTA { integer [ K | M ]
| UNLIMITED

O ly }
ON tablespace

l & On
[ QUOTA { integer [ K | M ]
| UNLIMITED

n a e }
ON tablespace

t e r U s ]...
| PROFILE profile
| PASSWORD EXPIRE

I n | ACCOUNT { LOCK | UNLOCK }


]...

c l e ] ;

ra
CREATE VIEW CREATE [ OR REPLACE ] [ [ NO ] FORCE ] VIEW
[ schema. ]view

O [ (alias [ inline_constraint
[ inline_constraint ]... ]

Oracle Database 11g: Administration Workshop I C - 18


SQL Statement Syntax
| out_of_line_constraint
[, alias [ inline_constraint
[ inline_constraint ]... ]
| out_of_line_constraint
]...
)
| object_view_clause
| XMLType_view_clause
]
AS subquery [ subquery_restriction_clause ] ;

DELETE DELETE [ hint ]


[ FROM ]
{ dml_table_expression_clause
| ONLY (dml_table_expression_clause)
}
[ t_alias ]
[ where_clause ]
[ returning_clause ] ;

DISASSOCIATE STATISTICS DISASSOCIATE STATISTICS FROM

y
{ COLUMNS [ schema. ]table.column
[, [ schema. ]table.column ]...
| FUNCTIONS [ schema. ]function
[, [ schema. ]function ]...
e m
d
| PACKAGES [ schema. ]package

a
[, [ schema. ]package ]...

c
| TYPES [ schema. ]type
[, [ schema. ]type ]...
| INDEXES [ schema. ]index

e
[, [ schema. ]index ]...A
c l
| INDEXTYPES [ schema. ]indextype
[, [ schema. ]indextype ]...
}

r a
[ FORCE ] ;

DROP CLUSTER O ly
DROP CLUSTER [ schema. ]cluster

& On
[ INCLUDING TABLES [ CASCADE CONSTRAINTS ] ] ;

l
DROP CONTEXT
n a e
DROP CONTEXT namespace ;

DROP DATABASE
t e r U s
DROP DATABASE ;

I
DROP DATABASE LINK n DROP [ PUBLIC ] DATABASE LINK dblink ;

c l e
DROP DIMENSION DROP DIMENSION [ schema. ]dimension ;

r a
O
DROP DIRECTORY DROP DIRECTORY directory_name ;

Oracle Database 11g: Administration Workshop I C - 19


SQL Statement Syntax
DROP DISKGROUP DROP DISKGROUP diskgroup_name
[ { INCLUDING | EXCLUDING }
CONTENTS
] ;

DROP FUNCTION DROP FUNCTION [ schema. ]function_name ;

DROP INDEX DROP INDEX [ schema. ]index [ FORCE ] ;

DROP INDEXTYPE DROP INDEXTYPE [ schema. ]indextype [ FORCE ] ;

DROP JAVA DROP JAVA


{ SOURCE | CLASS | RESOURCE }
[ schema. ]object_name ;

DROP LIBRARY DROP LIBRARY library_name ;

DROP MATERIALIZED VIEW DROP MATERIALIZED VIEW


[ schema. ]materialized_view
[ PRESERVE TABLE ] ;

m y
DROP MATERIALIZED VIEW DROP MATERIALIZED VIEW LOG

d e
a
LOG ON [ schema. ]table ;

DROP OPERATOR
A c
DROP OPERATOR [ schema. ]operator [ FORCE ] ;

DROP OUTLINE
l e
DROP OUTLINE outline ;

c
DROP PACKAGE
r a
DROP PACKAGE [ BODY ] [ schema. ]package ;

DROP PROCEDURE O ly
DROP PROCEDURE [ schema. ]procedure ;

l & On
DROP PROFILE
a e
DROP PROFILE profile [ CASCADE ] ;

n
DROP ROLE

t e r s
DROP ROLE role ;

U
I n
DROP ROLLBACK SEGMENT DROP ROLLBACK SEGMENT rollback_segment ;

l e
DROP SEQUENCE

c
DROP SEQUENCE [ schema. ]sequence_name ;

Ora
DROP SYNONYM DROP [ PUBLIC ] SYNONYM [ schema. ]synonym
[ FORCE ] ;

Oracle Database 11g: Administration Workshop I C - 20


SQL Statement Syntax
DROP TABLE DROP TABLE [ schema. ]table
[ CASCADE CONSTRAINTS ]
[ PURGE ] ;

DROP TABLESPACE DROP TABLESPACE tablespace


[ INCLUDING CONTENTS [ AND DATAFILES ]
[ CASCADE CONSTRAINTS ]
] ;

DROP TRIGGER DROP TRIGGER [ schema. ]trigger ;

DROP TYPE DROP TYPE [ schema. ]type_name


[ FORCE | VALIDATE ] ;

DROP TYPE BODY DROP TYPE BODY [ schema. ]type_name ;

DROP USER DROP USER user [ CASCADE ] ;

DROP VIEW DROP VIEW [ schema. ] view


[ CASCADE CONSTRAINTS ] ;

m y
EXPLAIN PLAN EXPLAIN PLAN

d e
a
[ SET STATEMENT_ID = 'text' ]

c
[ INTO [ schema. ]table [ @ dblink ] ]
FOR statement ;

e A
FLASHBACK DATABASE
l
FLASHBACK [ STANDBY ] DATABASE [ database ]

c
{ TO { SCN | TIMESTAMP } expr

a
| TO BEFORE { SCN | TIMESTAMP } expr

FLASHBACK TABLE
};
r
O ly
FLASHBACK TABLE

l & On
[ schema. ]table
[, [ schema. ]table ]...

n a e
TO { { SCN | TIMESTAMP } expr
[ { ENABLE | DISABLE } TRIGGERS ]

t e r U s
| BEFORE DROP [ RENAME TO table ]
} ;

GRANT
I n GRANT { grant_system_privileges

c l e | grant_object_privileges
} ;

r a
INSERT INSERT [ hint ]

O { single_table_insert | multi_table_insert } ;

Oracle Database 11g: Administration Workshop I C - 21


SQL Statement Syntax
LOCK TABLE LOCK TABLE
[ schema. ] { table | view }
[ { PARTITION (partition)
| SUBPARTITION (subpartition)
}
| @ dblink
]
[, [ schema. ] { table | view }
[ { PARTITION (partition)
| SUBPARTITION (subpartition)
}
| @ dblink
]
]...
IN lockmode MODE
[ NOWAIT ] ;

MERGE MERGE [ hint ]


INTO [ schema. ]table [ t_alias ]
USING [ schema. ] { table | view | subquery }
[ t_alias ]
ON ( condition )
[ merge_update_clause ]
[ merge_insert_clause ] ;

m y
NOAUDIT NOAUDIT
d e
{ sql_statement_clause
[, sql_statement_clause ]...
| schema_object_clause
c a
}
[, schema_object_clause ]...

e A
l
[ WHENEVER [ NOT ] SUCCESSFUL ] ;

c
PURGE PURGE
r a
O ly
{ { TABLE table
| INDEX index

l & On
}
| { RECYCLEBIN | DBA_RECYCLEBIN }

a e
| TABLESPACE tablespace
[ USER user ]

r n s
} ;

e
DO NOT IMPORT AS INSET problem importing file, locks

RENAME
I n t U
up FrameMaker
RENAME old_name
TO new_name ;

REVOKE
c l e REVOKE { revoke_system_privileges

r a | revoke_object_privileges
} ;

O
Oracle Database 11g: Administration Workshop I C - 22
SQL Statement Syntax
ROLLBACK ROLLBACK [ WORK ]
[ TO [ SAVEPOINT ] savepoint
| FORCE 'text'
] ;

SAVEPOINT SAVEPOINT savepoint ;

SELECT subquery [ for_update_clause ] ;

SET CONSTRAINT[S] SET { CONSTRAINT | CONSTRAINTS }


{ constraint [, constraint ]...
| ALL
}
{ IMMEDIATE | DEFERRED } ;

SET ROLE SET ROLE


{ role [ IDENTIFIED BY password ]
[, role [ IDENTIFIED BY password ] ]...
| ALL [ EXCEPT role [, role ]... ]
| NONE
} ;

m y
SET TRANSACTION SET TRANSACTION
{ { READ { ONLY | WRITE }
d e
| ISOLATION LEVEL

c
{ SERIALIZABLE | READ COMMITTED }
a
A
| USE ROLLBACK SEGMENT rollback_segment
}

c l
| NAME 'text'
} ;
e
[ NAME 'text' ]

r a
TRUNCATE TRUNCATE
O ly
{ TABLE [ schema. ]table

l & On
[ { PRESERVE | PURGE } MATERIALIZED VIEW LOG ]
| CLUSTER [ schema. ]cluster

n a e
}
[ { DROP | REUSE } STORAGE ] ;

UPDATE
t e r U s
UPDATE [ hint ]

I n { dml_table_expression_clause
| ONLY (dml_table_expression_clause)

e
}

c l [ t_alias ]
update_set_clause

r a [ where_clause ]
[ returning_clause ] ;

O
Oracle Database 11g: Administration Workshop I C - 23
Table 2: Syntax for Subclauses

Subclause Syntax
activate_standby_db_clause ACTIVATE
[ PHYSICAL | LOGICAL ]
STANDBY DATABASE
[ SKIP [ STANDBY LOGFILE ] ]

add_binding_clause ADD BINDING


(parameter_type
[, parameter_type ]...)
RETURN (return_type)
[ implementation_clause ]
using_function_clause

add_column_clause ADD
( column datatype
[ DEFAULT expr ]
[ { inline_constraint
[ inline_constraint ]...
| inline_ref_constraint
}

y
]
[, column datatype
[ DEFAULT expr ]
[ { inline_constraint
em
d
[ inline_constraint ]...

a
| inline_ref_constraint

c
}
]

)
]...

e A
l
[ column_properties ]

c
add_disk_clause ADD

r a
[ FAILGROUP failgroup_name ]

O ly
DISK qualified_disk_clause
[, qualified_disk_clause ]...

l & On
[ [ FAILGROUP failgroup_name ]
DISK qualified_disk_clause

n a e
]...
[, qualified_disk_clause ]...

t
add_hash_index_partition
e r U s
ADD PARTITION

n
[ partition_name ]

e I [ TABLESPACE tablespace_name ]
[ parallel_clause ]

c l
add_hash_partition_clause ADD PARTITION [ partition ]

r a partitioning_storage_clause
[ update_index_clauses ]

O [ parallel_clause ]

Oracle Database 11g: Administration Workshop I C - 24


Subclause Syntax
add_hash_subpartition ADD subpartition_spec
[ update_index_clauses ]
[ parallel_clause ]

add_list_partition_clause ADD PARTITION [ partition ]


list_values_clause
[ table_partition_description ]
[ update_index_clauses ]

add_list_subpartition ADD subpartition_spec


[ update_index_clauses ]

add_logfile_clauses ADD [ STANDBY ] LOGFILE


{ [ INSTANCE 'instance_name' | THREAD integer
]
[ GROUP integer ] redo_log_file_spec
[, [ GROUP integer ] redo_log_file_spec
]...
| MEMBER 'filename' [ REUSE ]
[, 'filename' [ REUSE ] ]...

y
TO logfile_descriptor
[, logfile_descriptor ]...
}

em
add_overflow_clause ADD OVERFLOW [ segment_attributes_clause ]

a
[ (PARTITION [ segment_attributes_clause ] d
]...
)
A c
[, PARTITION [ segment_attributes_clause ]

c l e
add_range_partition_clause

r a
ADD PARTITION [ partition ]
range_values_clause

O ly
[ table_partition_description ]
[ update_index_clauses ]

l & On
add_table_partition

n a e
{ add_range_partition_clause
| add_hash_partition_clause

t e r }

U s
| add_list_partition_clause

alias_file_name
I n +diskgroup_name [ (template_name) ] /alias_name

c l e
allocate_extent_clause ALLOCATE EXTENT

r a [ ( { SIZE size_clause
| DATAFILE 'filename'

O
| INSTANCE integer
}

Oracle Database 11g: Administration Workshop I C - 25


Subclause Syntax
[ SIZE size_clause
| DATAFILE 'filename'
| INSTANCE integer
]...
)
]

alter_attribute_definition { { ADD | MODIFY } ATTRIBUTE


{ attribute [ datatype ]
| ( attribute datatype
[, attribute datatype ]...
)
}
| DROP ATTRIBUTE
{ attribute
| ( attribute [, attribute ]... )
}
}

alter_collection_clauses MODIFY { LIMIT integer


| ELEMENT TYPE datatype
}

m y
alter_datafile_clause DATAFILE
{ 'filename' | filenumber }

d e
a
[, 'filename' | filenumber ]...

c
}
{ ONLINE
| OFFLINE [ FOR DROP ]
| RESIZE size_clause

e A
c l
| autoextend_clause
| END BACKUP
}

r a
alter_external_table_clauses {
O ly
add_column_clause

& On
| modify_column_clauses
| drop_column_clause

l|

a e
|
parallel_clause
external_data_properties

r n |
|
s
REJECT LIMIT { integer | UNLIMITED }
PROJECT COLUMN { ALL | REFERENCED }

n t e U}
[ add_column_clause

e I | modify_column_clauses
| drop_column_clause

c l | parallel_clause
| external_data_properties

r a | REJECT LIMIT { integer | UNLIMITED }


| PROJECT COLUMN { ALL | REFERENCED }

O
]...

Oracle Database 11g: Administration Workshop I C - 26


Subclause Syntax
alter_index_partitioning { modify_index_default_attrs
| add_hash_index_partition
| modify_index_partition
| rename_index_partition
| drop_index_partition
| split_index_partition
| coalesce_index_partition
| modify_index_subpartition
}

alter_iot_clauses { index_org_table_clause
| alter_overflow_clause
| alter_mapping_table_clauses
| COALESCE
}

alter_mapping_table_clauses MAPPING TABLE


{ UPDATE BLOCK REFERENCES
| allocate_extent_clause
| deallocate_unused_clause
}

alter_method_spec { ADD | DROP }


m y
{ map_order_function_spec
| subprogram_spec

d e
a
}

c
[ { ADD | DROP }
{ map_order_function_spec
| subprogram_spec
}

e A
]...

c l
alter_mv_refresh
r a
REFRESH
{ { FAST | COMPLETE | FORCE }

O ly
| ON { DEMAND | COMMIT }

& On
| { START WITH | NEXT } date
| WITH PRIMARY KEY

l
a e
| USING
{ DEFAULT MASTER ROLLBACK SEGMENT

r n s
| MASTER ROLLBACK SEGMENT
rollback_segment

n t e U }
| USING { ENFORCED | TRUSTED } CONSTRAINTS

e I }

c l
alter_overflow_clause { OVERFLOW

a
{ allocate_extent_clause

O r | deallocate_unused_clause
}
[ allocate_extent_clause
| deallocate_unused_clause

Oracle Database 11g: Administration Workshop I C - 27


Subclause Syntax
]...
| add_overflow_clause
}

alter_session_set_clause SET parameter_name = parameter_value


[ parameter_name = parameter_value ]...

alter_system_reset_clause parameter_name
[ SCOPE = { MEMORY | SPFILE | BOTH } ]
SID = 'sid'

alter_system_set_clause parameter_name =
parameter_value [, parameter_value ]...
[ COMMENT 'text' ]
[ DEFERRED ]
[ SCOPE = { MEMORY | SPFILE | BOTH } ]
[ SID = { 'sid' | * } ]

alter_table_partitioning { modify_table_default_attrs
| set_subpartition_template
|
|
modify_table_partition
modify_table_subpartition

m y
e
| move_table_partition
| move_table_subpartition
|
|
add_table_partition
coalesce_table_partition
a d
|
|
|
drop_table_partition
drop_table_subpartition
rename_partition_subpart
A c
|
|
l e
truncate_partition_subpart

c
split_table_partition

a
| split_table_subpartition
|
|
|
r
merge_table_partitions
merge_table_subpartitions

O ly
exchange_partition_subpart

& On
}

alter_table_properties l
a e
{ { physical_attributes_clause

r n s
|
|
logging_clause
table_compression

n t e U
|
|
supplemental_table_logging
allocate_extent_clause

e I |
|
deallocate_unused_clause
shrink_clause

c l |
|
{ CACHE | NOCACHE }
upgrade_table_clause

a
| records_per_block_clause

O r |
|
}
parallel_clause
row_movement_clause

[ physical_attributes_clause

Oracle Database 11g: Administration Workshop I C - 28


Subclause Syntax
| logging_clause
| table_compression
| supplemental_table_logging
| allocate_extent_clause
| deallocate_unused_clause
| shrink_clause
| { CACHE | NOCACHE }
| upgrade_table_clause
| records_per_block_clause
| parallel_clause
| row_movement_clause
]...
| RENAME TO new_table_name
}
[ alter_iot_clauses ]

alter_tempfile_clause TEMPFILE
{ 'filename' [, 'filename' ]...
| filenumber [, filenumber ]...
}
{ RESIZE size_clause
| autoextend_clause
| DROP [ INCLUDING DATAFILES ]
| ONLINE
| OFFLINE
m y
}

d e
alter_varray_col_properties MODIFY VARRAY varray_item
( modify_LOB_parameters )
c a
e A
analytic_clause
l
[ query_partition_clause ]

c
[ order_by_clause [ windowing_clause ] ]

r a
archive_log_clause
O ly
ARCHIVE LOG
[ INSTANCE 'instance_name' | THREAD integer
]

l & On
{ { SEQUENCE integer

n a e | CHANGE integer
| CURRENT [ NOSWITCH ]

t e r U s
| GROUP integer
| LOGFILE 'filename'
[ USING BACKUP CONTROLFILE ]

I n | NEXT
| ALL

c l e | START
}
[ TO 'location' ]

r a | STOP
}

O
Oracle Database 11g: Administration Workshop I C - 29
Subclause Syntax
array_DML_clause [ WITH | WITHOUT ]
ARRAY DML
[ ([ schema. ]type
[, [ schema. ]varray_type ])
[, ([ schema. ]type
[, [ schema. ]varray_type ])...
]

attribute_clause ATTRIBUTE level DETERMINES


{ dependent_column
| ( dependent_column
[, dependent_column ]... )
}

auditing_by_clause BY { proxy [, proxy ]...


| user [, user ]...
}

auditing_on_clause ON { [ schema. ]object


| DIRECTORY directory_name

y
| DEFAULT
}

autoextend_clause AUTOEXTEND
em
{ OFF
| ON [ NEXT size_clause ]
a d
}
[ maxsize_clause ]

A c
binding_clause BINDING

c l e
(parameter_type [, parameter_type ]...)

r a
RETURN return_type
[ implementation_clause ]

O ly
using_function_clause
[, (parameter_type [, parameter_type ]...)

l & On RETURN return_type


[ implementation_clause ]

n a e using_function_clause
]...

t e
bitmap_join_index_clause
r U s
[ schema.]table

I n ( [ [ schema. ]table. | t_alias. ]column


[ ASC | DESC ]

c l e [, [ [ schema. ]table. | t_alias. ]column


[ ASC | DESC ]
]...

r a )
FROM [ schema. ]table [ t_alias ]

O [, [ schema. ]table [ t_alias ]


]...

Oracle Database 11g: Administration Workshop I C - 30


Subclause Syntax
WHERE condition
[ local_partitioned_index ]
index_attributes

build_clause BUILD { IMMEDIATE | DEFERRED }

C_declaration C [ NAME name ]


LIBRARY lib_name
[ AGENT IN (argument[, argument ]...) ]
[ WITH CONTEXT ]
[ PARAMETERS (parameter[, parameter ]...) ]

call_spec LANGUAGE { Java_declaration | C_declaration }

cancel_clause CANCEL [ IMMEDIATE ] [ WAIT | NOWAIT ]

cell_assignment measure_column [ { { condition


| expr
| single_column_for_loop
}
[, { condition
| expr
m y
}
d e
| single_column_for_loop

]...

c
| multi_column_for_loop
a
A
}
]

c l e
Note: The outer square brackets are part of the
syntax.

r a
In this case, they do not indicate
optionality.

O ly
cell_reference_options
& On
[ { IGNORE | KEEP } NAV ]

l
[ UNIQUE { DIMENSION | SINGLE REFERENCE } ]

n a e
character_set_clause

t e r CHARACTER SET character_set

U s
n
check_datafiles_clause CHECK DATAFILES [ GLOBAL | LOCAL ]

e I
c l
check_diskgroup_clauses CHECK
{ ALL

a
| DISK

O r disk_name
[, disk_name ]...
| DISKS IN FAILGROUP
failgroup_name

Oracle Database 11g: Administration Workshop I C - 31


Subclause Syntax
[, failgroup_name ]...
| FILE
filename
[, filename ]...
}
[ CHECK
{ ALL
| DISK
disk_name
[, disk_name ]...
| DISKS IN FAILGROUP
failgroup_name
[, failgroup_name ]...
| FILE
filename
[, filename ]...
}
]...
[ REPAIR | NOREPAIR ]

checkpoint_clause CHECKPOINT [ GLOBAL | LOCAL ]

cluster_index_clause CLUSTER [ schema. ] cluster index_attributes

m y
coalesce_index_partition COALESCE PARTITION

d e
a
[ parallel_clause ]

coalesce_table_partition COALESCE PARTITION


[ update_index_clauses ]
A c
l e
[ parallel_clause ]

c
column_association

r a
COLUMNS [ schema. ]table.column
[, [ schema. ]table.column ]...

O ly
using_statistics_type

column_clauses
l & On
{ { add_column_clause

n a e | modify_column_clause
| drop_column_clause

t e r U s }
[ add_column_clause
| modify_column_clause

I n | drop_column_clause
]...

c l e | rename_column_clause
| modify_collection_retrieval
[ modify_collection_retrieval ]...

r a | modify_LOB_storage_clause
| alter_varray_col_properties

O }

Oracle Database 11g: Administration Workshop I C - 32


Subclause Syntax
column_properties { object_type_col_properties
| nested_table_col_properties
| { varray_col_properties | LOB_storage_clause }
[ (LOB_partition_storage
[, LOB_partition_storage ]...
)
]
| XMLType_column_properties
}
[ { object_type_col_properties
| nested_table_col_properties
| { varray_col_properties |
LOB_storage_clause }
[ (LOB_partition_storage
[, LOB_partition_storage ]...
)
]
| XMLType_column_properties
}
]...

commit_switchover_clause { PREPARE | COMMIT } TO SWITCHOVER


[ TO { { PHYSICAL | LOGICAL } PRIMARY
| PHYSICAL STANDBY
[ { WITH | WITHOUT } SESSION SHUTDOWN
m y
]
{ WAIT | NOWAIT }

d e
| LOGICAL STANDBY
}
| CANCEL
c a
]

e A
compile_type_clause COMPILE
c l
a
[ DEBUG ]

r
[ SPECIFICATION | BODY ]
[ compiler_parameters_clause

O ly
[ compiler_parameters_clause ] ... ]

& On
[ REUSE SETTINGS ]

compiler_parameters_clause
l
a e
parameter_name = parameter_value

composite_partitioning
r n s
PARTITION BY RANGE ( column_list )

n t e U]
[ subpartition_by_list | subpartition_by_hash

e I ( PARTITION [ partition ]
range_values_clause

c l table_partition_description
[, PARTITION [ partition ]

r a range_values_clause
table_partition_description ] ...

O
)

Oracle Database 11g: Administration Workshop I C - 33


Subclause Syntax
compute_statistics_clause COMPUTE [ SYSTEM ] STATISTICS [ for_clause ]

conditional_insert_clause [ ALL | FIRST ]


WHEN condition
THEN insert_into_clause
[ values_clause ]
[ error_logging_clause ]
[ insert_into_clause
[ values_clause ]
[ error_logging_clause ]
]...
[ WHEN condition
THEN insert_into_clause
[ values_clause ]
[ error_logging_clause ]
[ insert_into_clause
[ values_clause ]
[ error_logging_clause ]
]...
]...
[ ELSE insert_into_clause
[ values_clause ]
[ error_logging_clause ]
[ insert_into_clause
[ values_clause ]
m y
[ error_logging_clause ]
]...
d e
]

c a
constraint {
|
inline_constraint

e
out_of_line_constraint A
|
|
c l
inline_ref_constraint
out_of_line_ref_constraint
}

r a
constraint_clauses
O ly
{ ADD { out_of_line_constraint

l & On [ out_of_line_constraint ]...


| out_of_line_REF_constraint

a e
}
| MODIFY { CONSTRAINT constraint

r n s
| PRIMARY KEY

e
| UNIQUE (column [, column ]...)

I n t U }
constraint_state
| RENAME CONSTRAINT old_name TO new_name

c l e | drop_constraint_clause
}

Ora
constraint_state [ [ [ NOT ] DEFERRABLE ]
[ INITIALLY { IMMEDIATE | DEFERRED } ]
| [ INITIALLY { IMMEDIATE | DEFERRED } ]

Oracle Database 11g: Administration Workshop I C - 34


Subclause Syntax
[ [ NOT ] DEFERRABLE ]
]
[ RELY | NORELY ]
[ using_index_clause ]
[ ENABLE | DISABLE ]
[ VALIDATE | NOVALIDATE ]
[ exceptions_clause ]

constructor_declaration [ FINAL ]
[ INSTANTIABLE ]
CONSTRUCTOR FUNCTION datatype
[ [ SELF IN OUT datatype, ]
parameter datatype
[, parameter datatype ]...
]
RETURN SELF AS RESULT
{ IS | AS } { pl/sql_block | call_spec }

constructor_spec [ FINAL ]
[ INSTANTIABLE ]
CONSTRUCTOR FUNCTION datatype
[ ([ SELF IN OUT datatype, ]

y
parameter datatype
[, parameter datatype ]...

]
)

em
d
RETURN SELF AS RESULT

a
[ { IS | AS } call_spec ]

context_clause [ WITH INDEX CONTEXT,

A c
SCAN CONTEXT implementation_type

e
[ COMPUTE ANCILLARY DATA ]
]

c l
[ WITH COLUMN CONTEXT ]

controlfile_clauses
r a
{ CREATE [ LOGICAL | PHYSICAL ]

O ly
STANDBY CONTROLFILE AS
'filename' [ REUSE ]

l & On
| BACKUP CONTROLFILE TO
{ 'filename' [ REUSE ]

n a e | trace_file_clause
}

t
create_datafile_clause
e r U s
}

CREATE DATAFILE

I n { 'filename' | filenumber }
[, 'filename' | filenumber ]...

c l e }
[ AS { file_specification
[, file_specification ]...

r a | NEW
}

O ]

Oracle Database 11g: Administration Workshop I C - 35


Subclause Syntax
create_incomplete_type CREATE [ OR REPLACE ]
TYPE [ schema. ]type_name ;

create_mv_refresh { REFRESH
{ { FAST | COMPLETE | FORCE }
| ON { DEMAND | COMMIT }
| { START WITH | NEXT } date
| WITH { PRIMARY KEY | ROWID }
| USING
{ DEFAULT [ MASTER | LOCAL ]
ROLLBACK SEGMENT
| [ MASTER | LOCAL ]
ROLLBACK SEGMENT rollback_segment
}
[ DEFAULT [ MASTER | LOCAL ]
ROLLBACK SEGMENT
| [ MASTER | LOCAL ]
ROLLBACK SEGMENT rollback_segment
]...
| USING
{ ENFORCED | TRUSTED }
CONSTRAINTS
}
[ { FAST | COMPLETE | FORCE }
| ON { DEMAND | COMMIT }
m y
| { START WITH | NEXT } date
| WITH { PRIMARY KEY | ROWID }
d e
| USING

c
{ DEFAULT [ MASTER | LOCAL ]
a
A
ROLLBACK SEGMENT
| [ MASTER | LOCAL ]

c
}
l e ROLLBACK SEGMENT rollback_segment

[ DEFAULT [ MASTER | LOCAL ]

r a ROLLBACK SEGMENT
| [ MASTER | LOCAL ]

O ly
rollback_segment
ROLLBACK SEGMENT

l & On
| USING
]...

n a e { ENFORCED | TRUSTED }
CONSTRAINTS

t e r U s ]...
| NEVER REFRESH
}

I n
c l e
create_nested_table_type CREATE [ OR REPLACE ]
TYPE [ schema. ]type_name

r a [ OID 'object_identifier' ]
{ IS | AS } TABLE OF datatype ;

O
Oracle Database 11g: Administration Workshop I C - 36
Subclause Syntax
create_object_type CREATE [ OR REPLACE ]
TYPE [ schema. ]type_name
[ OID 'object_identifier' ]
[ invoker_rights_clause ]
{ { IS | AS } OBJECT
| UNDER [schema.]supertype
}
[ sqlj_object_type ]
[ ( attribute datatype
[ sqlj_object_type_attr ]
[, attribute datatype
[ sqlj_object_type_attr ]...
[, element_spec
[, element_spec ]...
]
)
]
[ [ NOT ] FINAL ]
[ [ NOT ] INSTANTIABLE ] ;

create_varray_type CREATE [ OR REPLACE ]


TYPE [ schema. ]type_name
[ OID 'object_identifier' ]
{ IS | AS } { VARRAY | VARYING ARRAY }
(limit) OF datatype ;
m y
d e
database_file_clauses { RENAME FILE

c
'filename' [, 'filename' ]...
TO 'filename' a
| create_datafile_clause

e
| alter_datafile_clause A
}
c l
| alter_tempfile_clause

r a
O ly
database_logging_clauses { LOGFILE
[ GROUP integer ] file_specification

l & On
]...
[, [ GROUP integer ] file_specification

a e
| MAXLOGFILES integer
| MAXLOGMEMBERS integer

r n s
| MAXLOGHISTORY integer

e
| { ARCHIVELOG | NOARCHIVELOG }

I n t U| FORCE LOGGING
}

c l e
datafile_tempfile_clauses { ADD { DATAFILE | TEMPFILE }
[ file_specification

r a ]
[, file_specification ]...

O
| RENAME DATAFILE 'filename' [, 'filename' ]...
TO

Oracle Database 11g: Administration Workshop I C - 37


Subclause Syntax
'filename' [, 'filename' ]...
| { DATAFILE | TEMPFILE } { ONLINE | OFFLINE }
}

datafile_tempfile_spec [ 'filename' ]
[ SIZE size_clause ]
[ REUSE ]
[ autoextend_clause ]

dblink database[.domain [.domain ]... ]


[ @ connect_descriptor ]

dblink_authentication AUTHENTICATED BY user


IDENTIFIED BY password

deallocate_unused_clause DEALLOCATE UNUSED


[ KEEP size_clause ]

default_cost_clause DEFAULT COST (cpu_cost, io_cost, network_cost)

default_selectivity_clause DEFAULT SELECTIVITY default_selectivity


m y
d e
a
default_tablespace DEFAULT TABLESPACE tablespace

c
[ DATAFILE datafile_tempfile_spec ]
extent_management_clause

e A
l
default_settings_clauses { SET DEFAULT

c
{ BIGFILE | SMALLFILE } TABLESPACE
| DEFAULT TABLESPACE tablespace

r a
| DEFAULT TEMPORARY TABLESPACE
{ tablespace | tablespace_group_name }

O ly
| RENAME GLOBAL_NAME TO
database.domain [.domain ]...

l & On
| { ENABLE BLOCK CHANGE TRACKING
[ USING FILE 'filename' [ REUSE ] ]

n a e | DISABLE BLOCK CHANGE TRACKING


}

t e r U s
| flashback_mode_clause
| set_time_zone_clause

n
}

e I
default_temp_tablespace [ BIGFILE | SMALLFILE ]

c l DEFAULT TEMPORARY TABLESPACE tablespace


[ TEMPFILE file_specification

r a ]
[, file_specification ]...

O extent_management_clause

Oracle Database 11g: Administration Workshop I C - 38


Subclause Syntax
dependent_handling_clause { INVALIDATE
| CASCADE [ { [ NOT ] INCLUDING TABLE DATA
| CONVERT TO SUBSTITUTABLE
}
]
[ [FORCE ] exceptions_clause ]
}

dimension_join_clause JOIN KEY


{ child_key_column
| (child_key_column [, child_key_column ]...)
}
REFERENCES parent_level
[ JOIN KEY
{ child_key_column
| (child_key_column [, child_key_column
]...)
}
REFERENCES parent_level
]...

disk_clauses { diskgroup_name
{ add_disk_clause
| drop_disk_clauses
m y
| resize_disk_clauses
}
d e
| { diskgroup_name | ALL }

}
undrop_disk_clause
c a
e A
diskgroup_alias_clauses
l
{ ADD ALIAS

c
alias_name FOR filename

r a
[, alias_name FOR filename ]...
| DROP ALIAS

O ly
alias_name
[, alias_name ]...

l & On
| RENAME ALIAS
old_alias_name TO new_alias_name

a e
[, old_alias_name TO new_alias_name ]...
}

r n s
t e
diskgroup_availability

n U { MOUNT
| DISMOUNT [ FORCE | NOFORCE ]

e I }

c l
diskgroup_clauses { diskgroup_name

a
{ rebalance_diskgroup_clause

O r | check_diskgroup_clauses
| diskgroup_template_clauses
| diskgroup_directory_clauses
| diskgroup_alias_clauses

Oracle Database 11g: Administration Workshop I C - 39


Subclause Syntax
| drop_diskgroup_file_clause
}
| { diskgroup_name | ALL }
diskgroup_availability
}

diskgroup_directory_clauses { ADD DIRECTORY


filename
[, filename ]...
| DROP DIRECTORY
filename [ FORCE | NOFORCE ]
[, filename [ FORCE | NOFORCE ] ]...
| RENAME DIRECTORY
old_dir_name TO new_dir_name
[, old_dir_name TO new_dir_name ]...
}

diskgroup_file_spec [ ' { fully_qualified_file_name


| numeric_file_name
| incorporate_file_name
| alias_file_name
}

]
'

[ SIZE size_clause ]
m y
[ REUSE ]
[ autoextend_clause ]
d e
diskgroup_template_clauses { { ADD | ALTER } TEMPLATE
c a
e A
qualified_template_clause
[, qualified_template_clause ]...

c l
| DROP TEMPLATE
template_name

}
r a [, template_name ]...

distributed_recov_clauses O ly
{ ENABLE | DISABLE } DISTRIBUTED RECOVERY

l & On
a e
dml_event_clause { DELETE | INSERT | UPDATE
[ OF column [, column ]... ]

r n }

s
e
[ OR { DELETE | INSERT | UPDATE

I n t U ]...
[ OF column [, column]... ]
}

e
ON { [ schema. ]table

c l | [ NESTED TABLE nested_table_column OF ]


[ schema. ] view

r a }
[ referencing_clause ]

O [ FOR EACH ROW ]

Oracle Database 11g: Administration Workshop I C - 40


Subclause Syntax
dml_table_expression_clause { [ schema. ]
{ table
[ { PARTITION (partition)
| SUBPARTITION (subpartition)
}
| @ dblink
]
| { view | materialized view } [ @ dblink ]
}
| ( subquery [ subquery_restriction_clause ] )
| table_collection_expression
}

domain_index_clause INDEXTYPE IS indextype


[ parallel_clause ]
[ PARAMETERS ('ODCI_parameters') ]

drop_binding_clause DROP BINDING


(parameter_type
[, parameter_type ]...)
[ FORCE ]

drop_column_clause { SET UNUSED { COLUMN column


m y
| (column [, column ]...)
}

d e
a
[ { CASCADE CONSTRAINTS | INVALIDATE }

c
[ CASCADE CONSTRAINTS | INVALIDATE ]...
]
| DROP { COLUMN column
A
| (column [, column ]...)

e
}

c l
[ { CASCADE CONSTRAINTS | INVALIDATE }

]
r a[ CASCADE CONSTRAINTS | INVALIDATE ]...

O ly
[ CHECKPOINT integer ]
| DROP { UNUSED COLUMNS

l & On | COLUMNS CONTINUE


}

a e
[ CHECKPOINT integer ]
}

r n s
t e
drop_constraint_clause

n U DROP
{ { PRIMARY KEY

e I | UNIQUE (column [, column ]...)


}

c l [ CASCADE ]
[ { KEEP | DROP } INDEX ]

r a | CONSTRAINT constraint
[ CASCADE ]

O
}

Oracle Database 11g: Administration Workshop I C - 41


Subclause Syntax
drop_disk_clauses DROP
{ DISK
disk_name [ FORCE | NOFORCE ]
[, disk_name [ FORCE | NOFORCE ] ]...
| DISKS IN FAILGROUP
failgroup_name [ FORCE | NOFORCE ]
[, failgroup_name [ FORCE | NOFORCE ] ]...
}

drop_diskgroup_file_clause DROP FILE


filename
[, filename ]...

drop_index_partition DROP PARTITION partition_name

drop_logfile_clauses DROP [ STANDBY ] LOGFILE


{ logfile_descriptor
[, logfile_descriptor ]...
| MEMBER 'filename'
[, 'filename' ]...

y
}

drop_table_partition DROP PARTITION partition

em
[ update_index_clauses [ parallel_clause ] ]

a d
drop_table_subpartition DROP SUBPARTITION subpartition

A c
[ update_index_clauses [ parallel_clause ] ]

element_spec [
{ l e
inheritance_clauses ]

c
subprogram_spec
|
|
r a
constructor_spec
map_order_function_spec
}
O ly
[ subprogram_clause

l & On
| constructor_spec
| map_order_function_spec

n a e ]...
[, pragma_clause ]

else_clause
t e r U s
ELSE else_expr

I n
enable_disable_clause { ENABLE | DISABLE }

c l e [
{
VALIDATE | NOVALIDATE ]
UNIQUE (column [, column ]...)

r a |
|
PRIMARY KEY
CONSTRAINT constraint

O
}
[ using_index_clause ]

Oracle Database 11g: Administration Workshop I C - 42


Subclause Syntax
[ exceptions_clause ]
[ CASCADE ]
[ { KEEP | DROP } INDEX ]

end_session_clauses { DISCONNECT SESSION 'integer1, integer2'


[ POST_TRANSACTION ]
| KILL SESSION 'integer1, integer2'
}
[ IMMEDIATE ]

estimate_statistics_clause ESTIMATE [ SYSTEM ] STATISTICS [ for_clause ]


[ SAMPLE integer { ROWS | PERCENT } ]

exceptions_clause EXCEPTIONS INTO [ schema. ]table

exchange_partition_subpart EXCHANGE { PARTITION partition


| SUBPARTITION subpartition
}
WITH TABLE table
[ { INCLUDING | EXCLUDING } INDEXES ]
[ { WITH | WITHOUT } VALIDATION ]
[ exceptions_clause ]

m y
e
[ update_index_clauses [ parallel_clause ] ]

expr { simple_expression
a d
|
|
|
compound_expression
case_expression
cursor_expression
A c
|
|
|
c l e
datetime_expression
function_expression
interval_expression
|
|
r a
object_access_expression
scalar_subquery_expression
|
| O ly
model_expression
type_constructor_expression
|
}
l & On
variable_expression

n a e
expression_list

t e r s
{ expr [, expr ]...
| (expr [, expr ]...)
}
U
I n
e
extended_attribute_clause ATTRIBUTE attribute

c l LEVEL level
DETERMINES { dependent_column

r a | (dependent_column
[, dependent_column ]...

O [ LEVEL level
)

Oracle Database 11g: Administration Workshop I C - 43


Subclause Syntax
DETERMINES { dependent_column
| (dependent_column
[, dependent_column ]...
)
]...

extent_management_clause EXTENT MANAGEMENT


{ DICTIONARY
| LOCAL
[ AUTOALLOCATE
| UNIFORM
[ SIZE size_clause ]
]
}

external_data_properties DEFAULT DIRECTORY directory


[ ACCESS PARAMETERS
{ (opaque_format_spec)
| USING CLOB subquery
}
]
LOCATION
([ directory: ] 'location_specifier'
[, [ directory: ] 'location_specifier'
m y
]...
)
d e
external_table_clause ([ TYPE access_driver_type ]
c a
)
external_data_properties

e A
l
[ REJECT LIMIT { integer | UNLIMITED } ]

c
file_specification
r a
{ datafile_tempfile_spec
| diskgroup_file_spec

O ly
| redo_log_file_spec

& On
}

finish_clause l
a e[ DISCONNECT [ FROM SESSION ] ]

r n [ parallel_clause ]

s
FINISH

n t e U
[ SKIP [ STANDBY LOGFILE ] ]
[ WAIT | NOWAIT ]

e I
l
flashback_mode_clause FLASHBACK { ON | OFF }

a c
flashback_query_clause [ VERSIONS BETWEEN

O r { SCN | TIMESTAMP }
{ expr | MINVALUE } AND
{ expr | MAXVALUE }

Oracle Database 11g: Administration Workshop I C - 44


Subclause Syntax
]
AS OF { SCN | TIMESTAMP } expr

for_clause FOR
{ TABLE
| ALL [ INDEXED ] COLUMNS [ SIZE integer ]
| COLUMNS [ SIZE integer ]
{ column | attribute } [ SIZE integer ]
[ { column | attribute }
[ SIZE integer ]
]...
| ALL [ LOCAL ] INDEXES
}
[ FOR
{ TABLE
| ALL [ INDEXED ] COLUMNS
[ SIZE integer ]
| COLUMNS [ SIZE integer ]
{ column | attribute } [ SIZE integer ]
[ { column | attribute }
[ SIZE integer ]
]...
| ALL [ LOCAL ] INDEXES
}
]...
m y
d e
for_update_clause FOR UPDATE
[ OF [ [ schema. ]
c a
[, [ [ schema. ]

e A
{ table | view } . ]column

c l
]...
{ table | view } . ]column

r a
[ NOWAIT | WAIT integer ]

O ly
full_database_recovery

l & On
[ STANDBY ] DATABASE
[ { UNTIL { CANCEL

a e
| TIME date
| CHANGE integer

r n s
}

e
| USING BACKUP CONTROLFILE

I n t U }
[ UNTIL { CANCEL
| TIME date

c l e | CHANGE integer
}
| USING BACKUP CONTROLFILE

r a ]
]...

O
Oracle Database 11g: Administration Workshop I C - 45
Subclause Syntax
fully_qualified_file_name +diskgroup_name/db_name/file_type/
file_type_tag.filenumber.incarnation_number

function_association { FUNCTIONS
[ schema. ]function [, [ schema. ]function
]...
| PACKAGES
[ schema. ]package [, [ schema. ]package
]...
| TYPES
[ schema. ]type [, [ schema. ]type ]...
| INDEXES
[ schema. ]index [, [ schema. ]index ]...
| INDEXTYPES
[ schema. ]indextype [, [ schema.
]indextype ]...
}
{ using_statistics_type
| { default_cost_clause
[, default_selectivity_clause ]
| default_selectivity_clause
[, default_cost_clause ]

}
}

m y
function_declaration FUNCTION name
d e
]...)
RETURN datatype
c a
(parameter datatype[, parameter datatype

A
{ IS | AS } { pl/sql_block | call_spec }

e
function_spec
c l
FUNCTION name

r
]...)
a
(parameter datatype [, parameter datatype

O ly
return_clause

general_recovery

l & On
RECOVER
[ AUTOMATIC ]

n a e[ FROM 'location' ]

r
{ { full_database_recovery

t e U s | partial_database_recovery
| LOGFILE 'filename'

I n }
[ { TEST
| ALLOW integer CORRUPTION

c l e | parallel_clause
}

r a [ TEST
| ALLOW integer CORRUPTION

O
| parallel_clause
]...

Oracle Database 11g: Administration Workshop I C - 46


Subclause Syntax
]
| CONTINUE [ DEFAULT ]
| CANCEL
}

global_partitioned_index GLOBAL PARTITION BY


{ RANGE
(column_list)
(index_partitioning_clause)
| HASH
(column_list)
{ individual_hash_partitions
| hash_partitions_by_quantity
}
}

grant_object_privileges { object_privilege | ALL [ PRIVILEGES ] }


[ (column [, column ]...) ]
[, { object_privilege | ALL [ PRIVILEGES ] }
[ (column [, column ]...) ]
]...
on_object_clause
TO grantee_clause
[ WITH HIERARCHY OPTION ]
m y
[ WITH GRANT OPTION ]

d e
grant_system_privileges { system_privilege
| role
c a
| ALL PRIVILEGES
}

e A
c l
[, { system_privilege
| role

r}
a
| ALL PRIVILEGES

O ly
]...
TO grantee_clause

l & On
[ IDENTIFIED BY password ]
[ WITH ADMIN OPTION ]

n a e
r
grantee_clause { user | role | PUBLIC }

t e U s[, { user | role | PUBLIC } ]...

group_by_clause
I n GROUP BY
{ expr

c l e | rollup_cube_clause
| grouping_sets_clause

a
}

O r [, { expr
| rollup_cube_clause
| grouping_sets_clause
}

Oracle Database 11g: Administration Workshop I C - 47


Subclause Syntax
]...
[ HAVING condition ]

grouping_expression_list expression_list [, expression_list ]...

grouping_sets_clause GROUPING SETS


({ rollup_cube_clause | grouping_expression_list
})

hash_partitioning PARTITION BY HASH


(column [, column ] ...)
{ individual_hash_partitions
| hash_partitions_by_quantity
}

hash_partitions_by_quantity PARTITIONS hash_partition_quantity


[ STORE IN
(tablespace [, tablespace ]...) ]
[ OVERFLOW STORE IN
(tablespace [, tablespace ]...) ]

hierarchical_query_clause [ START WITH condition ]


m y
CONNECT BY [ NOCYCLE ] condition

d e
hierarchy_clause HIERARCHY hierarchy
c
(child_level CHILD OF parent_level a
e
[ dimension_join_clause ] A
[ CHILD OF parent_level ]...

c l
implementation_clause
r a
{ ANCILLARY TO

O ly
primary_operator (parameter_type
[, parameter_type ]...)

& On
[, primary_operator ( parameter_type

l
[, parameter_type

a e
]...)
]...

r n | context_clause

s
e
}

I n t
incomplete_file_name U +diskgroup_name [ (template_name) ]

c l e
index_attributes [ { physical_attributes_clause

a
| logging_clause

O r |
|
|
|
ONLINE
COMPUTE STATISTICS
TABLESPACE { tablespace | DEFAULT }
key_compression

Oracle Database 11g: Administration Workshop I C - 48


Subclause Syntax
| { SORT | NOSORT }
| REVERSE
| parallel_clause
}
[ physical_attributes_clause
| logging_clause
| ONLINE
| COMPUTE STATISTICS
| TABLESPACE { tablespace | DEFAULT }
| key_compression
| { SORT | NOSORT }
| REVERSE
| parallel_clause
]...
]

index_expr { column | column_expression }

index_org_overflow_clause [ INCLUDING column_name ]


OVERFLOW
[ segment_attributes_clause ]

index_org_table_clause [ { mapping_table_clause
m y
| PCTTHRESHOLD integer
| key_compression

d e
a
}

c
[ mapping_table_clause
| PCTTHRESHOLD integer
| key_compression
]...

e A
]

c l
[ index_org_overflow_clause ]

index_partition_description
r a
PARTITION

O ly
[ partition

& On
[ { segment_attributes_clause
| key_compression

l
a e
}
[ segment_attributes_clause

r n s
| key_compression
]...

n t e U ]
]

e I
c l
index_partitioning_clause PARTITION [ partition ]
VALUES LESS THAN (value[, value... ])

a
[ segment_attributes_clause ]

O r
index_properties [ { { global_partitioned_index
| local_partitioned_index

Oracle Database 11g: Administration Workshop I C - 49


Subclause Syntax
}
| index_attributes
}
[ { { global_partitioned_index
| local_partitioned_index
}
| index_attributes
}
]...
| domain_index_clause
]

index_subpartition_clause { STORE IN (tablespace[, tablespace ]...)


| (SUBPARTITION
[ subpartition [ TABLESPACE tablespace ] ]
[, SUBPARTITION
[ subpartition [ TABLESPACE tablespace
] ]
]...
)
}

individual_hash_partitions (PARTITION
[ partition partitioning_storage_clause ]
m y
[, PARTITION

d e
[ partition partitioning_storage_clause
]

)
]...
c a
e A
inheritance_clauses
l
[ NOT ] { OVERRIDING | FINAL | INSTANTIABLE }

c
[ [ NOT ] { OVERRIDING | FINAL | INSTANTIABLE
} ]...

r a
inline_constraint [
O ly
CONSTRAINT constraint_name ]

& On
{ [ NOT ] NULL
| UNIQUE

l|

a e
|
PRIMARY KEY
references_clause

r n |
}
s
CHECK (condition)

n t e U[ constraint_state ]

e I
inline_ref_constraint { SCOPE IS [ schema. ] scope_table

c l | WITH ROWID
| [ CONSTRAINT constraint_name ]

a
references_clause

O r }
[ constraint_state ]

Oracle Database 11g: Administration Workshop I C - 50


Subclause Syntax
inner_cross_join_clause table_reference
{ [ INNER ] JOIN table_reference
{ ON condition
| USING (column [, column ]...)
}
| { CROSS
| NATURAL [ INNER ]
}
JOIN table_reference
}

insert_into_clause INTO dml_table_expression_clause [ t_alias ]


[ (column [, column ]...) ]

integer [ + | - ] digit [ digit ]...

interval_day_to_second INTERVAL
'{ integer | integer time_expr | time_expr }'
{ { DAY | HOUR | MINUTE }
[ (leading_precision) ]

y
| SECOND
[ (leading_precision

)
[, fractional_seconds_precision ]

e m
d
]

a
}

c
[ TO { DAY | HOUR | MINUTE | SECOND
[ (fractional_seconds_precision) ]

]
}

e A
c l
a
interval_year_to_month INTERVAL 'integer [- integer ]'

r
{ YEAR | MONTH } [ (precision) ]
[ TO { YEAR | MONTH } ]

O ly
into_clause
& On
INTO [ schema. ] table

l
invoker_rights_clause

n a e
AUTHID { CURRENT_USER | DEFINER }

Java_declaration
t e r U s
JAVA NAME 'string'

join_clause I n { inner_cross_join_clause | outer_join_clause }

c l e
a
key_compression { COMPRESS [ integer ]

O r | NOCOMPRESS
}

Oracle Database 11g: Administration Workshop I C - 51


Subclause Syntax
level_clause LEVEL level IS
{ level_table.level_column
| (level_table.level_column
[, level_table.level_column ]...
)
}

list_partitioning PARTITION BY LIST (column)


(PARTITION [ partition ]
list_values_clause
table_partition_description
[, PARTITION [ partition ]
list_values_clause
table_partition_description
]...
)

list_values_clause VALUES ({ value | NULL


[, { value | NULL }...)
| DEFAULT
)

LOB_parameters { TABLESPACE tablespace


m y
|
|
{ ENABLE | DISABLE } STORAGE IN ROW
storage_clause

d e
a
| CHUNK integer

c
| PCTVERSION integer
| RETENTION
|
|
FREEPOOLS integer
{ CACHE

e A
}
c l
| { NOCACHE | CACHE READS } [ logging_clause ]

r[
a TABLESPACE tablespace

O ly
| { ENABLE | DISABLE } STORAGE IN ROW
| storage_clause

l & On|
|
CHUNK integer
PCTVERSION integer

a e
| RETENTION
| FREEPOOLS integer

r n s
| { CACHE

e
| { NOCACHE | CACHE READS } [ logging_clause

I n t U ]
}
]...

c l e
LOB_partition_storage PARTITION partition

r a { LOB_storage_clause | varray_col_properties }
[ LOB_storage_clause | varray_col_properties

O
]...
[ (SUBPARTITION subpartition

Oracle Database 11g: Administration Workshop I C - 52


Subclause Syntax
{ LOB_storage_clause | varray_col_properties
}
[ LOB_storage_clause
| varray_col_properties
]...
)
]

LOB_storage_clause LOB
{ (LOB_item [, LOB_item ]...)
STORE AS (LOB_parameters)
| (LOB_item)
STORE AS
{ LOB_segname (LOB_parameters)
| LOB_segname
| (LOB_parameters)
}
}

local_partitioned_index LOCAL
[ on_range_partitioned_table
| on_list_partitioned_table
| on_hash_partitioned_table
| on_comp_partitioned_table
]
m y
logfile_clause LOGFILE
d e
[ GROUP integer ] file_specification

c a
[, [ GROUP integer ] file_specification ]...

logfile_clauses

e
{ { ARCHIVELOG [ MANUAL ] A
}
c l
| NOARCHIVELOG

r a
| [ NO ] FORCE LOGGING
| RENAME FILE 'filename'

O ly [, 'filename' ]...
TO 'filename'

l & On
| CLEAR
[ UNARCHIVED ]

n a e LOGFILE logfile_descriptor
[, logfile_descriptor ]...

t e r U s [ UNRECOVERABLE DATAFILE ]
| add_logfile_clauses
| drop_logfile_clauses

I n | supplemental_db_logging
}

c l e
logfile_descriptor { GROUP integer

a
| ('filename' [, 'filename' ]...)

O r | 'filename'
}

Oracle Database 11g: Administration Workshop I C - 53


Subclause Syntax
logging_clause { LOGGING | NOLOGGING }

main_model [ MAIN main_model_name ]


model_column_clauses
[ cell_reference_options ]
model_rules_clause

managed_standby_recovery RECOVER MANAGED STANDBY DATABASE


[ recover_clause | cancel_clause |
finish_clause ]

map_order_func_declaration { MAP | ORDER } MEMBER function_declaration

map_order_function_spec { MAP | ORDER } MEMBER function_spec

mapping_table_clauses { MAPPING TABLE | NOMAPPING }

materialized_view_props [ column_properties ]
[
[
[
table_partitioning_clauses ]
CACHE | NOCACHE ]
parallel_clause ]
m y
[ build_clause ]

d e
maximize_standby_db_clause SET STANDBY DATABASE TO MAXIMIZE

c a
{ PROTECTION | AVAILABILITY | PERFORMANCE }

e A
maxsize_clause
l
MAXSIZE { UNLIMITED | size_clause }

c
merge_insert_clause

r a
WHEN NOT MATCHED THEN
INSERT [ (column [, column ]...) ]

O ly
VALUES ({ expr [, expr ]... | DEFAULT })
[ where_clause ]

l & On
merge_table_partitions

n a eMERGE PARTITIONS partition_1, partition_2


[ INTO partition_spec ]

t e r U s [ update_index_clauses ]
[ parallel_clause ]

I n
merge_table_subpartitions MERGE SUBPARTITIONS subpart_1, subpart_2

e
[ INTO subpartition_spec ]

c l [ update_index_clauses ]
[ parallel_clause ]

r a
O
merge_update_clause WHEN MATCHED THEN
UPDATE SET column = { expr | DEFAULT }

Oracle Database 11g: Administration Workshop I C - 54


Subclause Syntax
[, column = { expr | DEFAULT } ]...
[ where_clause ]
[ DELETE where_clause ]

model_clause MODEL
[ cell_reference_options ]
[ return_rows_clause ]
[ reference_model ]
[ reference_model ]...
main_model

model_column expr [ [ AS ] c_alias ]

model_column_clauses [ query_partition_clause [ c_alias ] ]


DIMENSION BY (model_column
[, model_column ]...)
MEASURES (model_column
[, model_column ]...)

model_rules_clause RULES
[ UPSERT | UPDATE ]
[ { AUTOMATIC | SEQUENTIAL } ORDER ]
[ ITERATE (number) [ UNTIL (condition) ] ]
m y
([ UPDATE | UPSERT ]
cell_assignment [ order_by_clause ] = expr
d e
a
[ [ UPDATE | UPSERT ]

c
cell_assignment [ order_by_clause ] = expr
]...
)

e A
modify_col_properties

c l
( column [ datatype ]
[ DEFAULT expr ]

r a [ inline_constraint
[ inline_constraint ]... ]

O ly [ LOB_storage_clause ]
[, column [ datatype ]

l & On [ DEFAULT expr ]


[ inline_constraint

n a e [ inline_constraint ]... ]
[ LOB_storage_clause ]

t e r U s
)
]

I n
modify_col_substitutable COLUMN column

c l e [ NOT ] SUBSTITUTABLE AT ALL LEVELS


[ FORCE ]

Ora
modify_collection_retrieval MODIFY NESTED TABLE collection_item
RETURN AS { LOCATOR | VALUE }

Oracle Database 11g: Administration Workshop I C - 55


Subclause Syntax
modify_column_clauses MODIFY { modify_col_properties
| modify_col_substitutable
}

modify_hash_partition MODIFY PARTITION partition


{ partition_attributes
| alter_mapping_table_clause
| [ REBUILD ] UNUSABLE LOCAL INDEXES
}

modify_hash_subpartition { { allocate_extent_clause
| deallocate_unused_clause
| shrink_clause
| { LOB LOB_item
| VARRAY varray
}
modify_LOB_parameters
[ { LOB LOB_item
| VARRAY varray
}
modify_LOB_parameters

}
]...

| [ REBUILD ] UNUSABLE LOCAL INDEXES


m y
}

d e
modify_index_default_attrs MODIFY DEFAULT ATTRIBUTES
[ FOR PARTITION partition ]
c a
{ physical_attributes_clause
A
| TABLESPACE { tablespace | DEFAULT }

e
}
c l
| logging_clause

r a
[ physical_attributes_clause
| TABLESPACE { tablespace | DEFAULT }

O ly
| logging_clause
]...

modify_index_partition
l & On
MODIFY PARTITION partition

n a e
{ { deallocate_unused_clause

r
| allocate_extent_clause

t e U s| physical_attributes_clause
| logging_clause

I n | key_compression
}
[ deallocate_unused_clause

c l e | allocate_extent_clause
| physical_attributes_clause

r a | logging_clause
| key_compression

O
]...
| PARAMETERS ('ODCI_parameters')

Oracle Database 11g: Administration Workshop I C - 56


Subclause Syntax
| COALESCE
| UPDATE BLOCK REFERENCES
| UNUSABLE
}

modify_index_subpartition MODIFY SUBPARTITION subpartition


{ UNUSABLE
| allocate_extent_clause
| deallocate_unused_clause
}

modify_list_partition MODIFY PARTITION partition


{ partition_attributes
| {ADD | DROP} VALUES
(partition_value[, partition_value ]...)
| [ REBUILD ] UNUSABLE LOCAL INDEXES
}

modify_list_subpartition { allocate_extent_clause
| deallocate_unused_clause

y
| shrink_clause
| { LOB LOB_item | VARRAY varray }
modify_LOB_parameters
[ { LOB LOB_item | VARRAY varray }
e m
d
modify_LOB_parameters

a
] ...

c
| [ REBUILD ] UNUSABLE LOCAL INDEXES
| { ADD | DROP } VALUES (value[, value ]...)
}

e A
modify_LOB_parameters {
c l
storage_clause

a
| PCTVERSION integer
|
|
|
r
RETENTION
FREEPOOLS integer

O ly
REBUILD FREEPOOLS

& On
| { CACHE
| { NOCACHE | CACHE READS } [ logging_clause ]

l
a e
}
| allocate_extent_clause

r n | deallocate_unused_clause

s
| shrink_clause

n t e U}

e I [
|
storage_clause
PCTVERSION integer

c l |
|
RETENTION
FREEPOOLS integer

r a |
|
REBUILD FREEPOOLS
{ CACHE

O
| { NOCACHE | CACHE READS } [ logging_clause
]

Oracle Database 11g: Administration Workshop I C - 57


Subclause Syntax
}
| allocate_extent_clause
| deallocate_unused_clause
| shrink_clause
]...

modify_LOB_storage_clause MODIFY LOB (LOB_item)


(modify_LOB_parameters)

modify_range_partition MODIFY PARTITION partition


{ partition_attributes
| { add_hash_subpartition
| add_list_subpartition
}
| COALESCE SUBPARTITION
[ update_index_clauses ]
[ parallel_clause ]
| alter_mapping_table_clause
| [ REBUILD ] UNUSABLE LOCAL INDEXES
}

modify_table_default_attrs MODIFY DEFAULT ATTRIBUTES


[ FOR PARTITION partition ]
m y
[ segment_attributes_clause ]
[ table_compression ]
d e
[ PCTTHRESHOLD integer ]
[ key_compression ]
c a
[ alter_overflow_clause ]
[ { LOB (LOB_item)

e A
l
| VARRAY varray

c
}
(LOB_parameters)

r a
[ { LOB (LOB_item)
| VARRAY varray

O ly}
(LOB_parameters)

l & On
]
]...

n a e
modify_table_partition

t e r U s
{ modify_range_partition
| modify_hash_partition

n
| modify_list_partition

e I }

c l
modify_table_subpartition MODIFY SUBPARTITION subpartition

a
{ modify_hash_subpartition

O r | modify_list_subpartition
}

Oracle Database 11g: Administration Workshop I C - 58


Subclause Syntax
move_table_clause MOVE [ ONLINE ]
[ segment_attributes_clause ]
[ table_compression ]
[ index_org_table_clause ]
[ { LOB_storage_clause
| varray_col_properties
}
[ { LOB_storage_clause
| varray_col_properties
}
]...
]
[ parallel_clause ]

move_table_partition MOVE PARTITION partition


[ MAPPING TABLE ]
[ table_partition_description ]
[ update_index_clauses ]
[ parallel_clause ]

move_table_subpartition MOVE SUBPARTITION


subpartition_spec
[ update_index_clauses ]
[ parallel_clause ]
m y
d e
a
multi_column_for_loop FOR (dimension_column

c
[, dimension_column ]...)
IN ( { (literal [, literal ]...)

| subquery

e A
[ (literal [, literal ]...)... ]

)
}

c l
multi_table_insert
r a
{ ALL insert_into_clause

O ly
[ values_clause ]

& On
[ insert_into_clause
[ values_clause ]

l
a e
]...
| conditional_insert_clause

r n}

s
subquery

n t e U
multiset_except

e I nested_table1
MULTISET EXCEPT [ ALL | DISTINCT ]

c l nested_table2

r a
multiset_intersect nested_table1
MULTISET INTERSECT [ ALL | DISTINCT ]

O nested_table2

Oracle Database 11g: Administration Workshop I C - 59


Subclause Syntax
multiset_union nested_table1
MULTISET UNION [ ALL | DISTINCT ]
nested_table2

nested_table_col_properties NESTED TABLE


{ nested_item | COLUMN_VALUE }
[ substitutable_column_clause ]
STORE AS storage_table
[ ( { (object_properties)
| [ physical_properties ]
| [ column_properties ]
}
[ (object_properties)
| [ physical_properties ]
| [ column_properties ]
]...
)
]
[ RETURN AS { LOCATOR | VALUE } ]

new_values_clause { INCLUDING | EXCLUDING } NEW VALUES

number [ + | - ]
m y
{
]
e
digit [ digit ]... [ . ] [ digit [ digit ]...

d
a
| . digit [ digit ]...

c
}
[ e [ + | - ] digit [ digit ]... ]
[ f | d ]

e A
numeric_file_name
c l
+diskgroup_name.filenumber.incarnation_number

object_properties { {
r acolumn | attribute }

O ly
[
[
DEFAULT expr ]
inline_constraint [ inline_constraint ]...

l & On
|
]
inline_ref_constraint

n a e| {
|
out_of_line_constraint
out_of_line_ref_constraint

t e r U s
}
|
}
supplemental_logging_props

I n
c l
object_table
e CREATE [ GLOBAL TEMPORARY ] TABLE
[ schema. ]table OF
[ schema. ]object_type

r a [ object_table_substitution ]
[ (object_properties) ]

O [ ON COMMIT { DELETE | PRESERVE } ROWS ]


[ OID_clause ]

Oracle Database 11g: Administration Workshop I C - 60


Subclause Syntax
[ OID_index_clause ]
[ physical_properties ]
[ table_properties ] ;

object_table_substitution [ NOT ] SUBSTITUTABLE AT ALL LEVELS

object_type_col_properties COLUMN column substitutable_column_clause

object_view_clause OF [ schema. ]type_name


{ WITH OBJECT IDENTIFIER
{ DEFAULT | ( attribute
[, attribute ]... )
}
| UNDER [ schema. ]superview
}
({ out_of_line_constraint
| attribute inline_constraint
[ inline_constraint ]...
}
[, { out_of_line_constraint

y
| attribute inline_constraint
[ inline_constraint ]...
}
]...
em
d
)

OID_clause OBJECT IDENTIFIER IS


c a
A
{ SYSTEM GENERATED | PRIMARY KEY }

e
OID_index_clause

c l
OIDINDEX [ index ]
({ physical_attributes_clause

r a
| TABLESPACE tablespace
}

O ly
[ physical_attributes_clause
| TABLESPACE tablespace

l)& On
]...

n a e
t e r
on_comp_partitioned_table

U s
[ STORE IN ( tablespace [, tablespace ]... ) ]
( PARTITION
[ partition

I n [ { segment_attribute_clause
| key_compression

c l e }
[ segment_attribute_clause
| key_compression

r a ]
]...

O ]
[ index_subpartition_clause ]

Oracle Database 11g: Administration Workshop I C - 61


Subclause Syntax
[, PARTITION
[ partition
[ { segment_attribute_clause
| key_compression
}
[ segment_attribute_clause
| key_compression
]...
]
[ index_subpartition_clause ]
]...
]
)

on_hash_partitioned_table { STORE IN (tablespace[, tablespace ]...)


| (PARTITION
[ partition [ TABLESPACE tablespace ] ]
[, PARTITION
[ partition [ TABLESPACE tablespace ] ]
]...
)
}

on_list_partitioned_table ( PARTITION
m y
[ partition
[ { segment_attributes_clause
d e
| key_compression
}
c
[ segment_attributes_clause a
| key_compression

e
]... A
]
]

c l
r a
[, PARTITION
[ partition

O ly [ { segment_attributes_clause
| key_compression

l & On }
[ segment_attributes_clause

n a e | key_compression
]...

t e r U s]...
]
]

I n )

c l e
on_object_clause { schema.object
| { DIRECTORY directory_name

r a | JAVA { SOURCE | RESOURCE } [ schema. ]object


}

O }

Oracle Database 11g: Administration Workshop I C - 62


Subclause Syntax
on_range_partitioned_table ( PARTITION
[ partition
[ { segment_attributes_clause
| key_compression
}
[ segment_attributes_clause
| key_compression
]...
]
]
[, PARTITION
[ partition
[ { segment_attributes_clause
| key_compression
}
[ segment_attributes_clause
| key_compression
]...
]
]
]...
)

order_by_clause ORDER [ SIBLINGS ] BY


{ expr | position | c_alias }

m y
e
[ ASC | DESC ]
[ NULLS FIRST | NULLS LAST ]
[, { expr | position | c_alias }
[ ASC | DESC ]
a d
[ NULLS FIRST | NULLS LAST ]
]...
A c
out_of_line_constraint [
{ l e
CONSTRAINT constraint_name ]

c
UNIQUE (column [, column ]...)
|
|
r a
PRIMARY KEY (column [, column ]...)
FOREIGN KEY (column [, column ]...)

O ly
references_clause
| CHECK (condition)
}

l & On
[ constraint_state ]

out_of_line_ref_constraint
n a e
{ SCOPE FOR

t e r U s
| REF
({ ref_col | ref_attr })
IS [ schema. ]scope_table

I n ({ ref_col | ref_attr })
WITH ROWID

c l e | [ CONSTRAINT constraint_name ]
FOREIGN KEY
({ ref_col | ref_attr })

r a references_clause
[ constraint_state ]

O }

Oracle Database 11g: Administration Workshop I C - 63


Subclause Syntax
outer_join_clause table_reference
[ query_partition_clause ]
{ outer_join_type JOIN
| NATURAL [ outer_join_type ] JOIN
}
table_reference [ query_partition_clause ]
[ ON condition
| USING ( column [, column ]...)
]

outer_join_type { FULL | LEFT | RIGHT }


[ OUTER ]

parallel_clause { NOPARALLEL | PARALLEL [ integer ] }

parallel_enable_clause PARALLEL_ENABLE
[ (PARTITION argument BY
{ ANY
| { HASH | RANGE } (column [, column ]...)
}

y
)
[ streaming_clause ]
]

em
partial_database_recovery { TABLESPACE tablespace [, tablespace ]...
| DATAFILE { 'filename' | filenumber }
a d
| STANDBY
}
A c
[, 'filename' | filenumber ]...

l e
{ TABLESPACE tablespace [, tablespace ]...

c
| DATAFILE { 'filename' | filenumber }

a
[, 'filename' | filenumber ]...

}
r
O ly
}

UNTIL [ CONSISTENT WITH ] CONTROLFILE

& On
}

partition_attributes l
a e
[ { physical_attributes_clause

r n |
|
s
logging_clause
allocate_extent_clause

n t e U
|
|
deallocate_unused_clause
shrink_clause

e I }
[ physical_attributes_clause

c l | logging_clause
| allocate_extent_clause

a
| deallocate_unused_clause

O r ]
| shrink_clause
]...

[ OVERFLOW

Oracle Database 11g: Administration Workshop I C - 64


Subclause Syntax
{ physical_attributes_clause
| logging_clause
| allocate_extent_clause
| deallocate_unused_clause
}
[ physical_attributes_clause
| logging_clause
| allocate_extent_clause
| deallocate_unused_clause
]...
]
[ table_compression ]
[ { LOB LOB_item | VARRAY varray }
modify_LOB_parameters
[ { LOB LOB_item | VARRAY varray }
modify_LOB_parameters
]...
]

partition_extended_name [ schema.] { table | view }


[ PARTITION (partition)
| SUBPARTITION (subpartition)

y
]

partition_level_subpartition { SUBPARTITIONS hash_subpartition_quantity


[ STORE IN (tablespace[, tablespace ]...) ]
em
| (subpartition_spec[, subpartition_spec ]...)
}
a d
partition_spec PARTITION [ partition ]
[ table_partition_description ]
A c
partitioning_storage_clause
c l e
[ { TABLESPACE tablespace

r a
| OVERFLOW [ TABLESPACE tablespace ]
| LOB (LOB_item) STORE AS

O ly
{ LOB_segname [ (TABLESPACE tablespace) ]
| (TABLESPACE tablespace)

l & On}
| VARRAY varray_item STORE AS LOB LOB_segname

a e
}

n
[ { TABLESPACE tablespace

t e r U s
| OVERFLOW [ TABLESPACE tablespace ]
| LOB (LOB_item) STORE AS
{ LOB_segname [ (TABLESPACE tablespace)

I n ]
| (TABLESPACE tablespace)

c l e }
| VARRAY varray_item STORE AS LOB
LOB_segname

r a }
]...

O ]

Oracle Database 11g: Administration Workshop I C - 65


Subclause Syntax
password_parameters { { FAILED_LOGIN_ATTEMPTS
| PASSWORD_LIFE_TIME
| PASSWORD_REUSE_TIME
| PASSWORD_REUSE_MAX
| PASSWORD_LOCK_TIME
| PASSWORD_GRACE_TIME
}
{ expr | UNLIMITED | DEFAULT }
| PASSWORD_VERIFY_FUNCTION
{ function | NULL | DEFAULT }
}

permanent_tablespace_clause { MINIMUM EXTENT integer [ K | M ]


| BLOCKSIZE integer [ K ]
| logging_clause
| FORCE LOGGING
| DEFAULT [ table_compression ]
storage_clause
| { ONLINE | OFFLINE }
| extent_management_clause
| segment_management_clause
| flashback_mode_clause
[ MINIMUM EXTENT integer [ K | M ]
| BLOCKSIZE integer [ K ]
| logging_clause
m y
| FORCE LOGGING
| DEFAULT [ table_compression ]
d e
storage_clause
| { ONLINE | OFFLINE }
c a
A
| extent_management_clause
| segment_management_clause

}
c
]...
l e
| flashback_mode_clause

r a
physical_attributes_clause
O ly
[ {
|
PCTFREE integer
PCTUSED integer

l & On
|
|
INITRANS integer
storage_clause

n a e }
[ PCTFREE integer

t e r U s | PCTUSED integer
| INITRANS integer
| storage_clause

I n ]
]...

c l e
physical_properties { segment_attributes_clause

r a [ table_compression ]
| ORGANIZATION

O { HEAP
[ segment_attributes_clause ]

Oracle Database 11g: Administration Workshop I C - 66


Subclause Syntax
[ table_compression ]
| INDEX
[ segment_attributes_clause ]
index_org_table_clause
| EXTERNAL
external_table_clause
}
| CLUSTER cluster (column [, column ]...)
}

pragma_clause PRAGMA RESTRICT_REFERENCES


({ method_name | DEFAULT } ,
{ RNDS | WNDS | RNPS | WNPS | TRUST }
[, { RNDS | WNDS | RNPS | WNPS | TRUST } ]...
)

procedure_declaration PROCEDURE name (parameter datatype


[, parameter datatype ]...)
{ IS | AS } { pl/sql_block | call_spec }

y
procedure_spec PROCEDURE name
(parameter datatype [, parameter datatype ]...)
[ { IS | AS } call_spec ]

e m
proxy_authentication { AUTHENTICATION REQUIRED
| AUTHENTICATED USING
a d
{ PASSWORD
| DISTINGUISHED NAME
| CERTIFICATE [ TYPE 'type' ]
A c
}
l e
[ VERSION 'version' ]

c
a
}

proxy_clause r
O ly
{ GRANT | REVOKE }
CONNECT THROUGH proxy

l & On
[ WITH { ROLE { role_name
[, role_name ]...

n a e | ALL EXCEPT role_name


[, role_name ]...

t e r U s }
| NO ROLES
}

I n ]
[ proxy_authentication ]

c l e
qualified_disk_clause search_string

r a [ NAME disk_name ]
[ SIZE size_clause ]

O [ FORCE | NOFORCE ]

Oracle Database 11g: Administration Workshop I C - 67


Subclause Syntax
qualified_template_clause template_name
ATTRIBUTES
([ MIRROR | UNPROTECTED ]
[ FINE | COARSE ]
)

query_partition_clause PARTITION BY
{ value_expr[, value_expr ]...
| ( value_expr[, value_expr ]... )

query_table_expression { query_name
| [ schema. ]
{ table [ { PARTITION (partition)
| SUBPARTITION (subpartition)
}
[ sample_clause ]
| [ sample_clause ]
| @ dblink
]
| { view | materialized view } [ @ dblink ]
}
| (subquery [ subquery_restriction_clause ])
| table_collection_expression
}
m y
d e
a
quiesce_clauses QUIESCE RESTRICTED | UNQUIESCE

range_partitioning
A c
PARTITION BY RANGE (column[, column ]...)
(PARTITION [ partition ]

l e
range_values_clause

c
table_partition_description

a
[, PARTITION [ partition ]

rrange_values_clause
table_partition_description

O ly
]...

& On
)

range_values_clause l
a e
VALUES LESS THAN

r n s
({ value | MAXVALUE }
[, { value | MAXVALUE } ]...

n t e U
)

e I
rebalance_diskgroup_clause REBALANCE [ POWER integer ]

c l
rebuild_clause REBUILD

r a [ { PARTITION partition
| SUBPARTITION subpartition

O }
| { REVERSE | NOREVERSE }

Oracle Database 11g: Administration Workshop I C - 68


Subclause Syntax
]
[ parallel_clause
| TABLESPACE tablespace
| PARAMETERS ('ODCI_parameters')
| ONLINE
| COMPUTE STATISTICS
| physical_attributes_clause
| key_compression
| logging_clause
]
[ parallel_clause
| TABLESPACE tablespace
| PARAMETERS ('ODCI_parameters')
| ONLINE
| COMPUTE STATISTICS
| physical_attributes_clause
| key_compression
| logging_clause
]...

records_per_block_clause { MINIMIZE | NOMINIMIZE } RECORDS_PER_BLOCK

recover_clause { { DISCONNECT [ FROM SESSION ]


| { TIMEOUT integer | NOTIMEOUT }
m y
}

d
| { NODELAY | DEFAULT DELAY | DELAY integer }
e
| NEXT integer
| { EXPIRE integer | NO EXPIRE }
| parallel_clause
c a
| USING CURRENT LOGFILE

e
| UNTIL CHANGE integer A
c l
| THROUGH { [ THREAD integer ] SEQUENCE integer
| ALL ARCHIVELOG

r a | { ALL | LAST | NEXT } SWITCHOVER


}
}
O ly
[ { DISCONNECT [ FROM SESSION ]

l & On| { TIMEOUT integer | NOTIMEOUT }


}

n a e | { NODELAY | DEFAULT DELAY | DELAY integer }


| NEXT integer

t e r U s | { EXPIRE integer | NO EXPIRE }


| parallel_clause
| USING CURRENT LOGFILE

I n | UNTIL CHANGE integer


| THROUGH { [ THREAD integer ] SEQUENCE

c l e integer
| ALL ARCHIVELOG
| { ALL | LAST | NEXT } SWITCHOVER

r a ] ...
}

O
Oracle Database 11g: Administration Workshop I C - 69
Subclause Syntax
recovery_clauses { general_recovery
| managed_standby_recovery
| BEGIN BACKUP
| END BACKUP
}

redo_log_file_spec [ 'filename'
| ('filename' [, 'filename' ]...)
]
[ SIZE size_clause ]
[ REUSE ]

redo_thread_clauses { ENABLE | DISABLE }


{ INSTANCE 'instance_name'
| [ PUBLIC ] THREAD integer
}

reference_model REFERENCE reference_spreadsheet_name


ON (subquery)
spreadsheet_column_clauses

y
[ cell_reference_options ]

references_clause

e
REFERENCES [ schema. ] { object_table | view }
[ (column [, column ]...) ] m
[ON DELETE { CASCADE | SET NULL } ]
[ constraint_state ]
a d
referencing_clause REFERENCING
A c
c l e
{ OLD [ AS ] old
| NEW [ AS ] new
| PARENT [ AS ] parent }

r a
[ OLD [ AS ] old
| NEW [ AS ] new

O ly
| PARENT [ AS ] parent ]...

register_logfile_clause
l & On
REGISTER

n a e
[ OR REPLACE ]
[ PHYSICAL | LOGICAL ]

t e r s
LOGFILE
[ file_specification

U
[, file_specification ]...

I n ]
FOR logminer_session_name

c l e
relational_properties { column datatype [ SORT ]

r a [ DEFAULT expr ]
[ inline_constraint

O [ inline_constraint ]...
| inline_ref_constraint

Oracle Database 11g: Administration Workshop I C - 70


Subclause Syntax
]
| { out_of_line_constraint
| out_of_line_ref_constraint
| supplemental_logging_props
}
}
[, { column datatype [ SORT ]
[ DEFAULT expr ]
[ inline_constraint
[ inline_constraint ]...
| inline_ref_constraint
]
| { out_of_line_constraint
| out_of_line_ref_constraint
| supplemental_logging_props
}
]...

relational_table CREATE [ GLOBAL TEMPORARY ] TABLE [ schema.


]table
[ (relational_properties) ]
[ ON COMMIT { DELETE | PRESERVE } ROWS ]
[ physical_properties ]
[ table_properties ] ;

m y
rename_column_clause RENAME COLUMN old_name TO new_name
d e
rename_index_partition RENAME { PARTITION partition
c a
TO new_name

e A
| SUBPARTITION subpartition }

c l
a
rename_partition_subpart RENAME { PARTITION | SUBPARTITION }

replace_type_clause
r
current_name TO new_name

O ly
REPLACE [ invoker_rights_clause ] AS OBJECT

l & On
(attribute datatype [, attribute datatype
]...

n a e [, element_spec [, element_spec ]... ])

resize_disk_clauses

t e r U s
RESIZE
{ ALL [ SIZE size_clause ]

I n | DISK
disk_name [ SIZE size_clause ]

c l e [, disk_name [ SIZE size_clause ] ]...


| DISKS IN FAILGROUP
failgroup_name [ SIZE size_clause ]

r a }
[, failgroup_name [ SIZE size_clause ] ]...

O
Oracle Database 11g: Administration Workshop I C - 71
Subclause Syntax
resource_parameters { { SESSIONS_PER_USER
| CPU_PER_SESSION
| CPU_PER_CALL
| CONNECT_TIME
| IDLE_TIME
| LOGICAL_READS_PER_SESSION
| LOGICAL_READS_PER_CALL
| COMPOSITE_LIMIT
}
{ integer | UNLIMITED | DEFAULT }
| PRIVATE_SGA
{ integer [ K | M ] | UNLIMITED | DEFAULT }
}

restricted_session_clauses { ENABLE | DISABLE } RESTRICTED SESSION

return_clause { RETURN datatype [ { IS | AS } call_spec ]


| sqlj_object_type_sig
}

return_rows_clause RETURN { UPDATED | ALL } ROWS

returning_clause RETURNING expr [, expr ]...

m y
e
INTO data_item [, data_item ]...

revoke_object_privileges { object_privilege | ALL [ PRIVILEGES ] }


a d
]...
on_object_clause
A c
[, { object_privilege | ALL [ PRIVILEGES ] }

l e
FROM grantee_clause
[ CASCADE CONSTRAINTS | FORCE ]

c
revoke_system_privileges
r a
{ system_privilege
| role

O ly
| ALL PRIVILEGES

& On
}

l
[, { system_privilege
| role

n a e | ALL PRIVILEGES

r
}

t e U s ]...
FROM grantee_clause

I
rollup_cube_clause n { ROLLUP | CUBE } (grouping_expression_list)

c l e
routine_clause [ schema. ] [ type. | package. ]

r a {
[
function | procedure | method }
@dblink_name ]

O ( [ argument [, argument ]... ] )

Oracle Database 11g: Administration Workshop I C - 72


Subclause Syntax
row_movement_clause { ENABLE | DISABLE } ROW MOVEMENT

sample_clause SAMPLE [ BLOCK ]


(sample_percent)
[ SEED (seed_value) ]

schema_object_clause { object_option [, object_option ]... | ALL }


auditing_on_clause

scoped_table_ref_constraint { SCOPE FOR


({ ref_column | ref_attribute })
IS [ schema. ] { scope_table_name | c_alias }
}
[, SCOPE FOR
({ ref_column | ref_attribute })
IS [ schema. ] { scope_table_name | c_alias
}
]...

searched_case_expression WHEN condition THEN return_expr


[ WHEN condition THEN return_expr ]...

security_clause GUARD { ALL | STANDBY | NONE }


m y
d e
a
segment_attributes_clause { physical_attributes_clause

c
| TABLESPACE tablespace
| logging_clause
}
[ physical_attributes_clause

e A
c l
| TABLESPACE tablespace
| logging_clause
]...

r a
segment_management_clause
O ly
SEGMENT SPACE MANAGEMENT { MANUAL | AUTO }

select_list
l & On
{ *

n a e
| { query_name.*
| [ schema. ]

t e r U s { table | view | materialized view } .*


| expr [ [ AS ] c_alias ]
}

I n [, { query_name.*
| [ schema. ]

c l e { table | view | materialized view } .*


| expr [ [ AS ] c_alias ]
}

r a }
]...

O
Oracle Database 11g: Administration Workshop I C - 73
Subclause Syntax
set_subpartition_template SET SUBPARTITION TEMPLATE
{ (SUBPARTITION subpartition
[ list_values_clause ]
[ partitioning_storage_clause ]
[, SUBPARTITION subpartition
[ list_values_clause ]
[ partitioning_storage_clause ]...
]
)
| hash_subpartition_quantity
}

set_time_zone_clause SET TIME_ZONE =


'{ { + | - } hh : mi | time_zone_region }'

shrink_clause SHRINK SPACE [ COMPACT ] [ CASCADE ]

shutdown_dispatcher_clause SHUTDOWN [ IMMEDIATE ] dispatcher_name

simple_case_expression expr WHEN comparison_expr


THEN return_expr
[ WHEN comparison_expr

m y
e
THEN return_expr ]...

single_column_for_loop FOR dimension_column


a d
{ IN ( { literal
[, literal ]...
| subquery
A c
c
)
l
}
e
| [ LIKE pattern ]

r a
FROM literal TO literal
{ INCREMENT | DECREMENT } literal

O ly
}

single_table_insert
l & On
insert_into_clause

n a e{ values_clause [ returning_clause ]
| subquery

t e r U s
}

size_clause

I n integer [ K | M | G | T ]

c l e
split_index_partition SPLIT PARTITION partition_name_old
AT (value [, value ]...)

r a [ INTO (index_partition_description,
index_partition_description

O
)
]

Oracle Database 11g: Administration Workshop I C - 74


Subclause Syntax
[ parallel_clause ]
UPDATE MANUALLY problem importing file
split_table_partition SPLIT PARTITION current_partition
{ AT | VALUES } (value [, value ]...)
[ INTO (partition_spec, partition_spec) ]
[ update_index_clauses ]
[ parallel_clause ]
UPDATE MANUALLY problem importing file
split_table_subpartition SPLIT SUBPARTITION subpartition
VALUES ({ value | NULL }
[, value | NULL ]...)
[ INTO (subpartition_spec,
subpartition_spec
)
]
[ update_index_clauses ]
[ parallel_clause ]
UPDATE MANUALLY problem importing file
sql_statement_clause { { statement_option | ALL }
[, { statement_option | ALL } ]...
| { system_privilege | ALL PRIVILEGES }

}
[, { system_privilege | ALL PRIVILEGES } ]...

[ auditing_by_clause ]
m y
d e
a
sqlj_object_type EXTERNAL NAME java_ext_name LANGUAGE JAVA

c
USING (SQLData | CustomDatum | OraData)

sqlj_object_type_attr EXTERNAL NAME 'field_name'

e A
sqlj_object_type_sig
c l
RETURN { datatype | SELF AS RESULT }

r a
EXTERNAL { VARIABLE NAME
'java_static_field_name'

O ly | NAME 'java_method_sig'
}

l & On
standby_database_clauses

n a e
(
|
activate_standby_db_clause
maximize_standby_db_clause

t e r U
|
|
|s register_logfile_clause
commit_switchover_clause
start_standby_clause

I n |
)
stop_standby_clause

c l e [ parallel_clause ]

r a
start_standby_clause START LOGICAL STANDBY APPLY
[ IMMEDIATE ]

O [ NODELAY ]
[ NEW PRIMARY dblink

Oracle Database 11g: Administration Workshop I C - 75


Subclause Syntax
| INITIAL [ scn_value ]
| { SKIP FAILED TRANSACTION | FINISH }
]

startup_clauses { MOUNT [ { STANDBY | CLONE } DATABASE ]


| OPEN { [ READ WRITE ]
[ RESETLOGS | NORESETLOGS ]
[ UPGRADE | DOWNGRADE ]
| READ ONLY
}
}

stop_standby_clause { STOP | ABORT }


LOGICAL STANDBY APPLY

storage_clause STORAGE
({ INITIAL integer [ K | M ]
| NEXT integer [ K | M ]
| MINEXTENTS integer
| MAXEXTENTS { integer | UNLIMITED }
| PCTINCREASE integer
| FREELISTS integer
| FREELIST GROUPS integer
| OPTIMAL [ integer [ K | M ]
m y
| NULL
]
d e
}
c a
| BUFFER_POOL { KEEP | RECYCLE | DEFAULT }

A
[ INITIAL integer [ K | M ]
| NEXT integer [ K | M ]

e
| MINEXTENTS integer

l
| MAXEXTENTS { integer | UNLIMITED }

c
| PCTINCREASE integer

r a
| FREELISTS integer
| FREELIST GROUPS integer

O ly
| OPTIMAL [ integer [ K | M ]
| NULL

l & On ]
| BUFFER_POOL { KEEP | RECYCLE | DEFAULT }

n a e )
]...

streaming_clause
t e r U s
{ ORDER | CLUSTER } BY (column [, column ]...)

I
subpartition_by_hashn SUBPARTITION BY HASH (column [, column ]...)

c l e [ SUBPARTITIONS quantity
[ STORE IN (tablespace [, tablespace

a
]...) ]

O r | subpartition_template
]

Oracle Database 11g: Administration Workshop I C - 76


Subclause Syntax
subpartition_by_list SUBPARTITION BY LIST (column)
[ subpartition_template ]

subpartition_spec SUBPARTITION [ subpartition ]


[ list_values_clause ]
[ partitioning_storage_clause ]

subpartition_template SUBPARTITION TEMPLATE


(SUBPARTITION subpartition
[ list_values_clause ]
[ partitioning_storage_clause ]
[, SUBPARTITION subpartition
[ list_values_clause ]
[ partitioning_storage_clause ]
]
)
| hash_subpartition_quantity

subprogram_declaration { MEMBER | STATIC }


{ procedure_declaration

y
| function_declaration
| constructor_declaration
}

em
subprogram_spec { MEMBER | STATIC }
{ procedure_spec | function_spec }
a d
subquery [ subquery_factoring_clause ]
A c
SELECT
[ hint ]

c l e
[ { { DISTINCT | UNIQUE }

r a
| ALL
}
]
O ly
select_list

l & On
FROM table_reference
[, table_reference ]...

n a e
[ where_clause ]
[ hierarchical_query_clause ]

t e r U s
[ group_by_clause ]
[ HAVING condition ]
[ model_clause ]

I n [ { UNION [ ALL ]
| INTERSECT

c l e | MINUS
}

a
(subquery)

O r ]
[ order_by_clause ]

Oracle Database 11g: Administration Workshop I C - 77


Subclause Syntax
subquery_factoring_clause WITH query_name AS (subquery)
[, query_name AS (subquery) ]...

subquery_restriction_clause WITH { READ ONLY


| CHECK OPTION [ CONSTRAINT constraint ]
}

substitutable_column_clause [ ELEMENT ] IS OF [ TYPE ] ([ ONLY ] type)


| [ NOT ] SUBSTITUTABLE AT ALL LEVELS

supplemental_db_logging { ADD | DROP } SUPPLEMENTAL LOG


{ DATA | supplemental_id_key_clause }

supplemental_id_key_clause DATA
({ ALL
| PRIMARY KEY
| UNIQUE
| FOREIGN KEY
}
[, { ALL
| PRIMARY KEY
| UNIQUE

m y
e
| FOREIGN KEY
}

)
]...

a d
COLUMNS

A c
supplemental_log_grp_clause

l e
GROUP log_group

c
(column [ NO LOG ]
[, column [ NO LOG ] ]...)

r a
[ ALWAYS ]

supplemental_logging_props
O ly
{ supplemental_log_grp_clause

l & On
| supplemental_id_key_clause
}

n a e
t e r
supplemental_table_logging

U
{ ADD SUPPLEMENTAL LOG

s { supplemental_log_grp_clause
| supplemental_id_key_clause

I n }
[, SUPPLEMENTAL LOG

e
{ supplemental_log_grp_clause

c l | supplemental_id_key_clause
}

r a ]...
| DROP SUPPLEMENTAL LOG

O { supplemental_id_key_clause
| GROUP log_group

Oracle Database 11g: Administration Workshop I C - 78


Subclause Syntax
}
[, SUPPLEMENTAL LOG
{ supplemental_id_key_clause
| GROUP log_group
}
]...
}

table_collection_expression TABLE (collection_expression) [ (+) ]

table_compression { COMPRESS | NOCOMPRESS }

table_index_clause [ schema. ]table [ t_alias ]


(index_expr [ ASC | DESC ]
[, index_expr [ ASC | DESC ] ]...)
[ index_properties ]

table_partition_description [ segment_attributes_clause ]
[ table_compression | key_compression ]
[ OVERFLOW [ segment_attributes_clause ] ]
[ { LOB_storage_clause
| varray_col_properties

m y
e
}
[ LOB_storage_clause
| varray_col_properties
]...
a d
]

A
[ partition_level_subpartition ] c
table_partitioning_clauses {
|
c l e
range_partitioning
hash_partitioning
|
|
r a
list_partitioning
composite_partitioning
}
O ly
table_properties [
l & On
column_properties ]

n a e
[
[
table_partitioning_clauses ]
CACHE | NOCACHE ]

t e r [
[
[
U s
parallel_clause ]
ROWDEPENDENCIES | NOROWDEPENDENCIES ]
enable_disable_clause ]

I n [ enable_disable_clause ]...
[ row_movement_clause ]

c l e [ AS subquery ]

r a
table_reference { ONLY
(query_table_expression)

O [ flashback_query_clause ]
[ t_alias ]

Oracle Database 11g: Administration Workshop I C - 79


Subclause Syntax
| query_table_expression
[ flashback_query_clause ]
[ t_alias ]
| (join_clause)
| join_clause
}

tablespace_clauses { EXTENT MANAGEMENT LOCAL


| DATAFILE file_specification
[, file_specification ]...
| SYSAUX DATAFILE file_specification
[, file_specification ]...
| default_tablespace
| default_temp_tablespace
| undo_tablespace
}

tablespace_group_clause TABLESPACE GROUP { tablespace_group_name | '' }

tablespace_logging_clauses { logging_clause

y
| [ NO ] FORCE LOGGING
}

tablespace_retention_clause RETENTION { GUARANTEE | NOGUARANTEE }


e m
a d
tablespace_state_clauses {
|
}
ONLINE

A c
OFFLINE [ NORMAL | TEMPORARY | IMMEDIATE ]

|
|
l e
READ { ONLY | WRITE }

c
{ PERMANENT | TEMPORARY }

temporary_tablespace_clause
r a
TEMPORARY TABLESPACE tablespace

O ly
[ TEMPFILE file_specification
[, file_specification ]...

l & On
]
[ tablespace_group_clause ]

n a e [ extent_management_clause ]

text

t e r U s
[ N | n ]
{ 'c [ c ]...'

I n | { Q | q }
'quote_delimiter c [ c ]... quote_delimiter'

e
}

c l
r a
trace_file_clause TRACE
[ AS 'filename' [ REUSE ] ]

O
[ RESETLOGS | NORESETLOGS ]

Oracle Database 11g: Administration Workshop I C - 80


Subclause Syntax
truncate_partition_subpart TRUNCATE { PARTITION partition
| SUBPARTITION subpartition
}
[ { DROP | REUSE } STORAGE ]
[ update_index_clauses [ parallel_clause ] ]

undo_tablespace [ BIGFILE | SMALLFILE ]


UNDO TABLESPACE tablespace
[ TABLESPACE file_specification
[, file_specification ]...
]

undo_tablespace_clause UNDO TABLESPACE tablespace


[ DATAFILE file_specification
[, file_specification ]...
]
[ extent_management_clause ]
[ tablespace_retention_clause ]

undrop_disk_clause UNDROP DISKS

update_all_indexes_clause UPDATE INDEXES


[ (index ( { update_index_partition
m y
e
| update_index_subpartition

d
}
)
)

c a
[, (index ( { update_index_partition

e
} A
| update_index_subparition

)
c l )

a
]...

r
update_global_index_clause
O ly
{ UPDATE | INVALIDATE } GLOBAL INDEXES

update_index_clauses
l & On
{ update_global_index_clause

a e
| update_all_indexes_clause
}

r n s
update_index_partition

n t e U
PARTITION [ partition ]
[ index_partition_description

e I ]
[ index_subpartition_clause ]

c l [, PARTITION [ partition ]
[ index_partition_description

a
[ index_subpartition_clause ]

O r ]...
]

Oracle Database 11g: Administration Workshop I C - 81


Subclause Syntax
update_index_subpartition SUBPARTITION [ subpartition ]
[ TABLESPACE tablespace ]
[, SUBPARTITION [ subpartition ]
[ TABLESPACE tablespace ]
]...

update_set_clause SET
{ { (column [, column ]...) = (subquery)
| column = { expr | (subquery) | DEFAULT }
}
[, { (column [, column]...) = (subquery)
| column = { expr | (subquery) | DEFAULT
}
}
]...
| VALUE (t_alias) = { expr | (subquery) }
}

upgrade_table_clause UPGRADE [ [NOT ] INCLUDING DATA ]


[ column_properties ]

using_function_clause USING [ schema. ] [ package. | type.


]function_name
m y
using_index_clause USING INDEX
d e
{ [ schema. ]index
| (create_index_statement)
c a
| index_properties
}

e A
c l
a
using_statistics_type USING { [ schema. ] statistics_type | NULL }

using_type_clause r
O ly
USING [ schema. ]implementation_type
[ array_DML_clause ]

l & On
validation_clauses

n a e{ VALIDATE REF UPDATE


[ SET DANGLING TO NULL ]

t e r U s
| VALIDATE STRUCTURE
[ CASCADE ]
[ into_clause ]

I n }
{ OFFLINE| ONLINE }

c l e
values_clause VALUES ({ expr | DEFAULT }

r a )
[, { expr | DEFAULT } ]...

O
Oracle Database 11g: Administration Workshop I C - 82
Subclause Syntax
varray_col_properties VARRAY varray_item
{ [ substitutable_column_clause ]
STORE AS LOB
{ [ LOB_segname ] (LOB_parameters)
| LOB_segname
}
| substitutable_column_clause
}

where_clause WHERE condition

windowing_clause { ROWS | RANGE }


{ BETWEEN
{ UNBOUNDED PRECEDING
| CURRENT ROW
| value_expr { PRECEDING | FOLLOWING }
}
AND
{ UNBOUNDED FOLLOWING
| CURRENT ROW
| value_expr { PRECEDING | FOLLOWING }
}
| { UNBOUNDED PRECEDING
| CURRENT ROW
m y
| value_expr PRECEDING
}
d e
}

c a
XML_attributes_clause XMLATTRIBUTES
(value_expr [ AS c_alias ]

e A
)
c l
[, value_expr [ AS c_alias ]...

XMLSchema_spec
r a
[ XMLSCHEMA XMLSchema_URL ]

O ly
ELEMENT { element | XMLSchema_URL # element }

XMLType_column_properties
l & On
XMLTYPE [ COLUMN ] column

n a e [ XMLType_storage ]
[ XMLSchema_spec ]

XMLType_storage
t e r U s
STORE AS

I n { OBJECT RELATIONAL
| CLOB [ { LOB_segname [ (LOB_parameters) ]

c l e ]
| LOB_parameters
}

r a
OXMLType_table CREATE TABLE [ GLOBAL TEMPORARY ] TABLE
[ schema. ]table OF XMLTYPE

Oracle Database 11g: Administration Workshop I C - 83


Subclause Syntax
[ (oject_properties) ]
[ XMLTYPE XMLType_storage ]
[ XMLSchema_spec ]
[ ON COMMIT { DELETE | PRESERVE } ROWS ]
[ OID_clause ]
[ OID_index_clause ]
[ physical_properties ]
[ table_properties ] ;

XMLType_view_clause OF XMLTYPE
[ XMLSchema_spec ]
WITH OBJECT IDENTIFIER
{ DEFAULT | ( expr [, expr ]...) }

m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I C - 84
_________________

Appendix D
Acronyms and
Terms
_________________

m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Term Definition
Active session pool Number of current active sessions allowed for a resource group or
subplan
ADDM Automatic Database Diagnostic Monitor
ASM Automatic Storage Management
ASM Automatic Summary Management
ASMM Automatic Shared Memory Management
ASSM Automatic Segment Space Management
ATO Automatic Tuning Optimizer
Automatic PGA Memory A feature of the Oracle database that simplifies and improves the
Management way PGA memory is allocated
Automatic Shared A feature of the Oracle database that automates the management
Memory Management of the most important shared memory structures used by an
Oracle database instance
Automatic Storage A mechanism that provides a vertical integration of the file
Management system and the volume manager, specifically built for the Oracle
database files
Automatic Database A utility that performs a top-down instance analysis, identifies
Diagnostic Management problems and potential causes, and makes recommendations for

Automatic Tuning
fixing the problems
A database feature that performs various analyses of SQL
m y
Optimizer
Automatic Workload
performance within the database

d e
An infrastructure that collects, processes, and maintains
Repository
a
performance statistics for problem detection and self-tuning
purposes
c
Auxiliary database
A
A database that is used when creating a duplicate database or

e
performing tablespace point-in-time recovery
AWR
c l
Automatic Workload Repository
Backup piece
Backup set
r a
An individual file that is part of a backup set
A copy of one or more data or archived log files. It differs from

Block change tracking O ly


image copies in that empty blocks are not stored.
A feature that uses the change tracking writer (CTWR)
& On
background process to record the physical location of all database
l
Block corruption
n a e
changes in a separate file
Corruption of a data block. A corrupted data block is a block that

t e r U s
is not in a recognized Oracle format, or whose contents are not
internally consistent.
Block Media Recovery
I n A recovery method that reduces the smallest recoverable unit of
media recovery from a data file to a block
BMR

c l
Buffer cachee Block Media Recovery
A region of memory that caches blocks of data retrieved from the

r
CFSa database
Cluster File Storage
O
Oracle Database 11g: Administration Workshop I D - 2
Term Definition
Change tracking file A file used to store the physical location of database changes
made since the last backup
Channel A link or connection to a target database
CLI Command-line interpreter
Cluster A group of one or more tables that share the same data blocks
CMAN Oracle Connection Manager. It functions as a net traffic firewall
and proxy server.
Control file A file that contains information about the physical structure of the
database, including the locations of all data and redo log files
CRS Cluster Ready Services
Data block The smallest unit of physical storage within the database. Data
blocks contain rows of data, index information, and so on.
Data dictionary cache An area of memory within the shared pool that holds the
definitions of dictionary objects in memory
Data file A file that contains data for the database
Database Character Set A utility that assesses the feasibility of migrating an Oracle
Scanner database to a new database character set
DBA Database administrator
DBA Data block address, which is used to uniquely identify a data

DBCA
block within the database
Database Configuration Assistant
m y
DBVERIFY
e
An external command-line utility that performs a physical data
structure integrity check on an offline database
d
DDL
a
Data definition language. It is the class of SQL statements that
define and manipulate database objects.
c
DML
A
Data manipulation language. It is the class of SQL statements that

e
query and manipulate data.
EM
l
Enterprise Manager
c
emctl

r a
Enterprise Manager Control. It is a utility for starting, stopping,
and checking the status of Database Control, the Oracle Agent,

Encoded character set O ly


and Oracle Management servers.
A character set that maps numeric codes to characters that a

Enterprise Manager l & On


computer or terminal can display and receive
A graphical interface used to manage the database
Database Control Console
n a e
EXTPROC
FGA
t e r U s
External code libraries
Fine-grained auditing
FGAC
I
Flash recovery area n Fine-Grained Access Control
A unified storage location for all recovery-related files and

c l e
Flashback buffer
activities in an Oracle database
An area in memory that stores Flashback Database data

r a
Flashback Database A new recovery method that uses Undo data, instead of Redo
data, to recover the database
O
Oracle Database 11g: Administration Workshop I D - 3
Term Definition
Flashback Drop A feature that enables you to undo the effects of a DROP TABLE
statement without resorting to traditional point-in-time recovery
Flashback Table A command that enables you to recover a table and all its
dependent objects from the recycle bin
Flashback Transaction A diagnostic tool that you can use to view changes made to the
Query database at the transaction level
Flashback Versions A query syntax that provides a history of changes made to a row
Query along with the corresponding identifier of the transaction that
made the change
Format mask elements A character literal that describes the format of datetime or
numeric data stored in a character string
Growth trend report Analysis of the growth of database segments
Globalization support A feature set that ensures that utilities and error messages, sort
order, alphabet, calendar, date, time, money, and numbers
automatically adapt to the native language
Image copy A bit-for-bit identical copy of a database file
Incarnation A separate version of a physical database. The incarnation of the
database changes when you open it with the RESETLOGS option,
but you can recover backups from an earlier incarnation so long

Index-organized tables
as the necessary redo is available.

m y
A database structure that has the appearance of a table but stores

init.ora or
its data in a B*Tree structure

d e
The initialization parameter file that controls how the database
init<sid>.ora
“parameter file”.
c a
instance is configured and run at startup time. Also known as

Instance
e A
The collection of shared memory and processes used to access the
Oracle database
c l
IPC
isqlplusctl
r a
Internal Process Communication
Control utility for starting and stopping iSQL*Plus listener

ISV
processes
O ly
Independent software vendor
Java pool
& On
A region of memory in the SGA that is used for all session-
l
specific Java code and data within the Java Virtual Machine

n a e
(JVM)
JDBC
jnnn
t e r U s
Java Database Connectivity
Job Queue Processes. They execute scheduled jobs.
Keep buffer cache
I n An area of memory in the SGA used to cache data in the buffer
cache for longer periods of time

c l e
Language and Character
Set File Scanner
A statistic-based utility for determining the language and
character set for unknown file text

r a
Large pool An optional memory storage area used for buffering large I/O
requests

OLCSSCAN Language and Character Set File Scanner

Oracle Database 11g: Administration Workshop I D - 4


Term Definition
®
LEGATO NetWorker, Software included with Oracle Database 10g that enables the
Single-Server Version Recovery Manager utility to write to tape drives
Library cache An area of memory within the shared pool that contains the fully
parsed or compiled representations of PL/SQL blocks and SQL
statements
Linguistic sort A feature that produces a sort sequence that matches the
alphabetic sequence of characters, and not their numeric values in
the character encoding scheme
Listener The gateway to the Oracle instance for all nonlocal user
connections
Locale A collection of information about the linguistic and cultural
preferences from a particular region
Locale variants A language-dependent territory definition
LSSV LEGATO® NetWorker, Single-Server Version
Media management An interface used by RMAN when writing to or reading from
library tapes
Memory Advisor A feature of Enterprise Manager that helps you tune the size of
your memory structures
Memory Manager A database background process that serves as the SGA memory
(MMAN)
Metric
broker and coordinates the sizing of memory components
A measurement of some database or instance characteristic
m y
MML
MMON
Media management library
Management Monitor Process. This process issues alerts
d e
c a
whenever a metric violates its threshold value. It captures
statistics for SQL objects that have been recently modified.
National Language
Support
e
the database client and the database serverA
Parameters and files that determine the locale-specific behavior of

nK block size buffer


l
A region of memory in the SGA, which caches data blocks that
c
are of a different size than the default database block size. It is

r a
used to support transportable tablespaces.
NLS
NLS Runtime Library O ly
National Language Support
A comprehensive suite of language-independent functions that

l & On
allow proper text and character processing and language-
convention manipulations
NLS_LANG
n a e
An environment variable used to specify the language, territory,

NLSRTL
t e r U s
and character set used by a database
National Language Support Runtime Library
NMP
OC4J
I n Named Pipes
Oracle Application Server Containers for J2EE
OMF

c l e
Optimizer statistics
Oracle Managed Files
Statistics that describe the database and the objects in the

r a database, and are used by the query optimizer to choose the best
execution plan for each SQL statement

OOUI Oracle Universal Installer

Oracle Database 11g: Administration Workshop I D - 5


Term Definition
Oracle Locale Builder A feature that provides a graphical user interface through which
you can easily view, modify, and define locale-specific data
Oracle Managed Files A feature of the Oracle database, which manages the creation,
naming, and deletion of Oracle database files within dedicated
areas of the disk
Oracle Net An interface that enables network connections between Oracle
Database 10g and client or middle-tier applications
Oracle Shared Server A database server configuration that allows many user processes
to share a small number of server processes, minimizing the
number of server processes and maximizing the use of available
system resources
ORACLE_BASE Environment variable used to point to the base of the OFA
structure
ORACLE_HOME Environment variable used to identify a directory containing
Oracle software
ORACLE_SID Environment variable used to specify the default database
instance name
Package A collection of procedures and function definitions that are
logically related. The procedures and functions are implemented

Parallelization
by the package body.
Allocation of multiple channels for RMAN backup and recovery
m y
PGA
operations
Program Global Area
d e
PGA Advisor
a
A feature of Enterprise Manager that gives detailed statistics for

c
the work areas and provides recommendations about optimal

workload characteristics
e A
usage of Program Global Area (PGA) memory on the basis of

Pipe
l
An area of memory used by one process to pass information to
another
c
Private SQL area
r a
An area of memory in the PGA that contains data such as bind

Privilege O ly
information and run-time memory structures
The right to execute a particular type of SQL statement. There are

Proactive Tablespace
l & On
two basic forms of privileges: object and system.
A feature of Oracle Database 10g that manages tablespace disk
Monitoring
a e
space usage
n
Program Global Area
Recovery catalog
t e r s
Private memory area for use by a process
A separate database that keeps historical data concerning backup
U
Recovery Manager
I n activities
The Oracle utility used to back up and restore database files
Recycle bin

c l e A data dictionary table that maintains the relationships between


the original names of dropped objects and their system-generated

r a
Recycle buffer cache
names
A region of memory in the SGA, which holds data that is quickly

O aged out of the buffer cache

Oracle Database 11g: Administration Workshop I D - 6


Term Definition
Redo log buffer A region of memory that caches redo information until it can be
written to disk
Redo Log File Sizing A feature of Enterprise Manager that offers redo log file-sizing
Advisor advice
Resource Manager A feature of the Oracle database that gives the Oracle database
server more control over resource management decisions, thus
circumventing problems resulting from inefficient operating
system management
Resumable space A means for suspending, and later resuming, the execution of
allocation large database operations in the event of space allocation failures
RMAN Recovery Manager
RMAN Repository A storage structure that maintains metadata about a database’s
backup and recovery operations
Scheduler A new database feature that enables database administrators and
application developers to control when and where various tasks
take place in the database environment
SCN System change number
Segment Advisor An advisor that monitors object space issues and analyzes growth
trends
Segment Resource
Estimator
The new segment resource estimation feature that enables you to
estimate the amount of resources that the creation of a new
m y
Server sessions
segment would require

d
The server processes (UNIX) or threads (Windows NT/2000)e
Session memory
c a
invoked by a client utility to connect to the target database
Memory in the PGA that is allocated to hold session variables and

SGA
other information related to the session
A
System Global Area. It is the memory area shared by all server
e
SGA Advisor
c l
and background processes.
An advisor that makes recommendations for SGA-related

r a
parameter settings
Shared pool
O ly
A region of memory that caches various constructs that can be
shared among users
Shrink Advisor
SID
l & On
See the Segment Advisor.
System Identifier. It defaults to the database name and uniquely
a e
identifies the instance on a given server.
n
SQL
SQL Access Advisor
t e r U s
Structured Query Language
A tool that determines optimal data access path (for example, the

SQL Tuning Advisor


I n use of indexes and materialized views)
A tool that provides tuning advice for SQL statements
Statspack

c l e A set of SQL, PL/SQL, and SQL*Plus scripts that allow the


collection, automation, storage, and viewing of performance data.

r a This feature has been replaced by the Automatic Workload


Repository.

OStreams pool An optional region of memory in the SGA that is used by Oracle
Streams

Oracle Database 11g: Administration Workshop I D - 7


Term Definition
System statistics Statistics that describe the system’s hardware characteristics, such
as I/O and CPU performance and utilization, to the query
optimizer
Tablespace A logical grouping of data files
Target database The database that you are attempting to connect to
Threshold A boundary value against which metric values are compared
Undo Advisor A feature of Enterprise Manager that suggests parameter values
and the amount of additional space that is needed to support
flashback for a specified time
Undo data A copy of original data stored whenever a DML transaction
changes data. Undo data is used to roll back a transaction and to
provide read-consistent views of changing data.
User Global Area An area of memory within the shared pool or large pool that
contains the session information for the Oracle shared server
sessions
UTC Universal Time Coordinates. This is a global time stamp in the
Uniform Audit Trail.
VPD Virtual Private Database
Wait event Statistics that are incremented by a server process or thread to
indicate that the process had to wait for an event to complete
before being able to continue processing
m y
Work area
e
A private allocation of memory in the PGA, used for sorts, hash
joins, and other operations that are memory intensive
d
Workload repository See AWR.

c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I D - 8
Next Steps:
Continuing Your Education

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Where Do You Go from Here?

“To stay competitive in the tech industry, never stop


learning. Always be on the lookout for better ways of
doing things and new technologies. Our industry does
not reward people who let themselves stagnate”
–John Hall, Senior Vice President, Oracle University

Here are a few resources to help you with continuing


your education.

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I E - 2
Continuing Education Resources

The resources to learn more about administering Oracle


Database 11g include:
• Oracle University
• Oracle Technology Network
• Technical support: Oracle MetaLink

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I E - 3
Oracle University
http://education.oracle.com

Learn Oracle from Oracle! No one knows


Oracle technology better than Oracle
University.
• Worldwide education services
• 100% student satisfaction
• Learn with the format that best suits
your needs:
– Instructor-Led Inclass Training
– Live Web Class
– Self-Study CD-ROMs
• Certification
m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Oracle University

e A
c l
Oracle University is the world’s largest corporate educator with education centers around the
globe. The goal is 100% student satisfaction.

r a
Oracle certifications are tangible, industry-recognized credentials that provide measurable

O ly
benefits to IT Professionals and their employers. Numerous certification paths exist, for
example, for DBAs:

l & On
• Oracle Certified Associate (OCA)
• Oracle Certified Professional (OCP)
a e
• Oracle Certified Master (OCM), and
n
Expert
t e r U s
• Specialty certifications, for example, Oracle 10g: Managing Oracle on Linux Certified

I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I E - 4
Continuing Your Education

• Recommended follow-on classes:


– Oracle Database 11g: Administration Workshop II
– Oracle Database 11g: SQL Fundamentals I & II
– Oracle Database 11g: PL/SQL Fundamentals
• Grid technology specialty courses:
– Oracle Enterprise Manager 11g Grid Control
– Oracle Database 11g: Real Application Clusters
– Oracle Database 11g: Implement Streams
– Oracle Database 11g: Data Guard Administration
• Other specialty courses

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Continuing Your Education

e A
c l
The Oracle Database 11g: Administration Workshop II course continues your training as a
database administrator. You cover advanced database recovery strategies, performance

r a
monitoring and tuning, and distributed data concepts.

O ly
In this course, SQL and PL/SQL are discussed. Because both of these topics are vast, you are
provided with only an overview. You can find additional training on these topics that can

& On
enhance your abilities as an administrator.
l
n a e
Oracle recommends that you complete the Oracle Database 11g: Administration Workshop II
course, before beginning specialty courses.

e r s
Consult Oracle University’s website for an up-to-date list of all courses. Other specialty
courses include:
t U
I n
• Oracle Database 11g: Security
• Oracle Database 11g: Implement and Administer a Data Warehouse

c l e
r a
O
Oracle Database 11g: Administration Workshop I E - 5
Database Specialty Areas
Modern Enterprise Grids
• Real Application Clusters
• Management packs
• TimesTen In-Memory Database
Information Lifecycle Management
• Partitioning
• Advanced Compression
Data Warehousing
• Oracle Information Appliances
• OLAP, Mining, Warehouse
Builder
Governance, Risk & Compliance
• Security Options
• Total Recall
Change management
m y
• Real Application Testing

d e
Copyright © 2007, Oracle. All rights reserved.

ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I E - 6
Oracle Real Application Clusters

• Consolidating different
workloads to a single
grid
• Virtualizing the
information platform Databases
• Flexible physical
infrastructure (including
dedicated servers)

Storage
m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Why use RAC?

e A
c l
Oracle Real Application Clusters (RAC) enables high utilization of a cluster of standard, low-
cost modular servers such as blades. RAC offers automatic workload management for services.

r a
Services are groups or classifications of applications that comprise business components
corresponding to application workloads. Services in RAC enable continuous, uninterrupted
O ly
database operations and provide support for multiple services on multiple instances. You

l & On
assign services to run on one or more instances, and alternate instances can serve as backup
instances. If a primary instance fails, Oracle moves the services from the failed instance to a
a e
surviving alternate instance. Oracle also automatically load-balances connections across
n
t e r
instances hosting a service.

U s
RAC harnesses the power of multiple low-cost computers to serve as a single large computer

I n
for database processing, and provides the only viable alternative to large-scale SMP boxes for
all types of applications. RAC, which is based on a shared-disk architecture, can grow and

l e
shrink on demand without the need to artificially partition data among the servers of your

c
cluster. RAC also offers a single-button addition and removal of servers to a cluster. Thus, you

a
can easily provide or remove a server to or from the database.
r
O
Oracle Database 11g: Administration Workshop I E - 7
Oracle Data Guard

Synchronous or Standby databases, for example:


asynchronous redo
transport For reporting: Logical
Primary standby database with
database additional materialized
views

For QA and testing:


Oracle Net

Physical/ Snapshot
standby with the
changes queued

For off-site queries:


Physical standby

Observer: Initiating
fast-start failover

Production Database Database copies


m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Oracle Data Guard

e A
c l
Oracle Data Guard is a management, monitoring, and automation software infrastructure that
works with a production database and one or more standby databases to protect your data

r a
against failures, errors, and corruptions that might otherwise destroy your database. It protects
critical data by providing facilities to automate the creation, management, and monitoring of
O ly
the databases and other components in a Data Guard configuration. It automates the process of

l & On
maintaining a copy of an Oracle production database (called a standby database) that can be
used if the production database is taken offline for routine maintenance or becomes damaged.
a e
In a Data Guard configuration, a production database is referred to as a primary database. A
n
t e r U s
standby database is a synchronized copy of the primary database. Using a backup copy of the
primary database, you can create from one to nine standby databases. The standby databases,

I n
together with the primary database, make up a Data Guard configuration. Each standby
database is associated with only one primary database.

l e
Note: You can use the Cascaded Redo Log Destinations feature to incorporate more than nine

c
standby databases in your configuration.

r a
Configuring standby redo log files is highly recommended on all standby databases in a Data

O Guard configuration, including the primary database to aid in role reversal.

Oracle Database 11g: Administration Workshop I E - 8


Streams Overview

Source database Target database

Propagate

Capture Apply1

Redo logs Apply2


Transparent
Gateway

Non-Oracle
database

m y
d e
Copyright © 2007, Oracle. All rights reserved.

c a
Streams Overview

e A
c l
A stream is a flow of information either within a database or from one database to another.
Oracle Streams is a set of processes and database structures that enable you to share data and

r a
messages in a data stream. The unit of information that is put into a stream is called an event:
• DDL or DML changes, formatted as an LCR
• User-created events
O ly
& On
Events are staged in and propagated between queues.
l
n a e
Most people think of Streams as replication where all databases can be updatable, and without
platform or release considerations. Characteristics include:

t e r U s
• All sites: Active and updateable
• Automatic conflict detection and optional resolution

I n
• Supporting data transformations
• Flexible configurations: n-way, hub & spoke, and so on

l e
• Different database platforms, releases and schemas

c
• Providing high availability for applications (where update conflicts can be avoided or

r a managed)

O
Oracle Database 11g: Administration Workshop I E - 9
Oracle Streams: Basic Elements
By using Oracle Streams, you can share data and events in a data stream, either within a
database or from one database to another.
Oracle Streams uses queues to stage events for propagation or consumption. You can use
Oracle Streams to propagate events from one queue to another, and these queues can be in
the same database or in different databases. You may stage two types of events in a queue
used by Streams: captured events (logical change records, or LCRs) and user-enqueued
events (which can be messages or LCRs):
• Changes to the database can be captured from the redo logs. You can then format these
changes into LCRs. The LCRs can represent data manipulation language (DML) or
data definition language (DDL) changes. The database where changes are generated in
the redo log is called the source database.
• You can also enqueue user events explicitly with a user application. These explicitly
enqueued events can be LCRs or user-created messages. A message is the smallest unit
of information that is inserted into and retrieved from a queue. A message consists of
data as well as information to govern the interpretation and use of the message data.
You can divide Oracle Streams into a small set of tasks. By configuring these tasks, you can
control what information is put into a stream, how the stream flows from node to node, what
happens to events in the stream as they flow into each node, and how the stream terminates.
You can customize each task to address specific requirements and business needs. The

m
result is a new feature that provides greater functionality and flexibility than traditional
y
d e
solutions for capturing and managing events, and for sharing the events with other databases
and applications. Oracle Streams provides the capabilities that are needed to build and

c a
operate distributed enterprises and applications, data warehouses, and high-availability
solutions.
The three basic tasks of Oracle Streams are:
e A
c l
• Capture: To capture DML or DDL events automatically from the redo log. User-
created events are not captured automatically but are placed into a queue via an explicit
enqueue operation.
r a
O ly
• Staging: To store and propagate events between databases. Propagation can be
performed explicitly if needed.

an application.
l & On
• Apply: To apply DML or DDL events to a destination database or to pass the events to

n a e
You can perform these tasks in a single database or combine them with tasks in other

Multi-Database Streams
t e r U s
databases to form a distributed environment.

I n
Events propagate between the staging areas in each database. The capture and consumption

c l e
elements can be active in any database. For example, you can configure bidirectional data
replication with a capture process, propagation job, and apply process at each site. Or, you

r a
can have a single-source system with capture and propagation at one site and apply at
several other databases. You can also have an arbitrary number of databases. Some of the

O more complex environments may need hundreds of databases sharing information with
Oracle Streams.
Oracle Database 11g: Administration Workshop I E - 10
Security
http://www.oracle.com/technology/deploy/security/index.html

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Security

e A
c l
For more information about all security related aspects of the database, visit the “Security
Technology Center” which is updated regularly.

r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I E - 11
Oracle Technology Network
http://www.oracle.com/technology

Oracle Technology Network is a free resource


with information about the core Oracle
software products, including database and
development tools. You can have access to:
• Technology centers
• Oracle Community including
user groups
• Software downloads and
code samples
• Oracle by Example
and much more!

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Oracle Technology Network

e A
c l
Oracle Technology Network (OTN) hosts the latest news about Oracle technology and
products. Additionally, OTN provides peer-to-peer forums, white papers, security bulletins,

r a
and other vital information for the Oracle professional.

O ly
In addition to tips, tricks, and techniques for getting the most out of your Oracle software, you
can download that software from OTN. Remember: All software downloads are free, and each

l & On
comes with a development license that allows you to use full versions of the products only
when developing and making prototypes your applications.

n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I E - 12
Oracle by Example

• What is an OBE?
A set of hands-on, step-by-step instructions
• Where can you find them?
http://www.oracle.com//technology/obe
• What is available?
Over 100 database OBEs grouped by focus area:
— Installation
— Availability
— Manageability
— Security
Application Development
y

— Business Intelligence
— Extended Data Management
e m
Copyright © 2007, Oracle. All rights reserved.
a d
Oracle by Example
A c
l e
The Oracle by Example (OBE) series provides hands-on, step-by-step instructions on how to

c
use various new features of Oracle products. OBEs help to reduce the time spent on learning a

r a
new product capability and enhance the users’ understanding of how the feature can be
implemented in their environment. Currently, OBEs are available for the Oracle database,
O ly
Oracle Application Server, and Oracle Collaboration Suite. OBEs can be accessed at

& On
http://www.oracle.com/technology/obe.

l
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I E - 13
Technical Support: Oracle MetaLink
http://metalink.oracle.com

Access to Oracle MetaLink is included as part of your


annual support maintenance fees. In addition to the most
up-to-date technical information available, MetaLink gives
you access to:
• Service requests (SRs)
• Certification matrices
• Technical forums monitored by Oracle experts
• Software patches
• Bug reports

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Oracle MetaLink

e A
c l
Oracle MetaLink is your gateway to Oracle’s Support resources. Here, you find answers to the
most common issues facing Oracle administrators and developers, as well as resources to solve
many of those issues.
r a
O ly
Like Oracle Technology Network, MetaLink includes the most recent headlines about issues
that affect the Oracle professional.

l & On
n a e
t e r U s
I n
c l e
r a
O
Oracle Database 11g: Administration Workshop I E - 14
Thank You!

We hope your experience with Oracle University has been


enjoyable. We welcome your feedback on how we can
improve to better meet your needs:
• End-of-course evaluations
• Oracle University Office of Customer Satisfaction
• Oracle Education Services
We hope to see you in class again soon.

m y
d e
Copyright © 2007, Oracle. All rights reserved.

ca
Thank You!

e A
c l
Oracle University’s mission is to enhance the adoption of Oracle technology. Our goal is to
partner with you, providing information that is pertinent, timely, and relevant to your needs.

r a
Please take a minute to complete the end-of-course evaluation and let us know how we can

O ly
serve you better. In the U.S., feel free to e-mail our office of customer satisfaction at:
customersat_us@oracle.com

& On
If you have questions about continuing your Oracle education, need help finding a class, or
l
n a e
want to arrange for on-site training at your company, contact Oracle Education Services for
assistance. In the U.S., dial 800.529.0165. For contact numbers outside the U.S., visit the
following Web site:

t e r U s
http://www.oracle.com/education/index.html?contact.html

I n
Thanks again and hope to see you in another class!

c l e
r a
O
Oracle Database 11g: Administration Workshop I E - 15
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c l e
r a
O

Вам также может понравиться