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

Contents Oracle Certified Professional (OCA, OCP) Certification Course

Topics................................................................................................................................................8
Introduction to database management systems and databases..............................................................8
What is a database?..............................................................................................................................8
Popular database management system (DBMS) software and why Oracle DBMS. .............................8
History and Current trends of DBMS and Database Administration. ...................................................8
Oracle database market share and about its current competitive landscape......................................8
Tasks of a Database Administrator. ......................................................................................................8
Installing Oracle database software (12c R1 and 12c R2).........................................................................8
Understand prerequisites for a successful Oracle RDBMS software installation.................................9
Installation of Oracle 12c R1 database software with the latest patchset...........................................9
Installation of Oracle 12c R2 database software ..................................................................................9
Oracle Database Architecture...................................................................................................................9
Planning for an Oracle database creation.............................................................................................9
Creating an Oracle 12c R1 database using the CREATE DATABASE SQL command..............................9
Creating an Oracle 12c R2 database using the Graphical Tool (Database Configuration Assistant). ...9
How to configure and use Oracle Enterprise Manager (OEM) Database Express web based tool. .....9
Understand initialization parameter files.............................................................................................9
Startup and Shutdown of a database. ..................................................................................................9
Oracle DBA Training Course Copyright 2010 – 2019 DBA University, Inc. Chicago USA
http://www.DBAUniversity.com – email: info@DBAUniversity.com – Ph: 720 934 1260 2 View the
database alert log ..................................................................................................................9 Components
of an Oracle database and detailed architecture............................................................9 Advance Startup
and Shutdown scenarios. ..........................................................................................9 Oracle database
memory and process architecture.............................................................................9 The Oracle database
job scheduler API (DBMS_SCHEDULER package)................................................9 Database storage
......................................................................................................................................9 Oracle tablespaces
and allocation types.............................................................................................10 How to create small file
(default) and big file tablespaces.................................................................10 How to create datafiles with
fixed size and auto extend option........................................................10 What are control files and how to
view control file content in a trace file........................................10 How to rename datafiles in a control
file. ..........................................................................................10 Temporary tablespaces and temporary
tablespace groups. ..............................................................10 Managing Undo Data
..........................................................................................................................10 Oracle Networking
..................................................................................................................................10 Introduction to
Oracle Net Services component................................................................................10 Oracle listener
configuration (Dynamic and Static Listeners).............................................................10 Dynamic Service
Registration and Naming Methods configuration in sqlnet.ora..............................10 Oracle database
connections from other computers.........................................................................10 Oracle netca
(Network Configuration Assistant) tool for configuration file generation....................10 Oracle netmgr
tool for adding database services to a static listener.ora configuration file..............10 Oracle listener
administration and TNS_ADMIN environment variable.............................................10 What are database
links and learn about best practices in creating them. .......................................10 Administering User
Security ...................................................................................................................10 Create and manage
database user accounts......................................................................................11 Grant and revoke
privileges................................................................................................................11 Create and manage
roles....................................................................................................................11 Create and manage
profiles................................................................................................................11 Standard database
auditing................................................................................................................11 Used Managed
(Manual) Backup and Recovery.....................................................................................11 Backup and
Recovery Concepts (Redo log files and archive log files.)...............................................11 Backup and
Recovery Configuration (Configure the fast recovery area and ARCHIVELOG mode.)...11 Oracle DBA
Training Course Copyright 2010 – 2019 DBA University, Inc. Chicago USA http://www.DBAUniversity.com
– email: info@DBAUniversity.com – Ph: 720 934 1260 3 Introduction and planning for a robust Backup
and Recovery Strategy.............................................11 How to create a consistent database backup aka
offline backup (COLD BACKUP)............................11 Hot to create an inconsistent database backup aka
online backup (HOT BACKUP)...........................11 How to clone a database from a consistent database
backup. ..........................................................11 How to clone a database using Cancel based recovery
from an inconsistent database backup. ......11 How to clone a database using Time based recovery
(Database point in time recovery) from an inconsistent database
backup.............................................................................................................11 RMAN Backup and
Recovery...................................................................................................................11 Advantages of
RMAN method compared to the user-managed method. .........................................11 Create consistent
database backups using RMAN..............................................................................11 Create inconsistent
database backups (without shutting it down) using RMAN. ..............................11 Oracle database backup
metadata. ....................................................................................................12 How to create incremental
backups using RMAN. .............................................................................12 How to clone a database using
RMAN backup based duplication......................................................12 How to restore and recover a full
database from its RMAN backup..................................................12 Use Data Recovery Advisor to perform
recovery of the control file and redo log file. ......................12 How to drop a database using
RMAN.................................................................................................12 Oracle database backup retention
policies and backups to Tape/offsite. .........................................12 How to purge old backups using
RMAN. ............................................................................................12 Oracle database
upgrades......................................................................................................................12 Introduction to
Oracle versions and how to understand a version....................................................12 How to upgrade a
database from Oracle 12c R1 to Oracle 12c R2. ...................................................12 How to upgrade from
one patchset to another patchset within the same maintenance release.....12 What are Oracle interim
patches........................................................................................................12 How to apply SPU patches
(Security Patch Updates). ........................................................................12 How to apply a Patch Set
Update (PSU)..............................................................................................12 Learn about Oracle Interim
Patch Installer (OPATCH)........................................................................12 Oracle Data Movement
Utilities.............................................................................................................12 Oracle database logical
backup and restore operations (Data Pump Export and Import).................13 Business use cases of logical
backups compared to physical backups. ..............................................13 Various Data Pump Export
modes. .....................................................................................................13 Oracle DBA Training Course
Copyright 2010 – 2019 DBA University, Inc. Chicago USA http://www.DBAUniversity.com – email:
info@DBAUniversity.com – Ph: 720 934 1260 4 Data Pump Import to import data from an export
backup. ...............................................................13 Advanced features in Oracle Data Pump Export.
...............................................................................13 Oracle Database Performance Tuning
....................................................................................................13 How to handle performance issues in
the real world.........................................................................13 V$ dynamic views for performance
monitoring and analysis.............................................................13 How to size the Oracle database
memory structures for optimal performance................................13 Oracle database wait
events...............................................................................................................13 Explain Oracle temporary
space internals and sizing. ........................................................................13 How to trace database
sessions using DBMS_MONITOR and DBMS_SESSION packages..................13 How to format SQL trace
files using the tkprof utility. .......................................................................13 How to generate on-error
diagnostic dump files. ..............................................................................13 Index Monitoring and
internals of index maintenance by Oracle. .....................................................13 Statistics data collection
for Oracle database optimizer. ...................................................................13 What is Oracle automatic
workload repository (AWR) and how to obtain AWR reports. .................13 Real world life of an Oracle
DBA.............................................................................................................13 Type of Oracle errors. Valid
errors and internal exceptions (ORA-00600 and ORA-07445 errors)....14 How to work with Oracle
Support https://support.oracle.com to create Service Requests.............14 Parlance and terminology
used by Oracle DBAs.................................................................................14 Working with Oracle Forums
for issues..............................................................................................14 Productivity tools required when
you join the work place.................................................................14 Scheduling JOBS and scripts through
UNIX/LINUX crontab utility......................................................14 Oracle DBAAS (Database as a
Service)....................................................................................................14 Sign-up in
https://cloud.oracle.com...................................................................................................14 Difference
between a DBAAS instance and a database instance. ......................................................14 Navigate with
My Services Dashboard ...............................................................................................14 User
authentication and roles ............................................................................................................14 Generate
a Secure Shell (SSH) Public/Private Key Pair.......................................................................14 Oracle 12c
ASM (Automatic Storage Management)...............................................................................14 Oracle 12c
Database High Availability (RAC, DataGaurd).......................................................................14 Unique
Teaching Methodology...................................................................................................................14 More
Information .......................................................................................................................................15
Course Outline:
ENTERPRISE EDITION INSTALLATION
• IDENTIFY SYSTEM REQUIREMENTS
• THE OPTIMAL FLEXIBLE ARCHITECTURE (OFA)
• ORACLE_BASE
• ORACLE_HOME
• CONFIGURE THE INSTALLATION ENVIRONMENT
• ENTERPRISE EDITION INSTALLATION • DBCA
THE ADMINISTRATOR INTERFACE
• ENTERPRISE MANAGER TOUR
• USING EM SQL WORKSHEET
• DUTIES OF A DATABASE ADMINISTRATOR
• EXPLORING THE ORACLE DATABASE ARCHITECTURE: GENERAL
THE ORACLE ENTERPRISE ARCHITECTURE
EXPLORING THE ORACLE DATABASE ARCHITECTURE: INSTANCE MEMORY
• WHAT IS AN ORACLE DATABASE INSTANCE?
• MORE ABOUT THE SYSTEM GLOBAL AREA (SGA)
• ABOUT THE PGA • MANAGING MEMORY
EXPLORING THE ORACLE DATABASE ARCHITECTURE: INSTANCE PROCESSES
• INSTANCE BACKGROUND PROCESSES
• SQL EXECUTION PROCESSES
CREATING AN ORACLE DATABASE
• CREATE A NEW DATABASE
• CONFIGURE AN EXISTING DATABASE
• DROP A DATABASE
• MANAGE DBCA TEMPLATES
• MANUALLY CREATE A DATABASE
MANAGING THE DATABASE INSTANCE
• CONFIGURING A LINUX ENVIRONMENT
• STARTING & STOPPING DATABASE CONTROL
• STARTING & STOPPING THE DATABASE LISTENER
• STARTING & STOPPING THE DATABASE INSTANCE
• MORE ABOUT THE DATABASE FILES
MANAGE DATABASE STORAGE STRUCTURES: TABLESPACES
• ABOUT TABLESPACES
• TABLESPACE MANAGEMENT
• DROP TABLESPACE
• ALTER TABLESPACE
MANAGE DATABASE STORAGE STRUCTURES: ADVANCED TABLESPACES
• MORE ABOUT TEMPORARY TABLESPACES
• ABOUT TEMPORARY TABLESPACE GROUPS
• MORE ABOUT PERMANENT TABLESPACES
• MORE ABOUT BIGFILE TABLESPACES
• MORE ABOUT THE SYSAUX TABLESPACE
MANAGE DATABASE STORAGE STRUCTURES
• DATA FILES & TEMP FILES
• MANAGING DATA FILES
• MANAGING TEMP FILES
• ENABLE ORACLE-MANAGED FILES (OMF)
MANAGING UNDO DATA
• ABOUT UNDO SPACE MANAGEMENT
• CONFIGURE AUTOMATIC UNDO MANAGEMENT
• UNDO_MANAGEMENT
• UNDO_TABLESPACE
• UNDO_RETENTION
• GUARANTEE UNDO RETENTION
• MONITOR UNDO SPACE
• USE THE UNDO ADVISOR
NETWORK ENVIRONMENT: ORACLE SHARED SERVERS
• SHARED SERVERS ARCHITECTURE
• CONFIGURE SHARED SERVERS
• MONITOR SHARED SERVERS
• V$SHARED_SERVER
• V$SHARED_SERVER_MONITOR
• V$SESSION
• V$CIRCUIT
• V$DISPATCHER & V$DISPATCHER_CONFIG
• V$QUEUE
SECURITY: IMPLEMENTING DATABASE SECURITY
• DATABASE SYSTEM PRIVILEGES
• DATABASE OBJECT PRIVILEGES
• ADMINISTRATOR AUDITING OF DATABASE ACTIVITY
• ENHANCED DEFAULT SECURITY SETTINGS
SECURITY: ADMINISTERING USER SECURITY
• CREATE & MANAGE DATABASE ACCOUNTS
• GRANT & REVOKE DATABASE PRIVILEGES
• RESOURCE LIMITS VIA PROFILES
• ALTER PROFILE
• DROP PROFILE
• PASSWORD MANAGEMENT VIA PROFILES
• ABOUT ROLE-BASED SECURITY
• WITH ADMIN OPTION
• ALTER USER...DEFAULT ROLE
• SET ROLE
• ENHANCED DEFAULT SECURITY SETTINGS
MOVING DATA: SQL LOADER
• LOADER CONCEPTS
• CONTROL FILE OPTIONS
• LOAD METHODS
• USING THE EM INTERFACE
MOVING DATA: EXPORT & IMPORT
• MANAGE DIRECTORY OBJECTS
• ABOUT THE DATA PUMP ARCHITECTURE
• DATA PUMP EXPORT
• DATA PUMP IMPORT
• DATA PUMP DATA DICTIONARY VIEWS
• USING THE EM INTERFACE
DATABASE MAINTENANCE & PERFORMANCE MANAGEMENT
• THE MANAGEMENT & ADVISORY FRAMEWORK
• MANAGE THE AUTOMATIC WORKLOAD REPOSITORY
• AUTOMATIC DATABASE DIAGNOSTIC MONITOR
• USE METRICS & ALERT THRESHOLDS
• AUTOMATIC MAINTENANCE TASKS
MANAGING CONCURRENCY & LOCKS
• ABOUT LATCHES & LOCKS
• MANAGE & MONITOR LATCHES
• MANAGE & MONITOR LOCKS
• V$LOCK
• V$LOCKED_OBJECT
• V$SESSION
• V$SESSION_WAIT
• DBA_BLOCKERS & DBA_WAITERS
• DBA_DML_LOCKS & DBA_DDL_LOCKS
• DML_LOCKS
BACKUP & RECOVERY CONCEPTS & CONFIGURATION
• ABOUT DATABASE BACKUP & RECOVERY STRUCTURES
• MANAGING REDO DATA
• MANAGING ARCHIVAL DATA
• AUTOMATIC CRASH RECOVERY
• CREATING A BASIC BACKUP STRATEGY

