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

[1]

Oracle
Database

Administrator's Guide
12c Release 1 (12.1)
E41484-10

August 2014

Oracle Database Administrator's Guide, 12c Release 1 (12.1)


E41484-10
Copyright 2001, 2014, Oracle and/or its affiliates. All rights reserved.
Primary Author:

Randy Urbano

Contributor: The Oracle Database 12c documentation is dedicated to Mark Townsend, who was an
inspiration to all who worked on this release.
Contributing Author:

Leo Cloutier, Steve Fogel, Pradeep Gopal, Janis Greenberg

Contributors: A. Agrawal, L. Ashdown, P. Avril, D. Austin, B. Baddepudi, H. Baer, C. Baird, R. Balwada, S.


Battula, M. Bauer, T. Bednar, E. Belden, J. Byun, D. Chatterjee, A. Chaudhry, B. Cheng, H. Chien, T. Chien, G.
Christman, C. C. Chui, G. Claborn, C. Colrain, K. Cook, J. Creighton, A. Dadhich, S. Datta, S. Davidson, M.
Dilman, J. Draaijer, M. Fallen, D. Gagne, A. Ganesh, GP Gongloor, F. Gonzales, J. Gonzalez, V. Goorah, S.
Gopalan, S. Gupta, B. Habeck, S. Hase, M. Hayasaka, W. Hodak, W. Hu, P. Huey, C. Iyer, K. Itikarlapalli, S.
Jain, K. Jernigan, S. Joshi, B. Khaladkar, B. Krishnan, V. Krishnaswamy, A. Kruglikov, B. Kuchibhotla, S.
Kumar, V. Kumar, H. Lakshmanan, P. Lane, A. Lee, B. Lee, J. Lee, S. K. Lee, C. Lei, B. Leung, Y. Li, I.
Listvinsky, B. Llewellyn, B. Lundhild, S. Lynn, R. Mani, V. Marwah, C. McGregor, B. McGuirk, K. Mensah, E.
Miner, M. Minhas, K. Mohan, P. Murguia, A. Mylavarapu, V. Moore, N. Mukherjee, S. Muthulingam, G.
Ngai, L. Nim, S. Panchumarthy, R. Pang, V. Panteleenko, R. Pfau, R. Pingte, K. Rajamani, A. Raghavan, M.
Ramacher, R. Ramkissoon, S. Ravindhran, A. Ray, W. Ren, K. Rich, S. Sonawane, Y. Sarig, M. Savanur, S.
Shankar, D. Sharma, A. Shen, B. Sinha, J. Spiller, V. Srihari, D. Steiner, J. Stern, M. Stewart, R. Swonger, M.
Subramaniam, M. Susairaj, A. Tran, A. Tsukerman, T. Ueda, K. Umamageswaran, D. Utzig, E. Voss, X. Wang,
M. Wei, S. Wertheimer, P. Wheeler, D. Williams, A. Witkowski, D. M. Wong, Z. Yang, P. Youn, T. F. Yu, W.
Zhang
This software and related documentation are provided under a license agreement containing restrictions on
use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your
license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license,
transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse
engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is
prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If
you find any errors, please report them to us in writing.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it
on behalf of the U.S. Government, the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software,
any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users
are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and
agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and
adaptation of the programs, including any operating system, integrated software, any programs installed on
the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to
the programs. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management
applications. It is not developed or intended for use in any inherently dangerous applications, including
applications that may create a risk of personal injury. If you use this software or hardware in dangerous
applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other
measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages
caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of
their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks
are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD,
Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced
Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information on content, products,
and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly
disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle
Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your
access to or use of third-party content, products, or services.

Contents
Preface ................................................................................................................................................................ xli
Audience...................................................................................................................................................... xli
Documentation Accessibility .................................................................................................................... xli
Related Documents ................................................................................................................................... xlii
Conventions ............................................................................................................................................... xlii

Changes in This Release for Oracle Database Administrator's Guide ..................... xliii
Changes in Oracle Database 12c Release 1 (12.1.0.2)........................................................................... xliii
Changes in Oracle Database 12c Release 1 (12.1.0.1)............................................................................ xlv

Part I
1

Basic Database Administration

Getting Started with Database Administration


Types of Oracle Database Users ............................................................................................................
Database Administrators ..................................................................................................................
Security Officers .................................................................................................................................
Network Administrators...................................................................................................................
Application Developers.....................................................................................................................
Application Administrators..............................................................................................................
Database Users ...................................................................................................................................
Tasks of a Database Administrator.......................................................................................................
Task 1: Evaluate the Database Server Hardware ..........................................................................
Task 2: Install the Oracle Database Software .................................................................................
Task 3: Plan the Database..................................................................................................................
Task 4: Create and Open the Database ...........................................................................................
Task 5: Back Up the Database...........................................................................................................
Task 6: Enroll System Users..............................................................................................................
Task 7: Implement the Database Design.........................................................................................
Task 8: Back Up the Fully Functional Database ............................................................................
Task 9: Tune Database Performance ...............................................................................................
Task 10: Download and Install Patches ..........................................................................................
Task 11: Roll Out to Additional Hosts ............................................................................................
Submitting Commands and SQL to the Database.............................................................................
About SQL*Plus..................................................................................................................................
Connecting to the Database with SQL*Plus ...................................................................................

1-1
1-1
1-2
1-2
1-2
1-2
1-3
1-3
1-3
1-3
1-4
1-4
1-5
1-5
1-5
1-5
1-5
1-5
1-6
1-6
1-7
1-7

iii

Identifying Your Oracle Database Software Release.....................................................................


Release Number Format.................................................................................................................
Checking Your Current Release Number....................................................................................
About Database Administrator Security and Privileges ...............................................................
The Database Administrator's Operating System Account ......................................................
Administrative User Accounts......................................................................................................
Database Administrator Authentication ..........................................................................................
Administrative Privileges ..............................................................................................................
Selecting an Authentication Method for Database Administrators ........................................
Using Operating System Authentication.....................................................................................
Using Password File Authentication............................................................................................
Creating and Maintaining a Database Password File ....................................................................
Creating a Database Password File with ORAPWD..................................................................
Sharing and Disabling the Database Password File...................................................................
Adding Users to a Database Password File ................................................................................
Maintaining a Database Password File........................................................................................
Data Utilities ..........................................................................................................................................

1-13
1-13
1-13
1-14
1-14
1-14
1-17
1-17
1-19
1-21
1-23
1-25
1-25
1-30
1-32
1-34
1-34

Creating and Configuring an Oracle Database


