Академический Документы
Профессиональный Документы
Культура Документы
Oracle
Database
Administrator's Guide
12c Release 1 (12.1)
E41484-10
August 2014
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:
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
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
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
iv
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
vi
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
7-1
7-1
7-2
7-2
7-2
8-1
8-1
8-4
8-7
8-7
8-8
8-8
ix
Part II
9-30
9-31
9-31
9-32
9-33
9-35
9-39
9-43
9-44
9-44
11
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
12
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
xii
14-1
14-2
14-3
14-4
14-4
14-4
14-5
14-5
14-6
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
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
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
19-1
19-2
19-4
19-4
xv
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
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
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
23
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
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
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
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
xx