Exploring the Oracle Database Architecture

 Oracle Database Architecture Overview


 Oracle ASM Architecture Overview
 Process Architecture
 Memory structures
 Logical and physical storage structures
 ASM storage components

Installing your Oracle Software

 Tasks of an Oracle Database Administrator


 Tools Used to Administer an Oracle Database
 Installation: System Requirements
 Oracle Universal Installer (OUI)
 Installing Oracle Grid Infrastructure
 Installing Oracle Database Software
 Silent Install

Creating an Oracle Database


 Planning the Database
 Using the DBCA to Create a Database
 Password Management
 Creating a Database Design Template
 Using the DBCA to Delete a Database

Managing the Oracle Instance

 Start and stop the Oracle database and components


 Use Oracle Enterprise Manager
 Access a database with SQLPlus
 Modify database installation parameters
 Describe the stages of database startup
 Describe database shutdown options
 View the alert log
 Access dynamic performance views

Manage the ASM Instance

 Set up initialization parameter files for ASM instance


 Start up and shut down ASM instances
 Administer ASM disk groups

Configuring the Oracle Network Environment

 Use Enterprise Manager to create and configure the Listener


 Enable Oracle Restart to monitor the listener
 Use tnsping to test Oracle Net connectivity
 Identify when to use shared servers and when to use dedicated servers

Managing Database Storage Structures

 Storage Structures
 How Table Data Is Stored
 Anatomy of a Database Block
 Space Management in Tablespaces
 Tablespaces in the Preconfigured Database
 Actions with Tablespaces
 Oracle Managed Files (OMF)

Administering User Security

 Database User Accounts


 Predefined Administrative Accounts
 Benefits of Roles
 Predefined Roles
 Implementing Profiles

Managing Data Concurrency


 Data Concurrency
 Enqueue Mechanism
 Resolving Lock Conflicts
 Deadlocks

Managing Undo Data

 Data Manipulation
 Transactions and Undo Data
 Undo Data Versus Redo Data
 Configuring Undo Retention

Implementing Oracle Database Auditing

 Describe DBA responsibilities for security


 Enable standard database auditing
 Specify audit options
 Review audit information
 Maintain the audit trail
 Manage optimizer statistics
 Manage the Automatic Workload Repository (AWR)
 Use the Automatic Database Diagnostic Monitor (ADDM)
 Describe and use the advisory framework
 Set alert thresholds
 Use server-generated alerts
 Use automated tasks

Performance Management

 Performance Monitoring
 Managing Memory Components
 Enabling Automatic Memory Management (AMM)
 Automatic Shared Memory Advisor
 Using Memory Advisors
 Dynamic Performance Statistics
 Troubleshooting and Tuning Views
 Invalid and Unusable Objects

Backup and Recovery Concepts

 Part of Your Job


 PStatement Failure
 PUser Error
 PUnderstanding Instance Recovery
 PPhases of Instance Recovery
 PUsing the MTTR Advisor
 PMedia Failure
 P Archive Log Files

Performing Database Backups using RMAN


 Backup Solutions: Overview
 Oracle Secure Backup
 User-Managed Backup
 Terminology
 Recovery Manager (RMAN)
 Configuring Backup Settings
 Backing Up the Control File to a Trace File
 Monitoring the Flash Recovery Area
 Opening a Database
 Data Recovery Advisor
 Loss of a Control File
 Loss of a Redo Log File
 Data Recovery Advisor
 Data Failures
 Listing Data Failures
 Data Recovery Advisor Views

Data Replication

 Describe ways to move data


 Create and use directory objects
 Use SQL*Loader to move data
 Use external tables to move data
 General architecture of Oracle Data Pump
 Use Data Pump export and import to move data

Working with Support

 Use the Enterprise Manager Support Workbench


 Work with Oracle Support
 Log service requests (SR)
 Manage patches

Using the RMAN Recovery Catalog

 Identify situations that require RMAN recovery catalog


 Create and configure a recovery catalog
 Synchronize the recovery catalog
 Create and Use RMAN stored scripts
 Back up the recovery catalog
 Create and use a virtual private catalog

Configuring Backup Specifications

 Configure backup settings


 Allocate channels to use in backing up
 Configure backup optimization

Using RMAN to Create Backups


 Create image file backups
 Create a whole database backup
 Enable fast incremental backup
 Create duplex backup and back up backup sets
 Create an archival backup for long-term retention
 Create a multisection, compressed and encrypted backup
 Report on and maintain backups

Performing User-Managed Backup and Recovery

 Recover from a lost TEMP file and redo log group


 Recover from the loss of password file
 Perform user-managed complete and incomplete database recovery
 Perform user-managed and server managed backups
 Identify the need of backup mode
 Back up and recover a control file

Using RMAN to Perform Recovery

 Perform complete recovery from a critical or noncritical data file loss using RMAN
 Perform incomplete recovery using RMAN
 Recover using incrementally updated backups
 Switch to image copies for fast recovery
 Restore a database onto a new host
 Recover using a backup control file
 Using RMAN to Duplicate a Database
 Creating a duplicate database
 Using a duplicate database

Monitoring and Tuning RMAN

 Monitoring RMAN sessions and jobs


 Tuning RMAN
 Configure RMAN for Asynchronous I/O

ASM TOPICS

 Database Architecture and ASM


 Describe Automatic Storage Management (ASM)
 Set up initialization parameter files for ASM and database instances
 Start up and shut down ASM instances
 Administer ASM disk groups
 Storage Fundamentals
 ASM Concepts
 Preparing ASM Storage
 ASM Instance setup
 ASM diskgroupsFailure groups (Redundancy)
 Managing Diskgroups
 Backing up Diskgroups
 Monitoring Diskgroups
 Creating Database on ASM
 Managing Database on ASM
 Basic architecture
 Storage concepts

RMAN Topics

 Backup Strategies
 FLASH recovery area
 RMAN Architecture
 RMAN backup components
 RMAN catalog and configuration
 RMAN Commands
 Monitoring RMAN backups
 Tuning RMAN jobs
 Restoring and recovering using RMAN
 Database cloning using RMAN
 Troubleshooting RMAN issues
 Best practices

Part I Basic Database Administration 1 Getting Started with Database Administration 1.1 Types of Oracle
Database Users

Administrators

Network Administrators

Application Developers

Application Administrators

Database Users

Tasks of a Database Administrator

Task 1: Evaluate the Database Server Hardware

Task 2: Install the Oracle Database Software

Task 3: Plan the Database

Task 4: Create and Open the Database

Task 5: Back Up the Database

Task 6: Enroll System Users

Task 7: Implement the Database Design


Task 8: Back Up the Fully Functional Database

Task 9: Tune Database Performance

Task 10: Download and Install Patches

Task 11: Roll Out to Additional Hosts

SQL Statements ................................................................................................................................. 1-7


1.3.1 Submitting Commands and SQL to the Database............................................................ 1-7 1.3.2
About SQL*Plus..................................................................................................................... 1-7 1.3.3
Connecting to the Database with SQL*Plus ...................................................................... 1-8 1.4
Identifying Your Oracle Database Software Release................................................................. 1-14 1.4.1
Release Number Format..................................................................................................... 1-14 1.4.2
Checking Your Current Release Number ........................................................................ 1-15 1.5 About
Database Administrator Security and Privileges........................................................... 1-15 1.5.1 The
Database Administrator's Operating System Account .......................................... 1-15 1.5.2
Administrative User Accounts .......................................................................................... 1-16 1.6 Database
Administrator Authentication ..................................................................................... 1-18 1.6.1
Administrative Privileges .................................................................................................. 1-19 1.6.2
Operations Authorized by Administrative Privileges................................................... 1-19 1.6.3
Authentication Methods for Database Administrators ................................................. 1-22 1.6.4 Using
Operating System Authentication......................................................................... 1-24 1.6.5 Using
Password File Authentication................................................................................ 1-26 1.7 Creating and
Maintaining a Database Password File ............................................................... 1-28 1.7.1 ORAPWD
Syntax and Command Line Argument Descriptions ................................. 1-28 1.7.2 Creating a Database
Password File with ORAPWD...................................................... 1-33 1.7.3 Sharing and Disabling the
Database Password File....................................................... 1-34 1.7.4 Keeping Administrator Passwords
Synchronized with the Data Dictionary ............ 1-35 1.7.5 Adding Users to a Database Password
File..................................................................... 1-36 1.7.6 Granting and Revoking Administrative
Privileges........................................................ 1-36 1.7.7 Viewing Database Password File Members
.................................................................... 1-37 1.7.8 Expanding the Number of Database Password File
Users ........................................... 1-38 1.7.9 Removing a Database Password
File................................................................................ 1-38 1.8 Data
Utilities.................................................................................................................................... 1-39

2 Creating and Configuring an Oracle Database

2.1 About Creating an Oracle Database

2.2 Considerations Before Creating the Database

2.2.1 Planning for Database Creation


About Selecting a Character Set

Meeting Creation Prerequisites

Creating a Database with DBCA

About Creating a Database with DBCA

About Creating a Database with Interactive DBCA

Creating a Database with Noninteractive/Silent DBCA..................................... 2-5 2.4 Creating a