About Creating an Oracle Database ..................................................................................................... 2-1
Considerations Before Creating the Database ............................................................................... 2-2
Creating a Database with DBCA........................................................................................................... 2-5
Creating a Database with Interactive DBCA.................................................................................. 2-5
Creating a Database with Noninteractive/Silent DBCA.............................................................. 2-5
Creating a Database with the CREATE DATABASE Statement .................................................... 2-6
Step 1: Specify an Instance Identifier (SID) .................................................................................... 2-7
Step 2: Ensure That the Required Environment Variables Are Set............................................. 2-7
Step 3: Choose a Database Administrator Authentication Method............................................ 2-8
Step 4: Create the Initialization Parameter File.............................................................................. 2-8
Step 5: (Windows Only) Create an Instance................................................................................... 2-9
Step 6: Connect to the Instance......................................................................................................... 2-9
Step 7: Create a Server Parameter File ......................................................................................... 2-10
Step 8: Start the Instance ............................................................................................................... 2-11
Step 9: Issue the CREATE DATABASE Statement..................................................................... 2-11
Step 10: Create Additional Tablespaces....................................................................................... 2-15
Step 11: Run Scripts to Build Data Dictionary Views ............................................................... 2-15
Step 12: (Optional) Run Scripts to Install Additional Options ................................................. 2-16
Step 13: Back Up the Database. ..................................................................................................... 2-16
Step 14: (Optional) Enable Automatic Instance Startup ............................................................ 2-16
Specifying CREATE DATABASE Statement Clauses ................................................................... 2-16
Protecting Your Database: Specifying Passwords for Users SYS and SYSTEM .................... 2-17
Creating a Locally Managed SYSTEM Tablespace..................................................................... 2-17
About the SYSAUX Tablespace..................................................................................................... 2-18
Using Automatic Undo Management: Creating an Undo Tablespace.................................... 2-19
Creating a Default Permanent Tablespace .................................................................................. 2-19
Creating a Default Temporary Tablespace.................................................................................. 2-19
Specifying Oracle Managed Files at Database Creation............................................................ 2-20

iv

Supporting Bigfile Tablespaces During Database Creation......................................................


Specifying the Database Time Zone and Time Zone File..........................................................
Specifying FORCE LOGGING Mode ...........................................................................................
Specifying Initialization Parameters.................................................................................................
About Initialization Parameters and Initialization Parameter Files ........................................
Determining the Global Database Name.....................................................................................
Specifying a Fast Recovery Area...................................................................................................
Specifying Control Files ................................................................................................................
Specifying Database Block Sizes ...................................................................................................
Specifying the Maximum Number of Processes.........................................................................
Specifying the DDL Lock Timeout ...............................................................................................
Specifying the Method of Undo Space Management ................................................................
About The COMPATIBLE Initialization Parameter ..................................................................
Setting the License Parameter .......................................................................................................
Managing Initialization Parameters Using a Server Parameter File ...........................................
What Is a Server Parameter File? ..................................................................................................
Migrating to a Server Parameter File ...........................................................................................
Creating a Server Parameter File ..................................................................................................
The SPFILE Initialization Parameter ............................................................................................
Changing Initialization Parameter Values ..................................................................................
Clearing Initialization Parameter Values.....................................................................................
Exporting the Server Parameter File ............................................................................................
Backing Up the Server Parameter File .........................................................................................
Recovering a Lost or Damaged Server Parameter File ..............................................................
Viewing Parameter Settings ..........................................................................................................
Managing Application Workloads with Database Services ........................................................
Database Services ............................................................................................................................
Global Data Services .......................................................................................................................
Database Service Data Dictionary Views.....................................................................................
Considerations After Creating a Database.......................................................................................
Some Security Considerations.......................................................................................................
Enabling Transparent Data Encryption .......................................................................................
Creating a Secure External Password Store ................................................................................
Using Transaction Guard and Application Continuity.............................................................
Installing the Oracle Database Sample Schemas ........................................................................
Cloning a Database with CloneDB....................................................................................................
About Cloning a Database with CloneDB...................................................................................
Cloning a Database with CloneDB ...............................................................................................
After Cloning a Database with CloneDB.....................................................................................
Dropping a Database ............................................................................................................................
Database Data Dictionary Views .......................................................................................................
Database Configuration Assistant Command Reference for Silent Mode ................................
createDatabase .................................................................................................................................
configureDatabase...........................................................................................................................
createTemplateFromDB .................................................................................................................
createCloneTemplate ......................................................................................................................
generateScripts ................................................................................................................................

2-21
2-22
2-23
2-24
2-25
2-27
2-28
2-28
2-29
2-30
2-30
2-31
2-32
2-32
2-33
2-33
2-34
2-34
2-36
2-36
2-38
2-38
2-38
2-39
2-39
2-40
2-40
2-43
2-44
2-45
2-45
2-46
2-46
2-47
2-47
2-47
2-48
2-48
2-53
2-54
2-54
2-55
2-57
2-62
2-64
2-65
2-66

deleteDatabase.................................................................................................................................
createPluggableDatabase ...............................................................................................................
unplugDatabase...............................................................................................................................
deletePluggableDatabase ...............................................................................................................
configurePluggableDatabase.........................................................................................................

2-67
2-68
2-71
2-72
2-73

Starting Up and Shutting Down


Starting Up a Database............................................................................................................................ 3-1
About Database Startup Options ..................................................................................................... 3-1
Specifying Initialization Parameters at Startup ............................................................................. 3-2
About Automatic Startup of Database Services ............................................................................ 3-4
Preparing to Start Up an Instance.................................................................................................... 3-5
Starting Up an Instance ..................................................................................................................... 3-6
Altering Database Availability.............................................................................................................. 3-9
Mounting a Database to an Instance ............................................................................................... 3-9
Opening a Closed Database........................................................................................................... 3-10
Opening a Database in Read-Only Mode .................................................................................... 3-10
Restricting Access to an Open Database...................................................................................... 3-11
Shutting Down a Database.................................................................................................................. 3-11
Shutting Down with the Normal Mode....................................................................................... 3-12
Shutting Down with the Immediate Mode ................................................................................. 3-12
Shutting Down with the Transactional Mode............................................................................. 3-13
Shutting Down with the Abort Mode .......................................................................................... 3-13
Shutdown Timeout ......................................................................................................................... 3-14
Quiescing a Database ........................................................................................................................... 3-14
Placing a Database into a Quiesced State .................................................................................... 3-15
Restoring the System to Normal Operation ................................................................................ 3-16
Viewing the Quiesce State of an Instance .................................................................................... 3-16
Suspending and Resuming a Database ............................................................................................ 3-16

Configuring Automatic Restart of an Oracle Database


