Oracle Database 11g Workshop I Vol-2 PDF
Oracle Database 11g Workshop I Vol-2 PDF
Oracle Database 11g Workshop I Vol-2 PDF
Administration Workshop I
Deirdre Matishak This document contains proprietary information and is protected by copyright and
Jim Spiller 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
Priya Vennapusa any way. Except where your use constitutes "fair use" under copyright law, you may
not use, share, download, upload, copy, print, display, perform, reproduce, publish,
license, post, transmit, or distribute this document in whole or in part without the
Technical Contributors express authorization of Oracle.
and Reviewers
The information contained in this document is subject to change without notice. If you
Christian Bauwens 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
Monica Cervilla warranted to be error-free.
Claude Chervet
Restricted Rights Notice
Sangram Dash
Andy Fortunak 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
Gerlinde Frenzen applicable:
Steve Friedberg U.S. GOVERNMENT RIGHTS
Mark Fuller The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or
disclose these training materials are restricted by the terms of the applicable Oracle
Joel Goodman license agreement and/or the applicable U.S. Government contract.
Magnus Isaksson
Trademark Notice
Pete Jones
Akira Kinutani Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other
names may be trademarks of their respective owners.
Pierre Labrousse
Gwen Lazenby
m y
Hakan Lindfors
Srinivas Putrevu
d e
Andreas Reinhardt
c a
Lauran Serhal
Ira Singer
e A
Jenny Tsai
c l
Editors r a
Aju Kumar O ly
Nita Pavitran
l & On
Graphic Designer
n a e
Rajiv Chandrabhanu
t e r U s
Publishers
I n
c le
Joseph Fernandez
Jothi Lakshmi
r a
O
Contents
Preface
I Introduction
Course Objectives I-2
Suggested Schedule I-3
Oracle Products and Services I-4
Oracle Database 11g: “g” Stands for Grid I-5
Course Examples: HR Sample Schema I-7
e A
Redo Log Buffer 1-14
Shared Pool 1-15
c l
r a
Allocation and Reuse of Memory in the Shared Pool 1-17
Large Pool 1-19
O ly
Process Architecture 1-21
l & On
Java Pool and Streams Pool 1-20
I n
Checkpoint Process (CKPT) 1-28
c le
System Monitor Process (SMON) 1-29
Process Monitor Process (PMON) 1-30
r a
Recoverer Process 1-31
iii
Database Storage Architecture 1-36
Logical and Physical Database Structures 1-38
Tablespaces and Data Files 1-40
SYSTEM and SYSAUX Tablespaces 1-41
Segments, Extents, and Blocks 1-42
Database Architecture: Summary of Structural Components 1-43
Summary 1-44
Practice 1: Overview 1-45
e
3 Creating an Oracle Database
c l
Objectives 3-2
Planning the Database 3-3 r a
Databases: Examples 3-4 O ly
Configuring the Listener 3-5
l & On
a e
Database Configuration Assistant (DBCA) 3-8
n
t e r
Using the DBCA to Create a Database 3-9
Password Management 3-17
U s
I n
Creating a Database Design Template 3-18
Using the DBCA to Delete a Database 3-19
le
Using the DBCA for Additional Tasks 3-21
c
r a
Summary 3-22
Practice 3 Overview: Using the DBCA 3-23
O
iv
4 Managing the Oracle Instance
Objectives 4-2
Management Framework 4-3
Starting and Stopping Database Control 4-4
Oracle Enterprise Manager 4-5
Database Home Page 4-7
Other Oracle Tools 4-8
Using SQL*Plus 4-9
Calling SQL*Plus from a Shell Script 4-10
Calling a SQL Script from SQL*Plus 4-11
Initialization Parameter Files 4-12
Simplified Initialization Parameters 4-14
Initialization Parameters: Examples 4-15
Using SQL*Plus to View Parameters 4-19
Changing Initialization Parameter Values 4-21
Changing Parameter Values: Examples 4-23
Database Startup and Shutdown 4-24
Starting Up an Oracle Database Instance 4-25
Starting Up an Oracle Database Instance: NOMOUNT 4-26
Starting Up an Oracle Database Instance: MOUNT 4-27
m y
Starting Up an Oracle Database Instance: OPEN 4-28
d e
Startup Options: Examples 4-29
c
Shutting Down an Oracle Database Instance 4-30 a
Shutdown Modes 4-31
e A
Shutdown Options 4-32
Shutdown Options: Examples 4-33
c l
Shutdown Options 4-34
r a
O ly
Using SQL*Plus to Start Up and Shut Down 4-35
Blackout Administration 4-36
Viewing the Alert Log 4-38
l & On
a e
Viewing the Alert History 4-40
n
t e r
Using Trace Files 4-41
U s
Dynamic Performance Views 4-43
I n
Dynamic Performance Views: Usage Examples 4-44
le
Dynamic Performance Views: Considerations 4-45
c
Data Dictionary: Overview 4-46
a
O r Data Dictionary Views 4-47
v
Data Dictionary: Usage Examples 4-49
Summary 4-50
Practice 4 Overview: Managing the Oracle Instance 4-51
O ly
User Sessions: Dedicated Server 5-28
User Sessions: Shared Servers 5-29
SGA and PGA 5-30
l & On
a e
Shared Server: Connection Pooling 5-31
n
t e r U s
When Not to Use a Shared Server 5-32
Configuring Communication Between Databases 5-33
I n
Connecting to Another Database 5-34
Summary 5-35
c le
Practice 5 Overview: Working with Oracle Network Components 5-36
6 r a
Managing Database Storage Structures
OObjectives 6-2
Storage Structures 6-3
How Table Data Is Stored 6-4
vi
Database Block: Contents 6-5
Tablespaces and Data Files 6-6
Space Management in Tablespaces 6-7
Exploring the Storage Structure 6-8
Creating a New Tablespace 6-9
Storage for Locally Managed Tablespaces 6-11
Tablespaces in the Preconfigured Database 6-13
Altering a Tablespace 6-15
Actions with Tablespaces 6-17
Dropping Tablespaces 6-19
Viewing Tablespace Information 6-20
Viewing Tablespace Contents 6-21
Oracle Managed Files (OMF) 6-22
Enlarging the Database 6-23
Automatic Storage Management 6-24
ASM: Key Features and Benefits 6-25
ASM: Concepts 6-26
Summary 6-27
Practice 6 Overview: Managing Database Storage Structures 6-28
m y
7 Administering User Security
Objectives 7-2
d e
Database User Accounts 7-3
c a
Predefined Accounts: SYS and SYSTEM 7-5
Creating a User 7-6
e A
Authenticating Users 7-7
c l
Administrator Authentication 7-9
r a
O ly
Unlocking a User Account and Resetting the Password 7-10
Privileges 7-11
System Privileges 7-12
l & On
Object Privileges 7-14
n a e
t e r U s
Revoking System Privileges with ADMIN OPTION 7-15
Revoking Object Privileges with GRANT OPTION 7-16
I n
Benefits of Roles 7-17
le
Assigning Privileges to Roles and Assigning Roles to Users 7-18
a c
Predefined Roles 7-19
Creating a Role 7-20
vii
Creating a Password Profile 7-27
Supplied Password Verification Function: VERIFY_FUNCTION_11G 7-28
Assigning Quotas to Users 7-29
Summary 7-31
Practice 7 Overview: Administering Users 7-32
le
Temporary Tables 8-43
c
r a
Temporary Tables: Considerations 8-44
Summary 8-45
OPractice 8 Overview: Administering Schema Objects 8-46
viii
9 Managing Data and Concurrency
Objectives 9-2
Manipulating Data by Using SQL 9-3
INSERT Command 9-4
UPDATE Command 9-5
DELETE Command 9-6
MERGE Command 9-7
COMMIT and ROLLBACK Commands 9-9
PL/SQL 9-10
Administering PL/SQL Objects 9-11
PL/SQL Objects 9-12
Functions 9-13
Procedures 9-14
Packages 9-15
Package Specification and Body 9-16
Built-in Packages 9-17
Triggers 9-18
Triggering Events 9-19
Locks 9-20
Locking Mechanism 9-21
m y
Data Concurrency 9-22
d e
DML Locks 9-24
Enqueue Mechanism 9-25
c a
Lock Conflicts 9-26
e A
Detecting Lock Conflicts 9-28
c l
Possible Causes of Lock Conflicts 9-27
c
Undo Data 10-4
a
O rTransactions and Undo Data 10-6
Storing Undo Information 10-7
Undo Data Versus Redo Data 10-8
Managing Undo 10-9
ix
Configuring Undo Retention 10-10
Guaranteeing Undo Retention 10-12
Changing an Undo Tablespace to a Fixed Size 10-13
General Undo Information 10-14
Using the Undo Advisor 10-15
Viewing System Activity 10-16
Summary 10-17
Practice 10 Overview: Managing Undo Segments 10-18
e A
Using and Maintaining Audit Information 11-19
Value-Based Auditing 11-20
c l
Fine-Grained Auditing 11-22
r a
FGA Policy 11-23
O ly
Audited DML Statement: Considerations 11-25
FGA Guidelines 11-26
l & On
SYSDBA Auditing 11-27
n a e
t e
Security Updates 11-29 r U s
Maintaining the Audit Trail 11-28
I n
Applying Security Patches 11-30
Summary 11-31
le
Practice 11 Overview: Implementing Oracle Database Security 11-32
c
r a
12 Database Maintenance
O Objectives 12-2
Database Maintenance 12-3
Terminology 12-4
x
Oracle Optimizer: Overview 12-5
Optimizer Statistics 12-6
Using the Manage Optimizer Statistics Page 12-7
Gathering Optimizer Statistics Manually 12-8
Preferences for Gathering Statistics 12-10
Statistic Levels 12-12
Automatic Workload Repository (AWR) 12-13
AWR Infrastructure 12-14
AWR Baselines 12-15
Enterprise Manager and the AWR 12-16
Managing the AWR 12-17
Automatic Database Diagnostic Monitor (ADDM) 12-18
ADDM Findings 12-19
ADDM Recommendations 12-20
Advisory Framework 12-21
Enterprise Manager and Advisors 12-23
DBMS_ADVISOR Package 12-24
Automated Maintenance Tasks 12-25
Automated Maintenance Tasks Configuration 12-27
Server-Generated Alerts 12-28
m y
Setting Thresholds 12-29
d e
Creating and Testing an Alert 12-30
Alerts Notification 12-31
c a
Reacting to Alerts 12-33
e A
Alert Types and Clearing Alerts 12-34
Summary 12-35
c l
r a
Practice 12 Overview: Proactive Maintenance 12-36
13 Performance Management O ly
Objectives 13-2
l & On
a e
Performance Monitoring 13-3
n
t e r U s
Enterprise Manager Performance Page 13-4
Drilling Down to a Particular Wait Category 13-5
I n
Performance Page: Throughput 13-6
Performance Monitoring: Top Sessions 13-7
le
Performance Monitoring: Top Services 13-8
c
r a
Managing Memory Components 13-9
Enabling Automatic Memory Management (AMM) 13-10
O Enabling Automatic Shared Memory Management (ASMM) 13-11
Automatic Shared Memory Advisor 13-12
Setting Shared Memory Components Manually 13-13
xi
Using Memory Advisors 13-14
Dynamic Performance Statistics 13-16
Troubleshooting and Tuning Views 13-18
Invalid and Unusable Objects 13-19
Summary 13-21
Practice 13 Overview: Monitoring and Improving Performance 13-22
n
t e r
Archive Log File: Naming and Destinations 14-26
U
Enabling ARCHIVELOG Mode 14-28s
Summary 14-29
I n
Practice 14 Overview: Configuring for Recoverability 14-30
c le
r a
15 Performing Database Backups
Objectives 15-2
xii
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
Scheduling Backups: Schedule 15-14
Scheduling Backups: Review 15-15
Backing Up the Control File to a Trace File 15-16
Managing Backups 15-17
Viewing Backup Reports 15-18
Monitoring the Flash Recovery Area 15-19
Using the RMAN Command Line 15-20
Summary 15-21
Practice 15 Overview: Creating Database Backups 15-22
c l
Loss of a System-Critical Data File in ARCHIVELOG Mode 16-12
Data Failure: Examples 16-13
r a
Data Recovery Advisor 16-14
Assessing Data Failures 16-15 O ly
Data Failures 16-16
l & On
a e
Listing Data Failures 16-17
n
t e r
Advising on Repair 16-18
Executing Repairs 16-19
U s
I n
Data Recovery Advisor Views 16-20
le
Summary 16-21
c
Practice 16 Overview: Performing Database Recovery 16-22
a
O r
17 Moving Data
Objectives 17-2
Moving Data: General Architecture 17-3
Directory Objects: Overview 17-4
xiii
Creating Directory Objects 17-5
SQL*Loader: Overview 17-6
Loading Data with SQL*Loader 17-8
SQL*Loader Control File 17-9
Loading Methods 17-11
External Table Population 17-13
Using External Tables 17-14
External Table Population with ORACLE_DATAPUMP 17-15
External Table Population with ORACLE_LOADER 17-16
Oracle Data Pump: Overview 17-17
Oracle Data Pump: Benefits 17-18
Data Pump Export and Import: Overview 17-20
Data Pump Utility: Interfaces and Modes 17-21
Fine-Grained Object Selection. 17-22
Advanced Feature: Sampling 17-23
Export Options: Files 17-24
Data Pump File Locations 17-25
Data Pump File Naming and Size 17-27
Scheduling and Running a Job 17-28
Data Pump Import 17-29
m y
Data Pump Import: Transformations 17-30
d e
Data Pump: Performance Considerations 17-32
Performance Initialization Parameters 17-33
c a
A
Data Pump Access Path: Considerations 17-34
e
Data Dictionary 17-36
c l
Using Enterprise Manager to Monitor Data Pump Jobs 17-35
Summary 17-37
r a
O ly
Practice 17 Overview: Moving Data 17-38
l & On
18 Enhancing Database Capabilities
Objectives 18-2
n a e
t e r U s
Using the Support Workbench 18-3
Viewing Critical Error Alerts in Enterprise Manager 18-4
I n
Viewing Problem Details 18-5
Viewing Incident Details: Dump Files 18-6
c le
Viewing Incident Details: Checker Findings 18-7
r a
Creating a Service Request 18-8
Packaging and Uploading Diagnostic Data to Oracle Support 18-9
O Tracking the Service Request and Implementing Repairs 18-10
Closing Incidents and Problems 18-12
Incident Packaging Configuration 18-13
xiv
Working with Oracle Support 18-14
MetaLink Integration 18-15
Using MetaLink 18-16
Researching an Issue 18-18
Logging Service Requests 18-20
Managing Patches 18-22
Applying a Patch Release 18-23
Using the Patch Advisor 18-24
Using the Patch Wizard 18-25
Applying a Patch 18-26
Staging a Patch 18-27
Summary 18-28
Practice 18 Overview: Using EM Tools for Alerts and Patches 18-29
m y
Appendix D: Acronyms and Terms
d e
c
Appendix E: Next Steps: Continuing Your Education a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
xv
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
xvi
Preface
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
Profile
Before You Begin This Course
Before you begin this course, you should have a working knowledge of SQL.
How This Course Is Organized
Oracle Database 11g: Administration Workshop I is an instructor-led course
featuring lectures and hands-on exercises. Online demonstrations and written
practice sessions reinforce the concepts and skills that are introduced.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Preface - 3
Related Publications
Oracle Publications
Title Part Number
Oracle Database 2 Day DBA 11g Release 1 (11.1) B28301-03
Oracle Database Administrator’s Guide 11g B28310-04
Release 1 (11.1)
Oracle® Database Concepts 11g Release 1 (11.1) B28318-03
Oracle® Database Reference 11g Release 1 (11.1) B28320-01
Oracle® Database SQL Language Reference 11g B28286-03
Release 1 (11.1)
Additional Publications
• System release bulletins
• Installation and user’s guides
• read.me files
• International Oracle User’s Group (IOUG) articles
• Oracle Magazine
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Preface - 4
Typographic Conventions
The following two lists explain Oracle University typographical conventions for
words that appear within regular text or within code samples.
c a
words or phrases;
placeholders or
e A
Do not save changes to the database.
variables
c l Enter hostname, where
n a e
titles referenced “Working with Objects.”
t e r U s
within a course
I n
c le
r a
O
Preface - 5
Typographic Conventions (continued)
m y
be entered by a
CREATE USER scott
IDENTIFIED BY tiger;
d e
user
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Preface - 6
Performing Database Recovery
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
Objectives
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
To open a database:
• All control files must be present and synchronized
• All online data files must be present and synchronized
• At least one member of each redo log group must be
present
OPEN
STARTUP
MOUNT
NOMOUNT
SHUTDOWN
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Opening a Database
e A
c l
As a database moves from the shutdown stage to being fully open, it performs internal consistency
checks with the following stages:
r a
• NOMOUNT: For an instance to reach the NOMOUNT (also known as STARTED) status, the
O ly
instance must read the initialization parameter file. No database files are checked while the
instance enters the NOMOUNT state.
l & On
n a e
• 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
e r s
or corrupt, the instance returns an error (noting the missing control file) to the administrator and
t
remains in the NOMOUNT state. U
I n
• OPEN: When the instance moves from the MOUNT state to the OPEN state, it does the following:
c le
- 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.
r a
O
l & On
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:
a e
ORA-01113: file 4 needs media recovery
n
t e r s
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
U
n
are present and require media recovery are listed, but no error message is displayed.
I
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Keeping a Database Open
e A
c l
After a database is open, instance failure can be caused by media failure: for example, by the loss of
r a
a control file, the loss of an entire redo log group, or the loss of a data file belonging to the SYSTEM
or UNDO tablespaces. Even if an inactive redo log group is lost, the database would eventually fail
due to log switches. O ly
l & On
In many cases, the failed instance does not completely shut down but is unable to continue to
a e
perform work. Recovering from these types of media failure must be done with the database down.
n
efforts.
t e r
As a result, the administrator must use the SHUTDOWN ABORT command before beginning recovery
U s
I n
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.
c le
These errors can be detected by inspecting the alert log file or by using the Data Recovery Advisor.
r a
O
c a
Data Recovery Advisor
e A
c l
The Data Recovery Advisor automatically gathers data failure information when an error is
r a
encountered. In addition, it can proactively check for failures. In this mode, it can potentially detect
and analyze data failures before a database process discovers the corruption and signals an error.
O ly
(Note that repairs are always under human control.)
l & On
Data failures can be very serious. For example, if your current log files are missing, you cannot open
a e
your database. Some data failures (like block corruptions in data files) are not catastrophic because
n
t e r
they do not take the database down or prevent you from opening the Oracle instance. The Data
s
Recovery Advisor handles both cases: the one when you cannot start up the database (because
U
I
discovered during run time.n
required database files are missing, inconsistent, or corrupted) and the one when file corruptions are
le
The preferred way to address serious data failures is as follows:
c
r a
1. Fail over to a standby database if you are in a Data Guard configuration. This allows users to
come back online as soon as possible.
O
2. Repair the primary cause of the data failure (fortunately, this does not affect your users).
c a
diagnose and repair failures on a standby database. However, the Data Recovery Advisor does
A
support failover to a standby database as a repair option (as mentioned above).
e
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Control files
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Loss of a Control File
e A
c l
Recovering from the loss of a control file (if at least one control file remains) can be accomplished
by performing the following steps:
r a
1. If the instance has not already failed, shut it down by using SHUTDOWN ABORT.
O ly
2. Copy one of the remaining control files to the missing file’s location. If the media failure is due
& On
to the loss of a disk drive or controller, copy one of the remaining control files to some other
l
n a e
location and update the instance’s parameter file to point to the new location. Alternatively, you
can delete the reference to the missing control file from the initialization parameter file.
e r s
Remember that Oracle recommends having at least two control files at all times.
3. Start the instance. t U
I n
Recovering from the loss of all control files is covered in the course titled Oracle Database 11g:
le
Administration Workshop II.
c
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Loss of a Redo Log File
e A
c l
Recovering from the loss of a single redo log group member should not affect the running instance.
To perform this recovery:
r a
O ly
1. Determine whether there is a missing log file by examining the alert log.
2. Restore the missing file by copying one of the remaining files from the same group.
l & On
3. If the media failure is due to the loss of a disk drive or controller, rename the missing file.
a e
4. If the group has already been archived, or if you are in NOARCHIVELOG mode, you may choose
n
t e r
to solve the problem by clearing the log group to re-create the missing file or files. Select the
s
appropriate group and then select the Clear Logfile action. You can also clear the affected group
U
I n
manually with the following command:
SQL> ALTER DATABASE CLEAR LOGFILE GROUP #;
le
Note: Database Control does not allow you to clear a log group that has not been archived. Doing so
c
r a
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
O
another failure occurs. To clear an unarchived log group, use the following command:
SQL> ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP #;
c a
Loss of a Data File in NOARCHIVELOG Mode
e A
c l
The loss of any data file from a database in NOARCHIVELOG mode requires complete restoration of
r a
the database, including control files and all data files.
O ly
With the database in NOARCHIVELOG mode, recovery is possible only up to the time of the last
backup. So users must reenter all changes made since that backup.
To perform this type of recovery:
l & On
a e
1. Shut down the instance if it is not already down.
n
t e r U s
2. Click Perform Recovery on the Maintenance properties page.
3. Select Whole Database as the type of recovery.
I n
If you have a database in NOARCHIVELOG mode that has an incremental backup strategy, RMAN
le
first restores the most recent level 0 and then RMAN recovery applies the incremental backups.
c
r a
O
Users
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Loss of a Noncritical Data File in ARCHIVELOG Mode
e A
c l
With the database in ARCHIVELOG mode, the loss of any data file not belonging to the SYSTEM or
r a
UNDO tablespaces affects only the objects that are in the missing file. The rest of the database
remains available for users to continue work.
O ly
To restore and recover the missing data file:
l & On
1. Click Perform Recovery on the Maintenance properties page.
a e
2. Select Datafiles as the recovery type, and then select “Restore to current time.”
n
t e r
3. Add all data files that need recovery.
s
4. Determine whether you want to restore the files to the default location or (if a disk or controller
U
I n
is missing) to a new location.
5. Submit the RMAN job to restore and recover the missing files.
le
Because the database is in ARCHIVELOG mode, recovery is possible up to the time of the last
c
a
commit and users are not required to reenter any data.
r
O
Users
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
A
Loss of a System-Critical Data File in ARCHIVELOG Mode
e
c l
Data files belonging to the SYSTEM tablespace or containing UNDO data are considered system
r a
critical. A loss of one of these files requires the database to be restored from the MOUNT state (unlike
other data files that may be restored with the database open).
To perform this recovery: O ly
l & On
1. If the instance is not already shut down, shut it down.
2. Mount the database.
n a e
t e r
3. Click Perform Recovery on the Maintenance properties page.
s
4. Select Datafiles as the recovery type, and then select “Restore to current time.”
U
I n
5. Add all data files that need recovery.
6. Determine whether you want to restore the files to the default location or (if a disk or controller
c le
is missing) to a new location.
7. Submit the RMAN job to restore and recover the missing files.
r a
8. Open the database. Users are not required to reenter data because the recovery is up to the time
Oof the last commit.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Failure: Examples
e A
c l
The Data Recovery Advisor can analyze failures and suggest repair options for a growing list of
issues.
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Recovery Advisor
e A
c l
The automatic diagnostic workflow in Oracle Database 11g performs workflow steps for you. With
r a
the Data Recovery Advisor you only need to initiate an advise and a repair.
1. Health Monitor automatically executes checks and logs failures and their symptoms as
O ly
“findings” into the automatic diagnostic repository (ADR). For details about Health Monitor, see
the Diagnostics eStudy.
l & On
n a e
2. The Data Recovery Advisor consolidates findings into failures. It lists the results of previously
executed assessments with failure severity (critical or high).
e r s
3. When you ask for repair advice on a failure, the Data Recovery Advisor maps failures to
t U
automatic and manual repair options, checks basic feasibility, and presents you with the repair
advice. I n
you.
c le
4. You can execute a repair manually, or you can request the Data Recovery Advisor to do it for
r a
5. In addition to the automatic, primarily “reactive” checks of Health Monitor and the Data
O
Recovery Advisor, Oracle recommends using the VALIDATE command as a “proactive” check.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Assessing Data Failures
e A
c l
The example in the slide shows one of several possible ways to see the interaction of Health Monitor
and the Data Recovery Advisor.
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Failures
e A
c l
Data failures are detected by checks, which are diagnostic procedures that assess the health of the
r a
database or its components. Each check can diagnose one or more failures, which are then mapped to
a repair.
O ly
Checks can be reactive or proactive. When an error occurs in the database, reactive checks are
l & On
automatically executed. You can also initiate proactive checks (for example, by executing the
VALIDATE DATABASE command).
n a e
t e r U s
In Enterprise Manager, select Availability > Perform Recovery or click the Perform Recovery button
if you find your database in a “down” or “mounted” state.
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Listing Data Failures
e A
c l
On the Perform Recovery page, click “Advise and Repair.”
r a
This “View and Manage Failures” page is the home page for the Data Recovery Advisor. The
O ly
example in the screenshot shows how the Data Recovery Advisor lists data failures and details.
Activities that you can initiate include advising, setting priorities, and closing failures.
l & On
The underlying RMAN LIST FAILURE command can also display data failures and details.
a e
Failure assessments are not initiated here; they are executed and stored in the ADR.
n
t e r U s
Failures are listed in decreasing priority order: CRITICAL, HIGH, LOW. Failures with the same
priority are listed in order of increasing time stamps.
I n
c le
r a
O
2a
2b
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Advising on Repair
e A
c l
On the “View and Manage Failures” page, the Data Recovery Advisor generates a manual checklist
r a
after you click the Advise button. Two types of failures can appear.
• Failures that require human intervention: An example is a connectivity failure when a disk cable
is not plugged in. O ly
& On
• Failures that are repaired faster if you can undo a previous erroneous action: For example, if you
l
RMAN restoration from backup.
n a e
renamed a data file by error, it is faster to rename it back to its previous name than to initiate
t e r
You can initiate the following actions:
U s
I n
• Click “Re-assess Failures” after you perform a manual repair. Resolved failures are implicitly
closed; any remaining failures are displayed on the “View and Manage Failures” page.
c le
• Click “Continue with Advise” to initiate an automated repair. When the Data Recovery Advisor
generates an automated repair option, it generates a script that shows how RMAN plans to repair
r a
the failure. Click Continue if you want to execute the automated repair. If you do not want the
O
Data Recovery Advisor to automatically repair the failure, you can use this script as a starting
point for your manual repair.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Executing Repairs
e A
c l
The Data Recovery Advisor displays these pages. In the example, a successful repair is completed in
less than 30 seconds.
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Recovery Advisor Views
e A
Usage Example
c l
r a
Suppose that you need to display all failures that were detected on June 21, 2007.
SELECT * FROM v$ir_failure
O ly
WHERE trunc (time_detected) = '21-JUN-2007';
l & On
See the Oracle Database Reference for details about the dynamic data dictionary views used by the
Data Recovery Advisor.
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
Objectives
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
Data Pump
DBMS_DATAPUMP
Data/Metadata Movement Engine
Oracle Oracle
Loader DataPump Direct Path API Metadata API
c a
Moving Data: General Architecture
e A
Major functional components:
c l
and metadata movement r a
• DBMS_DATAPUMP: Contains the API for high-speed export and import utilities for bulk data
O ly
• Direct Path API (DPAPI): Oracle Database 11g supports a Direct Path API interface that
& On
minimizes data conversion and parsing at both unload and load time.
l
n a e
• DBMS_METADATA: Used by worker processes for all metadata unloading and loading. Database
object definitions are stored using XML rather than SQL.
e r s
• External Table API: With the ORACLE_DATAPUMP and ORACLE_LOADER access drivers,
t U
you can store data in external tables (that is, in platform-independent files). The SELECT
I n
statement reads external tables as though they were stored in an Oracle database.
c le
• SQL*Loader: Has been integrated with external tables, providing automatic migration of loader
control files to external table access parameters
r a
• expdp and impdp: Thin layers that make calls to the DBMS_DATAPUMP package to initiate
O
and monitor Data Pump operations
• Other clients: 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.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Directory Objects: Overview
e A
c l
Directory objects are logical structures that represent a physical directory on the server’s file system.
r a
They contain the location of a specific operating system directory. This directory object name can be
used in Enterprise Manager so that you do not need to hard-code directory path specifications. You
O ly
thus get greater file management flexibility. Directory objects are owned by the SYS user. Directory
& On
names are unique across the database because all the directories are located in a single name space
l
(that is, SYS).
n a e
t e r
Directory objects are required when you specify file locations for Data Pump because it accesses
s
files on the server rather than on the client.
U
I n
In Enterprise Manager, select Schema > Database Objects > Directory Objects.
le
To edit or delete a directory object, select the object and click the appropriate button.
c
r a
O
5
3
4
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Creating Directory Objects
e A
c l
1. On the Directory Objects page, click the Create button.
r a
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
O ly
the test, provide the host login credentials (that is, the OS user who has privileges on this OS
directory).
l & On
n a e
3. Permissions for directory objects are not the same as OS permissions on the physical directory
on the server file system. You can manage user privileges on individual directory objects. This
e r s
increases the level of security and gives you granular control over these objects. On the
t U
Privileges page, click Add to select the user to which you give read or write privileges (or both).
I n
4. Click Show SQL to view the underlying statements. Click Return when finished.
le
5. Click OK to create the object.
c
r a
O
SQL*Loader Rejected
Field processing
Discarded Accepted
Record selection
Selected
Bad
Oracle server file
Discard file Rejected
Inserted
(optional)
Log file
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
SQL*Loader: Overview
e A
c l
SQL*Loader loads data from external files into tables of an Oracle database. It has a powerful data
r a
parsing engine that puts little limitation on the format of the data in the data file.
SQL*Loader uses the following files:
O ly
l & On
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
a e
organized as records. A particular data file can be in fixed record format, variable record format, or
n
t e r U s
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.
I n
Control file: The control file is a text file that is written in a language that SQL*Loader understands.
c le
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
r a
three sections.
• The first section contains such session-wide information as the following:
O - 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
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Loading Data with SQL*Loader
e A
c l
Use the “Load Data from User Files Wizard” to load data from a flat file into an Oracle database.
r a
To display the wizard, select Enterprise Manager Data Movement > Move Row Data > Load Data
from User Files.
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
SQL*Loader Control File
e A
c l
The SQL*Loader control file is a text file that contains data definition language (DDL) instructions.
r a
DDL is used to control the following aspects of a SQL*Loader session:
• Where SQL*Loader finds the data to load
O ly
• How SQL*Loader expects that data to be formatted
& On
• How SQL*Loader is being configured (including memory management, selection and rejection
l
n a e
criteria, interrupted load handling, and so on) as it loads the data
• How SQL*Loader manipulates the data being loaded
t e r U s
I n
c le
r a
O
m y
1. Comments can appear anywhere in the command section of the file, but they must not appear in
the data. Precede any comment with two hyphens. All text to the right of the double hyphen is
ignored until the end of the line.
d e
2. The LOAD DATA statement indicates to SQL*Loader that this is the beginning of a new data
c a
load. If you are continuing a load that has been interrupted in progress, use the CONTINUE
LOAD DATA statement.
e A
3. The INFILE keyword specifies the name of a data file containing data that you want to load.
c l
4. The BADFILE keyword specifies the name of a file into which rejected records are placed.
placed. r a
5. The DISCARDFILE keyword specifies the name of a file into which discarded records are
O ly
6. The APPEND keyword is one of the options that you can use when loading data into a table that
l & On
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
n a e
relationship between records in the data file and tables in the database.
t e r U s
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
I n
character is a decimal point. That decimal point delimits dollars and cents in the field and
c le
causes records to be rejected if SAL has no value.
9. The TRAILING NULLCOLS clause prompts SQL*Loader to treat any relatively positioned
r a
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
Ocolumn formats in the table that is being loaded.
Table
HWM
Always generates redo entries Generates redo only under specific conditions
Enforces all constraints Enforces only PRIMARY KEY, UNIQUE, and NOT NULL
Can load into clustered tables Does not load into clusters
Allows other users to modify tables Prevents other users from making changes to tables
during load operation during load operation
Maintains index entries on each insert Merges new index entries at the end of the load
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Comparing Direct and Conventional Path Loads
e A
Method of Saving Data
c l
r a
A conventional path load executes SQL INSERT statements to populate tables in an Oracle database.
O ly
A direct path load eliminates much of the Oracle database overhead by formatting Oracle data blocks
l & On
and writing the data blocks directly to the database files. A direct load does not compete with other
users for database resources, so it can usually load data at close to disk speed. Conventional path
a e
loads use SQL processing and a database COMMIT operation for saving data. The insertion of an
n
transactions.
t e r U s
array of records is followed by a COMMIT operation. Each data load may involve several
I n
Direct path loads use data saves to write blocks of data to Oracle data files. This is why the direct
COMMIT:
c le
path loads are faster than the conventional ones. The following features differentiate a data save from
r a
• During a data save, only full database blocks are written to the database.
• The blocks are written after the high-water mark (HWM) of the table.
O
• After a data save, the HWM is moved.
• Internal resources are not released after a data save.
• A data save does not end the transaction.
• Indexes are not updated at each data save.
e A
path load and re-enabled at the end of the load. They may remain disabled if a referenced object is
not accessible at the end of the run. Consider using conventional path loads to load data into tables
with the INSERT triggers.
c l
Loading into Clustered Tables
r a
O ly
Direct loads cannot be used to load rows into clustered tables. Clustered tables can be loaded with
conventional path loads only.
Locking
l & On
n a e
While a direct path load is in progress, other transactions cannot make changes to the tables that are
concurrently.
t e r U s
being loaded. The only exception to this rule is when several parallel direct load sessions are used
I n
c le
r a
O
Unloading Loading
Tables
External files
(proprietary format) Tables
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
External Table Population
e A
c l
An external table is composed of proprietary format (that is, Direct Path API) flat files that are
r a
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
O ly
native external representation (that is, DPAPI).
l & On
You can use the CREATE TABLE AS SELECT command to populate an external table. After an
a e
external table has been created and populated, no rows may be added, updated, or deleted from the
n
have indexes.
t e r
external table. Any attempt to modify the data in the external table fails. An external table may not
U s
I n
The Data Pump access driver enables the unloading and loading operations for external tables.
le
In Oracle Database 11g, you can compress and encrypt data before it is written to the dump file set.
c
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Using External Tables
e A
c l
The data files created for the external table can be moved and used as the data files for another
r a
external table in the same database or different database. They can be read only by the
ORACLE_DATAPUMP access driver. You can choose to have your applications directly access
O ly
external tables with the SELECT command, or you can choose to have data loaded first into a target
database.
l & On
a e
Data files that are populated by different external tables can all be specified in the LOCATION clause
n
t e r
of another external table. This provides an easy way of aggregating data from multiple sources. The
s
only restriction is that the metadata for all the external tables must be exactly the same.
U
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
External Table Population with ORACLE_DATAPUMP
e A
c l
This example shows you how the new external table population operation can help to export a
a
selective set of records resulting from the join of the EMPLOYEES and DEPARTMENTS tables.
r
O ly
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
l & On
of a parallel populate operation is constrained by the number of concurrent files that can be written to
a e
by the access driver. There is never more than one parallel execution server writing into one file at a
n
particular point in time.
t e r U s
The number of files in the LOCATION clause must match the specified degree of parallelism because
I n
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
le
parallelization is lowered to match the number of files in the LOCATION clause.
c
r a
Note: For more information about the ORACLE_DATAPUMP access driver parameters, see the
Oracle Database Utilities guide.
O
c a
External Table Population with ORACLE_LOADER
e A
c l
The ORACLE_LOADER access driver uses the SQL*Loader syntax to create external tables.
r a
The example in the slide shows three directory objects (extab_dat_dir, extab_bad_dir, and
O ly
extab_log_dir) that are created and mapped to existing OS directories to which the user is
granted access.
l & On
Best-practice tip: If you have a lot of data to load, enable PARALLEL for the load operation:
n a e
ALTER SESSION ENABLE PARALLEL DML;
t e r U s
I n
c le
r a
O
c a
Oracle Data Pump: Overview
e A
c l
Oracle Data Pump enables very high-speed data and metadata loading and unloading of Oracle
r a
databases. The Data Pump infrastructure is callable via the DBMS_DATAPUMP PL/SQL package.
Thus, custom data movement utilities can be built by using Data Pump.
O ly
Oracle Database 11g provides the following tools:
l & On
• Command-line export and import clients called expdp and impdp, respectively
a e
• A Web-based export and import interface that is accessible from Database Control
n
t e r U s
Data Pump automatically decides the data access methods to use; these can be either direct path or
external tables. Data Pump uses direct path load and unload when a table’s structure allows it and
I n
when maximum single-stream performance is desired. However, if there are clustered tables,
referential integrity constraints, encrypted columns, or a number of other items, Data Pump uses
le
external tables rather than direct path to move the data.
c
r a
The ability to detach from and reattach to long-running jobs without affecting the job itself enables
you to monitor jobs from multiple locations while they are running. All stopped Data Pump jobs can
O
be restarted without loss of data as long as the metainformation remains undisturbed. It does not
matter whether the job is stopped voluntarily or involuntarily due to a crash.
c a
Oracle Data Pump: Benefits
e A
c l
The EXCLUDE, INCLUDE, and CONTENT parameters are used for fine-grained object and data
selection.
r a
O ly
You can specify the database version for objects to be moved (using the VERSION parameter) to
create a dump file set that is compatible with a previous release of the Oracle database that supports
Data Pump.
l & On
a e
You can use the PARALLEL parameter to specify the maximum number of threads of active
n
t e r U s
execution servers operating on behalf of the export job.
You can estimate how much space an export job would consume (without actually performing the
I n
export) by using the ESTIMATE_ONLY parameter.
c le
Network mode enables you to export from a remote database directly to a dump file set. This can be
done by using a database link to the source system.
r a
During import, you can change the target data file names, schemas, and tablespaces.
O
In addition you can specify a percentage of data to be sampled and unloaded from the source
database when performing a Data Pump export. This can be done by specifying the SAMPLE
parameter.
You can use the COMPRESSION parameter to indicate whether the metadata should be compressed
in the export dump file so that it consumes less disk space. If you compress the metadata, it is
automatically uncompressed during import.
Oracle Database 11g: Administration Workshop I 17 - 18
Data Pump Enhancements in Oracle Database 11g
In Oracle Database 11g, new features have been added that enable you to:
• Compress both data and metadata, only data, only metadata, or no data during an export
• Specify additional encryption options in the following areas:
- You can choose to encrypt both data and metadata, only data, only metadata, no data, or
only encrypted columns during an export.
- You can specify a specific encryption algorithm to use during an export.
- You can specify the type of security to use for performing encryption and decryption during
an export. For example, perhaps the dump file set will be imported into a different or
remote database and it must remain secure in transit. Or perhaps the dump file set will be
imported onsite using the Oracle Encryption Wallet but it may also need to be imported
offsite where the Oracle Encryption Wallet is not available.
• Perform table mode exports and imports using the transportable method; specify how partitioned
tables should be handled during import operations
• Overwrite existing dump files during an export operation
• Rename tables during an import operation
• Specify that a data load should proceed even if nondeferred constraint violations are encountered
(This is valid only for import operations that use the external tables access method.)
• Specify that XMLType columns are to be exported in uncompressed CLOB format regardless of
the XMLType storage format that was defined for them
• During an export, specify a remap function that takes as a source the original value of the
file
m y
designated column and returns a remapped value that will replace the original value in the dump
Source Target
“Network mode”
impdp
client
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Pump Export and Import: Overview
e A
c l
Data Pump Export is a utility for unloading data and metadata into a set of operating system files
r a
called dump file sets. Data Pump Import is used to load metadata and data stored in an export dump
file set into a target system.
O ly
The Data Pump API accesses its files on the server rather than on the client.
l & On
These utilities can also be used to export from a remote database directly to a dump file set, or to
a e
load the target database directly from a source database with no intervening files. This is known as
n
t e r U s
network mode. This mode is particularly useful to export data from a read-only source database.
At the center of every Data Pump operation is the master table (MT), which is a table created in the
I n
schema of the user running the Data Pump job. The MT maintains all aspects of the job. The MT is
c le
built during a file-based export job and is written to the dump file set as the last step. Conversely,
loading the MT into the current user’s schema is the first step of a file-based import operation and is
a
used to sequence the creation of all objects imported.
r
O
Note: The MT is the key to Data Pump’s restart capability in the event of a planned or unplanned
stopping of the job. The MT is dropped when the Data Pump job finishes normally.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Pump Utility: Interfaces and Modes
e A
c l
You can interact with Data Pump Export and Import by using one of the following interfaces:
r a
• Command line interface: Enables you to specify most of the export parameters directly on the
command line
O ly
• Parameter file interface: Enables you to specify all command line parameters in a parameter
& On
file. The only exception is the PARFILE parameter.
l
n a e
• 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
e r s
[Ctrl] + [C] during an export operation that is started with the command line interface or the
t U
parameter file interface. Interactive-command mode is also enabled when you attach to an
I n
executing or stopped job.
c le
• 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
r a
from Database.
O
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. The
available modes are listed in the slide and are the same as in the original export and import utilities.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Fine-Grained Object Selection
e A
c l
The Data Pump job can include or exclude virtually any type of object.
r a
The EXCLUDE parameter enables any database object type to be excluded from an export or import
O ly
operation. The optional name qualifier enables you to have finer selectivity within each object type
that is specified, as in these examples:
EXCLUDE=VIEW
l & On
EXCLUDE=PACKAGE
n a e
t e r
EXCLUDE=INDEX:"LIKE 'EMP%'"
s
The INCLUDE parameter includes only the specified object types and objects in an operation.
U
I n
Syntax: INCLUDE = object_type[:"name_expr"]
c le
The CONTENT parameter enables you to request the current operation, only the metadata, only the
data, or both metadata and data.
a
Syntax: CONTENT = ALL | METADATA_ONLY | DATA_ONLY
r
O
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. Here is an example:
QUERY=hr.employees:"WHERE department_id in (10,20) and salary <
1600 ORDER BY department_id"
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Advanced Feature: Sampling
e A
c l
With the SAMPLE parameter, you can specify a percentage of data to be sampled and unloaded from
r a
the source database when performing a Data Pump export.
O ly
Syntax: SAMPLE=[[schema_name.]table_name:]sample_percent
l & On
The sample percentage indicates the likelihood that a block of rows will be included. The range of
values for sample_percent is .000001 to (but not including) 100.
n a e
Note: The SAMPLE parameter is not valid for network exports.
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Export Options: Files
e A
c l
Three types of files are managed by Data Pump jobs:
r a
• Dump files for data and metadata that is to be moved
• Log files for messages
O ly
• SQL files for the output of a SQLFILE operation
l & On
Because Data Pump is server based rather than client based, Data Pump files are accessed relative to
a e
Oracle directory paths. Absolute paths are not supported for security reasons.
n
t e r U s
I n
c le
r a
O
c a
Data Pump File Locations
e A
c l
The slide shows you the order of precedence used by Data Pump clients to locate files.
r a
• 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 (:).
O ly
• The Data Pump Export and Import clients provide a DIRECTORY parameter, which specifies
& On
the name of a directory object. These directory objects describe the location in which the files
l
are accessed.
n a e
• You can alternatively define an environment variable, DATA_PUMP_DIR, to specify the
e r s
directory object name rather than use the DIRECTORY parameter. The Data Pump clients look
t U
for this environment variable if no explicit directory object is specified.
I n
• A default directory object is created for every database. This directory object is named
c le
DATA_PUMP_DIR. Access to the DATA_PUMP_DIR directory is granted automatically to the
EXP_FULL_DATABASE and IMP_FULL_DATABASE roles.
r a
O
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Pump File Naming and Size
e A
c l
The DUMPFILE parameter specifies the names and (optionally) directories of disk-based dump files.
r a
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
O ly
multiple files may be generated. %U is expanded in the resulting file names into a two-character,
& On
fixed-width, monotonically increasing integer starting at 01. If no DUMPFILE is specified,
l
a e
expdat.dmp is used by default. Created dump files are autoextensible by default.
n
t e r
If FILESIZE is specified, each file is FILESIZE bytes in size and nonextensible. If more dump
s
space is required and a template with %U has been supplied, a new file is automatically created with
U
I n
FILESIZE bytes; otherwise, the client receives a message to add a new file.
If a template with %U is specified, the number of files that are initially created is equal to the
le
PARALLEL parameter.
c
r a
Preexisting files that match the resulting file names are not overwritten by default. Instead, they
result in an error and cause the job to be aborted. If you want the files to be overwritten then set
O
REUSE_DUMPFILES=Y.
Note: If multiple dump file templates are provided, they are used to generate dump files in a circular
fashion.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Scheduling and Running a Job
e A
c l
Data Pump jobs (created through this wizard) can be scheduled as repeatable jobs by Enterprise
Manager Database Control.
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Pump Import
e A
c l
Data Pump Import is a utility for loading an export dump file set into a target system. The dump file
r a
set comprises 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, Data
O ly
Pump Import uses these files to locate each database object in the dump file set.
l & On
You can interact with Data Pump Import by using a command line, a parameter file, or an
interactive-command mode:
n a e
t e r
• You can use the impdp command and specify parameters directly on the command line.
s
• You can enter command line parameters in a file (the PARFILE parameter is excluded because
U
I n
parameter files cannot be nested).
• In interactive-command mode, the current job continues running, but logging to the terminal is
c le
stopped and the Import prompt is displayed. You can, for example, attach additional jobs to an
executing or stopped job.
r a
O
REMAP_DATAFILE = 'C:\oradata\tbs6.f':'/u1/tbs6.f'
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Pump Import: Transformations
e A
c l
Because object metadata is stored as XML in the dump file set, it is easy to apply transformations
r a
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. O ly
& On
• REMAP_TABLESPACE enables objects to be moved from one tablespace to another.
l
n a e
• REMAP_SCHEMA provides the old FROMUSER /TOUSER capability to change object ownership.
• REMAP_TABLE provides the ability to rename entire tables.
e r s
• REMAP_DATA provides the ability to remap data as it is being inserted.
t U
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Pump Import: Transformations (continued)
e A
c l
The TRANSFORM parameter enables you to alter the object-creation DDL for specific objects or for
O ly
• SEGMENT_ATTRIBUTES: If the value is specified as Y, segment attributes (physical attributes,
& On
storage attributes, tablespaces, and logging) are included.
l
n a e
• STORAGE: If the value is specified as Y, the STORAGE clauses are included.
• OID: Determines whether the object ID (OID) of abstract data types is reused or created as new.
e r s
If the value is specified as N, the generation of the export OID clause for object types is
t U
suppressed. This is useful when you need to duplicate schemas across databases by using export
I n
and import, but you cannot guarantee that the object types will have identical OID values in
c le
those databases.
• PCTSPACE: Reduces the amount of space that is required for tablespaces by performing a
r a
shrink operation on tablespace storage allocation. The value supplied for this transformation
O
must be a number greater than zero. It represents the percentage multiplier that is used to alter
extent allocations and the size of data files.
Master coordinator
Parallel
execution
Generated
files
Example:
expdp hr/hr FULL=y
DUMPFILE=dpdir1:full1%U.dmp, dpdir2:full2%U.dmp, dpdir3:full3%U.dmp
FILESIZE=2G PARALLEL=3
LOGFILE=dp_dir1:expfull.log JOB_NAME=expfull
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Pump: Performance Considerations
e A
c l
You can improve job throughput with the PARALLEL parameter. The parallelism setting is enforced
r a
by the master process, which allocates work to be executed to worker processes that perform the data
and metadata processing in an operation. These worker processes operate in parallel. In general, the
O ly
degree of parallelism should be set to more than twice the number of CPUs on an instance. To
& On
maximize parallelism, you must supply at least one file for each degree of parallelism. If there are
l
n a e
not enough dump files, the performance will not be optimal because multiple threads of execution
will try to access the same dump file. The degree of parallelism can be reset at any time during a job.
t e r s
The example in the slide shows a full database export. All data and metadata in the database will be
U
I n
exported. Dump files (full101.dmp, full201.dmp, full301.dmp, and so on) will be
created in a round-robin fashion in the directories pointed to by the dpdir1, dpdir2, and dpdir3
c le
directory objects. For best performance, these should be on separate I/O channels. Each file will be
up to 2 GB in size (as necessary). Up to three files will be created initially, and more files will be
r a
created if needed. The job and master table have the same name: expfull. The log file will be
O
written to expfull.log in the dpdir1 directory.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Performance Initialization Parameters
e A
c l
You can try using the parameters listed in the slide to improve performance, although the results may
not be the same on all platforms.
r a
O ly
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. Turning off
l & On
DB_BLOCK_CHECKING and DB_BLOCK_CHECKSUM only to improve Data Pump performance is
a e
not recommended because this will affect the detection of block corruption.
n
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Pump Direct Path: Considerations
e A
c l
Data Pump automatically selects the appropriate access method for each table.
r a
Direct path: Data Pump uses direct path load and unload when a table’s structure allows it and when
O ly
maximum single-stream performance is desired.
l & On
External tables: Data Pump uses external tables for any of the following conditions:
• Tables with fine-grained access control enabled in insert and select modes
• Domain index for a LOB column
n a e
t e r U s
• Tables with active triggers defined
• Global index on partitioned tables with a single-partition load
I n
• BFILE or opaque type columns
• Referential integrity constraint
le
• VARRAY columns with an embedded opaque type
c
r a
Note: Because both methods support the same external data representation, data that is unloaded
with one method can be loaded using the other method.
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e
Using Enterprise Manager to Monitor Data Pump JobsA
c l
You can use the Enterprise Manager graphical user interface (GUI) to monitor all Data Pump jobs,
DBMS_DATAPUMP package. r a
including those created by using the expdp or impdp command line interfaces or by using the
O ly
You can view the current status of the job and change the status to EXECUTE, STOP, or SUSPEND.
l & On
To access the “Export and Import Jobs” page, click the “Monitor Export and Import Jobs” link in the
a e
Move Row Data region on the Maintenance page.
n
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Data Dictionary
e A
c l
The data dictionary views in the slide list the following table information:
r a
[DBA| ALL| USER]_EXTERNAL_TABLES: Specific attributes of external tables in the database
O ly
[DBA| ALL| USER]_EXTERNAL_LOCATIONS: Data sources for external tables
& On
[DBA| ALL| USER]_TABLES: Descriptions of the relational tables in the database
l
in the database
n a e
[DBA| ALL| USER]_TAB_COLUMNS: Descriptions of the columns of tables, views, and clusters
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
Objectives
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
View critical
1 error alerts in
Enterprise Manager.
c a
Using the Support Workbench
e A
c l
Using the Enterprise Manager Support Workbench, you can investigate, report, and (in some cases)
r a
resolve a problem by performing the following general steps:
1. On the Database Home page in Enterprise Manager, review critical error alerts. View the details
by selecting an alert. O ly
& On
2. Examine the problem details and view a list of all incidents that were recorded for the problem.
l
n a e
Display findings from any health checks that were automatically run.
3. (Optional) Run additional health checks and invoke the SQL Test Case Builder, which gathers
e r s
all required data related to a SQL problem and packages the information in a way that enables
t U
the problem to be reproduced at Oracle Support.
I n
4. Create a service request with MetaLink and (optionally) record the service request number with
c le
the problem information.
5. Invoke the Incident Packaging Service, which packages all gathered diagnostic data for a
r a
problem and (optionally) uploads the data to Oracle Support. You can edit the data to remove
O
sensitive information before uploading.
6. You can maintain an activity log for the service request in the Support Workbench. Run Oracle
advisors to help repair SQL failures or corrupted data.
7. Set the status for one, some, or all incidents for the problem to be closed.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e
Viewing Critical Error Alerts in Enterprise Manager A
c l
You begin the process of investigating problems (critical errors) by reviewing critical error alerts on
r a
the Database Home page. To view critical error alerts, access the Database Home page in Enterprise
Manager. On the Home page, you can click the Active Incidents link in the Diagnostic Summary
O ly
section if there are incidents. You can also use the Alerts section and look for critical alerts that are
flagged as Incidents.
l & On
a e
When you click the Active Incidents link, you access the Support Workbench page, where you can
n
t e r
retrieve details about all problems and corresponding incidents. From there, you can also retrieve all
s
Health Monitor checker findings and created packages.
U
I n
Note: The tasks described in this section are all performed in Enterprise Manager. You can also
accomplish all of these tasks with the ADRCI command-line utility. See the Oracle Database
le
Utilities guide for more information on the ADRCI utility.
c
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Viewing Problem Details
e A
c l
From the Problems subpage on the Support Workbench page, click the ID of the problem that you
r a
want to investigate. This takes you to the corresponding Problem Details page.
O ly
On this page, you can see all incidents that are related to your problem. You can associate your
problem with a MetaLink service request and bug number. In the “Investigate and Resolve” section
l & On
of the page, you see a Self Service subpage that has direct links to the operations that you can
a e
perform for this problem. In the same section, the Oracle Support subpage has direct links to
n
MetaLink.
t e r U s
The Activity Log subpage shows you the system-generated operations that have occurred on your
I n
problem so far. This subpage enables you to add your own comments while investigating the
problem.
c le
On the Incidents subpage, you can click a related incident ID to access the corresponding Incident
a
Details page.
r
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Viewing Incident Details: Dump Files
e A
c l
When you access the Incident Details page, the Dump Files subpage lists all corresponding dump
r a
files. You can then click the eyeglass icon for a particular dump file to visualize the file content with
its various sections.
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Viewing Incident Details: Checker Findings
e A
c l
On the Incident Details page, click Checker Findings to view the Checker Findings subpage. This
r a
page displays findings from any health checks that were automatically run when the critical error was
detected. You will usually have the opportunity to select one or more findings and invoke an advisor
to fix the issue. O ly
l & On
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Creating a Service Request
e A
c l
Before you can package and upload diagnostic information for the problem to Oracle Support, you
r a
must create a service request (SR). To create a service request, you first access Oracle MetaLink.
MetaLink can be accessed directly from the Problem Details page when you click the “Go to
O ly
MetaLink” button in the “Investigate and Resolve” section of the page. Once on MetaLink, log in
& On
and create a service request in the usual manner.
l
a e
When finished, you have the opportunity to enter that service request for your problem. This is
n
t e r
entirely optional and is for your reference only.
U s
In the Summary section, click the Edit button that is adjacent to the SR# label. In the window that
I n
opens, enter the SR# and then click OK.
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
Packaging and Uploading Diagnostic Data to Oracle Support
c l
The Support Workbench provides two methods for creating and uploading an incident package: the
r a
Quick Packaging method and the Advanced Packaging method. The example in the slide shows how
to use Quick Packaging.
O ly
Quick Packaging is a more automated method with a minimum of steps. You select a single problem,
l & On
provide an incident package name and description, and then schedule the incident package upload,
a e
either immediately or at a specified date and time. The Support Workbench automatically places
n
t e r
diagnostic data related to the problem into the incident package, finalizes the incident package,
s
creates the ZIP file, and then uploads the file. With this method, you do not have the opportunity to
U
I n
add, edit, or remove incident package files or add other diagnostic data such as SQL test cases.
To package and upload diagnostic data to Oracle Support:
le
1. On the Problem Details page, in the Investigate and Resolve section, click Quick Package.
c
r a
The Create New Package page of the Quick Packaging wizard appears.
2. Enter a package name and description.
O
3. Enter the service request number to identify your problem.
4. Click Next, and then proceed with the remaining pages of the Quick Packaging Wizard. Click
Submit on the Review page to upload the package.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
Tracking the Service Request and Implementing Repairs
c l
After uploading diagnostic information to Oracle Support, you can perform various activities to track
r a
the service request and implement repairs. Among these activities are the following:
• Add an Oracle bug number to the problem information. On the Problem Details page, click the
O ly
Edit button that is adjacent to the Bug# label. This is for your reference only.
& On
• Add comments to the problem activity log:
l
n a e
1. Access the Problem Details page for the problem.
2. Click Activity Log to display the Activity Log subpage.
e r s
3. In the Comment field, enter a comment and then click Add Comment.
t U
Your comment is recorded in the activity log.
I n
• Respond to a request by Oracle Support to provide additional diagnostics. Your Oracle Support
le
representative can provide instructions for gathering and uploading additional diagnostics.
c
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
Tracking the Service Request and Implementing Repairs (continued)
c l
From the Incident Details page, you can run an Oracle advisor to implement repairs. Access the
r a
suggested advisor in one of the following places:
• On the Self-Service tab of the “Investigate and Resolve” section of the Problem Details page
O ly
• On the Checker Findings subpage of the Incident Details page (as shown in the slide)
l & On
The advisors that help you repair critical errors are:
a e
• Data Recovery Advisor: Corrupted blocks, corrupted or missing files, and other data failures
n
t e r
• SQL Repair Advisor: SQL statement failures
U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Closing Incidents and Problems
e A
c l
When a particular incident is no longer of interest, you can close it. By default, closed incidents are
r a
not displayed on the Problem Details page. All incidents, whether closed or not, are purged after 30
days. You can disable purging for an incident on the Incident Details page.
To close incidents: O ly
l & On
1. Access the Support Workbench home page.
a e
2. Select the desired problem, and then click View.
n
t e r
The Problem Details page appears.
s
3. Select the incidents to close, and then click Close.
U
I n
A confirmation page appears.
4. Click Yes on the Confirmation page to close your incident.
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Incident Packaging Configuration
e A
c l
You can configure retention rules and packaging generation. Access the Incident Packaging
r a
configuration page from the Related Links section of the Support Workbench page by clicking the
Incident Package Configuration link. Here are the parameters you can change:
O ly
• Incident Metadata Retention Period: Metadata is information about the data. For incidents, it
& On
includes the incident time, ID, size, and problem. Data is the actual content of an incident (such
l
as traces).
n a e
• Cutoff Age for Incident Inclusion: This value includes incidents for packaging that are in the
e r s
range to now. When you set the cutoff date to 90, the system includes only those incidents that
t
are within the last 90 days. U
I n
• Leading Incidents Count and Trailing Incidents Count: For every problem included in a
c le
package, the system selects a certain number of incidents from the problem from the beginning
(leading) and the end (trailing). For example, if the problem has 30 incidents and the leading
r a
incident count is 5 and the trailing incident count is 4, the system includes the first 5 incidents
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Working with Oracle Support
e A
c l
Oracle Support Services (OSS) provides 24 × 7 solution support to all Oracle customers throughout
r a
the world. OSS has support centers around the globe to provide this coverage whenever it is required,
365 days a year.
O ly
Support is delivered to Oracle customers through the MetaLink Web site, on the telephone, and by
l & On
using the Oracle Direct Connect (ODC) remote diagnostic tool.
a e
After purchasing Oracle software, customers are provided with a Customer Support Identifier (CSI)
n
t e r U s
number. This number is used to track the software and support licensed to each customer. The CSI
number provides access to all the available patches, documentation, and troubleshooting information
I n
on MetaLink. The CSI number enables customers to log a service request (SR) with OSS.
le
Note: Service requests were formerly called technical assistance requests (TARs).
c
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
MetaLink Integration
e A
c l
Oracle Enterprise Manager (Enterprise Manager) significantly facilitates software patching with its
r a
built-in MetaLink integration. Enterprise Manager automatically alerts users to new critical patches
and flags all systems that require a specific patch. You can invoke the Enterprise Manager patch
O ly
wizard to determine what interim patches are available for installation. Alternatively, you can use the
& On
patch wizard to select an interim patch and determine whether any of your systems require that patch.
l
Manager.
n a e
You can review the patch details and README patch notes directly from within Enterprise
t e r s
You can use the Enterprise Manager patch wizard to download interim patches from MetaLink into
U
I n
the Enterprise Manager patch cache, eliminating the need for repeated downloads. You can stage
appropriate patches on the destination system or systems for manual application at a later time. To
c le
further automate the patching process, you can also provide a customizable patch application script
that is executed on the destination system at a user-defined time by the resident Enterprise Manager
r a
agents. As patches are applied to a system, the corresponding Oracle Universal Installer (OUI)
O
inventory is automatically updated to keep track of the systems’ correct patch level.
Click Patch in the Deployments region of the Maintenance page to access the patch wizard.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Using MetaLink
e A
c l
To register for MetaLink, go to http://metalink.oracle.com/ and select First Time User. At the
r a
prompt, enter your CSI number and answer a few basic questions. After registering, you are ready to
use MetaLink. Note that each CSI number has an administrator designated by the customer who
O ly
controls new-user access to MetaLink. Customers must designate this individual, and then new users
& On
must work with this individual to create new accounts and grant appropriate MetaLink access.
l
a e
MetaLink has a variety of tools and methods available for researching problems.
n
t e r U s
Searching for answers on MetaLink through the standard and advanced search engines is relatively
straightforward. A common problem is that too many results are returned. The following are some
I n
simple steps that can improve the quality and relevance of search results:
• Use full and exact error text when performing your search. For example, ORA-1400:
le
mandatory (NOT NULL) column returns more relevant answers than ORA-1400.
c
r a
• When researching errors in Oracle E-Business Suite, enter the name of the code as part of the
search criteria. For example, APXINWKB ORA-1400: mandatory (NOT NULL)
O
column returns fewer and better results than if you supply only the error message.
l & On
methods are available for searching the BUG database.
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Researching an Issue
e A
c l
Oracle MetaLink provides several resources that can be used to research an issue. The following
r a
steps outline basic troubleshooting techniques that use MetaLink resources:
1. Keyword search: Most issues can be resolved quickly and easily by using the keyword search
O ly
utility on MetaLink. Effective searches can provide much information about a specific problem
and its solutions.
l & On
n a e
2. Documentation: If keyword searching fails to yield a solution, you should review the
documentation to ensure that setup problems are not the root cause. Setup issues account for
e r s
more than one-third of all service requests; it is always good to review setups early in the
t U
troubleshooting process. Documentation consists of user guides and implementation manuals
I n
published in PDF format as well as product README files and installation notes published in
c le
HTML. Both of these document types are available on MetaLink and can be accessed through
the self-service toolkits for each product.
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Logging Service Requests
e A
c l
You may research an issue on MetaLink, but may be unable to locate a solution. In this case, you
r a
should log a service request (SR) through MetaLink. You can log an SR by clicking the Service
Request tab on the MetaLink home page.
O ly
The first step in creating an SR is the selection of a CSI number and SR profile. After the required
l & On
profile information has been submitted, MetaLink gathers some specifics about the problem,
a e
including the problem type, error message, brief summary of the issue, and language preference.
n
t e r
MetaLink performs a search by using this information and attempts to find a solution.
U s
The search conducted during this phase may provide different results than the searches you have
I n
performed earlier. Both searches retrieve notes and BUGs from the same database; however, the
search engines and weighting are slightly different. Because the search results can differ, it is
le
important that the search results are reviewed during the SR creation process, even if previous
c
a
searches have been conducted by using the MetaLink search engine.
r
O
m y
Note: For more information, refer to MetaLink Technical Note 166650.1 (“Working Effectively
with Global Customer Support”).
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Kinds of patches
• Interim patches
– For specific issues
– No regression testing
• CPUs (Critical Patch Updates)
– Critical security issues
– Regression testing
– Does not advance version number
• Patch releases
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Managing Patches
e A
c l
You can apply different kinds of patches at different times for different reasons.
r a
• Interim patches (also known as one-off or one-of patches) are created to solve a specific
problem. They do not go through a full regression test. Interim patches are typically installed
O ly
with the opatch utility. The Enterprise Manager Patching Wizard can help automate the
& On
patching process by downloading, applying, and staging the patches. This wizard uses the
l
n a e
opatch utility in the background.
• CPU patches (Critical Patch Update patches) include security patches and dependent non-
e r s
security patches. The CPU patches are cumulative, which means fixes from previous Oracle
t U
security alerts and critical patch updates are included. It is not required to have previous security
I n
patches applied before applying the CPU patches. However, you must be on the stated patch set
c le
level. CPU patches are for a specific patch release level (such as 10.2.0.3). CPU patches are
installed with the opatch utility or through EM Patching Wizard. The CPU patches are issued
r a
quarterly. CPU patches and interim patches can also be removed from your system with
O
opatch rollback -id <patch id>.
Oracle does extensive testing of Critical Patch Updates with our own applications, as well as
running regression tests for the Critical Patch Updates themselves. To verify that a patch has
been applied, query the inventory with opatch -lsinventory and see if the patch is
listed.
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Applying a Patch Release
e A
c l
Software management involves keeping your Oracle software up-to-date with the latest product
r a
fixes. Periodically, Oracle issues patch releases (product fixes) for its software. Patch releases are
fully tested product fixes only; they do not include new functionality. Application of a patch release
O ly
affects only the software residing in your Oracle home, with no upgrade or change to the database.
l & On
Patches are individual bug fixes. Patch sets are a collection of bug fixes up to the time of the patch
a e
set release. All patch and patch set releases carry version numbers. For example, if you bought
n
t e r
Oracle Database 11g Release 11.1.0.2, an available patch set is 11.1.0.3. Every patch or patch set
s
also has a patch number to identify it. Every patch release has an associated README file that
U
I n
describes its bug fixes. The README also has instructions for manually applying the patch.
Enterprise Manager enables you to find the latest patch release on the Oracle MetaLink Web site and
le
download it to your Oracle home.
c
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Using the Patch Advisor
e A
c l
The Patch Advisor shows you Critical Patch Updates and recommended patches for your system. The
r a
recommendation can be based on features usage, or you can display all available patches. The Patch
Setup must be configured, and the RefreshFromMetalink job must run before the patches are
visible. O ly
l & On
Click Patch Setup in the Related links section of the Patch Advisor page to navigate to the Patch
Setup page.
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Using the Patch Wizard
e A
c l
When you click Apply Patch in the Database Software Patching section of the “Software and
r
Support” page, the Patch Wizard is invoked.
a
O ly
The first step is Select Patches. Click Add Patch to select more patches to apply in this scheduled
run.
l & On
The Target List step is reserved for patching RAC and is skipped in Oracle Database 11g Release 1.
n a e
The Library Step Properties are skipped unless the customer has customized the deployment
t e r U s
procedures with custom variables. In the latter case, the Library Step properties are not skipped, and
the user enters values for the custom variable.
I n
In the next step, you provide the credentials for running the patch job and for determining if the job
c le
should run immediately or at a later time.
You then review the job and submit it.
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Applying a Patch
e A
c l
You can find and apply a patch, CPU, or patch release by using the “Software and Support” page.
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Staging a Patch
e A
c l
When you click Stage Patch in the Database Software Patching section of the “Software and
r
Support” page, the Patch Wizard is invoked.
a
O ly
The first step is to select the patch either by number or by criteria.
l & On
You then select the destination. In this step, you can choose from a list of available targets.
In the third step, provide the credentials of the OS user that is to do the patching, It is recommended
n a e
that this be the user that owns the software installation.
e r s
In the next step, you can choose either to stage the patch or to stage and apply the patch.
t U
I n
The fifth step schedules the job.
The final step enables you to review and submit the patch job.
c le
The staged patches are stored in the $ORACLE_HOME/EMStagedPatches_<sid> directory on
r a
UNIX and Linux platforms, and in the %ORACLE_HOME%\EMStagedPatches_<sid>
directory on Windows platforms.
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
Table of Contents
Practices for Lesson 1 ......................................................................................................... 4
Practice 1-1: Exploring the Oracle Database Architecture ............................................. 5
Practices for Lesson 2 ......................................................................................................... 9
Practice 2-1: Installing the Oracle Database Software ................................................. 10
Practices for Lesson 3 ....................................................................................................... 14
Practice 3-1: Creating an Oracle Database ................................................................... 15
Practices for Lesson 4 ....................................................................................................... 22
Practice 4-1: Managing the Oracle Instance ................................................................. 23
Practices for Lesson 5 ....................................................................................................... 29
Practice 5-1: Configuring the Oracle Network to Access Another Database ............... 30
Practice 5-2: Creating an Alternate Listener................................................................. 34
Practices for Lesson 6 ....................................................................................................... 37
Practice 6-1: Viewing Database Storage Structure Information................................... 38
Practice 6-2: Creating a Tablespace.............................................................................. 42
Practices for Lesson 7 ....................................................................................................... 45
Practice 7-1: Creating and Using a Profile ................................................................... 46
Practice 7-2: Creating Roles ......................................................................................... 48
Practice 7-3: Creating and Configuring Users .............................................................. 50
Practices for Lesson 8 ....................................................................................................... 53
Practice 8-1: Creating Tables........................................................................................ 54
m
Practice 8-2: Creating Indexes ...................................................................................... 60
y
d e
Practice 8-3: Modifying Tables .................................................................................... 63
Practice 8-4: Creating Views ........................................................................................ 64
c a
Practice 8-5: Viewing Schema Object Information ...................................................... 65
A
Practices for Lesson 9 ....................................................................................................... 67
Practice 9-1: Resolving Lock Conflicts ........................................................................ 68
e
l
Practices for Lesson 10 ..................................................................................................... 72
c
r a
Practice 10-1: Managing Undo Data............................................................................. 73
Practices for Lesson 11 ..................................................................................................... 78
O ly
Practice 11-1: Configuring Database Auditing............................................................. 79
Practices for Lesson 12 ..................................................................................................... 82
l & On
Practice 12-1: Database Maintenance........................................................................... 83
n a e
Practices for Lesson 13 ..................................................................................................... 93
Practice 13-1: Managing Performance.......................................................................... 94
e r s
Practices for Lesson 14 ................................................................................................... 102
t U
Practice 14-1: Configuring Your Database for Recovery........................................... 103
I n
Practices for Lesson 15 ................................................................................................... 111
le
Practice 15-1: Performing Database Backups............................................................. 112
a c
Practices for Lesson 16 ................................................................................................... 118
Practice 16-1: Preparing Practice Environment.......................................................... 119
O rPractice 16-2: Recovering from the Loss of a Control File ........................................ 120
Practice 16-3: Recovering from the Loss of a Data File............................................. 126
Practice 16-4: Recovering from the Loss of a Redo Log Member ............................. 129
Practice 16-5: Recovering from the Loss of a File in the SYSTEM Tablespace......... 132
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 3
Practices for Lesson 1
Background: In this practice, you review concepts about Oracle architecture components
and answer questions to test your knowledge of the concepts learned in the lesson.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 4
Practice 1-1: Exploring the Oracle Database Architecture
Fill in the blanks with the correct answers.
m y
Hint: see page 1-26
d e
c
8) The primary files associated with an Oracle database are:
a
• ___________________________
e A
• ___________________________
c l
• ___________________________
r a
O ly
Additional important files are:
•
l & On
___________________________
• a e
___________________________
n
•
e r s
___________________________
t U
•
n
___________________________
I
le
• ___________________________
a c
O r Hint: see page 1-36
10) The ___________________process copies the redo log files to an archive destination.
11) The _____________________ contains data and control information for a server or
background process.
m y
d e
Hint: see page 1-11
c a
A
12) The logical tablespace structure is associated with the physical
e
____________________files on disk.
c l
Hint: see page 1-40 r a
O ly
13) LGWR writes when:
l & On
•
n a e
___________________________
•
e r s
___________________________
t U
•
I n
___________________________
c le
Hint: see page 1-26
r a
O
Oracle Database 11g: Administration Workshop I A - 7
Practice 1-1: Exploring the Oracle Database Architecture
(continued)
14) State whether the following statements are true or false.
a) The SGA includes the Database buffer cache and Redo log buffer. ____
b) Each server process and background process has its own PGA. ____
c) The buffers in the database buffer cache are organized in two lists: the most
recently used list and the least recently used (LRU) list. ____
d) User processes run the application or Oracle tool code. ____
e) Oracle Database processes include server processes and background processes.
____
f) Checkpoints are recorded in log file headers. ___
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 8
Practices for Lesson 2
Background: In the practices of this course, you assume the role of a database
administrator (DBA). The operating system (OS) accounts on your computer are:
• The oracle user with a password of oracle
• The root user with a password of oracle
The system administrator has set up the OS so that it is ready for the installation, and the
installation media is staged at /stage/db11g/db/Disk1. Perform the following
tasks as the default oracle OS user, unless otherwise indicated.
Note: Completing this practice is critical for all following practice sessions.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 9
Practice 2-1: Installing the Oracle Database Software
1) Install the Oracle database software as the oracle user. Navigate to the
/stage/db11g/db/Disk1 directory, and start the Oracle Universal Installer
(OUI) by entering ./runInstaller.
a) Right-click on the desktop and click Open Terminal to open a terminal window.
Then enter the following:
$ cd /stage/db11g/db/Disk1
$ ./runInstaller
Note: Ensure that you deselect the Create Starter Database option.
b) Click Next.
m y
d e
c) You are now on the page titled “Specify Inventory directory and credentials.”
Enter /u01/app/oraInventory as inventory directory and oinstall as
c
Operating System group name. Click Next. a
A
OUI is loading the products list and checking product-specific prerequisites.
e
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 10
Practice 2-1: Installing the Oracle Database Software (continued)
d) After OUI has finished its prerequisite checks on the “Product-Specific
Prerequisite Checks” page, click Next.
m y
d e
c a
3) When the prerequisite checks are finished, the Summary page is displayed.
A
Click Install to begin your installation.
e
greatly influence this estimate. c l
Estimated installation time is 10–15 minutes. However, varying environments can
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 11
Practice 2-1: Installing the Oracle Database Software (continued)
4) When the “Execute Configuration scripts” page appears, follow the instructions by
running the scripts specified on that page. Accept the default for the local bin
directory when running the root.sh script. When the scripts are finished running,
click OK and then finish your installation with the OUI.
m y
d e
c a
e A
a) Do not click OK yet. Open another terminal window.
c l
b) Navigate to /u01/app/oraInventory and run the orainstRoot.sh
script as root.
r a
O ly
Note: The password for root is oracle.
$ su
Password:
l & On
a e
# cd /u01/app/oraInventory
n
# ./orainstRoot.sh
t e r s
Changing permissions of /u01/app/oraInventory to 770.
U
I n
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete
c le
c) Still connected as root, navigate to
/u01/app/oracle/product/11.1.0/db_1 and run the root.sh script.
O # cd /u01/app/oracle/product/11.1.0/db_1
# ./root.sh
Running Oracle 11g root.sh script...
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 14
Practice 3-1: Creating an Oracle Database
In this practice, you first create a listener and then create the orcl database. You use
Oracle Net Configuration Assistant (netca) to create the listener and the Database
Configuration Assistant (DBCA) to create the database.
1) To create the listener, open a terminal window and start the Oracle Net Configuration
Assistant by entering netca at the command prompt. Choose to perform listener
configuration and go through each page of the assistant, accepting the defaults for
listener name, protocol, and port. Exit netca when finished.
Note: You can also use the lab_03_01.sh script, which is in the
/home/oracle/labs directory. This script uses the netca utility in silent mode
to create a listener for you.
Note: Completing the database creation is critical for all the following practice
sessions.
a) Open a terminal window and enter netca at the command prompt.
$ netca
e A
2) Now you are ready to create the database. Start the Database Configuration Assistant
(DBCA).
c l
r a
a) Open a terminal window as the oracle user by right-clicking on your desktop
and selecting Open Terminal.
b) To start the DBCA, enter: O ly
l & On
a e
$ dbca
r n s
n e
3) Begin the orcl database creation. Use the General Purpose database template.
t U
a) In the DBCA, click Next on the Welcome page.
I
c le
b) On the Operations page, select Create a Database, and then click Next.
c) On the Database Templates page, select General Purpose or Transaction
Question 7: What is the template default for the Database Character Set?
Answer: WE8MSWIN1252
m y
character set.
d e
Note: You will change this setting later in this practice to use a Unicode database
c
e) Click Close to close the Template Details window. a
f) Click Next.
e A
l
4) Create the orcl database, as well as the orcl template and the database generation
c
scripts.
r a
a) On the Database Identification page, enter orcl.oracle.com as Global Database
O ly
Name. The SID defaults to the database name orcl. Click Next.
l & On
b) On the Management Options page, ensure that the following items are selected:
a e
- Configure Enterprise Manager
n
c) Click Next.
t e r U s
- Configure Database Control for local Management
I n
d) On the Database Credentials page, select Use the Same Password for All
c le
Accounts and enter oracle as Password and Confirm Password. Then click
Next.
r a
e) On the Storage Options page, select File System, and then click Next.
O f) On the Database File Locations page, select Use Database File Location from
Template. Make a note of the file location variables. Click Next.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 17
Practice 3-1: Creating an Oracle Database (continued)
j) Click the Character Sets tab and select Use Unicode (AL32UTF8).
k) Review the Sizing and Connection Mode tabbed pages, but do not change any
m y
values. Then click Next.
d e
c
m) On the Automatic Maintenance tasks page, select Enable automatic
a
l) On the Security Settings page, accept the 11g security settings and click Next.
m y
d e
c a
q) The Confirmation page appears. Review options and parameters, such as Sample
A
Schemas (true), db_block_size (8KB), sga_target (404MB),
e
c l
Database Character Set (AL32UTF8), and then click OK.
r) Click OK to acknowledge that the template has been created. Then acknowledge
r a
the generation of the database scripts (if you selected those options).
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 19
Practice 3-1: Creating an Oracle Database (continued)
s) 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.
m y
Important: Make note of your Database Control URL here:
d e
c
https://_________________________________________:______/em a
A
You will be using this URL many times throughout the remainder of the course.
e
l
t) Click the Password Management button.
c
a
u) Scroll down the Password Management page until you see the HR username.
r
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 20
Practice 3-1: Creating an Oracle Database (continued)
v) Deselect Lock Account? and enter hr as the New Password and Confirm
Password. Then click OK.
m y
w) Click Exit to close the DBCA.
d e
and database generation scripts.
c a
You completed your task to create a database and (optionally) a database template
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 21
Practices for Lesson 4
Background: You have just installed the Oracle software and created a database. You
want to ensure that you can start and stop the database and see the application data.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 22
Practice 4-1: Managing the Oracle Instance
In this practice, you get to know the Oracle Enterprise Manager interface a little better.
Using Oracle Enterprise Manager you perform the following tasks:
• View and change instance parameters
• Shut down the database
• Start up the database
You also view various instance parameters using SQL*Plus and look the text version of
the alert log from a terminal window.
1) Invoke Enterprise Manager, and log in as the SYS user. Which port number does this
database use? You noted this in Practice 3.
Answer: 1158
a) Double-click the Web Browser icon on your desktop to open your Web browser
as the oracle user.
b) Enter the URL that you wrote down in Practice 3. It has the following format:
https://hostname:portnumber/em
The Oracle Enterprise Manager window appears.
Note: You may receive a dialog box titled Website Certified by an Unknown
Authority. Select the “Accept this certificate permanently” option and click OK.
If you are not using Mozilla browser and you receive a similar dialog box, select
the option that will accept the certificate.
m y
c) Log in by entering sys as User Name and oracle as Password, and selecting
SYSDBA as Connect As. Then click Login. d e
c a
e A
c l
r a
O ly
l & On
n a e
d) You may receive a security warning. In class, deselect Alert me whenever I
t e r U s
submit information that’s not encrypted, and then click Continue.
2) View the initialization parameters and set the JOB_QUEUE_PROCESSES parameter
I n
to 15. What SQL statement is run to do this?
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 23
Practice 4-1: Managing the Oracle Instance (continued)
a) Select Server > Initialization Parameters (in the Database Configuration
section).
d e
d) Click Show SQL and note the SQL statement that is going to be run next.
c a
e A
c l
r a
e) Click Return, and then click Apply.
O ly
3) Question: What is the significance of a check in the Dynamic column?
& On
Answer: A “dynamic” parameter can be modified while the database is active.
l
a e
4) Shut down the database instance by using Enterprise Manager.
n
t
b) Click Shutdown.e r U s
a) In the Enterprise Manager browser session, click the Database tab.
I n
c) For Host Credentials, enter oracle as Username and oracle as Password.
le
d) Click OK. The “Startup/Shutdown: Confirmation” page appears.
c
r a
e) Click Advanced Options to see the mode for shutting down, but do not change
the mode; it should remain as “Immediate.”
O f) Click Cancel to return to the previous page.
g) Click Yes to confirm the shutdown operation.
5) Using SQL*Plus, verify that you are not able to connect as the HR user to a database
that has been shut down.
a) In the Linux command window, enter the following to attempt to log in to the
database:
$ sqlplus hr
A
Question: What SQL is run to accomplish the database startup?
e
c l
a) In Enterprise Manager, click the Startup button.
r a
b) Enter oracle for both Username and Password in the Host Credentials
region.
O ly
c) Click OK.
l & On
d) The “Startup/Shutdown: Confirmation” page appears. Click Show SQL to view
n a e
the SQL that is about to run.
e r s
Question: What SQL is run to accomplish the database startup?
t U
n
Answer: STARTUP
I
c le
r a
O e) Click Return.
f) Click Yes to confirm the startup operation.
m y
d e
c a
e A
c) Note that the modes that the database goes through during startup are MOUNT and
OPEN.
c l
r a
d) Locate and view the text version of the alert log.
O ly
Connect to the database as the system user (password is oracle) using
SQL*Plus and query the V$DIAG_INFO view. To view the text-only alert log
l & On
without the XML tags, complete these steps:
a e
i) In the V$DIAG_INFO query results, note the path that corresponds to the
n
t e r
Diag Trace entry.
U s
n
SQL> select * from V$DIAG_INFO;
I
le
INST_ID NAME
c
---------- ------------------------------------------------
r a VALUE
-----------------------------------------------------------
O ...
1 Diag Trace
/u01/app/oracle/diag/rdbms/orcl/orcl/trace
...
9) Use the SHOW PARAMETER command to verify the settings for SGA_TARGET,
PGA_AGGREGATE_TARGET, DB_CACHE_SIZE, and SHARED_POOL_SIZE.
e A
NAME
c l TYPE VALUE
db_cache_size
r a
------------------------------------ ----------- ----------
big integer 0
O ly
SQL> show parameter shared_pool_size
NAME
l & On TYPE VALUE
shared_pool_size
n a e
------------------------------------ ----------- ----------
big integer 0
SQL>
t e r U s
I n
10) Check the value of JOB_QUEUE_PROCESSES.
c le
SQL> show parameter job_queue_processes
r a
O NAME TYPE VALUE
------------------------------------ ----------- ----------
job_queue_processes integer 1000
SQL>
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 28
Practices for Lesson 5
Background: Users need to connect to your orcl database. Work with them to enable
connections by using different methods. Ensure that users can use connect-time failover
to take advantage of a backup listener.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 29
Practice 5-1: Configuring the Oracle Network to Access Another
Database
Configure your network environment so that you can connect to a partner’s orcl
database. Use local naming and create a new network service name called testorcl
that maps to your partner’s orcl database. Test your network changes by attempting to
connect to your partner’s database using the testorcl service name.
1) Make a copy of your listener.ora and tnsnames.ora files. They are in the
$ORACLE_HOME/network/admin directory.
a) In a terminal window, enter cd $ORACLE_HOME/network/admin to
navigate to the
/u01/app/oracle/product/11.1.0/db_1/network/admin
directory.
b) Enter cp listener.ora listener.old to create a copy of the
listener.ora file.
c) Enter cp tnsnames.ora tnsnames.old to create a copy of the
tnsnames.ora file.
d) Enter ls -l, if you want to see the copies and their privileges in your directory.
2) Navigate to the Net Services Administration page. Start by clicking the Listener
link on the Database home page.
m y
database.
d e
a) Invoke Enterprise Manager as the SYS user in the SYSDBA role for your orcl
c a
b) On the Database Instance – Home page, click the Listener link in the General
region.
e A
c l
c) In the Related Links region, click Net Services Administration.
3) Modify your local Names Resolution file so that you can connect to another database.
r a
Name the connection to a partner’s orcl database testorcl.
O ly
a) On the Net Services Administration page, select Local Naming from the
& On
Administer drop-down list, and then click Go.
l
n a e
b) The Netservices Administration: Host Login page appears. If you previously
saved the oracle username and oracle password as preferred credentials for
t e r U s
your host login, 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.
I n
c le
c) On the Local Naming page, click Create to enter a new network service name.
d) Enter testorcl as Net Service Name.
r a
e) Select Use Service Name, and enter orcl.oracle.com as Service Name.
O Note: You can also choose to enter a SID by selecting the Use SID option. In this
case, you must enter orcl.
m y
g) Click Add in the Addresses region.
d e
in?”
c a
Click No if you are asked, “Do you want to remember the values you filled
A
h) On the Add Address page, select the following values:
e
Option Value
c l
Protocol
Port
TCP/IP
1521
r a
Host
O ly
<Your partner’s host name or IP address—for example,
l & On
edrsr12p1.us.oracle.com or
139.185.35.112>
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 31
Practice 5-1: Configuring the Oracle Network to Access Another
Database (continued)
i) Click OK to return to the Create Net Service Name properties page.
j) Click OK.
The Creation Message appears: Net Service “testorcl” created successfully.
4) In Enterprise Manager, test access to your partner’s orcl database as the system
user with the oracle password by using the testorcl Local Naming.
a) Select testorcl on the Local Naming page, and then click Test Connection.
The message “Test Connection To Net Service Name: testorcl” appears.
b) Enter system as Username and oracle as Password, and then click Test.
The Processing page displays status information. It is followed by a success
message. If you receive any errors or warnings, resolve them.
m y
d e
c a
e A
c l
r a
O ly
l & On
Click OK after the test is completed.
n a e
5) Test your changes to the network configuration using SQL*Plus. Again, use:
t e r U s
system/oracle@testorcl. To see your partner’s information, select the
instance_name and host_name columns from the v$instance table.
I n
a) In a terminal window, enter:
c le
$ sqlplus system/oracle@testorcl
r a The Oracle SQL*Plus window opens. If you receive any errors or warnings,
resolve them.
O
Oracle Database 11g: Administration Workshop I A - 32
Practice 5-1: Configuring the Oracle Network to Access Another
Database (continued)
b) At the SQL> prompt, enter the following command:
SQL> select instance_name, host_name from v$instance;
INSTANCE_NAME
----------------
HOST_NAME
-----------------------------------------------------------
orcl
edrsr12p1.us.oracle.com
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 33
Practice 5-2: Creating an Alternate Listener
In this practice, you create a second listener that could be used to support connect-time
failover.
1) First, log out of Enterprise Manager and run the lab_05_06.sh script to configure
the NetProperties file to allow you to configure the listener from Enterprise
Manager.
a) Log out of Enterprise Manager.
b) Run the lab_05_02_01.sh script at the operating system command prompt.
c) Log in to Enterprise Manager as the SYS user in the SYSDBA role for your orcl
database.
2) Create a new listener called LISTENER2 to support connect-time failover. Use port
1561 for this listener.
a) Log into Enterprise Manager as the SYS user in the SYSDBA role. On the
Database Instance – Home page, click the Listener link in the General region.
b) In the Related Links region, click Net Services Administration.
c) 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.
m y
d) On the Listeners page, which gives you an overview of the existing listeners, click
the Create button.
The Create Listener page appears. d e
c a
e) Enter LISTENER2 as Listener Name, and then click Add to add a listener
address.
e A
l
f) Enter or confirm the following values:
c
Option
Protocol
Value
TCP/IP r a
Port 1561
O ly
Host
& On
<Your computer’s host name—for example,
l
edrsr30p1.us.oracle.com
g) Click OK.
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 34
Practice 5-2: Creating an Alternate Listener (continued)
h) Click the Static Database Registration tab.
i) Click the Add button to connect the new listener with your orcl database.
j) Enter the following values:
Option Value
Service Name orcl
Oracle Home Directory /u01/app/oracle/product/11.1.0/db_1
Oracle System Identifier orcl
(SID)
m y
d e
c a
e A
k) Click OK to add the database service.
c l
l) Click OK to create the LISTENER2 listener.
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 35
Practice 5-2: Creating an Alternate Listener (continued)
3) Start the LISTENER2 listener.
a) Confirm that the LISTENER2 listener and Start/Stop Actions are selected, and
then click Go.
b) Click OK on the Start/Stop page.
A confirmation message appears with a View Details link.
c) Optionally, click the View Details link, review the listener status information, and
use the Back icon of your browser to return to the previous page.
4) Stop your default listener and check the status of the new listener
a) Issue the following commands at the command prompt
$ lsnrctl stop
$ lsnrctl status
$ lsnrctl status LISTENER2
b) Connect to your database using the new listener using an easy connect string.
$ sqlplus hr/hr@ your_ip_address:1561/orcl
Your connection is through your newly created listener. Exit SQL*Plus after you
complete this step.
c) Restart your default listener using the following command:
$ lsnrctl start LISTENER
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 36
Practices for Lesson 6
Background: You need to view existing storage structure information and create a new
tablespace for the INVENTORY application. You also need to create a database user to
perform all administrative tasks without using the SYS and SYSTEM accounts.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 37
Practice 6-1: Viewing Database Storage Structure Information
In this practice, you take a look at existing storage structure information for your
database. Before you begin, you run a script that creates a new user DBA1 that will be
used for your DBA tasks from now on. You must configure this user in Enterprise
Manager to be one of the Administrators.
1) Run the lab_06_01.sh script that creates the DBA1 user. It is located at
/home/oracle/labs. The password for DBA1 is oracle.
a) If you do not have a terminal window open from previous practices, open one
now by right-clicking on your desktop and selecting Open Terminal.
b) Change the current directory to the labs directory by entering:
$ cd labs
c) Enter the following command to run the script that creates the DBA1 user:
$ ./lab_06_01.sh
d) Leave the terminal window open. You will use it again later.
2) Use the Setup link in the top-right corner of Enterprise Manager (EM) to define the
DBA1 user as one who can perform administrative tasks in EM. When the non-SYS
user is configured, log out as the SYS user and log in as the DBA1 user. Use the
DBA1 user to perform the rest of these tasks, unless otherwise indicated.
m
a) In the far top-right corner of the EM window, click Setup and then on the Setup
y
page select Administrators.
d e
c a
e A
c l
r a
O ly
l & On
n a e
b) Click Create to add the DBA1 user to the Administrators list. This will enable the
DBA1 user to perform management tasks by using Enterprise Manager.
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 38
Practice 6-1: Viewing Database Storage Structure Information
(continued)
c) Enter dba1 as Name, and oracle as Password and Confirm Password. Leave
Email Address blank, and leave Super Administrator selected, and then click
Review.
d) On the “Create Administrator: Review” page, click Finish.
e) Now that there is a non-SYS user, click Logout in the top-right corner, and then
click Login.
f) Enter dba1 as User Name and oracle as Password, and select SYSDBA as
Connect As. Then click Login.
The Database Home page appears.
3) Using Enterprise Manager, view information about the EXAMPLE tablespace. Answer
the following questions about it:
a) Question 1: What percentage of free space can be used up before the Warning
threshold is reached?
i) In Enterprise Manager, select Server > Storage > Tablespaces.
ii) Click the EXAMPLE tablespace name.
Answer: 85%
m y
d e
c a
e A
b) Question 2: How many segments are there in the EXAMPLE tablespace?
c l
i) From the Actions drop-down list, select Show Tablespace Contents, and
then click Go.
r a
O ly
ii) The Show Tablespace Contents page appears.
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 39
Practice 6-1: Viewing Database Storage Structure Information
(continued)
Answer: 418 (Your answer may vary.)
c) Question 3: Which index in the EXAMPLE tablespace takes up the most space?
i) Select INDEX from the Type drop-down list in the Search region, and then
click Go.
m y
e
ii) Notice the Size column is the sort column and that it is sorted in descending
d
order.
c a
e A
c l
r a
O ly
Answer: SH.CUSTOMERS_PK
l & On
a e
d) Question 4: Which segment is stored physically first in the tablespace? That is,
n
t e r U s
which one is stored right after the tablespace header?
i) Scroll to the bottom of the page, and then click the plus icon to the left of the
I n
Extent Map label.
c le
ii) After several seconds, the extent map appears. Note that the map legend
indicates that pink is the tablespace header.
r a iii) Scroll back to the top of the page, select All Types from the Type drop-down
v) Scroll to the top of the page again, and note the segment that is being pointed
to:
m y
d e
c a
e A
Answer: HR.REGIONS
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 41
Practice 6-2: Creating a Tablespace
In this practice, you create the Inventory tablespace that will be used in a later practice.
1) Create a new, locally managed tablespace (LMT) called INVENTORY of size 5 MB.
a) In Enterprise Manager, select Server> Storage > Tablespaces.
b) Click Create.
c) Enter INVENTORY as the tablespace name, and verify that Extent Management
is Locally Managed, Type is Permanent, Status is Read Write, and Use bigfile
tablespace is not selected.
d) Click Add in the Datafiles region.
e) On the Add Datafile page, enter inventory01.dbf for File Name, and 5 MB as File
Size.
f) Click Continue.
g) Click the Storage tab, and verify that Extent Allocation is Automatic, Segment
Space Management is Automatic, Compression Options is Disabled, and
Logging is set to Yes.
h) Click the General tab and review your settings.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
i) Click Show SQL to see the SQL that will be run, and then click Return
r a
j) Click OK, and a successful Update Message appears.
O2) As the DBA1 user, run the lab_06_02_02.sql script to create and populate a
table (called X) in the INVENTORY tablespace. What error do you eventually see?
a) In a terminal window, navigate to the labs directory.
c) Note that there is eventually an error ORA-01653 stating that the table cannot be
extended. There is not enough space to accommodate all the rows to be inserted.
...
SQL> insert into x select * from x
2 /
SQL> commit
2 /
m y
Commit complete.
d e
SQL> quit
c a
Release 11.1.0.6.0 - Production
e A
Disconnected from Oracle Database 11g Enterprise Edition
r a
3) Go to the Enterprise Manager window and define space for 72 MB in the tablespace
O ly
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?
l & On
a) Select Server> Storage > Tablespaces.
n a e
b) Select the INVENTORY tablespace, and then click Edit.
t e r U s
c) In the Datafiles region, click Edit.
I n
d) Change File Size from 5 MB to 72 MB.
c le
e) Click Continue to return to the General tabbed page.
f) Click Show SQL to see the SQL that will be run. Note that it is an ALTER
r a DATABASE statement. Click Return.
O
Oracle Database 11g: Administration Workshop I A - 43
Practice 6-2: Creating a Tablespace (continued)
g) Click Apply.
4) Go back to the terminal window and run the lab_06_02_04.sql script. It drops
the table and re-executes the original script that previously returned the space error.
a) Go to the terminal window.
b) Enter the following to run the script:
$ sqlplus dba1/oracle @lab_06_02_04.sql
c) Note that the same number of row inserts are attempted, and there is no error
because of the increased size of the tablespace.
5) In a terminal window, run the lab_06_02_05.sql script to clean up the
tablespace for later practice sessions.
a) Enter the following to run the script:
$ sqlplus dba1/oracle @lab_06_02_05.sql
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 44
Practices for Lesson 7
Background: You need to create a user account for Jenny Goodman, the new human
resources department manager. There are also two new clerks in the human resources
department, David Hamby and Rachel Pandya. All three must be able to log in to the
orcl database and to select data from, and update records in, the HR.EMPLOYEES
table. The manager also needs to be able to insert and delete new employee records.
Ensure that if the new users forget to log out at the end of the day, they are automatically
logged out after 15 minutes. You also need to create a new user account for the inventory
application that you are installing.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 45
Practice 7-1: Creating and Using a Profile
In this practice, you create the INVENTORY user to own the new Inventory application.
You create a profile to limit the idle time of users. If a user is idle or forgets to log out
after 15 minutes, the user session is ended.
1) Mandatory task: Review and run the lab_07_01.sh script (located in the
/home/oracle/labs directory) to create the INVENTORY user, which you will
use in the next practice.
a) In a terminal window enter:
$ cd $HOME/labs
$ cat lab_07_01.sh
# Oracle Database 11g: Administration Workshop I
# Oracle Server Technologies - Curriculum Development
#
# ***Training purposes only***
#***Not appropriate for production use***
#
# Start this script as OS user: oracle
# This script creates the INVENTORY schema user
# The DROP command fails the first time
# you execute the script.
# The error can be ignored.
e A
c
grant connect, resource to inventory;
l
exit;
r a
EOF
$ ./lab_07_01.sh O ly
l & On
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Jul 26
21:18:27 2007
n a e
e r s
Copyright (c) 1982, 2007, Oracle.
t U
All rights reserved.
I n
le
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
a c
Production
SQL> SQL> 2
User created.
SQL> SQL>
Grant succeeded.
2) Create a profile named HRPROFILE that allows only 15 minutes idle time.
a) Invoke Enterprise Manager as the SYS user in the SYSDBA role for your orcl
database.
b) Click the Server tab, and then click Profiles in the Security section.
c) Click the Create button.
m y
d) Enter HRPROFILE in the Name field.
d e
e) Enter 15 in the Idle Time (Minutes) field.
c
f) Leave all the other fields set to DEFAULT. a
A
g) Click the Password tab, and review the Password options, which are currently all
e
set to DEFAULT.
c l
and then click Return. r a
h) Optionally, click the Show SQL button, review your underlying SQL statement,
O ly
i) Finally, click OK to create your profile
l & On
3) Set the RESOURCE_LIMIT initialization parameter to TRUE so that your profile
limits are enforced.
n a e
t e r
Configuration section.
U s
a) Click the Server tab, and then click Initialization Parameters in the Database
I n
b) Enter resource_limit in the Name field, and then click Go.
le
c) Select TRUE from the Value drop-down list, and then click Apply.
c
r a
O
Oracle Database 11g: Administration Workshop I A - 47
Practice 7-2: Creating Roles
In this practice, you create the HRCLERK and HRMANAGER roles that will be used in the
next practice.
1) Create the role named HRCLERK with SELECT and UPDATE permissions on the
HR.EMPLOYEES table.
a) Click the Server tab and then click Roles in the Security section.
b) Click the Create button.
c) Enter HRCLERK in the Name field. This role is not authenticated.
d) Click Object Privileges tab.
e) Select Table from the Select Object Type drop-down list, and then click Add.
f) Enter HR.EMPLOYEES in the Select Table Objects field.
g) Move the SELECT and UPDATE privileges to the Selected Privileges box. Click
OK.
h) Click the Show SQL button, and review your underlying SQL statement.
m y
i) Click Return, and then click OK to create the role.
d e
c
2) Create the role named HRMANAGER with INSERT and DELETE permissions on thea
A
HR.EMPLOYEES table. Grant the HRCLERK role to the HRMANAGER role.
e
b) Click Create. c l
a) Click the Server tab, and then click Roles in the Security section.
r a
c) Enter HRMANAGER in the Name field. This role is not authenticated.
O ly
d) Click Object Privileges tab.
l & On
e) Select Table from the Select Object Type drop-down list, and then click Add.
n a e
f) Enter HR.EMPLOYEES in the Select Table Objects field.
e r s
g) Move the INSERT and DELETE privileges to the Selected Privileges box. Click
t U
OK.
I n
h) Click the Roles tab, and then click Edit List.
c le
i) Move the HRCLERK role into the Selected Roles box, and then click OK.
r a
j) Click the Show SQL button, and review your underlying SQL statement.
O
Oracle Database 11g: Administration Workshop I A - 48
Practice 7-2: Creating Roles (continued)
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 49
Practice 7-3: Creating and Configuring Users
In this practice, you create the following users and assign appropriate profiles and roles to
these users:
Name Username Description
David Hamby DHAMBY A new HR Clerk
Rachel Pandya RPANDYA A new HR Clerk
Jenny Goodman JGOODMAN A new HR Manager
A
3) Create an account for Jenny Goodman, the new HR manager. Repeat the steps under
e
of the HRCLERK role. c l
task 6 with JGOODMAN as the username and selecting the HRMANAGER role instead
r a
a) Click the Show SQL button and review your underlying SQL statement.
O ly
l & On
n a e
t e r U s
I n
b) Click Return, and then click OK to create the user.
c le
4) Test the new users in SQL*Plus. Connect to the orcl database as the DHAMBY user.
Use oracle as the new password. Select the row with EMPLOYEE_ID=197 from
r a
the HR.EMPLOYEES table. Then attempt to delete it. (You should get the
ERROR:
ORA-28001: the password has expired
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 –
Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
SQL>
SALARY
----------
m y
3000
d e
c) Now attempt to delete the same record from the hr.employees table.
c a
e A
SQL> DELETE FROM hr.employees WHERE EMPLOYEE_ID=197;
DELETE FROM hr.employees WHERE EMPLOYEE_ID=197
*
c l
a
ERROR at line 1:
r
ORA-01031: insufficient privileges
O ly
5) Repeat the test as the JGOODMAN user. After deleting the row, issue a rollback, so
& On
that you still have the original 107 rows.
l
a e
a) Connect to the orcl database as the JGOODMAN user.
n
ERROR:
t e r U s
SQL> connect jgoodman/newuser
I n
ORA-28001: the password has expired
<Change the password as shown above>
le
b) Select the row with EMPLOYEE_ID=197 from the HR.EMPLOYEES table.
c
r a
SQL> SELECT salary FROM hr.employees WHERE EMPLOYEE_ID=197;
O SALARY
----------
3000
1 row deleted.
d) Roll back the delete operation (because this was just a test).
SQL> rollback;
Rollback complete.
COUNT(*)
----------
107
SQL>
Question 2: When you created the new users, you did not select a default or
m y
e
temporary tablespace. What determines the tablespaces that the new users will use?
d
a
Answer: The system-defined default permanent and temporary tablespaces
c
A
Question 3: You did not grant the CREATE SESSION system privilege to any of the
e
l
new users, but they can all connect to the database. Why?
c
r a
Answer: Because Enterprise Manager automatically assigns the CONNECT role to the
new users, and CREATE SESSION is contained within that role
O ly
l & On
6) 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
a e
connection as RPANDYA.) Leave RPANDYA connected during the next lesson or at
n
t e r s
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
U
n
automatically logged out by trying to select from the HR.EMPLOYEES table again.
I
le
ERROR at line 1:
a c
ORA-02396: exceeded maximum idle time, please connect again
O r
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 53
Practice 8-1: Creating Tables
In this practice, you create the three required tables for the new inventory application.
You use three techniques to create these tables:
1. Create the PRODUCT_MASTER table by using Enterprise Manager.
2. Create the PRODUCT_ON_HAND table by correcting a script and running the
script in SQL* Plus.
3. Create the OBSOLETE_PRODUCTS table by using Enterprise Manager to create
this table based on a SELECT from the PRODUCT_MASTER table.
1) Return to the Enterprise Manager browser session, or invoke EM as the DBA1 user in
the SYSDBA role for your orcl database.
2) In the INVENTORY tablespace, create the PRODUCT_MASTER table in the
INVENTORY schema. The specifications of the table are:
Column Name Data Type Not Constraint
NULL
PRODUCT_ID NUMBER(7) Y This is the primary key
field. (Constraint name:
PK_INV)
PRODUCT_NAME VARCHAR2(50) Y
CODE VARCHAR2(10) Y
REORDER_THRESHOLD NUMBER(5) CHECK constraint ensuring
that the number is always
m y
d e
greater than zero (Constraint
name: CHK_REORDER)
COST
PRICE
NUMBER(5,2)
NUMBER(5,2)
c a
A
a) Select Schema > Database Objects > Tables.
e
b) Click Create.
c l
r a
c) Leave the default table type to be Standard (Heap Organized), and then click
Continue.
O ly
l & On
d) Enter PRODUCT_MASTER as table name and set Schema to INVENTORY, and
leave the Tablespace setting as the default for the user, which is INVENTORY.
n a e
t e r U s
I n
c le
e) Referring to the table above, enter the first five columns’ information (including
r a Data Type, Size, Scale, and Not NULL); do not add the primary key or check
constraints yet.
O
Oracle Database 11g: Administration Workshop I A - 54
Practice 8-1: Creating Tables (continued)
f) Click Add 5 Table Columns, and then enter the last column, PRICE, along with
its type and size. The results so far should look as follows:
Note: If you chose to set the PRODUCT_ID as Not NULL now (because as a
primary key you know it cannot be null) then you will see a check in the Not
NULL box for that column. If you did not set the Not NULL option for the
PRODUCT_ID now then the creation of the primary key constraint in a later step
will enforce the not null requirement for the primary key.
g) Click the Constraints tab.
h) Set the Constraints drop-down list value to PRIMARY, and then click Add.
i) Give the constraint a name by entering PK_INV in the Name field.
m y
e
j) Double-click PRODUCT_ID in the left list to move it to the right list, to make it
d
alone the primary key. Then click Continue.
c a
k) Set the constraint type drop-down list value to CHECK, and then click Add.
e A
l) Enter CHK_REORDER for the name of the check constraint.
c l
m) Enter “reorder_threshold > 0” (without the quotation marks) in the
Check Condition field.
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 55
Practice 8-1: Creating Tables (continued)
n) Leave the Attributes settings at their default settings, and then click Continue.
o) Your constraint list should now look like this:
p) Click OK to create the table. If you receive errors, correct them, and then click
OK again.
3) In the INVENTORY tablespace, create the PRODUCT_ON_HAND table in the
INVENTORY schema. You have been given the lab_08_01_03.sql script to
create the table, but there is a problem with it (intentionally created to enhance your
learning experience). Fix the problem, and run the script. If you cannot find the error
right away, run the original script in SQL*Plus to see the error message. This helps
you discover and solve the problem. The specifications of the table are:
Column Name Data Type Not Constraint
m y
WAREHOUSE_ID NUMBER(3)
NULL
Y
d e
This column along with the
c a
PRODUCT_ID make up the primary
key (Constraint name: PK_POH)
PRODUCT_ID NUMBER(7)
e A Y This column along with the
r a PK_POH)
n a e PRODUCT_MASTER table
(Constraint name:
t e r U s FK_PROD_ON_HAND_PROD_ID).
n
QUANTITY NUMBER(5)
WAREHOUSE_CITY
I VARCHAR2(30)
c le
LAST_UPDATE DATE
a) Edit the lab_08_01_03.sql in the /home/oracle/labs directory. It has
r a an error in it. If you can spot the error, make the change to correct it. Run the
c) Edit the file and correct the error. If you want, remove the prompt commands:
prompt There is an error in this statement. It will not
prompt run successfully unless fixed.
d) Run the script. The table should be created without error.
m y
4) In the INVENTORY tablespace, create the OBSOLETE_PRODUCTS table in the d e
c
INVENTORY schema. This table definition is very much like that of thea
e A
PRODUCT_MASTER table, so you can use Enterprise Manager’s ability to “Define
Using SQL” rather than using “Column Specification.” The specifications of the table
are:
c l
Column Name
r a
Data Type Not
NULL
Constraint
PRODUCT_ID O ly
NUMBER(7) Y This is the primary key
PRICE
I n NUMBER(5,2)
c le
a) In Enterprise Manager, select Schema > Database Objects > Tables.
r a
b) Click Create.
O c) Leave the default setting for Table Organization, and then click Continue.
d) Enter OBSOLETE_PRODUCTS for Name.
m y
i) Click OK to create the table.
d e
c a
j) Take a look at the newly created OBSOLETE_PRODUCTS table to see if any
constraints were created automatically. Select the OBSOLETE_PRODUCTS table
A
from the list on the Tables page and click View.
e
c l
k) Scroll down and see in the list of constraints that there are Not NULL constraints
r a
for the PRODUCT_NAME and CODE columns. When you created the table based
on a SELECT from another table, the columns in the new table inherit the data
O ly
type and Not NULL characteristics of the table involved in the SELECT. Any
& On
other constraints do not get copied to the new table.
l
n a e
l) The table specification states that there should be a primary key constraint on the
PRODUCT_ID column. Create this constraint now.
t e r U s
i) Scroll up and click the Edit button.
I n
ii) Click the Constraints tab.
le
iii) Set the Constraints drop-down list value to PRIMARY, and then click Add.
c
r a iv) Give the constraint a name by entering PK_OBS in the Name field.
v) Double-click PRODUCT_ID in the left list to move it to the right list, to make
O it alone the primary key. Then click Continue.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 59
Practice 8-2: Creating Indexes
In this practice, you create indexes on the new inventory tables. One of the indexes you
create is to speed up the response time of a specific query. After creating this index, you
test to see whether the query response has improved.
1) In the INVENTORY tablespace, create an index called OBS_CODE on the CODE
column of the OBSOLETE_PRODUCTS table in the INVENTORY schema. Choose an
appropriate index type either B-tree or Bitmap. Explain the reason for your choice.
a) Question: Which type of index is appropriate, and why?
Answer: B-tree, because the CODE column can contain many different values, not
just a small, finite set.
b) Select Schema > Database Objects > Indexes, and the click Create.
c) Enter OBS_CODE as Name.
d) Enter INVENTORY as Schema.
e) Enter INVENTORY.OBSOLETE_PRODUCTS as Table Name.
f) Click Populate Columns. The column names have been filled into the table. If
your browser prompts you to remember entered values, click No.
g) Enter an ORDER value of 1 for the CODE column.
h) Click Show SQL, confirm the SQL statement looks like the statement below, and
then click Return. m y
d e
c a
e A
i) Click OK to create the index.
c l
r a
2) In the INVENTORY tablespace, create an index called PROD_NAME_CODE on the
O ly
combined PRODUCT_NAME and CODE columns of the PRODUCT_MASTER table.
l & On
Use the lab_08_02_02.sql script (which contains an error, intentionally created
to enhance your learning experience). Correct the error and run the script. If you
a e
cannot find the error right away, run the original script in SQL*Plus to see the error
n
t e r U s
message. This will help you discover and solve the problem.
a) Edit lab_08_02_02.sql in the /home/oracle/labs directory. It has an
I n
error in it. If you can spot the error, make the change to correct it. If you cannot
le
see the error, run the script as the dba1 user.
a cSQL> @lab_08_02_02.sql
The error in the script is that it should not have the word COMPOSITE. Delete the
word and save your changes in the script. The corrected statement is:
SQL> create index inventory.prod_name_code
2 on inventory.product_master(product_name,code)
e
l
2> inventory.product_on_hand(product_id, quantity);
c
4) You receive a notice from developers that there is a certain type of query that will be
a
r
run very frequently, and they want to be sure that it runs in less than one second. You
O ly
need to run the query and see how it performs. First, run the
lab_08_02_04_a.sql script to generate some test data of the volume indicated
& On
in the request. Then run the query in the lab_08_02_04_b.sql script several
l
n a e
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_FUNC column that will improve the
e r
performance of this query.
t U s
I n
a) Open a terminal window and enter the following at the command prompt to
populate the table with test data. This will take three to five minutes to run.
c le
$ cd /home/oracle/labs
b) Enter the following on the command line to run the test query.
O SQL> @lab_08_02_04_b.sql
m y
n) Click Return.
d e
o) Click OK.
c a
p) Return to the SQL*Plus command line and run the benchmark query script
A
(lab_08_02_04_b.sql) a few more times. Note that the execution time is
e
greatly reduced.
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 62
Practice 8-3: Modifying Tables
In this practice, you respond to update requests for modifications to the new tables you
created for the new inventory application. The modifications involve the addition of new
columns to one of the existing tables as well as the deletion of a table.
1) 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?
a) Select Schema > Database Objects > Tables.
b) Enter INVENTORY in the Schema field, and then click Go.
c) Select the PRODUCT_MASTER table, and then click Edit.
d) Enter PRIMARY_SOURCE in the Name field under PRICE, and set Data Type to
VARCHAR2, and Size to 50.
e) Enter SECONDARY_SOURCE in the next available Name field, and set Data
Type to VARCHAR2, and Size to 50.
f) Click Show SQL.
m y
d e
g) Click Return, and then click Apply.
c a
e A
2) You receive another update for the inventory application. This change request
instructs you to drop the OBSOLETE_PRODUCTS table and add the OBSOLETED
c l
column to the PRODUCT_MASTER table, with data type DATE. Do this using EM.
r a
a) Select Schema > Database Objects > Tables.
O ly
b) Enter INVENTORY in the Schema field, and then click Go.
& On
c) Select the OBSOLETE_PRODUCTS table, and then click Delete With Options.
l
a e
d) Ensure that the “Delete the table definition, all its data, and dependent objects
n
t e r U s
(DROP)” option is selected. Click Show SQL to see the DROP command.
I n
c le
e) Click Return, and then click Yes.
r a
f) Select the PRODUCT_MASTER table, and then click Edit.
O g) In the first empty Name field, enter OBSOLETED, and set Data Type to DATE.
h) Click Apply.
You will have to join two tables together to create this view.
a) Select Schema > Database Objects > Views.
b) Click Create.
c) Enter WAREHOUSE_VW in the Name field, and INVENTORY in the Schema field.
d) Enter the following in the Query Text field:
select product_name, quantity, warehouse_city
from product_master pm, product_on_hand poh
where pm.product_id = poh.product_id
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
le
e) Click OK.
c
r a
O
Oracle Database 11g: Administration Workshop I A - 64
Practice 8-5: Viewing Schema Object Information
In this practice, you query the data dictionary to answer questions about the schema
objects for the INVENTORY user.
1) Use SQL*Plus to identify the data dictionary view name that you would use to list all
constraints that the INVENTORY user can see.
a) From a terminal window, log in to SQL*Plus as inventory as Username and
verysecure as the Password.
b) You are looking for things that the INVENTORY user has access to. So you must
use a view with the ALL_ prefix. You can assume that the name of the view that
shows constraint information begins with “ALL_CON.” Enter the following query:
$ sqlplus inventory
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
m y
Production
With the Partitioning, OLAP, Data Mining and Real
d e
Application Testing options
c a
SQL> column comments format a15 wrap
SQL> SELECT * FROM dictionary
e A
WHERE table_name like ‘ALL_CON%’
ORDER BY table_name;
c l
r a
TABLE_NAME
O ly COMMENTS
ALL_CONSTRAINTS
l & On
------------------------------ ---------------
Constraint defi
n a e nitions on acce
ssible tables
t e
ALL_CONS_COLUMNS r U s Information abo
I n ut accessible c
olumns in const
c le raint definitio
ns
O …
c) Review the returned rows. One of them has the COMMENTS value “Constraints
definitions on accessible tables.” The object name is ALL_CONSTRAINTS.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 66
Practices for Lesson 9
Background: The Help desk just received a call from Susan Mavris, an HR
representative, complaining that the database is “frozen.” Upon questioning the user, you
find that she was trying to update John Chen’s personnel record with his new phone
number, but when she entered the new data, her session froze and she could not do
anything else. SQL script files are provided for you in the /home/oracle/labs
directory.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 67
Practice 9-1: Resolving Lock Conflicts
In this practice, you use two separate SQL*Plus sessions to cause a lock conflict. Using
Enterprise Manager, you detect the cause of the lock conflict and then resolve the
conflict. For your convenience, the SQL code that will cause the lock conflict has been
provided in scripts that you run during this practice.
1) Make an uncommitted update to the row in question by running the
lab_09_01.sql script. This script first creates the users (smavris and
ngreenberg) that are involved in this practice and the hremployee role that will
give these new users access to the hr.employee table. It then logs in to SQL*Plus
as the ngreenberg user and performs an update on the hr.employee table. The
script does not perform a commit, leaving the update uncommitted in this session.
a) Enter the following to run the script. When the script completes executing, you
will see a note stating that an uncommitted update has been made.
$ sqlplus dba1/oracle @lab_09_01.sql
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
m y
Production
With the Partitioning, OLAP, Data Mining and Real
d e
Application Testing options
c a
Creating users...
e A
l
... … Some output not shown here to conserve space …
c
Connecting as ngreenberg ...
Connected. r a
SQL> show user
O ly
USER is "NGREENBERG"
l & On
SQL> update hr.employees set phone_number='650.555.1212'
a e
where employee_id = 110 ;
n
1 row updated.
t e r U s
I n
SQL> prompt User "ngreenberg" made an update and left it
uncommitted in this ses sion.
c le
User "ngreenberg" made an update and left it uncommitted in
this session.
r aSQL>
SQL>
O SQL>
b) Leave this session connected in the state that it is currently. Do not exit at this
time.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
With the Partitioning, OLAP, Data Mining and Real
Application Testing options
e A
c l
b) Notice that this session appears to be hung. Leave this session as is and move on
to the next step.
r a
O ly
3) Using Enterprise Manager, click the Blocking Sessions link on the Performance page
& On
and detect which session is causing the locking conflict.
l
a e
a) In Enterprise Manager, click the Performance page.
n
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 69
Practice 9-1: Resolving Lock Conflicts (continued)
b) Click Blocking Sessions in the Additional Monitoring Links area. You should
see the following:
4) What was the last SQL statement that the blocking session executed?
a) Select the NGREENBERG session, and then click View Session.
b) Click the hash value link named “Previous SQL.”
m y
d e
c a
e A
c l
r a
O ly
l & On
c) Note the SQL that was most recently run.
n a e
t e r U s
I n
c le
5) Resolve the conflict in favor of the user who complained, by killing the blocking
r a
session. What SQL statement resolves the conflict?
d) Click Return, and then click Yes to carry out the KILL SESSION command.
6) Return to the SQL*Plus command window, and note that SMAVRIS’s update has
now completed successfully. It may take a few seconds for the success message to
appear.
USER is "SMAVRIS"
Update is being attempted now.
1 row updated.
Update is completed.
SQL>
7) Try issuing a SQL select statement in the NGREENBERG session. What do you see?
SQL> SELECT sysdate from dual;
m y
SELECT sysdate from dual
*
d e
ERROR at line 1:
ORA-03135: connection lost contact
c a
Process ID: 8033
Session ID: 124 Serial number: 46946
e A
c l
SQL>
r a
O ly
Answer: The session has been disconnected.
& On
Close all open SQL sessions by entering exit, and then close the terminal windows.
l
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 71
Practices for Lesson 10
Background: The business users and management in your organization decide, that they
need to have a 48-hour retention of undo in the Oracle database to support their flashback
needs. Your task is to configure the orcl database to support this requirement.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 72
Practice 10-1: Managing Undo Data
In this practice, you first view your system activity regarding undo, and then you
configure the orcl database to support 48-hour retention for flashback operations.
1) In Enterprise Manager, as the DBA1 user, view the undo related system activity.
a) Click the Server tabbed page and select “Automatic Undo Management” in the
Database Configuration section.
b) Click the System Activity tabbed page.
m y
d e
Note: Your information will look different on all analysis screenshots, based on your
c
analysis period and the system activity during this period. a
encounter?
e A
c) Question: Looking at the preceding screenshot, how many errors did this system
Answer: None
c l
r a
d) Question: Looking at the preceding screenshot, what is the duration of the longest
running query?
O ly
& On
Answer: 28 minutes (Your answer may be different.)
l
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 73
Practice 10-1: Managing Undo Data (continued)
e) Click the Plus icon to show related graphs.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 74
Practice 10-1: Managing Undo Data (continued)
f) Question: How many graphs are displayed?
Answer: Yes, (but most likely not enough to support the required 48 hours).
2) Modify the undo retention time and calculate the undo tablespace size to support the
requested 48-hour retention.
a) Click the General tab to go back to the General Automatic Undo Management
page.
b) Under the Undo Advisor section, select “Specified manually to allow for longer
duration queries or flashback.”
c) Enter 48 hours as Duration and click the Run Analysis button.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 75
Practice 10-1: Managing Undo Data (continued)
d) When the Undo Advisor is finished, take a look at the results.
m y
d e
It looks like the undo tablespace is very close to the recommended undo
tablespace size. This is okay for most workloads, but the recommendation is to set
c a
your undo tablespace size to be three times the minimum size. This means that
A
you should change your undo tablespace size to be 846 MB.
Note: Your recommended size might be different from what is shown here, so
e
adjust the size accordingly.
c l
Undo Management page. r a
e) Click the Show SQL button in the upper-right corner of the General Automatic
O ly
l & On
n a e
f) This command will change the undo retention to support the 48-hour requirement.
t e r U s
Review the SQL statement and click Return.
I n
g) Click Apply to make the change to undo retention.
h) Now adjust the undo tablespace size by clicking the Edit Undo Tablespace button.
c le
i) Scroll down to Datafiles and click Edit to make a change to the
Click Return.
l) Click Apply to change the tablespace size.
3) Go back to the Automatic Undo Management to see the results of the changes you
just made. You see that the undo retention time has increased to support the 48 hours
requirement. Your undo tablespace size has also increased based on the changes you
made to the size of the datafile for the undo tablespace.
m y
e
a) Question: Which Flashback operations are potentially affected by this change?
d
c
b) Question: Do undo data survive the shutdown of a database?
a
Answer: Flashback query, Flashback transaction, and Flashback table.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 78
Practice 11-1: Configuring Database Auditing
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) Invoke Enterprise Manager as the DBA1 user in the SYSDBA role for your orcl
database.
b) Click the Server tab, and then click Audit Settings in the Security section.
c) Click the value of Audit Trail, the DB link.
d) On the Initialization Parameters page, click the SPFile tab.
e) Enter audit in the Name field and then click Go.
f) For the audit_trail parameter, select the XML value.
g) Click Show SQL.
e A
$ cd /home/oracle/labs
$ ./lab_11_02.sh
c l
r a
b) Continue with the next step when you see that the database is restarted and the
script has exited SQL*Plus.
O ly
l & On
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 e
Because the database has been restarted, you have to log in to Enterprise Manager
n
t e r
again as the DBA user.
U s
a) Click logout in the upper-right corner of the Enterprise Manager window.
I n
b) Log in as the DBA1 user in the SYSDBA role for your orcl database.
le
c) Click the Database home page tab to ensure that Enterprise Manager had time to
c
r a update the status of the database and its agent connections.
d) Click the Server tab, and then click Audit Settings in the Security section.
O e) Click the Audited Objects tab at the bottom of the page, and then click the Add
button.
U s
I n
Answer: No, the standard audit records only show which user accessed the table.
le
d) Click Return.
c
r a
6) Undo your audit settings for HR.JOBS, disable database auditing, and then restart the
database by using the lab_11_06.sh script.
O a) On the Audit Settings page, click the Audited Objects tab at the bottom of the
page.
e) Review the statements, and then click Yes to confirm your removal.
f) On the Audit Settings page, click XML in the Configuration region.
g) On the Initialization Parameters page, click the SPFile tab.
h) On the SPFile page, enter audit in the Name field, and then click Go.
i) For the audit_trail parameter, select the DB value.
j) Click Show SQL.
m y
d e
c
k) Review the statement, and then click Return. a
A
l) On the Initialization Parameters page, click Apply.
e
l
m) Because you changed a static parameter, you must restart the database. Do so by
c
a
running the lab_11_06.sh script. In a terminal window, enter:
r
$ cd /home/oracle/labs
$ ./lab_11_06.sh O ly
l & On
7) Maintain your audit trail: Because you are completely finished with this task, backup
a e
and delete all audit files from the /u01/app/oracle/admin/orcl/adump
n
directory.
t e r U s
a) In a terminal window, enter:
I n
$ cd /u01/app/oracle/admin/orcl/adump
le
$ ls
c
b) Create a backup of the audit trail files, and then remove the files
a
O r $ tar –czf $HOME/audit_today.tar.z *
$ rm –f *
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 82
Practice 12-1: Database Maintenance
1) Create a new, locally managed tablespace called TBSSPC. It has a spc1.dbf data
file of 50 MB. Ensure that the TBSSPC tablespace does not use Automatic Segment
Space Management (ASSM). Execute the lab_12_01.sh script to perform these
tasks.
In a terminal window, enter:
$ cd /home/oracle/labs
$ cat lab_12_01.sh
…
sqlplus / as sysdba << END
set echo on
exit;
END
m y
$ ./lab_12_01.sh
d e
c a
2) Create a new SPCT user, identified by spct. Assign the TBSSPC tablespace as the
e A
default tablespace. Assign the TEMP tablespace as the temporary tablespace. Grant
the following roles to the SPCT users: CONNECT, RESOURCE, and DBA. Execute the
c l
lab_12_02.sh script to perform these tasks.
In a terminal window, enter:
r a
$ cat lab_12_02.sh
… O ly
l
sqlplus / as sysdba << END
& On
set echo on
n a e
t e r
drop user spct cascade;
U s
I n
create user spct identified by spct
le
default tablespace TBSSPC
c
temporary tablespace temp;
a
O r grant connect, resource, dba to spct;
exit;
END
3) Use the DBMS_ADVISOR package to set the database activity time to 30 minutes. As
the SPCT user, drop and create the SPCT table and gather statistics for this table.
Create a snapshot in Automatic Workload Repository (AWR). Execute the
lab_12_03.sh script to perform these tasks.
In a terminal window, enter:
$ cat lab_12_03.sh
…
sqlplus / as sysdba << EOF
set echo on
exec
dbms_advisor.set_default_task_parameter('ADDM','DB_ACTIVITY_MI
N',30);
connect spct/spct
exec DBMS_STATS.GATHER_TABLE_STATS(-
ownname=>'SPCT', tabname=>'SPCT',-
m y
estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE);
d e
exec DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT();
c a
exit;
EOF
e A
$ ./lab_12_03.sh
c l
r a
4) Create the activity to be analyzed. Execute the lab_12_04.sh script to perform
these tasks.
O ly
l & On
In a terminal window, enter the following. You may have to press [Enter] after you
see that several PL/SQL procedures have completed, in order to see the command
prompt again.
n a e
$ ./lab_12_04.sh
t e r U s
I n
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,
c le
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
r a
suffering from concurrency problems.
O a) Invoke Enterprise Manager as the SYS user in the SYSDBA role for your orcl
database.
Note: Depending on when you run the workload, you may see differences
between your graph and the one provided as a possible solution.
c) After the spike is finished, execute the lab_12_05.sh script. This script forces
the creation of a new snapshot and gathers statistics on your SPCT table.
Note: Causing the same performance problem in all environments is not easy. To
y
help make your test more successful, wait an extra minute or so after the spike has
m
completely finished before running the script.
After the spike has finished, in a terminal window, enter:
d e
c a
$ ./lab_12_05.sh
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 85
Practice 12-1: Database Maintenance (continued)
6) Look at the Performance Analysis findings in order of their impact. There are
several access paths to this information. The results should look similar to the
following:
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
m
first impulse is to look at this finding in more detail. However, looking at this SQLy
database.
d e
statement does not yet help you to understand the concurrency problem of your
c a
Investigate the other findings in order of severity. Look at the Buffer Busy findings in
A
particular. For one of the Buffer Busy results, you should see that there is read-and-
write contention on your SPCT table. The recommended action is to use the
e
l
Automatic Segment Space Management (ASSM) feature for your SPCT table. The
c
r a
following steps guide you through this exercise.
a) Navigate to the Database home page, and then click Advisor Central at the
bottom of the page. O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 86
Practice 12-1: Database Maintenance (continued)
b) Your ADDM task should already be displayed. If not, search for it and display it
on this page.
m y
name of the task).
d e
c) Select the task, and then click the View Result button (alternatively, click the
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 87
Practice 12-1: Database Maintenance (continued)
d) The ADDM page appears, showing the detailed results from the ADDM run.
Note: Do not click the Run ADDM Now button because you already executed the
ADDM performance analysis when you ran the lab_12_05.sh script. Clicking
the button now would produce an empty set of findings.
m y
d e
Looking at the Performance Analysis section, you see that the first finding has a
c a
100% impact on the system. You also notice that there are Buffer Findings as
well. Because the Top SQL by DB Time finding is impacting your system by
A
100%, your first impulse is to look at this finding in more detail.
e
c l
Note: Because there are several factors that can affect performance on your
classroom machine, your results may not be exactly as shown. The findings may
r a
appear in a different order. If you do not see at least the three results outlined in
the preceding screenshot, you may need to restart this practice. If you still do not
O ly
see the expected results, you may need to adjust the load by modifying the
l & On
lab_12_04.sh and lab_12_04.sql scripts. Ask your instructor for
assistance if this is the case. Take care not to increase the load too much or you
n a e
will slow your system down too much.
e r s
e) Click the “Top SQL by DB Time” link in the Finding column.
t U
I n
f) Review the recommendations on the Performance Finding Details page. However,
looking at this SQL statement does not yet help you to understand the
le
concurrency problem of your database. Click the Back icon in your Web browser.
c
r a
O
Oracle Database 11g: Administration Workshop I A - 88
Practice 12-1: Database Maintenance (continued)
g) Look at the Buffer Busy findings on the “Automatic Database Diagnostic Monitor
(ADDM)” page. Click the first occurrence of the Buffer Busy finding.
m y
d e
The findings show that there is read-and-write contention on database blocks. The
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 89
Practice 12-1: Database Maintenance (continued)
h) Go back to the ADDM page and look at the next Buffer Busy finding.
m y
d e
This finding shows that there is a hot data block that belongs to the SPCT.SPCT
a
table. The recommendation is to investigate the application logic to find the cause.
c
e A
7) You decide to implement the recommendation to use Automated Segment Space
Management. To do this, you must re-create the object. Create a new, locally
c l
managed tablespace, called TBSSPC2 with a 50 MB data file called spc2.dbf.
r a
Ensure that the TBSSPC2 tablespace uses the Automatic Segment Space
Management feature. Then execute the lab_12_07.sh script to drop the SPCT
O ly
table, to re-create it in the new tablespace, to gather statistics, and to take a new
snapshot.
l & On
section.
n a e
a) In Enterprise Manager, click the Server tab, and then Tablespaces in the Storage
b) Click Create.
t e r U s
I n
c) Enter TBSSPC2 as the tablespace name, and verify that Extent Management is
Locally Managed, Type is Permanent, Status is Read Write, and Use bigfile
le
tablespace is not selected.
c
r a
d) Click Add in the Datafiles region.
O e) On the Add Datafile page, enter spc2.dbf for File Name, and 50 MB as File
Size.
f) Click Continue.
d e
After the spike is finished, execute the lab_12_05.sh script again. This script
forces the creation of a new snapshot and gathers statistics on your ADDM table.
c a
a) Invoke Enterprise Manager as the sys user in the SYSDBA role for your orcl
database.
e A
chart to complete.
c l
b) Click the Performance tabbed page. Watch for the spike in the Active Sessions
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 91
Practice 12-1: Database Maintenance (continued)
c) After the spike is finished, run the lab_12_05.sh script to force the creation of
a new snapshot and gather statistics on your SPCT table. Enter the following in a
terminal window:
$ ./lab_12_05.sh
m y
d e
c a
e A
c l
11) To not affect other practice sessions, execute the lab_12_11.sh script to clean up
your environment.
In a terminal window, enter: r a
O ly
& On
$ ./lab_12_11.sh
l
a e
r n s
nt e U
I
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 92
Practices for Lesson 13
Background: Users are complaining about slower-than-normal performance for
operations involving the human resources and order-entry applications. When you
question other members of the DBA staff, you find that maintenance was recently
performed on some of the tables belonging to the HR schema. You need to troubleshoot
and make changes as appropriate to resolve the performance problems. SQL script files
are provided for you in the /home/oracle/labs directory. Other directories are
individually named.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 93
Practice 13-1: Managing Performance
1) Log in to SQL*Plus as the SYS user and perform maintenance on tables in the HR
schema by running the lab_13_01.sql script.
$ cd labs
$ sqlplus / as sysdba
SQL> @lab_13_01.sql
2) You get calls from HR application users saying that a particular query is taking longer
than normal to execute. The query is in the lab_13_02.sql script. To run this file,
enter the following in SQL*Plus:
SQL> CONNECT hr/hr
SQL> @lab_13_02.sql
3) Using Enterprise Manager, locate the HR session in which the above statement was
just executed, and view the execution plan for that statement.
a) In Enterprise Manager, click the Performance tab, and the click Search Sessions
in the Additional Monitoring Links section.
b) On the Search Sessions page, change the Search criteria to “DB User,” enter HR
in the field to the right of that, and then click Go.
c) Click the SID number in the Results listing.
m y
d) You now see the Session Details page for this session. Click the hash value link to
the right of the Previous SQL label in the Application section.
d e
e) On the SQL Details page, you see the details for the last SQL statement executed
c a
by that session, which is the one in question. Click the Plan tab to see the
execution plan for the query.
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 94
Practice 13-1: Managing Performance (continued)
f) You see in the Operation column that this query is doing a full table scan
(TABLE ACCESS FULL). Because you know that the query’s condition is an
equality comparison on the primary key (EMPLOYEE_ID), you decide to
investigate the status of the primary key index.
4) Using Enterprise Manager, check to see the status of the EMPLOYEE table’s index on
EMPLOYEE_ID. See if it is VALID.
a) From the Database Home page, click the Schema tab, and then Indexes.
b) Select Table Name as the Search By value.
c) Enter HR in the Schema field.
d) Enter employees for Object Name.
e) Click Go, and the list of six indexes appears.
f) Click the index named EMP_EMP_ID_PK.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 95
Practice 13-1: Managing Performance (continued)
g) On the View Index page, notice 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’;
INDEX_NAME
---------------------
TABLE_NAME
------------------------
STATUS
--------
m y
EMP_EMAIL_UK
EMP_EMP_ID_PK
EMPLOYEES
EMPLOYEES
d e
UNUSABLE
UNUSABLE
EMP_DEPARTMENT_IX
EMP_JOB_IX
EMPLOYEES
c
EMPLOYEES a
UNUSABLE
UNUSABLE
EMP_MANAGER_IX
A
EMPLOYEES
e
UNUSABLE
l
EMP_NAME_IX EMPLOYEES UNUSABLE
6 rows selected.
a c
SQL> r
O ly
l & On
b) You notice that the output lists six indexes, all on the EMPLOYEES table. This is a
problem you will need to fix.
n a e
6) You decide to use Enterprise Manager to reorganize all the indexes in the HR schema
e r
that are marked as UNUSABLE.
t U s
I n
a) In Enterprise Manager, on the page displaying the EMP_EMP_ID_PK index,
select Reorganize in the Actions list, and then click Go.
le
b) On the Reorganize Objects pages, click Add, to add each of the other five indexes
c
r a to the reorganization operation.
c) In the Add screen, choose Indexes for the Type drop-down list, and enter hr in
O the Schema field. Click Search.
m y
d e
c a
e A
c l
e) Click OK to go back to the Reorganize Objects: Objects page.
r a
f) Verify that all six indexes for the EMPLOYEES table are listed and click Next.
O ly
g) Keep all the default settings for Options, and then click Next. The reorganize
& On
script generation occurs, and then the Impact Report appears.
l
a e
h) Note that there are no problems reported on Impact Report, and then click Next.
n
t e r U
under Host Credentials. s
i) On the Schedule page, enter oracle and oracle for Username and Password
I
j) Click Next. n
le
k) On the Review page, click Submit Job.
c
r a
O
Oracle Database 11g: Administration Workshop I A - 97
Practice 13-1: Managing Performance (continued)
l) After the Confirmation page appears, click the View job Details to see the job
status.
m) Click Reload on your browser until you see the job has succeeded.
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
changed.
m y
see the plan of the last SQL statement executed by this session, to see if the plan has
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 / as sysdba
SQL> @lab_13_09.sql
10) Go back to Enterprise Manager and take a look at the performance of your database.
a) In Enterprise Manager, navigate to the Performance page, and investigate system
performance.
b) You may need to wait a minute or two to see the effects of the load generation
script appear on the graphs.
m y
d e
c a
e A
c l Wait to see the beginning of a
spike in the Average Active
r a Sessions graph before
O ly proceeding.
l & On
n a e
t e r
Question 1: In the Average Active Sessions graph, which are the two main
s
categories that active sessions are waiting for?
U
I n
Answer: System I/O and CPU Used
le
Question 2: In the Configuration category of waits, what is one of the contributors to
c
r a
the wait time? Click Configuration to see the graph.
O
Oracle Database 11g: Administration Workshop I A - 99
Practice 13-1: Managing Performance (continued)
Answer: Any one of these:
Question 3: Click Back, and then click Settings on the Performance page. For the
Detail Chart Settings select I/O for Default Veiw, and I/O Function for I/O Chart
Settings, and then click OK. Determine which process is doing the most writing to
the disk.
Answer: LGWR
c) Click Back.
d) Click Top Activity in the Additional Monitoring Links region. m y
d
e) Click the SQL ID of the first SQL statement listed in the Top SQL region.e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
f) See the first SQL statement.
11) Kill the session that is generating the load. Use the session ID recorded in step 9. The
r a
session ID is listed in the SID column of the Detail for Selected 5 Minute Interval.
O
Oracle Database 11g: Administration Workshop I A - 100
Practice 13-1: Managing Performance (continued)
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 a warning, “WARNING, Session has expired.”
This warning 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 activity in the database has declined considerably.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 101
Practices for Lesson 14
Background: Your orcl database is ready to move from test or development into
production.
Configure your database to reduce the chances of failure or data loss. To do so, perform
the following tasks:
• Ensure redundancy of control files and backup the control file to trace
• Review the flash recovery area configuration
• Ensure that there are at least two redo log members in each group
• Place your database in ARCHIVELOG mode
• Configure redundant archive log destinations
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 102
Practice 14-1: Configuring Your Database for Recovery
In this practice, you configure your database to reduce the chances of failure or data loss.
Note: Completing this practice is a prerequisite for all following backup and recovery
practices.
1) Verify that you have at least two control files to ensure redundancy and backup the
control file to trace.
a) Invoke Enterprise Manager as the DBA1 user in the SYSDBA role for your orcl
database.
b) Click Server > Control Files (in the Storage section).
m y
d e
Question 1: On the Control Files: General page, how many control files do you
have?
c
Answer: Three (in the preceding example).
a
e A
Question 2: How would you add another control file if you needed to?
c l
Answer: Adding a control file is a manual operation. To perform this, you must:
• Shut down the database
r a
• Use the operating system to copy an existing control file to the location where
O ly
you want your new file to be.
l & On
• Start the database by using Enterprise Manager. Unlike a normal startup, you
would use Advanced Options to select a different startup mode. Select “Start
n a e
the instance” to leave the instance in the NOMOUNT state.
t
control file.e r U s
• Edit the CONTROL_FILES initialization parameter to point to the new
I n
• Continue the STARTUP database operation until the database is in an open
state.
c le
Note
r a • This answer does not apply to an OMF database because the control files in
O •
that case would have to all be re-created.
Alternatively, if you did not want to use Enterprise Manager to perform the
steps, you could perform the steps outlined in the Multiplexing Control Files
slide in the “Backup and Recover Concepts” lesson.
e) Optionally, use a terminal window, logged in as the oracle user to view the
trace file name at the end of the alert log by executing the following command:
cd /u01/app/oracle/diag/rdbms/orcl/orcl/trace
tail alert_orcl.log
The following output shows only the last few lines:
$ cd /u01/app/oracle/diag/rdbms/orcl/orcl/trace
$ tail alert_orcl.log
Fri Aug 29 12:00:31 2008
Thread 1 advanced to log sequence 301
Current log# 8 seq# 301 mem# 0:
/u01/app/oracle/oradata/orcl/redo8.log
Fri Aug 29 12:02:53 2008
m y
ALTER DATABASE BACKUP CONTROLFILE TO TRACE
Backup controlfile written to trace file
d e
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_16330.trc
c
Completed: ALTER DATABASE BACKUP CONTROLFILE TO TRACE a
$
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 104
Practice 14-1: Configuring Your Database for Recovery
(continued)
f) Optionally, to view size and usage of the different sections within the control file,
click the Record Section tabbed page.
Your numbers could look different. For additional information, click Help in the
upper-right corner of the page.
m y
2) Review the flash recovery area configuration and change the size to 8 GB.
d e
a) In Enterprise Manager, select Availability > Recovery Settings in the Setup
section.
c a
b) Scroll to the bottom of the page.
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 105
Practice 14-1: Configuring Your Database for Recovery
(continued)
c) Question: Is the flash recovery area enabled?
Answer: Yes, by default.
d) Note the location of the flash recovery area.
For example: /u01/app/oracle/flash_recovery_area
e) Question: Which essential DBA tasks can you perform in this section?
Answer: You can change the location, size or retention time for the flash recovery
area, as well as enable the Flashback Database functionality.
f) Question: Does changing the size of the flash recovery area require the database
to be restarted?
Answer: No, a restart is not required for this change.
g) Change the size of the Flash Recovery Area to 8 GB, by entering 8 into the
“Flash Recovery Area Size” field.
h) Optionally, click Show SQL, review the statement and click Return.
i) Click Apply.
m y
d e
3) Check how many members each redo log group has. Ensure that there are at least two
redo log members in each group. One set of members should be stored in the flash
recovery area.
c a
Members” column.
e A
a) Click Server > Redo Log Groups, and note how many members are in the “# of
c l
Answer: There is only one member in each group.
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 106
Practice 14-1: Configuring Your Database for Recovery
(continued)
b) To add a member to each group, perform the following steps for each group:
i) Select the group (for example, 1) and click the Edit button.
ii) On the Edit Redo Log Group page, note the File Name, for example
“redo01.log” and click the Add button.
iii) On the Edit Redo Log Group: Add Redo Log Member page, enter a file name
by adding the letter “b” to the end of the name (before the dot). For example,
enter redo01b.log as File Name and enter your flash recovery area, for
example, /u01/app/oracle/flash_recovery_area/ as File
Directory.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
vi) Optionally, click Show SQL to review the command, and then Return.
I n
c le
r a vii) Click Apply.
O viii) You should receive a success message. Return to the Redo Log Groups page
and repeat the preceding sequence of steps (under 3 b) for each of the
remaining redo log groups.
Note: In a production database, you want to ensure that the two members are on
different hard drives, preferably with different disk controllers, to minimize the
risk of any single hardware failure destroying an entire log group.
4) You notice that, for each log group, the Archived column has a value of No. This
m y
d e
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 are archived.
c
Note: You must continue with step 5, so that your changes are applied.
a
e A
a) In Enterprise Manager, select Availability > Recovery Settings in the Setup
section.
c l
r a
b) In the Media Recovery region, select the ARCHIVELOG Mode check box.
O ly
c) Verify that Log Archive Filename Format contains %t, %s, and %r.
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 108
Practice 14-1: Configuring Your Database for Recovery
(continued)
d) Notice the current configuration of redundant archive log destinations—one to the
flash recovery area and the other to
/u01/app/oracle/product/11.1.0/db_1/dbs/arch. The database
is preconfigured to save archived logs to the flash recovery area (Archive Log
Destination 10), as well as to a redundant location (Archive Log Destination 1).
Note: If you add archive log destinations, you must create the directory, if it does
not already exist.
e) Click Apply.
f) When prompted whether you want to restart the database now, click Yes.
g) Enter the credentials to restart the database (oracle as the Host Credentials, and
sys/oracle as SYSDBA as Database Credentials), and then click OK.
h) When asked to confirm, click Yes again.
i) Should you receive an error during the shutdown and startup activity, click OK to
acknowledge the error, and then click Refresh again. (You might have been
simply faster than the database.)
5) Optionally, use SQL*Plus to check whether your database is in ARCHIVELOG mode.
In a terminal window, log in to SQL*Plus as SYSDBA and run the archive log
list command.
$ sqlplus / as sysdba
m y
d e
SQL*Plus: Release 11.1.0.6.0 - Production on Fri Aug 29
17:36:22 2008
c a
Copyright (c) 1982, 2007, Oracle.
c l
Connected to:
r a
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
O ly
Testing options
l & On
With the Partitioning, OLAP, Data Mining and Real Application
t
Automatic archival
e r U s Archive Mode
Enabled
I n
Archive destination
Oldest online log sequence
USE_DB_RECOVERY_FILE_DEST
299
c le
Next log sequence to archive
Current log sequence
301
301
r a
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 110
Practices for Lesson 15
Background: Your database is ready to move from development and testing into
production. Ensure that your database is configured so that recovery is possible without
loss of data. Establish the backup policy to automatically back up the SPFILE and
control file. Perform an immediate backup to disk and schedule nightly backup jobs that
repeat indefinitely.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 111
Practice 15-1: Performing Database Backups
In this practice, you perform an immediate backup to disk and schedule a nightly backup
job.
1) What is the difference between a backup set and an image copy?
Answer: A backup set contains data and archive log files packed in an Oracle
proprietary format. Files must be extracted before use. Image copies are the
equivalent of operating system file copies and can be used for restore operations
immediately.
2) What is the destination of any disk backups that are done?
a) Log in to Enterprise Manager as the DBA1 user in the SYSDBA role and select
Availability > Backup Settings.
m y
d e
c a
e A
c l
r a
b) Note the message under the Disk Backup Location that says the flash recovery
O ly
area is the current disk backup location.
l & On
3) Establish the backup policy to automatically back up the SPFILE and control file.
a e
a) Click the Policy tab under the Backup Settings pages.
n
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 112
Practice 15-1: Performing Database Backups (continued)
b) Click Automatically backup the control file and server parameter file
(SPFILE) with every backup and database structural change.
c) Scroll to the bottom and enter oracle and oracle for Host Credentials
Username and Password for your server, and click “Save as Preferred
Credential.”
4) Test making a backup to disk, as a backup set, with oracle for Host Credentials.
m y
a) Click the Device tab under the Backup Settings pages.
d e
b) Select Backup Set as your Disk Backup Type.
c a
c) Scroll to the bottom and ensure the Host Credentials are set to oracle.
e A
d) Scroll to the top of the page and click Test Disk Backup.
c l
e) A processing message appears. When the test finishes, and you see the ‘Disk
r a
Backup Test Successful!’ message, click OK.
O ly
5) Back up your entire database, with archive logs, while the database is open for user
l & On
activity. This backup should be the base for an incremental backup strategy.
a) Question: What prerequisite must be met to create a valid backup of a database
a e
without shutting it down?
n
e r s
Answer: The database must be in ARCHIVELOG mode. Backups made with the
t U
database open, but not in ARCHIVELOG mode, cannot be used for recovery.
I n
b) Select Availability > Schedule Backup (in the Manage section).
c le
If you find that the Oracle-Suggested Backup strategy fits your needs exactly, you
r a would chose this option. For practice purposes, you will schedule a customized
backup
O c) Select Whole Database as the object to be backed up.
m y
d e
c a
e A
c l
j) Click Next.
r a
O ly
k) Accept all the defaults on the Schedule Customized Backup: Schedule page and
l & On
then click Next to continue.
Note: Schedule Type should be One Time (Immediately).
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 114
Practice 15-1: Performing Database Backups (continued)
l) On the Schedule Customized Backup: Review page, review the RMAN script,
and then click Submit Job.
m) Click View Job to monitor the status of the backup job. The time for this backup
depends on your hardware and system resources.
n) Click your browser’s Refresh or Requery button until the job is completed.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
6) Schedule nightly disk-based incremental online backups for your whole database,
without archived logs. Schedule it for execution at 11:00 PM. The schedule should be
r a
in effect indefinitely.
O a) In Enterprise Manager, select Availability > Schedule Backup (in the Manage
section).
b) Select Whole Database as the object to be backed up.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O k) Click Next to continue.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 117
Practices for Lesson 16
Background: Many failures of the Oracle database can be traced to some sort of media
failure, such as disk or controller failure. In this practice, you encounter a number of
problems from which you need to recover the database.
• Recover from the loss of a control file
• Recover from the loss of a data file
• Recover from the loss of a redo log member
• Recover from the loss of a file in the SYSTEM tablespace
SQL script files are provided for you in the /home/oracle/labs directory. If
needed, use the appendixes for Linux and for SQL syntax. After you set up a failure with
a SQL script, you must complete the recovery before continuing with any other practice.
Note: Your system may have different OS file names than shown here. Your output
might look different. (To conserve space, blank lines have been removed.)
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 118
Practice 16-1: Preparing Practice Environment
Before beginning one of the recovery scenarios, you need to run a script that will prepare
the environment for the remaining recovery practices.
1) Before setting up an individual problem, you need to navigate to your labs directory
and (in SQL*Plus) execute the lab_16_01.sql script as the SYS user. This script
prepares some procedures to be called by the rest of this practice.
$ cd /home/oracle/labs
$ sqlplus / as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
SQL> @lab_16_01.sql
y
Connected.
Java created.
e m
Procedure created.
a d
PL/SQL procedure successfully completed.
A c
le
PL/SQL procedure successfully completed.
c
a
PL/SQL procedure successfully completed.
r
O ly
PL/SQL procedure successfully completed.
l & On
PL/SQL procedure successfully completed.
n a e
PL/SQL procedure successfully completed.
Synonym created.
t e r U s
I
Grant succeeded.n
c
SQL>
le
r a
O
Oracle Database 11g: Administration Workshop I A - 119
Practice 16-2: Recovering from the Loss of a Control File
In this practice, your system experiences the loss of a control file. You then go through
the steps to recover from this loss.
1) Continue in your SQL*Plus session as the SYS user. Execute the lab_16_02.sql
script. This script deletes one of your control files.
SQL> @lab_16_02.sql
2) The Help desk begins receiving calls saying that the database appears to be down.
Troubleshoot and recover as necessary. Use Enterprise Manager to try to start up the
database, and use SQL*Plus if needed.
a) In Enterprise Manager, navigate to the Database home page. It reports that the
database is down and offers you the chance to start it up again.
Note: you may see a message stating ‘Internal Error has occurred.’ If so, keep
trying to connect to using the Enterprise Manager URL. Eventually it will display
the database home page.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
b) Click Startup. If you see a Connection Refused message, ignore it; the connection
will eventually be established.
O c) Enter oracle as Username and Password for Host Credentials and click OK.
d) Click Yes to confirm your attempted startup.
m y
d e
c a
A
f) Note the following, and then click OK:
e
c l
ORA-00205: error in identifying control file, check alert
log for more info
r a
g) Alternatively, in a new SQL*Plus session, check the current status of the instance
O ly
as the SYS user and attempt to mount it with the following commands:
l & On
select status from v$instance;
a e
alter database mount;
n
e r
$ sqlplus / as sysdba
t U s
SQL*Plus: Release 11.1.0.6.0 - Production on Sat Aug 30
00:00:10 2008
I n
Copyright (c) 1982, 2007, Oracle. All rights reserved.
c le
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
r a
Production
With the Partitioning, OLAP, Data Mining and Real Application
O Testing options
SQL>
3) The instance cannot move to the mount stage because it cannot find one of the control
files. To find the locations of the alert log and of diagnostic information, enter the
following SELECT statement:
SELECT NAME, VALUE FROM V$DIAG_INFO;
NAME
--------------------------------------------------------------
VALUE
m y
--------------------------------------------------------------
Diag Enabled
d e
TRUE
c a
ADR Base
e A
l
/u01/app/oracle
ADR Home
a c
Diag Trace
r
/u01/app/oracle/diag/rdbms/orcl/orcl
O ly
& On
/u01/app/oracle/diag/rdbms/orcl/orcl/trace
l
Diag Alert
n a e
t e r U s
/u01/app/oracle/diag/rdbms/orcl/orcl/alert
Diag Incident
I n
/u01/app/oracle/diag/rdbms/orcl/orcl/incident
c le
Diag Cdump
r a
/u01/app/oracle/diag/rdbms/orcl/orcl/cdump
O Health Monitor
/u01/app/oracle/diag/rdbms/orcl/orcl/hm
11 rows selected.
SQL>
4) Look at the last 25 lines in the log.xml file to see if you can find out what the
problem is. Still inside your SQL*Plus session, enter the following command (on one
line):
host tail -25
/u01/app/oracle/diag/rdbms/orcl/orcl/alert/log.xml
</txt>
</msg>
c le
r a
<msg time='2008-08-30T00:00:41.938-06:00' org_id='oracle'
comp_id='rdbms'
O ly
client_id='' type='UNKNOWN' level='16'
module='' pid='23464'>
l & On
<txt>ORA-00210: cannot open the specified control file
ORA-00202: control file:
n a e
'/u01/app/oracle/oradata/orcl/control02.ctl'
e r s
ORA-27037: unable to obtain file status
t U
Linux Error: 2: No such file or directory
I n
Additional information: 3
</txt>
c le
</msg>
<msg time='2008-08-30T00:00:44.937-06:00' org_id='oracle'
r a
comp_id='rdbms'
msg_id='opiexe:2986:2780954927' client_id=''
O type='NOTIFICATION'
group='admin_ddl' level='16'
module='[email protected] (TNS V1-V3)'
pid='23617'>
SQL>
5) Note that in the preceding example, the control02.ctl file is missing. This
might be different in your environment. Restore the control file that is missing for
your database by copying an existing control file. Enter the following command with
your correct file names (on one line):
host cp /u01/app/oracle/oradata/orcl/control01.ctl
/u01/app/oracle/oradata/orcl/control02.ctl
SQL>
6) (Optional) To view the content of the directory, enter:
host ls /u01/app/oracle/oradata/orcl
e A
c l
7) Now mount and open the database with the following commands:
connect / as sysdba
r a
alter database mount;
alter database open; O ly
l & On
SQL> connect / as sysdba
Connected.
n a e
t e r
SQL> alter database mount;
U s
I n
Database altered.
le
SQL> alter database open;
c
r a
Database altered.
O SQL>
a) Why did you have to use two commands to move the instance state from
NOMOUNT to OPEN?
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 125
Practice 16-3: Recovering from the Loss of a Data File
In this practice, you experience the loss of an application data file. You then go through
the steps to recover from this loss.
1) In a SQL*Plus session, as the SYS user, execute the lab_16_03.sql script from
your labs directory. This script deletes one of your application data files.
$ sqlplus / as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
SQL> @lab_16_03.sql
m y
"Data file deleted. Database should be open."
SQL>
d e
c a
2) 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
determine whether there is a problem.
e A
c l
SQL> select count(*) from HR.COUNTRIES;
select count(*) from HR.COUNTRIES
*
r a
ERROR at line 1:
O ly
ORA-01116: error in opening database file 5
ORA-01110: data file 5:
l & On
n a e
'/u01/app/oracle/oradata/orcl/example01.dbf'
ORA-27041: unable to open file
t e r
Additional information: 3
U s
Linux Error: 2: No such file or directory
SQL>
I n
c le
3) Troubleshoot and recover as necessary. The error message suggests that the
example01.dbf data file is corrupt or missing.
r a
a) In Enterprise Manager, click Availability > Perform Recovery.
O b) Click Advise and Recover.
Note: If you do not see the nonsystem datafile failure, keep refreshing the page
until it shows up.
d) With the failures selected, click Advise.
e) Because the file was not just renamed or moved, but deleted, you continue by
m y
clicking “Continue with Advise.”
d e
c a
e A
c l
r a
f) On the Recovery Advise page, you see the RMAN script. Click Continue.
O ly
l & On
n a e
t e r U s
I n
c le
g) On the Review page, you see the failure and the suggested solution. Click
“Submit Recovery Job.”
r a
O
Oracle Database 11g: Administration Workshop I A - 127
Practice 16-3: Recovering from the Loss of a Data File
(continued)
h) A Processing window appears, followed by the Job Activity page. You should see
a message that the job was successfully created. (Your link name is probably
different.)
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 128
Practice 16-4: Recovering from the Loss of a Redo Log Member
In this practice, your system experiences the loss of a redo log member. You then go
through the steps to recover from this loss.
1) Make sure that you are in your labs directory. Using SQL*Plus, execute the
lab_16_04.sql script as the SYS user. The lab_16_04.sql script deletes one
of your redo log files. See the error in the alert log and recover from it.
$ sqlplus / as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
SQL> @lab_16_04.sql
c a
2) The database continues to function normally, and no users are complaining. Log in to
A
Enterprise Manager with the DBA1 username as SYSDBA. On the Database home
e
l
page, view alerts similar to the following ones:
c
r a
O ly
l & On
n a e
If you do not see similar alerts, you may need to wait a few minutes and refresh the
t e r U s
page. One of the failures listed may be left over from the data file recovery you
performed in the previous practice.
I n
3) Click Availability > Perform Recovery (in the Manage section).
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 129
Practice 16-4: Recovering from the Loss of a Redo Log Member
(continued)
4) On the Perform Recovery page, you see the Failure Description and could directly
begin correcting the failure. But for practice purposes, you follow the steps in the
Data Recovery Advisor. Scroll down and ensure that your host credentials are set
(oracle for both username and password). Then click the “Advise and Recover”
button (which is one of the ways to invoke the Data Recovery Advisor).
m y
d e
c a
Advise.
e A
5) On the View and Manage Failures page, ensure that the failure is selected, and click
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 130
Practice 16-4: Recovering from the Loss of a Redo Log Member
(continued)
6) The Manual Actions page suggests to manually restore it. In the preceding example,
redo03.log is deleted. Do not click any button at this point in time.
7) In a new terminal window, as the oracle user, copy an existing redo log from the
same redo log group to the missing file.
Note: The actual redo log member that was lost on your machine may be different
than the one shown here. Make sure that you are replacing the file names as
appropriate for your failure.
cd /u01/app/oracle/oradata/orcl
ls
cp /u01/app/oracle/flash_recovery_area/redo02b.log redo02.log
ls
exit
$ cd /u01/app/oracle/oradata/orcl
$ ls
control01.ctl system01.dbf
m y
control02.ctl redo01.log
control03.ctl redo03.log
temp01.dbf
undotbs01.dbf
d e
example01.dbf sysaux01.dbf users01.dbf
c
$ cp /u01/app/oracle/flash_recovery_area/redo02b.log a
redo02.log
$ ls
e A
control01.ctl
control02.ctl redo01.log
c l
inventory01.dbf sysaux01.dbf users01.dbf
system01.dbf
control03.ctl
example01.dbf
redo02.log
redo03.log r atemp01.dbf
undotbs01.dbf
$ exit
O ly
assess Failures button. l & On
8) Now return to your Manual Actions page in Enterprise Manager and click the Re-
n a e
t e r
a) Note that there are now no failures found.
U s
b) Question: Why did the database not crash?
I n
Answer: Because a single missing member is noncritical and does not affect the
c le
operation of the database. As long as there is at least one good member for each
log group, the database operation continues.
r a
O
Oracle Database 11g: Administration Workshop I A - 131
Practice 16-5: Recovering from the Loss of a File in the SYSTEM
Tablespace
In this practice, your system experiences the loss of a file in the SYSTEM tablespace. You
then go through the steps to recover from this loss.
1) 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
2) As the SYS user, execute the lab_16_05.sql script in your labs directory. This
script deletes the system data file.
$ sqlplus / as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
m y
Production
With the Partitioning, OLAP, Data Mining and Real Application
d e
Testing options
c a
SQL> @lab_16_05.sql
e A
c l
PL/SQL procedure successfully completed.
l & On
3) In Enterprise Manager, review the Database home page. If you see a message that
a e
says the connection was refused, dismiss it and reenter the EM home page URL in the
n
t e r
browser. You may need to try several times before you see the Database home page.
U s
I n
c le
r a
O4) The database is shut down. Attempt to start your database.
e A
c l
6) On the Perform Recovery page, you could select the Oracle Advised Recovery, but
for practice purposes, continue with a User Directed Recovery.
r a
a) In the User Directed Recovery section, select Datafiles from the Recovery Scope
O ly
drop-down list and “Recover to current time” as Operation Type.
& On
b) Scroll down and enter oracle and oracle as Host Credentials
l
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 133
Practice 16-5: Recovering from the Loss of a File in the SYSTEM
Tablespace (continued)
c) Click Recover.
d) On the Perform Object Level Recovery: Datafiles page, you should see the
missing data file. Click Next.
m y
d e
c a
e A
c l
r a
O ly
e) Because the problem is simply a deleted file rather than a bad hard drive, there is
l & On
no need to restore to a different location. Select “No. Restore the files to the
default location” and then click Next.
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 134
Practice 16-5: Recovering from the Loss of a File in the SYSTEM
Tablespace (continued)
f) On the Perform Object Level Recovery: Review page, view your current options
and the data file. Click Edit RMAN Script to review the RMAN commands.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 135
Practice 16-5: Recovering from the Loss of a File in the SYSTEM
Tablespace (continued)
h) A processing page appears, followed by the Perform Recovery: Result page. The
duration of this operation depends on your system resources. The recovery
operation should be successful.
m y
i) On the Perform Recovery: Result page, click Open Database.
d e
j) After you see the success message, click OK.
c a
A
k) Verify that the database is open and operating normally by logging in to EM as
your DBA1 user as SYSDBA, and reviewing the Database home page.
e
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 136
Practices for Lesson 17
Background: In the recent past, you received a number of questions about the HR
schema. To analyze them without interfering in daily activities, you decide to use the
Data Pump Wizard to export the HR schema to file. When you perform the export, you
are not sure into which database you will be importing this schema.
In the end, you learn that the only database for which management approves an import is
the orcl database. So you perform the import with the Data Pump Wizard, remapping
the HR schema to DBA1 schema.
Then you receive two data load requests for which you decide to use SQL*Loader.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 137
Practice 17-1: Moving Data Using Data Pump
In this practice, you first grant the DBA1 user the privileges necessary to provide access
to the DATA_PUMP_DIR directory. You then export the HR schema so that you can then
import the tables you want into the DBA1 schema. In the practice, you import only the
EMPLOYEES table at this time.
1) First, you need to grant the DBA1 user the appropriate privileges on the
DATA_PUMP_DIR directory and create the users and roles required for this practice.
A script exists that performs all the steps required to configure your environment for
this practice.
a) Review the lab_17_01.sql script, which grants the DBA1 user privileges on
the DATA_PUMP_DIR directory and performs other configurations to your
environment, by executing the following in your labs directory:
$ cat lab_17_01.sql
m y
e
Tablespace created.
a d
User created.
A c
Role created.
c le
Grant succeeded. r a
O ly
Grant succeeded.
l & On
n a e
Table altered.
t e r U s
I
Grant succeeded.n
c le
r a
Grant succeeded.
m y
e
f) On the “Export: Options” page, select DATA_PUMP_DIR from the Directory
d
Objects drop-down list, and enter hrexp.log as Log File.
c a
e A
c l
r a
O ly
g) Review Advanced Options (but do not change), and then click Next.
l & On
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.
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 139
Practice 17-1: Moving Data Using Data Pump (continued)
i) On the “Export: Schedule” page, enter hrexp as Job Name and Export HR
schema as Description, accept the immediate job start time, and then click
Next.
j) On the “Export: Review” page, click Show PL/SQL and review the PL/SQL that
the Export Wizard helped you to create.
k) Click Submit Job to submit the job.
d e
c a
e A
c l
r a
O ly
3) Now, import the EMPLOYEES table from the exported HR schema into the DBA1
schema. To get a feeling for the command-line interface, you can use the impdp
l & On
utility from the command line to import the EMPLOYEES table into the DBA1 user
schema.
n a e
t e r U
the end of the command: s
a) Enter the following entire command string. Do not press [Enter] before reaching
I n
impdp dba1/oracle DIRECTORY=data_pump_dir
DUMPFILE=HREXP01.DMP REMAP_SCHEMA=hr:dba1 TABLES=employees
c le
LOGFILE=empimport.log
r a
$ impdp dba1/oracle DIRECTORY=data_pump_dir
DUMPFILE=HREXP01.DMP REMAP_SCHEMA=hr:dba1 TABLES=employees
O LOGFILE=empimport.log
c l
r a
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
ORA-39082: Object type TRIGGER:"DBA1"."SECURE_EMPLOYEES"
O ly
created with compilation warnings
l & On
ORA-39082: Object type TRIGGER:"DBA1"."SECURE_EMPLOYEES"
created with compilation warnings
n a e
ORA-39082: Object type TRIGGER:"DBA1"."UPDATE_JOB_HISTORY"
created with compilation warnings
e r s
ORA-39082: Object type TRIGGER:"DBA1"."UPDATE_JOB_HISTORY"
t U
created with compilation warnings
I n
Processing object type
SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
c le
Job "DBA1"."SYS_IMPORT_TABLE_01" completed with 5 error(s) at
17:23:33
r a
Note: You may see errors on constraints and triggers not being created because only
O the EMPLOYEES table is imported and not the other objects in the schema. These
errors are expected.
b) You can also verify that the import succeeded by viewing the log file.
4) Confirm that the EMPLOYEES table has been loaded into the DBA1 schema by
logging in to SQL*Plus as the DBA1 user and selecting data from the EMPLOYEES
table.
a) Log in to SQL*Plus as the DBA1 user.
$ sqlplus dba1/oracle
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
SQL>
b) Select a count of the rows from the EMPLOYEES table in the DBA1 schema, for
verification of the import.
m y
SQL> select count(*) from employees;
d e
COUNT(*)
----------
c a
SQL>
107
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 142
Practice 17-2: Loading Data Using SQL*Loader
In this practice, you load data into the PRODUCT_MASTER table by using SQL*Loader
via Enterprise Manager Database Control. Data and control files are provided.
1) As the DBA1 user, use Enterprise Manager to load the lab_17_02_01.dat data
file. This data file contains rows of data for the PRODUCT_MASTER table. The
lab_17_02_01.ctl file is the control file for this load.
Optionally, view the lab_17_02_01.dat and lab_17_02_01.ctl files to
learn more about their structure before going further.
a) Invoke Enterprise Manager as the DBA1 user as the Normal role for your orcl
database.
b) Select Data Movement > Move Row Data > Load Data from User Files.
c) Click Use Existing Control File. If not already entered, enter oracle as
Username and as Password, click Save as Preferred Credential, and then click
Continue.
m y
d e
c a
e A
c l
d) On the “Load Data: Control File” page, enter
r a
/home/oracle/labs/lab_17_02_01.ctl as the control file name and
path, or use the flashlight icon to select this control file. Click Next.
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 143
Practice 17-2: Loading Data Using SQL*Loader (continued)
e) On the “Load Data: Data File” page, click Provide the full path and name on
the database server machine and enter
/home/oracle/labs/lab_17_02_01.dat as the data file name and path,
or use the flashlight icon to select this data file. Click Next.
f) On the “Load Data: Load Method” page, select Conventional Path, and then
click Next.
m y
g) On the “Load Data: Options” page, accept all defaults, but enter d e
c a
/home/oracle/labs/lab_17_02_01.log as the log file name and path.
Next.
e A
Review the advanced options if you want, but do not change any, and then click
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 144
Practice 17-2: Loading Data Using SQL*Loader (continued)
h) On the “Load Data: Schedule” page, enter lab_17_02_01 as Job Name and
Load data into the PRODUCT_MASTER table as Description. Let the
job start immediately, and then click Next.
i) On the “Load Data: Review” page, review the loading information and
parameters, and then click Submit Job.
j) Click the link to the LAB_17_02_01 job to monitor the progress. After the job
shows as successfully completed, move on to the next step.
m y
d e
c a
e A
c l
r a
k) Confirm your results by viewing your lab_17_02_01.log file in your
O ly
/home/oracle/labs directory.
l & On
2) As the INVENTORY user, load data into the PRODUCT_ON_HAND table by using
SQL*Loader command line. The lab_17_02_02.dat data file contains rows of
n a e
data for the PRODUCT_ON_HAND table. The lab_17_02_02.ctl file is the
t e r
control file for this load.
U s
Optionally, view the lab_17_02_02.dat and lab_17_02_02.ctl files to
I n
learn more about their structure before going further.
c le
a) Open a terminal window and navigate to the /home/oracle/labs directory.
b) Enter the following SQL*Loader command (in continuation, without pressing
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 146
Practices for Lesson 18
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
Oracle Database 11g: Administration Workshop I A - 147
Practice 18-1: Investigating a Critical Error
In this practice, you investigate a critical error. A data block has been corrupted. Use the
Enterprise Manager Support Workbench, Health Checkers, and advisors to react to the
error.
1) Set up the database for the practice. The setup places the database in ARCHIVELOG
mode, creates a tablespace for the practice, and performs a tablespace backup. These
actions place the database in a mode that more closely resembles a production
database. Run the setup_p18.sh script. The scripts for this practice are in the
$HOME/labs directory.
$ cd $HOME/labs
$ ./setup_p18.sh
m y
e
Copyright (c) 1982, 2007, Oracle. All rights reserved.
a d
Connected to:
A c
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 -
Production
le
With the Partitioning, OLAP and Data Mining options
c
SQL> @cr_critical.sql
Connected.
r a
O ly
FILE_NO BLOCK_NO
---------- ----------
l & On
6 12
n a e
t e r U
Enter value for block_no: 12 s
'Enter Block number when prompted'
0+1 records in
0+1 records out
I n
c le
0+1 records in
0+1 records out
r a
O System altered.
3) Log in to Enterprise Manager as the DBA1 user in the SYSDBA role, and then view
the alerts on the Database home page and investigate the alert details. When the
incident appears in the alerts, click the Active Incidents link.
You should see one or more critical alerts. Depending on the timing, you may see one
or more of the following:
m y
d e
The number of Active Incidents may not match the number of alerts immediately.
Click the Active Incidents link.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
4) Investigate the details of the problem.
On the Support Workbench page and Problems tab, expand the problem with the
I n
description ORA 1578.
c le
Click the incident number of the most recent (first listed) incident.
5) Examine the Incident Details page. Notice that the SQL text of the statement that
r a
received the error is listed, and the session information. Depending on the error this
8) When the problem details page appears, notice that the Investigate and Resolve
Oracle Support.
m y
section has two tabs that allow you to pursue the solution yourself or enlist the aid of
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 150
Practice 18-1: Investigating a Critical Error (continued)
9) Get Checker information about the problem. Click Support Workbench in the
breadcrumb at the top of the page to return to the Support Workbench page. Click
Checker Findings tab.
10) Get advise. Under the Checker Findings tab, in the Data Corruption section, Select
the finding with the description that starts with “Datafile …” and click Launch
Recovery Advisor.
m y
d e
c a
e A
c l
r a
O ly
l & On
a e
Note: The data file number given in the description is the same as the FILE_NO
n
t e r
shown in the cr_critical.sql script in step 2.
U s
a) On the View and Manage Failures page, confirm that the failure “Datafile …” is
I n
selected, and then click Advise.
c le
b) The Recovery Advice page recommends an RMAN script. This script will
perform a block media recovery. Click Continue.
r a
c) The Review page shows the failures that will be resolved. Click Submit
O Recovery Job.
NKOCHHAR
17001
101 Neena Kochhar
515.123.4568 21-SEP-89 AD_VP
m y
100 90
d e
a
...
directory.
A c
12) When finished, run the cleanup_p18.sh script from the $HOME/labs
$ cd $HOME/labs
c le
a
$ ./cleanup_p18.sh
r
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 152
Practice 18-2: Staging a Patch
In this practice, you stage a patch for later installation. The patch has been downloaded
from MetaLink to a local directory.
1) Upload a patch file from the local machine at $HOME/labs/p6198642.zip to
the Enterprise Manager patch cache.
a) On the Database home page of Enterprise Manager, click the Software and
Support tab, and then click View Patch Cache in the Database Software
Patching section.
b) On the Patch Cache page, click Upload Patch File.
c) On the Create Oracle Software Update Component page, click Browse to find the
patch file. Select the /home/oracle/labs/p6198642.zip file in the File
Upload window and then click Open.
d) From the README.txt file inside the zipped patch file the following
information has been obtained. Enter the following on the Create Oracle Software
Update Component page. The Release field cannot be selected from the drop-
down menu. Most of the other values may be selected from a list.
Patch Number: 6198642
Patch Type: Patch
Created On: 07-JUL-2007
m y
Description: Dummy Patch for testing
Product Family: Oracle Database d e
Product: Oracle Database
c a
Release: 11.1.0.6
e A
Platform: Linux x86
c l
Language: American English
r a
O ly
e) Select Add Patch File to Patch Cache.
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 153
Practice 18-2: Staging a Patch (continued)
f) Click Upload.
m y
d e
2) Apply the patch to your database using the EM Apply Patch wizard.
c a
e A
a) From the Database home page, and the Software and Support tab, click Apply
Patch in the Database Software Patching section.
c l
b) On the Select Patches page, click Add Patches.
r a
c) On the Search And Select Patches page, confirm that Search Software Library
is selected, and Click Go.
O ly
& On
d) Select the patch that matches the one you uploaded in the previous steps.
l
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 154
Practice 18-2: Staging a Patch (continued)
e) Click Select.
m y
Host credentials for the oracle software owner. In this practice, the username is
c
h) On the Review page, check the parameters and click Finish. a
A
i) On the Deployment Procedure Manager page, the Patch Oracle Standalone
e
c l
Database job is shown with a status of running. The patch procedure stops the
dbconsole, so you cannot view the progress of the job from EM. The LISTENER
r a
and database will be stopped, and the software will be patched. The database
components will be restarted.
O ly
3) View the patches that are installed.
l & On
a) When the Enterprise Manager is available, Navigate to the Patch Advisor page on
a e
the Software and Support tab.
n
t e r s
Note: You may see a message on the Database home page that your database is
Under Blackout. Click End Blackout.
U
I n
b) On the Patch Advisor page, click Interim Patches Applied in the Related Links
sections.
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 155
Practice 18-2: Staging a Patch (continued)
c) The Oracle Home: /u01/app/oracle/product/11.1.0/db_1 (OraDb11g_home1) page
is displayed with a list of components and targets.
d) Click the Oracle Database 11g 11.1.0.6.0 link to drill down and see detailed
information and any interim patches that you have applied.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
Note: you will not see the patch you just applied in this practice because it is a
dummy patch for testing purposes only.
I n
e) Exit Enterprise Manger.
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 156
Practice 18-2: Staging a Patch (continued)
4) Remove the patch from the database with $HOME/labs/cleanup_patch.sh.
$ cd $HOME/labs
$ ./cleanup_patch.sh
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 157
Practice 18-2: Staging a Patch (continued)
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I A - 158
___________________
Appendix B
Basic Linux and
vi Commands
___________________
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
vi Commands
The Visual Interpreter/Editor (vi) is the most widely used text editor available for the UNIX environment.
While almost everybody curses its unwieldy command syntax, it is still the only editor almost certain to
be included with every version of the UNIX and Linux operating system. The following are a partial list
of available vi commands.
vi has two modes. Command line (where anything typed is taken as an editing command) and input mode
(where everything typed will be treated as part of the file being edited. To enter the input mode, type a, A,
i, I, o, O, c, C, s, S, r, or R. To return to the command-line mode, use the <ESC> key. To access the vi
editor from SQLPlus, enter the following command:
SQL>define _editor=vi
To edit a file from SQLPlus prompt, edit <filename> (press enter), from the Linux command prompt, vi
<filename> (press enter)
m y
0 (zero) - Move to beginning of current line $ - end of current line
d e
G - go to last line of file
c
a
?<string> - Search backward to the next occurrence of <string>
r
n - Repeat previous search
O ly N - Repeat previous search in opposite direction
n a e
t e r
u - Will undo the most recent change.
n
:e! - re-edit current file without saving any changes made since last change
I
le
To ENTER NEW text:
c
r a
a - Append text after the current cursor position.
O A - Append text to the end of a line (jumps to end of line and begin appending).
c - Change object C - Change from current cursor position to end of the line
i - Insert text before the current cursor position. I - Insert text at the beginning of a line.
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)
x - Will delete the character directly under the current cursor location.
dnd (where n is some integer) will delete n lines from current cursor position
e
manipulated with the following commands:
c l
Y - Yank a copy of the current line
r a y <integer> - Yank a copy of next <int> lines
a e
Also, see the s and S commands under the input section
n
e r s
To SAVE edited changes to an operating system file:
t U
I n
zz - Will terminate edit mode. :w filename - Will save changes to the filename specified.
le
:wq - Write all changes and quit the edit mode
c
a
To QUIT without saving changes:
r
O ZZ - Will terminate edit mode. :q! - Will terminate the file without saving changes.
This appendix is meant to serve only as a quick reference while you are in class. For more
details on these commands, consult the man pages, your Linux documentation, or other
Linux command reference books.
Files and Linux Commands Description/Comments
Directories
Command man <command> Find the manual entry for this
manual <command>.
man –k <string> Show all the manual entries that
contain this <string>.
man man Displays the manual page for
man.
Command info <command> Show the information system entry
information for this command. Using info
info shows a tutorial of the info
documentation system.
Print to cat <file>
Concatenate and print – print the
standard out
named file to the terminal screen.
List users
Change
cat /etc/password
cd <directory> Change working directory to
m y
working
directory
specified directory
d e
cd with no parameters changes to
Copy a file c
$HOME.
a
Copy a source file to a destination
A
cp <source_file>
<destination_file> file.
View a file less <file>
O ly version.
List directory
& On
ls <directory>
Options –l long listing, -R
l
a e recursive, -a show hidden files, -t
r n s
sort by time, -r reverse sort,
default directory is current
nt e U working directory.
Create a
directory I
mkdir <directory> Make a directory defaults into the
current working directory, full
r a
Move or
rename a file
mv <old_file> <new_file> Move changes the name of a file
or moves it to a different directory.
O
Oracle Database 11g: Administration Workshop I B - 4
Process List ps Shows the processes report
ps -ef Shows all processes on the system
with a full listing. Many option
exist see the man page for details.
Print working pwd Print to stdout the current working
directory directory.
Remove or rm <file> Removing a file on Linux is
erase a file permanent. Options –r recursive,
and –f force (including
subdirectories) are very
dangerous. Often the rm
command is aliased with rm –i
The option –i asks ‘Are you sure?’
Create an empty touch <file> Create a file.
file
Name of the hostname Returns the name of the machine.
machine
The IP address host <machine_name>
of the machine
Queries the Domain Name Server,
and returns the IP address of the
m y
Remote shell rsh <host> <command>
machine name.
d e
Execute a <command> on <host>.
r a instead.
a pattern O ly
Search a file for grep <option> <pattern> <file> Search a <file> or stream for a
regular expression defined by
le
Source a script . <script_file> In the bash shell this command ‘.’
c a
Available under Gnome.
WSIWIG kate <file>
Alias
t e r U s
alias <command> <alias>
by default unless redirected.
Make a substitution when a user
r a
Show shell
variables
set Prints all of the variables that are
currently defined in the shell.
O
Oracle Database 11g: Administration Workshop I B - 6
Show printenv or env Prints all the environment
environment variables – an environment
variables variable has been ‘exported’ so
that it will be inherited by child
processes.
File Creation umask –S u=rwx,g=rx,o=rx Set the default permissions for all
mask files created by this shell or its
children. The –S option uses the
symbolic notation, the numeric
notation is obsolete.
Clock xclock An X client that shows a clock on
the screen. Often used to test the X
windows system.
X access xhost Show the current access control in
xhost +<Xclient>
control place.
Add a Xclient that is allowed to
access the local DISPLAY, if no
<Xclient> is given all are allowed.
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I B - 7
System Linux Commands Description / Comments
Administration
Substitute user su - username Change the user that is currently
performing the work. This can be
used by any user to change who is
the effective id of the session user.
normal users must provide a
password, root does not. The ‘-‘
parameter is optional. It runs the
new users login scripts.
Limited root sudo The root user may configure which
privileges users can execute certain
commands as root, and whether a
password is required or not. Useful
for allowing specific users to
perform certain root commands
e.g. mount and unmount
removable volumes such as
m y
The root directory for the system
d e
Typically the directory in which
c a
all user home directories placed.
For example: /home/oracle.
Tmp directory /tmp
l & On instructions.
Log directory /var/log
Sample
t e r
/etc/inittab
U s files.
Configuration files are located per
configuration
files
I n the application. Any configuration
file that you change after
r a
Password files /etc/passwd
/etc/shadow
The /etc/passwd file holds
user information and must be
O readable by others; even with
encrypted passwords this can be a
security hole. The /etc/shadow
frequency
Schedule a at <options> TIME
d e
Runs a job specified by <options>
command to run
at a single c a
at a specified TIME parameter.
specified time
e A
Schedule a
command
batch <options> <TIME>
r
system umount <mount_point>
Maximum # of 65535
t e U s
user ID
I
Recover root {lilo} n This is a procedure to recover the
password
c le control-x
linux S
root password if is lost. This
requires physical access to the
r a passwd root
machine and system console. You
start by rebooting the machine,
O {grub}
then during the LILO boot press
and hold [Ctrl] + [x] to get a
c prompt and command LILO to
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I B - 10
Delete user userdel Remove a user and optionally all
files belonging to the user.
Modify user usermod Change /etc/password
account information.
Create new groupadd –g sets the group id; default is first
group free value above 500.
Delete group groupdel Remove a group from the system.
May not remove a group that is a
primary group for a user. Files
owned by deleted group must be
manually changed with chown.
Change run init <runlevel> The init command causes the
levels rcN.d scripts to be evaluated, for
the change in run level. init 6
forces a reboot.
Synchronize the sync Forces the buffer cache and page
disks cache to write all dirty buffers to
disk. Used just before a reboot to
n a e after a time.
Network IP
configuration
e
scripts/
t r U s
/etc/sysconfig/network- This directory holds scripts
executed as part of the boot up
Hosts IP I n
/etc/hosts
sequence by rc.sysinit.
A list of hosts that your machine
c le
addresses knows about. Must at minimum
include the name of the local
OName service
switch
/etc/nsswitch.conf
le
Run Level Shows previous and current
runlevel
a
Kernelc sysctl -a
runlevel.
Show settings of all settable kernel
O r
Parameters
Max # File sysctl fs.file-max
parameters.
Shows the value of maximum number
Descriptors of file descriptor per process.
d e
number of file handles; many
others (see man bash).
Show process ulimit
c a
Without options ulimit show the
limits
Interprocess ipcs <option>
e A current limit settings.
Options: –m the current usage of
Communication
c l shared memory; –s usage of
(Shared
Memory and
r a semaphores; –a shows all.
Semaphores)
O ly
Remove a
shared memory
ipcrm shm <shmid>
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I B - 13
System Linux Commands Description / Comments
Performance
Performance top View real-time OS and process
monitor statistics.
System activity sar –<options> <interval> Options: –q shows CPU queue, –u
reporter <count> CPU utilization, –d device
activity, –n DEV network device
activity, many more (see man
page). Interval is in seconds.
Virtual Memory vmstat <interval> < count> Interval is in seconds.
statistics
Virtual Memory cat /proc/meminfo Shows instantaneous virtual
statistics memory usage.
Kernel Cache cat /proc/slabinfo Kernel slab allocator statistics:
statistics frequently allocated cache objects
such as inode, dentries, and
asynchronous IO buffers.
I/O statistics iostat <option> <interval> Options: –d device activity, –c
<count> CPU activity, –x extended disk
m y
activity statistics. The interval is in
seconds.
d e
Multiprocessor mpstat –P <cpu> <count>
Statistics <interval>
c a
Return CPU statistics for
particular processor or all CPUs in
c le
r a
O
Oracle Database 11g: Administration Workshop I B - 14
Display swap free Show the current memory and
size swap usage.
Activate Swap swapon -a Turn on swap.
Free disk blocks df -k Measured in KB; use –m for MB
units.
Device listing cat /proc/devices List devices known to the system
by major and minor number.
Disk cat /proc/scsi/scsi0/sda/model View SCSI disk information.
information
cat /proc/ide/ide0/hda/model View IDE disk information.
Print network netstat <options> Print a wide variety of network
statistics statistics (see man netstat).
Graphical xosview An X-based display of recent OS
system statistics statistics.
viewer
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I B - 15
Misc System Linux Commands Description / Comments
Information
NFS exported /etc/exports Database file are not supported on
simple NFS.
NFS Client /var/lib/nfs/xtab
mounted
directories
Max File 2 TB with 4KB block size (on 32 With ext3 and ext2, others vary.
kernel)
System
Max File Size 2 GB {512B block size} The oracle database can create
files up to 64 GB with a 16 KB
File size can not database block size.
exceed file
system 2 TB {4KB block size} The 32-bit kernel limits file and
block devices to 2 TB.
File System dumpe2fs <device> Dump the file system properties to
Block size stdout.
Filesystem table /etc/fstab Mounts these file systems at boot
Journal ext3
up.
m y
Filesystem
d e
a
types reiserfs
n
/etc/rc.d/rc
Kernel
I
/boot/vmlinuz
cle
Kernel Bits getconf WORD_BIT POSIX call to get kernel
information. There are many other
O
Oracle Database 11g: Administration Workshop I B - 16
Boot single user {lilo} Use LILO facility.
control-x
linux S
{grub}
c Use GRUB Boot Loader.
kernel vmlinuz-2.4.9-13 single
ro root=/dev/hda8
initrd /initrd-2.4.9-13.img
boot
d e
Floppy drive /dev/fd0
c a
Usually mounted at
System /proc
e A /mnt/floppy.
The /proc filesystem is a memory-
information
c l based file system that allows
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I B - 17
LVM Linux (UnitedLinux) Description / Comments
LVM Logical Volume Manager This package is not provided by Red Hat
Enterprise Linux AS 2.1 and may not be
added without tainting the kernel. Kernel
support is provided in United Linux.
LVM Concepts logical extents A Logical volume is made up of logical
extents.
logical volume A set of logical extents taken from a volume
group and presented to the OS as a disk
volume. These extents may be striped across
multiple disks.
volume group A set of physical disk partitions created by
fdisk or the like, initialized with
pvcreate, then grouped into a physical
volume with vgcreate.
Display volume vgdisplay -v
group
Modify physical
volume
pvchange
m y
Prepare physical
disk
pvcreate
d e
List physical
volume
pvdisplay
c a
Remove disk vgreduce
e A
from volume
group
c l
Move logical pvmove
r a
volumes to
another physical O ly
volumes
l & On
Create volume vgcreate
n a e
group
Remove volume
t e r
vgremove
U s
group
Volume group I n
vgchange
c le
availability
Restore volume vgcfgrestore
r a
group
O
Oracle Database 11g: Administration Workshop I B - 18
Exports volume vgexport
group
Imports volume vgimport
group
Volume group vgscan
listing
Change logical lvchange
volume
characteristics
List logical lvdisplay
volume
Make logical lvcreate
volume
Extend logical lvextend
volume
Reduce logical lvreduce
volume
Remove logical
volume
lvremove
m y
Create striped lvcreate -i 3 -I 64
d e
volumes
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I B - 19
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
____________________
Appendix C
SQL Statement Syntax
____________________
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
SQL Statements
This excerpt from the Oracle Database SQL Quick Reference guide presents the syntax for
Oracle SQL statements. SQL statements are the means by which programs and users access data
in an Oracle database.
Table 1 shows each SQL statement and its related syntax. Table 2 shows the syntax of the
subclauses found in the table 1.
See Also: Oracle Database SQL Reference for detailed information about Oracle SQL
d
| SIZE size_clause
| allocate_extent_clause
c
| deallocate_unused_clause
| { CACHE | NOCACHE } a
]...
e A
[ parallel_clause ] ;
c l
ALTER DATABASE
a
ALTER DATABASE [ database ]
r
{ startup_clauses
O ly
| recovery_clauses
| database_file_clauses
l & On
| logfile_clauses
| controlfile_clauses
n a e | standby_database_clauses
r
| default_settings_clauses
t e U s| redo_thread_clauses
| security_clause
I n } ;
cle
ALTER DIMENSION ALTER DIMENSION [ schema. ]dimension
{ ADD
r a { level_clause
| hierarchy_clause
O | attribute_clause
| extended_attribute_clause
}
[ ADD
m y
ALTER DISKGROUP ALTER DISKGROUP
d e
{ disk_clauses | diskgroup_clauses }
c a
[ { disk_clauses | diskgroup_clauses } ]... ;
ALTER FUNCTION
e A
ALTER FUNCTION [ schema. ]function
c l
COMPILE [ DEBUG ]
[ compiler_parameters_clause
r a
[ compiler_parameters_clause ] ... ]
[ REUSE SETTINGS ] ;
O ly
ALTER INDEX
l & On
ALTER
{ {
INDEX [ schema. ]index
deallocate_unused_clause
n a e |
|
allocate_extent_clause
shrink_clause
t e r U s|
|
parallel_clause
physical_attributes_clause
I n |
}
logging_clause
le
[ deallocate_unused_clause
| allocate_extent_clause
a c | shrink_clause
O r | parallel_clause
| physical_attributes_clause
| logging_clause
]...
| rebuild_clause
| PARAMETERS ('ODCI_parameters')
m y
( ( match_string [, ] { schema_name | - } )
[ ( match_string [, ] { schema_name | - } )
]...
]
)
d e
{ { COMPILE | RESOLVE }
c
| invoker_rights_clause a
} ;
e A
ALTER MATERIALIZED VIEW
c l
ALTER MATERIALIZED VIEW
r a
[ schema. ](materialized_view)
[ physical_attributes_clause
O ly
| table_compression
| LOB_storage_clause
l & On
[, LOB_storage_clause ]...
| modify_LOB_storage_clause
n a e [, modify_LOB_storage_clause ]...
| alter_table_partitioning
t e r U s
| parallel_clause
| logging_clause
I n | allocate_extent_clause
| shrink_clause
le
| { CACHE | NOCACHE }
]
a c [ alter_iot_clauses ]
y
[, { { OBJECT ID
| PRIMARY KEY
| ROWID
| SEQUENCE
e m
}
a d
[ (column [, column ]...) ]
}
]...
A c
| (column [, column ]...)
] ;
le
[ new_values_clause ]
c
ALTER OPERATOR
r a
ALTER OPERATOR [ schema. ]operator
O ly
{ add_binding_clause
& On
| drop_binding_clause
l
| COMPILE
a e
} ;
ALTER OUTLINE
r n s
ALTER OUTLINE
I | RENAME TO new_outline_name
le
| CHANGE CATEGORY TO new_category_name
| { ENABLE | DISABLE }
a c }
O r [ REBUILD
| RENAME TO new_outline_name
| CHANGE CATEGORY TO new_category_name
| { ENABLE | DISABLE }
]... ;
c
| CONNECT_TIME
| LOGICAL_READS_PER_SESSION
A
| PRIVATE_SGA
}
c l
integere
a
] ... ;
ALTER ROLE r
O ly
ALTER ROLE role
& On
{ NOT IDENTIFIED
l
| IDENTIFIED
a e
{ BY password
| USING [ schema. ]package
r n s
| EXTERNALLY
nt e U
| GLOBALLY
}
I } ;
cle
ALTER ROLEBACK SEGMENT ALTER ROLLBACK SEGMENT rollback_segment
a
{ ONLINE
O r | OFFLINE
| storage_clause
| SHRINK [ TO integer [ K | M ] ]
};
e A
c l
{ archive_log_clause
| checkpoint_clause
r a
| check_datafiles_clause
| DUMP ACTIVE SESSION HISTORY [ MINUTES integer ]
O ly
| distributed_recov_clauses
| restricted_session_clauses
l & On
| FLUSH { SHARED_POOL | BUFFER_CACHE }
| end_session_clauses
n a e
| SWITCH LOGFILE
r
| { SUSPEND | RESUME }
t e U s
| quiesce_clauses
| shutdown_dispatcher_clause
I n | REGISTER
| SET alter_system_set_clause
le
[ alter_system_set_clause ]...
c
| RESET alter_system_reset_clause
a
[ alter_system_reset_clause ]...
O r
ALTER TABLE
} ;
c
| tablespace_retention_clause a
} ;
e A
ALTER TRIGGER
c l
ALTER TRIGGER [ schema. ]trigger
r a
{ ENABLE
| DISABLE
O ly
| RENAME TO new_name
| COMPILE [ DEBUG ]
l & On
[ compiler_parameters_clause
[ compiler_parameters_clause ] ... ]
n a e
} ;
[ REUSE SETTINGS ]
t e r U s
n
ALTER TYPE ALTER TYPE [ schema. ]type
I { compile_type_clause
| replace_type_clause
c le | { alter_method_spec
| alter_attribute_definition
r a | alter_collection_clauses
| [ NOT ] { INSTANTIABLE | FINAL }
O }
[ dependent_handling_clause ]
} ;
d e
{ BY password [ REPLACE old_password ]
| EXTERNALLY
c a
| GLOBALLY AS ’external_name’
}
e A
| DEFAULT TABLESPACE tablespace
c l
| TEMPORARY TABLESPACE
{ tablespace | tablespace_group_name }
r a| QUOTA { integer [ K | M ]
| UNLIMITED
O ly } ON tablespace
& On
[ QUOTA { integer [ K | M ]
l
| UNLIMITED
a e
} ON tablespace
]...
r n s
| PROFILE profile
nt e U
| DEFAULT ROLE { role [, role ]...
| ALL [ EXCEPT
I | NONE
role [, role ]... ]
c le }
| PASSWORD EXPIRE
O ]...
| user [, user ]... proxy_clause ;
ANALYZE ANALYZE
{ TABLE [ schema. ]table
[ PARTITION (partition)
| SUBPARTITION (subpartition)
]
| INDEX [ schema. ]index
[ PARTITION (partition)
| SUBPARTITION (subpartition)
]
| CLUSTER [ schema. ]cluster
}
{ validation_clauses
| LIST CHAINED ROWS [ into_clause ]
| DELETE [ SYSTEM ] STATISTICS
m y
| compute_statistics_clause
| estimate_statistics_clause
d e
} ;
c a
ASSOCIATE STATISTICS
A
ASSOCIATE STATISTICS WITH
e
l
{ column_association | function_association } ;
c
AUDIT AUDIT
r a
{ sql_statement_clause | schema_object_clause }
O ly
[ BY { SESSION | ACCESS } ]
l & On
[ WHENEVER [ NOT ] SUCCESSFUL ] ;
CALL
n a e
CALL
t e r U s
{ routine_clause
| object_access_expression
}
I n [ INTO :host_variable
[ [ INDICATOR ] :indicator_variable ] ] ;
c le
a
COMMENT COMMENT ON
O r { TABLE [ schema. ]
{ table | view }
| COLUMN [ schema. ]
{ table. | view. | materialized_view. } column
| OPERATOR [ schema. ] operator
| INDEXTYPE [ schema. ] indextype
]
]...
e A
c l
[ parallel_clause ]
[ NOROWDEPENDENCIES | ROWDEPENDENCIES ]
a
[ CACHE | NOCACHE ] ;
r
CREATE CONTEXT
O ly
CREATE [ OR REPLACE ] CONTEXT namespace
l & On
USING [ schema. ] package
[ INITIALIZED { EXTERNALLY | GLOBALLY }
n a e| ACCESSED GLOBALLY
] ;
CREATE CONTROLFILE
t e r U s
CREATE CONTROLFILE
I n [ REUSE ]
[ SET ]
c le DATABASE database
[ logfile_clause ]
r a { RESETLOGS | NORESETLOGS }
[ DATAFILE file_specification
O [, file_specification ]... ]
[ { MAXLOGFILES integer
| MAXLOGMEMBERS integer
| MAXLOGHISTORY integer
c
| set_time_zone_clause
a
A
}... ;
c
[ CONNECT TO
r a
{ CURRENT_USER
| user IDENTIFIED BY password
}O ly
[ dblink_authentication ]
l]& On
| dblink_authentication
n a e
[ USING 'connect_string' ] ;
CREATE DIMENSION
t e r U s
CREATE DIMENSION [ schema. ]dimension
n
level_clause
I [ level_clause ]...
le
{ hierarchy_clause
| attribute_clause
a c | extended_attribute_clause
r
}
[ hierarchy_clause
O | attribute_clause
| extended_attribute_clause
]... ;
c
| parallel_enable_clause a
]
]...
e A
c l
{ { AGGREGATE | PIPELINED }
USING [ schema. ]implementation_type
r a
| [ PIPELINED ]
{ IS | AS }
O ly
{ pl/sql_function_body | call_spec }
} ;
l & On
a e
CREATE INDEX CREATE [ UNIQUE | BITMAP ] INDEX [ schema. ]index
n
ON { cluster_index_clause
t e r U s
|
|
}
table_index_clause
bitmap_join_index_clause
;
I n
le
CREATE INDEXTYPE CREATE [ OR REPLACE ] INDEXTYPE
[ schema. ]indextype FOR
r
[, paramater_type ]...)
[, [ schema. ]operator (paramater_type
O ]...
using_type_clause ;
[, paramater_type ]...)
y
CREATE LIBRARY CREATE [ OR REPLACE ] LIBRARY [ schema. ]libname
{ IS | AS } 'filename' [ AGENT 'agent_dblink' ] ;
a d
c
[ OF [ schema. ]object_type ]
[ (scoped_table_ref_constraint) ]
e A
{ ON PREBUILT TABLE
[ { WITH | WITHOUT } REDUCED PRECISION ]
}
c l
| physical_properties materialized_view_props
r a
[ USING INDEX
[ physical_attributes_clause
O ly
| TABLESPACE tablespace
& On
]
l
[ physical_attributes_clause
a e
| TABLESPACE tablespace
n
]...
t e r U s
| USING NO INDEX
]
[ create_mv_refresh ]
I n [ FOR UPDATE ]
[ { DISABLE | ENABLE }
c le ]
QUERY REWRITE
r a AS subquery ;
O
CREATE MATERIALIZED VIEW
LOG
CREATE MATERIALIZED VIEW LOG
ON [ schema. ] table
[ physical_attributes_clause
| TABLESPACE tablespace
m y
CREATE OPERATOR CREATE [ OR REPLACE ] OPERATOR
d e
a
[ schema. ] operator binding_clause ;
c
CREATE OUTLINE
A
CREATE [ OR REPLACE ]
e
[ PUBLIC | PRIVATE ] OUTLINE [ outline ]
c l
[ FROM [ PUBLIC | PRIVATE ] source_outline ]
[ FOR CATEGORY category ]
r a
[ ON statement ] ;
CREATE PACKAGE
O ly
CREATE [ OR REPLACE ] PACKAGE [ schema. ]package
& On
[ invoker_rights_clause ]
l
a e
{ IS | AS } pl/sql_package_spec ;
s[ schema. ]package
nt e U { IS | AS } pl/sql_package_body ;
CREATE PFILE
I CREATE PFILE [= 'pfile_name' ]
le
FROM SPFILE [= 'spfile_name'] ;
a c
CREATE PROCEDURE CREATE [ OR REPLACE ] PROCEDURE [ schema. ]procedure
] ;
}
m y
CREATE ROLEBACK SEGMENT
d e
CREATE [ PUBLIC ] ROLLBACK SEGMENT rollback_segment
c a
[ { TABLESPACE tablespace | storage_clause }
[ TABLESPACE tablespace | storage_clause ]...
A
];
CREATE SCHEMA
le
CREATE SCHEMA AUTHORIZATION schema
c
{ create_table_statement
r a
| create_view_statement
| grant_statement
}
O ly
[ create_table_statement
l & On
| create_view_statement
| grant_statement
n a e ]... ;
CREATE SEQUENCE
t e r s
CREATE
U
SEQUENCE [ schema. ]sequence
n
[ { INCREMENT BY | START WITH } integer
I | {
| {
MAXVALUE integer | NOMAXVALUE }
MINVALUE integer | NOMINVALUE }
c le | {
| {
CYCLE | NOCYCLE }
CACHE integer | NOCACHE }
r a | {
]
ORDER | NOORDER }
O [
|
|
{
{
{
INCREMENT BY | START WITH } integer
MAXVALUE integer | NOMAXVALUE }
MINVALUE integer | NOMINVALUE }
| { CYCLE | NOCYCLE }
d e
| database_event [ OR database_event ]...
}
c
ON { [ schema. ]SCHEMA
a
A
| DATABASE
}
}
c le
[ WHEN (condition) ]
a
{ pl/sql_block | call_procedure_statement } ;
CREATE TYPE {
|
r
O ly
create_incomplete_type
create_object_type
|
|
l & On
create_varray_type
create_nested_table_type
n a e
}
n
{ IS | AS }
I { subprogram_declaration
le
| map_order_func_declaration
}
a c [; { subprogram_declaration
r
| map_order_func_declaration
}
O ]...
END ;
c l
| PROFILE profile
| PASSWORD EXPIRE
r a
| ACCOUNT { LOCK | UNLOCK }
]...
O ly
] ;
CREATE VIEW
l & On
CREATE [ OR REPLACE ] [ [ NO ] FORCE ] VIEW
n a e [ schema. ]view
r
[ (alias [ inline_constraint
t e U s [ inline_constraint ]... ]
| out_of_line_constraint
I n [, alias [ inline_constraint
[ inline_constraint ]... ]
le
| out_of_line_constraint
a c )
]...
O r | object_view_clause
| XMLType_view_clause
]
AS subquery [ subquery_restriction_clause ] ;
y
}
[ FORCE ] ;
e m
DROP CLUSTER DROP CLUSTER [ schema. ]cluster
a d
[ INCLUDING TABLES [ CASCADE CONSTRAINTS ] ] ;
DROP CONTEXT
A c
DROP CONTEXT namespace ;
DROP DATABASE
c le
DROP DATABASE ;
O ly
DROP DIMENSION
& On
DROP DIMENSION [ schema. ]dimension ;
l
DROP DIRECTORY
n a e
DROP DIRECTORY directory_name ;
DROP DISKGROUP
t e r U s
DROP DISKGROUP diskgroup_name
I n [ { INCLUDING | EXCLUDING }
CONTENTS
c le ] ;
r a
DROP FUNCTION DROP FUNCTION [ schema. ]function_name ;
O
DROP INDEX DROP INDEX [ schema. ]index [ FORCE ] ;
m y
DROP PROCEDURE DROP PROCEDURE [ schema. ]procedure ;
d e
DROP PROFILE DROP PROFILE profile [ CASCADE ] ;
c a
DROP ROLE
A
DROP ROLE role ;
e
DROP ROLLBACK SEGMENT
c l
DROP ROLLBACK SEGMENT rollback_segment ;
r a
DROP SEQUENCE
O ly
DROP SEQUENCE [ schema. ]sequence_name ;
DROP SYNONYM
l & On
DROP [ PUBLIC ] SYNONYM [ schema. ]synonym
a e
[ FORCE ] ;
DROP TABLE
r n s
DROP TABLE [ schema. ]table
nt e U [ CASCADE CONSTRAINTS ]
[ PURGE ] ;
I
c le
DROP TABLESPACE DROP TABLESPACE tablespace
[ INCLUDING CONTENTS [ AND DATAFILES ]
r a [ CASCADE CONSTRAINTS ]
] ;
O
DROP TRIGGER DROP TRIGGER [ schema. ]trigger ;
c a
[ { ENABLE | DISABLE } TRIGGERS ]
} ;
e A
| BEFORE DROP [ RENAME TO table ]
c l
a
GRANT GRANT { grant_system_privileges
r| grant_object_privileges
} ;
O ly
INSERT
l & On
INSERT [ hint ]
a e
{ single_table_insert | multi_table_insert } ;
r n s
e
LOCK TABLE LOCK TABLE
le
}
c
| @ dblink
a
]
NOAUDIT NOAUDIT
{ sql_statement_clause
[, sql_statement_clause ]...
| schema_object_clause
[, schema_object_clause ]...
}
[ WHENEVER [ NOT ] SUCCESSFUL ] ;
PURGE PURGE
{ { TABLE table
| INDEX index
}
| { RECYCLEBIN | DBA_RECYCLEBIN }
m y
| TABLESPACE tablespace
[ USER user ]
d e
} ;
c a
RENAME RENAME old_name
e A
l
TO new_name ;
REVOKE
a c
REVOKE { revoke_system_privileges
r
| revoke_object_privileges
O ly
} ;
ROLLBACK
l & On
ROLLBACK [ WORK ]
a e
[ TO [ SAVEPOINT ] savepoint
n
| FORCE 'text'
t e r U s
] ;
SAVEPOINT
I n SAVEPOINT savepoint ;
le
SELECT subquery [ for_update_clause ] ;
a c
SET CONSTRAINT[S] SET { CONSTRAINT | CONSTRAINTS }
O r {
|
}
constraint [, constraint ]...
ALL
{ IMMEDIATE | DEFERRED } ;
TRUNCATE TRUNCATE
{ TABLE [ schema. ]table
[ { PRESERVE | PURGE } MATERIALIZED VIEW LOG ]
| CLUSTER [ schema. ]cluster
}
UPDATE
[ { DROP | REUSE } STORAGE ] ;
UPDATE [ hint ]
m y
{ dml_table_expression_clause
| ONLY (dml_table_expression_clause)
d e
}
[ t_alias ]
c a
e A
update_set_clause
[ where_clause ]
l
[ returning_clause ] ;
c
r a
Table 2: Syntax for Subclauses O ly
l & On
Subclause
n a e
Syntax
t e r
activate_standby_db_clause
U s
ACTIVATE
[ PHYSICAL | LOGICAL ]
STANDBY DATABASE
cle
add_binding_clause ADD BINDING
(parameter_type
r a [, parameter_type ]...)
RETURN (return_type)
O [ implementation_clause ]
using_function_clause
add_disk_clause ADD
[ FAILGROUP failgroup_name ]
DISK qualified_disk_clause
y
[, qualified_disk_clause ]...
[ [ FAILGROUP failgroup_name ]
DISK qualified_disk_clause
[, qualified_disk_clause ]...
em
]...
a d
add_hash_index_partition ADD PARTITION
A c
[ partition_name ]
e
[ TABLESPACE tablespace_name ]
l
[ parallel_clause ]
c
add_hash_partition_clause
r a
ADD PARTITION [ partition ]
O ly
partitioning_storage_clause
[ update_index_clauses ]
& On
[ parallel_clause ]
l
add_hash_subpartition
a e
ADD subpartition_spec
n
t e r s
[ update_index_clauses ]
[ parallel_clause ]
U
I n
add_list_partition_clause ADD PARTITION [ partition ]
le
list_values_clause
c
[ table_partition_description ]
a
[ update_index_clauses ]
O r
add_list_subpartition ADD subpartition_spec
[ update_index_clauses ]
m y
add_table_partition { add_range_partition_clause
d e
a
| add_hash_partition_clause
A c
| add_list_partition_clause
alias_file_name
le
+diskgroup_name [ (template_name) ] /alias_name
c
allocate_extent_clause
r a
ALLOCATE EXTENT
O ly
[ ( { SIZE size_clause
| DATAFILE 'filename'
l & On
| INSTANCE integer
}
n a e [ SIZE size_clause
r
| DATAFILE 'filename'
t e U s | INSTANCE integer
]...
I n ]
)
c le
alter_attribute_definition { { ADD | MODIFY } ATTRIBUTE
r a { attribute [ datatype ]
| ( attribute datatype
O }
)
[, attribute datatype ]...
| DROP ATTRIBUTE
alter_datafile_clause DATAFILE
{ 'filename' | filenumber }
[, 'filename' | filenumber ]...
}
{ ONLINE
| OFFLINE [ FOR DROP ]
| RESIZE size_clause
| autoextend_clause
| END BACKUP
}
alter_external_table_clauses { add_column_clause
| modify_column_clauses
| drop_column_clause
|
|
parallel_clause
external_data_properties
m y
|
|
REJECT LIMIT { integer | UNLIMITED }
d
PROJECT COLUMN { ALL | REFERENCED } e
}
c
[ add_column_clause
a
A
| modify_column_clauses
| drop_column_clause
le
| parallel_clause
c
| external_data_properties
r a
| REJECT LIMIT { integer | UNLIMITED }
| PROJECT COLUMN { ALL | REFERENCED }
O ly
]...
alter_index_partitioning {
|
l & On
modify_index_default_attrs
add_hash_index_partition
|
n
| a e
modify_index_partition
rename_index_partition
t e r |
|
U s
drop_index_partition
split_index_partition
I n |
|
coalesce_index_partition
modify_index_subpartition
le
}
a c
alter_iot_clauses { index_org_table_clause
O r |
|
|
alter_overflow_clause
alter_mapping_table_clauses
COALESCE
}
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
m y
rollback_segment
}
d e
}
c a
| USING { ENFORCED | TRUSTED } CONSTRAINTS
alter_overflow_clause { OVERFLOW
e A
c l
{ allocate_extent_clause
a
| deallocate_unused_clause
}
r
[ allocate_extent_clause
O ly
| deallocate_unused_clause
l & On
]...
| add_overflow_clause
n
}
a e
alter_session_set_clause
t e r s
SET parameter_name = parameter_value
I n
le
alter_system_reset_clause parameter_name
c
[ SCOPE = { MEMORY | SPFILE | BOTH } ]
a
SID = 'sid'
O r
alter_system_set_clause parameter_name =
parameter_value [, parameter_value ]...
[ COMMENT 'text' ]
[ DEFERRED ]
alter_table_partitioning { modify_table_default_attrs
| set_subpartition_template
| modify_table_partition
| modify_table_subpartition
| move_table_partition
| move_table_subpartition
| add_table_partition
| coalesce_table_partition
| drop_table_partition
| drop_table_subpartition
| rename_partition_subpart
| truncate_partition_subpart
| split_table_partition
| split_table_subpartition
| merge_table_partitions
| merge_table_subpartitions
| exchange_partition_subpart
}
alter_table_properties { {
|
physical_attributes_clause
logging_clause
m y
|
|
table_compression
supplemental_table_logging
d e
|
|
allocate_extent_clause
c
deallocate_unused_clause a
|
|
A
shrink_clause
{ CACHE | NOCACHE }
e
|
|
c l
upgrade_table_clause
records_per_block_clause
|
|
r a
parallel_clause
row_movement_clause
}
O ly
[ physical_attributes_clause
l & On
| logging_clause
| table_compression
n a e | supplemental_table_logging
| allocate_extent_clause
t e r U s | deallocate_unused_clause
| shrink_clause
I n | { CACHE | NOCACHE }
| upgrade_table_clause
le
| records_per_block_clause
| parallel_clause
a c | row_movement_clause
O r }
]...
| RENAME TO new_table_name
[ alter_iot_clauses ]
analytic_clause [ query_partition_clause ]
[ order_by_clause [ windowing_clause ] ]
e A
[ TO 'location' ]
| STOP
}
c l
r a
O ly
array_DML_clause [ WITH | WITHOUT ]
ARRAY DML
l & On
[ ([ schema. ]type
[, [ schema. ]varray_type ])
n a e [, ([ schema. ]type
[, [ schema. ]varray_type ])...
t e r ]
U s
attribute_clause
I n ATTRIBUTE level DETERMINES
{ dependent_column
le
| ( dependent_column
c
[, dependent_column ]... )
a
}
O r
auditing_by_clause BY { proxy [, proxy ]...
| user [, user ]...
}
autoextend_clause AUTOEXTEND
{ OFF
| ON [ NEXT size_clause ]
[ maxsize_clause ]
}
binding_clause BINDING
(parameter_type [, parameter_type ]...)
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
m y
[ ASC | DESC ]
d e
( [ [ schema. ]table. | t_alias. ]column
a
[, [ [ schema. ]table. | t_alias. ]column
)
]...
A c
[ ASC | DESC ]
c le
FROM [ schema. ]table [ t_alias ]
[, [ schema. ]table [ t_alias ]
a
]...
r
WHERE condition
[ local_partitioned_index ]
O ly
index_attributes
l & On
a e
build_clause BUILD { IMMEDIATE | DEFERRED }
r n s
e
C_declaration C [ NAME name ]
I nt U LIBRARY lib_name
[ AGENT IN (argument[, argument ]...) ]
[ WITH CONTEXT ]
le
[ PARAMETERS (parameter[, parameter ]...) ]
a c
O r
call_spec
cancel_clause
LANGUAGE { Java_declaration | C_declaration }
m y
check_diskgroup_clauses CHECK
d e
{ ALL
| DISK
c a
A
disk_name
[, disk_name ]...
le
| DISKS IN FAILGROUP
c
failgroup_name
| FILE
r a
[, failgroup_name ]...
O ly
filename
[, filename ]...
}
l & On
[ CHECK
n a e
{ ALL
| DISK
t e r U s disk_name
[, disk_name ]...
I n | DISKS IN FAILGROUP
failgroup_name
le
[, failgroup_name ]...
| FILE
a c filename
r
[, filename ]...
}
O ]...
[ REPAIR | NOREPAIR ]
column_clauses { { add_column_clause
| modify_column_clause
| drop_column_clause
}
[ add_column_clause
| modify_column_clause
| drop_column_clause
]...
| rename_column_clause
m y
| modify_collection_retrieval
[ modify_collection_retrieval ]...
d e
| modify_LOB_storage_clause
c
| alter_varray_col_properties a
}
e A
column_properties
c l
{ object_type_col_properties
r a
| nested_table_col_properties
| { varray_col_properties | LOB_storage_clause }
O ly
[ (LOB_partition_storage
[, LOB_partition_storage ]...
l & On
]
)
n a e
| XMLType_column_properties
}
t e r U s
[ { object_type_col_properties
| nested_table_col_properties
I n | { varray_col_properties |
LOB_storage_clause }
le
[ (LOB_partition_storage
[, LOB_partition_storage ]...
a c )
O r }
]...
]
| XMLType_column_properties
compile_type_clause COMPILE
[ DEBUG ]
[ SPECIFICATION | BODY ]
[ compiler_parameters_clause
[ compiler_parameters_clause ] ... ]
[ REUSE SETTINGS ]
y
[ subpartition_by_list | subpartition_by_hash
]
( PARTITION [ partition ]
range_values_clause
e m
table_partition_description
[, PARTITION [ partition ]
a d
)
A c
range_values_clause
table_partition_description ] ...
compute_statistics_clause
c le
COMPUTE [ SYSTEM ] STATISTICS [ for_clause ]
r a
conditional_insert_clause
O ly
[ ALL | FIRST ]
WHEN condition
l & On
THEN insert_into_clause
[ values_clause ]
n a e [ error_logging_clause ]
r
[ insert_into_clause
t e U s [ values_clause ]
[ error_logging_clause ]
I n ]...
[ WHEN condition
le
THEN insert_into_clause
c
[ values_clause ]
a
[ error_logging_clause ]
O r [ insert_into_clause
[ values_clause ]
[ error_logging_clause ]
]...
]...
[ ELSE insert_into_clause
constraint { inline_constraint
| out_of_line_constraint
| inline_ref_constraint
| out_of_line_ref_constraint
}
c l
[ [ NOT ] DEFERRABLE ]
a
]
r
[ RELY | NORELY ]
[ using_index_clause ]
O ly
[ ENABLE | DISABLE ]
l & On
[ VALIDATE | NOVALIDATE ]
[ exceptions_clause ]
constructor_declaration
n a e
[ FINAL ]
t e r U s
[ INSTANTIABLE ]
CONSTRUCTOR FUNCTION datatype
le
[, parameter datatype ]...
]
r
{ IS | AS } { pl/sql_block | call_spec }
O
constructor_spec [ FINAL ]
[ INSTANTIABLE ]
CONSTRUCTOR FUNCTION datatype
[ ([ SELF IN OUT datatype, ]
d e
[ AS { file_specification
c
[, file_specification ]...a
| NEW
}
e A
]
c l
create_incomplete_type
r a
CREATE [ OR REPLACE ]
TYPE [ schema. ]type_name ;
O ly
create_mv_refresh
& On
{ REFRESH
n a e| ON { DEMAND | COMMIT }
t e r U s
| { START WITH | NEXT } date
| WITH { PRIMARY KEY | ROWID }
| USING
c le | [ MASTER | LOCAL ]
ROLLBACK SEGMENT rollback_segment
r a }
[ DEFAULT [ MASTER | LOCAL ]
O ROLLBACK SEGMENT
| [ MASTER | LOCAL ]
]...
ROLLBACK SEGMENT rollback_segment
c
TYPE [ schema. ]type_name a
A
[ OID 'object_identifier' ]
{ IS | AS } TABLE OF datatype ;
e
c l
create_object_type
a
CREATE [ OR REPLACE ]
r
TYPE [ schema. ]type_name
O ly
[ OID 'object_identifier' ]
[ invoker_rights_clause ]
l & On
{ { IS | AS } OBJECT
| UNDER [schema.]supertype
n a e }
[ sqlj_object_type ]
t e r U s[ ( attribute datatype
[ sqlj_object_type_attr ]
I n [, attribute datatype
[ sqlj_object_type_attr ]...
le
[, element_spec
[, element_spec ]...
a c ]
O r ]
)
[ [ NOT ] FINAL ]
[ [ NOT ] INSTANTIABLE ] ;
database_logging_clauses { LOGFILE
[ GROUP integer ] file_specification
[, [ GROUP integer ] file_specification
]...
| MAXLOGFILES integer
| MAXLOGMEMBERS integer
| MAXLOGHISTORY integer
| { ARCHIVELOG | NOARCHIVELOG }
| FORCE LOGGING
}
m y
d e
a
datafile_tempfile_clauses { ADD { DATAFILE | TEMPFILE }
] c
[ file_specification
[, file_specification ]...
A
TO
c le
| RENAME DATAFILE 'filename' [, 'filename' ]...
a
'filename' [, 'filename' ]...
} r
| { DATAFILE | TEMPFILE } { ONLINE | OFFLINE }
O ly
datafile_tempfile_spec [
l & On
'filename' ]
a e
[ SIZE size_clause ]
[ REUSE ]
r n [
s
autoextend_clause ]
nt e U
I
dblink database[.domain [.domain ]... ]
[ @ connect_descriptor ]
c le
dblink_authentication AUTHENTICATED BY user
r a IDENTIFIED BY password
O
deallocate_unused_clause DEALLOCATE UNUSED
[ KEEP size_clause ]
m y
default_temp_tablespace [ BIGFILE | SMALLFILE ]
d
DEFAULT TEMPORARY TABLESPACE tablespace e
[ TEMPFILE file_specification
c a
[, file_specification ]...
]
A
extent_management_clause
e
dependent_handling_clause
c l
{ INVALIDATE
r a
| CASCADE [ { [ NOT ] INCLUDING TABLE DATA
| CONVERT TO SUBSTITUTABLE
O ly ]
}
l
} & On
[ [FORCE ] exceptions_clause ]
n a e
dimension_join_clause
t e r U s
JOIN KEY
{ child_key_column
le
REFERENCES parent_level
[ JOIN KEY
a c { child_key_column
r
| (child_key_column [, child_key_column
]...)
O }
REFERENCES parent_level
]...
diskgroup_availability { MOUNT
| DISMOUNT [ FORCE | NOFORCE ]
}
m y
diskgroup_clauses { diskgroup_name
{ rebalance_diskgroup_clause
d e
| check_diskgroup_clauses
c
| diskgroup_template_clauses
a
A
| diskgroup_directory_clauses
| diskgroup_alias_clauses
le
| drop_diskgroup_file_clause
}
c
a
| { diskgroup_name | ALL }
} r
diskgroup_availability
O ly
diskgroup_directory_clauses
& On
{ ADD DIRECTORY
l filename
r
| DROP DIRECTORY
t e U s
filename [ FORCE | NOFORCE ]
[, filename [ FORCE | NOFORCE ] ]...
I n | RENAME DIRECTORY
old_dir_name TO new_dir_name
le
[, old_dir_name TO new_dir_name ]...
a c }
O r
diskgroup_file_spec [ ' {
|
|
fully_qualified_file_name
numeric_file_name
incorporate_file_name
| alias_file_name
}
c
[ referencing_clause ]
a
A
[ FOR EACH ROW ]
dml_table_expression_clause
l
{ [ schema. ]
{ table
c e
r a
[ { PARTITION (partition)
| SUBPARTITION (subpartition)
O ly
}
| @ dblink
l & On
]
| { view | materialized view } [ @ dblink ]
n a e
}
r
| ( subquery [ subquery_restriction_clause ] )
t e }
U s
| table_collection_expression
c le [ parallel_clause ]
[ PARAMETERS ('ODCI_parameters') ]
r a
drop_binding_clause DROP BINDING
O (parameter_type
[, parameter_type ]...)
[ FORCE ]
drop_constraint_clause DROP
{ { PRIMARY KEY
| UNIQUE (column [, column ]...)
}
[ CASCADE ]
[ { KEEP | DROP } INDEX ]
m y
| CONSTRAINT constraint
[ CASCADE ]
d e
}
c a
drop_disk_clauses DROP
{ DISK
e A
c l
disk_name [ FORCE | NOFORCE ]
[, disk_name [ FORCE | NOFORCE ] ]...
r a
| DISKS IN FAILGROUP
failgroup_name [ FORCE | NOFORCE ]
} O ly
[, failgroup_name [ FORCE | NOFORCE ] ]...
l & On
drop_diskgroup_file_clause
a e
DROP FILE
n
r
filename
t e U s
[, filename ]...
drop_index_partition
I n DROP PARTITION partition_name
c le
drop_logfile_clauses DROP [ STANDBY ] LOGFILE
r a { logfile_descriptor
[, logfile_descriptor ]...
O | MEMBER 'filename'
}
[, 'filename' ]...
element_spec [ inheritance_clauses ]
{ subprogram_spec
| constructor_spec
| map_order_function_spec
}
[ subprogram_clause
| constructor_spec
| map_order_function_spec
]...
[, pragma_clause ]
e
end_session_clauses
c l
{ DISCONNECT SESSION 'integer1, integer2'
a
[ POST_TRANSACTION ]
} r
| KILL SESSION 'integer1, integer2'
O ly
[ IMMEDIATE ]
estimate_statistics_clause
l & On
ESTIMATE [ SYSTEM ] STATISTICS [ for_clause ]
n a e
[ SAMPLE integer { ROWS | PERCENT } ]
exceptions_clause
t e r s
EXCEPTIONS INTO [ schema. ]table
U
I n
exchange_partition_subpart EXCHANGE { PARTITION partition
le
| SUBPARTITION subpartition
}
[ LEVEL level
)
[, dependent_column ]...
m y
DETERMINES { dependent_column
| (dependent_column
d e
)
c a
[, dependent_column ]...
]...
e A
extent_management_clause
c l
EXTENT MANAGEMENT
r a
{ DICTIONARY
| LOCAL
O ly
[ AUTOALLOCATE
| UNIFORM
l & On
]
[ SIZE size_clause ]
n a e}
t e
external_data_properties r U s
DEFAULT DIRECTORY directory
I n [ ACCESS PARAMETERS
{ (opaque_format_spec)
le
| USING CLOB subquery
}
a c ]
r
LOCATION
([ directory: ] 'location_specifier'
O ]...
)
[, [ directory: ] 'location_specifier'
file_specification { datafile_tempfile_spec
| diskgroup_file_spec
| redo_log_file_spec
}
]
{ expr | MAXVALUE }
A
| COLUMNS [ SIZE integer ]
c le
{ column | attribute } [ SIZE integer ]
[ { column | attribute }
a
[ SIZE integer ]
r]...
| ALL [ LOCAL ] INDEXES
}
O ly
l & On
[ FOR
{ TABLE
n
[ { column | attribute }
I [ SIZE integer ]
]...
r a ]...
O
for_update_clause FOR UPDATE
[ OF [ [ schema. ]
{ table | view } . ]column
[, [ [ schema. ]
fully_qualified_file_name +diskgroup_name/db_name/file_type/
y
file_type_tag.filenumber.incarnation_number
function_association { FUNCTIONS
e m
[ schema. ]function [, [ schema. ]function
]...
| PACKAGES
a d
]...
A c
[ schema. ]package [, [ schema. ]package
| TYPES
le
[ schema. ]type [, [ schema. ]type ]...
| INDEXES
c
r a
[ schema. ]index [, [ schema. ]index ]...
| INDEXTYPES
O ly
[ schema. ]indextype [, [ schema.
& On
]indextype ]...
l
}
a e
{ using_statistics_type
n
| { default_cost_clause
t e r U s [, default_selectivity_clause ]
| default_selectivity_clause
[, default_cost_clause ]
I n }
}
c le
r a
function_declaration FUNCTION name
(parameter datatype[, parameter datatype
O
]...)
RETURN datatype
{ IS | AS } { pl/sql_block | call_spec }
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
]...
]
| CONTINUE [ DEFAULT ]
| CANCEL
}
m y
global_partitioned_index GLOBAL PARTITION BY
d e
{ RANGE
c
(column_list) a
| HASH
e A
(index_partitioning_clause)
c l
(column_list)
{ individual_hash_partitions
r a| hash_partitions_by_quantity
}
}
O ly
grant_object_privileges
l & On
{ object_privilege | ALL [ PRIVILEGES ] }
n a e
[ (column [, column ]...) ]
[, { object_privilege | ALL [ PRIVILEGES ] }
n
on_object_clause
I TO grantee_clause
[ WITH HIERARCHY OPTION ]
r a
grant_system_privileges { system_privilege
O | role
| ALL PRIVILEGES
}
[, { system_privilege
group_by_clause GROUP BY
{ expr
| rollup_cube_clause
| grouping_sets_clause
}
[, { expr
| rollup_cube_clause
| grouping_sets_clause
}
]...
[ HAVING condition ]
hash_partitioning
e A
PARTITION BY HASH
c l
(column [, column ] ...)
a
{ individual_hash_partitions
} r
| hash_partitions_by_quantity
O ly
hash_partitions_by_quantity
& On
PARTITIONS hash_partition_quantity
l
[ STORE IN
r
[ OVERFLOW STORE IN
I n
hierarchical_query_clause [ START WITH condition ]
CONNECT BY [ NOCYCLE ] condition
c le
r a
hierarchy_clause HIERARCHY hierarchy
(child_level CHILD OF parent_level
O )
[ CHILD OF parent_level ]...
[ dimension_join_clause ]
index_attributes [ { physical_attributes_clause
| logging_clause
| ONLINE
| COMPUTE STATISTICS
| TABLESPACE { tablespace | DEFAULT }
| key_compression
| { SORT | NOSORT }
| REVERSE
| parallel_clause
}
[ physical_attributes_clause
| logging_clause
m y
e
| ONLINE
d
| COMPUTE STATISTICS
a
| TABLESPACE { tablespace | DEFAULT }
c
| key_compression
| { SORT | NOSORT }
| REVERSE
e A
| parallel_clause
]
]...
c l
r a
index_expr
O ly
{ column | column_expression }
index_org_overflow_clause
l & On
[ INCLUDING column_name ]
n a e
OVERFLOW
[ segment_attributes_clause ]
index_org_table_clause
t e r U s
[ { mapping_table_clause
I n | PCTTHRESHOLD integer
| key_compression
c le }
[ mapping_table_clause
r a | PCTTHRESHOLD integer
| key_compression
O
]...
]
[ index_org_overflow_clause ]
index_properties [ { { global_partitioned_index
| local_partitioned_index
}
| index_attributes
}
[ { { global_partitioned_index
| local_partitioned_index
}
| index_attributes
m y
}
]...
d e
| domain_index_clause
]
c a
index_subpartition_clause
e A
{ STORE IN (tablespace[, tablespace ]...)
c l
| (SUBPARTITION
[ subpartition [ TABLESPACE tablespace ] ]
r a
[, SUBPARTITION
[ subpartition [ TABLESPACE tablespace
] ]
O ly
]...
}
l
)
& On
n a e
individual_hash_partitions
t e r U s
(PARTITION
[ partition partitioning_storage_clause ]
I n [, PARTITION
[ partition partitioning_storage_clause
le
]
]...
a c )
O r
inheritance_clauses [ NOT ] { OVERRIDING | FINAL | INSTANTIABLE }
[ [ NOT ] { OVERRIDING | FINAL | INSTANTIABLE
} ]...
inner_cross_join_clause table_reference
{ [ INNER ] JOIN table_reference
{ ON condition
| USING (column [, column ]...)
}
| { CROSS
| NATURAL [ INNER ]
}
m y
}
JOIN table_reference
d e
insert_into_clause
c a
INTO dml_table_expression_clause [ t_alias ]
A
[ (column [, column ]...) ]
e
integer
c l
[ + | - ] digit [ digit ]...
interval_day_to_second INTERVAL
r a
O ly
'{ integer | integer time_expr | time_expr }'
{ { DAY | HOUR | MINUTE }
l & On
[ (leading_precision) ]
| SECOND
n a e
[ (leading_precision
t e r U]s)
[, fractional_seconds_precision ]
I n }
[ TO { DAY | HOUR | MINUTE | SECOND
c le }
[ (fractional_seconds_precision) ]
r a ]
O
interval_year_to_month INTERVAL 'integer [- integer ]'
{ YEAR | MONTH } [ (precision) ]
[ TO { YEAR | MONTH } ]
c
list_values_clause a
]...
e A
table_partition_description
c l
list_values_clause
r a
VALUES ({ value | NULL
[, { value | NULL }...)
O ly
| DEFAULT
l & On )
LOB_parameters
n a e
{ TABLESPACE tablespace
t e r |
|
U
| s
{ ENABLE | DISABLE } STORAGE IN ROW
storage_clause
CHUNK integer
I n |
|
PCTVERSION integer
RETENTION
c le |
|
FREEPOOLS integer
{ CACHE
O }
[ TABLESPACE tablespace
| { ENABLE | DISABLE } STORAGE IN ROW
| storage_clause
LOB_storage_clause LOB
m y
e
{ (LOB_item [, LOB_item ]...)
STORE AS (LOB_parameters)
| (LOB_item)
a d
c
STORE AS
{ LOB_segname (LOB_parameters)
e A
| LOB_segname
| (LOB_parameters)
}
}
c l
r a
local_partitioned_index
O ly
LOCAL
[ on_range_partitioned_table
l & On
| on_list_partitioned_table
| on_hash_partitioned_table
n a e
| on_comp_partitioned_table
]
logfile_clause
t e r U s
LOGFILE
c le
logfile_clauses { { ARCHIVELOG [ MANUAL ]
r a | NOARCHIVELOG
}
O | [ NO ] FORCE LOGGING
| RENAME FILE 'filename'
[, 'filename' ]...
TO 'filename'
d e
map_order_func_declaration
c a
{ MAP | ORDER } MEMBER function_declaration
map_order_function_spec A
{ MAP | ORDER } MEMBER function_spec
e
mapping_table_clauses
c l
{ MAPPING TABLE | NOMAPPING }
r a
materialized_view_props [
[
O ly
column_properties ]
table_partitioning_clauses ]
l
[
[& On
CACHE | NOCACHE ]
parallel_clause ]
n a e
[ build_clause ]
t e
maximize_standby_db_clauser U s
SET STANDBY DATABASE TO MAXIMIZE
n
{ PROTECTION | AVAILABILITY | PERFORMANCE }
I
cle
maxsize_clause MAXSIZE { UNLIMITED | size_clause }
r a
merge_insert_clause WHEN NOT MATCHED THEN
O
INSERT [ (column [, column ]...) ]
VALUES ({ expr [, expr ]... | DEFAULT })
[ where_clause ]
model_clause MODEL
[ cell_reference_options ]
[ return_rows_clause ]
[ reference_model ]
[ reference_model ]...
main_model
m y
model_column expr [ [ AS ] c_alias ]
d e
model_column_clauses
c a
[ query_partition_clause [ c_alias ] ]
A
DIMENSION BY (model_column
[, model_column ]...)
le
MEASURES (model_column
c [, model_column ]...)
model_rules_clause
r
RULES a
O ly
[ UPSERT | UPDATE ]
[ { AUTOMATIC | SEQUENTIAL } ORDER ]
l & On
[ ITERATE (number) [ UNTIL (condition) ] ]
([ UPDATE | UPSERT ]
t e r U s
[ [ UPDATE | UPSERT ]
cell_assignment [ order_by_clause ] = expr
]...
I n )
cle
modify_col_properties ( column [ datatype ]
[ DEFAULT expr ]
r a [ inline_constraint
[ inline_constraint ]... ]
O [ LOB_storage_clause ]
[, column [ datatype ]
[ DEFAULT expr ]
[ inline_constraint
m y
modify_hash_subpartition { {
|
allocate_extent_clause
deallocate_unused_clause
d e
|
|
shrink_clause
c
{ LOB LOB_item a
}
e A
| VARRAY varray
c l
modify_LOB_parameters
[ { LOB LOB_item
r a | VARRAY varray
}
O ly modify_LOB_parameters
]...
l & On
}
| [ REBUILD ] UNUSABLE LOCAL INDEXES
n a e
}
t e r
modify_index_default_attrs
U s
MODIFY DEFAULT ATTRIBUTES
le
| TABLESPACE { tablespace | DEFAULT }
| logging_clause
a c }
O r [ physical_attributes_clause
| TABLESPACE { tablespace | DEFAULT }
| logging_clause
]...
m y
modify_list_partition MODIFY PARTITION partition
d e
{ partition_attributes
c
| {ADD | DROP} VALUES a
A
(partition_value[, partition_value ]...)
| [ REBUILD ] UNUSABLE LOCAL INDEXES
e
}
c l
modify_list_subpartition {
| r a
allocate_extent_clause
deallocate_unused_clause
|
O ly
shrink_clause
|
l & On
{ LOB LOB_item | VARRAY varray }
modify_LOB_parameters
t e r U s ] ...
| [ REBUILD ] UNUSABLE LOCAL INDEXES
n
| { ADD | DROP } VALUES (value[, value ]...)
I }
c le
modify_LOB_parameters { storage_clause
r a |
|
PCTVERSION integer
RETENTION
O |
|
|
FREEPOOLS integer
REBUILD FREEPOOLS
{ CACHE
| { NOCACHE | CACHE READS } [ logging_clause ]
}
[ storage_clause
| PCTVERSION integer
| RETENTION
| FREEPOOLS integer
| REBUILD FREEPOOLS
| { CACHE
| { NOCACHE | CACHE READS } [ logging_clause
]
}
| allocate_extent_clause
| deallocate_unused_clause
| shrink_clause
]...
c
| COALESCE SUBPARTITION a
e A
[ update_index_clauses ]
[ parallel_clause ]
c l
| alter_mapping_table_clause
| [ REBUILD ] UNUSABLE LOCAL INDEXES
}
r a
modify_table_default_attrs
O ly
MODIFY DEFAULT ATTRIBUTES
l & On
[ FOR PARTITION partition ]
[ segment_attributes_clause ]
n a e [ table_compression ]
[ PCTTHRESHOLD integer ]
t e r U s[ key_compression ]
[ alter_overflow_clause ]
n
[ { LOB (LOB_item)
I | VARRAY varray
le
}
(LOB_parameters)
a c [ { LOB (LOB_item)
r
| VARRAY varray
}
O ]
(LOB_parameters)
]...
m y
move_table_partition MOVE
[
PARTITION partition
MAPPING TABLE ]
d e
[
[
table_partition_description ]
c
update_index_clauses ]
a
A
[ parallel_clause ]
move_table_subpartition
le
MOVE SUBPARTITION
c
subpartition_spec
r a
[ update_index_clauses ]
[ parallel_clause ]
O ly
multi_column_for_loop
& On
FOR (dimension_column
l [, dimension_column ]...)
n a e
IN ( { (literal [, literal ]...)
[ (literal [, literal ]...)... ]
t e r U s
| subquery
}
n
)
I
le
multi_table_insert { ALL insert_into_clause
c
[ values_clause ]
a
[ insert_into_clause
O r [ values_clause ]
]...
| conditional_insert_clause
}
subquery
multiset_intersect nested_table1
MULTISET INTERSECT [ ALL | DISTINCT ]
nested_table2
multiset_union nested_table1
MULTISET UNION [ ALL | DISTINCT ]
nested_table2
d e
[ RETURN AS { LOCATOR | VALUE } ]
c a
new_values_clause
A
{ INCLUDING | EXCLUDING } NEW VALUES
e
number [
c
+ | - ]
l
{
]
a
digit [ digit ]... [ . ] [ digit [ digit ]...
r
|
}
O ly
. digit [ digit ]...
l
[ & On
e [ + | - ] digit [ digit ]... ]
f | d ]
n a e
numeric_file_name
t e r s
+diskgroup_name.filenumber.incarnation_number
U
object_properties
I n { {
[
column | attribute }
DEFAULT expr ]
le
[ inline_constraint [ inline_constraint ]...
| inline_ref_constraint
a c ]
O r | {
|
|
}
out_of_line_constraint
out_of_line_ref_constraint
supplemental_logging_props
c
[, { out_of_line_constraint
| attribute inline_constraint
A [ inline_constraint ]...
}
]...
c le
a
)
OID_clause r
O ly
OBJECT IDENTIFIER IS
& On
{ SYSTEM GENERATED | PRIMARY KEY }
OID_index_clause l
a e
OIDINDEX [ index ]
r n ({ physical_attributes_clause
s
e
| TABLESPACE tablespace
I nt U
}
[ physical_attributes_clause
| TABLESPACE tablespace
le
]...
c
)
r a
on_comp_partitioned_table [ STORE IN ( tablespace [, tablespace ]... ) ]
O ( PARTITION
[ partition
[ { segment_attribute_clause
| key_compression
}
)
c a
e A
on_list_partitioned_table ( PARTITION
c l
[ partition
r a
[ { segment_attributes_clause
| key_compression
O ly}
[ segment_attributes_clause
l & On | key_compression
]...
n a e ]
]
t e r U s
[, PARTITION
[ partition
I n [ { segment_attributes_clause
| key_compression
le
}
[ segment_attributes_clause
a c | key_compression
O r ]...
]
]
]...
on_range_partitioned_table ( PARTITION
[ partition
[ { segment_attributes_clause
| key_compression
}
[ segment_attributes_clause
| key_compression
]...
]
]
[, PARTITION
[ partition
[ { segment_attributes_clause
| key_compression
}
[ segment_attributes_clause
]
| key_compression
]...
m y
]...
]
d e
)
c a
order_by_clause
A
ORDER [ SIBLINGS ] BY
{ expr | position | c_alias }
e
c l
[ ASC | DESC ]
[ NULLS FIRST | NULLS LAST ]
r a
[, { expr | position | c_alias }
[ ASC | DESC ]
O ly
[ NULLS FIRST | NULLS LAST ]
]...
l & On
a e
out_of_line_constraint [ CONSTRAINT constraint_name ]
n
{ UNIQUE (column [, column ]...)
t e r |
|
s
PRIMARY KEY (column [, column ]...)
FOREIGN KEY (column [, column ]...)
U references_clause
I n | CHECK (condition)
}
c le [ constraint_state ]
r a
out_of_line_ref_constraint { SCOPE FOR
({ ref_col | ref_attr })
O | REF
IS [ schema. ]scope_table
({ ref_col | ref_attr })
WITH ROWID
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 ]...)
]
parallel_enable_clause PARALLEL_ENABLE
m y
[ (PARTITION argument BY
{ ANY
d e
}
c a
| { HASH | RANGE } (column [, column ]...)
A
)
[ streaming_clause ]
]
c le
partial_database_recovery
r a
{ TABLESPACE tablespace [, tablespace ]...
| DATAFILE { 'filename' | filenumber }
& On
}
l
| STANDBY
a e
{ TABLESPACE tablespace [, tablespace ]...
n
| DATAFILE { 'filename' | filenumber }
t e r }
U s }
[, 'filename' | filenumber ]...
I n }
UNTIL [ CONSISTENT WITH ] CONTROLFILE
c le
r a
partition_attributes [ {
|
physical_attributes_clause
logging_clause
O |
|
|
}
allocate_extent_clause
deallocate_unused_clause
shrink_clause
]
modify_LOB_parameters
]...
m y
d e
partition_extended_name [ schema.] { table | view }
c
[ PARTITION (partition)
a
A
| SUBPARTITION (subpartition)
]
c le
partition_level_subpartition { SUBPARTITIONS hash_subpartition_quantity
r a
[ STORE IN (tablespace[, tablespace ]...) ]
| (subpartition_spec[, subpartition_spec ]...)
}
O ly
partition_spec
l & On
PARTITION [ partition ]
a e
[ table_partition_description ]
r
partitioning_storage_clause n s
[ { TABLESPACE tablespace
nt e U
| OVERFLOW [ TABLESPACE tablespace ]
| LOB (LOB_item) STORE AS
le
| (TABLESPACE tablespace)
}
r
}
[ { TABLESPACE tablespace
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 }
}
c
flashback_mode_clause a
e A
[ MINIMUM EXTENT integer [ K | M ]
| BLOCKSIZE integer [ K ]
c l
| logging_clause
| FORCE LOGGING
r a
| DEFAULT [ table_compression ]
storage_clause
O ly
| { ONLINE | OFFLINE }
| extent_management_clause
l & On
| segment_management_clause
| flashback_mode_clause
n a e ]...
t e r
physical_attributes_clause
U
}
s
[ { PCTFREE integer
I n |
|
PCTUSED integer
INITRANS integer
le
| storage_clause
a c }
[ PCTFREE integer
O r | PCTUSED integer
| INITRANS integer
| storage_clause
]...
]
c
(parameter datatype [, parameter datatype ]...)
[ { IS | AS } call_spec ]
A
proxy_authentication
le
{ AUTHENTICATION REQUIRED
c
| AUTHENTICATED USING
r a
{ PASSWORD
| DISTINGUISHED NAME
O ly
| CERTIFICATE [ TYPE 'type' ]
& On
[ VERSION 'version' ]
l
}
a e
}
r n s
e
proxy_clause { GRANT | REVOKE }
le
| ALL EXCEPT role_name
c
[, role_name ]...
a
}
O r ]
| NO ROLES
}
[ proxy_authentication ]
qualified_template_clause template_name
ATTRIBUTES
([ MIRROR | UNPROTECTED ]
[ FINE | COARSE ]
)
query_partition_clause PARTITION BY
{ value_expr[, value_expr ]...
| ( value_expr[, value_expr ]... )
query_table_expression { query_name
| [ schema. ]
{ table [ { PARTITION (partition)
| SUBPARTITION (subpartition)
}
[ sample_clause ]
| [ sample_clause ]
| @ dblink
m y
]
d e
| { view | materialized view } [ @ dblink ]
a
}
c
| (subquery [ subquery_restriction_clause ])
| table_collection_expression
}
A
quiesce_clauses
c le
QUIESCE RESTRICTED | UNQUIESCE
r a
range_partitioning
O ly
PARTITION BY RANGE (column[, column ]...)
(PARTITION [ partition ]
l & On
range_values_clause
table_partition_description
n a e
[, PARTITION [ partition ]
r
range_values_clause
t e U s table_partition_description
]...
I n )
cle
range_values_clause VALUES LESS THAN
({ value | MAXVALUE }
r a )
[, { value | MAXVALUE } ]...
O
rebalance_diskgroup_clause REBALANCE [ POWER integer ]
m y
records_per_block_clause
e
{ MINIMIZE | NOMINIMIZE } RECORDS_PER_BLOCK
d
recover_clause
c
{ { DISCONNECT [ FROM SESSION ] a
}
e A
| { TIMEOUT integer | NOTIMEOUT }
c l
| { NODELAY | DEFAULT DELAY | DELAY integer }
| NEXT integer
r a
| { EXPIRE integer | NO EXPIRE }
| parallel_clause
O ly
| USING CURRENT LOGFILE
| UNTIL CHANGE integer
l & On
| THROUGH { [ THREAD integer ] SEQUENCE integer
| ALL ARCHIVELOG
t e r U
}
s[ { DISCONNECT [ FROM SESSION ]
le
| { NODELAY | DEFAULT DELAY | DELAY integer }
| NEXT integer
O r | parallel_clause
| USING CURRENT LOGFILE
| UNTIL CHANGE integer
| THROUGH { [ THREAD integer ] SEQUENCE
integer
| ALL ARCHIVELOG
recovery_clauses { general_recovery
| managed_standby_recovery
| BEGIN BACKUP
| END BACKUP
}
redo_log_file_spec [ 'filename'
| ('filename' [, 'filename' ]...)
]
[ SIZE size_clause ]
[ REUSE ]
e
c l
[ON DELETE { CASCADE | SET NULL } ]
[ constraint_state ]
r a
referencing_clause
O ly
REFERENCING
{ OLD [ AS ] old
l & On
| NEW [ AS ] new
| PARENT [ AS ] parent }
n a e
[ OLD [ AS ] old
| NEW [ AS ] new
t e r U s
| PARENT [ AS ] parent ]...
I n
register_logfile_clause REGISTER
[ OR REPLACE ]
c le [ PHYSICAL | LOGICAL ]
LOGFILE
r a [ file_specification
[, file_specification ]...
O ]
FOR logminer_session_name
d e
[ ON COMMIT { DELETE | PRESERVE } ROWS ]
[ physical_properties ]
c
[ table_properties ] ; a
e A
rename_column_clause
l
RENAME COLUMN old_name TO new_name
c
rename_index_partition
r a
RENAME { PARTITION partition
| SUBPARTITION subpartition }
O ly
TO new_name
l & On
a e
rename_partition_subpart RENAME { PARTITION | SUBPARTITION }
current_name TO new_name
r n s
replace_type_clause
nt e U
REPLACE [ invoker_rights_clause ] AS OBJECT
I
(attribute datatype [, attribute datatype
]...
le
[, element_spec [, element_spec ]... ])
a c
O r
resize_disk_clauses RESIZE
{ ALL [ SIZE size_clause ]
| DISK
disk_name [ SIZE size_clause ]
[, disk_name [ SIZE size_clause ] ]...
| DISKS IN FAILGROUP
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 }
}
y
| sqlj_object_type_sig
}
e m
d
return_rows_clause RETURN { UPDATED | ALL } ROWS
returning_clause
c
RETURNING expr [, expr ]... a
A
INTO data_item [, data_item ]...
e
revoke_object_privileges
c l
{ object_privilege | ALL [ PRIVILEGES ] }
a
[, { object_privilege | ALL [ PRIVILEGES ] }
]...
r
on_object_clause
O ly
FROM grantee_clause
& On
[ CASCADE CONSTRAINTS | FORCE ]
l
revoke_system_privileges
n a e
{ system_privilege
t e r | role
s
| ALL PRIVILEGES
U
}
I n [, { system_privilege
| role
le
| ALL PRIVILEGES
a c }
]...
O r
rollup_cube_clause
FROM grantee_clause
m y
searched_case_expression WHEN condition THEN return_expr
d e
a
[ WHEN condition THEN return_expr ]...
c
security_clause
A
GUARD { ALL | STANDBY | NONE }
e
segment_attributes_clause
c l
{ physical_attributes_clause
r a
| TABLESPACE tablespace
| logging_clause
}
O ly
[ physical_attributes_clause
l & On
| TABLESPACE tablespace
| logging_clause
n a e ]...
t e
segment_management_clause r U s
SEGMENT SPACE MANAGEMENT { MANUAL | AUTO }
select_list
I n { *
c le | { query_name.*
| [ schema. ]
O }
[, { query_name.*
| [ schema. ]
{ table | view | materialized view } .*
m y
shutdown_dispatcher_clause SHUTDOWN [ IMMEDIATE ] dispatcher_name
d e
simple_case_expression expr WHEN comparison_expr
c
THEN return_expr a
e A
[ WHEN comparison_expr
THEN return_expr ]...
c l
single_column_for_loop
a
FOR dimension_column
r
{ IN ( { literal
O ly [, literal ]...
| subquery
l & On )
}
n a e | [ LIKE pattern ]
t e r U s}
FROM literal TO literal
{ INCREMENT | DECREMENT } literal
I n
le
single_table_insert insert_into_clause
{ values_clause [ returning_clause ]
a c | subquery
O r
size_clause
}
integer [ K | M | G | T ]
m y
sql_statement_clause { { statement_option | ALL }
[, { statement_option | ALL } ]...
d e
c a
| { system_privilege | ALL PRIVILEGES }
[, { system_privilege | ALL PRIVILEGES } ]...
A
}
[ auditing_by_clause ]
sqlj_object_type
c le
EXTERNAL NAME java_ext_name LANGUAGE JAVA
a
USING (SQLData | CustomDatum | OraData)
r
sqlj_object_type_attr
O ly
EXTERNAL NAME 'field_name'
sqlj_object_type_sig
l & On
RETURN { datatype | SELF AS RESULT }
n a e
EXTERNAL { VARIABLE NAME
r
'java_static_field_name'
t e U s | NAME 'java_method_sig'
}
I n
standby_database_clauses ( activate_standby_db_clause
c le |
|
maximize_standby_db_clause
register_logfile_clause
r a |
|
commit_switchover_clause
start_standby_clause
O |
)
[
stop_standby_clause
parallel_clause ]
storage_clause STORAGE
({ INITIAL integer [ K | M ]
y
| NEXT integer [ K | M ]
| MINEXTENTS integer
| MAXEXTENTS { integer | UNLIMITED }
| PCTINCREASE integer
e m
| FREELISTS integer
| FREELIST GROUPS integer
a d
A c
| OPTIMAL [ integer [ K | M ]
| NULL
]
le
| BUFFER_POOL { KEEP | RECYCLE | DEFAULT }
}
c
r a
[ INITIAL integer [ K | M ]
| NEXT integer [ K | M ]
O ly
| MINEXTENTS integer
| MAXEXTENTS { integer | UNLIMITED }
r
| OPTIMAL [ integer [ K | M ]
t e U s | NULL
]
le
)
a c
streaming_clause { ORDER | CLUSTER } BY (column [, column ]...)
O r
subpartition_by_hash SUBPARTITION BY HASH (column [, column ]...)
[ SUBPARTITIONS quantity
[ STORE IN (tablespace [, tablespace
]...) ]
c a
subprogram_spec
A
{ MEMBER | STATIC }
e
l
{ procedure_spec | function_spec }
c
subquery
r a
[ subquery_factoring_clause ]
SELECT
O ly
[ hint ]
l & On
[ { { DISTINCT | UNIQUE }
| ALL
n a e
]
}
t e r s
select_list
FROM table_reference
U [, table_reference ]...
I n [ where_clause ]
[ hierarchical_query_clause ]
c le [ group_by_clause ]
[ HAVING condition ]
r a [ model_clause ]
[ { UNION [ ALL ]
O | INTERSECT
| MINUS
}
(subquery)
supplemental_id_key_clause DATA
({ ALL
| PRIMARY KEY
| UNIQUE
| FOREIGN KEY
}
m y
[, { ALL
| PRIMARY KEY
d e
| UNIQUE
c
| FOREIGN KEY a
]...
}
e A
)
COLUMNS
c l
r a
supplemental_log_grp_clause
O ly
GROUP log_group
(column [ NO LOG ]
l & On
[, column [ NO LOG ] ]...)
[ ALWAYS ]
n a e
t e r
supplemental_logging_props
U s
{ supplemental_log_grp_clause
| supplemental_id_key_clause
n
}
I
cle
supplemental_table_logging { ADD SUPPLEMENTAL LOG
{ supplemental_log_grp_clause
r a | supplemental_id_key_clause
}
O [, SUPPLEMENTAL LOG
{ supplemental_log_grp_clause
| supplemental_id_key_clause
}
table_partition_description [
[
segment_attributes_clause ]
table_compression | key_compression ]
m y
[
[ { LOB_storage_clause
d e
OVERFLOW [ segment_attributes_clause ] ]
| varray_col_properties
}
c a
e A
[ LOB_storage_clause
| varray_col_properties
]
]...
c l
r a
[ partition_level_subpartition ]
table_partitioning_clauses { O ly
range_partitioning
|
|
l & On
hash_partitioning
list_partitioning
n
|
a ecomposite_partitioning
r
}
t e U s
table_properties
I n [
[
column_properties ]
table_partitioning_clauses ]
le
[ CACHE | NOCACHE ]
[ parallel_clause ]
a c [ ROWDEPENDENCIES | NOROWDEPENDENCIES ]
O r [ enable_disable_clause ]
[ enable_disable_clause ]...
[ row_movement_clause ]
[ AS subquery ]
m y
tablespace_logging_clauses { logging_clause
| [ NO ] FORCE LOGGING
d e
a
}
tablespace_retention_clause
A c
RETENTION { GUARANTEE | NOGUARANTEE }
tablespace_state_clauses {
c
ONLINE le
|
} a
OFFLINE [ NORMAL | TEMPORARY | IMMEDIATE ]
r
|
| O ly
READ { ONLY | WRITE }
{ PERMANENT | TEMPORARY }
l & On
temporary_tablespace_clause
n a e
TEMPORARY TABLESPACE tablespace
[ TEMPFILE file_specification
t e r U s
]
[, file_specification ]...
I n [ tablespace_group_clause ]
[ extent_management_clause ]
text
c le [ N | n ]
r a { 'c [ c ]...'
| { Q | q }
O }
'quote_delimiter c [ c ]... quote_delimiter'
m y
undrop_disk_clause UNDROP DISKS
d e
update_all_indexes_clause UPDATE INDEXES
c a
[ (index ( { update_index_partition
}
e A
| update_index_subpartition
)
)
c l
r a
[, (index ( { update_index_partition
| update_index_subparition
O ly )
}
l & On )
]...
n a e
update_global_index_clause
t e r s
{ UPDATE | INVALIDATE } GLOBAL INDEXES
U
update_index_clauses
I n { update_global_index_clause
| update_all_indexes_clause
c le }
r a
update_index_partition PARTITION [ partition ]
[ index_partition_description
O ]
[ index_subpartition_clause ]
[, PARTITION [ partition ]
[ index_partition_description
update_set_clause SET
{ { (column [, column ]...) = (subquery)
| column = { expr | (subquery) | DEFAULT }
}
[, { (column [, column]...) = (subquery)
| column = { expr | (subquery) | DEFAULT
}
}
]...
| VALUE (t_alias) = { expr | (subquery) }
}
c l
{ [ schema. ]index
r a
| (create_index_statement)
| index_properties
}
O ly
using_statistics_type
l & On
USING { [ schema. ] statistics_type | NULL }
n a e
using_type_clause
t e r s
USING [ schema. ]implementation_type
[ array_DML_clause ]
U
validation_clauses I n { VALIDATE REF UPDATE
r a [ CASCADE ]
[ into_clause ]
O }
{ OFFLINE| ONLINE }
c le
XML_attributes_clause
a
XMLATTRIBUTES
r
(value_expr [ AS c_alias ]
)O ly
[, value_expr [ AS c_alias ]...
l & On
XMLSchema_spec
n a e
[ XMLSCHEMA XMLSchema_URL ]
ELEMENT { element | XMLSchema_URL # element }
t e
XMLType_column_properties r U s
XMLTYPE [ COLUMN ] column
I n [ XMLType_storage ]
[ XMLSchema_spec ]
c le
XMLType_storage STORE AS
r a { OBJECT RELATIONAL
| CLOB [ { LOB_segname [ (LOB_parameters) ]
O ]
| LOB_parameters
}
XMLType_view_clause OF XMLTYPE
[ XMLSchema_spec ]
WITH OBJECT IDENTIFIER
{ DEFAULT | ( expr [, expr ]...) }
m y
d e
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I C - 83
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
_________________
Appendix D
Acronyms and
Terms
_________________
m y
d e
ca
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
Term Definition
Active session pool Number of current active sessions allowed for a resource group or
subplan
ADDM Automatic Database Diagnostic Monitor
ASM Automatic Storage Management
ASM Automatic Summary Management
ASMM Automatic Shared Memory Management
ASSM Automatic Segment Space Management
ATO Automatic Tuning Optimizer
Automatic PGA Memory A feature of the Oracle database that simplifies and improves the
Management way PGA memory is allocated
Automatic Shared A feature of the Oracle database that automates the management
Memory Management of the most important shared memory structures used by an
Oracle database instance
Automatic Storage A mechanism that provides a vertical integration of the file
Management system and the volume manager, specifically built for the Oracle
database files
Automatic Database A utility that performs a top-down instance analysis, identifies
Diagnostic Management problems and potential causes, and makes recommendations for
Automatic Tuning
fixing the problems
A database feature that performs various analyses of SQL
m y
Optimizer
Automatic Workload
performance within the database
d e
An infrastructure that collects, processes, and maintains
Repository
a
performance statistics for problem detection and self-tuning
purposes c
Auxiliary database A
A database that is used when creating a duplicate database or
e
AWR
c l
performing tablespace point-in-time recovery
Automatic Workload Repository
Backup piece
r a
An individual file that is part of a backup set
Backup set
O ly
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
& On
A feature that uses the change tracking writer (CTWR)
l
n a e
background process to record the physical location of all database
changes in a separate file
Block corruption
t e r U s
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
O
CFS
database
Cluster File Storage
DBCA
block within the database
Database Configuration Assistant
m y
DBVERIFY
e
An external command-line utility that performs a physical data
structure integrity check on an offline database
d
DDL
a
Data definition language. It is the class of SQL statements that
c
define and manipulate database objects.
DML A
Data manipulation language. It is the class of SQL statements that
e
EM
c
Enterprise Manager l
query and manipulate data.
emctl
r a
Enterprise Manager Control. It is a utility for starting, stopping,
and checking the status of Database Control, the Oracle Agent,
O ly
and Oracle Management servers.
Encoded character set
& On
A character set that maps numeric codes to characters that a
l
computer or terminal can display and receive
Enterprise Manager
n a e
A graphical interface used to manage the database
Database Control Console
EXTPROC
t e r U s
External code libraries
FGA
FGAC I n Fine-grained auditing
Fine-Grained Access Control
c le
Flash recovery area A unified storage location for all recovery-related files and
r a
Flashback buffer
activities in an Oracle database
An area in memory that stores Flashback Database data
O
Flashback Database A new recovery method that uses Undo data, instead of Redo
data, to recover the database
Index-organized tables
as the necessary redo is available.
y
A database structure that has the appearance of a table but stores
m
init.ora or
its data in a B*Tree structure
d e
The initialization parameter file that controls how the database
init<sid>.ora
“parameter file”. c a
instance is configured and run at startup time. Also known as
e A
Instance
l
The collection of shared memory and processes used to access the
Oracle database
c
IPC
r a
Internal Process Communication
Control utility for starting and stopping iSQL*Plus listener
isqlplusctl
processes O ly
ISV
Java pool l & On
Independent software vendor
A region of memory in the SGA that is used for all session-
n a e
specific Java code and data within the Java Virtual Machine
JDBC
t e r
(JVM)
U s
Java Database Connectivity
jnnn
Keep buffer cache I n Job Queue Processes. They execute scheduled jobs.
An area of memory in the SGA used to cache data in the buffer
c le
Language and Character
cache for longer periods of time
A statistic-based utility for determining the language and
r a
Set File Scanner character set for unknown file text
O
Large pool
LCSSCAN
An optional memory storage area used for buffering large I/O
requests
Language and Character Set File Scanner
d e
Management Monitor Process. This process issues alerts
c a
whenever a metric violates its threshold value. It captures
statistics for SQL objects that have been recently modified.
National Language
A
Parameters and files that determine the locale-specific behavior of
e
Support
nK block size buffer
c l
the database client and the database server
A region of memory in the SGA, which caches data blocks that
r a
are of a different size than the default database block size. It is
used to support transportable tablespaces.
NLS O ly
National Language Support
NLS Runtime Library
& On
A comprehensive suite of language-independent functions that
l
allow proper text and character processing and language-
a e
convention manipulations
n
NLS_LANG
t e r U s
An environment variable used to specify the language, territory,
and character set used by a database
NLSRTL
NMP I n National Language Support Runtime Library
Named Pipes
OC4J
OMF c le Oracle Application Server Containers for J2EE
Oracle Managed Files
r a
Optimizer statistics Statistics that describe the database and the objects in the
O
OUI
database, and are used by the query optimizer to choose the best
execution plan for each SQL statement
Oracle Universal Installer
Parallelization
by the package body.
Allocation of multiple channels for RMAN backup and recovery
operations m y
PGA Program Global Area
d e
PGA Advisor
a
A feature of Enterprise Manager that gives detailed statistics for
c
the work areas and provides recommendations about optimal
e A
usage of Program Global Area (PGA) memory on the basis of
workload characteristics
Pipe
c l
An area of memory used by one process to pass information to
c
Recycle bin le
Recovery Manager The Oracle utility used to back up and restore database files
A data dictionary table that maintains the relationships between
O
Recycle buffer cache
names
A region of memory in the SGA, which holds data that is quickly
aged out of the buffer cache
Server sessions
d e
The server processes (UNIX) or threads (Windows NT/2000)
Session memory
c a
invoked by a client utility to connect to the target database
Memory in the PGA that is allocated to hold session variables and
A
other information related to the session
e
SGA
l
System Global Area. It is the memory area shared by all server
c
and background processes.
SGA Advisor
a
An advisor that makes recommendations for SGA-related
r
parameter settings
Shared pool O ly
A region of memory that caches various constructs that can be
Shrink Advisor
l & On
shared among users
See the Segment Advisor.
SID a e
System Identifier. It defaults to the database name and uniquely
n
SQL
t r U s
identifies the instance on a given server.
e
Structured Query Language
SQL Access Advisor
I nA tool that determines optimal data access path (for example, the
use of indexes and materialized views)
Statspack c le
SQL Tuning Advisor A tool that provides tuning advice for SQL statements
A set of SQL, PL/SQL, and SQL*Plus scripts that allow the
O
Streams pool
This feature has been replaced by the Automatic Workload
Repository.
An optional region of memory in the SGA that is used by Oracle
Streams
d
joins, and other operations that are memory intensive
Workload repository See AWR.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
Oracle Database 11g: Administration Workshop I D - 8
Next Steps:
Continuing Your Education
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
Where Do You Go from Here?
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
c a
Oracle University
e A
c l
Oracle University is the world’s largest corporate educator with education centers around the
r a
globe. The goal is 100% student satisfaction.
O ly
Oracle certifications are tangible, industry-recognized credentials that provide measurable
a e
• Oracle Certified Associate (OCA)
n
t e r U s
• Oracle Certified Professional (OCP)
• Oracle Certified Master (OCM), and
I n
• Specialty certifications, for example, Oracle 10g: Managing Oracle on Linux Certified
Expert
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Continuing Your Education
e A
c l
The Oracle Database 11g: Administration Workshop II course continues your training as a
r a
database administrator. You cover advanced database recovery strategies, performance
O ly
monitoring and tuning, and distributed data concepts.
l & On
In this course, SQL and PL/SQL are discussed. Because both of these topics are vast, you are
provided with only an overview. You can find additional training on these topics that can
a e
enhance your abilities as an administrator.
n
e r s
Oracle recommends that you complete the Oracle Database 11g: Administration Workshop II
t U
course, before beginning specialty courses.
I n
Consult Oracle University’s website for an up-to-date list of all courses. Other specialty
le
courses include:
c
r a
• Oracle Database 11g: Security
• Oracle Database 11g: Implement and Administer a Data Warehouse
O
c a
e A
c l
r a
O ly
l & On
n a e
t e r U s
I n
c le
ra
O
• Consolidating different
workloads to a single
grid
• Virtualizing the
information platform Databases
• Flexible physical
infrastructure (including
dedicated servers)
y
Storage
m
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Why use RAC?
e A
c l
Oracle Real Application Clusters (RAC) enables high utilization of a cluster of standard, low-
r a
cost modular servers such as blades. RAC offers automatic workload management for services.
O ly
Services are groups or classifications of applications that comprise business components
corresponding to application workloads. Services in RAC enable continuous, uninterrupted
l & On
database operations and provide support for multiple services on multiple instances. You
a e
assign services to run on one or more instances, and alternate instances can serve as backup
n
t e r U s
instances. If a primary instance fails, Oracle moves the services from the failed instance to a
surviving alternate instance. Oracle also automatically load-balances connections across
I n
instances hosting a service.
c le
RAC harnesses the power of multiple low-cost computers to serve as a single large computer
for database processing, and provides the only viable alternative to large-scale SMP boxes for
r a
all types of applications. RAC, which is based on a shared-disk architecture, can grow and
O
shrink on demand without the need to artificially partition data among the servers of your
cluster. RAC also offers a single-button addition and removal of servers to a cluster. Thus, you
can easily provide or remove a server to or from the database.
Physical/ Snapshot
standby with the
changes queued
Observer: Initiating
fast-start failover
c a
Oracle Data Guard
e A
c l
Oracle Data Guard is a management, monitoring, and automation software infrastructure that
r a
works with a production database and one or more standby databases to protect your data
O ly
against failures, errors, and corruptions that might otherwise destroy your database. It protects
critical data by providing facilities to automate the creation, management, and monitoring of
l & On
the databases and other components in a Data Guard configuration. It automates the process of
a e
maintaining a copy of an Oracle production database (called a standby database) that can be
n
t e r U s
used if the production database is taken offline for routine maintenance or becomes damaged.
In a Data Guard configuration, a production database is referred to as a primary database. A
I n
standby database is a synchronized copy of the primary database. Using a backup copy of the
c le
primary database, you can create from one to nine standby databases. The standby databases,
together with the primary database, make up a Data Guard configuration. Each standby
r a
database is associated with only one primary database.
O
Note: You can use the Cascaded Redo Log Destinations feature to incorporate more than nine
standby databases in your configuration.
Configuring standby redo log files is highly recommended on all standby databases in a Data
Guard configuration, including the primary database to aid in role reversal.
Propagate
Capture Apply1
Non-Oracle
database
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Streams Overview
e A
c l
A stream is a flow of information either within a database or from one database to another.
r a
Oracle Streams is a set of processes and database structures that enable you to share data and
O ly
messages in a data stream. The unit of information that is put into a stream is called an event:
• DDL or DML changes, formatted as an LCR
• User-created events
l & On
a e
Events are staged in and propagated between queues.
n
e r s
Most people think of Streams as replication where all databases can be updatable, and without
t U
platform or release considerations. Characteristics include:
I n
• All sites: Active and updateable
c le
• Automatic conflict detection and optional resolution
• Supporting data transformations
r a
• Flexible configurations: n-way, hub & spoke, and so on
O
• Different database platforms, releases and schemas
• Providing high availability for applications (where update conflicts can be avoided or
managed)
m y
result is a new feature that provides greater functionality and flexibility than traditional
d e
solutions for capturing and managing events, and for sharing the events with other databases
and applications. Oracle Streams provides the capabilities that are needed to build and
c a
operate distributed enterprises and applications, data warehouses, and high-availability
solutions.
e A
The three basic tasks of Oracle Streams are:
c l
• Capture: To capture DML or DDL events automatically from the redo log. User-
r a
created events are not captured automatically but are placed into a queue via an explicit
enqueue operation.
O ly
l
performed explicitly if needed. & On
• Staging: To store and propagate events between databases. Propagation can be
n a e
• Apply: To apply DML or DDL events to a destination database or to pass the events to
an application.
t e r U s
You can perform these tasks in a single database or combine them with tasks in other
I n
databases to form a distributed environment.
le
Multi-Database Streams
c
r a
Events propagate between the staging areas in each database. The capture and consumption
elements can be active in any database. For example, you can configure bidirectional data
O
replication with a capture process, propagation job, and apply process at each site. Or, you
can have a single-source system with capture and propagation at one site and apply at
several other databases. You can also have an arbitrary number of databases. Some of the
more complex environments may need hundreds of databases sharing information with
Oracle Streams.
Oracle Database 11g: Administration Workshop I E - 10
Security
http://www.oracle.com/technology/deploy/security/index.html
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Security
e A
c l
For more information about all security related aspects of the database, visit the “Security
r a
Technology Center” which is updated regularly.
O ly
l & On
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Oracle Technology Network
e A
c l
Oracle Technology Network (OTN) hosts the latest news about Oracle technology and
r a
products. Additionally, OTN provides peer-to-peer forums, white papers, security bulletins,
O ly
and other vital information for the Oracle professional.
l & On
In addition to tips, tricks, and techniques for getting the most out of your Oracle software, you
can download that software from OTN. Remember: All software downloads are free, and each
a e
comes with a development license that allows you to use full versions of the products only
n
t e r U s
when developing and making prototypes your applications.
I n
c le
r a
O
• What is an OBE?
A set of hands-on, step-by-step instructions
• Where can you find them?
http://www.oracle.com//technology/obe
• What is available?
Over 100 database OBEs grouped by focus area:
— Installation
— Availability
— Manageability
— Security
— Application Development
— Business Intelligence
Extended Data Management
m y
e
—
c le
The Oracle by Example (OBE) series provides hands-on, step-by-step instructions on how to
r a
use various new features of Oracle products. OBEs help to reduce the time spent on learning a
O ly
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,
l & On
Oracle Application Server, and Oracle Collaboration Suite. OBEs can be accessed at
a e
http://www.oracle.com/technology/obe.
n
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Oracle MetaLink
e A
c l
Oracle MetaLink is your gateway to Oracle’s Support resources. Here, you find answers to the
r a
most common issues facing Oracle administrators and developers, as well as resources to solve
many of those issues.
O ly
l
that affect the Oracle professional.& On
Like Oracle Technology Network, MetaLink includes the most recent headlines about issues
n a e
t e r U s
I n
c le
r a
O
m y
d e
Copyright © 2008, Oracle. All rights reserved.
c a
Thank You!
e A
c l
Oracle University’s mission is to enhance the adoption of Oracle technology. Our goal is to
r a
partner with you, providing information that is pertinent, timely, and relevant to your needs.
O ly
Please take a minute to complete the end-of-course evaluation and let us know how we can
l & On
serve you better. In the U.S., feel free to e-mail our office of customer satisfaction at:
[email protected]
n a e
If you have questions about continuing your Oracle education, need help finding a class, or
t e r U s
want to arrange for on-site training at your company, contact Oracle Education Services for
assistance. In the U.S., dial 800.529.0165. For contact numbers outside the U.S., visit the
following Web site:
I n
c le
http://www.oracle.com/education/index.html?contact.html
Thanks again and hope to see you in another class!
r a
O