Documente Academic
Documente Profesional
Documente Cultură
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
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)
Data Manipulation
Transactions and Undo Data
Undo Data Versus Redo Data
Configuring Undo Retention
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
Data Replication
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
ASM TOPICS
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
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