About Oracle Restart ............................................................................................................................... 4-1
Oracle Restart Overview ................................................................................................................... 4-2
About Startup Dependencies ........................................................................................................... 4-2
About Starting and Stopping Components with Oracle Restart................................................. 4-3
About Starting and Stopping Oracle Restart.................................................................................. 4-3
Oracle Restart Configuration............................................................................................................ 4-4
Oracle Restart Integration with Oracle Data Guard ..................................................................... 4-5
Fast Application Notification with Oracle Restart ........................................................................ 4-6
Configuring Oracle Restart .................................................................................................................... 4-9
Preparing to Run SRVCTL............................................................................................................. 4-10
Obtaining Help for SRVCTL.......................................................................................................... 4-11
Adding Components to the Oracle Restart Configuration ....................................................... 4-12
Removing Components from the Oracle Restart Configuration ............................................. 4-13
Disabling and Enabling Oracle Restart Management for a Component ................................ 4-14
Viewing Component Status........................................................................................................... 4-15
Viewing the Oracle Restart Configuration for a Component ................................................... 4-15

vi

Modifying the Oracle Restart Configuration for a Component ...............................................


Managing Environment Variables in the Oracle Restart Configuration ................................
Creating and Deleting Database Services with SRVCTL ..........................................................
Enabling FAN Events in an Oracle Restart Environment .........................................................
Automating the Failover of Connections Between Primary and Standby Databases...........
Enabling Clients for Fast Connection Failover ...........................................................................
Starting and Stopping Components Managed by Oracle Restart ...............................................
Stopping and Restarting Oracle Restart for Maintenance Operations.......................................
SRVCTL Command Reference for Oracle Restart..........................................................................
add.....................................................................................................................................................
config.................................................................................................................................................
disable ...............................................................................................................................................
downgrade .......................................................................................................................................
enable ................................................................................................................................................
getenv................................................................................................................................................
modify...............................................................................................................................................
remove ..............................................................................................................................................
setenv ................................................................................................................................................
start....................................................................................................................................................
status .................................................................................................................................................
stop ....................................................................................................................................................
unsetenv............................................................................................................................................
update ...............................................................................................................................................
upgrade.............................................................................................................................................
CRSCTL Command Reference ...........................................................................................................
check..................................................................................................................................................
config.................................................................................................................................................
disable ...............................................................................................................................................
enable ................................................................................................................................................
start....................................................................................................................................................
stop ....................................................................................................................................................

4-16
4-16
4-18
4-19
4-20
4-20
4-24
4-26
4-29
4-31
4-40
4-44
4-47
4-48
4-51
4-53
4-60
4-63
4-66
4-70
4-74
4-79
4-81
4-82
4-83
4-84
4-85
4-86
4-87
4-88
4-89

Managing Processes
About Dedicated and Shared Server Processes.................................................................................. 5-1
Dedicated Server Processes .............................................................................................................. 5-1
Shared Server Processes .................................................................................................................... 5-2
About Database Resident Connection Pooling .................................................................................. 5-4
Comparing DRCP to Dedicated Server and Shared Server ......................................................... 5-5
Configuring Oracle Database for Shared Server ............................................................................... 5-6
Initialization Parameters for Shared Server ................................................................................... 5-6
Memory Management for Shared Server ....................................................................................... 5-7
Enabling Shared Server ..................................................................................................................... 5-7
Configuring Dispatchers ................................................................................................................... 5-9
Disabling Shared Server ................................................................................................................. 5-14
Shared Server Data Dictionary Views.......................................................................................... 5-14
Configuring Database Resident Connection Pooling.................................................................... 5-15
Enabling Database Resident Connection Pooling ...................................................................... 5-15

vii

Configuring the Connection Pool for Database Resident Connection Pooling .....................
Data Dictionary Views for Database Resident Connection Pooling........................................
About Oracle Database Background Processes...............................................................................
Managing Processes for Parallel SQL Execution ............................................................................
About Parallel Execution Servers .................................................................................................
Altering Parallel Execution for a Session.....................................................................................
Managing Processes for External Procedures ..................................................................................
About External Procedures............................................................................................................
DBA Tasks to Enable External Procedure Calls..........................................................................
Terminating Sessions ...........................................................................................................................
Identifying Which Session to Terminate......................................................................................
Terminating an Active Session......................................................................................................
Terminating an Inactive Session ...................................................................................................
Process and Session Data Dictionary Views....................................................................................

5-16
5-18
5-18
5-19
5-20
5-20
5-21
5-21
5-22
5-23
5-23
5-24
5-25
5-25

Managing Memory
About Memory Management................................................................................................................. 6-1
Memory Architecture Overview............................................................................................................ 6-2
Using Automatic Memory Management ............................................................................................. 6-4
About Automatic Memory Management ....................................................................................... 6-4
Enabling Automatic Memory Management .................................................................................. 6-5
Monitoring and Tuning Automatic Memory Management ........................................................ 6-7
Configuring Memory Manually............................................................................................................ 6-8
Using Automatic Shared Memory Management .......................................................................... 6-8
Using Manual Shared Memory Management............................................................................. 6-15
Using Automatic PGA Memory Management ........................................................................... 6-20
Using Manual PGA Memory Management ................................................................................ 6-22
Using Force Full Database Caching Mode ....................................................................................... 6-22
About Force Full Database Caching Mode.................................................................................. 6-22
Before Enabling Force Full Database Caching Mode................................................................. 6-23
Enabling Force Full Database Caching Mode ............................................................................. 6-24
Disabling Force Full Database Caching Mode............................................................................ 6-24
Configuring Database Smart Flash Cache........................................................................................ 6-24
When to Configure Database Smart Flash Cache....................................................................... 6-25
Sizing Database Smart Flash Cache.............................................................................................. 6-25
Tuning Memory for Database Smart Flash Cache ..................................................................... 6-25
Database Smart Flash Cache Initialization Parameters ............................................................. 6-26
Database Smart Flash Cache in an Oracle Real Applications Clusters Environment........... 6-27
Using the In-Memory Column Store ................................................................................................. 6-27
About the IM Column Store .......................................................................................................... 6-27
Initialization Parameters Related to the IM Column Store ....................................................... 6-31
Enabling the IM Column Store for a Database ........................................................................... 6-33
Enabling and Disabling Tables for the IM Column Store ......................................................... 6-34
Enabling and Disabling Tablespaces for the IM Column Store ............................................... 6-36
Enabling and Disabling Materialized Views for the IM Column Store .................................. 6-37
Data Pump and the IM Column Store.......................................................................................... 6-38
Using IM Column Store In Enterprise Manager......................................................................... 6-38

viii

Memory Management Reference ....................................................................................................... 6-42


Platforms That Support Automatic Memory Management...................................................... 6-42
Memory Management Data Dictionary Views ........................................................................... 6-42

Managing Users and Securing the Database


The Importance of Establishing a Security Policy for Your Database...........................................
Managing Users and Resources.............................................................................................................
Managing User Privileges and Roles ...................................................................................................
Auditing Database Activity....................................................................................................................
Predefined User Accounts ......................................................................................................................

Monitoring the Database