Database with the CREATE DATABASE Statement................................................ 2-6 iv 2.4.1 About
Creating a Database with the CREATE DATABASE Statement........................ 2-6 2.4.2 Step 1: Specify an
Instance Identifier (SID)........................................................................ 2-7 2.4.3 Step 2: Ensure That the
Required Environment Variables Are Set................................ 2-7 2.4.4 Step 3: Choose a Database
Administrator Authentication Method............................... 2-8 2.4.5 Step 4: Create the Initialization
Parameter File................................................................. 2-8 2.4.6 Step 5: (Windows Only) Create an
Instance...................................................................... 2-9 2.4.7 Step 6: Connect to the
Instance.......................................................................................... 2-10 2.4.8 Step 7: Create a Server
Parameter File.............................................................................. 2-11 2.4.9 Step 8: Start the Instance
.................................................................................................... 2-11 2.4.10 Step 9: Issue the CREATE
DATABASE Statement ....................................................... 2-12 2.4.11 Step 10: Create Additional
Tablespaces ......................................................................... 2-16 2.4.12 Step 11: Run Scripts to Build Data
Dictionary Views ................................................. 2-16 2.4.13 Step 12: (Optional) Run Scripts to Install
Additional Options ................................... 2-17 2.4.14 Step 13: Back Up the Database
........................................................................................ 2-17 2.4.15 Step 14: (Optional) Enable Automatic
Instance Startup .............................................. 2-17 2.5 Specifying CREATE DATABASE Statement Clauses
............................................................... 2-18 2.5.1 About CREATE DATABASE Statement Clauses
........................................................... 2-18 2.5.2 Protecting Your Database: Specifying Passwords for
Users SYS and SYSTEM......... 2-18 2.5.3 Creating a Locally Managed SYSTEM
Tablespace......................................................... 2-19 2.5.4 Specify Data File Attributes for the SYSAUX
Tablespace ............................................. 2-19 2.5.5 Using Automatic Undo Management: Creating an
Undo Tablespace........................ 2-20 2.5.6 Creating a Default Permanent Tablespace
...................................................................... 2-21 2.5.7 Creating a Default Temporary
Tablespace...................................................................... 2-21 2.5.8 Specifying Oracle Managed Files at
Database Creation................................................ 2-22 2.5.9 Supporting Bigfile Tablespaces During
Database Creation.......................................... 2-23 2.5.10 Specifying the Database Time Zone and Time
Zone File............................................ 2-25 2.5.11 Specifying FORCE LOGGING Mode
............................................................................. 2-26 2.6 Specifying Initialization Parameters
............................................................................................ 2-27 2.6.1 About Initialization Parameters and
Initialization Parameter Files ............................ 2-28 2.6.2 Determining the Global Database Name
......................................................................... 2-30 2.6.3 Specifying a Fast Recovery
Area....................................................................................... 2-31 2.6.4 Specifying Control Files
..................................................................................................... 2-32 2.6.5 Specifying Database Block
Sizes ....................................................................................... 2-32 2.6.6 Specifying the Maximum Number
of Processes............................................................. 2-34 2.6.7 Specifying the DDL Lock Timeout
................................................................................... 2-34 2.6.8 Specifying the Method of Undo Space
Management..................................................... 2-35 2.6.9 Specifying the Database Compatibility Level
................................................................. 2-36 2.6.10 Setting the License
Parameter.......................................................................................... 2-37 2.7 Managing Initialization
Parameters Using a Server Parameter File ....................................... 2-37 2.7.1 What Is a Server
Parameter File? ...................................................................................... 2-37 2.7.2 Migrating to a Server
Parameter File................................................................................ 2-38 2.7.3 Server Parameter File
Default Names and Locations .................................................... 2-39 2.7.4 Creating a Server Parameter
File ...................................................................................... 2-40 v 2.7.5 The SPFILE Initialization
Parameter ................................................................................ 2-40 2.7.6 Changing Initialization
Parameter Values....................................................................... 2-41 2.7.7 Clearing Initialization
Parameter Values......................................................................... 2-42 2.7.8 Exporting the Server
Parameter File................................................................................. 2-43 2.7.9 Backing Up the Server
Parameter File.............................................................................. 2-43 2.7.10 Recovering a Lost or
Damaged Server Parameter File ................................................ 2-44 2.7.11 Methods for Viewing
Parameter Settings...................................................................... 2-45 2.8 Managing Application
Workloads with Database Services ..................................................... 2-45 2.8.1 Database Services
................................................................................................................ 2-45 2.8.2 Global Data Services
........................................................................................................... 2-49 2.8.3 Database Service Data
Dictionary Views......................................................................... 2-49 2.9 Considerations After Creating a
Database.................................................................................. 2-50 2.9.1 Some Security
Considerations........................................................................................... 2-50 2.9.2 Transparent Data
Encryption ............................................................................................ 2-51 2.9.3 A Secure External
Password Store.................................................................................... 2-51 2.9.4 Transaction Guard and
Application Continuity............................................................. 2-52 2.9.5 The Oracle Database Sample
Schemas............................................................................. 2-53 2.10 Cloning a Database with
CloneDB............................................................................................. 2-53 2.10.1 About Cloning a Database
with CloneDB ..................................................................... 2-53 2.10.2 Cloning a Database with CloneDB
................................................................................. 2-54 2.10.3 After Cloning a Database with CloneDB
....................................................................... 2-59 2.11 Dropping a
Database.................................................................................................................... 2-60 2.12 Database
Data Dictionary Views................................................................................................ 2-60 2.13.1 Database
Configuration Assistant Command Reference for Silent Mode ........................ 2-61 2.13.1.1
createDatabase ................................................................................................................ 2-63 2.13.1.2
configureDatabase.......................................................................................................... 2-67 2.13.1.3
createTemplateFromDB................................................................................................. 2-69 2.13.1.4
createCloneTemplate ..................................................................................................... 2-70 2.13.1.5
generateScripts................................................................................................................ 2-71 2.13.1.6
deleteDatabase ................................................................................................................ 2-72 2.13.1.7
createPluggableDatabase .............................................................................................. 2-72 2.13.1.8
unplugDatabase.............................................................................................................. 2-76 2.13.1.9
deletePluggableDatabase .............................................................................................. 2-77 2.13.1.10
configurePluggableDatabase ...................................................................................... 2-78
3 Starting Up and Shutting Down 3.1 Starting Up a
Database..................................................................................................................... 3-1 3.1.1 About
Database Startup Options ........................................................................................ 3-1 3.1.2 Specifying
Initialization Parameters at Startup ................................................................ 3-2 3.1.3 About Automatic
Startup of Database Services................................................................ 3-5 3.1.4 Preparing to Start Up an
Instance....................................................................................... 3-5 3.1.5 Starting Up an Instance
........................................................................................................ 3-6 3.2 Altering Database Availability
..................................................................................................... 3-11 vi 3.2.1 Mounting a Database to an
Instance ................................................................................ 3-11 3.2.2 Opening a Closed
Database............................................................................................... 3-11 3.2.3 Opening a Database in
Read-Only Mode ........................................................................ 3-11 3.2.4 Restricting Access to an Open
Database.......................................................................... 3-12 3.3 Shutting Down a
Database............................................................................................................ 3-13 3.3.1 About Shutting
Down the Database................................................................................. 3-13 3.3.2 Shutting Down with
the Normal Mode ........................................................................... 3-13 3.3.3 Shutting Down with the
Immediate Mode...................................................................... 3-14 3.3.4 Shutting Down with the
Transactional Mode................................................................. 3-15 3.3.5 Shutting Down with the Abort
Mode .............................................................................. 3-15 3.3.6 Shutdown
Timeout.............................................................................................................. 3-16 3.4 Quiescing a
Database ..................................................................................................................... 3-16 3.4.1 About
Quiescing a Database.............................................................................................. 3-16 3.4.2 Placing a
Database into a Quiesced State......................................................................... 3-17 3.4.3 Restoring the
System to Normal Operation .................................................................... 3-18 3.4.4 Viewing the Quiesce
State of an Instance ........................................................................ 3-18 3.5 Suspending and Resuming a
Database ....................................................................................... 3-19 4 Configuring Automatic Restart of
an Oracle Database 4.1 About Oracle Restart
........................................................................................................................ 4-1 4.1.1 Oracle Restart
Overview ...................................................................................................... 4-1 4.1.2 About Startup
Dependencies............................................................................................... 4-2 4.1.3 About Starting and
Stopping Components with Oracle Restart.................................... 4-2 4.1.4 About Starting and Stopping
Oracle Restart..................................................................... 4-3 4.1.5 Oracle Restart
Configuration............................................................................................... 4-3 4.1.6 Oracle Restart
Integration with Oracle Data Guard......................................................... 4-5 4.1.7 Fast Application
Notification with Oracle Restart ........................................................... 4-6 4.2 Configuring Oracle Restart
........................................................................................................... 4-10 4.2.1 About Configuring Oracle
Restart.................................................................................... 4-10 4.2.2 Preparing to Run
SRVCTL................................................................................................. 4-11 4.2.3 Obtaining Help for
SRVCTL.............................................................................................. 4-11 4.2.4 Adding Components to the
Oracle Restart Configuration ........................................... 4-12 4.2.5 Removing Components from the
Oracle Restart Configuration.................................. 4-14 4.2.6 Disabling and Enabling Oracle Restart
Management for a Component..................... 4-14 4.2.7 Viewing Component Status
............................................................................................... 4-15 4.2.8 Viewing the Oracle Restart
Configuration for a Component ....................................... 4-16 4.2.9 Modifying the Oracle Restart
Configuration for a Component ................................... 4-17 4.2.10 Managing Environment Variables in
the Oracle Restart Configuration................... 4-17 4.2.11 Creating and Deleting Database Services with
SRVCTL............................................. 4-19 4.2.12 Enabling FAN Events in an Oracle Restart Environment
........................................... 4-20 4.2.13 Automating the Failover of Connections Between Primary and
Standby Databases
..................................................................................................................................................... 4-21 4.2.14
Enabling Clients for Fast Connection Failover ............................................................. 4-22 vii 4.3 Starting
and Stopping Components Managed by Oracle Restart............................................ 4-26 4.4 Stopping and
Restarting Oracle Restart for Maintenance Operations.................................... 4-28 4.5 SRVCTL Command
Reference for Oracle Restart...................................................................... 4-30 4.5.1 add
......................................................................................................................................... 4-31 4.5.2
config..................................................................................................................................... 4-40 4.5.3
disable ................................................................................................................................... 4-43 4.5.4
downgrade ........................................................................................................................... 4-46 4.5.5
enable .................................................................................................................................... 4-47 4.5.6
getenv.................................................................................................................................... 4-49 4.5.7
modify ................................................................................................................................... 4-51 4.5.8
remove................................................................................................................................... 4-59 4.5.9
setenv .................................................................................................................................... 4-62 4.5.10
start ...................................................................................................................................... 4-65 4.5.11
status ................................................................................................................................... 4-68 4.5.12
stop ...................................................................................................................................... 4-72 4.5.13
unsetenv.............................................................................................................................. 4-77 4.5.14
update ................................................................................................................................. 4-78 4.5.15
upgrade............................................................................................................................... 4-79 4.6 CRSCTL
Command Reference...................................................................................................... 4-79 4.6.1
check...................................................................................................................................... 4-80 4.6.2
config..................................................................................................................................... 4-80 4.6.3
disable ................................................................................................................................... 4-80 4.6.4
enable .................................................................................................................................... 4-80 4.6.5
start ........................................................................................................................................ 4-80 4.6.6
stop ........................................................................................................................................ 4-81

5 Managing Processes 5.1 About Dedicated and Shared Server


Processes............................................................................ 5-1 5.1.1 Dedicated Server
Processes.................................................................................................. 5-1 5.1.2 Shared Server
Processes ....................................................................................................... 5-2 5.2 About Database
Resident Connection Pooling ............................................................................ 5-4 5.2.1 Comparing DRCP
to Dedicated Server and Shared Server ............................................ 5-5 5.3 Configuring Oracle Database
for Shared Server.......................................................................... 5-6 5.3.1 Initialization Parameters for
Shared Server....................................................................... 5-6 5.3.2 Memory Management for Shared
Server........................................................................... 5-7 5.3.3 Enabling Shared Server
........................................................................................................ 5-7 5.3.4 Configuring Dispatchers
.................................................................................................... 5-10 5.3.5 Disabling Shared Server
..................................................................................................... 5-15 5.3.6 Shared Server Data Dictionary
Views.............................................................................. 5-16 5.4 Configuring Database Resident
Connection Pooling................................................................ 5-16 5.4.1 Enabling Database Resident
Connection Pooling .......................................................... 5-17 5.4.2 Configuring the Connection Pool for
Database Resident Connection Pooling.......... 5-18 5.4.3 Data Dictionary Views for Database Resident
Connection Pooling............................ 5-20 viii 5.5 About Oracle Database Background
Processes.......................................................................... 5-21 5.6 Managing Processes for Parallel SQL
Execution........................................................................ 5-22 5.6.1 About Parallel Execution
Servers...................................................................................... 5-22 5.6.2 Altering Parallel Execution for a
Session......................................................................... 5-23 5.7 Managing Processes for External
Procedures............................................................................. 5-24 5.7.1 About External
Procedures................................................................................................ 5-24 5.7.2 DBA Tasks to Enable
External Procedure Calls.............................................................. 5-25 5.8 Terminating
Sessions...................................................................................................................... 5-26 5.8.1 About
Terminating Sessions.............................................................................................. 5-26 5.8.2 Identifying
Which Session to Terminate.......................................................................... 5-26 5.8.3 Terminating an
Active Session.......................................................................................... 5-27 5.8.4 Terminating an
Inactive Session ....................................................................................... 5-28 5.9 Process and Session
Data Dictionary Views............................................................................... 5-28 6 Managing Memory 6.1
About Memory Management.......................................................................................................... 6-1 6.2
Memory Architecture Overview .................................................................................................... 6-2 6.3
Using Automatic Memory Management ...................................................................................... 6-4 6.3.1
About Automatic Memory Management .......................................................................... 6-4 6.3.2
Enabling Automatic Memory Management...................................................................... 6-5 6.3.3
Monitoring and Tuning Automatic Memory Management............................................ 6-7 6.4 Configuring
Memory Manually ..................................................................................................... 6-8 6.4.1 About
Manual Memory Management ............................................................................... 6-8 6.4.2 Using
Automatic Shared Memory Management.............................................................. 6-8 6.4.3 Using Manual
Shared Memory Management................................................................. 6-16 6.4.4 Using Automatic PGA
Memory Management ............................................................... 6-22 6.4.5 Using Manual PGA Memory
Management..................................................................... 6-24 6.5 Using Force Full Database Caching
Mode.................................................................................. 6-24 6.5.1 About Force Full Database Caching
Mode...................................................................... 6-24 6.5.2 Before Enabling Force Full Database
Caching Mode..................................................... 6-25 6.5.3 Enabling Force Full Database Caching Mode
................................................................. 6-26 6.5.4 Disabling Force Full Database Caching Mode
................................................................ 6-26 6.6 Configuring Database Smart Flash
Cache................................................................................... 6-27 6.6.1 When to Configure Database Smart
Flash Cache........................................................... 6-27 6.6.2 Sizing Database Smart Flash
Cache.................................................................................. 6-27 6.6.3 Tuning Memory for Database Smart
Flash Cache.......................................................... 6-28 6.6.4 Database Smart Flash Cache Initialization
Parameters ................................................. 6-28 6.6.5 Database Smart Flash Cache in an Oracle Real
Applications Clusters Environment 6-30 6.7 Using the In-Memory Column Store
........................................................................................... 6-30 6.7.1 About the IM Column Store
.............................................................................................. 6-30 6.7.2 Initialization Parameters Related
to the IM Column Store ........................................... 6-34 6.7.3 Enabling the IM Column Store for a
Database ............................................................... 6-36 6.7.4 Enabling and Disabling Tables for the IM
Column Store ............................................. 6-37 ix 6.7.5 Enabling and Disabling Tablespaces for the IM
Column Store.................................... 6-39 6.7.6 Enabling and Disabling Materialized Views for the IM
Column Store ...................... 6-40 6.7.7 Data Pump and the IM Column
Store.............................................................................. 6-41 6.7.8 Using IM Column Store In Enterprise
Manager............................................................. 6-41 6.8 Memory Management Reference
................................................................................................. 6-45 6.8.1 Platforms That Support
Automatic Memory Management.......................................... 6-45 6.8.2 Memory Management Data
Dictionary Views ............................................................... 6-46 7 Managing Users and Securing the
Database 7.1 The Importance of Establishing a Security Policy for Your Database ......................................
7-1 7.2 Managing Users and Resources...................................................................................................... 7-
1 7.3 User Privileges and Roles ................................................................................................................ 7-1
7.4 Auditing Database Activity............................................................................................................. 7-2
7.5 Predefined User Accounts............................................................................................................... 7-2

