D17090GC31 sg2
D17090GC31 sg2
D17090GC31 sg2
fe r
a ns
n- t r
a no
h a s
Oracle Database m ) e10g: .
c o i d
g i c. t Gu Workshop I
Administration
a relo uden
iw Volume S t
l e @ h i s II • Student Guide
a t
h . bh use
b o d to
su cens e
e (
hal li
h b
o d
sub
D17090GC31
Edition 3.1
December 2008
D57299
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Authors Copyright © 2008, Oracle. All rights reserved.
Maria Billings This document contains proprietary information and is protected by copyright and
other intellectual property laws. You may copy and print this document solely for your
own use in an Oracle training course. The document may not be modified or altered in
Technical Contributors any way. Except where your use constitutes "fair use" under copyright law, you may
and Reviewers 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
Celia Antonio express authorization of Oracle.
Larry Baumann
The information contained in this document is subject to change without notice. If you
Tammy Bednar find any problems in the document, please report them in writing to: Oracle University,
500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
Howard Bradley
warranted to be error-free.
M.J. Bryksa
Restricted Rights Notice
Sandra Cheevers
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
a ble
Joel Goodman applicable:
fe r
John Hibbard
a n s
Magnus Isaksson
U.S. GOVERNMENT RIGHTS
n- t r
The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or
o
Sushma Jagannath
s an
disclose these training materials are restricted by the terms of the applicable Oracle
license agreement and/or the applicable U.S. Government contract.
Christine Jeal
) ha
Steven Karam
Trademark Notice
c o m ide.
Donna Keesling i c. t Gu
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other
g
elo den
names may be trademarks of their respective owners.
Stella Kister
a r
Pierre Labrousse
@ iw s Stu
Stefan Lindblad
h a le
e thi
Dee Matishak
d h .b us
Paul Needham o
b nse t o
Raza Siddiqui su
l e ( i ce
James aSpiller l
h bhStern
Janet
od Barry Trute
sub Jean-Francois Verrier
Anthony Woodell
Editor
Joyce Raftery
Graphic Designer
Satish Bettegowda
Publisher
Jobi Varghese
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Contents
Preface
1 Introduction
Course Objectives 1-2
Suggested Schedule 1-3
Lesson Objectives 1-4
a ble
Oracle Products and Services 1-5
fe r
Oracle Database 10g: “g” Stands for Grid 1-6 a ns
Oracle Database Architecture 1-8 n- t r
o
Database Structures 1-9
s an
Oracle Memory Structures 1-10
) ha
Process Structures 1-12
c o m ide.
Oracle Instance Management 1-13 g i c. t Gu
relo uden
Server Process and Database Buffer Cache 1-14
a
iw s St
Physical Database Structure 1-15
@
a le thi
Tablespaces and Data Files 1-17
h e
h .b us
SYSTEM and SYSAUX Tablespaces 1-18
d
o t o
( s ub ense
Segments, Extents, and Blocks 1-19
hal
e lic
Logical and Physical Database Structures 1-20
iii
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Executing Configuration Scripts 2-16
Completing Your Installation 2-17
Advanced Installation Options 2-18
Installation Option: Silent Mode 2-19
Summary 2-20
Practice Overview: Installing the Oracle Software 2-21
iv
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Shutting Down an Oracle Database Instance 4-24
Shutdown Modes 4-25
SHUTDOWN Options 4-26
Using SQL*Plus to Start Up and Shut Down 4-29
Viewing the Alert Log 4-30
Viewing the Alert History 4-31
Dynamic Performance Views 4-32
Dynamic Performance Views: Usage Examples 4-33
Dynamic Performance Views: Considerations 4-34
Summary 4-35
Practice Overview: Managing the Oracle Instance 4-36
a ble
fe r
5 Managing Database Storage Structures
a ns
Objectives 5-2 n- t r
o
Storage Structures 5-3
s an
How Table Data Is Stored 5-4
) ha
Anatomy of a Database Block 5-5
c o m ide.
Tablespaces and Data Files 5-6
g i c. t Gu
relo uden
Oracle Managed Files (OMF) 5-7
a
iw s St
Space Management in Tablespaces 5-8
@
h a le
e thi
Exploring the Storage Structure 5-9
.b us
Creating a New Tablespace 5-10
d h
o t o
Storage for Locally Managed Tablespaces 5-12
( s ub ense
Tablespaces in the Preconfigured Database 5-14
hal
e lic
Altering a Tablespace 5-16
h b Actions with Tablespaces 5-19
o d
sub Dropping Tablespaces 5-21
Viewing Tablespace Information 5-22
Gathering Storage Information 5-23
Viewing Tablespace Contents 5-24
Enlarging the Database 5-25
What Is Automatic Storage Management? 5-26
ASM: Key Features and Benefits 5-27
ASM: Concepts 5-28
Summary 5-29
Practice Overview: Managing Database Storage Structures 5-30
v
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Creating a User 6-6
Authenticating Users 6-7
Administrator Authentication 6-9
Unlocking a User Account and Resetting the Password 6-10
Privileges 6-11
System Privileges 6-12
Object Privileges 6-14
Revoking System Privileges with ADMIN OPTION 6-15
Revoking Object Privileges with GRANT OPTION 6-16
Benefits of Roles 6-17
Assigning Privileges to Roles and Roles to Users 6-18
a ble
Predefined Roles 6-19
fe r
Creating a Role 6-20
a ns
Secure Roles 6-21 n- t r
o
Assigning Roles to Users 6-22
s an
Profiles and Users 6-23
) ha
Implementing Password Security Features 6-25
c o m ide.
Creating a Password Profile 6-27
g i c. t Gu
relo uden
Supplied Password Verification Function: VERIFY_FUNCTION 6-28
a
Assigning Quota to Users 6-29
@ iw s St
Summary 6-31
h a le
e thi
.b us
Practice Overview: Administering Users 6-32
d h
o t o
s
7 Managing(Schema
ub eObjects
n se
h a le 7-2 lic
Objectives
h bWhat Is a Schema? 7-3
b d
o Accessing Schema Objects 7-5
s u
Naming Database Objects 7-6
Specifying Data Types in Tables 7-8
Creating and Modifying Tables 7-11
Understanding Data Integrity 7-13
Defining Constraints 7-15
Constraint Violations 7-16
Constraint States 7-17
Constraint Checking 7-19
Creating Constraints with SQL: Examples 7-20
Viewing the Columns in a Table 7-21
Viewing the Contents of a Table 7-22
Actions with Tables 7-23
Dropping a Table 7-24
vi
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Truncating a Table 7-25
Indexes 7-26
Types of Indexes 7-27
B-Tree Index 7-28
Bitmap Indexes 7-30
Index Options 7-32
Creating Indexes 7-34
What Is a View? 7-35
Creating Views 7-36
Sequences 7-37
Creating a Sequence 7-38
a ble
Using a Sequence 7-40
fe r
Temporary Tables 7-41
a ns
Temporary Tables: Considerations 7-43 n- t r
o
Data Dictionary: Overview 7-44
s an
Data Dictionary Views 7-45
) ha
Data Dictionary: Usage Examples 7-47
c o m ide.
Summary 7-48
g i c. t Gu
relo uden
Practice Overview: Administering Schema Objects 7-49
a
@ iw s St
h a le
8 Managing Data and Concurrency
e t hi
Objectives 8-2 .b
o
Manipulatingd h to usSQL 8-3
Data Through
(
The s ub eCommand
INSERT n se 8-4
e lic Command 8-5
hal The UPDATE
h b
o d The DELETE Command 8-6
sub The MERGE Command 8-7
The COMMIT and ROLLBACK Commands 8-9
PL/SQL 8-10
Administering PL/SQL Objects 8-12
PL/SQL Objects 8-13
Functions 8-14
Procedures 8-15
Packages 8-16
Package Specification and Body 8-17
Built-in Packages 8-18
Triggers 8-19
Triggering Events 8-20
Locks 8-21
Locking Mechanism 8-22
vii
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Data Concurrency 8-23
DML Locks 8-25
Enqueue Mechanism 8-26
Lock Conflicts 8-27
Possible Causes of Lock Conflicts 8-28
Detecting Lock Conflicts 8-29
Resolving Lock Conflicts 8-30
Resolving Lock Conflicts Using SQL 8-31
Deadlocks 8-32
Summary 8-33
Practice Overview: Managing Data and Concurrency 8-34
a ble
fe r
9 Managing Undo Data
a ns
Objectives 9-2 n- t r
o
Data Manipulation 9-3
s an
Undo Data 9-4
) ha
Transactions and Undo Data 9-6
c o m ide.
Storing Undo Information 9-7
g i c. t Gu
Undo Data Versus Redo Data 9-8
a relo uden
Monitoring Undo 9-9
@ iw s St
Administering Undo 9-11
h a le
e thi
.b us
Configuring Undo Retention 9-12
d h
o t o
Guaranteeing Undo Retention 9-14
( s ub ense
Sizing the Undo Tablespace 9-15
hal
e lic
Using the Undo Advisor 9-16
h b
Summary 9-17
o d
sub Practice Overview: Managing Undo Segments 9-18
viii
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Using and Maintaining Audit Information 10-17
Value-Based Auditing 10-18
Fine-Grained Auditing 10-20
FGA Policy 10-21
Audited DML Statement: Considerations 10-23
FGA Guidelines 10-24
DBA Auditing 10-25
Maintaining the Audit Trail 10-26
Security Updates 10-27
Applying Security Patches 10-28
Summary 10-29
a ble
Practice Overview: Implementing Oracle Database Security 10-30
fe r
a ns
11 Configuring the Oracle Network Environment n- t r
o
Objectives 11-2
s an
Oracle Net Services 11-3
) ha
Oracle Net Listener 11-4
c o m ide.
Establishing Net Connections 11-5
g i c. t Gu
Establishing a Connection 11-6
a relo uden
User Sessions 11-7
@ iw s St
h a le
e thi
Tools for Configuring and Managing the Oracle Network 11-8
.b us
Listener Control Utility 11-9
d h
o t o
Listener Control Utility Syntax 11-10
( s ub ense
Listener Home Page 11-12
hal
e lic
Net Services Administration Pages 11-13
h b Creating a Listener 11-14
o d
sub Adding Listener Addresses 11-15
Database Service Registration 11-16
Naming Methods 11-17
Easy Connect 11-18
Local Naming 11-19
Directory Naming 11-20
External Naming Method 11-21
Configuring Service Aliases 11-22
Advanced Connection Options 11-23
Testing Oracle Net Connectivity 11-25
User Sessions: Dedicated Server 11-26
User Sessions: Shared Servers 11-27
SGA and PGA 11-28
Shared Server: Connection Pooling 11-29
When Not to Use a Shared Server 11-30
ix
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Summary 11-31
Practice Overview: Working with Oracle Network Components 11-32
12 Proactive Maintenance
Objectives 12-2
Proactive Maintenance 12-3
Introducing Terminology 12-4
Optimizer Statistics 12-5
Using the Manage Optimizer Statistics Page 12-7
Automatic Workload Repository (AWR) 12-9
AWR Infrastructure 12-10
a ble
AWR Snapshot Sets 12-11
fe r
Enterprise Manager and AWR 12-12
a ns
Managing the AWR 12-13 n- t r
o
Statistic Levels 12-14
s an
Automatic Database Diagnostic Monitor (ADDM) 12-15
) ha
ADDM Findings 12-16
c o m ide.
ADDM Recommendations 12-17
g i c. t Gu
Advisory Framework 12-18
a relo uden
iw s St
Enterprise Manager and Advisors 12-20
@
h a le
The DBMS_ADVISOR Package 12-21
e thi
.b
Server-Generated Alerts 12-22
d h us
o t o
Default Server-Generated Alerts 12-23
( s ub ense
Setting Thresholds 12-24
hal
e lic
Creating and Testing an Alert 12-25
h b
Alerts Notification 12-26
o d
sub Reacting to Alerts 12-28
Alert Types and Clearing Alerts 12-29
Automated Maintenance Tasks 12-30
Summary 12-31
Practice Overview: Proactive Maintenance 12-32
13 Performance Management
Objectives 13-2
Performance Monitoring 13-3
Performance Monitoring: Top Sessions 13-7
Performance Monitoring: Top Services 13-8
SQL Tuning Advisor: Overview 13-9
SQL Tuning Advisor Options and Recommendations 13-10
Using the SQL Tuning Advisor 13-11
Using the SQL Tuning Advisor: Example 13-12
x
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Tuning Advisor: SQL Statistics 13-14
SQL Tuning Advisor: Identifying Duplicate SQL 13-15
Using the SQL Access Advisor 13-16
Managing Memory Components 13-18
Enabling Automatic Shared Memory Management (ASMM) 13-19
Manually Setting Shared Memory Management 13-21
Using the Memory Advisor 13-22
Dynamic Performance Statistics 13-23
Troubleshooting and Tuning Views 13-25
Invalid and Unusable Objects 13-26
Summary 13-28
a ble
Practice Overview: Monitoring and Improving Performance 13-29
fe r
a ns
14 Backup and Recovery Concepts n- t r
o
Objectives 14-2
s an
Part of Your Job 14-3
) ha
Categories of Failures 14-4
c o m ide.
Statement Failure 14-5
g i c. t Gu
User Process Failure 14-6
a relo uden
Network Failure 14-7
@ iw s St
User Error 14-8
h a le
e thi
.b
Instance Failure 14-10
d h us
o t o
Background Processes and Recovery: Checkpoint (CKPT) 14-11
( s ub ense
Background Processes and Recovery: Redo Log Files and LogWriter 14-12
hal
e lic
Background Processes and Recovery: Archiver (ARCn) 14-13
h b Instance Recovery 14-14
o d
sub Phases of Instance Recovery 14-15
Tuning Instance Recovery 14-16
Using the MTTR Advisor 14-17
Media Failure 14-18
Configuring for Recoverability 14-19
Control Files 14-20
Redo Log Files 14-21
Multiplexing the Redo Log 14-22
Archive Log Files 14-23
Archive Log File: Naming and Destinations 14-24
ARCHIVELOG Mode 14-26
Summary 14-27
Practice Overview: Configuring for Recoverability 14-28
xi
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
15 Performing Database Backups
Objectives 15-2
Backup Solutions: Overview 15-3
Oracle Secure Backup 15-4
User-Managed Backup 15-5
Terminology 15-6
Recovery Manager (RMAN) 15-8
Configuring Backup Settings 15-9
Scheduling Backups: Strategy 15-11
Scheduling Backups: Options 15-12
Scheduling Backups: Settings 15-13
a ble
Scheduling Backups: Schedule 15-14
fe r
Scheduling Backups: Review 15-15
a ns
Backing Up the Control File to a Trace File 15-16 n- t r
o
Managing Backups 15-18
s an
Flash Recovery Area 15-19
) ha
Summary 15-20
c o m ide.
Practice Overview: Creating Database Backups 15-21
g i c. t Gu
a r elo den
16 Performing Database Recovery
@ iw s Stu
Objectives 16-2
h a le
e t hi
Opening a Database 16-3
d h .b us
Changing Instance o t
Status 16-5 o
s ub eOpen
Keeping a(Database n se 16-6
Lossaof
c 16-7
lea ControlliFile
h
bLoss of a Redo Log File 16-8
d h
o Loss of a Data File in NOARCHIVELOG Mode 16-10
s ub
Loss of a Noncritical Data File in ARCHIVELOG Mode 16-11
Loss of a System-Critical Data File in ARCHIVELOG Mode 16-12
Summary 16-13
Practice Overview: Performing Database Recovery 16-14
17 Performing Flashback
Objectives 17-2
Flashback Technology: Benefits 17-3
When to Use the Flashback Technology 17-4
Flashing Back Any Error 17-5
Flashback Database: Overview 17-6
Flashback Database: Reducing Restore Time 17-7
Flashback Database: Considerations 17-8
xii
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Flashback Database: Limitations 17-9
Enabling Flashback Database 17-10
Flashback Table: Overview 17-11
Flashback Table 17-12
Enabling Row Movement on a Table 17-13
Performing Flashback Table 17-14
Flashback Table: Considerations 17-16
Flashback Drop: Overview 17-17
Flashing Back Dropped Tables Through Enterprise Manager 17-18
Flashback Drop: Considerations 17-19
Flashback Time Navigation 17-20
a ble
Flashback Query: Overview 17-21
fe r
Flashback Query: Example 17-22
a ns
Flashback Versions Query: Overview 17-23 n- t r
o
Flashback Versions Query Through Enterprise Manager 17-24
s an
Flashback Versions Query: Considerations 17-25
) ha
Flashback Transaction Query: Overview 17-26
c o m ide.
i c. t Gu
Flashback Transaction Query Through Enterprise Manager 17-27
g
relo uden
Flashback Transaction Query: Considerations 17-28
a
Summary 17-29
@ iw s St
h a le
e thi
Practice Overview: Using Flashback 17-30
d h .b us
o
18 Moving Data t o
( s ub 18-2
Objectives e n se
e lic General Architecture 18-3
hal Moving Data:
h b Directory Object: Overview 18-4
o d
sub Creating Directory Objects 18-5
SQL*Loader: Overview 18-6
Loading Data with SQL*Loader 18-8
SQL*Loader Control File 18-9
Loading Methods 18-11
Data Pump: Overview 18-13
Data Pump: Benefits 18-14
Data Pump Export and Import: Overview 18-15
Data Pump Utility: Interfaces and Modes 18-16
Fine-Grained Object Selection 18-17
Advanced Feature: Sampling 18-18
Export Options: Files 18-19
Data Pump File Locations 18-20
Scheduling and Running a Job 18-22
Data Pump File Naming and Size 18-23
xiii
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Data Pump Import 18-24
Data Pump Import: Transformations 18-25
Data Pump: Performance Consideration 18-27
Performance Initialization Parameters 18-28
Data Pump Access Path: Considerations 18-29
Using Enterprise Manager to Monitor Data Pump Jobs 18-30
External Table Population 18-31
Using External Tables 18-32
External Table Population with ORACLE_DATAPUMP 18-33
External Table Population with ORACLE_LOADER 18-34
Data Dictionary 18-35
a ble
Summary 18-36
fe r
Practice Overview: Moving Data 18-37
a ns
n- t r
o
Appendix A: Practices
s an
) ha
Appendix B: Solutions
c o m ide.
g i c. t Gu
Appendix C: Basic Linux and vi Commandsrelo e n
a
iw s Stu d
@
Appendix D: SQL Statement Syntax
h a le
e thi
d h .b us
Appendix E: Acronyms o
b and t o
eTerms
s u
( ice n s
a l eF: Next l - Continuing Your Education
b h
Appendix Steps
o d h
sub Index
xiv
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Preface
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Profile
a b le
fe r
a n s
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Preface - 3
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Related Publications
Oracle Publications
Title Part Number
Oracle Database 2 Day DBA 10g Release 2 (10.2) B14196-01
Oracle Database Administrator's Guide 10g Release 2 (10.2) B14231-01
Oracle Database Backup and Recovery Basics 10g Release 2 (10.2) B14192-01
Oracle Database Concepts 10g Release 2 (10.2) B14220-01
Oracle Database Licensing Information 10g Release 2 (10.2) B14199-01
Oracle Database Net Services Administrator's Guide 10g Release 2 (10.2) B14212-01
Oracle Database Net Services Reference 10g Release 2 (10.2) B14213-01
Oracle Database New Features Guide 10g Release 2 (10.2) B14214-01
a ble
Oracle Database Performance Tuning Guide 10g Release 2 (10.2) B14211-01
fe r
Oracle Database PL/SQL Packages and Types Reference 10g Release 2 (10.2) B14258-01
a ns
t r
Oracle Database PL/SQL User's Guide and Reference 10g Release 2 (10.2) on-
B14261-01
n
Oracle Database Recovery Manager Quick Start Guide 10g Release 2 (10.2)
s a
B14193-01
Oracle Database Recovery Manager Reference 10g Release 2 (10.2) ) h
a B14194-01
o m d e .
Oracle Database Security Guide 10g Release 2 (10.2)
i c
c. t Gu i B14266-01
g
a r elo den
Oracle Database SQL Quick Reference 10g Release 2 (10.2) B14195-01
Oracle Database SQL Reference 10g Release 2iw (10.2)
S tu B14200-01
@ s
h a le
e thi
Additional Publications
d h .b us
• System releaseu o
b nse
bulletins
t o
( s
e and user e
cguides
l
• Installation
a l i
bh files
• read.me
h
b o d• International Oracle Users Group (IOUG) articles
su
• Oracle Magazine
Preface - 4
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Typographic Conventions
Typographic Conventions in Text
hal
Initialbcap
e lic
Graphics labels Customer address (but Oracle Payables)
o d h (unless the term is a
sub proper noun)
Preface - 5
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Typographic Conventions (continued)
Typographic Conventions in Text (continued)
Uppercase SQL column Use the SELECT command to view information stored
names, commands, in the LAST_NAME column of the EMPLOYEES table.
functions, schemas,
a ble
table names,
fe r
database trigger
a ns
names
n- t r
a no
h a s
Typographic Conventions in Code
m ) e.
o
Convention Element Example
g i c.c t Guid
Lowercase Column names, lo en
SELECTrelast_name
table names, i
FROM a
S tud
w employees;
database trigger
a l e@ this
names .bh se OR REPLACE TRIGGER secure_employees
CREATE
d h u
to CREATE USER scott
b o e
e ( su cens
Passwords
IDENTIFIED BY tiger;
a l l i
h bh PL/SQL objects items.DELETE(3);
b o d
s u
Lowercase italic Syntax variables CREATE ROLE role
Preface - 6
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Typographic Conventions (continued)
Typographic Conventions in Navigation Paths
This course uses simplified navigation paths, such as the following example, to direct you through Oracle
applications.
Example:
Preface - 7
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Performing Database Recovery
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal li
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Objectives
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: 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 ble
be present fe r a
a ns
OPEN
n- t r
STARTUP
a no
MOUNT
h a s
m ) e.
o
NOMOUNT
g i c.c t Guid
a r elo den
SHUTDOWN
@ iw s Stu
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
Openingaal Database
h li
b
h a database moves from the shutdown stage to being fully open, it performs internal
As
o d
sub consistency checks. The stages are:
• NOMOUNT: In order 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.
• 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 or corrupt, the instance returns an error (noting the missing
control file) to the administrator and remains in the NOMOUNT state.
• OPEN: When the instance moves from the MOUNT state to the OPEN state, it:
- 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.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: 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 as long as 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.
a ble
Total System Global Area 171966464 bytes
fe r
Fixed Size 775608 bytes
a ns
Variable Size 145762888 bytes n- t r
o
Database Buffers 25165824 bytes
s an
Redo Buffers 262144 bytes
) ha
Database mounted.
c o m ide.
g i c. t Gu
ORA-01157: cannot identify/lock data file 4 - see DBWR
relo uden
trace file
ORA-01110: data file 4: a
iw s St
@
'/oracle/oradata/orcl/users01.dbf'
h a le
SQL> SELECT name, error
e thi
h .b
2 FROM v$datafile
d us
o t o
( s ub ense
3 JOIN v$recover_file
lic
4 USING (file#);
e
bhal NAME ERROR
o d h ----------------------------------- ------------------
sub /oracle/oradata/orcl/users01.dbf FILE NOT FOUND
/oracle/oradata/orcl/example01.dbf FILE NOT FOUND
- Verifies that all data files that are not offline or read-only are synchronized
with the control file. If necessary, instance recovery is automatically
performed. However, if 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 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:
ORA-01113: file 4 needs media recovery
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 are present and which need media recovery are listed, but no error
message is displayed .
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 16 - 4
Changing Instance Status
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
halInstanceli Status
Changing
b
o d h starting the instance, the default start mode is OPEN. You may choose to start the
When
sub instance in some other mode, or problems with the database may force you to start the
instance in another mode. The Advanced Startup Options properties page enables you to
select a state other than OPEN when starting the instance and to alter the state if the
instance has already started in another mode. You may also use SQL commands to modify
an instance’s status:
SQL> STARTUP NOMOUNT
ORACLE instance started.
( s ub ense
Keepingaale
h Database lic Open
h b an instance is open, media failure that causes the loss of a control file, loss of an
After
b d
o entire redo log group, or loss of a data file belonging to the SYSTEM or UNDO tablespaces
s u
causes the instance to fail.
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 failures must be done with the
database down, and so the administrator must use the SHUTDOWN ABORT command
before beginning recovery efforts.
The loss of data files belonging to other tablespaces does not cause instance failure, and
the database can be recovered while open, with work continuing in other tablespaces.
These errors can be detected by inspecting the alert log file.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 16 - 6
Loss of a Control File
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 16 - 7
Loss of a Redo Log File
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 16 - 8
Loss of a Redo Log File (continued)
4. If the group has already been archived, or if you are in NOARCHIVELOG mode, you
may choose to solve the problem by clearing the log group to re-create the missing
file or files. Select the appropriate group and select the Clear Logfile action. You can
also clear the affected group manually with the following command:
SQL> ALTER DATABASE CLEAR LOGFILE GROUP #;
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 immediately take a full backup of the whole database. Failure to do so may
result in a loss of data if another failure occurs. To clear an unarchived log group, use the
following command:
SQL> ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP #;
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 16 - 9
Loss of a Data File in NOARCHIVELOG Mode
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 16 - 10
Loss of a Noncritical Data File
in ARCHIVELOG Mode
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St Users
e
al e th i
b h
d t o u©s2008, Oracle. All rights reserved.
h. Copyright
o
ub ense
( s
Loss of a
h
e lic Data File in ARCHIVELOG Mode
a lNoncritical
h bthe database in ARCHIVELOG mode, the loss of any data file not belonging to the
With
d
subo SYSTEM or UNDO tablespaces only affects objects that are in the missing file. The rest of
the database remains available for users to continue work. To restore and recover the
missing data file, perform the following steps:
1. Click Perform Recovery on the Maintenance properties page.
2. Select “Datafiles” as the recovery type, and select “Restore to current time.”
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 is missing) to a new location.
5. Submit the RMAN job to restore and recover the missing files.
Because the database is in ARCHIVELOG mode, recovery up to the time of the last
commit is possible and users are not required to reenter any data.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 16 - 11
Loss of a System-Critical Data File
in ARCHIVELOG Mode
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 16 - 12
Summary
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 16 - 13
Practice Overview:
Performing Database Recovery
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 16 - 14
Performing Flashback
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal li
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Objectives
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 2
Flashback Technology: Benefits > Overview
Database
Table
Drop
Query
Versions
• The Flashback technology is a revolutionary Transaction
advance in recovery.
• Traditional recovery techniques are slow.
– The entire database or a file (not just the incorrect
data) has to be restored.
– Every change in the database log must be r a ble
examined. n s fe
a - tr
• Flashback is fast. no n
– Changes are indexed by row and by h s
transaction.
a
) a
om de.
– Only the changed data is restored.
.c Gui
• Flashback commands areloeasy.nt g i c
re procedures e
– No complex multiple-step i w Stud
a are involved.
@ s
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
Flashback li
hal Technology: Benefits
b
h Oracle Database 10g architecture leverages the unique technological advances in the
The
o d
sub area of database recovery from the loss of data due to human errors. The Flashback
technology provides a set of new features to view and rewind data back and forth in time.
The Flashback technology revolutionizes recovery by simply operating on the changed
data. The time it takes to recover from the error is equal to the amount of time it takes to
make the error. When applicable, the Flashback technology provides significant benefits
over media recovery in terms of ease of use, availability, and restoration time.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 3
When to Use the Flashback Technology
( s ub ense
When toaUse
h lic
le the Flashback Technology
b
h Flashback technology must be used when a logical corruption occurs in the Oracle
The
o d
sub database, and you need to recover data quickly and easily. As with human errors, it is
difficult to identify the objects and rows that are affected by an erroneous transaction.
With the Flashback technology, you can diagnose how errors are introduced into the
database, and then you can repair the damage. You can view the transactions that have
contributed to specific row modifications, view the entire set of versions of a given row
during some time period, or just view data as it appeared at a specific time in the past. The
table in the slide shows typical uses of the Flashback technology.
Flashback Database uses the flashback logs to perform flashback. Flashback Drop uses the
recycle bin. All others use undo data.
Not all flashback features modify the database. Some are simply methods to query other
versions of data. Those are tools for you to use to investigate a problem and aid in
recovery. The results of those flashback queries can help you perform one of these two
things:
• Determine which type of database-modifying flashback operation to perform to fix
the problem
• Feed the result set of these queries into an INSERT, UPDATE, or DELETE statement
that enables you to easily repair the erroneous data.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 4
Flashing Back Any Error
( s ub ense
le AnylicError
FlashingaBack
h
h b Database 10g introduces expanded database flashback capabilities. If a major error
Oracle
b d
o occurs that makes unisolated changes, such as a batch job being run twice in succession,
s u
then you can request a flashback operation that quickly recovers the entire database to a
previous point in time. This eliminates the need to restore backups and perform a
point-in-time recovery. In addition to flashback operations at the database level, it is also
possible to flash back a single table or recover a table dropped in error.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 5
Flashback Database: Overview Overview
> Database
Table
Drop
Query
Versions
The Flashback Database operation: Transaction
• Works like a rewind button for the database
• Can be used in cases of logical data corruptions
made by users
a ble
fe r
a ns
n- t r
a no
Users The You "press the has The
generate database is rewind button." ) .
m idedatabase is
c o
errors. corrupted.
g i c. t Gu “rewound.”
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
li Overview
hal Database:
Flashback
b
h Flashback Database, you can quickly bring your database to an earlier point in time
With
o d
sub by undoing all the changes that have taken place since that time. This operation is fast
because you do not need to restore backups. You can use this feature to undo changes that
have resulted in logical data corruptions.
If you have experienced a loss of media or physical corruption in your database, then you
must use traditional recovery methods.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 6
Flashback Database:
Reducing Restore Time
Apply logs
Backup User error forward a ble
fe r
a ns
Flashback Database User Repaired n- t r
error database a no
Flashback logs
h a s
m ) e.
o
g i c.c t Guid
Backup
Apply
a r eloFlashback d e n
iw logs S tu
backward
@ s
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
li Reducing Restore Time
hal Database:
Flashback
h b
Flashback Database is faster than the traditional point-in-time recovery that uses restored
o d
sub files and redo log files. As a database grows in size, the length of time required to restore
all the data files to perform a traditional point-in-time recovery becomes prohibitive. With
Flashback Database, the time to recover a database is now proportional to the number of
changes that need to be backed out (and not to the size of the database) because you do not
have to restore data files.
Flashback Database is implemented by using a type of log file called Flashback Database
logs. The Oracle database periodically logs “before images” of data blocks in the
Flashback Database logs. Block images can be reused to quickly back out the data file
changes to any time at which flashback logs are captured just before the desired target
time. Then, changes from the redo log files are applied to fill in the gap. The Flashback
Database logs are automatically created and managed in the flash recovery area.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 7
Flashback Database: Considerations
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 8
Flashback Database: Limitations
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 9
Enabling Flashback Database
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
h l
EnablingaFlashback li Database
h b
Flashback Database can be enabled in Enterprise Manager, using the Recovery Settings
o d
sub link on the Maintenance tabbed page. Turn on the checkmark in the Flash Recovery region
of the page, and specify the retention time, which is how far back in the past you want to
be able to flash back the database to.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 10
Flashback Table: Overview Overview
Database
> Table
Drop
Query
Versions
• Flashback Table recovers tables to a Transaction
specific point in time.
• Flashback Table is an in-place operation.
• The database stays online.
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
Erroneous a relo uden Flashed back
DMLs @iw s StUser tables
l e h i
. b ha se t
d h Copyright
t o u© 2008, Oracle. All rights reserved.
o
ub ense
( s
Flashback
h a ic
leTable: lOverview
h b Flashback Table, you can recover a set of tables to a specific point in time without
Using
b d
o having to perform traditional point-in-time recovery operations.
s u
A Flashback Table operation is done in-place, while the database is online, by rolling back
only the changes that are made to the given tables and their dependent objects.
A Flashback Table statement is executed as a single transaction. All tables must be flashed
back successfully, or the entire transaction is rolled back.
Note: You can use Flashback Versions Query and Flashback Transaction Query to
determine the appropriate flashback time.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 11
Flashback Table
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 12
Enabling Row Movement on a Table
a ble
fe r
a ns
n- t r
a no
h a s
m )MOVEMENT;
e .
ALTER TABLE employees ENABLE ROW
c o i d
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
EnablingaRow li
h l Movement on a Table
b
h must enable row movement on a table to be able to flash back the table. When you
You
o d
sub enable row movement, the Oracle server can move a row in the table. You can use
Enterprise Manager to enable row movement.
Using Enterprise Manager, you can enable row movement on a table by performing the
following steps:
1. Select Tables in the Schema region on the Administration property page. Enter the
schema name to search for the table, and click Go.
2. Click the table name of the table for which you want to enable row movement. You
are now on the View Table page.
3. Click Edit, which takes you to the Edit Table page.
4. Click the Options tab, where you can change the Enable Row Movement setting for
the table.
5. Set Enable Row Movement to Yes, and click Apply.
The update confirmation message is displayed.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 13
Performing Flashback Table
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
FLASHBACK TABLE hr.employeesc.c o uid
TO TIMESTAMP
g i t G
TO_TIMESTAMP('2005-05-05
r e lo05:32:00', e n
'YYYY-MM-DD HH24:MI:SS'); i wa Stud
a l e@ this
h . bhCopyrightu©s2008,
e
o d t o Oracle. All rights reserved.
( s ub ense
a
Performing
h lic Table
leFlashback
h
You
bcan flash back a table through Enterprise Manager by performing the following steps:
d
subo 1. Select Perform Recovery in the Backup/Recovery region on the Maintenance
property page. The Perform Recovery page appears.
2. In the Object Level Recovery region, select Tables from the Object Type drop-down
list.
3. Select Flashback Existing Tables as the Operation Type. Click Perform Object Level
Recovery. The “Perform Object Level Recovery: Point-in-time” page is displayed.
4. Select “Flashback to a timestamp” or “Flashback to a known SCN” and then specify
a time stamp or SCN to flash back to, and click Next.
5. Click Add Tables to add tables to the list for the flashback operation. Click Next.
6. The Dependency Options page appears if there are dependent tables. Select the
desired option for dealing with dependent tables. Typically, you would choose
“Cascade” to ensure a consistent flashback. Click Next.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 14
Performing Flashback Table (continued)
7. The “Perform Object Level Recovery: Review” page appears. Review the
information and click Submit. The Confirmation page appears.
Note: You can also flash back tables from the Tables link in the Schema region of the
Administration page.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 15
Flashback Table: Considerations
the tables that are specified in the statement over the period of time when the
operation is in progress.
• Statistics of impacted objects are not flashed back.
• All existing indexes are maintained. Dropped indexes are not re-created. Dependent
on-commit materialized views are also maintained automatically.
• A FLASHBACK TABLE statement is written to the alert log file.
• Tables specified in the FLASHBACK TABLE statement are flashed back, provided
that none of the table constraints are violated. If any constraints are violated during
flashback execution, the operation is aborted and the tables are left in the same state
as they were just before the FLASHBACK TABLE statement invocation.
• You cannot perform Flashback Table to a particular time that is older than the time
of the execution of a data definition language (DDL) operation that altered the
structure of or shrunk a table that would be involved in the flashback operation. This
restriction does not apply to DDL statements that only change storage attributes of
the tables.
• Flashback Table cannot be performed on system tables, remote tables, and fixed
tables.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 16
Flashback Drop: Overview Overview
Database
Table
> Drop
Query
Versions
Transaction
Recycle
Bin
a ble
fe r
DROP TABLE employees; FLASHBACK TABLE
a n s
employees
n -t r
TO BEFORE DROP; n o
Mistake was s a
a
) h e.
made. m
i c .co Guid
l o g nt
r e e
i wa Stud
a l e@ this
h . bhCopyrightu©s2008,
e
o d t o Oracle. All rights reserved.
( s ub ense
Flashback
h a lic
leDrop: Overview
h bthe Flashback Drop feature, you can undo the effects of a DROP TABLE statement
With
b d
o without resorting to the traditional point-in-time recovery. This is made possible because
s u
of the recycle bin, which can be queried via the DBA_RECYCLEBIN view.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 17
Flashing Back Dropped Tables
Through Enterprise Manager
a ble
fe r
a ns
n- t r
a no
h a s
Dependent bitmap index m ) e.
o
will also be flashed back.
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
h l Dropped
FlashingaBack li Tables Through Enterprise Manager
b
h flash back dropped tables with the Database Control Console, select Perform Recovery
To
o d
sub in the Backup/Recovery region of the Maintenance page. Select Tables for the Object
Type in the Type region, and choose Flashback Dropped Tables in the Operation Type
region. After this is done, click Perform Object Level Recovery.
You should now see the “Perform Object Level Recovery: Dropped Objects Selection”
page, where you can select dropped tables from the recycle bin. You can also query the
content of dropped tables by clicking View Content. Select the tables that you want to
recover, and click Next.
The “Perform Object Level Recovery: Rename” page appears, where you can rename the
table if a table with the same name currently exists in the same schema. Click Next to
continue. On the “Perform Object Level Recovery: Review” page, you can review the
details of your operation as well as display the corresponding SQL statements. After you
are ready, click Submit. You should now see the Confirmation page. Click OK to go back
to the Maintenance page.
Note: You can also flash back dropped tables from the Tables link of the Schema region of
the Administration page. On the Tables page, click the Recycle Bin button.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 18
Flashback Drop: Considerations
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 19
Flashback Time Navigation Overview
Database
Table
Drop
> Query
Versions
• Flashback Query Transaction
– Query all data at a specified point in time.
• Flashback Versions Query
– See all versions of a row between two times.
– See the transactions that changed the row.
• Flashback Transaction Query a ble
fe r
– See all changes made a ns
by a transaction.
Time
n- t r
a no
h a s
Tx3 m ) e.
o
Tx2 g i c.c t Guid
a reloTx1uden Flashback
iw s S t
@
h a l e
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
li
hal Time Navigation
Flashback
b
h Flashback technology offers the capability to query past versions of schema objects,
The
o d
sub query historical data, and perform change analysis. Every transaction logically generates a
new version of the database. With the Flashback technology, you can navigate through
these versions to find an error and its cause:
• Flashback Query: Query all data as it existed at a specific point in time.
• Flashback Versions Query: See all versions of rows between two times and the
transactions that changed the row.
• Flashback Transaction Query: See all changes made by a transaction.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 20
Flashback Query: Overview
a ble
fe r
ns
t1 t2 -tra
n on
a s
SELECT employee_id, salary FROM employees h a
) e.
o m
AS OF TIMESTAMP t1
g i c.c t Guid
WHERE employee_id = 200
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal Query:liOverview
Flashback
b
o d h the Flashback Query feature, you can perform queries on the database as of a certain
With
sub time. By using the AS OF clause of the SELECT statement, you can specify the time stamp
for which to view the data. This is useful for analyzing a data discrepancy.
Note: The AS OF clause can be followed by either TIMESTAMP or SCN.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 21
Flashback Query: Example
a ble
11:00 11:10 fe r
a ns
UPDATE employees SET salary = n- t r
(SELECT salary FROM employees a no
AS OF TIMESTAMP TO_TIMESTAMP h a s
m ) hh24:mi:ss')
e .
c o
('2005-05-04 11:00:00', 'yyyy-mm-dd
i d
WHERE employee_id = 200) ic. G u
WHERE employee_id = 200 relo
g t
en
i wa Stud
a l e@ this
h . bhCopyrightu©s2008,
e
o d t o Oracle. All rights reserved.
( s ub ense
Flashback a c
leQuery:liExample
b h
dIfha raise has been erroneously given to a particular employee recently, you can update the
ub o salary again, assigning the salary provided by a subquery that returns the flashed back
s value.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 22
Flashback Versions Query: Overview
Database
Overview Table
Drop
Query
Tx0 Tx1 Tx2 > Versions
Transaction
Employees Employees Employees
200
a ble
t1 t2 fe r
a ns
SELECT versions_xid, salary FROM employees
n- t r
o
VERSIONS BETWEEN TIMESTAMP t1 and t2
an
WHERE employee_id = 200; has ) e.
o m
g i c.c t Guid
Tx0 Tx1 elo n Tx2
a r d e
@ iw s Stu
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal Versions
Flashback li Query: Overview
b
h the Flashback Query feature, you can perform queries on the database as of a certain
With
o d
sub time span or range of user-specified system change numbers (SCNs). The Flashback
Versions Query feature enables you to use the VERSIONS clause to retrieve all the
versions of the rows that exist between two points in time or two SCNs.
The rows returned by Flashback Versions Query represent a history of changes for the
rows across transactions. Flashback Versions Query retrieves only committed occurrences
of the rows. Uncommitted row versions within a transaction are not shown. The rows
returned also include deleted and subsequently reinserted versions of the rows.
You can use Flashback Versions Query to retrieve row history. It provides you with a way
to audit the rows of a table and retrieve information about the transactions that affected the
rows. You can then use the returned transaction identifier either to perform transaction
mining by using LogMiner or to perform a Flashback Transaction Query, which is covered
later in this lesson.
Note: In the example, VERSIONS_XID is a pseudocolumn that returns the transaction
identifier of the corresponding version of a row.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 23
Flashback Versions Query Through
Enterprise Manager
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
li Query Through Enterprise Manager
hal Versions
Flashback
h b
Flashback Versions Query can also be performed through Enterprise Manager. On the
o d
sub Maintenance page, select Perform Recovery.
On the Perform Recovery page, select Tables for the Object Type and select Flashback
Existing Tables for the Operation Type. Click Perform Object Level Recovery. On the
“Perform Object Level Recovery: Point-in-Time” page, select “Evaluate row changes and
transactions to decide on a point in time,” and specify the name of the target table.
Select the columns that you want to view in the Available Columns box, and then enter a
search clause in the Bind The Row Value box. Select “Show all row history,” and then
click Next.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 24
Flashback Versions Query: Considerations
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 25
Flashback Transaction Query: Overview
Database
Overview Table
Drop
Query
FLASHBACK_TRANSACTION_QUERY Versions
> Transaction
DBA
a ble
fe r
Erroneous
Undo a ns
DML
n- t r
SQL
a no
h a s
m ) e.
o
g i c.c t Guid
a r elo den
User iw
S tu
@ s
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
li Query: Overview
hal Transaction
Flashback
h b
Flashback Transaction Query is a diagnostic tool that you can use to view changes made to
o d
sub the database at the transaction level. This enables you to diagnose problems in your
database and perform analysis and audits of transactions.
You can use the FLASHBACK_TRANSACTION_QUERY view to determine all the
necessary SQL statements that can be used to undo the changes made either by a specific
transaction or during a specific period of time.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 26
Flashback Transaction Query Through
Enterprise Manager
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
li Query Through Enterprise Manager
hal Transaction
Flashback
b
h feature is used in conjunction with the Flashback Versions Query feature with the
This
o d
sub help of the Perform Recovery Wizard. On the “Perform Object Level Recovery: Choose
SCN” page, click the corresponding Transaction ID link in the Flashback Versions Query
Result region.
In the example in the slide, a Flashback Versions Query is performed on the JOBS table to
retrieve the three versions of the JOBS row for JOB_ID = 'AD_PRES'. Then, one of the
transaction IDs is clicked, showing all the changes that were part of that transaction.
Notice that, besides the JOBS table update, there was also an update to the EMPLOYEES
table in that transaction.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 27
Flashback Transaction Query:
Considerations
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
li Query: Considerations
hal Transaction
Flashback
b
h• Within the database, DDL operations are nothing but a series of space management
o d
sub operations and changes to the data dictionary. Flashback Transaction Query on a
transaction underlying a DDL displays the changes made to the data dictionary.
• When Flashback Transaction Query involves tables that have been dropped from the
database, the table names are not reflected. Instead, object numbers are used.
• If the user who executed a transaction is dropped, Flashback Transaction Query of
that transaction displays the corresponding user ID only, and not the username.
Note: When there is not enough undo data for a specific transaction, a row with a value of
UNKNOWN in the OPERATION column of FLASHBACK_TRANSACTION_QUERY is
returned.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 28
Summary
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 29
Practice Overview:
Using Flashback
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal li
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 17 - 30
Moving Data
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal li
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Objectives Directory Obj.
SQL*Loader
Data Pump
- Export
- Import
External Table
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 2
Moving Data:
General Architecture
Data Pump
DBMS_DATAPUMP a ble
fe r
Data/Metadata Movement Engine
a ns
n- t r
a no
h a s
Oracle Oracle m ) e.
c o id
loader DataPump Direct Path
g i c.API G uMetadata API
r e lo ent
External Table API
i wa Stud
a l e@ this
h . bhCopyrightu©s2008,
e
o d t o Oracle. All rights reserved.
( s ub ense
Moving Data:
h a le Generallic Architecture
h
This bis a block diagram of the major functional components:
b d
o • DBMS_DATAPUMP: This package embodies the API for high-speed export and import
s u
utilities for bulk data and metadata movement.
• Direct Path API (DPAPI): Oracle Database 10g supports a direct path API interface that
minimizes data conversion and parsing at both unload and load time.
• DBMS_METADATA: This package is used by worker processes for all metadata unloading
and loading. Database object definitions are stored using XML rather than SQL.
• External Table API: With the ORACLE_DATAPUMP and ORACLE_LOADER access
drivers, you can store data in external tables (that is, in platform-independent files). The
SELECT statement reads external tables as though they were stored in an Oracle database.
• SQL*Loader: The SQL*Loader client has been integrated with external tables, thereby
providing automatic migration of loader control files to external table access parameters.
• expdp and impdp: The expdp and impdp clients are thin layers that make calls to the
DBMS_DATAPUMP package to initiate and monitor Data Pump operations.
• Other clients: They are applications, such as Database Control, replication, transportable
tablespaces, and user applications, that benefit from this infrastructure. SQL*Plus may also
be used as a client of DBMS_DATAPUMP for simple status queries against ongoing
operations.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 3
Directory Object: Overview .
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
h l
DirectoryaObject: li
Overview
h b
Directory objects are logical structures that represent a physical directory on the server’s file
o d
sub system. They contain the location of a specific operating system directory. This directory object
name can be used in Enterprise Manager, so you do not need to hard-code directory path
specifications. Therefore, you get greater file management flexibility. Directory objects are
owned by the SYS user. Directory names are unique across the database because all the
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 accesses
files on the server rather than on the client.
In Enterprise Manager, select Administration > Directory Objects.
To edit or delete a directory object, select the directory object and click the appropriate button.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 4
Creating Directory Objects
3 le
5 r a b
ns fe
t r a
n-
no
s a
h a
) e.
o m
4
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
Creating a l
hDirectory li
Objects
b
1.hOn the Directory Objects page, click the Create button.
o d
sub 2. Enter the name of the directory object and the OS path to which it maps. OS directories
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 privileges
on this OS directory).
3. Permissions for the directory objects are not the same as the OS permissions on the physical
directory on the server file system. You can manage user privileges on individual directory
objects. This increases the level of security and gives you granular control over these objects.
On the Privileges tabbed page, click Add to select the user to which you give read or write
privileges or both.
4. Click Show SQL to view the underlying statements.
5. Click OK to create the object.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 5
SQL*Loader: Overview Directory Obj.
> SQL*Loader
Data Pump
- Export
- Import
External Table
Input data files Control file
SQL*Loader Rejected
Field processing
Discarded Accepted
Record selection le
r a b
Selected
ns fe
Bad
- t r a
Oracle server
n onfile
Discard file
(optional)
Inserted sa
Rejected
ha
)
m ide.
c o
Log file g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal Overview
SQL*Loader: li
h b
SQL*Loader loads data from external files into tables of an Oracle database. It has a powerful
o d
sub data parsing engine that puts little limitation on the format of the data in the data file. The files
that are used by SQL*Loader are as follows:
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
data in the data file is organized as records. A particular data file can be in fixed record format,
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.
Control file: The control file is a text file that is written in a language that SQL*Loader
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
file can be said to have three sections.
• The first section contains sessionwide information, for example:
- Global options, such as the input data file name, and records to be skipped.
- INFILE clauses to specify where the input data is located
- Data to be loaded
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 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, then the
row is inserted into the table. If the row is determined to be invalid, then the record is rejected
and SQL*Loader puts it in the bad file. r a ble
n s fe
-tofrathe load
Discard file: This file is created only when it is needed, and only if you have specified that a
n
discard file should be enabled. The discard file contains records that are filteredoout
a n file.
because they do not match any record-selection criteria specified in the control
s
For more information about SQL*Loader, refer to the Oracle Database ) ha Utilities documentation.
.
. c om uide
l o gic nt G
a re ude
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 7
Loading Data with SQL*Loader
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
li
hal with SQL*Loader
Loading Data
b
h the Load Data from User Files Wizard to load data from a flat file into an Oracle database.
Use
o d
sub To display the wizard, select Enterprise Manager Maintenance > Data Movement > Move Row
Data > Load Data from User Files. The wizard guides you through the required steps.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 8
SQL*Loader Control File
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 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
a ble
TERMINATED BY WHITESPACE, NULLIF mgr=BLANKS,
fe r
ename POSITION(34:41) CHAR
a ns
TERMINATED BY WHITESPACE "UPPER(:ename)",
n- t r
empno POSITION(45) INTEGER EXTERNAL
TERMINATED BY WHITESPACE, a no
sal POSITION(51) CHAR TERMINATED BY WHITESPACE
h a s
"TO_NUMBER(:sal,’$99,999.99’)",
m ) e.
o
":comm * 100" g i c.c t Guid
comm INTEGER EXTERNAL ENCLOSED BY ’(’ AND ’%’
)
a relo uden
The explanation of a sample control file by S t is as follows:
iwlinesnumbers
1. Comments can appear anywhere
@ i
le in thethcommand section of the file, but they must not
b h a e
appear within the data.
h . Precedeuanys comment with two hyphens. All text to the right of the
o d
double hyphenbis ignored, t o
s u n s e until the end of the line.
2. The LOAD
l e ( ice
DATA statement indicates to SQL*Loader that this is the beginning of a new
l
haload. If you are continuing a load that has been interrupted in progress, use the
data
b
h CONTINUE LOAD DATA statement.
o d
sub 3. The INFILE keyword specifies the name of a data file containing data that you want to
load.
4. The BADFILE keyword specifies the name of a file into which rejected records are placed.
5. The DISCARDFILE keyword specifies the name of a file into which discarded records are
placed.
6. The APPEND keyword is one of the options that you can use when loading data into a table
that is not empty. To load data into a table that is empty, use the INSERT keyword.
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.
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 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.
9. The TRAILING NULLCOLS clause prompts SQL*Loader to treat any relatively positioned
columns that are not present in the record as null columns.
10. The remainder of the control file contains the field list, which provides information about
column formats in the table that is being loaded.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 10
Loading Methods
Data Block
insert writes
Table
HWM
Conventional Load Direct Path Load
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 11
Comparing Direct and Conventional Path Loads (continued)
Logging Changes
Conventional path loading generates redo entries 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.
r a ble
• FOREIGN KEY and CHECK constraints are disabled, and they can be enabled at the end
n s feof
the load by using the appropriate commands in the control file. The FOREIGNtKEY
n - ra
constraints are disabled because they reference other rows or tables, and the o CHECK
nsmall
constraints are disabled because they may use SQL functions. If only s a a number of
rows are to be inserted into a large table, then use conventional
) a
h loads.
PRIMARY KEY and UNIQUE constraints are checkedcduring o m and d e
at .the end of the load, and
•
they may be disabled if they are violated. i c. t Gu i
g
Firing the INSERT Triggers a relo uden
The WHILE INSERT triggers are fired @ iw s St
during iconventional loads; they are disabled before a
direct path load and reenabled h a l e
at the end e t h
of the load. They may remain disabled if a referenced
at h
object is not accessible d .bend
the of u srun.
the Consider using conventional path loads to load data
o t o
ubINSERTstriggers.
into tables with the
(s en
e
Loadinga
h into lic Tables
le Clustered
h bLoads cannot be used to load rows into clustered tables. Clustered tables can be loaded
Direct
b d
o with conventional path loads only.
s u
Locking
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 sessions are
used concurrently.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 12
Data Pump: Overview Directory Obj.
SQL*Loader
> Data Pump
- Export
- Import
External Table
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 13
Data Pump: Benefits
Source Target
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 15
Data Pump Utility: Interfaces and Modes
( s ub ense
Data Pump
h a lic
leUtility: Interfaces and Modes
b
h can interact with Data Pump Export and Import by using one of the following interfaces:
You
o d
sub • The command-line interface enables you to specify most of the export parameters directly
on the command line.
• The parameter file interface enables you to specify all command-line parameters in a
parameter file. The only exception is the PARFILE parameter.
• The 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 pressing
[Ctrl] + [C] during an export operation that is started with the command-line interface or
the parameter file interface. Interactive-command mode is also enabled when you attach to
an executing or stopped job.
• You can also access the Web interface. On the Database Control home page, click the
Maintenance tab, and then select one of the following links from the Utilities region:
Export to Files, Import from Files, or Import from Database.
Data Pump Export and Import provide different modes for unloading and loading different
portions of the database. The mode is specified on the command line by using the appropriate
parameter.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 16
Fine-Grained Object Selection Directory Obj.
SQL*Loader
.
Data Pump
> - Export
- Import
External Table
a ble
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal Objectli Selection
Fine-Grained
b
o d h Data Pump job can include or exclude virtually any type of object.
The
sub The EXCLUDE parameter enables any database object type to be excluded from an export or
import operation. The optional name qualifier enables you to have finer selectivity within each
object type that is specified. Examples:
EXCLUDE=VIEW
EXCLUDE=PACKAGE
EXCLUDE=INDEX:"LIKE 'EMP%'"
The INCLUDE parameter includes only the specified object types and objects in an operation.
Syntax:
INCLUDE = object_type[:"name_expr"]
The CONTENT parameter enables you to request for the current operation, only the metadata,
only the data, or both. Syntax:
CONTENT = ALL | METADATA_ONLY | DATA_ONLY
The QUERY parameter operates in a similar manner as the original export utility, with two
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. Example:
QUERY=hr.employees:"WHERE department_id in (10,20) and salary
< 1600 ORDER BY department_id"
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 17
Advanced Feature: Sampling
( s ub ense
le
AdvancedaFeature:
h ic
lSampling
h
Withbthe SAMPLE parameter, you can specify a percentage of data to be sampled and unloaded
d
subo from the source database when performing a Data Pump export.
Syntax:
SAMPLE=[[schema_name.]table_name:]sample_percent
Range for sample_percent: .000001 to (but not including) 100
Sample percentage indicates the likelihood that a block of rows will be included.
Note: The SAMPLE parameter is not valid for network exports.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 18
Export Options: Files
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal
Export Options: li
Files
b
h are three types of files that are managed by Data Pump jobs:
There
o d
sub • Dump files for data and metadata that is to be moved
• Log files for messages
• SQL files for the output of a SQLFILE operation
Because Data Pump is server based and not client based, Data Pump files are accessed relative to
Oracle directory paths. Absolute paths are not supported for security reasons.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 19
Data Pump File Locations
a ble
fe r
a ns
n- t r
The order of precedence of file locations: a no
• Per-file directory h a s
m ) e.
o
• The DIRECTORY parameter
g i c.c t Guid
relo uden variable
• The DATA_PUMP_DIR environment
a
• DATA_PUMP_DIR@ directory t
iw Sobject
a l e t h is
h . bhCopyrightu©s2008,
e
o d t o Oracle. All rights reserved.
( s ub ense
Data Pump
h a lic
leFile Locations
h
The b shows you the order of precedence used by Data Pump clients to locate these files:
slide
d
subo • Per-file directory objects may be specified for each dump file, log file, and SQL file. If
specified, they are separated from the file name by a colon (:).
• The Data Pump Export and Import clients provide a DIRECTORY parameter, which
specifies the name of a directory object. These directory objects describe the location in
which the files are accessed.
• You can alternatively define an environment variable, DATA_PUMP_DIR, to specify the
directory object name rather than use the DIRECTORY parameter. The Data Pump clients
look for this environment variable if no explicit directory object is specified.
• There is a default directory object created for every database. This directory object is
named DATA_PUMP_DIR. Access to the DATA_PUMP_DIR directory is granted
automatically to the EXP_FULL_DATABASE and IMP_FULL_DATABASE roles.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 20
Data Pump File Locations (continued)
• You do not need to create a directory object manually before using Data Pump Export.
There is a default directory object created for every database, whether newly created or
upgraded by a script on UNIX or Windows platforms. This directory object is named
DATA_PUMP_DIR. 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/ORACLE_SID
- <ORACLE_HOME>/admin/ORACLE_SID
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, then that value is used. Otherwise, the value of ORACLE_HOME is used. If,
for some reason, the DATA_PUMP_DIR subdirectory is not found, the following default
r a ble
path is used: ORACLE_HOME/rdbms/log. sfe
n
tra for the
Note: In all cases, you must have the appropriate access privileges to the directory -object
n
noyou need read
operation attempted. For export, you need write access for all files; for import,
a
access for dump files and write access for log files and SQL files. as
m ) h e.
i c .co Guid
l o g nt
r e e
i wa Stud
a l e@ this
h . bh use
b o d to
su cens e
e (
hal li
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 21
Scheduling and Running a Job
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
Scheduling li
hal and Running a Job
b
h Pump jobs (created through this wizard) are scheduled as repeatable jobs by Enterprise
Data
o d
sub Manager Database Control.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 22
Data Pump File Naming and Size
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
Data Pump
hal File Namingli and Size
b
h DUMPFILE parameter specifies the names and (optionally) directories of disk-based dump
The
o d
sub files. Multiple file specifications may be provided as a comma-separated list or in 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 resulting file names
into a two-character, fixed-width, monotonically increasing integer starting at 01. If no
DUMPFILE is specified, expdat.dmp is used by default. By default, created dump files are
autoextensible.
If FILESIZE is specified, each file is FILESIZE bytes in size and nonextensible. If more
dump space is required and a template with %U has been supplied, then a new file is
automatically created with FILESIZE bytes; otherwise, the client receives a message to add a
new file.
If a template with %U is specified, the number of files initially created is equal to the PARALLEL
parameter.
Preexisting files that match the resulting file names are not overwritten; they result in an error
and cause the job to be aborted.
Note: If multiple dump file templates are provided, then they are used to generate dump files in a
circular fashion.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 23
Data Pump Import Directory Obj.
SQL*Loader
Data Pump
- Export
> - Import
External Table
a ble
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
Data Pump
b hal Import li
o d h Pump Import is a utility for loading an export dump file set into a target system. The dump
Data
sub file set is made up of one or more disk files that contain table data, database object metadata, and
control information. The files are written in a proprietary, binary format. During an import
operation, the Data Pump Import utility uses these files to locate each database object in the
dump file set.
You can interact with Data Pump Import by using a command line, a parameter file, or an
interactive-command mode:
• You can use the impdp command and specify parameters directly on the command line.
• You can enter command-line parameters in a file (the PARFILE parameter is excluded
because parameter files cannot be nested).
• 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
additional jobs to an executing or stopped job.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 24
Data Pump Import: Transformations
a ble
REMAP_DATAFILE = 'C:\oradata\tbs6.f':'/u1/tbs6.f'
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
i
hal Import: lTransformations
Data Pump
b
h object metadata is stored as XML in the dump file set, it is easy to apply
Because
o d
sub transformations when DDL is being formed during import. Data Pump Import supports several
transformations:
• REMAP_DATAFILE is useful when moving databases across platforms that have different
file-system semantics.
• REMAP_TABLESPACE allows objects to be moved from one tablespace to another.
• REMAP_SCHEMA provides the old FROMUSER /TOUSER capability to change object
ownership.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 25
Data Pump Import: Transformations
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 26
Data Pump: Performance Consideration
Parallel
execution
a ble
fe r
Generated
a ns
files
n- t r
a no
Example: s
h a
) e.
expdp hr/hr FULL=y
o m
DUMPFILE=dp_dir1:full1%U.dmp, idp_dir2:full2%U.dmp
g c.c t Guid
FILESIZE=2G PARALLEL=3
a relo uden
LOGFILE=dp_dir1:expfull.log t
iw s SJOB_NAME=expfull
@
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
Data Pump: li
hal Performance Consideration
b
h can improve throughput of a job with the PARALLEL parameter. The parallelism setting is
You
o d
sub enforced by the master process, which allocates work to be executed to worker processes that
perform the data and metadata processing within an operation. These worker processes operate
in parallel. In general, the degree of parallelism should be set to more than twice the number of
CPUs on an instance. To maximize parallelism, you must supply at least one file for each degree
of parallelism. If there are not enough dump files, the performance will not be optimal because
multiple threads of execution will be trying to access the same dump file. The degree of
parallelism can be reset at any time during a job.
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) 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. Each file will
be up to 2 gigabytes in size, as necessary. Initially, up to three files will be created. More files
will be created, if needed. The job and master table have the same name: expfull. The log file
will be written to expfull.log in the dp_dir1 directory.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 27
Performance Initialization Parameters
( s ub ense
Performance
h a lic Parameters
le Initialization
h
You bcan try using the parameters (shown in the slide) to improve performance, although the
b d
o effect may not be the same on all platforms.
s u
Additionally, the SHARED_POOL_SIZE and UNDO_TABLESPACE initialization parameters
should be generously sized. The exact values will depend upon the size of your database.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 28
Data Pump Access Path: Considerations
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 29
Using Enterprise Manager to Monitor
Data Pump Jobs
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal
Using Enterprise li
Manager to Monitor Data Pump Jobs
b
h can use the Enterprise Manager graphical user interface (GUI) to monitor all Data Pump
You
o d
sub jobs, including those created by using the expdp or impdp command-line interfaces or by
using the DBMS_DATAPUMP package.
You can view the current status of the job and also change the status to EXECUTE, STOP, or
SUSPEND.
To access the Export and Import Jobs page, click the Monitor Export and Import Jobs link in the
Move Row Data region of the Maintenance page.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 30
External Table Population . Directory Obj.
SQL*Loader
Data Pump
- Export
- Import
> External Table
a ble
Unloading Loading
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
External filesrelo e n
Tables
a
w Stu
(proprietaryiformat)
d
Tables
e @ i s
b h al e th
d t o u©s2008, Oracle. All rights reserved.
h. Copyright
o
ub ense
( s
a
External Table
h lic
le Population
b
Anh“external table” is composed of proprietary format (that is, Direct Path API) flat files that are
o d
sub operating system independent. As data is extracted from the Oracle database and “unloaded” into
files, it is transparently converted from its Oracle internal representation into an equivalent
Oracle native external representation (that is, DPAPI).
You may use the CREATE TABLE AS SELECT command to populate an external table. After 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.
The Data Pump access driver enables the unloading and loading operations for external tables.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 31
Using External Tables
( s ub ense
a le Tables
Using External
h lic
h
The b files created for the external table can be moved and used as the data files for another
data
d
subo external table in the same database or different database. They can be read only by the
ORACLE_DATAPUMP access driver. You can choose whether your applications should directly
access external tables with the SELECT command, or if the data should first be loaded into a
target database.
Data files 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 sources. The
only restriction is that the metadata for all the external tables must be exactly the same.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 32
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')
a b le
) fe r
n s
PARALLEL
n - tra
no
AS
a
SELECT e.first_name,e.last_name,d.department_name
s
FROM employees e, departments d h a
) eAND
o m
WHERE e.department_id = d.department_id
d .
d.department_name in gic.
c u i
t G
relo en 'Purchasing');
('Marketing',
i wa Stud
a l e@ this
h . bhCopyrightu©s2008,
e
o d t o Oracle. All rights reserved.
( s ub ense
External Table
h a lic with ORACLE_DATAPUMP
le Population
h
This bexample shows you how the new external table population operation can help to export a
b d
o selective set of records resulting from the join of the EMPLOYEES and DEPARTMENTS tables.
s u
Because the external table can be large, you can use a parallel populate operation to unload 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 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.
The number of files in the LOCATION clause must match the specified degree of parallelism
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
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
Oracle Database Utilities guide.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 33
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
a ble
( records delimited by newline fe r
a ns
badfile extab_bad_dir:'empxt%a_%p.bad'
n- t r
logfile extab_log_dir:'empxt%a_%p.log'
a no
fields terminated by ','
h a s
missing field values are null
m ) e.
o
c.c t Guid
( employee_id, first_name, last_name,
g i
hire_date char date_format date mask "dd-mon-yyyy“))
relo uden
LOCATION ('empxt1.dat', 'empxt2.dat') )
a
iw s St
PARALLEL REJECT LIMIT UNLIMITED;
@
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
External Table li
hal Population with ORACLE_LOADER
b
h ORACLE_LOADER access driver uses the SQL*Loader syntax to create external tables.
The
o d
sub The example shown in the slide assumes that three directory objects (extab_dat_dir,
extab_bad_dir, and extab_log_dir) are created and mapped to existing OS directories, to
which the user is granted access.
Tip: If you have a lot of data to load, enable PARALLEL for the load operation:
ALTER SESSION ENABLE PARALLEL DML;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 34
Data Dictionary
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal
Data Dictionary li
b
h ALL| USER]_EXTERNAL_TABLES list the specific attributes of external tables in
o d
[DBA|
sub the database.
[DBA| ALL| USER]_EXTERNAL_LOCATIONS list the data sources for external tables.
[DBA| ALL| USER]_TABLES describe relational tables in the database.
[DBA| ALL| USER]_TAB_COLUMNS describe the columns of tables, views, and clusters in
the database.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 35
Summary
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 36
Practice Overview:
Moving Data
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I 18 - 37
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
________________
Appendix A
Practices
________________
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Practice Sessions: Overview
The HR schema:
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
Data Definition Language h a
(DDL) e thi
le Scripts
h
DDL scripts can be used to b theuinitial
.create s HR schema.
o d t o
( s ub ense
a le
TablehDefinitions lic ,STATE_PROVINCE VARCHAR2(25)
h b ,COUNTRY_ID CHAR(2)
b
ALTER TABLE REGIONS
u o se t /
(COUNTRY_ID))
( s
ADD (CONSTRAINT
e n
a le lic PRIMARY KEY
PK__REGIONS__76CBA758
h
/h
b
(REGION_ID)) PROMPT Creating Unique Key on
b o d 'EMPLOYEES'
su PROMPT Creating Primary Key on 'JOBS' ALTER TABLE EMPLOYEES
ADD (CONSTRAINT
ALTER TABLE JOBS UQ__EMPLOYEES__0519C6AF UNIQUE
ADD (CONSTRAINT PK__JOBS__023D5A04 (EMAIL))
PRIMARY KEY /
(JOB_ID))
/
PROMPT Creating Check Constraint on
PROMPT Creating Primary Key on 'JOB_HISTORY'
'LOCATIONS' ALTER TABLE JOB_HISTORY
ALTER TABLE LOCATIONS ADD (CONSTRAINT
CK__JOB_HISTORY__0EA330E9 CHECK
(END_DATE > START_DATE))
/
ADD (CONSTRAINT
PK__LOCATIONS__7B905C75 PRIMARY KEY
(LOCATION_ID))
/
l e
(DEPARTMENT_ID) ON DELETE CASCADE)@ his/ ON DELETE CASCADE)
/
. b ha se t
o
PROMPT Creating Foreignd h Keytoonu PROMPT Creating Foreign Key on
'JOB_HISTORY' ub e
sADD 'EMPLOYEES'
e s
ALTER TABLE (JOB_HISTORY
c e n ALTER TABLE EMPLOYEES ADD (CONSTRAINT
h a l
(CONSTRAINT l i FK__EMPLOYEES__DEPAR__060DEAE8
h b
FK__JOB_HISTO__JOB_I__0DAF0CB0 FOREIGN KEY
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/Disk1. Perform the following tasks as the default
oracle OS user, unless otherwise indicated.
Use the Oracle Universal Installer (OUI) to begin your software installation of the Enterprise
Edition of Oracle Database 10g Release 2. This is a “Basic Installation” of the Oracle software.
a ble
fe r
After installing the software, execute the lab_02_05.sh script, which creates a listener for
a n s
you. n- t r
a no
h a s
Note: Completing this practice is critical for all following practice)sessions.
c o m ide.
Your Tasks g i c. t Gu
a r elo den
1. Install the Oracle database software asiwthe oracle
S tuuser. Navigate to the /stage/Disk1
@ s
directory, and start the OUI bylentering
h a e
e thi
./runInstaller.
h
2. Select your installation
b byuentering
.method s and accepting the following settings:
o
b nse d t o
Object (su Setting
e li c e
b hal Home
Installation
Database
Method
Location
Basic Installation
/u01/app/oracle/product/10.2.0/db_1
o d h Installation Type Enterprise Edition
sub UNIX DBA Group oinstall
Create Starter Database Deselected
Inventory Directory /u01/app/oracle/oraInventory
3. After entering the initial settings, OUI checks product-specific prerequisites for you. When
these checks are finished, install the Oracle software.
Estimated installation time is 10–15 minutes. However, varying environments can greatly
influence this estimate.
4. When the Execute Configuration scripts page appears, follow the instructions on that page,
accept the default for the local bin directory, and then finish your installation with OUI.
Make a note of your End of Installation URLs. You will use them in later practice sessions.
iSQL*PlusURL:____________________________________________________________
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).
Note: Completing the database creation is critical for all following practice sessions.
Your Tasks
1. Start the Database Configuration Assistant (DBCA) by entering dbca in a terminal a ble
window. fe r
a n s
2. Begin the ORCL database creation. Use the General Purpose database template.n r
-t the
Review
o
template’s details and answer the following questions.
s an
Question 1: How many control files are created? ) ha
c o m ide.
g i c. t Gu
________________________________________________________________________
a relo uden
Question 2: Would it maximize database S t to multiplex them?
iw availability
@ s
h a le
e thi
________________________________________________________________________
d h .b us
o t o
( s ub many
Question 3: How
e n e log groups are created?
sredo
a le lic
________________________________________________________________________
h
o d hb Question 4: Would it maximize database availability to mirror them?
sub
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
Note: You will change this setting later in this practice to create and unlock the HR sample
schema.
Question 7: What is the template default for the Database Character Set?
________________________________________________________________________
Note: You will change this setting later in this practice to use a Unicode database character
set.
3. Create the ORCL database, as well as the ORCL template and the database generation
scripts.
relo uden
Storage Options File System
File Location a
iw s St Use Oracle-Managed Files
Recovery Configuration @ Specify Flash Recovery Area
Enable Archiving h a le
e thi deselect
Database Content
d h .b us Sample Schemas enabled
o t o
( s ub ense
Initialization Parameters Memory Custom and Automatic Shared Memory
Management
ale Setslic
hCharacter
bCreation Options: Use Unicode (AL32UTF8)
o d h Select all:
sub
- Create Database
- Save as a Database Template (optional)
- Generate Database Creation Scripts (optional)
Template Name orcl
Description ORCL Database template
Destination Directory /home/oracle/labs
Review and confirm options and parameters, such as Sample Schemas (true),
db_block_size (8KB), sga_target (270MB), undo_management
(AUTO), and Database Character Set (AL32UTF8).
The DBCA displays the progress of the various installation steps. When the database itself
has been created, the DBCA displays essential information about the database. Make note
of this information. The Database Control URL will be used in several of the following
practice sessions.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
Unlock
h a lic with HR as password.
lethe HR user
o d hb You completed your task to create a database and (optionally) a database template and
sub database generation scripts.
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.
Your Tasks
1. Invoke Enterprise Manager with Mozilla and the oracle profile. Enter the URL that you
wrote down in Practice 3, and log in as the SYS user with the oracle password and
SYSDBA as “Connect As.” Which port number does this database use? You noted this in
Practice 3.
_______________________________________________________________________
a ble
The first time you log in after installing the software, the “Oracle Database 10g Licensingsfe r
Information” page appears. Acknowledge this information.
t r a n
n o n-
2. View the initialization parameters (Navigation aid: Adminstration > AllaInitialization
Parameters). Set the JOB_QUEUE_PROCESSES parameter to 15.aWhat
h s SQL statement is
run to do this? m ) e.
o
g i c.c t Guid
_______________________________________________________________________
a relo uden
3. Question: What is the significance ofiw a check in
S t Dynamic column?
the
@ s
h a le
e thi
_______________________________________________________________________
d h .b us
o t o
4. Shut down the
( s ubdatabase
e n e by using Enterprise Manager.
sinstance
For
h aHost lic enter oracle as Username and oracle as Password.
le Credentials,
o d hb
b Question: What SQL is executed to shut down the database instance?
su
_______________________________________________________________________
If you click Refresh during the shutdown operation, you may see the following error: Click
OK and continue to refresh. The error will resolve itself.
Click OK and continue to click Refresh. Note that the Status of the instance is now
“Down.”
5. When you note that the Status of the instance is “Down,” use SQL*Plus to verify that you
are not able to connect as the HR user.
6. Use Enterprise Manager to restart the database instance with the oracle host credentials.
Question: What SQL is run to accomplish the database startup?
_______________________________________________________________________
7. In the alert log, view the phases that the database went through during startup. (Navigation
aid: Database > Alert Log Content).
Question: What are the database instance startup phases?
a ble
_______________________________________________________________________
fe r
a ns
n- t r
8. Test access to iSQL*Plus for your HR application developers. (Navigation aid: Database >
a no
iSQL*Plus). Use the Normal role, hr username and password, and the default setting as
Connect Identifier. If there is an error accessing iSQL*Plus, then start the isqlplus process
h a s
using the isqlplusctl start command at the OS prompt, and then reattempt. After
m ) e.
o
connecting, select the contents of the EMPLOYEES table.
g i c.c t Guid
a r elo log
When you have finished reviewing the information,
d e n of iSQL*Plus and close the
out
iSQL*Plus window.
@ iw s Stu
h a le
e thi
d h .b us
o t o
( s ub ense
h a le lic
o d hb
sub
Background: You need to create a new tablespace for the INVENTORY application. You also
need to create a database user that is not as privileged as the SYS user.
Your Tasks
1. Enter ./lab_05_01.sh to run a script that creates the DBA1 user. It is located at
/home/oracle/labs. The password for DBA1 is oracle. 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. Use the following settings:
a ble
Object Setting fe r
Name dba1 a ns
Password Oracle n- t r
Confirm Password Oracle a no
Super Administrator Selected
h a s
m ) e.
o and logidin as DBA1 user. Use
the DBA1 user to perform the rest of these tasks, g i c cotherwise
When the non-SYS user is configured, log out as SYS.user
unless t G u indicated.
a relo uden
iw sabout
3. Using Enterprise Manager, view information S t the EXAMPLE tablespace (Navigation
@
h a le Answer
aid: Administration > Tablespaces).
e thi the following questions about it:
d h.b toof free
Question 1: Whatopercentage
us space can be used up before the Warning threshold is
reached? sub n se
( e
h a le lic
_______________________________________________________________________
o d hb
sub Question 2: How many segments are there in the EXAMPLE tablespace? (Navigation aid:
“Show Tablespace Contents” Actions drop-down list selection).
_______________________________________________________________________
Question 3: Which index in the EXAMPLE tablespace takes up the most space? (Navigation
aid: Search type “INDEX”)
_______________________________________________________________________
Question 4: Which segment is stored physically first in the tablespace? That is, which one
is stored right after the tablespace header?
Look at all extent types on the Extent Map. Note the extent just to the right of the
tablespace header extent.
a ble
fe r
a ns
n- t r
no
Scroll to the top of the page again, and note the segment that is being pointed to.
a
h a s
_______________________________________________________________________
m ) e.
o uid (Navigation aid:
g c.cINVENTORY
4. Create a new, locally managed tablespace (LMT) called
i t G
r e lo specifications:
Administration > Tablespaces). Use the following
e n
Object i a
wSetting S tud
Tablespace name
a l e@ tINVENTORY
h is
Extent Management .bh se Locally Managed
Type d h to u Permanent
Status su b o e
e ( tablespace
c e ns Read Write
ha File Nameli
Use lBigfile deselected
h bData inventory01.dbf
b o d File Size 5 MB
su Extent Allocation Automatic
Segment Space Management Automatic
Enable Logging selected
Note: The INVENTORY tablespace will be used in later practice sessions during this class.
5. Run the lab_05_05.sql script to create and populate a table (called X) in the
INVENTORY tablespace. What error do you eventually see?
_______________________________________________________________________
6. Go to the Enterprise Manager window and define space for 50 MB in the tablespace instead
of 5 MB, while keeping the same single data file in the tablespace. What is the ALTER
statement that is executed to make this change?
_______________________________________________________________________
7. Go back to the terminal window and run the lab_05_07.sql script that drops the table
and reexecutes the original script that previously returned the space error.
Note that the same number of row inserts are attempted, and there is no error because of the
increased size of the tablespace.
a ble
8. In a terminal window, run the lab_05_08.sql script to clean up the tablespace for later
fe r
practice sessions.
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
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 of them must be able to log in to the ORCL database,
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 will automatically be logged out after 15 minutes. You also need to
create a new user account for the inventory application that you are installing.
Your Tasks
6. Use EM to create an account for David Hamby, a new HR clerk (Navigation aid:
Administration > Users). Use the following specifications:
Object Setting
Name DHAMBY
Profile HRPROFILE
Password Authentication selected
Password newuser
Expire Password now selected
Roles CONNECT and HRCLERK
7. Use EM to create an account for Rachel Pandya, another new HR clerk. Repeat the steps
a ble
from step 6 with RPANDYA as the username.
fe r
a n s
8. Use EM to create an account for Jenny Goodman, the new HR manager. Repeat the
n r
-t steps
from step 6 with JGOODMAN as the username and selecting the HRMANAGER o
n instead of
role
the HRCLERK role. Review your underlying SQL statement: s a
h
) e. a
o m
g i c.c t Guid
a relo uden
@ iw s St
9. Test the new users in SQL*Plus.
h a leConnectthtoi the ORCL database as the DHAMBY user. Use
. b Select
oracle as the new password.
h u sethe row with EMPLOYEE_ID=197 from the
b o d Then,toattempt to delete it. (You should get the “insufficient
table.
u ense
HR.EMPLOYEES
privileges”
( serror.)
h a le lic
o d h10.bRepeat the delete attempt as the JGOODMAN user. After deleting the row, issue a rollback,
so that you still have the original 107 rows.
sub
Question 1: Where was the row stored after deletion?
__________________________________________________________________________
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?
_________________________________________________________________________
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?
_________________________________________________________________________
11. Review the lab_05_01.sql script and the lab_05_01.txt log file that it generated
when you created the DBA1 user.
12. 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.
ERROR at line 1:
ORA-02396: exceeded maximum idle time, please connect again
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Background: You need to create schema objects for the new inventory application. Work as
DBA1 user in the SYSDBA role for your ORCL database.
Your Tasks
1. Return to the Enterprise Manager browser session, or invoke EM as the DBA1 user in the
SYSDBA role for your ORCL database.
h a s
COST number(5,2) ) e.
PRICE number(5,2) o m
g i c.c t Guid
a r elo den
3. In the INVENTORY tablespace, create the PRODUCT_ON_HAND table in the INVENTORY
iw s S
schema. You have been given the lab_07_03.sql t u script to create the table, but there is
a problem with it (intentionallyle @ i
created tohenhance your learning experience). Fix the
problem, and run the script. h a
If you e
cannot
t find the error right away, then go ahead and run
h . b u s
b dSQL*Plus
the original script in to toofsee
ospecifications the error message. This helps you discover and solve
the problem.uThe
s n s e the table are:
( e
h a le
PRODUCT_ID lic number(7). This field should have a foreign key constraint linking it to
o d h b the PRODUCT_ID field in the PRODUCT_MASTER table.
b QUANTITY number(5)
su WAREHOUSE_CITY varchar2(30)
LAST_UPDATE date
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.
_________________________________________________________________________
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 the
INVENTORY schema and displays (in this order):
• The name of the product
• The amount of “product on hand”
• The warehouse city name
You will have to join two tables together to create this view.
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 need to
run the query and see how it performs. First, run the lab_07_11_a.sql script to
generate some test data of the volume indicated in the request. Then, run the query in the
lab_07_11_b.sql script several times to see the average run time. Note that it takes
several seconds to run each time. Create a function-based index on the CODE column that
will improve the performance of this query.
12. Use iSQL*Plus to identify the data dictionary view name that you would use to list all
constraints that the INVENTORY user can see. What is the view name?
_________________________________________________________________________
a ble
fe r
13. How many indexes are owned by the INVENTORY user? You are looking for database
a n s
n- t r
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.
a no
h a s
) e.
_________________________________________________________________________
m
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
h a le lic
o d hb
sub
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.
Your Tasks
o d h. to us
_________________________________________________________________________
s b nse
uSQL*Plus
6. Return to (the ce Itcommand window, and note that SMAVRIS’s update has now
a l e successfully.
completed l i may take a few seconds for the success message to appear.
b h
o d h
sub
Background: A new version of your application will include several reports based on very
long-running queries. Configure your system to support these reports.
Your Tasks
1. Use the Undo Advisor to calculate the amount of undo space required to support a report
that takes two days to run, on the basis of an analysis period of the last seven days.
(Navigation aid: Administration > Advisor Central > Undo Management > Undo Advisor).
Question: What does the analysis recommend as “Required Tablespace Size for New Undo
Retention”?
a ble
_________________________________________________________________________
fe r
a ns
t r
2. Resize the undo tablespace to support the retention period required by the new reports (or 1
n-
no
GB, whichever is smaller). Do this by increasing the size of the existing data file.
a
Question: What are the two ways to add space to a tablespace? ha
s
m ) e.
o
g i c.c t Guid
_________________________________________________________________________
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
h a le lic
o d hb
sub
Background: You have just been informed of suspicious activities in the HR.JOBS table in
your ORCL database. All maximum 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.
Log in as the DBA1 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.
Your Tasks
1. Use Enterprise Manager to enable database auditing. Set the AUDIT_TRAIL parameter to
a ble
XML. This setting should be stored in the SPFILE. fe r
a n s
2. Because you changed a static parameter, you must restart the database. Do so byn -t r
running
o
the lab_10_02.sh script.
s an
) ha and the script has
Continue with the next step when you see that the database is restarted
exited out of SQL*Plus. c o m ide.
g i c. t Gu
3. Back in Enterprise Manager, select HR.JOBS
a relaso theudaudited
en object and DELETE, INSERT,
and UPDATE as Selected Statements.iw t information by session. (Navigation
Gather audit
S
@ s
h a le
aid: Administration > Audit Settings).
e thi
d
4. Provide input for the h .b executing
audit, by us the lab_10_04.sh script. This script creates the
o t o
AUDIT_USER
( s ubuser,econnects
n se to SQL*Plus as this user, and multiplies the values in the
le
MAX_SALARY
h a lic by 10. Then, the HR user connects and divides the column values
column
6. Undo your audit settings for HR.JOBS, disable database auditing, and then restart the
database by using the lab_10_06.sh script.
7. Maintain your audit trail: Because you are completely finished with this task, delete all
audit files from the /u01/app/oracle/admin/orcl/adump directory.
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.
Your Tasks
1. Make a copy of your listener.ora and tnsnames.ora files. They are in the
$ORACLE_HOME/network/admin directory.
2. Navigate to the Net Services Administration page. Start by clicking the Listener link on the
Database home page.
a ble
3. Modify your local Names Resolution file so that you can connect to another database.
fe r
(Navigation aid: Listener link > Net Services Administration > Administer > Local
a ns
Naming). Use the following information to define the connection:
n- t r
Object Setting a no
Connection name Testorcl h a s
DB ID Method SID m ) e.
o
SID value Orcl
g i c.c t Guid
relo uden
Protocol TCP/IP
Port a
iw s St1521
Host @ IP or name of other student’s computer
h a le
e thi
4. In Enterprise Manager,
h b accessusto your partner’s ORCL database as the system user
.test
with the oracle
b o d
password tousing the testorcl Local Naming.
by
su cens e
l e ( i displays status information. Then, it is followed by a success message.
TheaProcessing
h lpage
b
h If you receive any errors or warnings, resolve them.
b o d
su
5. Test your changes to the network configuration by using SQL*Plus or iSQL*Plus. Again,
use: system/oracle@testorcl. To see your partner’s information, select the
instance_name and host_name columns from the v$instance table. You should
see your partner’s host name.
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_11_06.sh script to
configure the NetProperties file. (Navigation aid: Listener link > Net Services
Administration > Administer > Listeners). Use the Static Database Registration tab on the
Create Listener page to connect the listener to your database. Use the following
information:
a ble
Object Setting
fe r
Listener name LISTENER2
a ns
Host <your computer’s name>
n- t r
o
Service name
Protocol
orcl
TCP/IP s an
Port ) ha
SID
1561
c o m ide.
Oracle Home Directory
orcl
g i c. t Gu
relo uden
/u01/app/oracle/product/10.2.0/db_1
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
Automatic Database Diagnostic Management (ADDM) environment.
Your Tasks
1. Create a new locally managed tablespace called TBSADDM. Its addm1.dbf data file is 50
MB. Ensure that the TBSADDM tablespace does not use Automatic Segment Space
Management (ASSM). Execute the lab_12_01.sh script to perform these tasks.
2. Create a new ADDM user, identifed by ADDM. Assign the TBSADDM tablespace as default a ble
tablespace. Assign the TEMP tablespace as temporary tablespace. Grant the following roles fe r
a n s
to the ADDM user: CONNECT, RESOURCE, and DBA. Execute the lab_12_02.sh script
n- t r
to perform these tasks.
a no
3. Use the DBMS_ADVISOR package to set the database activity time h a s
to 30 minutes. As an
ADDM user, drop and create the ADDM table and gather statistics m ) for this
e .table. Create a
c o i d
snapshot in Automatic Workload Repository (AWR).
g i c.Execute
t G u lab_12_03.sh script
the
to perform these tasks.
a relo uden
t
iwthe lab_12_04.sh
S
4. Create activity to be analyzed. Execute
l e @ h i s script to perform these tasks.
a t
5. In Enterprise Manager, h . bh theusPerformance
review
e page as a user connected as SYSDBA. View
performance data o d t o
a spike on(s
ub inereal
the “Average n
time
e with a 15-seconds refresh cycle. After a while, you should see
sActive Sessions” graph. This is your activity to be analyzed.
l e l i c
b ha at theproblems.
Looking
concurrency
graph, you can already determine that this instance is suffering from
If this is the first time that you accessed the Performance page, you
o d h
b need to accept the Adobe license agreement. Follow the directions in the pop-up window to
su 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 ADDM table.
6. Look at the Performance Analysis findings in order of their impact. There are several
access paths to this information.
Looking at the Performance Analysis section, you see that the first finding (in the SQL
Tuning Recommendations category) has a 100% impact on the system. So your first
impluse 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 of your database.
Research the next finding under Schema Recommendations: Read and write contention of
database blocks was consuming significant database time. Here, you are advised to use
the Automatic Segment Space Management (ASSM) feature for your ADDM table.
a ble
7. To implement the recommendation, you must re-create the object. Create a new locally
fe r
managed tablespace, called TBSADDM2 with a 50 MB data file, called addm2_1.dbf.
a n s
n-
Ensure that the TBSADDM2 tablespace uses the the ASSM feature. Then, execute the t r
no
lab_12_07.sh script to drop the ADDM table, to re-create it in the new tablespace, to
a
gather statistics and to take a new snapshot.
h a s
m ) e.
8. Execute your workload again by running the lab_12_08.sh
. c o script.
u id (The
lab_12_08.sh script is identical to the lab_12_04.sh i c
g nt G script.)
r e l o e
i wa Spage
9. In Enterprise Manager, review the Performance tudas a user connected as SYSDBA. View
a l e@
performance data in real time with
t h is refresh cycle. After a while, you should see
a 15-seconds
a spike on the “Average.b h Sessions”
Active se graph.
d h u
torun the workload, you may see differences between your
Note: Dependingb o on whene you
graphland
e suonecprovided
(the e ns as a possible solution.
ha li
b
h After the spike is finished, execute the lab_12_09.sh script. (The lab_12_09.sh
b o d script is identical to the lab_12_05.sh script.) This script forces the creation of a new
su snapshot and gathers statistics on your ADDM table.
10. Review the Performance Analysis on the Database home page. View the information for
this last ADDM task.
You see that there are no longer any schema-related recommendations. By moving the
ADDM table to the locally managed TBSADDM2 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.
Your Tasks
1. Log in to SQL*Plus as the DBA1 user and perform maintenance on tables in the HR schema
by running the lab_13_01.sql script. a ble
fe r
a ns
2. You get calls from HR application users saying that a particular query is taking longer than normal
n- t r
to execute. The query is in the lab_13_02.sql script. As the HR user, run it.
a no
3. Using Enterprise Manager (EM), locate the HR session in which h a
the s statement was
above
just executed, and view the execution plan for that statement.m ) e. aid: Performance
(Navigation
o
> Search Sessions).
g i c.c t Guid
4. Using EM, check to see the status of the a relo udtable’s
EMPLOYEE en index on EMPLOYEE_ID. See
iw s S>tIndexes).
if it is VALID. (Navigation aid: Administration
@
h a le
e thi
5. Now that you have seen
d h .bone indexuswith a non-VALID status, you decide to check all
o
indexes. UsingbSQL*Plus, easto
the HR user, find out which HR schema indexes do not have
u
STATUS (ofsVALID. s
n do this, you can query a data dictionary view with a condition on
eTo
l e l i c
b haSTATUS column.
the
o h
d 6. Using EM, reorganize all the indexes in the HR schema that are marked as UNUSABLE.
sub
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.
9. Simulate a working load on your instance by running the lab_13_09.sql script as the
DBA1 user. Note the SID value for task 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, you
will notice that response time for Database Control is slower.
Use EM to view overall instance performance and answer the following questions:
a ble
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
r e lo Wait e nto see the beginning of a
i wa Stuspike d in the Average Active
@ his Sessions graph before
l e
. b ha se t proceeding.
o d h to u
Question 1: In
s u b nse Active Sessions graph, which are the two main categories that
the Average
a l e ( are
active sessions
l i e for?
cwaiting
h
o d h b_________________________________________________________________________
sub Question 2: In the Configuration category of waits, what is one of the contributors to the
wait time? Click Configuration to see the graph.
_________________________________________________________________________
Question 3: Review the Physical Writes on the Instance Disk I/O graph. Determine which
process is doing the most writing to the disk.
_________________________________________________________________________
Question 4: Review the Top Activity under Additional Monitoring Links. Which SQL
statement is causing the most waits?
_________________________________________________________________________
10. Kill the session that is generating the load. Use the SID value from step 9 in Enterprise
Manager’s Search Sessions link on the Performance tab to locate and kill the session.
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.
Your Tasks
1. Verify that you have two control files to ensure redundancy. (Navigation aid:
Administration > Control Files).
Question 1: How would you add another control file if you needed to?
_________________________________________________________________________
_________________________________________________________________________ a ble
fe r
_________________________________________________________________________ a ns
n- t r
_________________________________________________________________________a no
h a s
) e.
_________________________________________________________________________
m
o
.c that id
uthere
2. Check how many members each redo log group has. g i cEnsure
t G are at least two redo
r
log members in each group. In what directory e l
or
o e n
directories are the redo log files stored?
a
iw s S t u d
@
h a l e
e thi
_________________________________________________________________________
h .b us
_________________________________________________________________________
d
o t o
Note: In a(s
ub endatabase,
production
se you want to ensure that the two members are on different
a
hard
h drives, lic with different disk controllers, to minimize the risk of any single
le preferably
o d h bhardware failure destroying an entire log group.
sub
3. 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 recovery, and in
the event of a failure, you will lose all data since your last backup. Place your database in
ARCHIVELOG mode, so that redo logs will be archived.
Notice that the database is preconfigured to save archived logs to the Flash Recovery Area
by default (Archive Log Destination 10).
4. Configure redundant archive log destinations—one to the Flash Recovery Area and the
other to /u01/app/oracle/archive/. Do not forget the trailing slash. Leave Quota
blank.
a ble
fe r
When prompted, restart your database with oracle Host Credentials and the SYS user.
a n s
n- t r
no
Now that your database is in ARCHIVELOG mode, it will continually archive a copy of
a
h a s
each online redo log file before reusing it for additional redo data.
Note: Remember that this consumes space on the disk and m ) e. regularly back up
o that youdmust
older archive logs to some other storage. g i c.c t Gui
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
h a le lic
o d hb
sub
Background: Your database is ready to move from development and test into production.
Ensure that your database is configured so that recovery is possible without loss of data.
Your Tasks
________________________________________________________________________
________________________________________________________________________
a ble
fe r
3. Test making a backup to disk, as a backup set, with oracle for Host Credentials.
a n s
(Navigation aid: Maintenance > Backup Settings)
n- t r
a no
4. Back up your entire database, without archived logs, while the database is open for user
h a s
activity. This backup should be the base for an incremental backup strategy (Navigation
aid: Maintenance > Schedule Backup). m ) e.
o
g i c.c t Guid
shutting it down? a relo ua dvalid
Question: What prerequisite must be met to create
enbackup of a database without
@ iw s St
a le thi
________________________________________________________________________
h e
d h .b utosperform the backup:
Use the following o t o
specifications
Object ( s ub ense Setting
a l e l i c
hObject(s) Whole Database
o d h bHost Credentials Username oracle
sub Host Credentials Password oracle
Backup Type Full Backup
Use as the base of an incremental selected
backup strategy
Backup Mode Online Backup
Backup Location Disk
Disk Backup Location Flash Recovery Area
Also backup all archived logs on disk deselected
Schedule Defaults selected
Submit and monitor the job. This backup takes approximately 15 minutes to complete.
5. Schedule nightly disk-based incremental online backups for your whole database, without
archived logs backup (Navigation aid: Maintenance > Schedule Backup). Schedule it for
11:00 p.m.. The schedule should be in effect indefinitely.
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
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. SQL script files are provided for you in the /home/oracle/labs directory. If
needed, use appendix C for Linux and appendix D for SQL syntax. Note that where OS file
names are mentioned, your system may possibly have different file names than shown here.
Your Tasks
a) As the DBA1 user, run the lab_16_01_a.sql script to prepare some procedures to
a ble
be called by the rest of this practice. fe r
a n s
b) Now run the lab_16_01_b.sql script. This script deletes one of your control n r
-t files.
n o
s
c) The Help desk begins receiving calls saying that the database appears
a to be down.
)
Troubleshoot and recover as necessary. Use Enterprise Manager’s ha Database page to
o m e .
attempt to start up the database, and use SQL*Plus,
g i c.c t Guid
if needed.
relo uManager,
d) The startup of the instance fails with Enterprise
a d en and you can get no other
information to explain the failure.iw So use the
S t
command-line tools.
@ s
- Connect to the instance h a with e thi as sysdba and check the current status of
le SQL*Plus
the instance. dh
.b us
o t o
( s
- Attempt
ubto mount
e n e
sthe database.
a l e l i c
h bh
e) The instance cannot move to the mount stage because it cannot find one of the control
o d files. Check the last 10 rows of the alert log to see which control file is the problem.
sub
f) The control file in the Flash Recovery Area is missing. Restore the missing control file
by copying the existing control file, and then mount and open the database.
Question 1: Why did you have to use two commands to move the instance state from
NOMOUNT to OPEN?
________________________________________________________________________
________________________________________________________________________
Question 2:Why did you use operating system commands to restore the control file instead
of using Oracle Recovery Manager?
________________________________________________________________________
________________________________________________________________________
a) Start a SQL*Plus session as the DBA1 user, and run the lab_16_02.sql script. This
script deletes one of your application data files.
b) The Help desk has received a call from a user who is unable to access the COUNTRIES
table in the HR application schema. Count the rows in the table to see whether there is a
problem.
c) Troubleshoot and recover as necessary. The error message suggests that the data file for
the EXAMPLES tablespace is corrupt or missing. Using operating system commands, verify
that there is a problem with the file.
a ble
fe r
d) Recover the data file to the current time, specifying the missing data file to be
a ns
recovered. (Navigation aid: Maintenance > Perform recovery > Object Type >
n- t r
Datafiles).
a no
h a s
e) Verify that the COUNTRIES table is now accessible. ) e.
o m
3. Recover from the loss of a system data file.
g i c.c t Guid
a) Question 3: Why is recovery fromw relofo ausystem
thealoss d endata file or a data file belonging
@
to an undo tablespace different
i s St an application data file?
from recovering
h a le
e thi
.b us
________________________________________________________________________
d h
o t o
s ub ense
________________________________________________________________________
(
h a le lic
o d h bb) As SYSDBA, run the lab_16_03.sql script. This script deletes the system data file.
sub c) In Enterprise Manager, review the Database home page. The database is shut down, so
you click Startup to try to open it.
- Enter the host credentials as oracle and oracle for the host Username and
Password, and enter DBA1 and oracle for the database credentials, and then click
OK.
d) This command will fail with the database left in the MOUNT state, because there is a
data file missing from the SYSTEM tablespace.
e) Recover the missing data file.
f) Open the database.
g) Verify that the database is open and operating normally, by logging into EM as
DBA1/oracle, as SYSDBA, and reviewing the Database home page.
Background: You decide to gain hands-on experience in some of the flashback functionality.
To avoid impacting other users, you will first copy the DEPARTMENTS table of the HR schema
to DEPARTMENTS2.
Your Tasks
1. Log in to SQL*Plus as DBA1 user and create a new HR.DEPARTMENTS2 table based on
the HR.DEPARTMENTS table. Count the rows in the DEPARTMENTS2 table. There should
be 27 rows.
2. Drop the HR.DEPARTMENTS2 table, and then verify that it has indeed been dropped.
a ble
3. Use the FLASHBACK TABLE command to restore the table. Count the rows in the fe r
a n s
DEPARTMENTS2 table.
n- t r
a no
4. Run the lab_17_04.sql script to insert three rows into the HR.DEPARTMENTS2 table
h a s
by using three separate transactions. The new rows have DEPARTMENT_ID values of 280,
290, and 300. m ) e.
o
g i c.c t Guid
5. Use Enterprise Manager to perform flashback
of the three new rows is present (with w a reltootheudversion of the table where only the first
en= 280). (Navigation aid:
i S t
DEPARTMENT_ID
Maintenance > Perform Recovery). @First,hevaluate
lerows is where row changes to decide on a point in time.
Limit your analysis to the h a
new just
e t added: department_id >= 280. If you
receive an error while . b
hperforming s
uthe flashback, you may need to enable row movement on
the table. Seeutheo d
b nse
next step. t o
Use the following specifications:
s
e ( lice
a l
Object
hObject Type
Setting
h b Tables
b o d Operation Type Flashback Existing Tables
su Evaluate row changes and transactions to selected
decide on a point in time
Table HR.DEPARTMENTS2
Choose Columns > Selected Columns DEPARTMENT_ID
Bind The Row Value where department_id >= 280
Select the row with the DEPARTMENT_ID = 290 and continue your flashback operation.
Review the SQL statement that you are about to execute and submit your operation.
Oracle Database 10g: Administration Workshop I A - 36
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Practice 17: Performing Flashback (continued)
6. You find that the operation fails because row movement is not enabled for the table. You
may recall from the lesson that row movement must be enabled for this feature to work.
Enable row movement (Navigation aid: Administration > Tables). Review the underlying
SQL statement:
After the table modification is confirmed, you can perform the flashback operation.
Repeat step 5 to perform the version flashback of the table. Because row movement has
a ble
been enabled, it should succeed this time. fe r
a n s
Then, in SQL*Plus, count the rows of the HR.DEPARTMENTS2 table to confirm n- t
ther
n oThen,
flashback operation. Note that there is only one additional row now, not three.
display the rows where DEPARTMENT_ID >= 280. Note that only s a
one of the original
a
) h e.
three is remaining.
m
i c .co Guid
l o g nt
r e e
i wa Stud
a l e@ this
h . bh use
b o d to
su cens e
e (
hal li
h b
b o d
su
Background: In the recent past, you received a number of questions about the HR schema. To
analyze them, without interfering in the 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 find out 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 a newly created HR_TEST schema in the HR_TEST tablespace. To follow best
practice guidelines, you also decide to create a DP user who will be a DBA performing Data
Pump jobs. For your convenience in class, the creation of the DP user is included in the
lab_18_01.sql script. SQL scripts are in the /home/oracle/labs directory. However,
there is one step missing. a ble
fe r
Then you receive two data load requests for which you decide to use SQL*Loader. a n s
n- t r
Your Tasks a no
h a s
1. Review the lab_18_01.sql script, which creates the HR_TEST m ) tablespace,
e . the
HR_TEST_ROLE role, and the HR_TEST and DP users. o d
.c NoteGtheuipasswords for these
g i c
users.
r e lo ent
i wa Stud
HR_TEST password: ________________________
a l e@ this
h . bh use
DP password: ________________________
b o d to
u step
Which additional e
ndos you need to perform to allow the DP user access to Enterprise
sAdministrator?
e ( c e
hal
Manager as li
b
h _____________________________________________________________________
b o d
su 2. Execute the lab_18_02.sh script. Then, perform the required step to make the DP user
an EM administrator.
3. Log in to Enterprise Manager as the DP user in the Normal role and export the HR schema
(Navigation aid: Maintenance > Export to Export Files). Use the following specifications:
Object Setting
Username oracle
Password oracle
Save as Preferred Credential selected
Export: Schemas HR
Export Options: Directory Objects DATA_PUMP_DIR
Log File hrexp.log
Export Files: Directory Objects DATA_PUMP_DIR
File Name HREXP%U.DMP
a ble
Export Schedule: Job Name hrexp
fe r
Description Export HR schema
a ns
Job Start Time Immediate n- t r
a no
Review the PL/SQL that the Export Wizard helped you to create and
h a ssubmit the job. A
m ) resolve
processing message appears, and then a success message. If not,
e . any errors, which
o
may have occurred.
g i c.c t Guid
Note: Please wait, not only for the job to bere lo butealso
created, n for the job to complete
execution. (It may take two minutes.)iw a tu d
@ s S
4. As the DP user, import theh a
exported e thi back into the ORCL database, remapping it
le HR schema
h .bHR_TEST
to the previously created
d usschema. (Navigation aid: Maintenance > Import from
o t
b thenfollowing o
Export Files).uUse
( s e se import specifications:
h a le
Object lic Setting
b
h Import Files: Directory Objects DATA_PUMP_DIR
b o d File Name HREXP%U.DMP
su Import Type Schemas
Host credentials oracle
The Data Pump Wizard reads the specified import file and gives you a success message. If
not, resolve any errors that may have occurred.
a
Note:
h ic an error saying that the hr_test object already exists. This is because
leYou maylsee
o d h bthat user existed when you did the export, and still exists. This is not a problem.
sub Select data from tables in the hr_test schema, for verification of the import.
5. As the DP user, load data into the PRODUCT_MASTER table by using SQL*Loader via
Enterprise Manager Database Control. (Navigation aid: Maintenance > Load Data from
User Files). Use the following loading specifications:
Object Setting
Use Existing Control File selected
Username oracle
Password oracle
Save as Preferred Credential selected
Load Data Control File Name /home/oracle/labs/lab_18_05.ctl
Data File: Provide the full path and name selected
on the database server machine
a ble
Data File Name /home/oracle/labs/lab_18_05.dat
fe r
Load Method Conventional Path
a ns
Load Data Options: Log File Name /home/oracle/labs/lab_18_05.log n- t r
Load Data Schedule: Job Name lab_18_05
a no
Description Load data into the
h a s
) e.
PRODUCT_MASTER table
m
o
Start
c.c t Guid
Immediately
g i
Submit your job and confirm your results by lo your
reviewing e nlab_18_05.log file.
a
iw s Stu d
6. As the INVENTORY user, loadle @
data into the
h i PRODUCT_ON_HAND table by using
SQL*Loader command.line. h a e t
h b (Enter u sthe command in continuation, without pressing [Enter]
before reaching the
b dend
o se t of theocommand: sqlldr
s u n
userid=inventory/verysecure
( e
control=lab_18_06.ctl log=lab-
le
_18_06.log
h a ic
ldata=lab_18_06.dat).
o d h bConfirm your results by viewing your lab_18_06.log file in your
sub /home/oracle/labs directory.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
________________
Appendix B
Solutions
________________
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Solutions for Practice 2: Installing the Oracle Database Software
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/Disk1. Perform the following tasks as the default
oracle OS user, unless otherwise indicated.
After installing the software, execute the lab_02_05.sh script, which creates a listener for
you.
a ble
fe r
Note: Completing this practice is critical for all following practice sessions.
a n s
n- t r
no
1. Install the Oracle database software as the oracle user. Navigate to the /stage/Disk1
a
directory, and start the Oracle Universal Installer (OUI) by entering ./runInstaller.
s
h a
)then enter:
a) Right-click your desktop and select Open Terminal, and
o m d e .
i c
c. t Gu i
g
relo uden
$ cd /stage/Disk1
$ ./runInstaller a
iw s St
@
for OUI.thi
2. Select your installation methodle
b h a e
h . u s
od Method
a) On the Installation
settings:ub e topage, select Basic Installation, and confirm the following
e ( s cens
al
hObject li Setting
b
h Database Home Location /u01/app/oracle/product/10.2.0/db_1
b o d Installation Type Enterprise Edition
su UNIX DBA Group oinstall
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.” Accept
/u01/app/oracle/oraInventory as inventory directory and oinstall as
Operating System group name. Click Next.
a ble
fe r
a n s
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h bd) After OUI has finished its prerequisite checks on the Product-Specific Prerequisite
o d
sub Checks page, click Next.
3. When the prerequisite checks are finished, the Summary page is displayed.
Estimated installation time is 10–15 minutes. However, varying environments can greatly
influence this estimate.
4. When the “Execute Configuration scripts” page appears, follow the instructions on that
page, accept the default for the local bin directory, and then finish your installation with
OUI.
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e t hi
a) Right-click your desktop
h s Open Terminal.
.b anduselect
b d o
o se t and root.sh scripts as root, and then click Continue.
b) Run the u
l e (s icen
orainstRoot.sh
a l
#hpassword: oracle <root password, does not appear on the screen>
$ su
h b
b o d # cd /u01/app/oracle/oraInventory
su #
#
./orainstRoot.sh
cd /u01/app/oracle/product/10.2.0/db_1
# ./root.sh
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
a
d) Enter exit to exit thehroot e thi
le OS user.
d h .b us
o
e) Close the terminal
b nse t
window, o and then click OK on the “Execute Configuration scripts”
page. (su
a l e l i ce
h
o d h bThe End of Installation page appears.
sub
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
f) Make (as ub of eyour
note n e
sURLs. You will use them in later practice sessions.
a l e l i c
h bh iSQL*Plus URL:________________________________________________________
o d
sub iSQL*Plus DBA URL:___________________________________________________
g) Optionally, click Installed Products, review the product inventory, then click Close.
You see an activity log, which should end with a success message. If not, resolve any errors
that might have occurred.
Oracle Database 10g: Administration Workshop I B-6
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Solutions for Practice 3: Creating an Oracle Database
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).
After you create the ORCL database, you execute the lab_03_03.sh script, which creates a
listener for you.
Note: Completing the database creation is critical for all following practice sessions.
Answer: 3
Answer: 3
It depends: No, not in class, because there are already three groups and you have only
one physical storage device; but yes, if you can put each group on a different physical
storage device.
Answer: 8 KB
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?
d) On the Database Credentials page, select Use the Same Password for All Accounts
and enter oracle as Password and Confirm Password. Then, click Next.
e) On the Storage Options page, select File System, and then click Next.
f) On the Database File Locations page, select Use Oracle-Managed Files. Accept the
default Database Area, and then click Next.
g) On the Recovery Configuration page, select Specify Flash Recovery Area, and then
click Next.
h) On the Database Content page, select Sample Schemas, and then click Next.
i) On the Memory tabbed page of the Initialization Parameters page, select Custom and
then select Automatic for the Shared Memory Management setting.
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le Mode
k) Review the Sizing and Connection
e thi tabbed pages, but do not change any values.
Then, click Next. .b
o d h to us
l) On thes
( ub eStorage
Database n se page, review your file names and locations. Then, click Next.
h a le lic
o d hb
sub
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ubselect
n) Optionally, e n se
all creation options and enter orcl as Name for the database
h a le ORCL
template, lic Database template as Description, and
h b /home/oracle/labs as Destination Directory. Then, click Finish.
o d
sub o) The Confirmation page appears. Review options and parameters, such as Sample
Schemas (true), db_block_size (8KB), sga_target (270MB),
undo_management (AUTO), Database Character Set (AL32UTF8),
and then click OK.
p) Click OK to acknowledge that the template has been created. Then, acknowledge the
generation of the database scripts (if you selected those options).
q) The DBCA displays the progress of the various installation steps. When the database
itself has been created, the DBCA displays essential information about the database.
Make note of this information. The Database Control URL will be used in several of the
following practice sessions.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
r) Click
h a lic Management button.
le the Password
o d hb s) Scroll down the Password Management page until you see the HR User Name.
sub
t) Deselect Lock Account? and enter hr as New Password and Confirm Password. Then,
click OK.
a ble
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
s ubto close
u) Click(Exit e n stheeDBCA.
h a le lic
o d h bYou completed your task to create a database and (optionally) a database template and
database generation scripts.
sub
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.
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
c) Enter the URL that you wrote down in Practice 3. It has the following format:
http://hostname:portnumber/em
d) Log in by entering sys as User Name and oracle as Password, and selecting
SYSDBA as Connect As. Then, click Login.
a ble
fe r
e) You may receive a security warning. In class, deselect Alert me whenever I submit a ns
information that’s not encrypted., and then click Continue. n- t r
a no
The first time you log in after installing the software, the Oracle
h a sDatabase 10g
Licensing Information page appears.
m ) e.
c o uiofdthe page.
f) To acknowledge this information, click I agree g i cat.the G
bottom
r e lo ent
2. View the initialization parameters andiw
S tud
setathe JOB_QUEUE_PROCESSES parameter to 15.
@
e this? thi
What SQL statement is run to ldo s
h a
h
a) Select Administration. u se Administration > Database Configuration > All
b > Database
b o d to
Initialization
su cens e
Parameters.
e (
hal li
h b
b o d
su
c) When the JOB_QUEUE_PROCESSES initialization parameter appears, change its value from
10 to 15.
d) Click Show SQL and note the SQL statement that is going to be run.
a ble
Answer: A “dynamic” parameter can be modified while the database is active.
fe r
a ns
4. Shut down the database instance by using Enterprise Manager.
n- t r
Question: What SQL is executed to do this? a no
h a s
) tab.
a) In the Enterprise Manager browser session, click the Database
m e .
c o i d
b) Click Shutdown. g i c. t Gu
a relo uden
c) For Host Credentials, enter oracle S t and oracle as Password.
iw assUsername
le @ hi
h a e t
d) Click OK.
d h .b us
o t o
( s ub enseConfirmation page appears.
The Startup/Shutdown:
e)ha
le lic
Click Advanced Options to see the mode for shutting down, but do not change the
h b mode; it should remain as “Immediate.”
o d
sub 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.
h) Click Return.
j) Click Refresh. If you see the following error during the refresh, click OK and continue
to refresh. The error will resolve itself.
a ble
fe r
k) Note that the Status of the instance is now “Down.”
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b uares not able to connect as the HR user to a database that
5. Using SQL*Plus,overify thattyou
b nse o
s udown.
has been (shut
a l e l i ce
h ba)h In the Linux command window, enter the following to attempt to log in to the database:
od
sub
$ sqlplus hr
6. Use Enterprise Manager to restart the database instance, and then log in as the SYS user
again.
b) Enter oracle for both Username and Password in the Host Credentials region.
c) Click OK.
d) The Startup/Shutdown: Confirmation page appears. Click Show SQL to view the SQL
that is about to run.
Answer: STARTUP
a ble
fe r
e) Click Return. a ns
n- t r
f) Click Yes to confirm the startup operation.
a no
g) The Startup/Shutdown: Activity Information page appears.)Wait hasfor the login page to
appear, at which time you can log in as SYS user with o m oracle
the d e .password and the
SYSDBA privilege. i c
c. t Gu i
g
a r elo den
7. In the alert log, view the phases that the
iwdatabaseS u through during startup. What are
twent
@ s
they?
h a le
e thi
a) Select Database b Links
> .Related
h us > Alert Log Content.
o d t o
( s ub ense
h a le lic
o d hb
sub
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.
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
c) Note that the modes
d h .bthe database
us goes through during startup are MOUNT and OPEN.
Click OK b o t o
to close theealert log.
( s u e ns
8. Test e li
l to iSQL*Plus
aaccess c for your HR application developers. (Navigation aid: Database >
b h
iSQL*Plus). Use the role, hr username and password, and the default setting as
o d h Normal
b Connect Identifier. If there is an error accessing iSQL*Plus, then start the isqlplus process
su using the isqlplusctl start command at the OS prompt, and then reattempt. After
connecting, select the contents of the EMPLOYEES table.
b) Notice that the SYSOPER and SYSDBA roles require special setup and authentication
for security reasons. Select Normal, and then click Continue.
c) If you see an error message saying that the connection was refused, that means you
need to start the supporting process. To do this, enter the isqlplusctl start
command at the OS prompt, and then retry step (b).
$ isqlplusctl start
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Starting iSQL*Plus ...
iSQL*Plus started.
d) On the Login page, enter hr as Username and Password and leave the Connect
Identifier set to its default value. Click the Login button.
a ble
The Confirm window appears, with the Password Manager offering to remember this fe r
login for you. Click No. a n s
n- t r
o
an
e) Enter the following statement in the workspace, and then click the Execute button:
s
SELECT * FROM EMPLOYEES;
) ha
c o m ide.
g i
The content of the EMPLOYEES table appears in ca.tabular
t G u
form.
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
f) When you have finished reviewing the information, click Logout in the top-right corner
of the page.
Background: You need to create a new tablespace for the INVENTORY application. You also
need to create a database user that is not as privileged as the SYS user.
1. Enter ./lab_05_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 right-clicking your desktop and selecting Open
Terminal.
c) Enter dba1 as Name, and oracle as Password and Confirm Password. Leave
Email Address blank, and leave Super Administrator selected, and then 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.
a ble
fe r
g) To acknowledge this information, click I agree at the bottom of the page.
a ns
n- t r
The Database Home page appears.
a no
3. Using Enterprise Manager, view information about the EXAMPLE h a s
tablespace. Answer the
) .
following questions about it:
. c om uide
a) In Enterprise Manager, select Administrationl o g>icDatabase
n t GAdministration > Storage >
r e e
Tablespaces.
i wa Stud
b) Click the EXAMPLE tablespace
a l [email protected]
h . bh use
c) Question 1: What
b o d percentage
to of free space can be used up before the Warning threshold
su cens
is reached? e
e (
hal 85% li
Answer:
b
o d h
sub
d) From the Actions drop-down list, select Show Tablespace Contents, and then click
Go.
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) Scroll to the top of the page again, and note the segment that is being pointed to:
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
Answer: HR.REGIONS o
g i c.c t Guid
a relo called
4. Create a new, locally managed tablespace (LMT)
u d e n
INVENTORY of size 5 MB.
t
iw s Sin later practice sessions during this class.
Note: The INVENTORY tablespace e @ will be iused
b h al e th
h. select
a) In Enterprise Manager, s
uAdministration > Database Administration > Storage >
o d t o
Tablespaces
( s ub ense
.
b)ha le Createli.c
Click
o d hb c) Enter INVENTORY as the tablespace name, and verify that Extent Management is
sub Locally Managed, Type is Permanent, Status is Read Write, and Use Bigfile
tablespace is not selected.
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.
i) Click Show SQL to see the SQL that will be run, and then click Return.
5. As the DBA1 user, run the lab_05_05.sql script to create and populate a table (called
X) in the INVENTORY tablespace. What error do you eventually see?
a) Right-click the desktop and select Open Terminal to start a command shell. Then
enter:
$ cd labs
c) Note that there is eventually an error ORA-01653 stating that the table cannot be
a ble
extended. There is not enough space to accommodate all of the rows to be inserted. fe r
a n s
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h6. bGo to the Enterprise Manager window and define space for 50 MB in the tablespace instead
o d
sub of 5 MB, while keeping the same single data file in the tablespace. What is the ALTER
statement that is executed to make this change?
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_05_07.sql script. It drops the table
and reexecutes the original script that previously returned the space error.
a ble
a) Go to the SQL*Plus window.
fe r
a ns
b) Enter the following to run the script:
n- t r
$ sqlplus dba1/oracle @lab_05_07.sql a no
h a s
c) Note that the same number of row inserts are attempted,m ) thereeis. no error because of
and
o
the increased size of the tablespace.
g i c.c t Guid
8. In an terminal window, run the lab_05_08.sql
a relo uscript
d ento clean up the tablespace for later
practice sessions.
@ iw s St
a le t h i
a) Enter the following.to h e
b run theuscript:
s
o d h t o
$ sqlplus
s u b dba1/oracle
n s e @lab_05_08.sql
a l e ( lice
h
o d hb
sub
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 of them must be able to log in to the ORCL database,
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 will automatically be logged out after 15 minutes. You also need to
create a new user account for the inventory application that you are installing.
1. Mandatory task: Review and run the lab_06_01.sh script (located in the
/home/oracle/labs directory) to create the INVENTORY user, which you will use in
the next practice.
a ble
a) In a terminal window, enter: fe r
a ns
cd /home/oracle/labs
n- t r
more lab_06_01.sh
./lab_06_01.sh a no
h a s
2. Create a profile named HRPROFILE, allowing 15 minutes o idle) time.e.
m
g i c.c t Guid
r e lo in theeSYSDBA
a) Invoke Enterprise Manager as the DBA1 user n role for your ORCL
database.
i wa Stud
b) Select Administration a e@ >thUsers
> lSchema is & Privileges > Profiles.
h . bh use
c) Click the Create
b o d button.to
( s u ense
d) Enter
h a lic in the Name field.
le HRPROFILE
h b
o d e) Enter 15 in the Idle Time (Minutes) field.
sub
a ble
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
b
h.fields us
f) Leave all theo d
other t o
set to DEFAULT.
( s ub ense
h a
DEFAULT.
lic tab, and review the Password options, which are currently all set to
le the Password
g) Click
o d hb
sub h) Optionally, click the Show SQL button, review your underlying SQL statement, and
then click Return.
3. Set the RESOURCE_LIMIT initialization parameter to TRUE so that your profile limits
will be enforced.
a) Select Administration > Database Administration > Database Configuration > All
Initialization Parameters.
c) Select TRUE from the Value drop-down list, and then click Apply.
a ble
fe r
4. Create the role named HRCLERK with SELECT and UPDATE permissions on the a ns
n- t r
HR.EMPLOYEES table.
a no
a) Select Administration > Schema > Users & Privileges > Roles h a .s
m ) e.
o
g i c.c t Guid
b) Click the Create button at the top-right of the page.
h b
g) Move the SELECT and UPDATE privileges to the Selected Privileges box. Click OK.
o d
sub h) Click the Show SQL button, and review your underlying SQL statement.
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 ble
fe r
a) Select Administration > Schema > Users & Privileges > Roles. a ns
n- t r
b) Click Create.
a no
h a s
c) Enter HRMANAGER in the Name field. This role is not authenticated.
) e.
o m
d) Click Object Privileges. g i c.c t Guid
r e lo en
e) Select Table from the Select Object
i a
w Type S tud list, and then click Add.
drop-down
o d h i) Move the HRCLERK role into the Selected Roles box, and then click OK.
sub
j) Click the Show SQL button, and review your underlying SQL statement.
a) Select Administration > Schema > Users & Privileges > Users.
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.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
newuser g i c. t Gu
relo uden
newuser
a
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h be) Click Roles. Notice that the CONNECT role has automatically been assigned to the user.
o d
sub 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.
7. Create an account for Rachel Pandya, another new HR clerk. Repeat the steps under step 6
with RPANDYA as the username.
8. Create an account for Jenny Goodman, the new HR manager. Repeat the steps under step 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.
9. Test the new users in SQL*Plus. Connect to the ORCL database as the DHAMBY user. Use a ble
oracle as the new password. Select the row with EMPLOYEE_ID=197 from the fe r
a ns
HR.EMPLOYEES table. Then, attempt to delete it. (You should get the “insufficient
n- t r
privileges” error.)
a no
a) In a terminal window, enter: h a s
m ) e.
o
sqlplus dhamby/newuser
g i c.c t Guid
relo udcommand.
or if you are already in SQL*Plus, use the CONNECT
a en If you reconnect as
w St
dhamby in SQL*Plus, the login and ichange-of-password session looks like this:
e @ i s
SQL> CONNECT dhamby/newuser
b h al e th
o d h. to us
ERROR:
s b password
uthe n se has expired
ORA-28001:
( e
h a lic for dhamby
le password
h bNew password: oracle <<<Password does not appear on screen
Changing
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Production
With the Partitioning, OLAP and Data Mining options
SQL>
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 delete attempt as the JGOODMAN user. After deleting the row, issue a rollback,
so that you still have the original 107 rows.
Rollback complete.
COUNT(*)
----------
107
SQL>
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?
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. Review the lab_05_01.sql script and the lab_05_01.txt log file that it generated
a ble
when you created the DBA1 user.
fe r
a ns
a) Double-click the oracle’s Home icon on your desktop.
n- t r
b) Navigate to the labs directory. a no
h a s
c) Double-click the lab_05_01.sql file, and reviewo itsm
)
content. e.
g i c.c t Guid
r e loclick theenUp icon to return to the labs
d) When you have finished reviewing the file,
directory.
i w Stud
a
e) Now, double-click theh a le@ this file, which was created when you executed
the lab_05_01.sqlh . b file. use
lab_05_01.txt
b o d to
e
su havecefinished
ns reviewing the file, click the X (Close Window) icon.
f) When(you
l e li
bha
12. Use SQL*Plus to connect to the ORCL database as the RPANDYA user. Change the
h
o d password to oracle. (You must change the password, because this is the first connection
sub 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.
ERROR at line 1:
ORA-02396: exceeded maximum idle time, please connect again
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.
1. Return to the Enterprise Manager browser session, or invoke EM as the DBA1 user in the
SYSDBA role for your ORCL database.
h) Set the drop-down list value to PRIMARY, and then click Add.
j) Double-click PRODUCT_ID in the left list to move it to the right list, to make it alone
the primary key. Then, click Continue.
k) Set the constraint type drop-down list value to CHECK, and then click Add.
a ble
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
n) Leave the Attributesb h aleat their
settings e hi settings, and then click Continue.
tdefault
o d h. to us
ub elistnsshould
o) Your constraint
( s e now look like this:
h a le lic
o d hb
sub
p) Click OK to create the table. If you receive errors, correct them, and then click OK
again.
) ha
$ sqlplus dba1/oracle @lab_07_03.sql
c o m ide.
g i c. t Gu
“(PRODUCT_ID)”. a relo isumissing
b) The error in the script is that “(PRODUCT_ID)”
d en after “FOREIGN KEY.” So, add
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense (PRODUCT_ID)
l e li c
h bha
o d
sub
a) In Enterprise Manager, select Administration > Schema > Database Objects > Tables. le
r a b
b) Click Create.
ns fe
t r a
n-
c) Leave the default setting for Table Organization, and then click Continue.
no
s a
d) Enter OBSOLETE_PRODUCTS for Name. h
) e.a
o m
e) Enter INVENTORY for Schema.
g i c.c t Guid
reloforuthisdeschema.
f) Leave the Tablespace setting as the default
a
n
@ iw s St
h a le listttohiSQL.
g) Set the Define Using drop-down
. b u s e
o h
h) In the SQL region,
d enter tthe
o following statement:
b e
su cproduct_id,
ns
e (
SELECT
e product_name, code, cost, price
li
l FROM inventory.product_master
h bha
o d
sub
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.
Answer: B-tree, because the CODE column can contain many different values, not just a
small, finite set.
b) Select Administration > Schema > Database Objects > Indexes, and the click Create.
h) Click Show SQL, confirm the SQL statement looks like the statement below, and then
click Return.
a ble
fe r
a n s
n- t r
o
an
Remove this
s
) ha
c o m ide.
g i c. t Gu
The corrected statement is:
a relo uden
@ iw s St
h a le
e thi
d h .b us
o
b) Remove thebprompt e t o
commands:
s u n s
a l e ( There
prompt l i ce is an error in this script.
h prompt Correct the error to have the index
o d h b prompt created successfully.
sub
c) Run the script to create the index by entering the following on the OS command line:
d) The error in the script is that it should not have the word “COMPOSITE”. Delete the
word, run the script, and the index should be created without error.
8. You receive an update for the inventory application that requires you to add two columns to
the PRODUCT_MASTER table. Add a column called PRIMARY_SOURCE of the data type
varchar2(50). Add another column called SECONDARY_SOURCE of the data type
varchar2(50). What is the SQL that executes to do this?
d) Enter PRIMARY_SOURCE in the Name field under PRICE, and set Data Type to
a ble
VARCHAR2, and Size to 50. fe r
a n s
e) Enter SECONDARY_SOURCE in the next available Name field, and set Data n r
t to
-Type
o
VARCHAR2, and Size to 50.
s an
f) Click Show SQL. ) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le Applyt.hi
g) Click Return, and then
h . b click
u se
9. You receive u b od update
another e to the inventory application. This change request instructs you
for
(
to dropethe c e ns
sOBSOLETE_PRODUCTS table and add the OBSOLETED column to the
h a l l i table, with data type DATE. Do this using EM. What clause is added
h bto the end of the DROP TABLE statement to also remove the table constraints?
PRODUCT_MASTER
b o d
su a) Select Administration > Schema > Database Objects > Tables.
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.
g) In the first empty Name field, enter OBSOLETED, and set Data Type to DATE.
h) Click Apply.
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 the
INVENTORY schema and displays (in this order):
• The name of the product
• The amount of “product on hand”
• The warehouse city name
You will have to join two tables together to create this view. a ble
fe r
a) Select Administration > Schema > Database Objects > Views. a n s
n- t r
b) Click Create. a no
h a s
c) Enter WAREHOUSE_VW in the Name field, and INVENTORY m ) in the
e .Schema field.
c o i d
d) Enter the following in the Query Text field: g i c. t Gu
o en
relwarehouse_city
select product_name, quantity,
i w Stud poh
a
from product_master pm,
a l e= @ t h is
product_on_hand
bh use
where pm.product_id poh.product_id
d h .
b o e to
e ( su cens
l li
h bha
o d
sub
e) Click OK.
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 need to
run the query and see how it performs. First, run the lab_07_11_a.sql script to
generate some test data of the volume indicated in the request. Then, run the query in the
lab_07_11_b.sql script several times to see the average run time. Note that it takes
several seconds to run each time. Create a function-based index on the CODE column that
will improve the performance of this query.
a) Right-click the desktop and select Open Terminal. Then enter the following at the
command prompt to populate the table with test data. This will take three to five
minutes to run.
a ble
$ cd /home/oracle/labs
fe r
$ sqlplus dba1/oracle @lab_07_11_a.sql
a n s
n- t r
b) Enter the following on the command line to run the test query.
a no
SQL> @lab_07_11_b.sql
h a s
m ) e.
o d times until you
g ic cseconds
c) Enter / (a slash), and press [Enter] to run it again..Repeat
establish an average run time. It should takeoseveral t G
thisiseveral
ueach time.
e l n
d) Select Administration > Schemaiw
ar tObjects
> Database u de > Indexes.
l e @ his S
e) Click Create.
. b ha se t
o d h to u
( s ub ensinethe Name field.
f) Enter CODE_FUNC
le lic in the Schema field.
g)haEnter INVENTORY
h b
o d
sub h) Enter INVENTORY.PRODUCT_MASTER in the Table 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.
12. Use iSQL*Plus to identify the data dictionary view name that you would use to list all
constraints that the INVENTORY user can see.
a) In the Enterprise Manager browser session, select Database > Related Links >
iSQL*Plus. le
r a b
The iSQL*Plus Connection Role page appears.
ns fe
t r a
b) Select Normal, and then click Continue.
no n-
s a
c) On the Login page, enter inventory as Username and verysecure
) h a as the
Password, leave the Connect Identifier set to its default
o value,
m ide .
and then click Login.
i c
c. tofferingu to remember this login
The Confirm window appears, with the Password gManager G
for you. Click No. a relo uden
@ iw s St
d) You are looking for things
h a lthat
e thi
e the INVENTORY user has access to. So, you must use a
view with the ALL_.b prefix. You
u scan assume that the name of the view that shows constraint
d h
o with
information begins t o
“ALL_CON .” In the iSQL*Plus Workspace, enter:
u b s e
l e
SELECT(s * FROM
i c endictionary
haWHERE l
table_name like ‘ALL_CON%’
h b
b o d ORDER BY table_name;
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
.c Guvalue
f) Review the returned rows. One of them has the COMMENTS id “Constraints
definitions on accessible tables.” The object g i c t
r e loname eis nALL_CONSTRAINTS .
wa Stuuser? d
13. How many indexes are owned by theiINVENTORY
l e @user,hsoisyou know thatYou are looking for database
objects owned by the INVENTORY
h a e t the data dictionary view begins
b usname is USER_INDEXES.
h. Thetoview
with the “USER_” prefix.
o d
a) In the(is ub enWorkspace,
SQL*Plus se enter:
l e l i c
b haSELECT * FROM user_indexes;
o d h
sub b) Click the Execute button.
Answer: 4
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b us
o
b arenfour
c) Note thatuthere t o
erows returned.
s s
d)ha leout( of iSQL*Plus
Log lice by clicking Logout in the top-right corner of the window. Then,
o d h b close the window by clicking X (Close icon) in the top-right corner.
sub
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.
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. a ble
fe r
$ sqlplus dba1/oracle @lab_08_01.sql
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub toeupdate
2. Make an attempt
n sethe same row in a separate session by running, in a separate
h a le window,licthe lab_08_02.sql script. Make sure you see the message “Update is
terminal
being attempted now” before moving on.
o d hb
sub a) Right-click the desktop and select Open Terminal to start another command shell.
Then enter the following to run the second script.
$ sqlplus dba1/oracle @lab_08_02.sql
3. Using the Blocking Sessions link on the Performance page, detect which session is causing
the locking conflict.
b) The first time you invoke the Performance page, a Software License Agreement is
displayed. Press [A] to accept and continue.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
iw S t
4. What was the last SQL statement
l e @
that the i s
blocking
h session executed?
a t
h .
a) Select the NGREENBERG
bh session,
u seand then click View Session.
b o d to
suhashcvalue e
nslink named “Previous SQL.”
b) Click (the e
e li
b hal
odh
sub
5. Resolve the conflict in favor of the user who complained, by killing the blocking session.
What SQL statement resolves the conflict?
o d h
sub
a) Close all open SQL sessions by entering exit, and then close the terminal windows.
Background: A new version of your application will include several reports based on very
long-running queries. Configure your system to support these reports.
1. Use the Undo Advisor to calculate the amount of undo space required to support a report
that takes two days to run, on the basis of an analysis period of the last seven days.
a) In Enterprise Manager, select Administration > Related Links > Advisor Central.
a ble
d) In the New Undo Retention field, enter 2. Then select days from the drop-down list.
fe r
a n s
e) Select Last Seven Days in the Analysis Time Period drop-down list. Results-of
n r
t the
analysis will be displayed. o
Note: The values that you see are likely to be different from those
s a n here.
shown
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
h a le lic
o d h bf) Question: What does the analysis recommend as “Required Tablespace Size for New
sub Undo Retention”?
Answer: 110 MB
g) Click OK.
2. Resize the undo tablespace to support the retention period required by the new reports (or 1
GB, whichever is smaller). Do this by increasing the size of the existing data file.
Answer: Add a new data file or increase the size of an existing data file.
c) To increase the size of the existing data file, select the data file, and then click Edit.
d) Enter the new value from step 1 (f) in the File Size field. Round off to the nearest 100
MB (not to exceed 1 GB). Make sure the box for “Automatically extend datafile when a ble
full” is not selected. Then, click Continue. fe r
a n s
e) Click Show SQL to confirm that the SQL statement looks similar to this: n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
f) Click Return, then click
h aApply e thi
le to implement your change.
. b
h to u s
o d
( s ub ense
h a le lic
o d hb
sub
Background: You have just been informed of suspicious activities in the HR.JOBS table in
your ORCL database. All maximum 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.
Log in as the DBA1 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 ble
a) Invoke Enterprise Manager as the DBA1 user in the SYSDBA role for your ORCL fe r
database. a ns
n- t r
o
an
b) Select Administration > Schema > Users & Privileges > Audit Settings.
s
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
c) Click the NONEo
b link. t o
( s u e n se
d) a
h On lic Parameters page, click the SPFile tab.
lethe Initialization
o d hb e) Enter audit in the Name field and then click Go.
sub
f) For the audit_trail parameter, select the XML value.
2. Because you changed a static parameter, you must restart the database. Do so by running
the lab_10_02.sh script.
Continue with the next step when you see that the database is restarted and the script has
exited out of SQL*Plus.
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. a ble
fe r
a
a) Click the Database home page tab to ensure that Enterprise Manager had time to updatens
n- t r
the status of the database and its agent connections. Because the database has been
restarted, you have to log in to EM again as the DBA1 user. a no
h a s
) > Audit
b) Then, select Administration > Schema > Users & Privileges
m e . Settings.
c o i d
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
h a le lic
o d hb
sub
c) Click the Audited Objects tab, and then click the Add button.
d) On the Add Audited Object page, ensure that the Object Type is Table, and enter
HR.JOBS in the Table field (or use the flashlight icon to retrieve this table).
e) Move DELETE, INSERT, and UPDATE into the Selected Statements area by double-
clicking each of them.
4. Provide input for the audit, by executing the lab_10_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.
6. Undo your audit settings for HR.JOBS, disable database auditing, and then restart the
database by using the lab_10_06.sh script.
7. Maintain your audit trail: Because you are completely finished with this task, delete all
audit files from the /u01/app/oracle/admin/orcl/adump directory.
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.
1. Make a copy of your listener.ora and tnsnames.ora files. They are in the
$ORACLE_HOME/network/admin directory.
b) If you previously saved the oracle username and oracle password as preferred
credentials for your host login, then they appear on the screen. If not, enter oracle as
Username and Password, select the Save as Preferred Credential check box, and then
click Login.
c) On the Local Naming page, click Create to enter a new network service name.
a ble
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
g) Click Add in the d h .b
Addresses
s
uregion.
o t o
ubareeasked,
Click No (ifsyou n se“Do you want to remember the values you filled in?”
h a le lic
o d h bh) On the Add Address page, select the following values:
sub - Protocol: TCP/IP
- Port: 1521
- 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>
j) Click OK.
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.
5. Test your changes to the network configuration by using SQL*Plus or iSQL*Plus. Again,
use: system/oracle@testorcl. To see your partner’s information, select the
instance_name and host_name columns from the v$instance table.
The Oracle SQL*Plus window opens. If you receive any errors or warnings, resolve them.
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
You should see your partner’s host@ iw s St
name.
h a le
e t hi
b SQL*Plus
c) Enter exit to exit.your
h u s session.
b d
o se t o
( u
s cenlistener to support connect-time failover. Use port 1561 for this
6. Create a LISTENER2
e li out of Enterprise Manager and run the lab_11_06.sh script to
b hal First,
listener.
configure
log
the NetProperties file.
o d h
sub a) Logout of Enterprise Manager.
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.
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.
h) Enter LISTENER2 as Listener Name, and then click Add to add a listener address.
a ble
fe r
a ns
n- t r
7. Start the LISTENER2 listener.
a no
a) Confirm that the LISTENER2 listener and Start/Stop Actions h a s selected, and then
are
click Go. m ) e.
o
g i c.c t Guid
b) Click OK on the Start/Stop page.
a relo uden
A confirmation message appears @
w Details
withi a View S t link.
le thi s
h a e
d h .bView Details
c) Optionally, click the usto return
link, review the listener status information, and use
the Back icon
b o t o
of your browser
e to the previous page.
u
(s icen s
l e l
b ha
o d h
sub
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
Automatic Database Diagnostic Management (ADDM) environment.
1. Create a new, locally managed tablespace called TBSADDM. Its addm1.dbf data file is 50
MB. Ensure that the TBSADDM tablespace does not use Automatic Segment Space
Management (ASSM). Execute the lab_12_01.sh script to perform these tasks.
4. Create activity to be analyzed. Execute the lab_12_04.sh script to perform these tasks.
a) In a terminal window, enter the following. You may have to press [Enter] after you see
that eight PL/SQL procedures have completed, in order to see the command prompt
again.
./lab_12_04.sh
5. In Enterprise Manager, review the Performance page as a user connected as SYSDBA. 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 to be analyzed.
Looking at the graph, you can already determine that this instance is suffering from
concurrency problems.
a ble
fe r
a ns
n- t r
a no
Note: Depending on when you run the workload, you may see differences between your
graph and the one provided as a possible solution. h a s
m ) e.
o id script forces the
After the spike is finished, execute the lab_12_05.sh
g i c.c script.
G uThis
t table.
r e loon yourenADDM
creation of a new snapshot and gathers statistics
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d c) After the spike has finished, in a terminal window, enter:
sub ./lab_12_05.sh
Note: The icon next to the cursor in this screenshot is a shortcut to the Automatic Database
Diagnostic Monitor (ADDM) page.
6. Look at the Performance Analysis findings in order of their impact. There are several
access paths to this information.
Looking at the Performance Analysis section, you see that the first finding (in the SQL
Tuning Recommendations category) has a 100% impact on the system. So your first
impluse 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 of your database.
Research the next finding under Schema Recommendations: Read and write contention of
database blocks was consuming significant database time. Here you are advised to use
the Automatic Segment Space Management (ASSM) feature for your ADDM table.
a ble
a) Navigate to the Database home page, and then click Advisor Central at the bottom of
fe r
the page.
a n s
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
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).
a ble
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a
impact on the system. So your first impluseriseltoolook
Looking at the Performance Analysis section, you see that
d e
at
nthe first finding has a 100%
this finding in more detail.
i w Stu
d) Click the SQL statements a l e@ thisignificant
consuming
s database time were found link.
. b h s e
o d h to u
( s ub ense
h a le lic
o d hb
sub
f) On the Automatic Database Diagnostic Monitor (ADDM) page, click the Read and
write contention of database blocks was consuming significant database time link .
This finding appears as type Schema under the Recommendations heading.
a ble
fe r
a n s
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub g) You are advised to use the Automatic Segment Space Management feature for your
ADDM table.
7. To implement the recommendation, you must re-create the object. Create a new, locally
managed tablespace, called TBSADDM2 with a 50 MB datafile, called addm2_1.dbf.
Ensure that the TBSADDM2 tablespace uses the the Automatic Segment Space Management
feature. Then, execute the lab_12_07.sh script to drop the ADDM table, to re-create it in
the new tablespace, to gather statistics and to take a new snapshot.
a) In Enterprise Manager, select Administration > Database Administration > Storage >
Tablespaces.
b) Click Create.
c) Enter TBSADDM2 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.
Oracle Database 10g: Administration Workshop I B - 66
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Solutions for Practice 12: Proactive Maintenance (continued)
e) On the Add Datafile page, enter addm2_1.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.
i) Click Show SQL to see the SQL that will be run, and then click Return. a ble
fe r
j) Click OK, and a successful Update Message appears. a ns
n- t r
k) In a terminal window, enter: a no
h a s
./lab_12_07.sh
m ) e.
o uid to the
c is identical
8. Execute your workload again. (The lab_12_08.sh g i c.script G
lab_12_04.sh script.) r e lo ent
i wa Stud
@following.
a) In a terminal window, enterlethe
h is You may have to press [Enter] after you see
a t
again. h . bh uhave
that eight PL/SQL procedures
se completed, in order to see the command prompt
b o d to
su cens e
(
./lab_12_08.sh
e
h al li
b
h9. In Enterprise Manager, review the Performance page as a user connected as SYSDBA. View
b o d performance data in real time with a 15-seconds refresh cycle. After a while, you should see
su a spike on the “Average Active Sessions” graph.
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_09.sh script. (The lab_12_09.sh
script is identical to the lab_12_05.sh script.) This script forces the creation of a new
snapshot and gathers statistics on your ADDM table.
a) Invoke Enterprise Manager as the DBA1 user in the SYSDBA role for your ORCL
database.
a ble
fe r
a ns
n- t r
c) After the spike is finished, enter the following in a terminal window:
a no
./lab_12_09.sh
h a s
m ) e.
o
10. Review the Performance Analysis on the Database home
g i c.c t Guid
page.
You see that there are no longer any schema-related recommendations. By moving the
ADDM table to the locally managed TBSADDM2 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.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
1. Log in to SQL*Plus as the DBA1 user and perform maintenance on tables in the HR schema
by running the lab_13_01.sql script.
a) Connect to the database as the DBA1 user and perform some maintenance on the
employees table by running the lab_13_01.sql script. a ble
fe r
a ns
$ cd labs
$ sqlplus dba1/oracle n- t r
SQL> @lab_13_01.sql
a no
h a s
m ) is taking
2. You get calls from HR application users saying that a particular query
e . longer than normal
to execute. The query is in the lab_13_02.sql script. o
.c Guid run it.
As the HR user,
i
g ntc
a) Enter the following in SQL*Plus , while r e l o
logged in e
as the HR user:
a
iw s S t u d
SQL> @lab_13_02.sql @
h a l e
e thi
.b locateuthe
3. Using Enterprise Manager,
d h s HR session in which the above statement was just
executed, and viewo t
b thensexecution
e o plan for that statement.
( s u e
a) a Enterpriselic
Inle Manager, click Search Sessions on the Performance tabbed page.
h
o d hb
sub
b) Change the Filter for the search criteria to “DB User,” enter HR in the field to the right
of that, and then click Go.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h bc) Click the SID number in the Results listing.
o d
sub d) You now see the Session Details page for this session. Click the hash value link to the
right of the Previous SQL label.
e) That shows you the SQL Details page 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.
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
f) You see in the Operation columnithat S t is doing a full table scan (TABLE
w this query
ACCESS FULL). Because
@ s
i the query’s condition is an equality
leyou knowththat
h a
b key e
comparison on the .primary
d h
key index.to
us(EMPLOYEE_ID), you decide to investigate the status
of the primary o
ub ense
( s
4. Using
h a leEnterpriselicManager, check to see the status of the EMPLOYEE table’s index on
h bEMPLOYEE_ID. See if it is VALID.
o d
sub a) Select Administration > Schema > Database Objects > Indexes.
g) Click the index link and note that the status of the index is UNUSABLE.
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.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
6. Using Enterprise Manager, reorganize all the indexes in the HR schema that are marked as
UNUSABLE.
b) Click Add, to add each of the other five indexes to the reorganization operation.
c) In the Add screen, choose Indexes for the Type drop-down list, and enter hr in the
Schema field.
d) Click Search.
e) Select the five other indexes whose names start with “EMP_.”
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
f) Click OK.
g) Click Next.
h) Keep all the default settings for Options, and then click Next.
i) Note that there are no problems reported on Impact Report, and then click Next.
j) On the Schedule page, enter oracle and oracle for Username and Password under
Host Credentials.
k) Click Next.
m) After the Confirmation page appears, click the job name to see its status. Click Reload
on your browser until you see the job has succeeded.
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
7. Return to the SQL*Plus session where the HR
r e o is logged
luser e n in, and run the
lab_13_07.sql script to execute the a
iwsamesbykind d
tuof query. Then, repeat the steps to see
the plan of the last SQL statement @
executed i Sthis session, to see if the plan has changed.
a l e t h
a) Enter the following h . bhthe SQL*Plus
at u se prompt:
b o d to
su cens e
(
SQL> @lab_13_07.sql
e
al li
b)h Repeat the tasks listed in step 3. Note that the plan now uses the index.
b
o d h
sub
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
DBA1 user. Please note the SID value for task 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, you
will notice that response time for Database Control is slower.
$ sqlplus dba1/oracle
SQL> @lab_13_09.sql
a ble
fe r
a n s
t r
on-
a) In Enterprise Manager, navigate to the Performance page, and investigate system
performance.
a n
a s
h load generation script
b) You may need to wait a minute or two to see the effects of)the
appear on the graphs. o m d e .
i c
c. t Gu i
g
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
h a le lic Wait to see the beginning of a
h b
o d spike in the Average Active
sub Sessions graph before
proceeding.
Question 1: In the Average Active Sessions graph, which are the two main categories that
active sessions are waiting for?
Question 2: In the Configuration category of waits, what is one of the contributors to the
wait time? Click Configuration to see the graph.
Question 3: Click Back, and then click Physical Writes on the Instance Disk I/O graph.
Determine which process is doing the most writing to the disk.
a ble
Answer: DBW0 fe r
a ns
c) Click Back. n- t r
a no
d) Click Top Activity in the Additional Monitoring Links region.
h a s
) e.
mTop
e) Click the SQL ID of the first SQL statement listed c inothe
i c . GuiSQL d region.
f) See the first SQL statement. l o g nt
e
ar tude
Question 4: What SQL statement @
i w
is causingistheS most waits?
a l e t h
Answer: delete from h . bhsh.sales_copy
u se
b o d to
su that s e
isngenerating
l e (
10. Kill the session
i c e the load. Use the session ID recorded in step 9. The
h a
session ID l
should be listed at the top of the list on the right side of the page, under the Top
b
h Sessions region.
b o d
su a) Click the SID number for the session ID recorded earlier. This is found under the
heading Detail for Selected 5 Minute Interval.
b) On the Session Details page, click Kill Session, and then click Yes to confirm.
Note: If you remain on this Session Details page long enough for a few automatic refreshes
to be done, you may see the following warning, which means you are attempting to refresh
information about a session that’s 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 session
a ble
activity in the database has declined considerably. fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
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.
a) Invoke Enterprise Manager as the DBA1 user in the SYSDBA role for your ORCL
database.
b) Select Administration > Database Administration > Storage > Control Files.
a ble
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b us
o
c) Question 1:bHow would t o
e you add another control file if you needed to?
s u
( iaccontroln s
e file is a manual operation. To perform this, you must:
l
Answer
a e: Addingl
h
o d h b - Shut down the database
sub
- Use the operating system to copy an existing control file to the location where you
want your new file to be
- Start the database by using Enterprise Manager. Unlike a normal startup, you would
use Advanced Options to select a different startup mode. Select “Start the instance” to
leave the instance in the NOMOUNT state.
- Edit the CONTROL_FILES initialization parameter to point to the new control file
- Continue the STARTUP database operation until the database is in an open state
Note: This answer does not apply to an OMF database, as the control files in that case
would have to all be recreated.
2. Check how many members each redo log group has. Ensure that there are at least two redo
log members in each group. In what directory or directories are the redo log files stored?
a) Select Administration > Database Administration > Storage > Redo Log Groups, and
note how many members are in the “# of Members” column. There should be two per
group.
a ble
fe r
a
b) Select the first group, and then click Edit to see the member file names. Note that onen s
n-
member is in directories under the oradata directory, and another is in the Flash
t r
o
Recovery Area. Click the browser’s Back button.
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h bNote: In a production database, you want to ensure that the two members are on different
o d hard drives, preferably with different disk controllers, to minimize the risk of any single
sub hardware failure destroying an entire log group.
3. 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 recovery, and in
the event of a failure, you will lose all data since your last backup. Place your database in
ARCHIVELOG mode, so that redo logs will be archived.
c) In the Media Recovery region, select the ARCHIVELOG Mode check box.
d) Verify that Log Archive Filename Format contains %t, %s, and %r.
4. Configure redundant archive log destinations—one to the Flash Recovery Area and the
other to /u01/app/oracle/archive.
a ble
fe r
a n s
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Notice that the database is preconfigured to save archived logs to the Flash Recovery Area
by default (Archive Log Destination 10). Add an additional Archive Log Destination so that
you will have redundant copies of your log files.
Note: You must create the directory, if it does not already exist. You already did this in
step (3).
b) Optionally, click Show SQL, review the statements, and then click Return.
c) Click Apply. When prompted whether you want to restart the database now, click Yes.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d d) Enter the credentials to restart the database, and then click OK.
sub e) When asked to confirm, click Yes again.
Now that your database is in ARCHIVELOG mode, it will continually archive a copy of
each online redo log file before reusing it for additional redo data.
Note: Remember that this consumes space on the disk and that you must regularly back up
older archive logs to some other storage.
Background: Your database is ready to move from development and test into production.
Ensure that your database is configured so that recovery is possible without loss of data.
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.
b) Scroll to the bottom and enter oracle and oracle for Host Credentials Username
and Password for your server.
4. 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.
Question: What prerequisite must be met to create a valid backup of a database without
shutting it down?
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) Select Maintenance > High Availability > Backup/Recovery > Schedule Backup.
e) Select Full Backup for your Backup Type, and select the Use as the base of an
incremental backup strategy check box.
g) In the Advanced region, deselect the Also backup all archived logs on disk check
box, and then click Next to continue.
h) Select Disk for your backup location (notice that your Disk Backup Location is retained
from step [2]). Click Next to continue.
i) Accept all the defaults on the Schedule page, and then click Next to continue.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d Click Submit Job to perform the online database backup.
sub
j)
k) Click View Job to monitor the status of the backup job. This backup takes
approximately five minutes to complete.
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b us online backups for your whole database, without
o
5. Schedule nightlyodisk-based tincremental
s ubSchedule
archived (logs.
e n sitefor 11:00 p.m. The schedule should be in effect indefinitely.
h a le lic
o d h ba) In Enterprise Manager, select Maintenance > High Availability > Backup/Recovery >
Schedule Backup.
sub
b) Select Whole Database as the object to be backed up.
c) Enter oracle and oracle for Host Credentials Username and Password for your
server, and then click Schedule Customized Backup.
f) In the Advanced region, deselect the Also backup all archived logs on disk check
box, and then click Next to continue.
g) Select Disk as your backup location, and then click Next to continue.
h) Change Job Name to Nightly_Backup and accept the default value for Job
Description.
i) Select Later in the Start region. Accept today’s date and use the drop-down lists and
option buttons to select 11:00 p.m. for Time.
k) Select Indefinite in the Repeat Until region, and then click Next.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
m) Navigate to Maintenance > Related Links > Jobs to see the scheduled job in the Job
Activity list.
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. SQL script files are provided for you in the /home/oracle/labs directory. If
needed, use appendix C for Linux and appendix D for SQL syntax. Note that where OS file
names are mentioned, your system may possibly have different file names than shown here.
a) As the DBA1 user, run the lab_16_01_a.sql script to prepare some procedures to
be called by the rest of this practice.
@$HOME/labs/lab_16_01_a.sql
a ble
fe r
b) Now run the lab_16_01_b.sql script. This script deletes one of your control files.
a ns
n- t r
@$HOME/labs/lab_16_01_b.sql
a no
c) The Help desk begins receiving calls saying that the databasehappearsa s to be down.
Troubleshoot and recover as necessary. Use Enterprisem ) eDatabase
Manager’s . page to
c o i d
attempt to start up the database, and use SQL*Plus,
g i c. if needed.
t G u
- In Enterprise Manager, navigate to thea elo dpage.
rDatabase e n It reports that the database is
down and offers you the chance to
u Attempt to do so by clicking
iwstart sit upStagain.
Startup. You may needa tole
@ hitwo minutes before the page appears as
wait onetor
described. If you see h e
.ba Connection
s Refused message, ignore it; the connection will
d h
eventually beoestablished.t o u
u b
s credentials s e
l e
- Enter
(host
l i c en as oracle for Username and Password, and then click OK.
b ha
o d h - When asked whether you are sure that you want to start the database, click Yes.
sub
d) The startup of the instance fails with Enterprise Manager, and you can get no other
information to explain the failure. So use the command-line tools.
- Connect to the instance with SQL*Plus as sysdba and check the current status of the
instance.
sqlplus / as sysdba
select status from v$instance;
- The instance status is STARTED, which means that the database is in the NOMOUNT
stage. Attempt to mount the database by entering this:
a ble
SQL> alter database mount;
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
e) The instance cannot move to the@ iw s Stbecause it cannot find one of the control
mountistage
a leof the alert
files. Check the last 10hrows th log to see which control file is the problem.
b e
o d h. to us
SQL> host
( s ub tail
e n e $ORACLE_BASE/admin/orcl/bdump/aler*
s-10
h a le lic
o d h b Output:
sub SQL> host tail -10 $ORACLE_BASE/admin/orcl/bdump/aler*
ORA-205 signalled during: ALTER DATABASE MOUNT...
Sun Oct 30 13:35:01 2005
alter database mount
Sun Oct 30 13:35:01 2005
ORA-00202: control file:
'/u01/app/oracle/flash_recovery_area/ORCL/controlfile/o1_mf_1p4sbncs_.ct
l'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Sun Oct 30 13:35:01 2005
ORA-205 signalled during: alter database mount...
f) The control file in the Flash Recovery Area is missing. Restore the missing control file
by copying the existing control file, and then mount and open the database.
SQL> host
$ cd /u01/app/oracle/oradata/ORCL/controlfile
$ ls -l
total 6908
-rw-r----- 1 oracle oinstall 7061504 Oct 30 13:32 o1_mf_1p4sbn1o_.ctl
$ cp o1_mf_1p4sbn1o_.ctl
/u01/app/oracle/flash_recovery_area/ORCL/controlfile/o1_mf_1p4sbncs_.ctl
$ exit
a) Start a SQL*Plus session as the DBA1 user, and run the lab_16_02.sql script. This
script deletes one of your application data files.
$ sqlplus dba1/oracle @$HOME/labs/lab_16_02.sql
b) The Help desk has received a call from a user who is unable to access the COUNTRIES
table in the HR application schema. Count the rows in the table to see whether there is a
problem.
o d h
sub d) Recover the data file to the current time, specifying the missing data file to be
recovered.
- In the Object Level Recovery region, select Recover to current time for the
Operation Type.
- Enter the host credentials as oracle and oracle for Username and Password,
and then click Perform Object Level Recovery.
- Click Next.
- Because the problem is simply a deleted file rather than a bad hard drive, there is no
need to restore the file to a different location. Select No. Restore the files to the
default location, and then click Next. le
r a b
- Click Submit. (It will take one or two minutes for the operation to complete.)
ns fe
t r a
n-
e) When you see the Operation Succeeded message, ensure that the restored data file is
no
online.
s a
h a
) Administration
- In Enterprise Manager, select Administration > Database
o m d e . > Storage
> Datafiles.
i c
c. t Gu i
g
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
COUNT(*)
----------
25
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 database
closed, whereas recovery of an application data file can be done with the database open and
available to users.
b) As SYSDBA, run the lab_16_03.sql script. This script deletes the system data file.
SQL> @lab_16_03.sql
a ble
PL/SQL procedure successfully completed. fe r
a ns
ORACLE instance shut down.
n- t r
SQL>
a no
h a s
c) In Enterprise Manager, review the Database home page. The ) e. is shut down, so
database
you click Startup to try to open it. If you see a message m
co inthattheusays
d the connection was
ibrowser.
refused, dismiss it, and reenter the EM home g i
pagec.URL t G
r e l o e n
- Enter the host credentials as oracle
i tud for the host Username and
wa andSoracle
Password, and enter DBA1le @oracle
and
h isfor the database credentials, and then click
a t
OK.
h . bh use
b o d to
su cens e
e (
l li
h bha
o d
sub
- Click Yes.
Background: You decide to gain hands-on experience in some of the flashback functionality.
To avoid impacting other users, you will first copy the DEPARTMENTS table of the HR schema
to DEPARTMENTS2.
1. Log in to SQL*Plus as DBA1 user and create a new HR.DEPARTMENTS2 table based on
the HR.DEPARTMENTS table.
3. Use the FLASHBACK TABLE command to restore the table. Count the rows in the
DEPARTMENTS2 table.
4. Run the lab_17_04.sql script to insert three rows into the HR.DEPARTMENTS2 table
by using three separate transactions. The new rows have DEPARTMENT_ID values of 280,
290, and 300.
SQL> @lab_17_04.sql
5. Use Enterprise Manager to perform flashback to the version of the table where only the first
of the three new rows is present (with DEPARTMENT_ID = 280). First, evaluate row
changes to decide on a point in time. Limit your analysis to the new rows just added: where
department_id >= 280. If you receive an error while performing the flashback, you
may need to enable row movement on the table. See the next step.
a ble
a) In Enterprise Manager, select Maintenance > High Availability > Backup/Recovery >
fe r
Perform Recovery.
a ns
n- t r
o
b) Select Tables from the Object Type drop-down list, and then select Flashback
an
Existing Tables for Operation Type. Click Perform Object Level Recovery.
s
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
c) Select Evaluate row changes and transactions to decide on a point in time, and enter
HR.DEPARTMENTS2 as the fully qualified name of the table in the Table field, and
then click Next.
Oracle Database 10g: Administration Workshop I B - 96
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Solutions for Practice 17: Performing Flashback (continued)
d) Highlight DEPARTMENT_ID under Available Columns, and then click the Move
button to move it under Selected Columns. Under Step 2, enter a WHERE clause that
will select the added rows. For example, earlier you added rows with
DEPARTMENT_IDs of 280, 290, and 300, so the “WHERE department_id >=
280” clause is suitable.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
e) a
h le Next toliccontinue.
Click
o d hb f) You can now review the rows under Flashback Versions Query Result.
sub
g) Under Flashback Versions Query Result, select the middle transaction from the list to
flash back. Click Next to continue.
h) On the next page, you are asked to include any tables related to or dependent on the
table that you are flashing back. Because there are none, click Next to continue.
a ble
fe r
a n s
n- t r
a no
h a s
i) Review the SQL statement that you are about to execute. Click) Show . SQL, view the
SQL statement, click OK, and then click Submit. com e
g i c. t Guid
a relo uden
@ iw s St
h a le
e t hi
h b that the
6. On the next page, you .find
u soperation has failed because row movement is not
b o d
enabled for the table. You may
t o recall from the lesson that row movement must be enabled
su tocwork.
for this feature ns e
e ( e
a)ha
l li
Note this error:
h b
b o d
su
b) To enable row movement for this table, select Administration > Schema > Database
Objects > Tables.
c) Enter HR in the Schema field and DEPARTMENTS2 in the Object Name field, and
then click Go.
d) One table is displayed in the Results region and is selected by default. Click Edit.
Repeat step 5 to perform the version flashback of the table. Because row movement has
been enabled, it should succeed this time.
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Background: In the recent past, you received a number of questions about the HR schema. To
analyze them, without interfering in the 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 find out that the only database for which the management approves an import
for, is the ORCL database. So you perform the import with the Data Pump Wizard, remapping
the HR schema to a newly created HR_TEST schema in the HR_TEST tablespace. To follow
best practice guidelines, you also decide to create a DP user who will be a DBA performing
Data Pump jobs. For your convenience in class, the creation of the DP user is included in the
lab_18_01.sql script. SQL scripts are in the /home/oracle/labs directory. However,
there is one step missing. a ble
fe r
Then, you receive two data load requests for which you decide to use SQL*Loader. a ns
n- t r
1. Review the lab_18_01.sql script, which creates the HR_TEST tablespace, the
a no
HR_TEST_ROLE role, and the HR_TEST and DP users. h a s
m ) e.
a) Double-click the oracle’s Home icon on your desktop, o uid labs, and then
.c double-click
double-click lab_18_01.sql to reviewlo g i c
this script.nt G
a r e de
i w t u
l e @ his S
b) Note the passwords for these users.
HR_TEST password: . b ha se t
hr_4test
o d h to u
( s ub dp_4test
DP password:
e n se
h a le l ic
h bc) Which additional step do you need to perform to allow the DP user access to Enterprise
o d Manager as Administrator?
sub
You need to log in to Enterprise Manager as the SYS user in the SYDBA role and make the
DP user an EM Administrator (as you learned in the lesson titled “Managing the Oracle
Instance”).
2. Execute the lab_18_02.sh script. Then, perform the required step to make the DP user
an EM administrator.
a) Right-click your desktop and select Open Terminal. Then navigate to the
/home/oracle/labs directory by entering cd labs.
d) Make the DP user an EM Administrator (as you learned in the lesson titled “Managing
the Oracle Instance”). (Select Setup > Create > Enter Name: DP, Password:
dp_4test, Super Administrator, checked > Click Finish > Finish > Logout.)
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
3. Log in to Enterprise Manager as the DP user in the Normal o
.c Guand
role id export the HR schema.
i
g ntc
a) Invoke Enterprise Manager as the DP user e
r thel o
in e role for your ORCL database.
The Connect As setting should be
a
iwNormal. t u dNormal
@ i s S
l e t h
If this is the first time that
. b htheaDP user
s e logs in, click I agree to accept the licensing
agreement.
o d h to u
b) Select ( s ub ens>eData Movement > Move Row Data > Export to Export Files.
Maintenance
h a le lic
o d h bc) Select Schemas, enter oracle as Username and Password, select Save as Preferred
sub Credential, and then click Continue.
d) On the Export: Schemas page, click Add, select the HR schema, and then click the
Select button.
e) Click Next.
f) On the Export: Options page, select DATA_PUMP_DIR from the Directory Object
drop-down list, and enter hrexp.log as Log File.
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.
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
a ble
Export Wizard helped you to create.
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
A processing message appears, and then a success message. If not, resolve any errors,
which may have occurred.
l) When the Job Activity Confirmation page appears, click the HREXP job name, and
then monitor the job progress by clicking the browser’s Reload button.
Note: Please wait, not only for the job to be created, but also for the job to complete
execution. (It may take two minutes.)
4. As the DP user, import the exported HR schema back into the ORCL database, remapping it
to the previously created HR_TEST schema.
Oracle Database 10g: Administration Workshop I B - 103
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Solutions for Practice 18: Moving Data (continued)
a) Invoke Enterprise Manager as the DP user in the Normal role for your ORCL database.
b) Select Maintenance > Data Movement > Move Row Data > Import from Export
Files.
c) On the Import: Files page, select DATA_PUMP_DIR from the Directory Object drop-
down list, and enter HREXP%U.DMP as File Name.
a ble
At this point, the export file is read, to verify the contents. Wait for this to complete.
fe r
a ns
f) On the Import: Schemas page, click Add, select HR, and then click Select.
n- t r
g) Click Next. a no
h a s
h) On the Import: Re-Mapping page, click Add Another m ) undereRe-Map
Row . Schemas.
Then select HR_TEST as Destination Schema. c. c o u i d
g i t G
lo en , enter HR_TEST as Destination
reTablespaces
Tablespace. i w Stud
i) Click Add Another Row under Re-Mapa
a l e@ this
h . bh use
b o d to
su cens e
e (
l li
h bha
o d
sub
j) Click Next.
k) On the Import: Options page, select DATA_PUMP_DIR from the Directory Object
drop-down list, enter hrimport.log as Log File, review the advanced options, but
leave them at their default values, and then click Next.
l) On the Import: Schedule page, enter hrimp as Job Name and Import HR schema
for test purposes as Description.
m) Select Later as Start and enter a time between 2 and 5 minutes from now (to give
yourself time for the following steps):
- Click Next.
a ble
- On the Import: Review page, review the PL/SQL that the Data Pump Wizard creates
fe r
for you, and then click Submit Job.
a ns
n- t r
no
- After the confirmation that the job was successfully created, note the job name (for
a
example HRIMP), and navigate to Maintenance > Data Movement > Move Row
s
Data > Monitor Export and Import Jobs. h a
) e.
o m
- Click your last job (for example, HRIMP). gic.
c
G uid
r e lo ent
- On the “Monitor Data Pump job”wpage,
i d in your browser, when it is time
a clicktuReload
S
to execute your job.
a l e@ this
h . bh use
b o d to
su cens e
e (
hal li
h b
o d
sub
- Optional (continued): Click Suspend and later Resume to halt the job and then to
continue it again.
a ble
fe r
n) In the end, you want to see that your job executed 100% without any errors.
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
o) Click OK.
Note: You may see an error saying that the hr_test object already exists. This is because
that user existed when you did the export, and still exists. This is not a problem.
r) Select data from tables in the hr_test schema, for verification of the import.
SQL> select * from jobs;
Oracle Database 10g: Administration Workshop I B - 106
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Solutions for Practice 18: Moving Data (continued)
5. As the DP user, load data into the PRODUCT_MASTER table by using SQL*Loader via
Enterprise Manager Database Control.
a) Invoke Enterprise Manager as the DP user in the Normal role for your ORCL database.
b) Select Maintenance > Data Movement > Move Row Data > Load Data from User
Files.
d) If you have not done so before, enter oracle as Username and as Password, click
Save as Preferred Credential, and then click Continue.
a ble
fe r
e) On the Load Data: Control File page, enter
a ns
/home/oracle/labs/lab_18_05.ctl as control file name and path, or use the
n- t r
flashlight icon to select this control file. Click Next.
a no
f) On the Load Data: Data File page, click Provide the full path h a s name on the
and
m
database server machine and enter /home/oracle/labs/lab_18_05.dat
) e. as
. c o u i d
data file name and path, or use the flashlight icon
l o gicto select
n t Gthis data file. Click Next.
e Conventional
raccept e
g) On the Load Data: Load Method page,
i w Stud
a Path, and then click Next.
l @ accept
epage, h isall defaults, but enter
h) On the Load Data: Options a t
h . bh use
/home/oracle/labs/lab_18_05.log as log file name and path.
o d t o
i) Review ( s ubadvanced
the e n seoptions, but do not change any, and then click Next.
h a le lic
h b
o d
sub
a ble
fe r
a ns
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
k) On the Load Data: Review page, ireview t
w theSloading information and parameters, and
then click Submit Job. ale
@ h i s
h e t
. b s
u your lab_18_05.log file in your
h by tviewing
o d
l) Confirm your results o
s ub ense directory.
/home/oracle/labs
(
6. As
h a le
the INVENTORYlic user, load data into the PRODUCT_ON_HAND table by using
h bSQL*Loader command line.
o d
sub a) Invoke a terminal window and navigate to the /home/oracle/labs directory.
b) Enter the following SQL*Loader command (in continuation, without pressing [Enter]
before reaching the end of the command): sqlldr
userid=inventory/verysecure control=lab_18_06.ctl log=lab-
_18_06.log data=lab_18_06.dat.
sqlldr userid=inventory/verysecure control=lab_18_06.ctl
log=lab_18_06.log data=lab_18_06.dat
Congratulations!
You completed all practices for the
Oracle Database 10g: Administration Workshop I
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
___________________
Appendix C
Basic Linux and
vi Commands
___________________
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
ab le
To edit a file from SQLPlus prompt, edit <filename> (press enter), from the Linux command prompt, vifer
<filename> (press enter) a n s
n -t r
o
To MOVE the cursor:
s an
h - move left j - move down k - move up
)l -h a right
move
c o m ide.
w - one word forward b - one word backward
g i c. t Gu
e - end of current word
relo uden
W, B, or E - same as lower case but ignores punctuation
a
iw$ - end S t
@
0 (zero) - Move to beginning of current line s of current line
h a le
e thi
G - go to last line of file
d h .b u s H - go to top line on the screen
b oscreen se t o
( s u
L - go to last line on
e n M - go to middle line on the screen
a
/<string>
h lic to the next occurrence of <string>
le- Search forward
h b
b d
o ?<string> - Search backward to the next occurrence of <string>
s u
n - Repeat previous search N - Repeat previous search in opposite direction
<ctrl> f - Scroll forward one page <ctrl> b - Scroll backward one page
u - Will undo the most recent change. U - Will undo the most recently deleted text.
:e! - re-edit current file without saving any changes made since last change
A - Append text to the end of a line (jumps to end of line and begin appending).
c - Change object C - Change from current cursor position to end of the line
i - Insert text before the current cursor position. I - Insert text at the beginning of a line.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
o - Insert a blank line BELOW the current cursor position.
r - Replace character at current cursor position R - Replace all characters until <ESC> is pressed
options include: g (change all occurences on current line) c (confirm prior to each change)
p - Put buffer contents after cursor P - Put buffer contents before cursor
zz - Will terminate edit mode. :w filename - Will save changes to the filename specified.
ZZ - Will terminate edit mode. :q! - Will terminate the file without saving changes.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
man.
fe r
Command info <command> Show the information system entry
a n s
information t
for this command. Using info
n- r
no
info shows a tutorial of the info
a
documentation system.
s
Print to cat <file> h
) and a
standard out
Concatenate
o m d e . print – print the
i c
c. named i
u to the terminal screen.
file
g t G
List users cat /etc/password
a r elo den
Change
working
cd <directory>
@ iw s Stu Change working directory to
specified directory
a l e t h i
directory
h . bh use cd with no parameters changes to
$HOME.
o d t o
Copy a file ubcp <source_file>
se Copy a source file to a destination
( s e n file.
h a le l ic <file>
<destination_file>
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 a ble
dangerous. Often the rm fe r
a n s
command is aliased with -rm
n r
t –i
The option –i asks n o
‘Are you sure?’
Create an empty Create a file.s a
ha
touch <file>
file )
m theidname e .
Name of the hostname c o
. Gu
Returns of the machine.
machine g i c t
The IP address host <machine_name> are
lo eQueriesn
i w t u d the Domain Name Server,
of the machine
l e @ his S and returns the IP address of the
h a e t machine name.
Remote shell rsh h b
<host> us
. <command> Execute a <command> on <host>.
o d
bssh <host> t o Rsh is not secure, use ssh instead.
s u n s e
a l e ( lice
Remote shell Secure shell, has features to
replace rsh, rcp, ftp, and telnet.
b h
o d h Remote shell telnet <host> Start a terminal session on <host>.
sub Telnet is not secure use ssh
instead.
Search a file for grep <option> <pattern> <file> Search a <file> or stream for a
a pattern regular expression defined by
<pattern> and show the line that
contains that pattern. A common
option is –i for case insensitive.
grep can accept input from a file
or stdin through a pipe as in:
netstat –a| grep ESTABLISHED
Source a script . <script_file> In the bash shell this command ‘.’
forces the script to run in the shell.
Normal behavior is for the script
to run in a child shell.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 a ble
editor many possible commands and fe r
options that are very good for a ns
n- t r
editing from a shell script.
o
Visual editor vi <file> an
Terminal based editor available on
s
ha
every Unix system, Linux provides
)
c o m ide.
vim, an improved vi, that is a
g i c. t Gu
superset of vi.
Gnu editor
relo uden This is a GPL editor with
emacs <file>
a
iw s St extensive customizable features
@ available on most UNIX and
h a le
e thi Linux distributions.
WSIWIG editor gedit h b
.<file> us A full-screen editor, requiring X.
o d t o
( s ubkateen<file>
se Available under Gnome.
WSIWIG A full-screen editor, requires X.
h a le lic Available under KDE
o d hb Terminal output
stdout Standard out (stdout), is not a
sub command but a concept, most
Linux commands write to stdout
by default unless redirected.
Terminal input stdin Standard in (stdin), is not a
(keyboard) command but a concept, most
Linux commands read from stdin
by default unless redirected.
Alias alias <command> <alias> Make a substitution when a user
types <command> substitute and
execute <alias>, common alias is
alias ‘rm’ ‘rm –i’. These aliases
are set in the .bashrc file.
Show shell set Prints all of the variables that are
variables currently defined in the shell.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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.
a ble
Clock An X client that shows a clock on fe r
xclock
a ns
the screen. Often used to test the X
n- t r
windows system. o
X access xhost an
Show the current access control in
s
control xhost +<Xclient>
ha
place.
)
c o m ide.
Add a Xclient that is allowed to
g i c. t Gu
access the local DISPLAY, if no
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
System Linux Commands Description / Comments
Administration
Root file system / The root directory for the system
directory tree.
Home Directory /home Typically the directory in which
all user home directories placed.
For example: /home/oracle.
Tmp directory /tmp A temporary storage area. Do
notput anything here you want to
keep. SA often have a cron job to a ble
fe r
remove everything periodically.
a ns
Boot directory /boot t r
A small partition to hold the kernel
n-
o
image(s) and boot loader
an
instructions.
s
Log directory /var/log ha
The location of most system log
)
c o m ide.
files.
Sample /etc/inittab g i c. t Gu
Configuration files are located per
configuration
a relo uden the application. Any configuration
files
@ iw s St file that you change after
h a le
e thi installation should be included in
the backup.
d h .b us
Password files /etc/passwd
o t o The /etc/passwd file holds
( s ub/etc/shadow
e n se user information and must be
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 /etc/anacrontab Edit the file to specify a script to
script to run at a run at a particular frequency (see
particular man anacrontab for details).
frequency
Schedule a at <options> TIME Runs a job specified by <options>
command to run at a specified TIME parameter. a ble
at a single fe r
specified time a n s
n- t r
Schedule a batch <options> <TIME> o
Run a command when the load
command an
average drops below .8, optionally
s
ha
after a set TIME.
)
Mount a file m ide.
mount <opt> <dev> <mount_point> Mount a file system on device
c o
system
g i c. t Gu
<dev> at <mount_point> with the
Maximum # of 65535 h a e
d h .b us
user ID
o t o
( s ub ense
Recover root {lilo} This is a procedure to recover the
hal
e
password lic
control-x
linux S
root password if is lost. This
h b passwd root requires physical access to the
o d machine and system console. You
sub start by rebooting the machine,
then during the LILO boot press
{grub}
and hold [Ctrl] + [x] to get a
c prompt and command LILO to
kernel vmlinuz-2.4.9-13 single boot linux to runlevel S.
ro root=/dev/hda8
initrd /initrd-2.4.9-13.img The second procedure uses the
boot
passwd root grub boot loader.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 a ble
manually changed with chown. fe r
a ns
Change run init <runlevel> The init command causes the
n- t r
levels o
rcN.d scripts to be evaluated, for
an
the change in run level. init 6
s
ha
forces a reboot.
)
Synchronize the sync c o m ide.
Forces the buffer cache and page
disks g i c. t Gucache to write all dirty buffers to
a relo uden disk. Used just before a reboot to
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
issued the login prompt.
fe r
YP/NIS service /sbin/ypbind n
Finds and attaches to a NIS server
a s
binder n- t
for name resolution and otherr
services.
a no
Module modinfo <options> <module>
h a s
Display information about kernel
information ) e.
modules: –l shows license, –p
m
o
.c Guid
parameters, –d description.
g i c
List modules lsmod
r e lo ent Show currently loaded modules.
Load module insmod
i w a
S t ud Load a loadable module.
Unload module rmmod
a l e@ this Unload a loadable module.
Install Software rpm -ivh
h . bh use
package
Install –i, verbose –v, with
b d
o se t o progress hash marks –h.
Uninstall (s u rpm
e n
-e package Erase package –e; will not
l e l i c
b hainstalled rpm -qa
software uninstall if dependencies exist.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 a ble
fe r
Parameter s
option reads the setting from a file
a n
n- t r
and sets them. The default file is
o
an
/etc/sysctl.conf
Set Process ulimit <option> <value> Set limits on a shell and processes
s
limits ha
started by the shell. Users can
)
c o m ide.
make limits more restrictive;
g i c. t Gugenerally only root can make limit
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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. a ble
fe r
statistics
a n s
Virtual Memory cat /proc/meminfo Shows instantaneous virtual -t r
statistics memory usage. non
Kernel Cache cat /proc/slabinfo s a statistics:
Kernel slab allocator
statistics frequently
a
) h allocated cache objects
m .
i c .csuch ideIO
o as uinode,
asynchronous
dentries, and
buffers.
l o g n t G
I/O statistics iostat <option> <interval>
a re udeOptions: –d device activity, –c
<count>
@ iw s St CPU activity, –x extended disk
h a le
e thi activity statistics. The interval is in
seconds.
d h .b–P <cpu>
u s<count>
Multiprocessor mpstat
b o e t o Return CPU statistics for
Statistics su ns
<interval> particular processor or all CPUs in
e ( c e
h a l l64i GB(Theoretical) an smp system.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 le
cat /proc/ide/ide0/hda/model View IDE disk information. r a b
Print network netstat <options> Print a wide variety of network
ns fe
t r a
statistics
n-
statistics (see man netstat).
o
Graphical
system statistics
xosview
s an
An X-based display of recent OS
statistics.
viewer ) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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)
@ iw s St up.
Journal ext3
h a le
e t hi
Filesystem
d h .b us
types
b
reiserfs
o t o
Disk Label(su fdiskns -le fdisk is not available on all
e li c e
b h al distributions.
o d h Extend File
system
resize2fs Extending a file system is
applicable to only some file
sub resize_reiserfs
system types.
Backup tar cvf /dev/rst0 / Create a backup of the root / file
system.
Restore tar xvf /dev/rst0 Restore the root / file system.
Prepare boot /sbin/lilo Must be run after changing
volumes /etc/lilo.conf to push
changes to boot loader.
Startup script /etc/rc.d/rc
Kernel /boot/vmlinuz
Kernel Bits getconf WORD_BIT POSIX call to get kernel
information. There are many other
variables besides WORD_BIT.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
@ iw s St /mnt/cdrom.
CDROM file iso9660
h a le
e t hi
type
d h .b us
Floppy drive
b o
/dev/fd0
e t o Usually mounted at
u
(s /proc en s /mnt/floppy.
a
Systeml e l i c The /proc filesystem is a memory-
b h
o d h information based file system that allows
access to process and kernel
sub settings and statistics.
Compile and make –f <file> <command> Use a make file <file> to
link a determine which parts of a large
executable program need to be recompiled,
and issue the commands required
to compile, link, and prepare the
executable for use.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
multiple disks. fe r
volume group ns
A set of physical disk partitions created by
a
n-
fdisk or the like, initialized witht r
o
an
pvcreate, then grouped into a physical
s
ha
volume with vgcreate.
)
Display volume vgdisplay -v
c o m ide.
group
g i c. t Gu
Modify physical
volume
pvchange
a relo uden
@ iw s St
Prepare physical pvcreate
disk h a le
e thi
List physical d h .b us
pvdisplay
o t o
volume
( s ub ense
Remove
h a ic
ledisk lvgreduce
from volume
o d hb group
sub Move logical pvmove
volumes to
another physical
volumes
Create volume vgcreate
group
Remove volume vgremove
group
Volume group vgchange
availability
Restore volume vgcfgrestore
group
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Exports volume vgexport
group
Imports volume vgimport
group
Volume group vgscan
listing
Change logical lvchange
volume
characteristics
List logical a ble
lvdisplay
fe r
volume
a ns
Make logical lvcreate
n- t r
volume o
Extend logicallvextend s an
volume ) ha
Reduce logical c o m ide.
c. t Gu
lvreduce
volume g i
Remove logicallvremove
a relo uden
volume
@ iw s St
Create stripedlvcreate -i le3 -I 64thi
h a
volumes h . b u se
b o d to
su cens e
e (
hal li
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
____________________
Appendix D
SQL Statement Syntax
____________________
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
Table 1: Syntax for SQL Statements fe r
a ns
SQL Statement Syntax n- t r
o
ALTER CLUSTER ALTER CLUSTER [ schema. ]cluster
s an
ha
{ physical_attributes_clause
)
| SIZE size_clause
c o m ide.
g i c. t Gu
| allocate_extent_clause
| deallocate_unused_clause
relo uden
| { CACHE | NOCACHE }
a
}
@ iw s St
[ physical_attributes_clause
h a le thi
| SIZE size_clause
e
d h .b us
| allocate_extent_clause
o t o | deallocate_unused_clause
hal
e lic [ parallel_clause ] ;
h b
b d
o ALTER DATABASE ALTER DATABASE [ database ]
s u { startup_clauses
| recovery_clauses
| database_file_clauses
| logfile_clauses
| controlfile_clauses
| standby_database_clauses
| default_settings_clauses
| redo_thread_clauses
| security_clause
} ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 ]... ]
a ble
}
fe r
[ DROP
{ LEVEL level
a ns
[ RESTRICT | CASCADE ]
n- t r
| HIERARCHY hierarchy
a no
| ATTRIBUTE attribute
h a s
[ LEVEL level [ COLUMN column
m ) e.
[, COLUMN column ]... ]
o
c.c t Guid
}
]...
g i
| COMPILE
a relo uden
iw s St
} ;
@
ALTER DISKGROUP h a
ALTER e thi
leDISKGROUP
d h .b { disk_clauses
us | diskgroup_clauses }
o t o
ub ense
[ { disk_clauses | diskgroup_clauses } ]... ;
( s
h a le
ALTER FUNCTION lic ALTER FUNCTION [ schema. ]function
h b COMPILE [ DEBUG ]
b o d [ compiler_parameters_clause
su [ compiler_parameters_clause ] ... ]
[ REUSE SETTINGS ] ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
| PARAMETERS ('ODCI_parameters')
| { ENABLE | DISABLE }
| UNUSABLE
| RENAME TO new_name
| COALESCE
| { MONITORING | NOMONITORING } USAGE
| UPDATE BLOCK REFERENCES
| alter_index_partitioning
} ;
le
{ { ADD | DROP }
[ schema. ]operator (parameter_types)
r a b
[, { ADD | DROP }
[ schema. ]operator (parameter_types) ns fe
t r a
n-
]...
[ using_type_clause ]
| COMPILE a no
} ;
h a s
m ) e.
o id
ALTER JAVA ALTER JAVA
{ SOURCE | CLASS g
c.c t Gu]object_name
} i[ schema.
[ RESOLVER rel
o en
( ( iw a
S t
match_stringud[, ] { schema_name | - } )
a l e@[]...t h is
( match_string [, ] { schema_name | - } )
h . bh u) se
b o d ]to
s e
u ens {| {invoker_rights_clause
COMPILE | RESOLVE }
(
h a le lic } ;
h b
o d
sub ALTER MATERIALIZED VIEW ALTER MATERIALIZED VIEW
[ schema. ](materialized_view)
[ physical_attributes_clause
| table_compression
| LOB_storage_clause
[, LOB_storage_clause ]...
| modify_LOB_storage_clause
[, modify_LOB_storage_clause ]...
| alter_table_partitioning
| parallel_clause
| logging_clause
| allocate_extent_clause
| shrink_clause
| { CACHE | NOCACHE }
]
[ alter_iot_clauses ]
[ USING INDEX physical_attributes_clause ]
[ MODIFY scoped_table_ref_constraint
| alter_mv_refresh
]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
[ { ENABLE | DISABLE } QUERY REWRITE
| COMPILE
| CONSIDER FRESH
] ;
le
| allocate_extent_clause
| shrink_clause
r a b
| { CACHE | NOCACHE }
] ns fe
t r a
n-
[ ADD
{ { OBJECT ID o
| PRIMARY KEY
s an
| ROWID
) ha
| SEQUENCE
}
c o m ide.
i c. t Gu
[ (column [, column ]...) ]
g
relo uden
| (column [, column ]... )
}
a
iw s St
[, { { OBJECT ID
@
h a le
e thi
| PRIMARY KEY
| ROWID
d h .b us | SEQUENCE
o t o
ub ense
}
( s [ (column [, column ]...) ]
hal
e lic | (column [, column ]...)
h b }
o d ]...
sub
[ new_values_clause ]
] ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
| { ENABLE | DISABLE }
]... ;
c o m ide.
[ resource_parameters | password_parameters
]... ;
g i c. t Gu
lo en
reCOST
ALTER RESOURCE COST
w Stud
a
ALTER RESOURCE
i
e@ this
{ CPU_PER_SESSION
| lCONNECT_TIME
a
bh|| LOGICAL_READS_PER_SESSION
h . u se
b o d }to
PRIVATE_SGA
e
su cens integer
e (
h a l li [ { CPU_PER_SESSION
h b | CONNECT_TIME
o d | LOGICAL_READS_PER_SESSION
sub
| PRIVATE_SGA
}
integer
] ... ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
| SHRINK [ TO integer [ K | M ] ]
};
le
[ INCREMENT BY integer
| { MAXVALUE integer | NOMAXVALUE }
r a b
| { MINVALUE integer | NOMINVALUE }
| { CYCLE | NOCYCLE } ns fe
t r a
n-
| { CACHE integer | NOCACHE }
| { ORDER | NOORDER }
]... ; a no
h a s
ALTER SESSION ALTER SESSION
m ) e.
{ ADVISE { COMMIT | ROLLBACK o
.cdblink | id
u NOTHING }
| CLOSE DATABASE LINK i c
g } nCOMMITt G IN PROCEDURE
e l o
| { ENABLE a|r DISABLE d}e GUARD
| { ENABLE | DISABLE
i w t u
S | FORCE } PARALLEL
l @ | DDL
{eDML h i s
| { ENABLE | DISABLE
h|a { ENABLE
e t RESUMABLE
| QUERY } [ PARALLEL integer ]
. b s
h to u[ TIMEOUT integer ] [ NAME string ]
o d
b nse |} DISABLE RESUMABLE
s u
a l e ( lice | alter_session_set_clause
b h } ;
o d h
b
su ALTER SYSTEM ALTER SYSTEM
{ archive_log_clause
| checkpoint_clause
| check_datafiles_clause
| DUMP ACTIVE SESSION HISTORY [ MINUTES integer ]
| distributed_recov_clauses
| restricted_session_clauses
| FLUSH { SHARED_POOL | BUFFER_CACHE }
| end_session_clauses
| SWITCH LOGFILE
| { SUSPEND | RESUME }
| quiesce_clauses
| shutdown_dispatcher_clause
| REGISTER
| SET alter_system_set_clause
[ alter_system_set_clause ]...
| RESET alter_system_reset_clause
[ alter_system_reset_clause ]...
} ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 }
a ble
{ TABLE LOCK | ALL TRIGGERS }
fe r
]...
] ;
a ns
n- t r
o
ALTER TABLESPACE ALTER TABLESPACE tablespace
s an
{ DEFAULT
) ha
c o m ide.
[ table_compression ] storage_clause
| MINIMUM EXTENT integer [ K | M ]
i
| RESIZE size_clause
g c. t Gu
relo uden
| COALESCE
a
| RENAME TO new_tablespace_name
iw s St
| { BEGIN | END } BACKUP
@
h a le
e thi
| datafile_tempfile_clauses
| tablespace_logging_clauses
d h .b us
| tablespace_group_clause
o t o
ub ense
| tablespace_state_clauses
( s | autoextend_clause
hal
e lic | flashback_mode_clause
h b | tablespace_retention_clause
b o d } ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
[ dependent_handling_clause ]
} ;
le
| TEMPORARY TABLESPACE
{ tablespace | tablespace_group_name }
r a b
| QUOTA { integer [ K | M ]
| UNLIMITED ns fe
t r a
n-
} ON tablespace
[ QUOTA { integer [ K | M ] o
| UNLIMITED
s an
} ON tablespace
) ha
]...
| PROFILE profile
c o m ide.
i c. t Gu
| DEFAULT ROLE { role [, role ]...
g
relo uden
| ALL [ EXCEPT
a
iw s St | NONE
role [, role ]... ]
@
h a le
e thi }
| PASSWORD EXPIRE
d h .b us
| ACCOUNT { LOCK | UNLOCK }
o t o
ub ense
}
( s (continued)
hal
e lic UPDATE MANUALLY too big to fit on page, split
b o d(cont.) [ { IDENTIFIED
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
| UNIQUE (column [, column ]...)
fe r
}
a ns
| COMPILE
n- t r
} ;
o
s an
ANALYZE
{ TABLE [ schema. ]table m)
ANALYZE ha
o d e .
c
c. t Gu
[ PARTITION (partition)
i i
g
relo u]index
| SUBPARTITION (subpartition)
]
a d en
t
iw s S(partition)
| INDEX [ schema.
@
[
hi
PARTITION
le| SUBPARTITION
h a e t (subpartition)
b us [ schema. ]cluster
h. |toCLUSTER
]
o d
b nse }
s u
( ice { validation_clauses
l e l
b ha | LIST CHAINED ROWS [ into_clause ]
| DELETE [ SYSTEM ] STATISTICS
o d h | compute_statistics_clause
sub | estimate_statistics_clause
} ;
AUDIT AUDIT
{ sql_statement_clause | schema_object_clause }
[ BY { SESSION | ACCESS } ]
[ WHENEVER [ NOT ] SUCCESSFUL ] ;
CALL CALL
{ routine_clause
| object_access_expression
}
[ INTO :host_variable
[ [ INDICATOR ] :indicator_variable ] ] ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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' ;
le
COMMIT COMMIT [ WORK ]
[ COMMENT 'text'
r a b
| FORCE 'text' [, integer ]
] ; ns fe
t r a
on-
CREATE CLUSTER CREATE CLUSTER [ schema. ]cluster
s an
ha
(column datatype [ SORT ]
)
[, column datatype [ SORT ] ]...
m ide.
)
c o
i c. t Gu
[ { physical_attributes_clause
g
relo uden
| SIZE size_clause
a
| TABLESPACE tablespace
iw s St
| { INDEX
@
le thi
| [ SINGLE TABLE ]
h a e
HASHKEYS integer [ HASH IS expr ]
d h .b us
}
o t o
}
( s ub ense [ physical_attributes_clause
hal
e lic | SIZE size_clause
| TABLESPACE tablespace
h b | { INDEX
o d | [ SINGLE TABLE ]
sub }
HASHKEYS integer [ HASH IS expr ]
]...
]
[ parallel_clause ]
[ NOROWDEPENDENCIES | ROWDEPENDENCIES ]
[ CACHE | NOCACHE ] ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
| MAXLOGMEMBERS integer
fe r
| MAXLOGHISTORY integer
| MAXDATAFILES integer
a ns
| MAXINSTANCES integer
n- t r
o
an
| { ARCHIVELOG | NOARCHIVELOG }
| FORCE LOGGING
]...
ha s
] )
m ide.
c o
c. t Gu
[ character_set_clause ] ;
g i
CREATE DATABASE
a
CREATE DATABASEre[lodatabase
d e n]
{ USER SYS
S tu BY password
iw IDENTIFIED
l e
| USER@ h
SYSTEM s
i REUSE
IDENTIFIED BY password
a t
h . bh| MAXDATAFILES
|
u se
CONTROLFILE
integer
o d |to
ub ense | CHARACTER SET charset
MAXINSTANCES integer
( s
h a le lic | NATIONAL CHARACTER SET charset
h b | SET DEFAULT
sub
| database_logging_clauses
| tablespace_clauses
| set_time_zone_clause
}... ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
| attribute_clause
| extended_attribute_clause
}
[ hierarchy_clause
| attribute_clause
| extended_attribute_clause
]... ;
bh u]...
datatype
. s e
o d h to)
b e
su cens RETURN datatype
]
e (
hal li [ { invoker_rights_clause
h b | DETERMINISTIC
b o d | parallel_enable_clause
su }
[ invoker_rights_clause
| DETERMINISTIC
| parallel_enable_clause
]...
]
{ { AGGREGATE | PIPELINED }
USING [ schema. ]implementation_type
| [ PIPELINED ]
{ IS | AS }
{ pl/sql_function_body | call_spec }
} ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 ;
le
[ NOFORCE ]
JAVA { { SOURCE | RESOURCE }
r a b
NAMED [ schema. ]primary_name
| CLASS [ SCHEMA schema ] ns fe
t r a
n-
}
[ invoker_rights_clause ] o
[ RESOLVER
s an
ha
((match_string [,] { schema_name | - })
)
)
c o m ide.
[ (match_string [,] { schema_name | - }) ]...
]
g i c. t Gu
relo uden
{ USING { BFILE (directory_object_name ,
a
iw s St
server_file_name)
| { CLOB | BLOB | BFILE }
@
h a le
e thi
subquery
| 'key_for_BLOB'
d h .b us }
o t o
ub ense
| AS source_text
( s } ;
hal
e lic
h b
CREATE LIBRARY CREATE [ OR REPLACE ] LIBRARY [ schema. ]libname
o d { IS | AS } 'filename' [ AGENT 'agent_dblink' ] ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
[ FOR UPDATE ]
[ { DISABLE | ENABLE }
QUERY REWRITE
]
AS subquery ;
( s ub ense | SEQUENCE
e lic
| (column [, column ]...)
bhal }
o d h ]...
[ new_values_clause ]
sub ] ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
CREATE PFILE CREATE PFILE [= 'pfile_name' ]
FROM SPFILE [= 'spfile_name'] ;
le
)
]
r a b
[ invoker_rights_clause ]
{ IS | AS } ns fe
t r a
n-
{ pl/sql_subprogram_body | call_spec } ;
a no
CREATE PROFILE
LIMIT { resource_parameters ha
CREATE PROFILE profile s
m ) e.
o
| password_parameters
}
g i c.c t Guid
elo den
[ resource_parameters
a r
| password_parameters
@ iw]...s;Stu
h a le
e thi
CREATE ROLE
d h .bCREATEu s role
ROLE
b o e o
t| IDENTIFIED
[ NOT IDENTIFIED
( s u ens { BY password
b h | EXTERNALLY
o d h | GLOBALLY
}
sub ] ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 }
a ble
| { ORDER | NOORDER }
fe r
]... ;
a ns
n- t r
no
CREATE SPFILE CREATE SPFILE [= 'spfile_name' ]
FROM PFILE [= 'pfile_name' ] ;
s a
h a
CREATE [ OR REPLACE ] [ PUBLIC) ] SYNONYM
CREATE SYNONYM
c o m ide.
c. [ t@ Gdblink
[ schema. ]synonym
g
FOR [ schema. ]objecti u ];
a relo |uobject_table
d en
CREATE TABLE
i w St
{ relational_table | XMLType_table }
l e @ his
a
h [ BIGFILE
e t
CREATE TABLESPACE
. bCREATE
u s
h t{opermanent_tablespace_clause
o d | SMALLFILE ]
( s ub ense | temporary_tablespace_clause
h a le lic | undo_tablespace_clause
h b } ;
b o dCREATE TRIGGER
su CREATE [ OR REPLACE ] TRIGGER [ schema. ]trigger
{ BEFORE | AFTER | INSTEAD OF }
{ dml_event_clause
| { ddl_event [ OR ddl_event ]...
| database_event [ OR database_event ]...
}
ON { [ schema. ]SCHEMA
| DATABASE
}
}
[ WHEN (condition) ]
{ pl/sql_block | call_procedure_statement } ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 ;
le
CREATE USER CREATE USER user
IDENTIFIED { BY password
r a b
| EXTERNALLY
| GLOBALLY AS 'external_name' ns fe
t r a
n-
}
[ DEFAULT TABLESPACE tablespace o
| TEMPORARY TABLESPACE
s an
ha
{ tablespace | tablespace_group_name }
)
| UNLIMITED
c o m ide.
| QUOTA { integer [ K | M ]
}
g i c. t Gu
relo uden
ON tablespace
a
[ QUOTA { integer [ K | M ]
iw s St
| UNLIMITED
@
h a le
e thi
}
ON tablespace
d h .b us
]...
o t o
ub ense
| PROFILE profile
( s | PASSWORD EXPIRE
hal
e lic | ACCOUNT { LOCK | UNLOCK }
o d | TEMPORARY TABLESPACE
sub
{ tablespace | tablespace_group_name }
| QUOTA { integer [ K | M ]
| UNLIMITED
}
ON tablespace
[ QUOTA { integer [ K | M ]
| UNLIMITED
}
ON tablespace
]...
| PROFILE profile
| PASSWORD EXPIRE
| ACCOUNT { LOCK | UNLOCK }
]...
] ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 ] ;
l e @ hi[sschema. ]package
[, ]function ]...
su }
[ FORCE ] ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
DROP DISKGROUP DROP DISKGROUP diskgroup_name
[ { INCLUDING | EXCLUDING }
CONTENTS
] ;
a ble
fe r
DROP JAVA DROP JAVA
{ SOURCE | CLASS | RESOURCE }
a ns
[ schema. ]object_name ;
n- t r
a no
DROP LIBRARY DROP LIBRARY library_name ;
h a s
m ) e.
o
DROP MATERIALIZED VIEW DROP MATERIALIZED VIEW .c
g i c t Guid
elo ] d; en
[ schema. ]materialized_view
[ PRESERVE rTABLE
a
iw s Stu
@ i VIEW LOG
leMATERIALIZED
h
DROP MATERIALIZED VIEW DROP
h a e t
LOG
d h .b ON u[ sschema. ]table ;
b o e to
(
DROP OPERATOR
e su cens DROP OPERATOR [ schema. ]operator [ FORCE ] ;
h al li
h b
DROP OUTLINE DROP OUTLINE outline ;
o d
sub DROP PACKAGE DROP PACKAGE [ BODY ] [ schema. ]package ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
DROP TABLE DROP TABLE [ schema. ]table
[ CASCADE CONSTRAINTS ]
[ PURGE ] ;
a ble
DROP TYPE DROP TYPE [ schema. ]type_name
fe r
[ FORCE | VALIDATE ] ;
a ns
n- t r
DROP TYPE BODY DROP TYPE BODY [ schema. ]type_name ;
a no
DROP USER user [ CASCADE ] ; ) h
as
DROP USER
c o m ide.
c.
DROP VIEW [ schema.g]i view t G
u
relo uden] ;
DROP VIEW
a
[ CASCADE CONSTRAINTS
iw s St
@
le PLANthi
EXPLAIN PLAN a
EXPLAIN
h
h . b [[ SET
u seSTATEMENT_ID = 'text' ]
b d o
o se tFOR statement ;
INTO [ schema. ]table [ @ dblink ] ]
u
(s icen
l e l
b ha DATABASE
FLASHBACK FLASHBACK [ STANDBY ] DATABASE [ database ]
sub
| TO BEFORE { SCN | TIMESTAMP } expr
};
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
LOCK TABLE LOCK TABLE
[ schema. ] { table | view }
[ { PARTITION (partition)
| SUBPARTITION (subpartition)
}
| @ dblink
]
[, [ schema. ] { table | view }
[ { PARTITION (partition)
| SUBPARTITION (subpartition)
}
| @ dblink
]
a ble
]...
fe r
IN lockmode MODE
[ NOWAIT ] ;
a ns
n- t r
o
MERGE MERGE [ hint ]
s an
ha
INTO [ schema. ]table [ t_alias ]
)
[ t_alias ]
c o m ide.
USING [ schema. ] { table | view | subquery }
ON ( condition )
g i c. t Gu
relo uden
[ merge_update_clause ]
a
[ merge_insert_clause ] ;
iw s St
@
NOAUDIT
h a le
NOAUDIT
e thi
d h .b { sql_statement_clause
us
o t o [, sql_statement_clause ]...
( s ub ense | schema_object_clause
a l e l i c [, schema_object_clause ]...
bh
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
SQL Statement Syntax
ROLLBACK ROLLBACK [ WORK ]
[ TO [ SAVEPOINT ] savepoint
| FORCE 'text'
] ;
d h .b |uISOLATION
s LEVEL
o t o
ub ense | USE ROLLBACK SEGMENT rollback_segment
{ SERIALIZABLE | READ COMMITTED }
( s
h a le lic }
h b [ NAME 'text' ]
o d | NAME 'text'
sub
} ;
TRUNCATE TRUNCATE
{ TABLE [ schema. ]table
[ { PRESERVE | PURGE } MATERIALIZED VIEW LOG ]
| CLUSTER [ schema. ]cluster
}
[ { DROP | REUSE } STORAGE ] ;
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Table 2: Syntax for Subclauses
Subclause Syntax
activate_standby_db_clause ACTIVATE
[ PHYSICAL | LOGICAL ]
STANDBY DATABASE
[ SKIP [ STANDBY LOGFILE ] ]
h a le [ inline_constraint ]...
.b us e | inline_ref_constraint
o d h t o }
( s ub ense ]
]...
hal
e lic )
h b [ column_properties ]
b d
o add_disk_clause
s u ADD
[ FAILGROUP failgroup_name ]
DISK qualified_disk_clause
[, qualified_disk_clause ]...
[ [ FAILGROUP failgroup_name ]
DISK qualified_disk_clause
[, qualified_disk_clause ]...
]...
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
add_hash_subpartition ADD subpartition_spec
[ update_index_clauses ]
[ parallel_clause ]
a ble
fe r
add_logfile_clauses ADD [ STANDBY ] LOGFILE
a ns
] n- t r
{ [ INSTANCE 'instance_name' | THREAD integer
no
[ GROUP integer ] redo_log_file_spec
a
h a s
[, [ GROUP integer ] redo_log_file_spec
]...
m ) e.
| MEMBER 'filename' [ REUSE ]
o
g i c.c t Guid
[, 'filename' [ REUSE ] ]...
relo uden
TO logfile_descriptor
[, logfile_descriptor ]...
} a
iw s St
@
h a e thi [ segment_attributes_clause ]
leADD OVERFLOW
add_overflow_clause
d h .b [u(PARTITION
s
o
b nse ]... t o [,
[ segment_attributes_clause ]
PARTITION [ segment_attributes_clause ]
s u
a l e ( lice )
b h ]
d h
o add_range_partition_clause ADD PARTITION [ partition ]
s ub
range_values_clause
[ table_partition_description ]
[ update_index_clauses ]
add_table_partition { add_range_partition_clause
| add_hash_partition_clause
| add_list_partition_clause
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
[ SIZE size_clause
| DATAFILE 'filename'
| INSTANCE integer
]...
)
]
le
)
}
r a b
| DROP ATTRIBUTE
{ attribute ns fe
t r a
n-
| ( attribute [, attribute ]... )
} o
}
s an
) ha
alter_collection_clauses MODIFY { LIMIT integerm
o d e .
i c
c. t Gu
| ELEMENT TYPE i
datatype
g
relo uden
}
a
iw s St
alter_datafile_clause @
DATAFILE
hi
le { 'filename'
h a e t | filenumber }
b d o
o se t { ONLINE
u
(s icen | OFFLINE [ FOR DROP ]
l e l
b ha | RESIZE size_clause
| autoextend_clause
o d h | END BACKUP
sub }
alter_external_table_clauses { add_column_clause
| modify_column_clauses
| drop_column_clause
| parallel_clause
| external_data_properties
| REJECT LIMIT { integer | UNLIMITED }
| PROJECT COLUMN { ALL | REFERENCED }
}
[ add_column_clause
| modify_column_clauses
| drop_column_clause
| parallel_clause
| external_data_properties
| REJECT LIMIT { integer | UNLIMITED }
| PROJECT COLUMN { ALL | REFERENCED }
]...
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
le
| alter_overflow_clause
| alter_mapping_table_clauses
r a b
|
}
COALESCE
ns fe
t r a
on-
alter_mapping_table_clauses MAPPING TABLE
s an
ha
{ UPDATE BLOCK REFERENCES
)
| allocate_extent_clause
m ide.
o
| deallocate_unused_clause
c
}
g i c. t Gu
{ ADD | a
relo en
DROP } ud
alter_method_spec
{@ iw s St
hi
map_order_function_spec
h a le| subprogram_spec
t
e
.b }u[s{ ADD | DROP }
o d h to { map_order_function_spec
b
su cens e
l e ( i
| subprogram_spec
ha l }
h b ]...
o d
sub alter_mv_refresh REFRESH
{
{ FAST | COMPLETE | FORCE }
|
ON { DEMAND | COMMIT }
|
{ START WITH | NEXT } date
|
WITH PRIMARY KEY
|
USING
{ DEFAULT MASTER ROLLBACK SEGMENT
| MASTER ROLLBACK SEGMENT
rollback_segment
}
| USING { ENFORCED | TRUSTED } CONSTRAINTS
}
alter_overflow_clause { OVERFLOW
{ allocate_extent_clause
| deallocate_unused_clause
}
[ allocate_extent_clause
| deallocate_unused_clause
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
]...
| add_overflow_clause
}
alter_system_reset_clause parameter_name
[ SCOPE = { MEMORY | SPFILE | BOTH } ]
SID = 'sid'
a ble
alter_system_set_clause parameter_name =
fe r
parameter_value [, parameter_value ]...
a ns
[ COMMENT 'text' ]
[ DEFERRED ] n- t r
o
[ SID = { 'sid' | * } ] s an
[ SCOPE = { MEMORY | SPFILE | BOTH } ]
) ha
c o m ide.
c. t Gu
alter_table_partitioning { modify_table_default_attrs
g i
| set_subpartition_template
relo uden
| modify_table_partition
a
iw s St
| modify_table_subpartition
@
| move_table_partition
h a e thi
le|| move_table_subpartition
d h .b |ucoalesce_table_partition
s
add_table_partition
o t o
b nse || drop_table_partition
( s u e drop_table_subpartition
a l e li c | rename_partition_subpart
b h | truncate_partition_subpart
o d h | split_table_partition
sub | split_table_subpartition
| merge_table_partitions
| merge_table_subpartitions
| exchange_partition_subpart
}
alter_table_properties { { physical_attributes_clause
| 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
}
[ physical_attributes_clause
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
}
fe r
[ alter_iot_clauses ]
a ns
n- t r
alter_tempfile_clause TEMPFILE
a
{ 'filename' [, 'filename' ]... no
a s
| filenumber [, filenumber ]...
h
}
m ) e.
o
c.c t Guid
{ RESIZE size_clause
i
| autoextend_clause
g
relo uden
| DROP [ INCLUDING DATAFILES ]
a
| ONLINE
iw s St
| OFFLINE
@
h a le }
e thi
d h .b MODIFY
us VARRAY varray_item
o
alter_varray_col_properties t o
( s ub ense ( modify_LOB_parameters )
h a le lic
h b
analytic_clause [ query_partition_clause ]
b o d [ order_by_clause [ windowing_clause ] ]
su
archive_log_clause ARCHIVE LOG
[ INSTANCE 'instance_name' | THREAD integer
]
{ { SEQUENCE integer
| CHANGE integer
| CURRENT [ NOSWITCH ]
| GROUP integer
| LOGFILE 'filename'
[ USING BACKUP CONTROLFILE ]
| NEXT
| ALL
| START
}
[ TO 'location' ]
| STOP
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
array_DML_clause [ WITH | WITHOUT ]
ARRAY DML
[ ([ schema. ]type
[, [ schema. ]varray_type ])
[, ([ schema. ]type
[, [ schema. ]varray_type ])...
]
le
[, dependent_column ]... )
}
r a b
ns fe
auditing_by_clause BY { proxy [, proxy ]...
t r a
| user [, user ]... n-
no
}
s a
h a
ON { [ schema. ]objectm) .
auditing_on_clause
c o
. Gu i d e
| DEFAULT gic
| DIRECTORY directory_name
}
r e lo ent
i wa Stud
l @ his
eAUTOEXTEND
autoextend_clause
h a {eOFFt
. b s
h to u | ON [ NEXT size_clause ]
o d
b nse [ maxsize_clause ]
s u
e ( lice
}
a l
h bh
b o dbinding_clause BINDING
(parameter_type [, parameter_type ]...)
s u RETURN return_type
[ implementation_clause ]
using_function_clause
[, (parameter_type [, parameter_type ]...)
RETURN return_type
[ implementation_clause ]
using_function_clause
]...
bitmap_join_index_clause [ schema.]table
( [ [ schema. ]table. | t_alias. ]column
[ ASC | DESC ]
[, [ [ schema. ]table. | t_alias. ]column
[ ASC | DESC ]
]...
)
FROM [ schema. ]table [ t_alias ]
[, [ schema. ]table [ t_alias ]
]...
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
WHERE condition
[ local_partitioned_index ]
index_attributes
a ble
fe r
call_spec LANGUAGE { Java_declaration | C_declaration }
a ns
n- t r
cancel_clause CANCEL [ IMMEDIATE ] [ WAIT | NOWAIT ]
a no
h a s
cell_assignment measure_column [ { { condition
m ) e.
| oexpr
g i G uid
c.c|} single_column_for_loop
r e lo en[,t { condition
i wa Stud | expr
l e @ h i s | single_column_for_loop
h a e t }
. b
h to u s ]...
b o d
u
s cen s e | multi_column_for_loop
e ( }
hal li ]
h b
b o d Note: The outer square brackets are part of the
syntax.
s u In this case, they do not indicate
optionality.
check_diskgroup_clauses CHECK
{ ALL
| DISK
disk_name
[, disk_name ]...
| DISKS IN FAILGROUP
failgroup_name
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
[, failgroup_name ]...
| FILE
filename
[, filename ]...
}
[ CHECK
{ ALL
| DISK
disk_name
[, disk_name ]...
| DISKS IN FAILGROUP
failgroup_name
[, failgroup_name ]...
a ble
| FILE
fe r
filename
[, filename ]...
a ns
}
n- t r
]...
a no
[ REPAIR | NOREPAIR ]
h a s
)
LOCAL ] e.
m
o
c.c t Guid
checkpoint_clause CHECKPOINT [ GLOBAL |
g i
CLUSTER [re lo ]encluster index_attributes
w Stud
a
cluster_index_clause schema.
i
@ hPARTITION
coalesce_index_partition ale t
COALESCE is
h . bh us[eparallel_clause ]
b o d to
su cens e
e (
coalesce_table_partition COALESCE PARTITION
h a l li [ update_index_clauses ]
h b [ parallel_clause ]
b o d
su column_association COLUMNS [ schema. ]table.column
[, [ schema. ]table.column ]...
using_statistics_type
column_clauses { { add_column_clause
| modify_column_clause
| drop_column_clause
}
[ add_column_clause
| modify_column_clause
| drop_column_clause
]...
| rename_column_clause
| modify_collection_retrieval
[ modify_collection_retrieval ]...
| modify_LOB_storage_clause
| alter_varray_col_properties
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 }
a ble
[ (LOB_partition_storage
fe r
)
[, LOB_partition_storage ]...
a ns
]
n- t r
| XMLType_column_properties
a no
}
]...
h a s
m ) e.
o ui}d PRIMARY
commit_switchover_clause { PREPARE | COMMIT
g i c.|c}LOGICAL
TO SWITCHOVER
t G
r e lo STANDBY
[ TO { { PHYSICAL
e n
w[a {{ WITH u|dWITHOUT } SESSION SHUTDOWN
| PHYSICAL
i S t
a l e@ t]hisWAIT | NOWAIT }
h . bh use| LOGICAL STANDBY
b o d to| CANCEL}
su cens e
l e ( i ]
a l
h bh
o dcompile_type_clause COMPILE
sub
[ DEBUG ]
[ SPECIFICATION | BODY ]
[ compiler_parameters_clause
[ compiler_parameters_clause ] ... ]
[ REUSE SETTINGS ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
compute_statistics_clause COMPUTE [ SYSTEM ] STATISTICS [ for_clause ]
le
[ WHEN condition
THEN insert_into_clause
r a b
[ values_clause ]
[ error_logging_clause ] ns fe
t r a
n-
[ insert_into_clause
[ values_clause ] o
an
[ error_logging_clause ]
s
]...
) ha
]...
c o m ide.
[ ELSE insert_into_clause
i c. t Gu
[ values_clause ]
g
relo uden
[ error_logging_clause ]
a
[ insert_into_clause
iw s St
[ values_clause ]
@
h a le
e thi[ error_logging_clause ]
]...
d h .b us
]
o t o
constraint (s
ub ense { inline_constraint
h a le lic | out_of_line_constraint
h b | inline_ref_constraint
b o d | out_of_line_ref_constraint
su }
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
[, parameter datatype ]...
fe r
]
a ns
RETURN SELF AS RESULT
{ IS | AS } { pl/sql_block | call_spec }
n- t r
o
constructor_spec [ FINAL ] s an
[ INSTANTIABLE ]
) ha
c o m ide.
CONSTRUCTOR FUNCTION datatype
g i c. t Gu
[ ([ SELF IN OUT datatype, ]
relo uden
parameter datatype
[, parameter datatype ]...
) a
iw s St
@
thi
]
o d h ]
[ WITH COLUMN CONTEXT ]
b
su controlfile_clauses { CREATE [ LOGICAL | PHYSICAL ]
STANDBY CONTROLFILE AS
'filename' [ REUSE ]
| BACKUP CONTROLFILE TO
{ 'filename' [ REUSE ]
| trace_file_clause
}
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
le
| [ MASTER | LOCAL ]
ROLLBACK SEGMENT rollback_segment
r a b
}
[ DEFAULT [ MASTER | LOCAL ] ns fe
t r a
n-
ROLLBACK SEGMENT
| [ MASTER | LOCAL ] o
an
ROLLBACK SEGMENT rollback_segment
s
]...
) ha
| USING
c o m ide.
{ ENFORCED | TRUSTED }
i
CONSTRAINTS
g c. t Gu
relo uden
}
a
[ { FAST | COMPLETE | FORCE }
iw s St
| ON { DEMAND | COMMIT }
@
h a le
e thi
| { START WITH | NEXT } date
| WITH { PRIMARY KEY | ROWID }
d h .b us| USING
o t o
ub ense
{ DEFAULT [ MASTER | LOCAL ]
( s ROLLBACK SEGMENT
hal
e lic | [ MASTER | LOCAL ]
o d }
sub
[ DEFAULT [ MASTER | LOCAL ]
ROLLBACK SEGMENT
| [ MASTER | LOCAL ]
ROLLBACK SEGMENT
rollback_segment
]...
| USING
{ ENFORCED | TRUSTED }
CONSTRAINTS
]...
| NEVER REFRESH
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
[, element_spec ]...
fe r
)
]
a ns
]
n- t r
[ [ NOT ] FINAL ]
a no
[ [ NOT ] INSTANTIABLE ] ;
h a s
m ) e.
create_varray_type CREATE [ OR REPLACE ]
c o uid
.]type_name
TYPE [ schema.
g i c G
{ IS |re
lo VARRAY
AS } { d e nt | VARYING
[ OID 'object_identifier' ]
wa OFSdatatype
ARRAY }
i
(limit) tu ;
a l e@ this
database_file_clauses .bh se FILE
d h u
{ RENAME
to 'filename'
b o e
[, 'filename' ]...
e ( su cens TO 'filename'
h a l l i | create_datafile_clause
| alter_datafile_clause
h b | alter_tempfile_clause
b o d }
su
database_logging_clauses { LOGFILE
[ GROUP integer ] file_specification
[, [ GROUP integer ] file_specification
]...
| MAXLOGFILES integer
| MAXLOGMEMBERS integer
| MAXLOGHISTORY integer
| { ARCHIVELOG | NOARCHIVELOG }
| FORCE LOGGING
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
'filename' [, 'filename' ]...
| { DATAFILE | TEMPFILE } { ONLINE | OFFLINE }
}
datafile_tempfile_spec [ 'filename' ]
[ SIZE size_clause ]
[ REUSE ]
[ autoextend_clause ]
a ble
fe r
dblink_authentication AUTHENTICATED BY user
a ns
IDENTIFIED BY password
n- t r
a no
deallocate_unused_clause DEALLOCATE UNUSED
[ KEEP size_clause ]
h a s
m ) e.
o uid network_cost)
default_cost_clause i c.c t G
DEFAULT COST (cpu_cost,
g io_cost,
a r elo den
default_selectivity_clause DEFAULT
S tu default_selectivity
iw SELECTIVITY
le @ h i s
h a e t
default_tablespace
d h .b DEFAULTs TABLESPACE tablespace
[uDATAFILE datafile_tempfile_spec ]
b o
o se t extent_management_clause
u
(s icen
l e l
b ha
default_settings_clauses { SET DEFAULT
sub
| DEFAULT TABLESPACE tablespace
| DEFAULT TEMPORARY TABLESPACE
{ tablespace | tablespace_group_name }
| RENAME GLOBAL_NAME TO
database.domain [.domain ]...
| { ENABLE BLOCK CHANGE TRACKING
[ USING FILE 'filename' [ REUSE ] ]
| DISABLE BLOCK CHANGE TRACKING
}
| flashback_mode_clause
| set_time_zone_clause
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
dependent_handling_clause { INVALIDATE
| CASCADE [ { [ NOT ] INCLUDING TABLE DATA
| CONVERT TO SUBSTITUTABLE
}
]
[ [FORCE ] exceptions_clause ]
}
le
}
REFERENCES parent_level
r a b
[ JOIN KEY
{ child_key_column ns fe
t r a
n-
| (child_key_column [, child_key_column
]...) o
}
s an
REFERENCES parent_level
) ha
]...
c o m ide.
g i c. t Gu
elo den
disk_clauses { diskgroup_name
a r
{ add_disk_clause
|iw
S tu
drop_disk_clauses
@
le } thi s
| resize_disk_clauses
h a e
b |u{sdiskgroup_name
d h . | ALL }
b o se t } o undrop_disk_clause
u
(s icen
l e l
b ha
diskgroup_alias_clauses { ADD ALIAS
o d h alias_name FOR filename
diskgroup_availability { MOUNT
| DISMOUNT [ FORCE | NOFORCE ]
}
diskgroup_clauses { diskgroup_name
{ rebalance_diskgroup_clause
| check_diskgroup_clauses
| diskgroup_template_clauses
| diskgroup_directory_clauses
| diskgroup_alias_clauses
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
| drop_diskgroup_file_clause
}
| { diskgroup_name | ALL }
diskgroup_availability
}
d h .b us
[ autoextend_clause ]
o t o
( s ub ense { { ADDqualified_template_clause
diskgroup_template_clauses | ALTER } TEMPLATE
b o d template_name
su }
[, template_name ]...
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
dml_table_expression_clause { [ schema. ]
{ table
[ { PARTITION (partition)
| SUBPARTITION (subpartition)
}
| @ dblink
]
| { view | materialized view } [ @ dblink ]
}
| ( subquery [ subquery_restriction_clause ] )
| table_collection_expression
}
a ble
domain_index_clause INDEXTYPE IS indextype
fe r
[ parallel_clause ]
a ns
[ PARAMETERS ('ODCI_parameters') ]
n- t r
a no
drop_binding_clause DROP BINDING
h a s
(parameter_type
m ) e.
o
[, parameter_type ]...)
[ FORCE ]
g i c.c t Guid
a relo{ uCOLUMN
d en column
drop_column_clause
iw s S|t(column [, column ]...)
{ SET UNUSED
@
h a le
e t hi }
d h .b u[s{ CASCADE CONSTRAINTS | INVALIDATE }
b o e o
t ] [ CASCADE CONSTRAINTS | INVALIDATE ]...
e ( su cens | DROP { COLUMN column
ha l l i | (column [, column ]...)
h b }
s u ]
[ CASCADE CONSTRAINTS | INVALIDATE ]...
[ CHECKPOINT integer ]
| DROP { UNUSED COLUMNS
| COLUMNS CONTINUE
}
[ CHECKPOINT integer ]
}
drop_constraint_clause DROP
{ { PRIMARY KEY
| UNIQUE (column [, column ]...)
}
[ CASCADE ]
[ { KEEP | DROP } INDEX ]
| CONSTRAINT constraint
[ CASCADE ]
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 ] ]...
}
le
[, filename ]...
r a b
drop_index_partition DROP PARTITION partition_name
ns fe
t r a
drop_logfile_clauses DROP [ STANDBY ] LOGFILE no n-
{ logfile_descriptor s a
h a
) e.
[, logfile_descriptor ]...
| MEMBER 'filename'
o m
g i c.c t Guid
[, 'filename' ]...
relo uden
}
DROP iw
a tpartition
drop_table_partition
@ S
PARTITION
s
h a e thi
le [ update_index_clauses [ parallel_clause ] ]
d h .b us
o t o
ub ense
drop_table_subpartition DROP SUBPARTITION subpartition
e ( s c
[ update_index_clauses [ parallel_clause ] ]
h al li
h b
element_spec [ inheritance_clauses ]
b o d { subprogram_spec
su | constructor_spec
| map_order_function_spec
}
[ subprogram_clause
| constructor_spec
| map_order_function_spec
]...
[, pragma_clause ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
[ exceptions_clause ]
[ CASCADE ]
[ { KEEP | DROP } INDEX ]
relo uden
[ { WITH | WITHOUT } VALIDATION ]
a
iw s St
[ exceptions_clause ]
@
[ update_index_clauses [ parallel_clause ] ]
h a le
e thi
expr
d h .b {usimple_expression
s
o t o
ub ense | case_expression
| compound_expression
( s
h a le lic | cursor_expression
h b | datetime_expression
b o d | function_expression
| interval_expression
s u | object_access_expression
| scalar_subquery_expression
| model_expression
| type_constructor_expression
| variable_expression
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
DETERMINES { dependent_column
| (dependent_column
[, dependent_column ]...
)
]...
le
[ SIZE size_clause ]
]
r a b
}
ns fe
t r a
external_data_properties DEFAULT DIRECTORY directory
no n-
[ ACCESS PARAMETERS
s a
{ (opaque_format_spec)
| USING CLOB subquery h a
) e.
}
o m
]
g i c.c t Guid
relo uden
LOCATION
a
([ directory: ] 'location_specifier'
iw s St
[, [ directory: ] 'location_specifier'
@
le thi
]...
h a )
e
d h .b us
o t o
b nse ([ TYPE access_driver_type ]
s u
external_table_clause
( ice external_data_properties
l e l
b ha )
[ REJECT LIMIT { integer | UNLIMITED } ]
o d h
s ub file_specification { datafile_tempfile_spec
| diskgroup_file_spec
| redo_log_file_spec
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
}
a ble
[ FOR fe r
{ TABLE
a ns
| ALL [ INDEXED ] COLUMNS
n- t r
[ SIZE integer ]
| COLUMNS [ SIZE integer ] a no
h a s
{ column | attribute } [ SIZE integer ]
m ) e.
[ { column | attribute }
o
c.c t Guid
[ SIZE integer ]
g
]... i
a
} relo uden
| ALL [ LOCAL ] INDEXES
@ iw s St
]...
h a le
e thi
for_update_clause dh.
b FOR usUPDATE
o t o
b nse [ OF [ [{ schema.
s u
( ice table |
]
view } . ]column
l e l
ha
[, [ [ schema. ]
b o d ]...
su
]
[ NOWAIT | WAIT integer ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 ]...
le
| INDEXES
[ schema. ]index [, [ schema. ]index ]...
r a b
| INDEXTYPES
[ schema. ]indextype [, [ schema. ns fe
t r a
n-
]indextype ]...
}
{ using_statistics_type a no
| { default_cost_clause
h a s
) e.
[, default_selectivity_clause ]
m
o
c.c t Guid
| default_selectivity_clause
i
[, default_cost_clause ]
g
relo uden
}
}
a
iw s St
@ i
leFUNCTIONthname
function_declaration
h a e
d h .b ]...) u s(parameter datatype[, parameter datatype
b o
o se t RETURN datatype
u
(s icen
a l e l { IS | AS } { pl/sql_block | call_spec }
b h
o h
dfunction_spec FUNCTION name
general_recovery RECOVER
[ AUTOMATIC ]
[ FROM 'location' ]
{ { full_database_recovery
| partial_database_recovery
| LOGFILE 'filename'
}
[ { TEST
| ALLOW integer CORRUPTION
| parallel_clause
}
[ TEST
| ALLOW integer CORRUPTION
| parallel_clause
]...
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
]
| CONTINUE [ DEFAULT ]
| CANCEL
}
le
{ individual_hash_partitions
| hash_partitions_by_quantity
r a b
}
}
ns fe
t r a
on-
grant_object_privileges
an
{ object_privilege | ALL [ PRIVILEGES ] }
s
ha
[ (column [, column ]...) ]
)
[, { object_privilege | ALL [ PRIVILEGES ] }
m ide.
o
[ (column [, column ]...) ]
c
]...
g i c. t Gu
relo uden
on_object_clause
a
TO grantee_clause
iw s St
[ WITH HIERARCHY OPTION ]
@
le thi
[ WITH GRANT OPTION ]
h a e
d h .b {usystem_privilege
s
o
grant_system_privileges
b nse | role t o
s u
( ice | ALL PRIVILEGES
l e l
b ha }
[, { system_privilege
o d h | role
group_by_clause GROUP BY
{ expr
| rollup_cube_clause
| grouping_sets_clause
}
[, { expr
| rollup_cube_clause
| grouping_sets_clause
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
]...
[ HAVING condition ]
a relo uden
hierarchical_query_clause iw WITH
[ START
S t
condition ]
e @ i s
al e th
CONNECT BY [ NOCYCLE ] condition
b h
d us
h. toHIERARCHY
hierarchy_clause
b o
u ens e
hierarchy
e ( s c
(child_level CHILD OF parent_level
bh
[ dimension_join_clause ]
o d h )
index_attributes [ { physical_attributes_clause
| logging_clause
| ONLINE
| COMPUTE STATISTICS
| TABLESPACE { tablespace | DEFAULT }
| key_compression
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
]...
fe r
]
a ns
n- t r
index_expr { column | column_expression } o
s an
[ INCLUDING column_name ] ha
index_org_overflow_clause
m ) e.
OVERFLOW
o
i c.c t Gui]d
[ segment_attributes_clause
g
a relo uden
index_org_table_clause
iw s St integer
[ { mapping_table_clause
@ hi
| PCTTHRESHOLD
h a le | key_compression
t
.b u}s e
o d h t o [ mapping_table_clause
s u b n s e | PCTTHRESHOLD integer
l e ( ice | key_compression
ha l ]...
h b ]
b o d [ index_org_overflow_clause ]
su
index_partition_description PARTITION
[ partition
[ { segment_attributes_clause
| key_compression
}
[ segment_attributes_clause
| key_compression
]...
]
]
index_properties [ { { global_partitioned_index
| local_partitioned_index
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
}
| index_attributes
}
[ { { global_partitioned_index
| local_partitioned_index
}
| index_attributes
}
]...
| domain_index_clause
]
]...
h a s
)
m ) e.
o
c.c t Guid
}
g i
individual_hash_partitions
a
(PARTITION r elo den
[iw
S
partition tupartitioning_storage_clause ]
@ s
le th[i partition partitioning_storage_clause
[, PARTITION
h a e
d h .b ]u]... s
o t o
( s ub ense )
h a le lic
h b
inheritance_clauses [ NOT ] { OVERRIDING | FINAL | INSTANTIABLE }
su } ]...
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
inner_cross_join_clause table_reference
{ [ INNER ] JOIN table_reference
{ ON condition
| USING (column [, column ]...)
}
| { CROSS
| NATURAL [ INNER ]
}
JOIN table_reference
}
le
insert_into_clause INTO dml_table_expression_clause [ t_alias ]
[ (column [, column ]...) ]
r a b
ns fe
integer [ + | - ] digit [ digit ]...
t r a
on-
interval_day_to_second INTERVAL s an
) ha
'{ integer | integer time_expr | time_expr }'
c o m ide.
{ { DAY | HOUR | MINUTE }
g i c. t Gu
[ (leading_precision) ]
relo uden
| SECOND
[ (leading_precision
a
iw s St
[, fractional_seconds_precision ]
@
thi
)
h a le ]
.b }
us e
o d h t o
[ TO { DAY | HOUR | MINUTE | SECOND
( s ub ense }
[ (fractional_seconds_precision) ]
hal
e lic ]
h b
b d
o interval_year_to_month
s u INTERVAL 'integer [- integer ]'
{ YEAR | MONTH } [ (precision) ]
[ TO { YEAR | MONTH } ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
level_clause LEVEL level IS
{ level_table.level_column
| (level_table.level_column
[, level_table.level_column ]...
)
}
le
[, PARTITION [ partition ]
list_values_clause
r a b
]...
table_partition_description
ns fe
t r a
n-
)
a no
list_values_clause VALUES ({ value | NULL
h a s
m ) e.
[, { value | NULL }...)
| DEFAULT
o
)
g i c.c t Guid
a relotablespace
d e n
LOB_parameters { TABLESPACE
|@
tu } STORAGE IN ROW
iw s|SDISABLE
hi
{ ENABLE
h a le| storage_clause
t
.b ||uCHUNK e
s integer
d h o
o se t | RETENTION
PCTVERSION integer
u b
l e (s icen | FREEPOOLS integer
ha l | { CACHE
b o d }
su }
[ TABLESPACE tablespace
| { ENABLE | DISABLE } STORAGE IN ROW
| storage_clause
| CHUNK integer
| PCTVERSION integer
| RETENTION
| FREEPOOLS integer
| { CACHE
| { NOCACHE | CACHE READS } [ logging_clause
]
}
]...
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
{ LOB_segname (LOB_parameters)
fe r
| LOB_segname
a ns
| (LOB_parameters)
n- t r
no
}
}
s a
local_partitioned_index LOCAL h a
) e.
o m
.c Guid
[ on_range_partitioned_table
i c
| on_list_partitioned_table
g
r e lo ent
| on_hash_partitioned_table
wa Stud
| on_comp_partitioned_table
] i
a l e@ this
logfile_clause
h . bh LOGFILE
u se integer ] file_specification
b o d to [, [ GROUP integer ] file_specification ]...
[ GROUP
su cens e
e (
hal
logfile_clauses li { { ARCHIVELOG [ MANUAL ]
h b | NOARCHIVELOG
b o d }
su | [ NO ] FORCE LOGGING
| RENAME FILE 'filename'
[, 'filename' ]...
TO 'filename'
| CLEAR
[ UNARCHIVED ]
LOGFILE logfile_descriptor
[, logfile_descriptor ]...
[ UNRECOVERABLE DATAFILE ]
| add_logfile_clauses
| drop_logfile_clauses
| supplemental_db_logging
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
logging_clause { LOGGING | NOLOGGING }
a ble
map_order_func_declaration { MAP | ORDER } MEMBER function_declaration
fe r
a ns
map_order_function_spec { MAP | ORDER } MEMBER function_spec
n- t r
a no
mapping_table_clauses { MAPPING TABLE | NOMAPPING a }s
h
) e.
o m
materialized_view_props [ column_properties
g i c.c] t Guid]
lo ]en
[ table_partitioning_clauses
[ CACHE |re
a ud]
NOCACHE
i w S
[ parallel_clauset
a l e[ @ t h is ]
build_clause
h . bh SET u e
sSTANDBY
o d
maximize_standby_db_clause
b nse t o DATABASE TO MAXIMIZE
a l e ( lice
h bh
maxsize_clause MAXSIZE { UNLIMITED | size_clause }
b o d
su merge_insert_clause WHEN NOT MATCHED THEN
INSERT [ (column [, column ]...) ]
VALUES ({ expr [, expr ]... | DEFAULT })
[ where_clause ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
b d
o se t ]... o
u
(s icen
a l e l
)
h bh
b o dmodify_col_properties ( column [ datatype ]
[ DEFAULT expr ]
s u [ inline_constraint
[ inline_constraint ]... ]
[ LOB_storage_clause ]
[, column [ datatype ]
[ DEFAULT expr ]
[ inline_constraint
[ inline_constraint ]... ]
[ LOB_storage_clause ]
]
)
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
modify_column_clauses MODIFY { modify_col_properties
| modify_col_substitutable
}
modify_hash_subpartition { { allocate_extent_clause
| deallocate_unused_clause
a ble
| shrink_clause
fe r
| { LOB LOB_item
a ns
| VARRAY varray
n- t r
no
}
modify_LOB_parameters
s a
[ { LOB LOB_item
| VARRAY varray h
) e.a
}
o m
i c.c t Guid
modify_LOB_parameters
g
elo den
]...
}
a r
| [ REBUILD
}@
tu
iw s ]SUNUSABLE LOCAL INDEXES
h a le
e thi
d h .b MODIFY
us DEFAULT ATTRIBUTES
o
modify_index_default_attrs
b nse t o
s u
( ice
[ FOR PARTITION partition ]
{ physical_attributes_clause
l e l
b ha | TABLESPACE { tablespace | DEFAULT }
| logging_clause
o d h }
sub [ physical_attributes_clause
| TABLESPACE { tablespace | DEFAULT }
| logging_clause
]...
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
| COALESCE
| UPDATE BLOCK REFERENCES
| UNUSABLE
}
l e @ h i s | VARRAY varray }
ha s]e ... t
modify_LOB_parameters
. b
h to|u[ REBUILD ] UNUSABLE LOCAL INDEXES
o d
b nse | { ADD | DROP } VALUES (value[, value ]...)
s u
( ice }
l e l
b ha
o d h
modify_LOB_parameters { storage_clause
sub
| PCTVERSION integer
| RETENTION
| FREEPOOLS integer
| REBUILD FREEPOOLS
| { CACHE
| { NOCACHE | CACHE READS } [ logging_clause ]
}
| allocate_extent_clause
| deallocate_unused_clause
| shrink_clause
}
[ storage_clause
| PCTVERSION integer
| RETENTION
| FREEPOOLS integer
| REBUILD FREEPOOLS
| { CACHE
| { NOCACHE | CACHE READS } [ logging_clause
]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
}
| allocate_extent_clause
| deallocate_unused_clause
| shrink_clause
]...
b o e t o [ key_compression ]
( u
s cen s [ alter_overflow_clause ]
a l e li [ { LOB (LOB_item)
b h | VARRAY varray
o d h }
s ub (LOB_parameters)
[ { LOB (LOB_item)
| VARRAY varray
}
(LOB_parameters)
]...
]
modify_table_partition { modify_range_partition
| modify_hash_partition
| modify_list_partition
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 ]
a ble
fe r
move_table_partition MOVE PARTITION partition
a ns
[ MAPPING TABLE ]
n- t r
[
[
table_partition_description ]
update_index_clauses ] a no
[ parallel_clause ]
h a s
m ) e.
o
move_table_subpartition MOVE SUBPARTITION .c
g i c t Guid
elo den ]
subpartition_spec
a r
[ update_index_clauses
[ iw
S tu ]
parallel_clause
le @ hi s
multi_column_for_loop b h a e t
FORs(dimension_column
d h . u [, dimension_column ]...)
o
b nse t o
s u
( ice
IN ( { (literal [, literal ]...)
[ (literal [, literal ]...)... ]
l e l
b ha |
}
subquery
o d h )
sub
multi_table_insert { ALL insert_into_clause
[ values_clause ]
[ insert_into_clause
[ values_clause ]
]...
| conditional_insert_clause
}
subquery
multiset_except nested_table1
MULTISET EXCEPT [ ALL | DISTINCT ]
nested_table2
multiset_intersect nested_table1
MULTISET INTERSECT [ ALL | DISTINCT ]
nested_table2
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
multiset_union nested_table1
MULTISET UNION [ ALL | DISTINCT ]
nested_table2
le
}
[ (object_properties)
r a b
| [ physical_properties ]
| [ column_properties ] ns fe
t r a
n-
]...
]
)
a no
a s
[ RETURN AS { LOCATOR | VALUE } ]
h
m ) e.
o id VALUES
new_values_clause
i c.c t G
{ INCLUDING | EXCLUDING
g
} u
NEW
[ + | -a
relo uden
number
{@ iw [ sdigit
]
S t ]... [ . ] [ digit [ digit ]...
hi
digit
h a le] t
e
.b |}u.sdigit [ digit ]...
o d h to[ e [ + | - ] digit [ digit ]... ]
b
su cens e
l e ( i
[ f | d ]
ha l
h b
o dnumeric_file_name +diskgroup_name.filenumber.incarnation_number
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
[ OID_index_clause ]
[ physical_properties ]
[ table_properties ] ;
relo uden
| attribute inline_constraint
[ inline_constraint ]...
} a
iw s St
@
thi
]...
h)a le
.b us e
o d h t o
OID_clause
s u b nse OBJECT IDENTIFIER IS
h al li
h b
b o dOID_index_clause OIDINDEX [ index ]
({ physical_attributes_clause
s u | TABLESPACE tablespace
}
[ physical_attributes_clause
| TABLESPACE tablespace
]...
)
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
[, PARTITION
[ partition
[ { segment_attribute_clause
| key_compression
}
[ segment_attribute_clause
| key_compression
]...
]
[ index_subpartition_clause ]
]...
]
)
a ble
fe r
on_hash_partitioned_table { STORE IN (tablespace[, tablespace ]...)
a ns
| (PARTITION
n- t r
[, PARTITION a no
[ partition [ TABLESPACE tablespace ] ]
a s
[ partition [ TABLESPACE tablespace ] ]
h
]...
m ) e.
o
c.c t Guid
)
}
g i
a r elo den
on_list_partitioned_table iw s Stu
( PARTITION
@
h a le [th{i segment_attributes_clause
[ partition
h . b u se | key_compression
b o d to }
s u ens e [ segment_attributes_clause
l e ( i c | key_compression
h a l ]...
h b ]
b o d ]
su [, PARTITION
[ partition
[ { segment_attributes_clause
| key_compression
}
[ segment_attributes_clause
| key_compression
]...
]
]
]...
)
on_object_clause { schema.object
| { DIRECTORY directory_name
| JAVA { SOURCE | RESOURCE } [ schema. ]object
}
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
on_range_partitioned_table ( PARTITION
[ partition
[ { segment_attributes_clause
| key_compression
}
[ segment_attributes_clause
| key_compression
]...
]
]
[, PARTITION
[ partition
[ { segment_attributes_clause
a ble
| key_compression
fe r
}
[ segment_attributes_clause
a ns
| key_compression
n- t r
]...
a no
]
]
h a s
]...
m ) e.
o
c.c t Guid
)
g i
order_by_clause
elo ] BYn
positiond|ec_alias }
ORDER [ SIBLINGS
{ expr |ar
[ ASCiw| DESC S]t
u
@
le[ NULLS s
i | NULLS LAST ]
h a thFIRST
[,e{ expr | position | c_alias }
d h .b us [ ASC | DESC ]
o
b nse t o
s u [ NULLS FIRST | NULLS LAST ]
e ( lice
]...
a l
h bh
out_of_line_constraint [ CONSTRAINT constraint_name ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 ]...)
]
le
[ OUTER ]
r a b
parallel_clause { NOPARALLEL | PARALLEL [ integer ] }
ns fe
t r a
parallel_enable_clause PARALLEL_ENABLE no n-
[ (PARTITION argument BY s a
{ ANY h a
) e.
m
| { HASH | RANGE } (column [, column ]...)
o
}
g i c.c t Guid
relo uden
)
[ streaming_clause ]
] a
iw s St
@
le thi tablespace [, tablespace ]...
partial_database_recoveryha { TABLESPACE
e
d h .b |uDATAFILE
s
o
b nse t o { 'filename' | filenumber }
[, 'filename' | filenumber ]...
s u
e ( lice
}
h a l | STANDBY
sub
[, 'filename' | filenumber ]...
}
}
UNTIL [ CONSISTENT WITH ] CONTROLFILE
}
partition_attributes [ { physical_attributes_clause
| logging_clause
| allocate_extent_clause
| deallocate_unused_clause
| shrink_clause
}
[ physical_attributes_clause
| logging_clause
| allocate_extent_clause
| deallocate_unused_clause
| shrink_clause
]...
]
[ OVERFLOW
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 }
a ble
modify_LOB_parameters
fe r
[ { LOB LOB_item | VARRAY varray }
modify_LOB_parameters
a ns
]...
n- t r
]
a no
h a s
partition_extended_name
) e.
[ schema.] { table | view }
m
o
[ PARTITION (partition)
g i c.c t Guid
| SUBPARTITION (subpartition)
relo uden
]
a t hash_subpartition_quantity
iw sINS(tablespace[,
partition_level_subpartition { SUBPARTITIONS
l @
[ STORE
h i
e| (subpartition_spec[, tablespace ]...) ]
a
h } se t subpartition_spec ]...)
. b
h to u
o d
(
partition_specs ub ense PARTITION [ partition ]
h a le lic [ table_partition_description ]
h b
b o dpartitioning_storage_clause [ { TABLESPACE tablespace
su | OVERFLOW [ TABLESPACE tablespace ]
| LOB (LOB_item) STORE AS
{ LOB_segname [ (TABLESPACE tablespace) ]
| (TABLESPACE tablespace)
}
| VARRAY varray_item STORE AS LOB LOB_segname
}
[ { TABLESPACE tablespace
| OVERFLOW [ TABLESPACE tablespace ]
| LOB (LOB_item) STORE AS
{ LOB_segname [ (TABLESPACE tablespace)
]
| (TABLESPACE tablespace)
}
| VARRAY varray_item STORE AS LOB
LOB_segname
}
]...
]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 }
}
d h .b us storage_clause
o t o
ub ense
| { ONLINE | OFFLINE }
( s | extent_management_clause
hal
e lic | segment_management_clause
h b | flashback_mode_clause
o d ]...
sub
}
physical_properties { segment_attributes_clause
[ table_compression ]
| ORGANIZATION
{ HEAP
[ segment_attributes_clause ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
[ table_compression ]
| INDEX
[ segment_attributes_clause ]
index_org_table_clause
| EXTERNAL
external_table_clause
}
| CLUSTER cluster (column [, column ]...)
}
le
({ method_name | DEFAULT } ,
{ RNDS | WNDS | RNPS | WNPS | TRUST }
r a b
)
[, { RNDS | WNDS | RNPS | WNPS | TRUST } ]...
ns fe
t r a
no n-
procedure_declaration PROCEDURE name (parameter datatype
s a
h
) e.a
[, parameter datatype ]...)
{ IS | AS } { pl/sql_block | call_spec }
o m
PROCEDURE namegic
.c Guid
procedure_spec
lo en[,t parameter datatype ]...)
(parameteredatatype
r
i w Stud
[ { IS |a AS } call_spec ]
a l e@ this
proxy_authentication
h . bh {|uAUTHENTICATION
se REQUIRED
b o d to { PASSWORD
AUTHENTICATED USING
su cens e
e ( | DISTINGUISHED NAME
h b [ VERSION 'version' ]
b o d }
su
}
qualified_disk_clause search_string
[ NAME disk_name ]
[ SIZE size_clause ]
[ FORCE | NOFORCE ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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. ]
a ble
{ table [ { PARTITION (partition)
fe r
| SUBPARTITION (subpartition)
a ns
}
n- t r
no
[ sample_clause ]
| [ sample_clause ]
s a
| @ dblink
] h a
) e.
o m
| { view | materialized view } [ @ dblink ]
}
g i c.c t Guid
relo uden
| (subquery [ subquery_restriction_clause ])
} a
| table_collection_expression
iw s St
le @ hi
h a e t
quiesce_clauses
d h .b QUIESCE
u s RESTRICTED | UNQUIESCE
b o se t o
( u
s cen
range_partitioning PARTITION BY RANGE (column[, column ]...)
a l e li (PARTITION [ partition ]
b h range_values_clause
o d h table_partition_description
sub
[, PARTITION [ partition ]
range_values_clause
table_partition_description
]...
)
rebuild_clause REBUILD
[ { PARTITION partition
| SUBPARTITION subpartition
}
| { REVERSE | NOREVERSE }
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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')
a ble
| ONLINE
fe r
| COMPUTE STATISTICS
| physical_attributes_clause
a ns
| key_compression
n- t r
| logging_clause
a no
]...
h a s
m ) e.
o
c.c t Guid
records_per_block_clause { MINIMIZE | NOMINIMIZE } RECORDS_PER_BLOCK
g i
recover_clause
a r elo [ dFROM
{ { DISCONNECT e n SESSION ]
| {iw
S tu
TIMEOUT integer | NOTIMEOUT }
@ s
thi | DEFAULT DELAY | DELAY integer }
le| { NODELAY
}
h a e
d h .b ||uNEXT s integer
b o e o
t | parallel_clause
{ EXPIRE integer | NO EXPIRE }
e ( su cens
h a l l i | USING CURRENT LOGFILE
| UNTIL CHANGE integer
h b | THROUGH { [ THREAD integer ] SEQUENCE integer
b o d | ALL ARCHIVELOG
su | { ALL | LAST | NEXT } SWITCHOVER
}
}
[ { DISCONNECT [ FROM SESSION ]
| { TIMEOUT integer | NOTIMEOUT }
}
| { NODELAY | DEFAULT DELAY | DELAY integer }
| NEXT integer
| { EXPIRE integer | NO EXPIRE }
| parallel_clause
| USING CURRENT LOGFILE
| UNTIL CHANGE integer
| THROUGH { [ THREAD integer ] SEQUENCE
integer
| ALL ARCHIVELOG
| { ALL | LAST | NEXT } SWITCHOVER
}
] ...
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
recovery_clauses { general_recovery
| managed_standby_recovery
| BEGIN BACKUP
| END BACKUP
}
redo_log_file_spec [ 'filename'
| ('filename' [, 'filename' ]...)
]
[ SIZE size_clause ]
[ REUSE ]
a ble
redo_thread_clauses { ENABLE | DISABLE }
fe r
{ INSTANCE 'instance_name'
a ns
| [ PUBLIC ] THREAD integer
n- t r
no
}
s a
reference_model h
) e.a
REFERENCE reference_spreadsheet_name
ON (subquery)
o m
g i c.c t G]uid
spreadsheet_column_clauses
relo uden
[ cell_reference_options
a t
iw s[Sschema.
references_clause
e @
REFERENCES
l [ON DELETEi
] { object_table | view }
h a [
e th { CASCADE | SET]NULL } ]
(column [, column ]...)
d h .b [uconstraint_state
s
o t o ]
( s ub ense
h a le
referencing_clause
lic REFERENCING
h b { OLD [ AS ] old
b o d | NEW [ AS ] new
| PARENT [ AS ] parent }
s u [ OLD [ AS ] old
| NEW [ AS ] new
| PARENT [ AS ] parent ]...
register_logfile_clause REGISTER
[ OR REPLACE ]
[ PHYSICAL | LOGICAL ]
LOGFILE
[ file_specification
[, file_specification ]...
]
FOR logminer_session_name
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
a ble
| out_of_line_ref_constraint
fe r
| supplemental_logging_props
}
a ns
]...
n- t r
a no
relational_table CREATE [ GLOBAL TEMPORARY ] a
h s [ schema.
TABLE
]table
m ) ]e.
o
.c G
[ (relational_properties)
[ ON COMMIT {icDELETE | u id
PRESERVE } ROWS ]
g t
relo uden ] ;
[ physical_properties ]
a
[ table_properties
iw s St
@ hi old_name TO new_name
leRENAME tCOLUMN
rename_column_clause
h a e
d h .b us
o t o
b nse RENAME { PARTITION partition
s u
rename_index_partition
( ice | SUBPARTITION subpartition }
l e l
b ha TO new_name
o d h
sub
rename_partition_subpart RENAME { PARTITION | SUBPARTITION }
current_name TO new_name
resize_disk_clauses RESIZE
{ ALL [ SIZE size_clause ]
| DISK
disk_name [ SIZE size_clause ]
[, disk_name [ SIZE size_clause ] ]...
| DISKS IN FAILGROUP
failgroup_name [ SIZE size_clause ]
[, failgroup_name [ SIZE size_clause ] ]...
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 }
}
a ble
fe r
restricted_session_clauses { ENABLE | DISABLE } RESTRICTED SESSION
a ns
n- t r
return_clause
no
{ RETURN datatype [ { IS | AS } call_spec ]
| sqlj_object_type_sig a
}
h a s
m ) e.
RETURN { UPDATED |.c o uid
return_rows_clause
g i c ALLt }GROWS
lo [, expr
reexpr e n ]...
returning_clause RETURNINGa d
tu[, data_item ]...
INTO iw S
@ data_item
s
h a le
e thi
revoke_object_privileges
d h .b {uobject_privilege
s | ALL [ PRIVILEGES ] }
b o e o
t ]...
[, { object_privilege | ALL [ PRIVILEGES ] }
e ( su cens
h a l l i on_object_clause
FROM grantee_clause
h b [ CASCADE CONSTRAINTS | FORCE ]
o d
sub revoke_system_privileges { system_privilege
| role
| ALL PRIVILEGES
}
[, { system_privilege
| role
| ALL PRIVILEGES
}
]...
FROM grantee_clause
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
row_movement_clause { ENABLE | DISABLE } ROW MOVEMENT
{a
re ude | NONE }
security_clause GUARDiw
S t
ALL | STANDBY
le @ hi s
h a e t
segment_attributes_clause
d h .b {|uphysical_attributes_clause
s
o t o TABLESPACE tablespace
b nse | logging_clause
s u
( ice }
l e l
b ha [ physical_attributes_clause
| TABLESPACE tablespace
o d h | logging_clause
sub ]...
select_list { *
| { query_name.*
| [ schema. ]
{ table | view | materialized view } .*
| expr [ [ AS ] c_alias ]
}
[, { query_name.*
| [ schema. ]
{ table | view | materialized view } .*
| expr [ [ AS ] c_alias ]
}
]...
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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
}
s a
shutdown_dispatcher_clause h
) e.a
SHUTDOWN [ IMMEDIATE ] dispatcher_name
o m
simple_case_expression
g i c.c t Guid
expr WHEN comparison_expr
o en
relcomparison_expr
THEN return_expr
i a
[ WHEN
tud
wTHEN return_expr
S
e @ i s ]...
b h al e th
single_column_for_loop
d h. toFOR u{sdimension_column
u b o s e IN ( { literal
h a l li | subquery
h b }
o d )
sub
| [ LIKE pattern ]
FROM literal TO literal
{ INCREMENT | DECREMENT } literal
}
single_table_insert insert_into_clause
{ values_clause [ returning_clause ]
| subquery
}
size_clause integer [ K | M | G | T ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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,
a ble
subpartition_spec
fe r
)
a ns
]
[ update_index_clauses ]
n- t r
[ parallel_clause ]
a no
h a s
UPDATE MANUALLY problem importing file
sql_statement_clause { { statement_option | ALL
m ) } .]...
}
| ALL e
[, { statement_option o id
| { system_privilege
g i c.c |t ALL
G uALL
PRIVILEGES }
r e l o
[, { system_privilege
e n | PRIVILEGES } ]...
wa Stud ]
}
i
[ auditing_by_clause
a l e@ this
sqlj_object_type
h . bh EXTERNAL
u e NAME java_ext_name LANGUAGE JAVA
sUSING
b o d to (SQLData | CustomDatum | OraData)
su cens e
e (
hal li
sqlj_object_type_attr EXTERNAL NAME 'field_name'
h b
b o dsqlj_object_type_sig RETURN { datatype | SELF AS RESULT }
s u EXTERNAL { VARIABLE NAME
'java_static_field_name'
| NAME 'java_method_sig'
}
standby_database_clauses ( activate_standby_db_clause
| maximize_standby_db_clause
| register_logfile_clause
| commit_switchover_clause
| start_standby_clause
| stop_standby_clause
)
[ parallel_clause ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
| INITIAL [ scn_value ]
| { SKIP FAILED TRANSACTION | FINISH }
]
a ble
stop_standby_clause { STOP | ABORT }
fe r
LOGICAL STANDBY APPLY
a ns
n- t r
storage_clause STORAGE o
({ INITIAL integer [ K | M ]
s an
| MINEXTENTS integer) ha
| NEXT integer [ K | M ]
o m ide.
| MAXEXTENTS { integer | UNLIMITED }
c
i c. t Gu
| PCTINCREASE integer
g
relo uden
| FREELISTS integer
a
| FREELIST GROUPS integer
iw s St
| OPTIMAL [ integer [ K | M ]
@
le thi
| NULL
h a e ]
hal
e lic | NEXT integer [ K | M ]
| MINEXTENTS integer
h b | MAXEXTENTS { integer | UNLIMITED }
o d
sub
| PCTINCREASE integer
| FREELISTS integer
| FREELIST GROUPS integer
| OPTIMAL [ integer [ K | M ]
| NULL
]
| BUFFER_POOL { KEEP | RECYCLE | DEFAULT }
]...
)
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
subpartition_by_list SUBPARTITION BY LIST (column)
[ subpartition_template ]
relo uden
| function_declaration
| constructor_declaration
} a
iw s St
@
le{ MEMBERth|i STATIC }
h a
subprogram_spec
h . se
b {uprocedure_spec
o d t o | function_spec }
( s ub ense
subqueryle
h a lic [ subquery_factoring_clause ]
h b SELECT
b o d [ hint ]
[ { { DISTINCT | UNIQUE }
s u | ALL
}
]
select_list
FROM table_reference
[, table_reference ]...
[ where_clause ]
[ hierarchical_query_clause ]
[ group_by_clause ]
[ HAVING condition ]
[ model_clause ]
[ { UNION [ ALL ]
| INTERSECT
| MINUS
}
(subquery)
]
[ order_by_clause ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
subquery_factoring_clause WITH query_name AS (subquery)
[, query_name AS (subquery) ]...
h a le }
e thi
d h .b us
]...
o t)
o
( s ub ense COLUMNS
h a le lic
h b
supplemental_log_grp_clause GROUP log_group
b o d (column [ NO LOG ]
[, column [ NO LOG ] ]...)
s u [ ALWAYS ]
supplemental_logging_props { supplemental_log_grp_clause
| supplemental_id_key_clause
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
}
[, SUPPLEMENTAL LOG
{ supplemental_id_key_clause
| GROUP log_group
}
]...
}
a ble
fe r
table_index_clause [ schema. ]table [ t_alias ]
a ns
(index_expr [ ASC | DESC ]
[, index_expr [ ASC | DESC ] ]...) n- t r
[ index_properties ]
a no
h a s
table_partition_description [ segment_attributes_clause
m ) ] e.
[ table_compressionc| o
. Guid
key_compression ]
i
g ntc
[ OVERFLOW [ segment_attributes_clause ] ]
l o
re ude
[ { LOB_storage_clause
a t
| varray_col_properties
} iw
@ s S
h a e thi
le [| LOB_storage_clause
d h .b us]...
varray_col_properties
o t o
b nse ][ partition_level_subpartition ]
s u
a l e ( lice
h bh
b o dtable_partitioning_clauses { range_partitioning
| hash_partitioning
s u | list_partitioning
| composite_partitioning
}
table_properties [ column_properties ]
[ table_partitioning_clauses ]
[ CACHE | NOCACHE ]
[ parallel_clause ]
[ ROWDEPENDENCIES | NOROWDEPENDENCIES ]
[ enable_disable_clause ]
[ enable_disable_clause ]...
[ row_movement_clause ]
[ AS subquery ]
table_reference { ONLY
(query_table_expression)
[ flashback_query_clause ]
[ t_alias ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
| query_table_expression
[ flashback_query_clause ]
[ t_alias ]
| (join_clause)
| join_clause
}
le
[, file_specification ]...
| default_tablespace
r a b
| default_temp_tablespace
| undo_tablespace ns fe
t r a
n-
}
a no
tablespace_group_clause
a s
TABLESPACE GROUP { tablespace_group_name
h
| '' }
m ) e.
o
tablespace_logging_clauses { logging_clause .c
i c t Guid
| [ NO ] FORCEgLOGGING
}
a relo uden
@ iw s St
tablespace_retention_clause le
h a thi { GUARANTEE | NOGUARANTEE }
RETENTION
e
d h .b us
o t o
ub ense | OFFLINE [ NORMAL | TEMPORARY | IMMEDIATE ]
tablespace_state_clauses { ONLINE
( s
h a le lic }
o d | { PERMANENT | TEMPORARY }
text [ N | n ]
{ 'c [ c ]...'
| { Q | q }
'quote_delimiter c [ c ]... quote_delimiter'
}
trace_file_clause TRACE
[ AS 'filename' [ REUSE ] ]
[ RESETLOGS | NORESETLOGS ]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
truncate_partition_subpart TRUNCATE { PARTITION partition
| SUBPARTITION subpartition
}
[ { DROP | REUSE } STORAGE ]
[ update_index_clauses [ parallel_clause ] ]
a ble
undo_tablespace_clause UNDO TABLESPACE tablespace
fe r
[ DATAFILE file_specification
a n s
]
[, file_specification ]...
n- t r
[ extent_management_clause ]
a no
[ tablespace_retention_clause ]
h a s
m ) e.
o
c.c t Guid
undrop_disk_clause UNDROP DISKS
g i
update_all_indexes_clause
rel(o {uupdate_index_partition
UPDATE INDEXES
a d en
@ iw s S|t update_index_subpartition
[ (index
h a le
e thi ) }
d h .b us )
o
b nse t o
s u
( ice
[, (index ( { update_index_partition
| update_index_subparition
l e l
b ha )
}
o d h )
sub
]...
update_index_clauses { update_global_index_clause
| update_all_indexes_clause
}
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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)
le
| column = { expr | (subquery) | DEFAULT
}
r a b
}
]... ns fe
t r a
n-
| VALUE (t_alias) = { expr | (subquery) }
}
a no
a s]
UPGRADE [ [NOT ] INCLUDING hDATA
upgrade_table_clause
[ column_propertiesm
) e.
o ]
g i c.c t Guid
using_function_clause
relo u]d[enpackage. | type.
USING [ schema.
a
iw s St
]function_name
@
h a e thi
leUSING INDEX
using_index_clause
d h .b u{s[ schema. ]index
o
b nse t o | (create_index_statement)
( s u e | index_properties
a l e li c }
b h
d h
o using_statistics_type
s ub USING { [ schema. ] statistics_type | NULL }
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Subclause Syntax
varray_col_properties VARRAY varray_item
{ [ substitutable_column_clause ]
STORE AS LOB
{ [ LOB_segname ] (LOB_parameters)
| LOB_segname
}
| substitutable_column_clause
}
b o d )
s u
XMLSchema_spec [ XMLSCHEMA XMLSchema_URL ]
ELEMENT { element | XMLSchema_URL # element }
XMLType_storage STORE AS
{ OBJECT RELATIONAL
| CLOB [ { LOB_segname [ (LOB_parameters) ]
| LOB_parameters
}
]
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 ]
le
WITH OBJECT IDENTIFIER
{ DEFAULT | ( expr [, expr ]...) }
r a b
ns fe
t r a
on-
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
_________________
Appendix E
Acronyms and
Terms
_________________
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
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 le
Automatic Shared A feature of the Oracle database that automates the management r a b
Memory Management of the most important shared memory structures used by an ns fe
Oracle database instance t r a
Automatic Storage o n-
A mechanism that provides a vertical integration of the file
Management an
system and the volume manager, specifically built for the Oracle
s
database files ) ha
Automatic Database o m ide.
A utility that performs a top-down instance analysis, identifies
c
Diagnostic Management i c. t Gu
problems and potential causes, and makes recommendations for
g
fixing the problems
a r elo den
Automatic Tuning
Optimizer @ iw s Stu
A database feature that performs various analyses of SQL
performance within the database
Automatic Workload h a le
e thi
An infrastructure that collects, processes, and maintains
Repository d h .b us
performance statistics for problem detection and self-tuning
o t o
( s ub ense purposes
Auxiliary ldatabase A database that is used when creating a duplicate database or
h a e lic performing tablespace point-in-time recovery
h
AWR
b Automatic Workload Repository
b d
o Backup piece
u An individual file that is part of a backup set
s Backup set A copy of one or more data or archived log files. It differs from
image copies in that empty blocks are not stored.
Block change tracking A feature that uses the change tracking writer (CTWR)
background process to record the physical location of all database
changes in a separate file
Block corruption Corruption of a data block. A corrupted data block is a block that
is not in a recognized Oracle format, or whose contents are not
internally consistent.
Block Media Recovery A recovery method that reduces the smallest recoverable unit of
media recovery from a data file to a block
BMR Block Media Recovery
Buffer cache A region of memory that caches blocks of data retrieved from the
database
CFS Cluster File Storage
Instance
h a le lic The collection of shared memory and processes used to access the
h b Oracle database
o d
sub IPC
isqlplusctl
Internal Process Communication
Control utility for starting and stopping iSQL*Plus listener
processes
ISV Independent software vendor
Java pool A region of memory in the SGA that is used for all session-
specific Java code and data within the Java Virtual Machine
(JVM)
JDBC Java Database Connectivity
jnnn Job Queue Processes. They execute scheduled jobs.
Keep buffer cache An area of memory in the SGA used to cache data in the buffer
cache for longer periods of time
Language and Character A statistic-based utility for determining the language and
Set File Scanner character set for unknown file text
Large pool An optional memory storage area used for buffering large I/O
requests
LCSSCAN Language and Character Set File Scanner
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Where Do You Go from Here?
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 2
Continuing Education Resources
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 3
Oracle University
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 4
Continuing Your Education
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 5
Oracle University Knowledge Center
( s ub ense
h a le
Oracle University ic
lKnowledge Center
b
h University Knowledge Center contains thousands of hours of content on a variety
Oracle
o d
sub of topics. This content can be accessed 24/7 via the Web and is a great way to refresh your
memory on things that you may not have worked with for a while or to learn about new
concepts.
Additional content for the Oracle University Knowledge Center is being developed
continuously, so make sure to check back often to see what is new.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 6
Oracle Technology Network
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 7
Oracle Technology Training
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal li
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 8
Oracle by Example
• What is an OBE?
A set of hands-on, step-by-step instructions
• Where can I find them?
http://www.oracle.com//technology/obe
• What is ble
available? fe r a
a ns
Over 100
n- t r
database
a no
OBEs h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
halExampleli
Oracle by
b
o d h Oracle by Example (OBE) series provides hands-on, step-by-step instructions on how
The
sub to use various new features of Oracle products. OBEs help to reduce the time spent on
learning 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, Oracle Application Server, and Oracle Collaboration Suite. OBEs can be
accessed at http://www.oracle.com/technology/obe.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 9
Oracle Magazine
• Free subscription
• Oracle Magazine Archives
http://www.oracle.com/technology/oramag/index.html
a ble
fe r
a n s
n- t r
a no
h a s
m ) e.
o
g i c.c t Guid
a relo uden
@ iw s St
h a le
e thi
d h .b Copyrightu©s2008, Oracle. All rights reserved.
b o e to
e ( su cens
hal
Oracle Magazine li
b
h the many different types of resources to which you have access from OTN is
Among
o d
sub Oracle Magazine. You can receive your free subscription also by mail.
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 10
Oracle Applications Community
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 11
Technical Support: Oracle MetaLink
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 12
Thank You!
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I F - 13
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Index
a ble
fe r
a ns
n- t r
o
s an
) ha
c o m ide.
g i c. t Gu
a relo uden
@ iw s St
h a le
e thi
d h .b us
o t o
( s ub ense
hal
e lic
h b
o d
sub
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
A
ADDM 8-29, 12-2, 12-5, 12-9, 12-10, 12-13, 12-15, 12-16, 12-17, 12-18,
12-19, 12-22, 12-27, 12-28, 12-30, 12-32, 13-11
Alert 1-15, 1-16, 2-18, 4-2, 4-3, 4-5, 4-7, 4-8, 4-15, 4-19,
4-21, 4-24, 4-30, 4-31, 4-32, 4-35, 4-36, 5-18, 10-22, 10-27, 10-28,
12-2, 12-3, 12-5, 12-9, 12-11, 12-15, 12-18, 12-22, 12-23, 12-24, 12-25,
12-26, 12-27, 12-28, 12-29, 12-30, 12-31, 14-21, 16-3, 16-6, 16-8, 17-16
Archive 1-13, 1-15, 2-10, 3-15, 4-30, 5-7, 5-17, 5-27, 6-13,
14-2, 14-3, 14-9, 14-13, 14-19, 14-23, 14-24, 14-25, 14-26, 14-27, 14-28,
15-7, 15-8, 15-11, 15-17, 15-19, 16-8, 16-9, 16-10, 16-11, 16-12, 18-12
ARCn 1-13, 1-23, 14-13 r a ble
ASM 1-6, 1-7, 5-2, 5-11, 5-26, 5-27, 5-28, 5-29, 13-18, 13-19, n s fe
13-20 n - tra
ASMM 13-18, 13-19, 13-20 a no
h a s
ASSM 5-12, 5-13, 12-17, 13-2
m ) e.
o uid
ATO 1-16, 1-17, 1-18, 1-19, 1-21, 1-22, 2-2, 2-3, 2-13,
g i c.c 4-5,G
t 6-24,
e
4-14, 5-5, 5-13, 6-5, 6-6, 6-9, 6-11, 6-12,
r lo6-19, 6-23,
e n
7-10, 7-27, 7-30, 7-37, 8-12, 8-18,i a 8-27,
w8-22, S tud8-30, 9-6, 9-9,
9-10, 9-11, 10-2, 10-5, h a le@
10-6, h is 10-11, 10-19, 10-20, 10-22,
10-8, t10-10,
. b u s e
10-27, 11-2, 11-4,
o h
d 11-20,t12-3,
o 12-22, 13-3, 13-9, 13-19, 14-3, 14-6,
b
su 15-10,
14-10, 14-16, e
ns15-14, 15-16, 15-19, 16-3, 16-4, 16-6, 17-12
e ( c e
li 6-5, 6-13, 8-19, 10-2, 10-3, 10-4, 10-5,
hal 4-16, 6-3,
Audit 2-10,
b
h 10-7, 10-8, 10-11, 10-12, 10-13, 10-14, 10-15, 10-16, 10-17, 10-18, 10-19,
o d
sub 10-20, 10-21, 10-22, 10-23, 10-24, 10-25, 10-26, 10-27, 10-29, 10-30, 11-7,
17-19, 17-23, 17-26
Automatic Shared Memory Management 1-11, 13-2, 13-18, 13-19, 13-20,
13-21, 13-22, 13-28
Automatic Tuning Optimizer 13-9
Automatic Workload Repository 6-5, 12-2, 12-3, 12-4, 12-9, 12-12,
12-31
AWR 6-5, 12-2, 12-3, 12-4, 12-5, 12-9, 12-10, 12-11, 12-12, 12-13,
12-14, 12-15, 12-18, 12-22, 12-30, 13-12
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I Index - 2
B
Backup set 5-27, 15-7, 15-9, 15-10, 15-18
Block 1-10, 1-13, 1-14, 1-17, 1-19, 1-20, 1-21, 1-23, 3-10, 4-12,
4-16, 4-17, 4-30, 4-33, 5-2, 5-3, 5-4, 5-5, 5-7, 5-8, 5-12,
5-13, 5-24, 5-28, 5-29, 7-10, 7-28, 7-29, 7-30, 7-31, 8-13, 8-22,
8-27, 8-29, 8-31, 9-6, 9-7, 9-8, 9-11, 10-20, 11-7, 12-5, 13-24,
14-11, 14-16, 15-6, 15-7, 15-10, 17-7, 17-25, 18-3, 18-7, 18-11, 18-18,
18-28
Block change tracking 5-7, 15-10
Block corruption 4-30
Buffer cache 1-10, 1-11, 1-13, 1-14, 1-23, 4-17, 4-26, 6-13, 11-7, a ble
fe r
12-18, 12-19, 13-18, 13-22, 13-24, 14-11
a ns
n- t r
C
a no
Checkpoint 1-13, 4-25, 5-17, 12-15, 14-2, 14-11, 14-16, 14-17, a
h s
14-27
CKPT 1-13, 1-23, 14-11 m ) e.
o
.c Guid
Cluster 1-6, 1-7, 1-21, 2-5, 2-18, 5-26, 5-27, 7-39,ic 10-14,
g
lo ent
14-3, 18-12, 18-13, 18-29, 18-35 r e
Configuration assistant 2-4, 2-15, 2-19, i a
w3-2, S
3-5,
ud 14-20
t11-8,
l e @ his
Constraint 1-22, 7-2, 7-3, 7-13, a t 7-16, 7-17, 7-18,
h 7-14,se7-15,
. b
h 7-26, u7-34, 7-35, 7-37, 7-41, 7-44, 7-48,
7-19, 7-20, 7-23, o
b nse d7-24, t o
(
7-49, 8-19,s u17-12, e17-16, 17-19, 18-12, 18-13, 18-29
l e l i c
a 1-13, 1-15, 2-9, 2-10, 3-6, 3-11, 3-15, 4-16, 4-21,
hfile
Control
b
o d h 4-22, 4-23, 4-34, 5-7, 5-21, 5-27, 13-4, 14-11, 14-14, 14-15, 14-16,
sub 14-19, 14-20, 14-28, 15-5, 15-6, 15-10, 15-16, 15-17, 15-19, 16-2, 16-3,
16-4, 16-6, 16-7, 16-10, 16-13, 16-14, 17-9, 18-3, 18-6, 18-7, 18-9,
18-10, 18-12
CRS 2-18
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I Index - 3
D
Data block 1-14, 1-17, 1-19, 1-21, 5-3, 5-5, 5-12, 5-13, 9-6,
11-7, 14-11, 15-6, 15-7, 17-7
Data file 1-13, 1-14, 1-15, 1-17, 1-19, 1-20, 2-9, 2-10, 3-3,
3-6, 3-11, 3-15, 4-22, 4-23, 4-26, 4-28, 4-34, 5-2, 5-6, 5-7,
5-11, 5-17, 5-19, 5-21, 5-22, 5-24, 5-25, 5-27, 5-28, 5-29, 6-13,
9-8, 9-15, 11-7, 11-30, 12-25, 14-11, 14-14, 14-15, 14-16, 14-17, 14-19,
15-5, 15-6, 15-7, 15-10, 15-11, 15-16, 15-17, 16-2, 16-3, 16-4, 16-6,
16-10, 16-11, 16-12, 16-13, 16-14, 17-7, 17-9, 18-6, 18-7, 18-10, 18-11,
18-14, 18-25, 18-26, 18-32
Database Control 2-6, 2-18, 4-3, 4-4, 4-5, 4-6, 4-20, 4-24, r a ble
6-6, 6-20, 6-22, 8-12, 10-15, 12-10, 12-11, 12-20, 12-22, 12-23, 12-25, n s fe
12-26, 12-27, 12-29, 16-5, 16-9, 17-18, 18-3, 18-13, 18-16, 18-22 on-
tra
DBA 2-2, 2-3, 2-20, 3-3, 4-5, 4-6, 4-10, 4-11, 4-29, 5-22, s an
ha
5-26, 6-5, 6-9, 6-11, 6-13, 6-15, 6-19, 6-20, 6-21, 7-45,) 7-46,
c o m ide.
7-47, 8-8, 8-12, 8-19, 8-27, 9-9, 9-11, 10-2, 10-3,
g i c. 10-5,
t G u10-8,
10-9, 10-10, 10-11, 10-12, 10-14, 10-18,
a relo10-20,d n 10-27, 10-29, 11-18,
10-25,
e
w 12-11,
11-20, 11-25, 11-30, 12-5, 12-6, i12-10, S tu 12-18, 12-29, 13-3, 14-3,
@ s
a le 14-25,
14-5, 14-6, 14-8, 14-13,h14-14,
e thi 14-26, 15-3, 15-5, 17-12, 17-17,
18-35 d h .b us
o
b 3-2, t o
DBCA 2-4, 2-15,
( s u2-19,e n se3-5, 3-6, 3-7, 3-8, 3-9, 3-10,
a
3-11,
h lic 3-14, 3-15, 3-16, 3-17, 12-30, 14-20
le3-12, 3-13,
h b 1-13, 1-14, 1-23, 14-11, 14-12
b o d
DBWn
s u DDL 5-5, 5-19, 5-28, 7-20, 7-23, 7-25, 8-20, 10-16, 11-3, 11-5,
11-6, 12-8, 17-16, 17-25, 17-28, 18-9, 18-25, 18-26
Dedicated server 11-2, 11-7, 11-26, 11-27, 11-28, 11-30, 11-31
DML 5-16, 5-19, 6-16, 7-14, 7-16, 7-17, 7-19, 7-23, 7-29, 7-41,
8-3, 8-9, 8-19, 8-20, 8-25, 9-2, 9-3, 9-6, 9-17, 10-23, 13-27,
17-11, 17-16, 18-11, 18-12, 18-34
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I Index - 4
E
emctl 2-5, 4-4
Enterprise Manager 1-6, 1-7, 1-10, 1-12, 1-18, 2-4, 2-5, 2-18,
3-7, 3-12, 4-2, 4-3, 4-4, 4-5, 4-6, 4-8, 4-18, 4-20, 4-24,
4-29, 4-30, 4-33, 4-35, 4-36, 5-9, 5-14, 5-25, 6-6, 6-19, 6-20,
6-22, 6-25, 6-27, 7-3, 7-11, 7-12, 7-15, 7-21, 7-22, 7-24, 7-38,
7-42, 8-29, 8-31, 9-15, 10-15, 10-27, 11-2, 11-4, 11-8, 11-12, 11-31,
12-6, 12-7, 12-9, 12-10, 12-11, 12-12, 12-15, 12-20, 12-22, 12-23, 12-25,
12-26, 12-27, 13-2, 13-4, 13-10, 13-26, 13-27, 13-28, 13-29, 14-17, 15-8,
15-9, 15-16, 15-18, 17-10, 17-12, 17-13, 17-14, 17-18, 17-24, 17-27, 18-4,
18-8, 18-22, 18-30 r a ble
Enterprise Manager Database Control 2-18, 4-3, 4-20, 4-24, 6-6, n s fe
6-20, 6-22, 12-10, 12-11, 12-22, 12-23, 18-22 n - tra
Environment variable 2-7, 2-11, 2-12, 3-5, 4-10, 11-19, 18-20, s a
no
18-21 ) ha
c o m ide.
EXTPROC 11-3, 11-15
o ic.
g nt G u
e l
F
i w ar tude
FGA 10-3, 10-8, 10-11, 10-14, 10-18, @ 10-20,
i s S 10-22, 10-23, 10-24,
10-21,
l e h
10-25, 10-26, 10-27, b
. ha se t
17-19
d
Flash recovery areao3-9,
u 15-2, 15-9, 15-10, 15-12,
h14-23,to14-25,
( s
15-19, 15-20,ub17-7,
e n se
17-8
h a
Flashback
leDatabaselic15-19, 17-2, 17-4, 17-5, 17-6, 17-7, 17-8, 17-9,
h b
b d
o 17-10, 17-29
s u Flashback Drop 17-4, 17-5, 17-17, 17-18, 17-19
Flashback Table 7-24, 17-2, 17-5, 17-11, 17-12, 17-14, 17-15, 17-16,
17-17, 17-29
Flashback Transaction Query 17-2, 17-11, 17-12, 17-20, 17-23, 17-26,
17-27, 17-28, 17-29
Flashback Versions Query 17-2, 17-11, 17-12, 17-20, 17-23, 17-24, 17-25,
17-27, 17-29, 17-30
G
Globalization support 2-12, 2-13
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I Index - 5
I
Image copy 15-7, 15-9, 15-12
Incarnation 15-17
Index 1-19, 1-20, 1-21, 2-12, 5-5, 5-15, 5-27, 7-2, 7-3, 7-9,
7-13, 7-14, 7-16, 7-18, 7-23, 7-24, 7-25, 7-26, 7-27, 7-28, 7-29,
7-30, 7-31, 7-32, 7-33, 7-34, 7-35, 7-37, 7-41, 7-42, 7-43, 7-44,
7-47, 7-48, 7-49, 8-23, 10-4, 11-30, 12-5, 12-17, 12-19, 13-9, 13-16,
13-17, 13-26, 13-27, 13-29, 15-10, 17-3, 17-12, 17-16, 17-18, 17-19, 18-11,
18-17, 18-26, 18-29, 18-31
Instance 1-3, 1-7, 1-8, 1-9, 1-10, 1-11, 1-12, 1-13, 1-14,
1-15, 1-21, 2-5, 2-6, 2-10, 2-11, 2-15, 2-18, 3-4, 3-7, 4-1, r a ble
4-3, 4-7, 4-15, 4-17, 4-20, 4-21, 4-22, 4-23, 4-24, 4-25, 4-26, n s fe
4-27, 4-28, 4-29, 4-32, 4-34, 4-36, 6-2, 6-5, 6-13, 6-23, 6-30, n - tra
7-37, 9-4, 9-6, 9-7, 9-9, 9-11, 10-14, 10-19, 11-3, 11-4, 11-9,s a
no
ha 12-29, 13-6,
11-15, 11-16, 11-18, 11-30, 12-5, 12-10, 12-15, 12-19,) 12-25,
c o m ide.
13-24, 13-25, 14-2, 14-4, 14-6, 14-10, 14-11,ic . 14-14,
14-13,
G u 14-15, 14-16,
g t
a relo15-17,
14-17, 14-19, 14-20, 14-23, 14-26, 14-27,
d e n15-19, 16-3, 16-4, 16-5,
iw s Stu
16-6, 16-7, 16-8, 16-10, 16-12, 18-27
@
IPC 11-15 h a le
e thi
h b 4-8,u4-9,
.4-2, s 4-10, 4-11, 4-35,
o
b nsed
iSQL*Plus 2-4, 2-5, 2-15, t o
4-36, 8-9(su
a
isqlplusctl l e 4-9 lice
2-5,
b h
oJ d h
s ub
Java pool 1-10, 1-11, 1-13, 12-19, 13-18
JDBC 1-7, 11-3
L
Large pool 1-10, 1-11, 1-13, 11-27, 11-28, 12-19, 13-18
Library cache 12-18, 13-14, 13-15
Listener 2-5, 2-15, 4-3, 4-6, 4-7, 4-9, 11-2, 11-3, 11-4,
11-5, 11-6, 11-7, 11-8, 11-9, 11-10, 11-11, 11-12, 11-13, 11-14, 11-15,
11-16, 11-18, 11-22, 11-23, 11-25, 11-26, 11-27, 11-31, 11-32, 14-7
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I Index - 6
L
Lock 1-7, 1-10, 1-13, 1-14, 1-17, 1-19, 1-20, 1-21, 1-23, 2-15,
3-10, 3-12, 3-17, 4-12, 4-16, 4-17, 4-30, 4-32, 4-33, 5-2, 5-3,
5-4, 5-5, 5-7, 5-8, 5-12, 5-13, 5-24, 5-28, 5-29, 6-3, 6-4,
6-10, 6-25, 6-28, 7-10, 7-28, 7-29, 7-30, 7-31, 7-41, 7-46, 8-2,
8-3, 8-9, 8-10, 8-13, 8-21, 8-22, 8-23, 8-24, 8-25, 8-26, 8-27,
8-28, 8-29, 8-30, 8-31, 8-32, 8-33, 8-34, 9-6, 9-7, 9-8, 9-11,
10-7, 10-20, 11-7, 12-5, 12-8, 12-15, 13-24, 13-25, 14-6, 14-11, 14-16,
15-6, 15-7, 15-10, 16-4, 17-7, 17-16, 17-25, 18-3, 18-7, 18-11, 18-12,
18-18, 18-28
a ble
M
fe r
Media management library 15-8, 15-9 a ns
n- t r
Memory Advisor 12-19, 13-2, 13-18, 13-21, 13-22, 13-28
a no
Metric 1-6, 4-7, 4-31, 4-32, 5-26, 6-3, 6-8, 10-7, 12-4, 12-9,
h a s
12-14, 12-22, 12-23, 12-24, 12-26, 12-27, 12-29, 13-3 m ) e.
o
MML 15-8
g i c.c t Guid
MMON 1-13, 1-20, 2-5, 2-10, 5-15, 6-3, 6-27,
o 7-8,
rel7-4, e n7-14,
a
iw 11-3, tu d
7-27, 8-10, 8-18, 8-28, 10-14,@
le
10-28,
hi s S 11-13, 11-15, 11-27, 11-30,
t 14-3, 15-8
. b ha 12-29,
12-9, 12-10, 12-15, 12-18,
s e 13-3,
dh 14-16,
MTTR 12-18, 12-19,o14-3, to u14-17
N ( s ub ense
hal
e lic
b Language Support 2-12
National
h
b d
o netca 2-19
s u
NLS 2-11, 2-12, 2-13
NLS_LANG 2-11, 2-12
NMP 6-25, 11-15, 12-27
O
OC4J 2-15, 2-18, 4-10
OMF 3-8, 5-7, 5-21, 14-20, 16-8
Optimizer statistics 8-18, 12-4, 12-5, 12-6, 12-7, 12-8, 12-30
Oracle Managed Files 3-8, 5-7, 14-20
Oracle Net 2-3, 2-4, 2-12, 2-15, 2-19, 3-10, 6-24, 11-1, 11-2,
11-3, 11-4, 11-5, 11-6, 11-8, 11-9, 11-13, 11-14, 11-15, 11-17, 11-18,
11-19, 11-20, 11-21, 11-22, 11-23, 11-25, 11-31, 11-32, 12-15, 14-24
Oracle Shared Server 11-26, 11-28, 11-30
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I Index - 7
O
ORACLE_BASE 2-11, 18-21
ORACLE_HOME 2-7, 2-11, 4-4, 4-9, 4-10, 4-21, 6-28, 10-25, 11-4,
11-16, 11-19, 11-25, 18-21
ORACLE_SID 2-11, 3-14, 18-21
OUI 2-2, 2-4, 2-13, 2-14, 2-15, 2-18, 2-19, 2-20, 4-9
P
Package 2-7, 2-13, 5-13, 6-11, 8-13, 8-16, 8-17, 8-18, 8-19,
10-8, 10-9, 10-10, 10-20, 10-24, 12-6, 12-9, 12-11, 12-21, 13-26, 18-3,
18-13, 18-17, 18-30
a ble
Parallelization 18-33
fe r
PGA 1-10, 1-11, 1-12, 1-23, 4-17, 11-7, 11-27, 11-28, 12-18, 12-19, a ns
n- t r
13-18, 13-22, 13-25
a no
PGA Advisor 12-18, 13-22 a s
PMON 1-13, 1-23, 14-6 m ) h e.
i
Privilege 4-6, 4-23, 5-14, 5-21, 6-2, 6-3, 6-5, 6-6, 6-7,c .co Guid
l o g nt
a r
6-9, 6-11, 6-12, 6-13, 6-14, 6-15, 6-16, e6-17, e 6-19, 6-20,
6-18,
d
6-21, 6-22, 6-23, 6-24, 6-25, @ iw6-29,s 6-31,
6-27,
t u
S 7-23, 7-24, 7-45,
7-46, 10-2, 10-3, 10-5,
le
a 10-8,
h10-6, e hi
t10-9, 10-10, 10-11, 10-12, 10-15,
. b
h 10-25, u s
d
10-16, 10-18, 10-20,
o t o 10-27, 10-29, 12-21, 13-10, 14-5, 14-26, 17-12,
(
18-5, 18-21s ub ense
h
Procedurea lic4-17, 5-13, 6-11, 6-13, 6-16, 6-21, 7-8,
le1-2, 1-21,
h b
b d
o 7-44, 8-10, 8-13, 8-15, 8-16, 8-18, 8-19, 10-5, 10-11, 10-16, 10-20,
s u 10-21, 10-22, 12-11, 12-21, 13-26, 14-3, 17-3
Profile 6-2, 6-3, 6-4, 6-6, 6-7, 6-11, 6-17, 6-23, 6-24,
6-25, 6-26, 6-27, 6-28, 6-29, 6-31, 6-32, 11-13, 11-28, 13-9, 13-10
Program Global Area 1-10, 1-11, 1-23, 4-17, 11-7, 12-19, 13-18,
13-22
R
Recovery Manager 2-4, 2-5, 3-15, 5-27, 11-30, 15-3, 15-4, 15-8
Recycle bin 6-30, 7-24, 14-9, 17-4, 17-17, 17-18, 17-19
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I Index - 8
R
Redo 1-10, 1-13, 1-15, 1-23, 2-9, 2-10, 3-6, 3-15, 4-22, 4-23,
4-26, 4-28, 4-29, 4-32, 5-7, 5-13, 6-13, 8-30, 9-2, 9-8, 9-17,
13-24, 14-2, 14-9, 14-11, 14-12, 14-13, 14-14, 14-15, 14-16, 14-17, 14-18,
14-19, 14-21, 14-22, 14-23, 14-26, 14-27, 14-28, 15-5, 15-16, 15-17, 15-19,
16-2, 16-3, 16-4, 16-5, 16-6, 16-8, 16-9, 16-13, 16-14, 17-7, 17-16,
18-12
Redo log buffer 1-10, 13-24, 14-12
Resource Manager 6-4, 6-24, 12-30
RMAN 1-3, 1-7, 1-8, 2-3, 2-5, 2-8, 3-3, 3-15, 4-2, 4-5,
4-7, 4-16, 4-17, 4-32, 4-33, 4-34, 4-35, 5-7, 5-10, 5-15, 5-26, r a ble
5-27, 6-6, 6-32, 7-18, 7-26, 7-37, 8-9, 8-16, 8-29, 9-6, 9-7, n s fe
10-11, 10-12, 10-16, 10-18, 10-22, 10-26, 12-4, 12-5, 12-9, 12-10, o n -tra
12-13,
12-16, 12-17, 12-18, 12-19, 12-20, 12-32, 13-1, 13-2, 13-3, s a n13-5,
13-4,
)
13-6, 13-7, 13-8, 13-11, 13-15, 13-16, 13-18, 13-23, 13-24,ha13-25, 13-26,
c o m ide.
13-28, 13-29, 14-17, 14-21, 14-22, 15-3, 15-4, i . 15-9,
c15-8, G u 15-10, 15-12,
g t
15-15, 15-18, 16-4, 16-11, 16-12, 18-13,
a relo18-27,
d n 18-29
18-28,
e
Role 2-2, 2-20, 4-10, 4-11, 6-2, 6-3, 6-5, S tu 6-17,
iw 6-7,s 6-11,
@ hi 6-29, 6-31, 6-32, 8-18,
le6-23, t6-25,
6-18, 6-19, 6-20, 6-21, h a
6-22,
e
.b 18-21 s
dh18-20,
10-8, 10-9, 10-10,
b o se to u
S u
(s icen
l e
ha 2-5, 8-18,l 12-7, 12-30, 15-15
Scheduler
b
o d h
Schema 1-3, 1-20, 1-21, 1-22, 1-23, 2-3, 3-9, 3-17, 5-6, 5-13,
s ub
5-14, 5-15, 6-6, 6-12, 6-13, 6-16, 6-18, 6-20, 6-22, 6-24, 6-27,
6-28, 6-32, 7-1, 7-2, 7-3, 7-4, 7-5, 7-11, 7-13, 7-21, 7-24,
7-25, 7-26, 7-34, 7-35, 7-36, 7-37, 7-38, 7-41, 7-44, 7-45, 7-47,
7-48, 7-49, 8-12, 8-14, 8-22, 10-12, 10-19, 10-21, 10-22, 12-6, 12-9,
12-17, 12-19, 13-16, 13-26, 17-13, 17-15, 17-18, 17-20, 18-14, 18-15, 18-16,
18-18, 18-25, 18-26
SCN 10-14, 14-15, 14-16, 14-19, 15-6, 17-8, 17-14, 17-21, 17-23, 17-27
Segment 1-19, 1-20, 1-21, 1-23, 4-17, 4-28, 4-31, 5-3, 5-4,
5-5, 5-12, 5-13, 5-15, 5-20, 5-21, 5-24, 5-28, 6-30, 7-29, 7-31,
9-6, 9-7, 9-9, 9-11, 9-17, 9-18, 12-17, 12-18, 12-19, 12-30, 13-25,
14-9, 17-25, 18-26
Segment Advisor 5-20, 12-17, 12-18, 12-19, 12-30
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I Index - 9
S
Sequence 1-21, 2-12, 6-11, 7-2, 7-3, 7-13, 7-26, 7-37, 7-38,
7-39, 7-40, 7-41, 7-44, 7-47, 7-48, 10-16, 12-11, 12-17, 14-24, 18-15
SGA 1-9, 1-10, 1-11, 1-13, 1-14, 1-23, 4-17, 4-21, 4-26, 6-24,
11-7, 11-27, 11-28, 12-9, 12-10, 12-18, 13-18, 13-19, 13-21, 13-22, 13-25,
14-11
Shared pool 1-10, 1-11, 1-13, 4-17, 11-27, 12-19, 13-18, 13-22
Shared server 3-10, 4-30, 6-24, 11-2, 11-26, 11-27, 11-28, 11-29,
11-30, 11-31
SID 2-3, 2-11, 3-3, 3-7, 3-12, 3-14, 4-4, 4-9, 4-14, 4-15,
4-16, 4-17, 4-19, 4-21, 4-25, 4-30, 4-32, 4-33, 4-34, 5-11, 5-14, r a ble
5-28, 6-12, 6-13, 6-29, 7-4, 7-10, 7-24, 7-27, 7-37, 7-43, 7-47, n s fe
8-7, 8-8, 8-11, 8-31, 9-7, 9-11, 10-5, 10-10, 10-16, 10-23, 10-25, on-
tra
10-28, 11-5, 11-15, 11-16, 11-18, 11-19, 11-22, 12-6, 12-9, s a n12-15,
12-13,
12-17, 12-28, 13-23, 14-12, 15-11, 15-12, 15-16, 15-19, ) a 17-8, 17-16,
h16-12,
c o m ide.
17-19, 17-25, 17-27, 17-28, 18-12, 18-21, 18-27,
g i c. 18-29
t G u
SMON 1-13, 1-23, 4-23
a relo uden
w 12-9,
Snapshot 1-14, 9-9, 9-10, 9-11, 12-3, i12-5, S t 12-10, 12-11,
@ s
hi 13-12
le12-29,t13-11,
12-12, 12-13, 12-15, 12-23,
h a e
d
SQL Access Advisor 12-18, h .b 12-19,u13-2,
s 13-16, 13-17, 13-28
o t o
s
SQL Tuning Advisor
( ub 12-17,
e n se12-18, 12-19, 13-2, 13-9, 13-10, 13-11, 13-12,
a
13-13,
h ic 13-28, 13-29
le13-14, l13-15,
h b
b o d
SQL*Loader 2-4, 2-5, 5-13, 18-2, 18-3, 18-6, 18-7, 18-8, 18-9,
su 18-10, 18-13, 18-17, 18-24, 18-31, 18-34, 18-36
SQL*Plus 1-10, 2-4, 2-5, 2-15, 4-2, 4-3, 4-8, 4-9, 4-10,
4-11, 4-12, 4-13, 4-14, 4-15, 4-19, 4-24, 4-29, 4-30, 4-32, 4-35,
4-36, 6-27, 8-9, 8-15, 12-10, 12-25, 18-3
Statistics 4-32, 8-18, 11-30, 12-2, 12-3, 12-4, 12-5, 12-6, 12-7,
12-8, 12-9, 12-10, 12-12, 12-13, 12-14, 12-15, 12-18, 12-22, 12-30, 12-31,
13-7, 13-9, 13-10, 13-14, 13-23, 13-24, 13-25, 17-16
Streams pool 1-10, 1-11, 1-13, 13-18
SYSAUX 1-18, 5-6, 5-14, 5-16, 6-29, 12-9, 15-17
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I Index - 10
S
SYSTEM 1-5, 1-6, 1-7, 1-8, 1-9, 1-10, 1-12, 1-13, 1-18, 1-19,
1-23, 2-3, 2-5, 2-6, 2-7, 2-8, 2-11, 2-18, 2-20, 3-3, 3-4,
3-7, 3-8, 3-12, 4-4, 4-6, 4-13, 4-17, 4-21, 4-23, 4-29, 4-32,
5-6, 5-7, 5-10, 5-12, 5-13, 5-14, 5-15, 5-16, 5-21, 5-26, 5-27,
5-28, 6-3, 6-5, 6-6, 6-8, 6-9, 6-11, 6-12, 6-13, 6-15, 6-16,
6-18, 6-23, 6-24, 6-25, 6-26, 6-29, 7-4, 7-18, 7-19, 7-20, 7-37,
8-10, 8-18, 8-28, 8-31, 9-3, 9-8, 9-12, 9-15, 10-5, 10-6, 10-7,
10-8, 10-9, 10-10, 10-11, 10-12, 10-13, 10-14, 10-16, 10-17, 10-19, 10-22,
10-26, 10-28, 11-4, 11-7, 11-8, 11-13, 11-22, 11-25, 11-26, 12-3, 12-4,
12-5, 12-11, 12-17, 12-19, 12-22, 12-23, 12-27, 12-28, 13-4, 13-5, 13-8, r a ble
13-22, 13-23, 13-24, 13-25, 14-3, 14-6, 14-7, 14-11, 14-12, 14-15, 14-17, ns
fe
14-26, 15-4, 15-5, 15-6, 15-7, 15-17, 15-18, 16-4, 16-5, 16-6, 16-11, n - tra
o
16-12, 16-14, 17-8, 17-12, 17-16, 17-19, 17-23, 18-4, 18-5, s a n18-14,
18-6,
18-15, 18-21, 18-24, 18-25, 18-31 ) ha
c o m ide.
System statistics 12-4, 12-5 ic.
o g nt G u
e l
T
i w ar tude
Tablespace 1-17, 1-18, 1-19, 1-20,@ 1-21, 1-23,
i s S2-3, 2-10, 3-3,
l e h
t5-6, 5-7, 5-8, 5-10,
3-6, 4-17, 4-22, 4-30,b5-2,
. ha5-3,s5-4,e
5-11, 5-12, 5-13, d h 5-15,
5-14, t o u5-16, 5-17, 5-18, 5-19, 5-20, 5-21,
o
b nse
u5-24,
e (
5-22, 5-23,s c e5-25, 5-28, 5-29, 5-30, 6-2, 6-3, 6-4, 6-6,
l l i
ha 6-13, 6-19, 6-29, 6-30, 6-31, 7-3, 7-12, 7-24, 7-42, 7-47,
6-11,
b
h 9-7, 9-9, 9-11, 9-12, 9-14, 9-15, 9-16, 9-18, 10-26, 11-30, 12-9,
o d
sub 12-19, 12-22, 12-23, 12-25, 12-27, 12-29, 13-27, 14-14, 15-5, 15-6, 15-10,
15-11, 15-16, 15-17, 16-4, 16-6, 16-11, 16-12, 17-9, 17-12, 17-19, 18-3,
18-14, 18-16, 18-25, 18-26, 18-28
Target database 4-6, 18-15, 18-32
Threshold 4-31, 5-18, 9-12, 12-2, 12-4, 12-11, 12-22, 12-23, 12-24,
12-25, 12-27, 12-29, 12-31
Trigger 7-24, 7-25, 7-42, 7-43, 8-2, 8-13, 8-19, 8-20, 8-33,
10-11, 10-16, 10-18, 10-19, 17-12, 18-12, 18-29
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I Index - 11
U
Undo 1-3, 1-21, 4-16, 4-17, 4-28, 4-32, 5-12, 5-13, 5-14, 5-15,
5-21, 6-29, 7-25, 8-9, 8-22, 9-1, 9-2, 9-4, 9-5, 9-6, 9-7,
9-8, 9-9, 9-10, 9-11, 9-12, 9-13, 9-14, 9-15, 9-16, 9-17, 9-18,
12-8, 12-18, 12-19, 12-20, 13-25, 14-8, 14-9, 14-14, 14-15, 15-17, 16-4,
16-6, 16-11, 16-12, 17-4, 17-5, 17-6, 17-8, 17-12, 17-16, 17-17, 17-26,
17-28, 18-28
Undo Advisor 9-2, 9-16, 9-17, 12-18
Undo data 5-21, 7-25, 9-1, 9-2, 9-4, 9-5, 9-6, 9-7, 9-8,
9-9, 9-10, 9-14, 9-17, 12-19, 12-20, 16-12, 17-4, 17-28
UTC 10-14 a ble
fe r
V a n s
n- t r
View 1-7, 1-16, 1-21, 2-3, 2-21, 3-17, 4-2, 4-3, 4-4, 4-5,
a no
h a s
4-7, 4-8, 4-15, 4-18, 4-19, 4-24, 4-30, 4-31, 4-32, 4-33, 4-34,
o m) 7-2, .
4-35, 4-36, 5-9, 5-22, 5-23, 5-24, 5-30, 6-11, 6-30, 6-32,
de
7-3, 7-4, 7-6, 7-13, 7-21, 7-22, 7-23, 7-26, 7-34,
g i c.c7-35, G ui
7-36,
t 7-48, 7-49,
7-37, 7-38, 7-41, 7-42, 7-43, 7-44, 7-45, r e o 7-47,
l7-46, e n
i w a d
tu10-2,
8-12, 8-18, 8-29, 8-34, 9-6, 9-10, 9-15,
@ his S
9-18, 10-5, 10-9,
l e t10-22, 10-24, 10-25, 10-26, 10-29, 10-30,
10-11, 10-12, 10-14, b
. ha 10-20,
10-16,
s e
11-8, 11-32, 12-9, d o u 12-19, 12-21, 12-28, 12-32, 13-2, 13-5,
h12-10,t12-16,
o
b nse
u13-10,
e (
13-8, 13-9,s c e13-13, 13-14, 13-16, 13-17, 13-21, 13-23, 13-25, 13-26,
l l i
ha 13-29, 14-22, 14-28, 15-3, 15-15, 15-19, 15-21, 16-4, 16-14, 17-2,
13-28,
b
h 17-3, 17-4, 17-6, 17-11, 17-13, 17-15, 17-16, 17-17, 17-18, 17-19, 17-20,
o d
sub 17-21, 17-23, 17-24, 17-25, 17-26, 17-29, 17-30, 18-4, 18-5, 18-6, 18-7,
18-13, 18-15, 18-17, 18-30, 18-35, 18-37
VPD 17-19
W
Wait event 4-32, 13-4, 13-5, 13-23
Work area 1-21
Workload repository 6-5, 12-2, 12-3, 12-4, 12-9, 12-12, 12-18,
12-20, 12-31
Unauthorized reproduction or distribution prohibited. Copyright© 2009, Oracle and/or its affiliates.
Oracle Database 10g: Administration Workshop I Index - 12