Monitoring Errors and Alerts.................................................................................................................
Monitoring Errors with Trace Files and the Alert Log .................................................................
Monitoring a Database with Server-Generated Alerts .................................................................
Monitoring Performance.........................................................................................................................
Monitoring Locks ...............................................................................................................................
Monitoring Wait Events ....................................................................................................................
Performance Monitoring Data Dictionary Views..........................................................................

7-1
7-1
7-2
7-2
7-2

8-1
8-1
8-4
8-7
8-7
8-8
8-8

Managing Diagnostic Data


About the Oracle Database Fault Diagnosability Infrastructure.................................................... 9-1
Fault Diagnosability Infrastructure Overview .............................................................................. 9-1
About Incidents and Problems......................................................................................................... 9-3
Fault Diagnosability Infrastructure Components ......................................................................... 9-4
Structure, Contents, and Location of the Automatic Diagnostic Repository ............................ 9-8
Investigating, Reporting, and Resolving a Problem ...................................................................... 9-12
RoadmapInvestigating, Reporting, and Resolving a Problem ............................................. 9-12
Task 1: View Critical Error Alerts in Cloud Control.................................................................. 9-14
Task 2: View Problem Details........................................................................................................ 9-15
Task 3: (Optional) Gather Additional Diagnostic Information ................................................ 9-16
Task 4: (Optional) Create a Service Request................................................................................ 9-16
Task 5: Package and Upload Diagnostic Data to Oracle Support............................................ 9-16
Task 6: Track the Service Request and Implement Any Repairs.............................................. 9-18
Viewing Problems with the Support Workbench .......................................................................... 9-19
Creating a User-Reported Problem.................................................................................................... 9-20
Viewing the Alert Log .......................................................................................................................... 9-21
Finding Trace Files................................................................................................................................ 9-22
Running Health Checks with Health Monitor................................................................................ 9-22
About Health Monitor.................................................................................................................... 9-22
Running Health Checks Manually ............................................................................................... 9-24
Viewing Checker Reports .............................................................................................................. 9-25
Health Monitor Views .................................................................................................................... 9-28
Health Check Parameters Reference ............................................................................................ 9-28
Repairing SQL Failures with the SQL Repair Advisor ................................................................. 9-29
About the SQL Repair Advisor ..................................................................................................... 9-29

ix

Running the SQL Repair Advisor.................................................................................................


Viewing, Disabling, or Removing a SQL Patch ..........................................................................
Repairing Data Corruptions with the Data Recovery Advisor ....................................................
Creating, Editing, and Uploading Custom Incident Packages.....................................................
About Incident Packages................................................................................................................
Packaging and Uploading Problems with Custom Packaging ................................................
Viewing and Modifying Incident Packages ................................................................................
Creating, Editing, and Uploading Correlated Packages ...........................................................
Deleting Correlated Packages .......................................................................................................
Setting Incident Packaging Preferences .......................................................................................

Part II

9-30
9-31
9-31
9-32
9-33
9-35
9-39
9-43
9-44
9-44

Oracle Database Structure and Storage

10 Managing Control Files


What Is a Control File? .........................................................................................................................
Guidelines for Control Files ...............................................................................................................
Provide Filenames for the Control Files ......................................................................................
Multiplex Control Files on Different Disks .................................................................................
Back Up Control Files .....................................................................................................................
Manage the Size of Control Files ..................................................................................................
Creating Control Files ..........................................................................................................................
Creating Initial Control Files .........................................................................................................
Creating Additional Copies, Renaming, and Relocating Control Files .................................
Creating New Control Files ...........................................................................................................
Troubleshooting After Creating Control Files ................................................................................
Checking for Missing or Extra Files .............................................................................................
Handling Errors During CREATE CONTROLFILE ..................................................................
Backing Up Control Files.....................................................................................................................
Recovering a Control File Using a Current Copy ...........................................................................
Recovering from Control File Corruption Using a Control File Copy....................................
Recovering from Permanent Media Failure Using a Control File Copy.................................
Dropping Control Files ........................................................................................................................
Control Files Data Dictionary Views ................................................................................................

11

Managing the Redo Log


What Is the Redo Log?..........................................................................................................................
Redo Threads ...................................................................................................................................
Redo Log Contents..........................................................................................................................
How Oracle Database Writes to the Redo Log ...........................................................................
Planning the Redo Log .........................................................................................................................
Multiplexing Redo Log Files .........................................................................................................
Placing Redo Log Members on Different Disks..........................................................................
Planning the Size of Redo Log Files .............................................................................................
Planning the Block Size of Redo Log Files ..................................................................................
Choosing the Number of Redo Log Files ....................................................................................
Controlling Archive Lag ...............................................................................................................

10-1
10-2
10-2
10-2
10-3
10-3
10-3
10-3
10-4
10-4
10-7
10-7
10-7
10-7
10-8
10-8
10-8
10-9
10-9

11-1
11-1
11-2
11-2
11-4
11-4
11-6
11-7
11-7
11-8
11-9

Creating Redo Log Groups and Members......................................................................................


Creating Redo Log Groups ..........................................................................................................
Creating Redo Log Members.......................................................................................................
Relocating and Renaming Redo Log Members ............................................................................
Dropping Redo Log Groups and Members ...................................................................................
Dropping Log Groups ..................................................................................................................
Dropping Redo Log Members.....................................................................................................
Forcing Log Switches..........................................................................................................................
Verifying Blocks in Redo Log Files .................................................................................................
Clearing a Redo Log File....................................................................................................................
Redo Log Data Dictionary Views ....................................................................................................

12

Managing Archived Redo Log Files


What Is the Archived Redo Log?........................................................................................................
Choosing Between NOARCHIVELOG and ARCHIVELOG Mode ...........................................
Running a Database in NOARCHIVELOG Mode .....................................................................
Running a Database in ARCHIVELOG Mode ............................................................................
Controlling Archiving ..........................................................................................................................
Setting the Initial Database Archiving Mode..............................................................................
Changing the Database Archiving Mode ...................................................................................
Performing Manual Archiving......................................................................................................
Adjusting the Number of Archiver Processes ............................................................................
Specifying Archive Destinations .......................................................................................................
Setting Initialization Parameters for Archive Destinations ......................................................
Understanding Archive Destination Status ................................................................................
Specifying Alternate Destinations ..............................................................................................
About Log Transmission Modes ......................................................................................................
Normal Transmission Mode........................................................................................................
Standby Transmission Mode ......................................................................................................
Managing Archive Destination Failure ..........................................................................................
Specifying the Minimum Number of Successful Destinations...............................................
Rearchiving to a Failed Destination ...........................................................................................
Controlling Trace Output Generated by the Archivelog Process..............................................
Viewing Information About the Archived Redo Log ..................................................................
Archived Redo Log Files Views..................................................................................................
The ARCHIVE LOG LIST Command.........................................................................................

13

11-10
11-10
11-11
11-11
11-12
11-12
11-13
11-14
11-14
11-15
11-15