8 Monitoring the Database 8.1 Monitoring Errors and Alerts


......................................................................................................... 8-1 8.1.1 Monitoring Errors with Trace
Files and the Alert Log .................................................... 8-1 8.1.2 Monitoring a Database with Server-
Generated Alerts .................................................... 8-5 8.2 Monitoring Performance
................................................................................................................. 8-9 8.2.1 Monitoring Locks
.................................................................................................................. 8-9 8.2.2 About Monitoring Wait
Events ........................................................................................... 8-9 8.2.3 Performance Monitoring Data
Dictionary Views........................................................... 8-10 9 Managing Diagnostic Data 9.1 About the
Oracle Database Fault Diagnosability Infrastructure ............................................... 9-1 9.1.1 Fault
Diagnosability Infrastructure Overview.................................................................. 9-1 9.1.2 Incidents and
Problems ........................................................................................................ 9-2 9.1.3 Fault Diagnosability
Infrastructure Components............................................................. 9-4 9.1.4 Structure, Contents, and
Location of the Automatic Diagnostic Repository ............... 9-8 9.2 Investigating, Reporting, and
Resolving a Problem.................................................................. 9-12 9.2.1 Roadmap—Investigating,
Reporting, and Resolving a Problem ................................. 9-12 9.2.2 Task 1: View Critical Error Alerts in
Cloud Control...................................................... 9-14 9.2.3 Task 2: View Problem
Details............................................................................................ 9-15 9.2.4 Task 3: (Optional) Gather
Additional Diagnostic Information .................................... 9-16 9.2.5 Task 4: (Optional) Create a Service
Request.................................................................... 9-16 9.2.6 Task 5: Package and Upload Diagnostic
Data to Oracle Support ................................ 9-16 9.2.7 Task 6: Track the Service Request and Implement
Any Repairs.................................. 9-18 9.3 Viewing Problems with the Support
Workbench...................................................................... 9-19 9.4 Creating a User-Reported
Problem.............................................................................................. 9-20 9.5 Viewing the Alert
Log.................................................................................................................... 9-21 9.6 Finding Trace
Files.......................................................................................................................... 9-22 9.7 Running
Health Checks with Health Monitor ........................................................................... 9-23 x 9.7.1 About
Health Monitor ........................................................................................................ 9-23 9.7.2 Running
Health Checks Manually.................................................................................... 9-25 9.7.3 Viewing Checker
Reports................................................................................................... 9-26 9.7.4 Health Monitor Views
........................................................................................................ 9-29 9.7.5 Health Check Parameters
Reference ................................................................................ 9-29 9.8 Repairing SQL Failures w 11.1.1
Redo Threads ..................................................................................................................... 11-1 11.1.2 Redo
Log Contents............................................................................................................ 11-1 11.1.3 How Oracle
Database Writes to the Redo Log ............................................................. 11-2 11.2 Planning the Redo
Log................................................................................................................. 11-4 11.2.1 Multiplexing Redo
Log Files............................................................................................ 11-4 11.2.2 Placing Redo Log
Members on Different Disks............................................................ 11-6 11.2.3 Planning the Size of Redo
Log Files ............................................................................... 11-7 11.2.4 Planning the Block Size of Redo
Log Files..................................................................... 11-7 11.2.5 Choosing the Number of Redo Log
Files....................................................................... 11-8 11.2.6 Controlling Archive Lag
.................................................................................................. 11-9 11.3 Creating Redo Log Groups and
Members .............................................................................. 11-10 11.3.1 Creating Redo Log Groups
............................................................................................ 11-11 11.3.2 Creating Redo Log
Members......................................................................................... 11-11 11.4 Relocating and Renaming
Redo Log Members ..................................................................... 11-12 11.5 Dropping Redo Log Groups
and Members ............................................................................ 11-13 11.5.1 Dropping Log Groups
.................................................................................................... 11-13 11.5.2 Dropping Redo Log
Members....................................................................................... 11-14 11.6 Forcing Log Switches
................................................................................................................. 11-15 11.7 Verifying Blocks in
Redo Log Files .......................................................................................... 11-15 11.8 Clearing a Redo Log
File............................................................................................................ 11-16 11.9 Precedence of FORCE
LOGGING Settings ............................................................................. 11-17 11.10 Redo Log Data
Dictionary Views .......................................................................................... 11-18 12 Managing Archived
Redo Log Files 12.1 What Is the Archived Redo
Log?................................................................................................ 12-1 12.2 Choosing Between
NOARCHIVELOG and ARCHIVELOG Mode ...................................... 12-2 12.2.1 Running a Database in
NOARCHIVELOG Mode........................................................ 12-2 12.2.2 Running a Database in
ARCHIVELOG Mode .............................................................. 12-2 12.3 Controlling
Archiving.................................................................................................................. 12-4 12.3.1 Setting the
Initial Database Archiving Mode ................................................................ 12-4 12.3.2 Changing the
Database Archiving Mode ..................................................................... 12-4 12.3.3 Performing Manual
Archiving ........................................................................................ 12-5 12.3.4 Adjusting the Number of
Archiver Processes............................................................... 12-6 12.4 Specifying Archive Destinations
................................................................................................ 12-6 12.4.1 Setting Initialization Parameters
for Archive Destinations......................................... 12-6 12.4.2 Understanding Archive Destination
Status................................................................. 12-10 12.4.3 Specifying Alternate Destinations
................................................................................ 12-10 12.5 About Log Transmission Modes
.............................................................................................. 12-11 12.5.1 Normal Transmission
Mode.......................................................................................... 12-11 12.5.2 Standby Transmission Mode
........................................................................................ 12-11 12.6 Managing Archive Destination Failure
................................................................................... 12-11 12.6.1 Specifying the Minimum Number of
Successful Destinations................................. 12-12 12.6.2 Rearchiving to a Failed
Destination.............................................................................. 12-14 xii 12.7 Controlling Trace Output
Generated by the Archivelog Process........................................ 12-14 12.8 Viewing Information About the
Archived Redo Log............................................................ 12-15 12.8.1 Archived Redo Log Files Views
.................................................................................... 12-15 12.8.2 Using the ARCHIVE LOG LIST
Command ................................................................ 12-16 13 Managing Tablespaces 13.1 Guidelines for
Managing Tablespaces....................................................................................... 13-1 13.1.1 Use Multiple
Tablespaces................................................................................................. 13-1 13.1.2 Assign Tablespace
Quotas to Users................................................................................ 13-2 13.2 Creating
Tablespaces.................................................................................................................... 13-2 13.2.1 About
Creating Tablespaces ............................................................................................ 13-2 13.2.2 Locally
Managed Tablespaces ......................................................................................... 13-3 13.2.3 Bigfile
Tablespaces ............................................................................................................ 13-6 13.2.4 Compressed
Tablespaces ................................................................................................. 13-8 13.2.5 Encrypted
Tablespaces ..................................................................................................... 13-8 13.2.6 Temporary
Tablespaces.................................................................................................. 13-11 13.2.7 Temporary
Tablespace Groups ..................................................................................... 13-14 13.3 Consider Storing
Tablespaces in the In-Memory Column Store ......................................... 13-16 13.4 Specifying
Nonstandard Block Sizes for Tablespaces ........................................................... 13-16 13.5 Controlling the
Writing of Redo Records................................................................................ 13-17 13.6 Altering
Tablespace Availability ............................................................................................. 13-18 13.6.1 Taking
Tablespaces Offline............................................................................................ 13-18 13.6.2 Bringing
Tablespaces Online ......................................................................................... 13-19 13.7 Using Read-Only
Tablespaces .................................................................................................. 13-20 13.7.1 About Read-Only
Tablespaces ...................................................................................... 13-20 13.7.2 Making a Tablespace
Read-Only .................................................................................. 13-20 13.7.3 Making a Read-Only
Tablespace Writable ................................................................. 13-22 13.7.4 Creating a Read-Only
Tablespace on a WORM Device............................................. 13-23 13.7.5 Delaying the Opening of Data
Files in Read-Only Tablespaces............................... 13-23 13.8 Altering and Maintaining
Tablespaces.................................................................................... 13-24 13.8.1 Increasing the Size of a
Tablespace............................................................................... 13-24 13.8.2 Altering a Locally Managed
Tablespace...................................................................... 13-24 13.8.3 Altering a Bigfile Tablespace
......................................................................................... 13-25 13.8.4 Altering a Locally Managed
Temporary Tablespace ................................................. 13-25 13.8.5 Shrinking a Locally Managed
Temporary Tablespace .............................................. 13-26 13.9 Renaming
Tablespaces............................................................................................................... 13-27 13.10 Dropping
Tablespaces ............................................................................................................. 13-27 13.11 Managing
the SYSAUX Tablespace ....................................................................................... 13-28 13.11.1 Monitoring
Occupants of the SYSAUX Tablespace ................................................. 13-29 13.11.2 Moving Occupants
Out Of or Into the SYSAUX Tablespace .................................. 13-29 13.11.3 Controlling the Size of the
SYSAUX Tablespace ...................................................... 13-29 13.12 Correcting Problems with Locally
Managed Tablespaces.................................................. 13-30 13.12.1 Diagnosing and Repairing Locally
Managed Tablespace Problems ..................... 13-30 xiii 13.12.2 Scenario 1: Fixing Bitmap When Allocated
Blocks are Marked Free (No Overlap)
................................................................................................................................................... 13-32
13.12.3 Scenario 2: Dropping a Corrupted Segment ............................................................. 13-32 13.12.4
Scenario 3: Fixing Bitmap Where Overlap is Reported ........................................... 13-33 13.12.5 Scenario
4: Correcting Media Corruption of Bitmap Blocks................................... 13-33 13.12.6 Scenario 5:
Migrating from a Dictionary-Managed to a Locally Managed
Tablespace................................................................................................................................ 13-33 13.13
Migrating the SYSTEM Tablespace to a Locally Managed Tablespace ............................ 13-34 13.14
Viewing Information About Tablespaces.............................................................................. 13-34 13.14.1
Tablespace Data Dictionary Views ............................................................................. 13-34 13.14.2
Example 1: Listing Tablespaces and Default Storage Parameters.......................... 13-36 13.14.3 Example
2: Listing the Data Files and Associated Tablespaces of a Database..... 13-36 13.14.4 Example 3:
Displaying Statistics for Free Space (Extents) of Each Tablespace .... 13-36 14 Managing Data Files and
Temp Files 14.1 Guidelines for Managing Data Files
.......................................................................................... 14-1 14.1.1 About Data Files
................................................................................................................ 14-1 14.1.2 Determine the
Number of Data Files.............................................................................. 14-2 14.1.3 Determine the Size of
Data Files ..................................................................................... 14-3 14.1.4 Place Data Files
Appropriately........................................................................................ 14-4 14.1.5 Store Data Files
Separate from Redo Log Files ............................................................. 14-4 14.2 Creating Data Files and
Adding Data Files to a Tablespace ................................................. 14-4 14.3 Changing Data File
Size............................................................................................................... 14-5 14.3.1 Enabling and
Disabling Automatic Extension for a Data File .................................... 14-5 14.3.2 Manually Resizing a
Data File......................................................................................... 14-6 14.4 Altering Data File
Availability.................................................................................................... 14-7 14.4.1 About Altering
Data File Availability ............................................................................ 14-7 14.4.2 Bringing Data Files
Online or Taking Offline in ARCHIVELOG Mode ................... 14-7 14.4.3 Taking Data Files Offline in
NOARCHIVELOG Mode ............................................... 14-8 14.4.4 Altering the Availability of All Data Files
or Temp Files in a Tablespace................ 14-8 14.5 Renaming and Relocating Data Files
......................................................................................... 14-9 14.5.1 Renaming and Relocating Online
Data Files................................................................. 14-9 14.5.2 Renaming and Relocating Offline Data
Files .............................................................. 14-11 14.6 Dropping Data Files
................................................................................................................... 14-14 14.7 Verifying Data Blocks
in Data Files.......................................................................................... 14-15 14.8 Copying Files Using the
Database Server ............................................................................... 14-16 14.8.1 About Copying Files
Using the Database Server........................................................ 14-16 14.8.2 Copying a File on a Local File
System.......................................................................... 14-16 14.8.3 Third-Party File
Transfer................................................................................................ 14-17 14.8.4 Advanced File Transfer
Mechanisms ........................................................................... 14-18 14.8.5 File Transfer and the
DBMS_SCHEDULER Package................................................. 14-18 14.9 Mapping Files to Physical
Devices........................................................................................... 14-19 14.9.1 Overview of Oracle
Database File Mapping Interface............................................... 14-19 xiv 14.9.2 How the Oracle Database
File Mapping Interface Works......................................... 14-20 14.9.3 Using the Oracle Database File
Mapping Interface.................................................... 14-23 14.9.4 File Mapping
Examples.................................................................................................. 14-27 14.10 Data Files Data
Dictionary Views........................................................................................... 14-29 15 Transporting Data
15.1 About Transporting Data ............................................................................................................ 15-1
15.1.1 Purpose of Transporting Data ......................................................................................... 15-1 15.1.2
Transporting Data: Scenarios........................................................................................... 15-1 15.1.3
Transporting Data Across Platforms .............................................................................. 15-6 15.1.4 General
Limitations on Transporting Data.................................................................... 15-8 15.1.5 Compatibility
Considerations for Transporting Data................................................ 15-10 15.2 Transporting Databases
............................................................................................................. 15-11 15.2.1 Introduction to Full
Transportable Export/Import.................................................... 15-11 15.2.2 Limitations on Full
Transportable Export/import..................................................... 15-12 15.2.3 Transporting a Database
Using an Export Dump File............................................... 15-13 15.2.4 Transporting a Database Over the
Network ............................................................... 15-19 15.3 Transporting Tablespaces Between
Databases....................................................................... 15-24 15.3.1 Introduction to Transportable
Tablespaces ................................................................. 15-25 15.3.2 Limitations on Transportable
Tablespaces .................................................................. 15-25 15.3.3 Transporting Tablespaces Between
Databases ........................................................... 15-26 15.4 Transporting Tables, Partitions, or
Subpartitions Between Databases............................... 15-34 15.4.1 Introduction to Transportable
Tables........................................................................... 15-34 15.4.2 Limitations on Transportable
Tables............................................................................ 15-34 15.4.3 Transporting Tables, Partitions, or
Subpartitions Using an Export Dump File..... 15-35 15.4.4 Transporting Tables, Partitions, or
Subpartitions Over the Network ..................... 15-41 15.5 Converting Data Between Platforms
....................................................................................... 15-45 15.5.1 Converting Data Between Platforms
Using the DBMS_FILE_TRANSFER Package
................................................................................................................................................... 15-45 15.5.2
Converting Data Between Platforms Using RMAN................................................... 15-47 15.6 Guidelines
for Transferring Data Files .................................................................................... 15-50