12-1
12-2
12-2
12-3
12-4
12-4
12-4
12-5
12-5
12-6
12-6
12-9
12-10
12-10
12-10
12-10
12-11
12-11
12-12
12-13
12-14
12-14
12-15

Managing Tablespaces
Guidelines for Managing Tablespaces .............................................................................................
Using Multiple Tablespaces...........................................................................................................
Assigning Tablespace Quotas to Users ........................................................................................
Creating Tablespaces............................................................................................................................
Locally Managed Tablespaces.......................................................................................................
Bigfile Tablespaces ..........................................................................................................................
Compressed Tablespaces ...............................................................................................................
Encrypted Tablespaces ...................................................................................................................

13-1
13-2
13-2
13-2
13-3
13-6
13-8
13-8

xi

Temporary Tablespaces................................................................................................................
Multiple Temporary Tablespaces: Using Tablespace Groups ................................................
Consider Storing Tablespaces in the In-Memory Column Store...............................................
Specifying Nonstandard Block Sizes for Tablespaces.................................................................
Controlling the Writing of Redo Records.......................................................................................
Altering Tablespace Availability ....................................................................................................
Taking Tablespaces Offline..........................................................................................................
Bringing Tablespaces Online .......................................................................................................
Using Read-Only Tablespaces..........................................................................................................
Making a Tablespace Read-Only ................................................................................................
Making a Read-Only Tablespace Writable ...............................................................................
Creating a Read-Only Tablespace on a WORM Device ..........................................................
Delaying the Opening of Data Files in Read-Only Tablespaces ............................................
Altering and Maintaining Tablespaces...........................................................................................
Increasing the Size of a Tablespace.............................................................................................
Altering a Locally Managed Tablespace....................................................................................
Altering a Bigfile Tablespace .......................................................................................................
Altering a Locally Managed Temporary Tablespace...............................................................
Shrinking a Locally Managed Temporary Tablespace ............................................................
Renaming Tablespaces.......................................................................................................................
Dropping Tablespaces .......................................................................................................................
Managing the SYSAUX Tablespace.................................................................................................
Monitoring Occupants of the SYSAUX Tablespace .................................................................
Moving Occupants Out Of or into the SYSAUX Tablespace ..................................................
Controlling the Size of the SYSAUX Tablespace ......................................................................
Diagnosing and Repairing Locally Managed Tablespace Problems ........................................
Scenario 1: Fixing Bitmap When Allocated Blocks are Marked Free (No Overlap)............
Scenario 2: Dropping a Corrupted Segment .............................................................................
Scenario 3: Fixing Bitmap Where Overlap is Reported ...........................................................
Scenario 4: Correcting Media Corruption of Bitmap Blocks...................................................
Scenario 5: Migrating from a Dictionary-Managed to a Locally Managed Tablespace......
Migrating the SYSTEM Tablespace to a Locally Managed Tablespace ...................................
Tablespace Data Dictionary Views..................................................................................................
Example 1: Listing Tablespaces and Default Storage Parameters .........................................
Example 2: Listing the Data Files and Associated Tablespaces of a Database.....................
Example 3: Displaying Statistics for Free Space (Extents) of Each Tablespace ....................

13-10
13-13
13-14
13-14
13-15
13-16
13-16
13-17
13-18
13-18
13-20
13-20
13-21
13-21
13-21
13-22
13-22
13-22
13-23
13-24
13-25
13-25
13-26
13-26
13-26
13-27
13-28
13-28
13-29
13-29
13-29
13-30
13-30
13-31
13-31
13-32

14 Managing Data Files and Temp Files


Guidelines for Managing Data Files .................................................................................................
Determine the Number of Data Files ...........................................................................................
Determine the Size of Data Files ...................................................................................................
Place Data Files Appropriately .....................................................................................................
Store Data Files Separate from Redo Log Files ...........................................................................
Creating Data Files and Adding Data Files to a Tablespace ........................................................
Changing Data File Size.......................................................................................................................
Enabling and Disabling Automatic Extension for a Data File..................................................
Manually Resizing a Data File.......................................................................................................

xii

14-1
14-2
14-3
14-4
14-4
14-4
14-5
14-5
14-6

Altering Data File Availability ...........................................................................................................


Bringing Data Files Online or Taking Offline in ARCHIVELOG Mode .................................
Taking Data Files Offline in NOARCHIVELOG Mode.............................................................
Altering the Availability of All Data Files or Temp Files in a Tablespace..............................
Renaming and Relocating Data Files ................................................................................................
Renaming and Relocating Online Data Files ..............................................................................
Renaming and Relocating Offline Data Files ............................................................................
Dropping Data Files............................................................................................................................
Verifying Data Blocks in Data Files ................................................................................................
Copying Files Using the Database Server ......................................................................................
Copying a File on a Local File System........................................................................................
Third-Party File Transfer .............................................................................................................
File Transfer and the DBMS_SCHEDULER Package...............................................................
Advanced File Transfer Mechanisms.........................................................................................
Mapping Files to Physical Devices ..................................................................................................
Overview of Oracle Database File Mapping Interface ............................................................
How the Oracle Database File Mapping Interface Works.......................................................
Using the Oracle Database File Mapping Interface..................................................................
File Mapping Examples................................................................................................................
Data Files Data Dictionary Views....................................................................................................

15

14-6
14-7
14-7
14-8
14-8
14-9
14-11
14-14
14-15
14-16
14-16
14-17
14-18
14-18
14-19
14-19
14-20
14-23
14-26
14-28

Transporting Data
About Transporting Data.....................................................................................................................
Purpose of Transporting Data .......................................................................................................
Transporting Data: Scenarios ........................................................................................................
Transporting Data Across Platforms............................................................................................
General Limitations on Transporting Data .................................................................................
Compatibility Considerations for Transporting Data .............................................................
Transporting Databases .....................................................................................................................
Introduction to Full Transportable Export/Import .................................................................
Limitations on Full Transportable Export/import...................................................................
Transporting a Database Using an Export Dump File ............................................................
Transporting a Database Over the Network .............................................................................
Transporting Tablespaces Between Databases .............................................................................
Introduction to Transportable Tablespaces...............................................................................
Limitations on Transportable Tablespaces................................................................................
Transporting Tablespaces Between Databases .........................................................................
Transporting Tables, Partitions, or Subpartitions Between Databases....................................
Introduction to Transportable Tables.........................................................................................
Limitations on Transportable Tables..........................................................................................
Transporting Tables, Partitions, or Subpartitions Using an Export Dump File ..................
Transporting Tables, Partitions, or Subpartitions Over the Network ...................................
Converting Data Between Platforms ...............................................................................................
Converting Data Between Platforms Using the DBMS_FILE_TRANSFER Package ..........
Converting Data Between Platforms Using RMAN ................................................................
Guidelines for Transferring Data Files...........................................................................................

15-1
15-1
15-2
15-6
15-8
15-10
15-11
15-11
15-11
15-12
15-18
15-23
15-23
15-24
15-24
15-31
15-31
15-32
15-32
15-38
15-42
15-42
15-44
15-47

xiii

16

Managing Undo
What Is Undo?........................................................................................................................................
Introduction to Automatic Undo Management ..............................................................................
Overview of Automatic Undo Management ..............................................................................
About the Undo Retention Period ................................................................................................
Setting the Minimum Undo Retention Period ................................................................................
Sizing a Fixed-Size Undo Tablespace ...............................................................................................
The Undo Advisor PL/SQL Interface ..........................................................................................
Managing Undo Tablespaces..............................................................................................................
Creating an Undo Tablespace .......................................................................................................
Altering an Undo Tablespace ........................................................................................................
Dropping an Undo Tablespace .....................................................................................................
Switching Undo Tablespaces.......................................................................................................
Establishing User Quotas for Undo Space.................................................................................
Managing Space Threshold Alerts for the Undo Tablespace .................................................
Migrating to Automatic Undo Management..................................................................................
Managing Temporary Undo..............................................................................................................
About Managing Temporary Undo ...........................................................................................
Enabling and Disabling Temporary Undo ................................................................................
Undo Space Data Dictionary Views ................................................................................................

17

Using Oracle Managed Files


What Are Oracle Managed Files?.......................................................................................................
Who Can Use Oracle Managed Files? ..........................................................................................
Benefits of Using Oracle Managed Files ......................................................................................
Oracle Managed Files and Existing Functionality......................................................................
Enabling the Creation and Use of Oracle Managed Files .............................................................
Setting the DB_CREATE_FILE_DEST Initialization Parameter...............................................
Setting the DB_RECOVERY_FILE_DEST Parameter.................................................................
Setting the DB_CREATE_ONLINE_LOG_DEST_n Initialization Parameters.......................
Creating Oracle Managed Files ..........................................................................................................
How Oracle Managed Files Are Named......................................................................................
Creating Oracle Managed Files at Database Creation ...............................................................
Creating Data Files for Tablespaces Using Oracle Managed Files ........................................
Creating Temp Files for Temporary Tablespaces Using Oracle Managed Files..................
Creating Control Files Using Oracle Managed Files................................................................
Creating Redo Log Files Using Oracle Managed Files ............................................................
Creating Archived Logs Using Oracle Managed Files ............................................................
Operation of Oracle Managed Files.................................................................................................
Dropping Data Files and Temp Files .........................................................................................
Dropping Redo Log Files .............................................................................................................
Renaming Files ..............................................................................................................................
Managing Standby Databases ....................................................................................................
Scenarios for Using Oracle Managed Files ....................................................................................
Scenario 1: Create and Manage a Database with Multiplexed Redo Logs ...........................
Scenario 2: Create and Manage a Database with Database and Fast Recovery Areas........
Scenario 3: Adding Oracle Managed Files to an Existing Database ......................................

xiv

16-1
16-2
16-2
16-3
16-5
16-6
16-7
16-8
16-8
16-9
16-9
16-10
16-11
16-11
16-11
16-11
16-11
16-12
16-13

17-1
17-2
17-3
17-3
17-3
17-4
17-5
17-5
17-6
17-6
17-7
17-12
17-14
17-15
17-16
17-17
17-18
17-18
17-18
17-19
17-19
17-19
17-19
17-22
17-23

Part III
18

Schema Objects

Managing Schema Objects


Creating Multiple Tables and Views in a Single Operation ........................................................
Analyzing Tables, Indexes, and Clusters .........................................................................................
Using DBMS_STATS to Collect Table and Index Statistics.......................................................
Validating Tables, Indexes, Clusters, and Materialized Views ................................................
Listing Chained Rows of Tables and Clusters ............................................................................
Truncating Tables and Clusters .........................................................................................................
Using DELETE.................................................................................................................................
Using DROP and CREATE ............................................................................................................
Using TRUNCATE..........................................................................................................................
Enabling and Disabling Triggers.......................................................................................................
Enabling Triggers ............................................................................................................................
Disabling Triggers...........................................................................................................................
Managing Integrity Constraints .......................................................................................................
Integrity Constraint States ..........................................................................................................
Setting Integrity Constraints Upon Definition..........................................................................
Modifying, Renaming, or Dropping Existing Integrity Constraints .....................................
Deferring Constraint Checks .......................................................................................................
Reporting Constraint Exceptions ................................................................................................
Viewing Constraint Information.................................................................................................
Renaming Schema Objects................................................................................................................
Managing Object Dependencies ......................................................................................................
About Object Dependencies and Object Invalidation..............................................................
Manually Recompiling Invalid Objects with DDL...................................................................
Manually Recompiling Invalid Objects with PL/SQL Package Procedures........................
Managing Object Name Resolution ................................................................................................
Switching to a Different Schema .....................................................................................................
Managing Editions..............................................................................................................................
About Editions and Edition-Based Redefinition ......................................................................
DBA Tasks for Edition-Based Redefinition ...............................................................................
Setting the Database Default Edition .........................................................................................
Querying the Database Default Edition.....................................................................................
Setting the Edition Attribute of a Database Service .................................................................
Using an Edition............................................................................................................................
Editions Data Dictionary Views..................................................................................................
Displaying Information About Schema Objects ..........................................................................
Using a PL/SQL Package to Display Information About Schema Objects ..........................
Schema Objects Data Dictionary Views.....................................................................................

19

18-1
18-2
18-2
18-3
18-4
18-6
18-6
18-7
18-7
18-8
18-9
18-9
18-10
18-10
18-12
18-13
18-14
18-15
18-16
18-17
18-17
18-17
18-19
18-19
18-20
18-21
18-22
18-22
18-22
18-22
18-23
18-23
18-24
18-25
18-25
18-25
18-26

Managing Space for Schema Objects


Managing Tablespace Alerts...............................................................................................................
Setting Alert Thresholds ................................................................................................................
Viewing Alerts.................................................................................................................................
Limitations .......................................................................................................................................

19-1
19-2
19-4
19-4

xv

Managing Resumable Space Allocation ...........................................................................................


Resumable Space Allocation Overview .......................................................................................
Enabling and Disabling Resumable Space Allocation...............................................................
Using a LOGON Trigger to Set Default Resumable Mode .....................................................
Detecting Suspended Statements................................................................................................
Operation-Suspended Alert.........................................................................................................
Resumable Space Allocation Example: Registering an AFTER SUSPEND Trigger ............
Reclaiming Unused Space .................................................................................................................
About Reclaimable Unused Space..............................................................................................
Using the Segment Advisor.........................................................................................................
Shrinking Database Segments Online ........................................................................................
Deallocating Unused Space .........................................................................................................
Dropping Unused Object Storage....................................................................................................
Understanding Space Usage of Data Types ...................................................................................
Displaying Information About Space Usage for Schema Objects ............................................
Using PL/SQL Packages to Display Information About Schema Object Space Usage ......
Schema Objects Space Usage Data Dictionary Views..............................................................
Capacity Planning for Database Objects .......................................................................................
Estimating the Space Use of a Table ..........................................................................................
Estimating the Space Use of an Index .......................................................................................
Obtaining Object Growth Trends ..............................................................................................