16 Managing Undo 16.1 What Is


Undo?............................................................................................................................... 16-1 16.2
Introduction to Automatic Undo Management ...................................................................... 16-1 16.2.1
Overview of Automatic Undo Management................................................................. 16-2 16.2.2 The
Undo Retention Period ............................................................................................. 16-3 16.3 Setting the
Minimum Undo Retention Period.......................................................................... 16-6 16.4 Sizing a Fixed-
Size Undo Tablespace ........................................................................................ 16-6 16.4.1 Activating the
Undo Advisor PL/SQL Interface.......................................................... 16-7 16.5 Managing Undo
Tablespaces...................................................................................................... 16-8 16.5.1 Creating an
Undo Tablespace.......................................................................................... 16-8 16.5.2 Altering an Undo
Tablespace .......................................................................................... 16-9 xv 16.5.3 Dropping an Undo
Tablespace...................................................................................... 16-10 16.5.4 Switching Undo
Tablespaces......................................................................................... 16-10 16.5.5 Establishing User
Quotas for Undo Space................................................................... 16-11 16.5.6 Managing Space
Threshold Alerts for the Undo Tablespace.................................... 16-11 16.6 Migrating to Automatic
Undo Management.......................................................................... 16-12 16.7 Managing Temporary
Undo ..................................................................................................... 16-12 16.7.1 About Managing
Temporary Undo.............................................................................. 16-12 16.7.2 Enabling and Disabling
Temporary Undo .................................................................. 16-13 16.8 Undo Space Data Dictionary
Views......................................................................................... 16-14 17 Using Oracle Managed Files 17.1
About Oracle Managed Files....................................................................................................... 17-1 17.1.1
What Is Oracle Managed Files? ....................................................................................... 17-1 17.1.2 Who
Can Use Oracle Managed Files? ............................................................................ 17-2 17.1.3 What Is a
Logical Volume Manager?.............................................................................. 17-2 17.1.4 What Is a File
System? ...................................................................................................... 17-2 17.1.5 Benefits of Using
Oracle Managed Files ........................................................................ 17-3 17.1.6 Oracle Managed Files
and Existing Functionality........................................................ 17-3 17.2 Enabling the Creation and Use of
Oracle Managed Files ....................................................... 17-4 17.2.1 Initialization Parameters That
Enable Oracle Managed Files..................................... 17-4 17.2.2 Setting the DB_CREATE_FILE_DEST
Initialization Parameter ................................. 17-5 17.2.3 Setting the DB_RECOVERY_FILE_DEST
Parameter................................................... 17-5 17.2.4 Setting the DB_CREATE_ONLINE_LOG_DEST_n
Initialization Parameters......... 17-5 17.3 Creating Oracle Managed
Files................................................................................................... 17-6 17.3.1 When Oracle Database
Creates Oracle Managed Files................................................ 17-6 17.3.2 How Oracle Managed Files Are
Named........................................................................ 17-6 17.3.3 Creating Oracle Managed Files at
Database Creation ................................................. 17-8 17.3.4 Creating Data Files for Tablespaces Using
Oracle Managed Files........................... 17-13 17.3.5 Creating Temp Files for Temporary Tablespaces
Using Oracle Managed Files.... 17-16 17.3.6 Creating Control Files Using Oracle Managed
Files.................................................. 17-17 17.3.7 Creating Redo Log Files Using Oracle Managed Files
.............................................. 17-19 17.3.8 Creating Archived Logs Using Oracle Managed Files
.............................................. 17-20 17.4 Operation of Oracle Managed Files
......................................................................................... 17-20 17.4.1 Dropping Data Files and Temp
Files............................................................................ 17-21 17.4.2 Dropping Redo Log Files
............................................................................................... 17-21 17.4.3 Renaming
Files................................................................................................................. 17-21 17.4.4 Managing
Standby Databases ...................................................................................... 17-21 17.5 Scenarios for Using
Oracle Managed Files ............................................................................. 17-22 17.5.1 Scenario 1: Create
and Manage a Database with Multiplexed Redo Logs ............. 17-22 17.5.2 Scenario 2: Create and
Manage a Database with Database and Fast Recovery
Areas......................................................................................................................................... 17-25