20

Managing Tables
About Tables ..........................................................................................................................................
Guidelines for Managing Tables .......................................................................................................
Design Tables Before Creating Them...........................................................................................
Specify the Type of Table to Create ..............................................................................................
Specify the Location of Each Table ...............................................................................................
Consider Parallelizing Table Creation .........................................................................................
Consider Using NOLOGGING When Creating Tables ............................................................
Consider Using Table Compression.............................................................................................
Managing Table Compression Using Enterprise Manager Cloud Control ..........................
Consider Using Segment-Level and Row-Level Compression Tiering ................................
Consider Using Attribute-Clustered Tables..............................................................................
Consider Using Zone Maps .........................................................................................................
Consider Storing Tables in the In-Memory Column Store .....................................................
Understand Invisible Columns ...................................................................................................
Consider Encrypting Columns That Contain Sensitive Data .................................................
Understand Deferred Segment Creation ...................................................................................
Materializing Segments................................................................................................................
Estimate Table Size and Plan Accordingly................................................................................
Restrictions to Consider When Creating Tables .......................................................................
Creating Tables....................................................................................................................................
Example: Creating a Table ...........................................................................................................
Creating a Temporary Table........................................................................................................
Parallelizing Table Creation ........................................................................................................
Loading Tables.....................................................................................................................................

xvi

19-5
19-5
19-8
19-10
19-10
19-11
19-12
19-13
19-13
19-14
19-25
19-28
19-28
19-29
19-29
19-29
19-30
19-32
19-32
19-33
19-33

20-1
20-2
20-3
20-3
20-4
20-4
20-4
20-5
20-13
20-16
20-17
20-19
20-19
20-20
20-22
20-23
20-25
20-26
20-26
20-26
20-27
20-28
20-29
20-30

Methods for Loading Tables........................................................................................................


Improving INSERT Performance with Direct-Path INSERT ..................................................
Using Conventional Inserts to Load Tables ..............................................................................
Avoiding Bulk INSERT Failures with DML Error Logging ...................................................
Automatically Collecting Statistics on Tables...............................................................................
Altering Tables ....................................................................................................................................
Reasons for Using the ALTER TABLE Statement ....................................................................
Altering Physical Attributes of a Table......................................................................................
Moving a Table to a New Segment or Tablespace ...................................................................
Manually Allocating Storage for a Table ...................................................................................
Modifying an Existing Column Definition................................................................................
Adding Table Columns ................................................................................................................
Renaming Table Columns............................................................................................................
Dropping Table Columns ...........................................................................................................
Placing a Table in Read-Only Mode...........................................................................................
Redefining Tables Online .................................................................................................................
Features of Online Table Redefinition .......................................................................................
Performing Online Redefinition with the REDEF_TABLE Procedure..................................
Performing Online Redefinition with Multiple Procedures in DBMS_REDEFINITION ...
Results of the Redefinition Process.............................................................................................
Performing Intermediate Synchronization................................................................................
Aborting Online Table Redefinition and Cleaning Up After Errors .....................................
Restrictions for Online Redefinition of Tables ..........................................................................
Online Redefinition of One or More Partitions ........................................................................
Online Table Redefinition Examples..........................................................................................
Privileges Required for the DBMS_REDEFINITION Package ...............................................
Researching and Reversing Erroneous Table Changes ...............................................................
Recovering Tables Using Oracle Flashback Table .......................................................................
Dropping Tables..................................................................................................................................
Using Flashback Drop and Managing the Recycle Bin ...............................................................
What Is the Recycle Bin? ..............................................................................................................
Enabling and Disabling the Recycle Bin ....................................................................................
Viewing and Querying Objects in the Recycle Bin ..................................................................
Purging Objects in the Recycle Bin .............................................................................................
Restoring Tables from the Recycle Bin.......................................................................................
Managing Index-Organized Tables ................................................................................................
What Are Index-Organized Tables? ...........................................................................................
Creating Index-Organized Tables...............................................................................................
Maintaining Index-Organized Tables ........................................................................................
Creating Secondary Indexes on Index-Organized Tables.......................................................
Analyzing Index-Organized Tables ...........................................................................................
Using the ORDER BY Clause with Index-Organized Tables..................................................
Converting Index-Organized Tables to Regular Tables ..........................................................
Managing External Tables.................................................................................................................
About External Tables ..................................................................................................................
Creating External Tables ............................................................................................................
Altering External Tables.............................................................................................................

20-30
20-32
20-36
20-37
20-40
20-41
20-41
20-42
20-42
20-44
20-45
20-45
20-46
20-46
20-48
20-49
20-50
20-51
20-51
20-57
20-58
20-58
20-58
20-60
20-61
20-82
20-83
20-83
20-84
20-85
20-85
20-86
20-87
20-88
20-88
20-90
20-90
20-91
20-95
20-96
20-97
20-98
20-99
20-99
20-99
20-100
20-103

xvii

Preprocessing External Tables...................................................................................................


Dropping External Tables ..........................................................................................................
System and Object Privileges for External Tables ..................................................................
Tables Data Dictionary Views .......................................................................................................

20-104
20-105
20-105
20-105

21 Managing Indexes
About Indexes ........................................................................................................................................
Guidelines for Managing Indexes .....................................................................................................
Create Indexes After Inserting Table Data ..................................................................................
Index the Correct Tables and Columns .......................................................................................
Order Index Columns for Performance .......................................................................................
Limit the Number of Indexes for Each Table ..............................................................................
Drop Indexes That Are No Longer Required ............................................................................
Indexes and Deferred Segment Creation.....................................................................................
Estimate Index Size and Set Storage Parameters........................................................................
Specify the Tablespace for Each Index .........................................................................................
Consider Parallelizing Index Creation.........................................................................................
Consider Creating Indexes with NOLOGGING ........................................................................
Understand When to Use Unusable or Invisible Indexes .........................................................
Understand When to Create Multiple Indexes on the Same Set of Columns ........................
Consider Costs and Benefits of Coalescing or Rebuilding Indexes .........................................
Consider Cost Before Disabling or Dropping Constraints........................................................
Consider Using the In-Memory Column Store to Reduce the Number of Indexes ..............
Creating Indexes....................................................................................................................................
Creating an Index Explicitly ........................................................................................................
Creating a Unique Index Explicitly ............................................................................................
Creating an Index Associated with a Constraint......................................................................
Creating a Large Index .................................................................................................................
Creating an Index Online.............................................................................................................
Creating a Function-Based Index................................................................................................
Creating a Compressed Index .....................................................................................................
Creating an Unusable Index ........................................................................................................
Creating an Invisible Index..........................................................................................................
Creating Multiple Indexes on the Same Set of Columns.........................................................
Altering Indexes ..................................................................................................................................
Altering Storage Characteristics of an Index.............................................................................
Rebuilding an Existing Index ......................................................................................................
Making an Index Unusable..........................................................................................................
Making an Index Invisible or Visible .........................................................................................
Renaming an Index .......................................................................................................................
Monitoring Index Usage ..............................................................................................................
Monitoring Space Use of Indexes ....................................................................................................
Dropping Indexes................................................................................................................................
Indexes Data Dictionary Views ........................................................................................................

21-1
21-2
21-2
21-3
21-4
21-4
21-4
21-4
21-4
21-5
21-5
21-5
21-6
21-7
21-8
21-9
21-9
21-9
21-10
21-11
21-11
21-12
21-12
21-13
21-14
21-16
21-17
21-18
21-19
21-19
21-20
21-20
21-22
21-23
21-23
21-23
21-24
21-25

22 Managing Clusters
About Clusters ....................................................................................................................................... 22-1
xviii

Guidelines for Managing Clusters ....................................................................................................


Choose Appropriate Tables for the Cluster ................................................................................
Choose Appropriate Columns for the Cluster Key....................................................................
Specify the Space Required by an Average Cluster Key and Its Associated Rows ..............
Specify the Location of Each Cluster and Cluster Index Rows ................................................
Estimate Cluster Size and Set Storage Parameters.....................................................................
Creating Clusters ...................................................................................................................................
Creating Clustered Tables..............................................................................................................
Creating Cluster Indexes................................................................................................................
Altering Clusters ...................................................................................................................................
Altering Clustered Tables ..............................................................................................................
Altering Cluster Indexes ................................................................................................................
Dropping Clusters.................................................................................................................................
Dropping Clustered Tables............................................................................................................
Dropping Cluster Indexes..............................................................................................................
Clusters Data Dictionary Views .........................................................................................................

23

Managing Hash Clusters


About Hash Clusters.............................................................................................................................
When to Use Hash Clusters.................................................................................................................
Situations Where Hashing Is Useful.............................................................................................
Situations Where Hashing Is Not Advantageous ......................................................................
Creating Hash Clusters ........................................................................................................................
Creating a Sorted Hash Cluster.....................................................................................................
Creating Single-Table Hash Clusters ...........................................................................................
Controlling Space Use Within a Hash Cluster............................................................................
Estimating Size Required by Hash Clusters................................................................................
Altering Hash Clusters .........................................................................................................................
Dropping Hash Clusters ......................................................................................................................
Hash Clusters Data Dictionary Views ..............................................................................................

24

22-2
22-3
22-3
22-3
22-4
22-4
22-4
22-5
22-5
22-6
22-6
22-7
22-7
22-7
22-8
22-8

23-1
23-2
23-2
23-2
23-2
23-3
23-6
23-6
23-8
23-9
23-9
23-9

Managing Views, Sequences, and Synonyms


Managing Views....................................................................................................................................
About Views ....................................................................................................................................
Creating Views ................................................................................................................................
Replacing Views ..............................................................................................................................
Using Views in Queries .................................................................................................................
Updating a Join View .....................................................................................................................
Altering Views...............................................................................................................................
Dropping Views ............................................................................................................................
Managing Sequences..........................................................................................................................
About Sequences ...........................................................................................................................
Creating Sequences .......................................................................................................................
Altering Sequences........................................................................................................................
Using Sequences............................................................................................................................
Dropping Sequences .....................................................................................................................

24-1
24-1
24-2
24-4
24-5
24-6
24-12
24-12
24-13
24-13
24-13
24-14
24-14
24-17

xix

Managing Synonyms..........................................................................................................................
About Synonyms...........................................................................................................................
Creating Synonyms.......................................................................................................................
Using Synonyms in DML Statements .......................................................................................
Dropping Synonyms.....................................................................................................................
Views, Synonyms, and Sequences Data Dictionary Views ........................................................

25

Repairing Corrupted Data


Options for Repairing Data Block Corruption................................................................................
About the DBMS_REPAIR Package ..................................................................................................
DBMS_REPAIR Procedures...........................................................................................................
Limitations and Restrictions..........................................................................................................
Using the DBMS_REPAIR Package...................................................................................................
Task 1: Detect and Report Corruptions .......................................................................................
Task 2: Evaluate the Costs and Benefits of Using DBMS_REPAIR..........................................
Task 3: Make Objects Usable .........................................................................................................
Task 4: Repair Corruptions and Rebuild Lost Data ...................................................................
DBMS_REPAIR Examples...................................................................................................................
Examples: Building a Repair Table or Orphan Key Table ........................................................
Example: Detecting Corruption ....................................................................................................
Example: Fixing Corrupt Blocks ...................................................................................................
Example: Finding Index Entries Pointing to Corrupt Data Blocks ..........................................
Example: Skipping Corrupt Blocks ..............................................................................................

Part IV
26

24-17
24-17
24-18
24-18
24-19
24-19

25-1
25-2
25-2
25-2
25-2
25-3
25-4
25-5
25-5
25-5
25-6
25-7
25-8
25-9
25-9

Database Resource Management and Task Scheduling

Managing Automated Database Maintenance Tasks


About Automated Maintenance Tasks .............................................................................................
About Maintenance Windows ...........................................................................................................
Configuring Automated Maintenance Tasks ..................................................................................
Enabling and Disabling Maintenance Tasks for all Maintenance Windows..........................
Enabling and Disabling Maintenance Tasks for Specific Maintenance Windows ................
Configuring Maintenance Windows.................................................................................................
Modifying a Maintenance Window..............................................................................................
Creating a New Maintenance Window .......................................................................................
Removing a Maintenance Window ..............................................................................................
Configuring Resource Allocations for Automated Maintenance Tasks ....................................
About Resource Allocations for Automated Maintenance Tasks ............................................
Changing Resource Allocations for Automated Maintenance Tasks......................................
Automated Maintenance Tasks Reference.......................................................................................
Predefined Maintenance Windows ..............................................................................................
Automated Maintenance Tasks Database Dictionary Views....................................................

26-1
26-2
26-3
26-3
26-4
26-4
26-4
26-5
26-5
26-6
26-6
26-6
26-7
26-7
26-7

27 Managing Resources with Oracle Database Resource Manager


About Oracle Database Resource Manager...................................................................................... 27-1
What Solutions Does the Resource Manager Provide for Workload Management? ............ 27-2

xx

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