17.5.3 Scenario 3: Adding Oracle Managed Files to an Existing Database ........................ 17-26 xvi Part III
Schema Objects 18 Managing Schema Objects 18.1 Creating Multiple Tables and Views in a Single
Operation ................................................... 18-1 18.2 Analyzing Tables, Indexes, and Clusters
.................................................................................. 18-2 18.2.1 About Analyzing Tables, Indexes, and
Clusters........................................................... 18-2 18.2.2 Using DBMS_STATS to Collect Table and Index
Statistics......................................... 18-2 18.2.3 Validating Tables, Indexes, Clusters, and Materialized
Views .................................. 18-3 18.2.4 Cross Validation of a Table and an Index with a Query
............................................. 18-4 18.2.5 Listing Chained Rows of Tables and Clusters
.............................................................. 18-4 18.3 Truncating Tables and
Clusters.................................................................................................. 18-6 18.3.1 Using DELETE to
Truncate a Table ................................................................................ 18-6 18.3.2 Using DROP and CREATE
to Truncate a Table ........................................................... 18-7 18.3.3 Using
TRUNCATE............................................................................................................ 18-7 18.4 Enabling and
Disabling Triggers................................................................................................ 18-8 18.4.1 About
Enabling and Disabling Triggers ........................................................................ 18-8 18.4.2 Enabling
Triggers .............................................................................................................. 18-9 18.4.3 Disabling
Triggers ........................................................................................................... 18-10 18.5 Managing
Integrity Constraints ............................................................................................... 18-10 18.5.1 Integrity
Constraint States ............................................................................................ 18-10 18.5.2 Setting Integrity
Constraints Upon Definition............................................................ 18-12 18.5.3 Modifying, Renaming, or
Dropping Existing Integrity Constraints........................ 18-13 18.5.4 Deferring Constraint Checks
......................................................................................... 18-15 18.5.5 Reporting Constraint Exceptions
.................................................................................. 18-16 18.5.6 Viewing Constraint
Information................................................................................... 18-17 18.6 Renaming Schema
Objects......................................................................................................... 18-18 18.7 Managing Object
Dependencies ............................................................................................... 18-18 18.7.1 About Object
Dependencies and Object Invalidation................................................ 18-19 18.7.2 Manually Recompiling
Invalid Objects with DDL..................................................... 18-20 18.7.3 Manually Recompiling Invalid
Objects with PL/SQL Package Procedures .......... 18-20 18.8 Managing Object Name Resolution
......................................................................................... 18-21 18.9 Switching to a Different Schema
.............................................................................................. 18-23 18.10 Managing
Editions.................................................................................................................... 18-23 18.10.1 About
Editions and Edition-Based Redefinition ...................................................... 18-23 18.10.2 DBA Tasks for
Edition-Based Redefinition ............................................................... 18-24 18.10.3 Setting the Database
Default Edition.......................................................................... 18-24 18.10.4 Querying the Database
Default Edition..................................................................... 18-24 18.10.5 Setting the Edition Attribute of
a Database Service ................................................. 18-25 18.10.6 Using an Edition
............................................................................................................ 18-26 18.10.7 Editions Data
Dictionary Views.................................................................................. 18-27 18.11 Displaying Information
About Schema Objects................................................................... 18-27 18.11.1 Using a PL/SQL Package
to Display Information About Schema Objects .......... 18-27 xvii 18.11.2 Schema Objects Data Dictionary
Views ..................................................................... 18-28 19 Managing Space for Schema Objects 19.1
Managing Tablespace Alerts....................................................................................................... 19-1 19.1.1
About Managing Tablespace Alerts ............................................................................... 19-1 19.1.2 Setting
Alert Thresholds................................................................................................... 19-2 19.1.3 Viewing Alerts
................................................................................................................... 19-4 19.1.4
Limitations.......................................................................................................................... 19-5 19.2
Managing Resumable Space Allocation .................................................................................... 19-5 19.2.1
Resumable Space Allocation Overview ......................................................................... 19-6 19.2.2
Enabling and Disabling Resumable Space Allocation ................................................. 19-8 19.2.3 Using a
LOGON Trigger to Set Default Resumable Mode ....................................... 19-10 19.2.4 Detecting
Suspended Statements.................................................................................. 19-11 19.2.5 Operation-
Suspended Alert........................................................................................... 19-13 19.2.6 Resumable Space
Allocation Example: Registering an AFTER SUSPEND Trigger 19-13 19.3 Reclaiming Unused Space
......................................................................................................... 19-14 19.3.1 About Reclaimable
Unused Space ................................................................................ 19-14 19.3.2 The Segment Advisor
..................................................................................................... 19-15 19.3.3 Shrinking Database
Segments Online .......................................................................... 19-29 19.3.4 Deallocating Unused Space
........................................................................................... 19-31 19.4 Dropping Unused Object Storage
............................................................................................ 19-32 19.5 Understanding Space Usage of Data
Types............................................................................ 19-33 19.6 Displaying Information About Space
Usage for Schema Objects ....................................... 19-33 19.6.1 Using PL/SQL Packages to Display
Information About Schema Object Space Usage
........................................................................................................................................ 19-33 19.6.2
Schema Objects Space Usage Data Dictionary Views................................................ 19-34 19.7 Capacity
Planning for Database Objects ................................................................................ 19-36 19.7.1 Estimating
the Space Use of a Table ............................................................................ 19-36 19.7.2 Estimating the
Space Use of an Index ......................................................................... 19-37 19.7.3 Obtaining Object
Growth Trends ................................................................................. 19-37 20 Managing Tables 20.1 About
Tables.................................................................................................................................. 20-1 20.2
Guidelines for Managing Tables ................................................................................................ 20-2 20.2.1
Design Tables Before Creating Them ............................................................................. 20-2 20.2.2 Specify
the Type of Table to Create ................................................................................ 20-3 20.2.3 Specify the
Location of Each Table ................................................................................. 20-3 20.2.4 Consider
Parallelizing Table Creation ........................................................................... 20-4 20.2.5 Consider Using
NOLOGGING When Creating Tables .............................................. 20-4 20.2.6 Consider Using Table
Compression............................................................................... 20-4 20.2.7 Managing Table Compression
Using Enterprise Manager Cloud Control ............ 20-14 20.2.8 Consider Using Segment-Level and Row-
Level Compression Tiering................... 20-17 20.2.9 Consider Using Attribute-Clustered
Tables................................................................ 20-18 xviii 20.2.10 Consider Using Zone Maps
......................................................................................... 20-20 20.2.11 Consider Storing Tables in the In-
Memory Column Store...................................... 20-21 20.2.12 Consider Using Invisible
Columns............................................................................. 20-21 20.2.13 Consider Encrypting Columns
That Contain Sensitive Data ................................. 20-24 20.2.14 Understand Deferred Segment Creation
................................................................... 20-25 20.2.15 Materializing Segments
................................................................................................ 20-27 20.2.16 Estimate Table Size and Plan
Accordingly................................................................ 20-28 20.2.17 Restrictions to Consider When
Creating Tables ....................................................... 20-28 20.3 Creating
Tables............................................................................................................................ 20-29 20.3.1
Example: Creating a Table ............................................................................................. 20-29 20.3.2
Creating a Temporary Table.......................................................................................... 20-30 20.3.3
Parallelizing Table Creation........................................................................................... 20-32 20.4 Loading
Tables ............................................................................................................................ 20-33 20.4.1
Methods for Loading Tables.......................................................................................... 20-33 20.4.2
Improving INSERT Performance with Direct-Path INSERT .................................... 20-34 20.4.3 Using
Conventional Inserts to Load Tables................................................................. 20-39 20.4.4 Avoiding Bulk
INSERT Failures with DML Error Logging...................................... 20-40 20.5 Automatically Collecting
Statistics on Tables ........................................................................ 20-44 20.6 Altering Tables
............................................................................................................................ 20-45 20.6.1 Reasons for
Using the ALTER TABLE Statement....................................................... 20-45 20.6.2 Altering Physical
Attributes of a Table ........................................................................ 20-46 20.6.3 Moving a Table to a New
Segment or Tablespace...................................................... 20-46 20.6.4 Manually Allocating Storage for a
Table ..................................................................... 20-49 20.6.5 Modifying an Existing Column
Definition.................................................................. 20-49 20.6.6 Adding Table Columns
.................................................................................................. 20-49 20.6.7 Renaming Table
Columns.............................................................................................. 20-50 20.6.8 Dropping Table
Columns .............................................................................................. 20-51 20.6.9 Placing a Table in
Read-Only Mode ............................................................................. 20-53 20.7 Redefining Tables Online
.......................................................................................................... 20-54 20.7.1 About Redefining Tables
Online................................................................................... 20-54 20.7.2 Features of Online Table
Redefinition.......................................................................... 20-55 20.7.3 Performing Online Redefinition
with the REDEF_TABLE Procedure .................... 20-56 20.7.4 Redefining Tables Online with Multiple
Procedures in DBMS_REDEFINITION 20-57 20.7.5 Results of the Redefinition
Process............................................................................... 20-63 20.7.6 Performing Intermediate
Synchronization.................................................................. 20-64 20.7.7 Aborting Online Table
Redefinition and Cleaning Up After Errors........................ 20-64 20.7.8 Restrictions for Online
Redefinition of Tables ............................................................ 20-65 20.7.9 Online Redefinition of One or
More Partitions........................................................... 20-67 20.7.10 Online Table Redefinition
Examples.......................................................................... 20-69 20.7.11 Privileges Required for the
DBMS_REDEFINITION Package ............................... 20-90 20.8 Researching and Reversing Erroneous
Table Changes......................................................... 20-91 20.9 Recovering Tables Using Oracle Flashback
Table ................................................................. 20-92 20.10 Dropping Tables
....................................................................................................................... 20-92 xix 20.11 Using
Flashback Drop and Managing the Recycle Bin ....................................................... 20-94 20.11.1 What Is
the Recycle Bin?............................................................................................... 20-94 20.11.2 Enabling and
Disabling the Recycle Bin .................................................................... 20-95 20.11.3 Viewing and Querying
Objects in the Recycle Bin................................................... 20-96 20.11.4 Purging Objects in the Recycle
Bin ............................................................................. 20-96 20.11.5 Restoring Tables from the Recycle
Bin....................................................................... 20-97 20.12 Managing Index-Organized Tables
....................................................................................... 20-99 20.12.1 What Are Index-Organized Tables?
........................................................................... 20-99 20.12.2 Creating Index-Organized
Tables............................................................................. 20-100 20.12.3 Maintaining Index-Organized
Tables ...................................................................... 20-105 20.12.4 Creating Secondary Indexes on Index-
Organized Tables ..................................... 20-106 20.12.5 Analyzing Index-Organized
Tables.......................................................................... 20-108 20.12.6 Using the ORDER BY Clause with
Index-Organized Tables................................ 20-109 20.12.7 Converting Index-Organized Tables to
Regular Tables ........................................ 20-109 20.13 Managing External Tables
..................................................................................................... 20-109 20.13.1 About External Tables
................................................................................................ 20-110 20.13.2 Creating External Tables
............................................................................................ 20-111 20.13.3 Altering External
Tables............................................................................................. 20-113 20.13.4 Preprocessing External
Tables................................................................................... 20-114 20.13.5 Dropping External Tables
.......................................................................................... 20-115 20.13.6 System and Object Privileges for
External Tables .................................................. 20-116 20.14 Tables Data Dictionary Views
.............................................................................................. 20-116 21 Managing Indexes 21.1 About
Indexes ............................................................................................................................... 21-1 21.2
Guidelines for Managing Indexes .............................................................................................. 21-2 21.2.1
Create Indexes After Inserting Table Data .................................................................... 21-2 21.2.2 Index
the Correct Tables and Columns.......................................................................... 21-2 21.2.3 Order Index
Columns for Performance ......................................................................... 21-3 21.2.4 Limit the Number of
Indexes for Each Table ................................................................ 21-4 21.2.5 Drop Indexes That Are No
Longer Required ............................................................... 21-4 21.2.6 Indexes and Deferred Segment
Creation ....................................................................... 21-4 21.2.7 Estimate Index Size and Set Storage
Parameters.......................................................... 21-4 21.2.8 Specify the Tablespace for Each Index
........................................................................... 21-5 21.2.9 Consider Parallelizing Index Creation
........................................................................... 21-5 21.2.10 Consider Creating Indexes with
NOLOGGING......................................................... 21-6 21.2.11 Understand When to Use Unusable or
Invisible Indexes ......................................... 21-6 21.2.12 Understand When to Create Multiple Indexes on
the Same Set of Columns......... 21-8 21.2.13 Consider Costs and Benefits of Coalescing or Rebuilding
Indexes ......................... 21-9 21.2.14 Consider Cost Before Disabling or Dropping
Constraints........................................ 21-9 21.2.15 Consider Using the In-Memory Column Store to
Reduce the Number of Indexes
................................................................................................................................................... 21-10 21.3
Creating Indexes ......................................................................................................................... 21-10 xx
21.3.1 Prerequisites for Creating Indexes................................................................................ 21-10 21.3.2
Creating an Index Explicitly .......................................................................................... 21-11 21.3.3
Creating a Unique Index Explicitly .............................................................................. 21-11 21.3.4 Creating
an Index Associated with a Constraint........................................................ 21-12 21.3.5 Creating a Large
Index ................................................................................................... 21-13 21.3.6 Creating an Index
Online ............................................................................................... 21-14 21.3.7 Creating a Function-
Based Index.................................................................................. 21-14 21.3.8 Creating a Compressed
Index ....................................................................................... 21-15 21.3.9 Creating an Unusable Index
.......................................................................................... 21-18 21.3.10 Creating an Invisible
Index.......................................................................................... 21-19 21.3.11 Creating Multiple Indexes
on the Same Set of Columns......................................... 21-20 21.4 Altering
Indexes.......................................................................................................................... 21-21 21.4.1 About
Altering Indexes .................................................................................................. 21-21 21.4.2 Altering
Storage Characteristics of an Index............................................................... 21-21 21.4.3 Rebuilding an
Existing Index ........................................................................................ 21-22 21.4.4 Making an Index
Unusable............................................................................................ 21-23 21.4.5 Making an Index
Invisible or Visible............................................................................ 21-25 21.4.6 Renaming an Index
......................................................................................................... 21-25 21.4.7 Monitoring Index
Usage................................................................................................. 21-26 21.5 Monitoring Space Use of
Indexes............................................................................................. 21-26 21.6 Dropping Indexes
....................................................................................................................... 21-27 21.7 Indexes Data
Dictionary Views ................................................................................................ 21-28 22 Managing
Clusters 22.1 About Clusters
.............................................................................................................................. 22-1 22.2 Guidelines for
Managing Clusters ............................................................................................. 22-2 22.2.1 Choose
Appropriate Tables for the Cluster................................................................... 22-3 22.2.2 Choose
Appropriate Columns for the Cluster Key...................................................... 22-3 22.2.3 Specify the Space
Required by an Average Cluster Key and Its Associated Rows 22-3 22.2.4 Specify the Location of Each
Cluster and Cluster Index Rows .................................. 22-4 22.2.5 Estimate Cluster Size and Set Storage
Parameters ....................................................... 22-4 22.3 Creating Clusters and Objects That Use
Them......................................................................... 22-4 22.3.1 Creating
Clusters............................................................................................................... 22-4 22.3.2 Creating
Clustered Tables................................................................................................ 22-5 22.3.3 Creating Cluster
Indexes.................................................................................................. 22-6 22.4 Altering Clusters and
Objects That Use Them ......................................................................... 22-6 22.4.1 Altering
Clusters................................................................................................................ 22-6 22.4.2 Altering
Clustered Tables ................................................................................................ 22-7 22.4.3 Altering Cluster
Indexes .................................................................................................. 22-7 22.5 Dropping Clusters and
Objects That Use Them....................................................................... 22-8 22.5.1 Dropping
Clusters............................................................................................................. 22-8 22.5.2 Dropping
Clustered Tables.............................................................................................. 22-8 22.5.3 Dropping Cluster
Indexes................................................................................................ 22-9 xxi 22.6 Clusters Data
Dictionary Views ................................................................................................. 22-9 23 Managing Hash
Clusters 23.1 About Hash Clusters
.................................................................................................................... 23-1 23.2 When to Use Hash
Clusters......................................................................................................... 23-1 23.2.1 Situations Where
Hashing Is Useful............................................................................... 23-2 23.2.2 Situations Where Hashing
Is Not Advantageous......................................................... 23-2 23.3 Creating Different Types of Hash
Clusters............................................................................... 23-2 23.3.1 Creating Hash
Clusters..................................................................................................... 23-3 23.3.2 Creating a Sorted
Hash Cluster....................................................................................... 23-3 23.3.3 Creating Single-Table
Hash Clusters.............................................................................. 23-6 23.3.4 Controlling Space Use Within
a Hash Cluster.............................................................. 23-6 23.3.5 Estimating Size Required by Hash
Clusters.................................................................. 23-9 23.4 Altering Hash
Clusters................................................................................................................. 23-9 23.5 Dropping Hash
Clusters.............................................................................................................. 23-9 23.6 Hash Clusters
Data Dictionary Views ..................................................................................... 23-10 24 Managing Views,
Sequences, and Synonyms 24.1 Managing Views
........................................................................................................................... 24-1 24.1.1 About
Views....................................................................................................................... 24-1 24.1.2 Creating
Views and Join Views....................................................................................... 24-2 24.1.3 Replacing Views
................................................................................................................ 24-4 24.1.4 Using Views in
Queries .................................................................................................... 24-5 24.1.5 DML Statements and
Join Views .................................................................................... 24-6 24.1.6 Altering Views
................................................................................................................. 24-13 24.1.7 Dropping
Views............................................................................................................... 24-13 24.2 Managing
Sequences.................................................................................................................. 24-13 24.2.1 About
Sequences ............................................................................................................. 24-13 24.2.2 Creating
Sequences ......................................................................................................... 24-14 24.2.3 Altering
Sequences.......................................................................................................... 24-15 24.2.4 Using
Sequences .............................................................................................................. 24-15 24.2.5 Dropping
Sequences ....................................................................................................... 24-18 24.3 Managing
Synonyms.................................................................................................................. 24-18 24.3.1 About
Synonyms ............................................................................................................. 24-19 24.3.2 Creating
Synonyms......................................................................................................... 24-19 24.3.3 Using
Synonyms in DML Statements .......................................................................... 24-19 24.3.4 Dropping
Synonyms....................................................................................................... 24-20 24.4 Views, Synonyms,
and Sequences Data Dictionary Views .................................................. 24-20 25 Repairing Corrupted Data
25.1 Options for Repairing Data Block Corruption ......................................................................... 25-1
25.2 About the DBMS_REPAIR Package........................................................................................... 25-1
25.2.1 DBMS_REPAIR Procedures............................................................................................. 25-2 xxii
25.2.2 Limitations and Restrictions for DBMS_REPAIR Procedures.................................... 25-2 25.3 Using
the DBMS_REPAIR Package............................................................................................ 25-3 25.3.1 Task 1:
Detect and Report Corruptions.......................................................................... 25-3 25.3.2 Task 2:
Evaluate the Costs and Benefits of Using DBMS_REPAIR............................ 25-4 25.3.3 Task 3: Make
Objects Usable............................................................................................ 25-5 25.3.4 Task 4: Repair
Corruptions and Rebuild Lost Data ..................................................... 25-6 25.4 DBMS_REPAIR
Examples........................................................................................................... 25-6 25.4.1 Examples:
Building a Repair Table or Orphan Key Table........................................... 25-6 25.4.2 Example: Detecting
Corruption ...................................................................................... 25-8 25.4.3 Example: Fixing Corrupt
Blocks ..................................................................................... 25-9 25.4.4 Example: Finding Index Entries
Pointing to Corrupt Data Blocks ............................ 25-9 25.4.5 Example: Skipping Corrupt
Blocks............................................................................... 25-10

Part IV Database Resource Management and Task Scheduling 26 Managing Automated Database
Maintenance Tasks 26.1 About Automated Maintenance
Tasks...................................................................................... 26-1 26.2 About Maintenance Windows
................................................................................................... 26-2 26.3 Configuring Automated
Maintenance Tasks ........................................................................... 26-3 26.3.1 Enabling and Disabling
Maintenance Tasks for all Maintenance Windows............ 26-3 26.3.2 Enabling and Disabling
Maintenance Tasks for Specific Maintenance Windows... 26-4 26.4 Configuring Maintenance
Windows.......................................................................................... 26-4 26.4.1 Modifying a Maintenance
Window................................................................................ 26-4 26.4.2 Creating a New Maintenance
Window.......................................................................... 26-5 26.4.3 Removing a Maintenance Window
................................................................................ 26-5 26.5 Configuring Resource Allocations for
Automated Maintenance Tasks ............................... 26-6 26.5.1 About Resource Allocations for
Automated Maintenance Tasks .............................. 26-6 26.5.2 Changing Resource Allocations for
Automated Maintenance Tasks ........................ 26-7 26.6 Automated Maintenance Tasks
Reference................................................................................ 26-7 26.6.1 Predefined Maintenance
Windows ................................................................................ 26-7 26.6.2 Automated Maintenance Tasks
Database Dictionary Views...................................... 26-8 27 Managing Resources with Oracle Database
Resource Manager 27.1 About Oracle Database Resource Manager
.............................................................................. 27-1 27.1.1 What Solutions Does the Resource
Manager Provide for Workload Management?
..................................................................................................................................................... 27-1 27.1.2
The Elements of Resource Manager ............................................................................... 27-3 27.1.3 About
Resource Manager Administration Privileges.................................................. 27-7 27.2 Assigning Sessions
to Resource Consumer Groups ................................................................ 27-8 27.2.1 Overview of
Assigning Sessions to Resource Consumer Groups.............................. 27-8 27.2.2 Assigning an Initial
Resource Consumer Group.......................................................... 27-8 27.2.3 Specifying Session-to–
Consumer Group Mapping Rules ........................................... 27-9 27.2.4 Switching Resource Consumer
Groups ....................................................................... 27-13 xxiii 27.2.5 Specifying Automatic Consumer
Group Switching................................................... 27-15 27.2.6 Granting and Revoking the Switch
Privilege.............................................................. 27-18 27.3 The Types of Resources Managed by the
Resource Manager.............................................. 27-20 27.3.1
CPU.................................................................................................................................... 27-20 27.3.2
Exadata I/O...................................................................................................................... 27-23 27.3.3
Parallel Execution Servers.............................................................................................. 27-23 27.3.4
Runaway Queries ............................................................................................................ 27-26 27.3.5
Active Session Pool with Queuing................................................................................ 27-27 27.3.6 Undo
Pool......................................................................................................................... 27-27 27.3.7 Idle Time
Limit ................................................................................................................ 27-27 27.4 Creating a Simple
Resource Plan ............................................................................................. 27-27 27.5 Creating a Complex
Resource Plan.......................................................................................... 27-29 27.5.1 About the Pending
Area................................................................................................. 27-30 27.5.2 Creating a Pending Area
................................................................................................ 27-30 27.5.3 Creating Resource Consumer
Groups ......................................................................... 27-31 27.5.4 Mapping Sessions to Consumer
Groups...................................................................... 27-31 27.5.5 Creating a Resource Plan
............................................................................................... 27-32 27.5.6 Creating Resource Plan
Directives ............................................................................... 27-33 27.5.7 Validating the Pending Area
......................................................................................... 27-39 27.5.8 Submitting the Pending Area
........................................................................................ 27-40 27.5.9 Clearing the Pending
Area............................................................................................. 27-41 27.6 Enabling Oracle Database
Resource Manager and Switching Plans................................... 27-41 27.7 Putting It All Together: Oracle
Database Resource Manager Examples ............................ 27-43 27.7.1 Multilevel Plan Example
................................................................................................ 27-44 27.7.2 Examples of Using the
Utilization Limit Attribute .................................................... 27-46 27.7.3 Example of Using Several
Resource Allocation Methods ......................................... 27-51 27.7.4 Example of Managing Parallel
Statements Using Directive Attributes .................. 27-52 27.7.5 An Oracle-Supplied Mixed Workload Plan
................................................................ 27-54 27.8 Managing Multiple Database Instances on a Single
Server.................................................. 27-55 27.8.1 About Instance Caging
................................................................................................... 27-55 27.8.2 Enabling Instance
Caging............................................................................................... 27-56 27.9 Maintaining Consumer
Groups, Plans, and Directives ........................................................ 27-56 27.9.1 Updating a Consumer
Group........................................................................................ 27-56 27.9.2 Deleting a Consumer
Group.......................................................................................... 27-57 27.9.3 Updating a Plan
............................................................................................................... 27-57 27.9.4 Deleting a
Plan................................................................................................................. 27-58 27.9.5 Updating a
Resource Plan Directive............................................................................. 27-58 27.9.6 Deleting a
Resource Plan Directive............................................................................... 27-59 27.10 Viewing Database
Resource Manager Configuration and Status ..................................... 27-60 27.10.1 Viewing Consumer
Groups Granted to Users or Roles........................................... 27-60 27.10.2 Viewing Plan
Information............................................................................................ 27-60 27.10.3 Viewing Current
Consumer Groups for Sessions .................................................... 27-61 27.10.4 Viewing the Currently
Active Plans........................................................................... 27-61 xxiv 27.11 Monitoring Oracle Database
Resource Manager ................................................................. 27-61 27.12 Interacting with Operating-
System Resource Control........................................................ 27-67 27.12.1 Guidelines for Using
Operating-System Resource Control .................................... 27-68 27.13 Oracle Database Resource
Manager Reference .................................................................... 27-68 27.13.1 Predefined Resource Plans
and Consumer Groups ................................................. 27-69 27.13.2 Predefined Consumer Group
Mapping Rules .......................................................... 27-70 27.13.3 Resource Manager Data Dictionary
Views................................................................ 27-71 28 Oracle Scheduler Concepts 28.1 Overview of
Oracle Scheduler.................................................................................................... 28-1 28.2 Jobs and
Supporting Scheduler Objects .................................................................................... 28-3 28.2.1 About
Jobs and Supporting Scheduler Objects............................................................. 28-3 28.2.2
Programs............................................................................................................................. 28-3 28.2.3
Schedules ............................................................................................................................ 28-4 28.2.4 Jobs
...................................................................................................................................... 28-4 28.2.5
Destinations........................................................................................................................ 28-6 28.2.6 File
Watchers...................................................................................................................... 28-8 28.2.7
Credentials.......................................................................................................................... 28-8 28.2.8
Chains.................................................................................................................................. 28-9 28.2.9 Job
Classes ........................................................................................................................ 28-11 28.2.10
Windows......................................................................................................................... 28-12 28.2.11
Groups............................................................................................................................. 28-16 28.3 More
About Jobs ......................................................................................................................... 28-17 28.3.1 Job
Categories .................................................................................................................. 28-17 28.3.2 Job
Instances..................................................................................................................... 28-25 28.3.3 Job
Arguments ................................................................................................................. 28-25 28.3.4 How
Programs, Jobs, and Schedules are Related....................................................... 28-26 28.4 Scheduler
Architecture .............................................................................................................. 28-26 28.4.1
Scheduler Components................................................................................................... 28-26 28.4.2 The
Job Table.................................................................................................................... 28-27 28.4.3 The Job
Coordinator........................................................................................................ 28-27 28.4.4 How Jobs
Execute............................................................................................................ 28-28 28.4.5 After Jobs
Complete........................................................................................................ 28-29 28.4.6 Using the
Scheduler in Real Application Clusters Environments ........................... 28-29 28.5 Scheduler Support for
Oracle Data Guard.............................................................................. 28-31 29 Scheduling Jobs with Oracle
Scheduler 29.1 About Scheduler Objects and Their
Naming............................................................................ 29-1 29.2 Creating, Running, and Managing Jobs
.................................................................................... 29-1 29.2.1 Job Tasks and Their
Procedures...................................................................................... 29-2 29.2.2 Creating Jobs
...................................................................................................................... 29-2 29.2.3 Altering
Jobs..................................................................................................................... 29-16 29.2.4 Running Jobs
.................................................................................................................... 29-16 xxv 29.2.5 Stopping Jobs
................................................................................................................... 29-17 29.2.6 Stopping External
Jobs.................................................................................................... 29-18 29.2.7 Stopping a Chain Job
...................................................................................................... 29-18 29.2.8 Dropping Jobs
.................................................................................................................. 29-18 29.2.9 Dropping Running
Jobs.................................................................................................. 29-19 29.2.10 Dropping Multiple
Jobs................................................................................................ 29-19 29.2.11 Disabling Jobs
................................................................................................................ 29-20 29.2.12 Enabling
Jobs.................................................................................................................. 29-21 29.2.13 Copying Jobs
.................................................................................................................. 29-21 29.3 Creating and
Managing Programs to Define Jobs ................................................................. 29-22 29.3.1 Program Tasks
and Their Procedures .......................................................................... 29-22 29.3.2 Creating Programs
with Scheduler............................................................................... 29-22 29.3.3 Altering
Programs........................................................................................................... 29-24 29.3.4 Dropping
Programs ........................................................................................................ 29-24 29.3.5 Disabling
Programs......................................................................................................... 29-25 29.3.6 Enabling
Programs.......................................................................................................... 29-25 29.4 Creating and
Managing Schedules to Define Jobs................................................................. 29-25 29.4.1 Schedule Tasks
and Their Procedures.......................................................................... 29-26 29.4.2 Creating
Schedules.......................................................................................................... 29-26 29.4.3 Altering
Schedules .......................................................................................................... 29-26 29.4.4 Dropping
Schedules........................................................................................................ 29-27 29.4.5 Setting the
Repeat Interval............................................................................................. 29-27 29.5 Using Events to
Start Jobs ......................................................................................................... 29-31 29.5.1 About
Events.................................................................................................................... 29-32 29.5.2 Starting
Jobs with Events Raised by Your Application ............................................. 29-32 29.5.3 Starting a Job
When a File Arrives on a System.......................................................... 29-37 29.6 Creating and Managing
Job Chains ......................................................................................... 29-44 29.6.1 About Creating and
Managing Job Chains ................................................................. 29-44 29.6.2 Chain Tasks and Their
Procedures ............................................................................... 29-44 29.6.3 Creating Chains
............................................................................................................... 29-45 29.6.4 Defining Chain Steps
...................................................................................................... 29-46 29.6.5 Adding Rules to a Chain
................................................................................................ 29-48 29.6.6 Setting an Evaluation Interval
for Chain Rules .......................................................... 29-51 29.6.7 Enabling
Chains............................................................................................................... 29-51 29.6.8 Creating Jobs
for Chains................................................................................................. 29-52 29.6.9 Dropping Chains
............................................................................................................. 29-53 29.6.10 Running Chains
............................................................................................................. 29-53 29.6.11 Dropping Chain Rules
.................................................................................................. 29-53 29.6.12 Disabling
Chains............................................................................................................ 29-54 29.6.13 Dropping Chain
Steps .................................................................................................. 29-54 29.6.14 Stopping Chains
............................................................................................................ 29-55 29.6.15 Stopping Individual
Chain Steps................................................................................ 29-55 29.6.16 Pausing Chains
.............................................................................................................. 29-55 xxvi 29.6.17 Skipping Chain
Steps.................................................................................................... 29-56 29.6.18 Running Part of a
Chain............................................................................................... 29-57 29.6.19 Monitoring Running
Chains........................................................................................ 29-57 29.6.20 Handling Stalled Chains
.............................................................................................. 29-57 29.7 Prioritizing
Jobs........................................................................................................................... 29-58 29.7.1 Managing
Job Priorities with Job Classes .................................................................... 29-58 29.7.2 Setting Relative
Job Priorities Within a Job Class....................................................... 29-60 29.7.3 Managing Job Scheduling
and Job Priorities with Windows ................................... 29-60 29.7.4 Managing Job Scheduling and Job
Priorities with Window Groups....................... 29-65 29.7.5 Allocating Resources Among Jobs Using
Resource Manager .................................. 29-68 29.7.6 Example of Resource Allocation for
Jobs..................................................................... 29-69 29.8 Monitoring
Jobs........................................................................................................................... 29-70 29.8.1 About
Monitoring Jobs ................................................................................................... 29-70 29.8.2 The Job
Log....................................................................................................................... 29-70 29.8.3 Monitoring
Multiple Destination Jobs ......................................................................... 29-73 29.8.4 Monitoring Job
State with Events Raised by the Scheduler...................................... 29-74 29.8.5 Monitoring Job State
with E-mail Notifications.......................................................... 29-77 30 Administering Oracle Scheduler
30.1 Configuring Oracle Scheduler .................................................................................................... 30-1
30.1.1 Setting Oracle Scheduler Privileges................................................................................ 30-1 30.1.2
Setting Scheduler Preferences.......................................................................................... 30-2 30.1.3 Using
the Oracle Scheduler Agent to Run Remote Jobs.............................................. 30-4 30.2 Monitoring and
Managing the Scheduler ............................................................................... 30-11 30.2.1 Viewing the
Currently Active Window and Resource Plan ..................................... 30-11 30.2.2 Finding Information
About Currently Running Jobs ................................................ 30-11 30.2.3 Monitoring and Managing
Window and Job Logs .................................................... 30-12 30.2.4 Managing Scheduler
Security........................................................................................ 30-15 30.3 Import/Export and the
Scheduler............................................................................................ 30-15 30.4 Troubleshooting the
Scheduler................................................................................................. 30-16 30.4.1 A Job Does Not
Run........................................................................................................ 30-16 30.4.2 A Program Becomes
Disabled ....................................................................................... 30-18 30.4.3 A Window Fails to Take
Effect...................................................................................... 30-18 30.5 Examples of Using the
Scheduler............................................................................................. 30-18 30.5.1 Examples of Creating
Job Classes ................................................................................. 30-19 30.5.2 Examples of Setting
Attributes...................................................................................... 30-19 30.5.3 Examples of Creating
Chains ........................................................................................ 30-21 30.5.4 Examples of Creating Jobs
and Schedules Based on Events..................................... 30-22 30.5.5 Example of Creating a Job In an
Oracle Data Guard Environment......................... 30-23 30.6 Scheduler Reference
................................................................................................................... 30-24 30.6.1 Scheduler
Privileges........................................................................................................ 30-24 30.6.2 Scheduler Data
Dictionary Views ................................................................................. 30-26 xxvii Part V Distributed
Database Management 31 Distributed Database Concepts 31.1 Distributed Database
Architecture............................................................................................. 31-1 31.1.1 Homogenous
Distributed Database Systems................................................................ 31-1 31.1.2 Heterogeneous
Distributed Database Systems ............................................................. 31-3 31.1.3 Client/Server Database
Architecture ............................................................................. 31-4 31.2 Database Links
.............................................................................................................................. 31-5 31.2.1 What Are
Database Links?............................................................................................... 31-6 31.2.2 What Are Shared
Database Links? ................................................................................. 31-7 31.2.3 Why Use Database
Links?................................................................................................ 31-8 31.2.4 Global Database Names in
Database Links................................................................... 31-8 31.2.5 Global Name as a Loopback
Database Link.................................................................. 31-9 31.2.6 Names for Database Links
............................................................................................. 31-10 31.2.7 Types of Database
Links................................................................................................. 31-10 31.2.8 Users of Database Links
................................................................................................. 31-12 31.2.9 Creation of Database Links:
Examples......................................................................... 31-14 31.2.10 Schema Objects and Database
Links .......................................................................... 31-15 31.2.11 Database Link
Restrictions........................................................................................... 31-17 31.3 Distributed Database
Administration ..................................................................................... 31-18 31.3.1 Site Autonomy
................................................................................................................. 31-18 31.3.2 Distributed
Database Security....................................................................................... 31-19 31.3.3 Auditing Database
Links................................................................................................ 31-24 31.3.4 Administration
Tools...................................................................................................... 31-24 31.4 Transaction Processing
in a Distributed System.................................................................... 31-25 31.4.1 Remote SQL Statements
................................................................................................. 31-25 31.4.2 Distributed SQL
Statements........................................................................................... 31-26 31.4.3 Shared SQL for
Remote and Distributed Statements ................................................ 31-26 31.4.4 Remote
Transactions....................................................................................................... 31-27 31.4.5 Distributed
Transactions ................................................................................................ 31-27 31.4.6 Two-Phase
Commit Mechanism ................................................................................... 31-27 31.4.7 Database Link
Name Resolution................................................................................... 31-28 31.4.8 Schema Object Name
Resolution .................................................................................. 31-30 31.4.9 Global Name Resolution in
Views, Synonyms, and Procedures.............................. 31-33 31.5 Distributed Database Application
Development................................................................... 31-34 31.5.1 Transparency in a Distributed
Database System........................................................ 31-35 31.5.2 Remote Procedure Calls (RPCs)
.................................................................................... 31-36 31.5.3 Distributed Query
Optimization................................................................................... 31-37 31.6 Character Set Support for
Distributed Environments........................................................... 31-37 31.6.1 About Character Set Support
for Distributed Environments ................................... 31-37 31.6.2 Client/Server Environment
........................................................................................... 31-38 31.6.3 Homogeneous Distributed
Environment .................................................................... 31-38 xxviii 31.6.4 Heterogeneous Distributed
Environment ................................................................... 31-39 32 Managing a Distributed Database 32.1
Managing Global Names in a Distributed System .................................................................. 32-1 32.1.1
Understanding How Global Database Names Are Formed ....................................... 32-1 32.1.2
Determining Whether Global Naming Is Enforced...................................................... 32-2 32.1.3 Viewing a
Global Database Name .................................................................................. 32-2 32.1.4 Changing the
Domain in a Global Database Name ..................................................... 32-3 32.1.5 Changing a Global
Database Name: Scenario............................................................... 32-3 32.2 Creating Database
Links.............................................................................................................. 32-6 32.2.1 Obtaining
Privileges Necessary for Creating Database Links.................................... 32-6 32.2.2 Specifying Link Types
...................................................................................................... 32-6 32.2.3 Specifying Link Users
....................................................................................................... 32-8 32.2.4 Using Connection Qualifiers
to Specify Service Names Within Link Names........ 32-10 32.3 Using Shared Database Links
................................................................................................... 32-11 32.3.1 Determining Whether to Use
Shared Database Links ............................................... 32-11 32.3.2 Creating Shared Database Links
................................................................................... 32-12 32.3.3 Configuring Shared Database
Links............................................................................. 32-12 32.4 Managing Database Links
......................................................................................................... 32-14 32.4.1 Closing Database Links
.................................................................................................. 32-14 32.4.2 Dropping Database Links
.............................................................................................. 32-15 32.4.3 Limiting the Number of Active
Database Link Connections.................................... 32-16 32.5 Viewing Information About Database
Links.......................................................................... 32-16 32.5.1 Determining Which Links Are in the
Database .......................................................... 32-16 32.5.2 Determining Which Link Connections Are
Open ...................................................... 32-18 32.6 Creating Location Transparency
.............................................................................................. 32-19 32.6.1 Using Views to Create Location
Transparency........................................................... 32-19 32.6.2 Using Synonyms to Create Location
Transparency ................................................... 32-20 32.6.3 Using Procedures to Create Location
Transparency ................................................. 32-22 32.7 Managing Statement Transparency
......................................................................................... 32-24 32.8 Managing a Distributed Database:
Examples......................................................................... 32-25 32.8.1 Example 1: Creating a Public Fixed
User Database Link .......................................... 32-25 32.8.2 Example 2: Creating a Public Fixed User
Shared Database Link ............................. 32-26 32.8.3 Example 3: Creating a Public Connected User
Database Link ................................. 32-26 32.8.4 Example 4: Creating a Public Connected User Shared
Database Link.................... 32-27 32.8.5 Example 5: Creating a Public Current User Database Link
...................................... 32-27 33 Developing Applications for a Distributed Database System 33.1
Managing the Distribution of Application Data ...................................................................... 33-1 33.2
Controlling Connections Established by Database Links....................................................... 33-1 33.3
Maintaining Referential Integrity in a Distributed System .................................................... 33-2 33.4
Tuning Distributed Queries ........................................................................................................ 33-3 33.4.1
Using Collocated Inline Views ........................................................................................ 33-3 xxix 33.4.2
Using Cost-Based Optimization...................................................................................... 33-4 33.4.3 Using
Hints......................................................................................................................... 33-6 33.4.4 Analyzing
the Execution Plan ......................................................................................... 33-7 33.5 Handling Errors in
Remote Procedures .................................................................................... 33-9 34 Distributed
Transactions Concepts 34.1 What Are Distributed Transactions?
......................................................................................... 34-1 34.1.1 DML and DDL
Transactions............................................................................................ 34-2 34.1.2 Transaction Control
Statements ...................................................................................... 34-2 34.2 Session Trees for Distributed
Transactions............................................................................... 34-3 34.2.1 About Session Trees for
Distributed Transactions ....................................................... 34-3 34.2.2 Clients
................................................................................................................................ 34-4 34.2.3 Database
Servers................................................................................................................ 34-4 34.2.4 Local
Coordinators ........................................................................................................... 34-4 34.2.5 Global
Coordinator ........................................................................................................... 34-5 34.2.6 Commit
Point Site ............................................................................................................. 34-5 34.3 Two-Phase
Commit Mechanism................................................................................................. 34-8 34.3.1 About the
Two-Phase Commit Mechanism .................................................................. 34-8 34.3.2 Prepare
Phase..................................................................................................................... 34-9 34.3.3 Commit
Phase.................................................................................................................. 34-11 34.3.4 Forget Phase
..................................................................................................................... 34-12 34.4 In-Doubt
Transactions................................................................................................................ 34-12 34.4.1 About
In-Doubt Transactions........................................................................................ 34-13 34.4.2 Automatic
Resolution of In-Doubt Transactions........................................................ 34-13 34.4.3 Manual Resolution
of In-Doubt Transactions............................................................. 34-15 34.4.4 Relevance of System
Change Numbers for In-Doubt Transactions......................... 34-15 34.5 Distributed Transaction
Processing: Case Study ................................................................... 34-16 34.5.1 About the Distributed
Transaction Processing Case Study ...................................... 34-16 34.5.2 Stage 1: Client Application
Issues DML Statements .................................................. 34-16 34.5.3 Stage 2: Oracle Database
Determines Commit Point Site.......................................... 34-17 34.5.4 Stage 3: Global Coordinator Sends
Prepare Response............................................... 34-18 34.5.5 Stage 4: Commit Point Site
Commits............................................................................ 34-19 34.5.6 Stage 5: Commit Point Site Informs
Global Coordinator of Commit ...................... 34-19 34.5.7 Stage 6: Global and Local Coordinators Tell All
Nodes to Commit ........................ 34-19 34.5.8 Stage 7: Global Coordinator and Commit Point Site
Complete the Commit ......... 34-20 35 Managing Distributed Transactions 35.1 Specifying the Commit
Point Strength of a Node.................................................................... 35-1 35.2 Naming Transactions
................................................................................................................... 35-1 35.3 Viewing Information
About Distributed Transactions........................................................... 35-2 35.3.1 Determining the ID
Number and Status of Prepared Transactions........................... 35-2 35.3.2 Tracing the Session Tree of In-
Doubt Transactions...................................................... 35-4 35.4 Deciding How to Handle In-Doubt
Transactions.................................................................... 35-5 xxx 35.4.1 Discovering Problems with a
Two-Phase Commit ...................................................... 35-6 35.4.2 Determining Whether to Perform a
Manual Override ................................................ 35-6 35.4.3 Analyzing the Transaction
Data...................................................................................... 35-7 35.5 Manually Overriding In-Doubt
Transactions........................................................................... 35-8 35.5.1 Manually Committing an In-
Doubt Transaction.......................................................... 35-8 35.5.2 Manually Rolling Back an In-Doubt
Transaction ......................................................... 35-9 35.6 Purging Pending Rows from the Data
Dictionary................................................................. 35-10 35.6.1 About Purging Pending Rows from the
Data Dictionary ......................................... 35-10 35.6.2 Executing the PURGE_LOST_DB_ENTRY
Procedure............................................... 35-10 35.6.3 Determining When to Use DBMS_TRANSACTION
................................................. 35-11 35.7 Manually Committing an In-Doubt Transaction:
Example.................................................. 35-11 35.7.1 Step 1: Record User
Feedback........................................................................................ 35-12 35.7.2 Step 2: Query
DBA_2PC_PENDING............................................................................ 35-12 35.7.3 Step 3: Query
DBA_2PC_NEIGHBORS on Local Node ............................................ 35-14 35.7.4 Step 4: Querying Data
Dictionary Views on All Nodes ............................................ 35-15 35.7.5 Step 5: Commit the In-Doubt
Transaction ................................................................... 35-17 35.7.6 Step 6: Check for Mixed Outcome
Using DBA_2PC_PENDING............................. 35-17 35.8 Data Access Failures Due to
Locks........................................................................................... 35-18 35.8.1 Transaction Timeouts
..................................................................................................... 35-18 35.8.2 Locks from In-Doubt
Transactions ............................................................................... 35-18 35.9 Simulating Distributed
Transaction Failure ........................................................................... 35-18 35.9.1 Forcing a Distributed
Transaction to Fail .................................................................... 35-19 35.9.2 Disabling and Enabling RECO
...................................................................................... 35-19 35.10 Managing Read
Consistency................................................................................................... 35-20

Вам также может понравиться