2 Server ConfigurationObjectives 2-2 Database Configuration Assistant DBCA Enhancements 2-3 Using Database Control for Management 2-5 Database Control: Overview 2-7 Important EM Agent Di
Trang 1Oracle Database 10g - New Features For
Administrators
Trang 2Oracle Database 10g: New
Features for AdministratorsVolume II • Student Guide
Trang 3Copyright © 2005, Oracle All rights reserved.
Disclaimer
This document contains proprietary information and is protected by copyright and other intellectual property laws You may copy and print this document solely for your own use in an Oracle training course The document may not be modified or altered in any way Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle.
The information contained in this document is subject to change without notice If you find any problems in the document, please report them in writing to: Oracle University,
500 Oracle Parkway, Redwood Shores, California 94065 USA This document is not warranted to be error-free.
Restricted Rights Notice
If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable:
U.S GOVERNMENT RIGHTS The U.S Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S Government contract
Trademark Notice
Oracle, JD Edwards, PeopleSoft, and Retek are registered trademarks of Oracle Corporation and/or its affiliates Other names may be trademarks of their respective owners.
Trang 4I Introduction
Overview I-2
Today’s IT Infrastructure I-3
How DBAs Spent Their Time Before Oracle Database 10g I-4
Grid Computing I-5
Oracle Ecosystem I-6
Enterprise Grid Computing I-7
Implement One from Many I-8
Manage Many as One I-10
Readily Available Product Controls I-12
Oracle Enterprise Manager 10g Grid Control I-13
Oracle Database 10g: The Database for the Grid I-14
Suggested Additional Courses I-15
Oracle Database 10g Manageability Goals I-16
Database Management Challenges I-17
Oracle Database 10g Solution: Self-Managing Database I-18 How Oracle Database 10g DBAs Spend Their Time I-19
Further Information I-20
Suggested Schedule I-21
1 Installation
Objectives 1-2
Installation Methods 1-3
Installation: New Feature Support 1-4
Performance Enhancements to Installation 1-5
Checking the Preinstallation Requirements 1-6
Miscellaneous Installation Enhancements 1-7
Response File Improvements 1-8
CD Pack Contents 1-9
Management Options 1-10
File Storage Options 1-11
Backup and Recovery Options 1-12
Passwords 1-13
Grid Control Components 1-14
Managed Targets for Grid Control 1-16
Oracle Management Service 1-17
Oracle Management Repository 1-18
Grid Control Console: Home 1-19
Grid Control Console: Targets 1-20
Managing Very Large Grids 1-21
Summary 1-22
Contents
iii
Trang 52 Server Configuration
Objectives 2-2
Database Configuration Assistant (DBCA) Enhancements 2-3 Using Database Control for Management 2-5
Database Control: Overview 2-7
Important EM Agent Directories 2-8
Configuring Database Control 2-9
Managing Database Control Components 2-10
Database Home Page: Overview 2-11
Database Control Setup Pages 2-13
Database Control Preferences Pages 2-14
Net Services Administration Pages 2-15
Database Feature Usage: Statistics Collection 2-16
Database Feature Usage: EM Interface 2-17
Database Feature Usage: HWM Page 2-18
Policy Framework 2-19
Policy Violations Page 2-20
Manage Policy Violations Page 2-22
Rule Violation Page 2-24
Manage Policy Library Page 2-25
Simplified Initialization Parameters 2-26
Viewing Initialization Parameters 2-27
Irreversible Data File Compatibility 2-28
Enabling iSQL*Plus DBA Access 2-29
Accessing iSQL*Plus DBA from EM 2-30
Summary 2-31
Practice 2: Overview 2-32
3 Data Pump, SQL*Loader, and External Tables
Objectives 3-2
Data Pump: Overview 3-3
Data Pump: General Architecture 3-4
Data Pump Export and Import: Overview 3-5
Data Pump Export and Import: Benefits 3-6
General Implementation: Overview 3-8
Data Pump Direct Path: Considerations 3-9
Data Pump File Locations 3-10
Data Pump File Naming and Size 3-12
Data Pump Utility: Interfaces and Modes 3-13
Data Pump and Filtering 3-14
Data Pump Import Transformations 3-15
Data Pump Job Monitoring Views 3-17
iv
Trang 6Database Control and Data Pump 3-18
Using EM to Monitor Data Pump Jobs 3-19
Parallel Full Export and Import: Examples 3-20
Limited Schema Export: Example 3-21
Network Mode Import: Example 3-22
Attaching to Existing Job: Example 3-23
Restarting a Stopped Job: Example 3-24
Data-Only Unload: Example 3-25
Loading Data from Flat Files by Using EM 3-26
External Table Population: Overview 3-27
External Table Population Operation 3-28
External Table Parallel Populate Operation 3-29
External Table Population: Example 3-30
External Table Projected Columns 3-31
External Table Projected Column: Examples 3-32
Summary 3-33
Practice 3: Overview 3-34
4 Database and Tablespace Data Movements
Objectives 4-2
Cross-Platform Transportable Tablespaces 4-3
Minimum Compatibility Level 4-4
Transportable Tablespace Procedure 4-5
Determining the Endian Format of a Platform 4-6
Data File Conversion: Examples 4-7
CLOB Exception 4-8
Using Database Control to Transport Tablespaces 4-9 Generating Transportable Tablespace Sets 4-10
Specifying Destination Characteristics 4-11
Specifying Conversion Information 4-12
Specifying the Files Transfer Mode 4-13
Database Transportation: Overview 4-14
Database Transportation Procedure 4-15
Database Transportation: Conversion 4-16
Database Transportation: Example 1 4-17
Database Transportation: Example 2 4-18
Database Transportation: Generated Pfile 4-19
Database Transportation: Generated SQL Script 4-20 Database Transportation: Generated RMAN Script 4-22 Database Transportation: Considerations 4-23
Database Cloning Using Database Control 4-25
Transport Tablespace from Backup: Overview 4-26 Transport Tablespace from Backup: Implementation 4-27
v
Trang 7Transport Tablespace from Backup: Example 4-28
Managing a File Group Repository 4-38
File Group Repository Catalog 4-41
File Group Repository Catalog Views 4-42
File Group Repository Privileges 4-43
Privileges for Versioning Tablespaces 4-45
Summary 4-46
Practice 4: Overview 4-47
5 Automatic Management
Objectives 5-2
Oracle Database 10g Solution: Self-Managing Database 5-3
Automatic Database Diagnostic Monitor: Overview 5-4 ADDM Performance Monitoring 5-5
ADDM Methodology 5-6
Top Performance Issues Detected 5-7
Database Control and ADDM Findings 5-8
ADDM Analysis Results 5-9
ADDM Recommendations 5-10
Database Control and ADDM Task 5-11
Changing ADDM Attributes 5-12
Retrieving ADDM Reports by Using SQL 5-13
Automatic Shared Memory Management: Overview 5-14 SGA Tuning Principles 5-15
Benefits of Automatic Shared Memory Management 5-16 Automatic Shared Memory Management 5-17
SGA Advisor 5-18
Manual Configuration 5-19
Behavior of Autotuned SGA Parameters 5-20
Behavior of Manually Tuned SGA Parameters 5-21
Using the V$PARAMETER View 5-22
Trang 8Changing the Default Schedule 5-33
Automatic Undo Retention Tuning 5-34
Automatic Checkpoint Tuning 5-35
Automatically Tuned Multiblock Reads 5-36
Summary 5-37
Practice 5: Overview 5-38
6 Manageability Infrastructure
Objectives 6-2
Oracle Database 10g Solution: Self-Managing Database 6-3
Automatic Workload Repository 6-4
Automatic Workload Repository: Overview 6-5
Automatic Workload Repository Data 6-6
Active Session History 6-7
Generate ASH Reports 6-8
Base Statistics and Metrics 6-9
Workload Repository 6-10
Statistic Levels 6-11
AWR Snapshot Sets 6-12
AWR Snapshot Purging Policy 6-13
Database Control and AWR 6-14
Generating AWR Reports 6-15
Snapshot Sets and Period Comparisons 6-16
Compare Periods: Results 6-17
Statspack and AWR 6-18
Server-Generated Alerts 6-19
Server-Generated Alerts: Overview 6-20
Alert Models Architecture 6-21
Server-Generated Alert Types 6-22
Readily Available Server-Generated Alerts 6-23
Database Control Usage Model 6-24
Database Control Interface to Alerts 6-25
Setting Alert Thresholds 6-26
Alerts Notification 6-27
Metric Details Severity History 6-28
Metric and Alert Views 6-29
PL/SQL Interface for Threshold Settings 6-30
Alert Consumption: Manual Configuration 6-31
vii
Trang 9User-Defined SQL Metrics 6-32
Automatic Routine Administration Tasks 6-33
DBCA and Automated Tasks 6-34
Common Manageability Infrastructure: Advisory Framework 6-35 Advisory Framework: Overview 6-36
Typical Advisor Tuning Session 6-37
Database Control and Advisors 6-38
Cyclic Nature of Workloads 7-3
Thresholds and Metric Baselines Overview: Fixed Thresholds 7-4 Thresholds and Metric Baselines Overview: Adaptive Thresholds 7-5 Metric Baselines and Thresholds Concepts 7-6
Metric Baselines and Time Groups 7-8
Enabling Metric Baselining 7-9
Activating the Moving Window Metric Baseline 7-10
Setting Adaptive Alert Thresholds 7-11
Visualizing Metric Baseline Statistics 7-12
Creating Static Metric Baselines 7-13
Time Grouping: Considerations 7-14
Metric Baseline and Adaptive Threshold: Considerations 7-15
Classification of Eligible Metrics 7-16
Metric Baseline: Normalized View 7-17
Configuring Normalization Metrics 7-19
Adaptive Thresholds and the All Metrics Page 7-20
Summary 7-21
Practice 7: Overview 7-22
8 Application Tuning
Objectives 8-2
Oracle Database 10g Solution: Self-Managing Database 8-3
Automatic Statistics Gathering 8-4
Enhanced Query Optimization 8-5
Statistics on Dictionary Objects 8-6
Dictionary Statistics: Best Practices 8-7
Miscellaneous Statistics-Related Changes 8-8
Locking Statistics 8-9
Using the DBMS_STATS Package 8-10
Automatic Statistics Collection: Considerations 8-11
viii
Trang 10History of Optimizer Statistics 8-12
Managing Historical Optimizer Statistics 8-13 Managing Optimizer Statistics Using EM 8-14 DML Table Monitoring Changes 8-15
Rule-Based Optimizer Obsolescence 8-16 Automatic SQL Tuning: Overview 8-17
Application Tuning Challenges 8-18
SQL Tuning Advisor: Overview 8-19
Stale or Missing Object Statistics 8-20
SQL Tuning Advisor: Usage Model 8-26
Database Control and SQL Tuning Advisor 8-27 Implementing Recommendations 8-28
DBMS_SQLTUNE: Examples 8-30
Exporting or Importing SQL Profiles 8-31
Automatic SQL Tuning Categories 8-32
SQL Access Advisor: Overview 8-33
SQL Access Advisor: Usage Model 8-34
Database Performance Page 8-45
Active Sessions Waiting Pages 8-46
Traditional Workload Dispatching 9-3
Grid Workload Dispatching 9-4
What Is a Service? 9-5
ix
Trang 11High Availability of Services in RAC 9-6
Possible Service Configuration with RAC 9-7
Service Attributes 9-8
Service Types 9-9
Service Goodness 9-10
Fast Application Notification for Continuous Service 9-11
Fast Connection Failover: Overview 9-12
Load Balancing Advisory 9-13
JDBC Runtime Connection Load Balancing: Benefit 9-14
Connection Load Balancing in RAC 9-15
Load Balancing Workflow in RAC 9-16
Creating Services 9-17
Managing Services in a Single-Instance Environment 9-18
Everything Switches to Services 9-19
Using Services with Client Applications 9-20
Using Services with the Resource Manager 9-21
Services and Resource Manager with EM 9-22
Services and the Resource Manager: Example 9-23
Using Services with the Scheduler 9-24
Services and the Scheduler with EM 9-25
Services and the Scheduler: Example 9-27
Using Services with Parallel Operations 9-28
Using Services with Metric Thresholds 9-29
Changing Service Thresholds by Using EM 9-30
Services and Metric Thresholds: Example 9-31
Service Aggregation and Tracing 9-32
Top Services Performance Page 9-33
Service Aggregation Configuration 9-34
Service Aggregation: Example 9-35
trcsess Utility 9-36
Service Performance Views 9-37
Generalized Trace Enabling 9-38
Summary 9-39
Practice 9: Overview 9-40
10 System Resource Management
Objectives 10-2
Oracle Database 10g Solution: Self-Managing Database 10-3
Database Resource Manager 10-4
Switching Plans at Scheduler Window Boundaries 10-5
Setting Idle Timeouts 10-6
Switching Back to the Initial Consumer Group at the End of Call 10-7 Creating a Mapping by Using Database Control 10-9
Creating a Mapping by Using DBMS_RESOURCE_MANAGER 10-10
x
Trang 12Assigning Priorities by Using DBMS_RESOURCE_MANAGER 10-11 Changes to the DBMS_RESOURCE_MANAGER Package 10-13 Using the RATIO Allocation Method 10-15
Monitoring the Database Resource Manager 10-16
Monitoring the Resource Manager by Using EM 10-17
Creating a Program by Using EM 11-7
Creating and Using Schedules 11-8
Using EM to Create Schedules 11-9
Calendaring Expressions 11-10
Creating a Job 11-12
Creating a Time-Based Job 11-13
Setting the Repeat Interval for a Job 11-15
Using Events with Jobs 11-16
Event-Based Scheduling 11-17
Creating an Event-Based Job 11-18
Events Raised by the Scheduler 11-19
Using Events Raised by Jobs 11-21
Using EM to Create Event-Based Schedules 11-22
Creating Complex Schedules 11-23
Privileges for Scheduler Components 11-24
Enabling and Disabling Scheduler Components 11-26
Managing Scheduler Components 11-27
Managing Scheduler Components with EM 11-29
Viewing Attributes of Scheduler Components 11-30
Viewing Job Execution Details 11-31
Viewing Job Logs 11-32
Scheduler Job Chain Concepts 11-33
Creating Chains 11-34
Creating a Chain Object 11-36
Defining Chain Steps 11-37
Defining Chain Rules 11-39
Specifying Chain Rule Conditions 11-40
Starting the Chain 11-42
Creating a Job Chain with EM 11-43
Managing Job Chains 11-45
xi
Trang 13Managing Job Chains with EM 11-46
Monitoring Job Chains 11-47
Advanced Scheduler Concepts 11-48
Creating a Window 11-49
Prioritizing Jobs Within a Window 11-50
Creating a Job Class 11-52
Summary 11-53
Practice 11: Overview 11-54
12 Space Management
Objectives 12-2
Oracle Database 10g Solution: Self-Managing Database 12-3
Proactive Tablespace Monitoring: Overview 12-4
Tablespace Space Usage Monitoring 12-5
Edit Tablespace Space Usage Thresholds 12-6
Edit Tablespace Page 12-7
PL/SQL and Tablespace Space Usage Thresholds 12-8 Proactive Undo Tablespace Monitoring 12-10
Shrinking Segments: Overview 12-11
Shrinking Segments: Considerations 12-12
Shrinking Segments by Using SQL 12-13
Segment Shrink: Basic Execution 12-14
Segment Shrink: Execution Considerations 12-15
Database Control and Segment Shrink 12-16
Segment Advisor: Overview 12-17
Running the Segment Advisor Manually 12-18
Using the Segment Advisor with EM 12-19
Growth Trend Report 12-20
Segment Resource Estimation 12-21
Undo Management Page 12-22
Undo Advisor Page 12-23
Fast Ramp-Up 12-24
Sorted Hash Cluster: Overview 12-25
Sorted Hash Cluster: Example 12-26
Sorted Hash Cluster: Basic Architecture 12-27
Sorted Hash Cluster: Considerations 12-28
Viewing Tablespace Contents 12-29
Summary 12-30
Practice 12: Overview 12-31
13 Improved Very Large Database (VDLB) Support
Objectives 13-2
Bigfile Tablespaces: Overview 13-3
Benefits of Bigfile Tablespaces 13-4
xii
Trang 14Bigfile Tablespace: Usage Model 13-5
Creating Bigfile Tablespaces 13-6
SQL Statement Changes and Additions 13-7
BFTs and SQL Statements: Examples 13-8
Data Dictionary Changes and Additions 13-9
Bigfile Tablespaces and DBVERIFY 13-10
Migration and Bigfile Tablespaces 13-12
Extended ROWID Format and BFTs 13-13
Temporary Tablespace Group: Overview 13-15
Temporary Tablespace Group: Benefits 13-16
Creating Temporary Tablespace Groups 13-17
Maintaining Temporary Tablespace Groups 13-18
Temporary Tablespace Group SQL: Examples 13-19
Data Dictionary Changes 13-21
Database Control: Creating a Partition 13-22
Database Control: Partition Maintenance 13-23
Partitioned IOT Enhancements 13-24
Local Partitioned Index Enhancements 13-25
Skipping Unusable Indexes 13-26
Hash-Partitioned Global Indexes: Overview 13-27
Contention Scenario 13-28
Hash-Partitioned Global Indexes: Benefits 13-29
Creating Hash-Partitioned Global Indexes 13-30
Adding and Coalescing Partitions 13-31
Range and Hash Global Index Commands 13-32
Operations Not Supported 13-33
Usage Example 13-34
Bitmap Index Storage Enhancements 13-35
DML Error Logging: Overview 13-36
DML Error Logging: Example 13-37
Oracle Database 10g Solution: Self-Managing Database 14-3
Flash Recovery Area 14-4
Defining Flash Recovery Area by Using Database Control 14-6 Defining a Flash Recovery Area by Using SQL 14-7
Flash Recovery Area Space Management 14-8
xiii
Trang 15Backing Up Data Files to a Flash Recovery Area 14-9
Modifying the Flash Recovery Area 14-10
Backing Up the Flash Recovery Area 14-11
Dynamic Flash Recovery Area Views 14-12
Flash Recovery Area Columns in Other Views 14-14
Best Practices for the Database and Flash Recovery Area 14-15 Changes in SQL Statement Behavior 14-16
Fast Incremental Backup 14-18
Enabling Fast Incremental Backup 14-19
Monitoring Block Change Tracking 14-20
Incrementally Updated Backups 14-21
Oracle-Suggested Strategy 14-22
Incremental Roll Forward of a Database Copy 14-23
RMAN Backup Command Changes 14-24
Backup Type Enhancements by Using Database Control 14-26 Backup Maintenance 14-27
Backing Up the Entire Database 14-28
Backing Up Individual Tablespaces 14-29
Backing Up Data Files and Control Files 14-30
Implementing Fast Recovery 14-31
Automated Instance Creation and TSPITR 14-32
Auxiliary Location in EM 14-33
Creating Compressed Backups 14-34
Monitoring Compressed Backups 14-35
Simplified Recovery Through RESETLOGS 14-36
Recovery Through RESETLOGS: Changes 14-37
Recovering Data Files Not Backed Up 14-38
Dropping a Database 14-39
Placing All Files in Online Backup Mode 14-40
How Does File Status Affect BEGIN BACKUP? 14-41
Changes to the END BACKUP Command 14-42
RMAN and Configuration Changes 14-43
Automatic Channel Failover 14-44
RMAN Channel Support for the Grid 14-45
Enhanced RMAN Scripts 14-46
Setting Duration and Throttling Option 14-47
Database Control: Backup Reports 14-48
Summary 14-49
Practice 14: Overview 14-50
15 Oracle Secure Backup Overview
Objectives 15-2
Data Protection to Tape for the Oracle Stack 15-3
The Customer Advantage Complete Oracle Solution 15-4
Trang 16Oracle Secure Backup for Centralized Tape Backup Management 15-5 Oracle Secure Backup Administrative Domain 15-6
Oracle Secure Backup: Backup Management Overview 15-7
Oracle Secure Backup Catalog 15-8
Oracle Secure Backup Users 15-9
Predefined Classes 15-10
Oracle Secure Backup Interface Options 15-11
Managing Data to Be Protected 15-12
Oracle Secure Backup Media Concepts 15-13
Volume Set Recycling 15-14
Automated Device Management 15-15
Library Management Operations 15-16
Oracle Secure Backup: Installation 15-17
Installing Oracle Secure Backup Software 15-18
Administrative Server Installation: Example 15-19
Defining Your Administrative Server in EM 15-20
The Oracle Secure Backup Device and Media Page 15-21
Adding Devices 15-22
Manage Devices by Using EM 15-23
RMAN and Oracle Secure Backup 15-24
Accessing Oracle Secure Backup from RMAN 15-25
User Preauthorization 15-26
Database Backup Storage Selector 15-27
RMAN and Oracle Secure Backup Usage Model 15-28
Defining Database Storage Selector 15-29
Testing Your Tape Drives 15-30
Scheduling Backups by Using EM Database Control 15-31
Oracle-Suggested Strategy for Backups 15-32
Managing Tape Backups 15-33
Performing Database Recovery by Using Tape Backups 15-34
Backing Up File-System Files with Oracle Secure Backup 15-35 Oracle Secure Backup Web Tool 15-36
Oracle Secure Backup Data Set Scripts 15-37
Data Set Script: Examples 15-38
Data Set Organization 15-39
Creating Data Sets Using the Web Interface 15-40
File-System Files Backup Concepts 15-41
Oracle Secure Backup Jobs 15-42
Creating On-Demand Backup Requests 15-43
Sending Backup Requests to the Scheduler 15-44
Creating Backup Schedules 15-45
Creating Backup Triggers 15-46
Viewing Job Properties and Transcripts 15-47
xv
Trang 17Restoring File-System Files with Oracle Secure Backup 15-48
Creating a Catalog-Based Restore Request 15-49
Sending Catalog-Based Restore Requests to the Scheduler 15-51
Listing All Backups of a Client 15-52
Summary 15-53
Practice 15: Overview 15-54
16 Flash Back Any Error
Objectives 16-2
Flashback Time Navigation 16-3
Flashback Error Correction 16-4
Flashback Database: Overview 16-5
Flashback Database: Eliminating Restore Time 16-6
Flashback Database Architecture 16-7
Configuring Flashback Database Using EM 16-8
Flashing Back Your Database by Using EM 16-9
Manually Configuring Flashback Database 16-10
Flashback Database: Examples 16-11
Monitoring Flashback Database 16-12
Excluding Tablespaces from Flashback Database 16-13
Flashback Database: Considerations 16-14
Flashing Back RESETLOGS 16-15
Flashback Drop: Overview 16-16
Recycle Bin 16-17
Flashing Back Dropped Tables by Using EM 16-18
Querying the Recycle Bin 16-19
Restoring Tables from the Recycle Bin 16-20
Recycle Bin: Automatic Space Reclamation 16-21
Recycle Bin: Manual Space Reclamation 16-22
Bypassing the Recycle Bin 16-23
Querying Dropped Tables 16-24
Flashback Drop: Considerations 16-25
Flashback Versions Query: Overview 16-26
Flashback Versions Query Using EM 16-27
Flashback Versions Query Syntax 16-28
Flashback Versions Query: Example 16-29
Flashback Versions Query: Considerations 16-30
Flashback Transaction Query: Overview 16-31
Flashback Transaction Query Using EM 16-32
Querying FLASHBACK_TRANSACTION_QUERY 16-33
Using Flashback Versions Query and Flashback Transaction Query 16-34 Flashback Transaction Query: Considerations 16-35
Flashback Table: Overview 16-36
Using EM to Flash Back Tables 16-37
xvi
Trang 18Flashback Table: Example 16-38
Rolling Back a Flashback Table Operation 16-39
Flashback Table: Considerations 16-40
Restore Points: Overview 16-41
Guaranteed Restore Points 16-42
Guaranteed Restore Points: Properties 16-43
Restore Point Creation and Usage 16-44
Guaranteed Undo Retention 16-45
SCN and Time Mapping Enhancements 16-46
Granting Flashback Privileges 16-47
When to Use Flashback Technology 16-48
Flashback Technology: Benefits 16-49
Summary 16-50
Practice 16: Overview 16-51
17 General Space Management Enhancements
Objectives 17-2
Oracle Database 10g Solution: Self-Managing Database 17-3
SYSAUX Tablespace: Overview 17-4
SYSAUX Tablespace: Benefits 17-5
SYSAUX Occupants 17-6
SYSAUX Tablespace: General Usage 17-9
SYSAUX Occupants: Visualization 17-10
SYSAUX Occupants: Relocation 17-11
SYSAUX Occupants: Relocation Using SQL 17-12
Tablespace Rename: Overview 17-13
Tablespace Rename: Usage Example 17-14
Tablespace Rename: Considerations 17-15
Tablespace Rename: Best Practices 17-16
Default Permanent Tablespace: Overview 17-17
Designating a Default Permanent Tablespace 17-18
Default Permanent Tablespace: SQL Examples 17-19
Copying Files by Using the Database Server 17-20
Local Copy: Example 17-21
Transferring Files: Example 17-22
Copying Files: Considerations 17-23
Redo Logfile Size Advisor 17-24
Dropping an Empty Data File 17-26
Summary 17-27
Practice 17: Overview 17-28
xvii
Trang 1918 Automatic Storage Management
Objectives 18-2
What Is Automatic Storage Management? 18-3
ASM: Key Features and Benefits 18-4
ASM: New Concepts 18-5
ASM: General Architecture 18-6
ASM Administration 18-8
ASM Instance Functionalities 18-9
Installing ASM: Overview 18-10
Transparent Multiversion Support 18-11
Creating a Database on ASM 18-12
Creating an ASM Instance on Its Own 18-13
ASM Instance Initialization Parameters 18-14
Accessing an ASM Instance 18-15
Dynamic Performance View Additions 18-16
ASM Home Page 18-17
ASM Performance Page 18-18
ASM Configuration Page 18-19
Starting Up an ASM Instance 18-20
Shutting Down an ASM Instance 18-21
ASM Administration 18-22
ASM Disk Group 18-23
Failure Group 18-24
Disk Group Mirroring 18-25
Disk Group Dynamic Rebalancing 18-26
ASM: Administration Page 18-27
Create Disk Group Page 18-28
Creating or Deleting Disk Groups 18-29
Adding Disks to Disk Groups 18-30
Miscellaneous Alter Commands 18-31
Monitoring Long-Running Operations by Using V$ASM_OPERATION 18-33 ASM Administration 18-34
ASM Files 18-35
ASM File Names 18-36
ASM File Name Syntax 18-37
ASM File Name Mapping 18-39
ASM File Templates 18-40
Template and Alias: Examples 18-41
Retrieving Aliases 18-42
SQL Commands and File Naming 18-43
ASM Command-Line Interface: Overview 18-44
ASM Command-Line Interface Commands 18-45
Database Instance Parameter Changes 18-46
xviii
Trang 20Migrate Database To ASM Wizard 18-48
Manually Migrating Your Database to ASM 18-49 ASM and Transportable Tablespaces 18-50
ASM and XML DB: Overview 18-51
ASM Virtual Folder Hierarchy 18-52
ASM Virtual Folder: Typical Use 18-53
Summary 18-54
Practice 18: Overview 18-55
19 Maintaining Software
Objectives 19-2
Oracle Database 10g Upgrade Paths 19-3
Choosing an Upgrade Method 19-4
Advantages of Using DBUA 19-5
Manual Upgrade: Advantages and Disadvantages 19-6 New Preupgrade Information Utility 19-7
Oracle Database 10g: Simplified Upgrade 19-8
New Postupgrade Status Utility 19-9
Properly Prepared Upgrade 19-10
Using Database Upgrade Assistant 19-11
Recompiling Invalid Objects 19-12
Backing Up the Database Before Upgrade 19-13 Upgrade Summary 19-14
Performing the Manual Upgrade 19-15
Downgrading Using a Single Script 19-20
MetaLink Integration 19-21
OPatch Utility 19-22
OPatch Operations 19-24
Support for RAC Environments 19-25
OPatch Process Flow 19-26
Patch Conflict Detection 19-28
Summary 19-29
20 Security
Objectives 20-2
Virtual Private Database: Overview 20-3
Virtual Private Database: Enhancements 20-4
Column-Level VPD: Example 20-5
Creating a Column-Level Policy 20-6
Policy Types: Overview 20-7
Static Policies 20-8
Context-Sensitive Policies 20-9
Sharing Policy Functions 20-10
Auditing Mechanisms: Overview 20-11
xix
Trang 21Uniform Audit Trails 20-12
Enhanced Enterprise User Auditing 20-13
Audit EM Page 20-14
Audit Enhancements 20-15
Fine-Grained Auditing: Enhancements 20-16
Fine-Grained Auditing Policy: Example 20-17
Audited DML Statement: Considerations 20-18
Transparent Data Encryption: Overview 20-19
Implementing Transparent Data Encryption 20-20 Existing Tables and Transparent Data Encryption 20-22 Transparent Data Encryption: Considerations 20-23 Data Pump and Transparent Data Encryption 20-24 RMAN Encrypted Backups: Overview 20-25
Transparent Mode Setup 20-26
Password Mode Setup 20-27
Dual Mode Setup 20-28
RMAN Encrypted Backups: Considerations 20-29
Wallet Support for Usernames and Passwords 20-31 Summary 20-32
Configurationless Client Connect 21-6
Simplified Shared-Server Configuration 21-8
Viewing the Dispatcher Configuration 21-9
Resumable Space Allocation Enhancements 21-10 Flushing the Buffer Cache 21-11
Large Object (LOB) Data Type Changes 21-13
Implicit Conversion Between CLOB and NCLOB 21-14 Regular Expression Support 21-15
Trang 22UTL_MAIL: Examples 21-24
LogMiner Enhancements 21-25
Enhanced Initialization Parameters 21-26
Faster Instance Startup for Ultralarge Buffer Caches 21-27 Asynchronous COMMIT 21-28
How to Use Asynchronous COMMIT 21-29
Diagnosis of Hung or Extremely Slow Databases 21-30 Using Memory Access Mode 21-31
Using the Hang Analysis Page 21-32
Trang 24Copyright © 2005, Oracle All rights reserved.
Application Tuning
Trang 25Copyright © 2005, Oracle All rights reserved.
8-2
Objectives
After completing this lesson, you should be able to do the following:
• Use the new optimizer statistics
• Identify the implications of rule-based optimizer obsolescence
Trang 26Copyright © 2005, Oracle All rights reserved.
8-3
Oracle Database 10g Solution:
Self-Managing Database
Application and SQL management Storage
management
Backup and recovery management
System resource management
Space management
Alert Monitor
Common infrastructure
Automatic management
Database Control
Oracle Database 10g Solution: Self-Managing Database
Oracle Database 10g automatically informs you about performance and resource allocation
problems In addition to providing you with suggestions for fixing these problems, Oracle
Database 10g can also automatically fix the problems for you.
Trang 27Copyright © 2005, Oracle All rights reserved.
8-4
Automatic Statistics Gathering
• Statistics are gathered by the predefined
• This job implicitly determines the following:
gather good statistics on those objects
the size of those histograms
statistics
Automatic Statistics Gathering
Optimizer statistics are automatically gathered by GATHER_STATS_JOB This job gathers statistics on all objects in the database that have missing or stale statistics
This job is created automatically at database creation time and is managed by the Scheduler GATHER_STATS_JOBgathers optimizer statistics by calling the
DBMS_STATS.GATHER_DATABASE_STATS_JOB_PROCprocedure This procedure
operates in a similar fashion to the DBMS_STATS.GATHER_DATABASE_STATS procedure by using the GATHER AUTO option The primary difference is that the
GATHER_DATABASE_STATS_JOB_PROCprocedure prioritizes the database objects that require statistics, so that those objects that need updated statistics the most are processed first This ensures that the most needed statistics are gathered before the maintenance window closes
Note: For more information about this feature, see the lesson titled “Automatic Management” in
this course
Trang 28Copyright © 2005, Oracle All rights reserved.
8-5
Enhanced Query Optimization
• Graceful behavior with missing or incomplete
statistics:
default.
Enhanced Query Optimization
The cost model is the optimizer component that estimates the cost of a query In releases before
Oracle9i, the cost model was limited to I/O contribution only Oracle9i Database introduced
CPU costing to make it possible to account for CPU-intensive and CPU-only operations For example, one of the important CPU-only operations is fetching data from the buffer cache The default cost model for the optimizer is now CPU + I/O
You should use dynamic sampling only when its compile-time overhead is acceptable If it is acceptable, then it is better to leave highly volatile objects without statistics The remaining objects should still be analyzed Even if it is very tolerable, raise the dynamic sampling level
to 4 or 5 with statistics collected In this case, dynamic sampling is used in conjunction with the statistics when the optimizer detects that it is useful
Automatic PGA Memory Management is now enabled by default, unless
PGA_AGGREGATE_TARGETis explicitly set to 0 or WORKAREA_ SIZE_POLICY is
explicitly set to MANUAL PGA_AGGREGATE_TARGET is defaulted to 20 percent of the SGA size, unless explicitly set
Note: There is no dynamic sampling support in Oracle Database 10g for fixed tables.
Trang 29Copyright © 2005, Oracle All rights reserved.
GATHER_DICTIONARY_STATS
Statistics on Dictionary Objects
Starting with Oracle Database 10g, you should gather statistics on dictionary tables (both fixed
and real) to get the best performance results
At any time, it is possible to collect statistics on dictionary tables by using the
DBMS_STATS.GATHER_{SCHEMA|DATABASE}_STATS procedures with the GATHER_SYSargument set to TRUE You can also use the new procedure called
DBMS_STATS.GATHER_DICTIONARY_STATS, and for this purpose, you need the new ANALYZE ANY DICTIONARYsystem privilege You need this privilege also to analyze the dictionary objects and fixed objects, unless you are a user with the SYSDBA privilege
The GATHER_DATABASE_STATS procedure has a new argument called GATHER_FIXED, which is set to FALSE by default and causes statistics not to be gathered for fixed tables It should be sufficient to gather fixed-table statistics once during a typical system workload
It is also possible to gather statistics on fixed tables by using the new procedure called
GATHER_FIXED_OBJECTS_STATS Similarly, it is possible to delete statistics on all fixed tables and export or import statistics on fixed tables
Note: It is possible to collect statistics for individual fixed tables by using existing procedures of
the DBMS_STATS package that take a table name as argument These are enhanced to accept a fixed table name as argument As fixed tables do not have I/O cost because the rows reside in
Trang 30Copyright © 2005, Oracle All rights reserved.
8-7
Dictionary Statistics: Best Practices
GATHER_DATABASE_STATS(OPTIONS=>'GATHER AUTO')
GATHER_SCHEMA_STATS('SYS') GATHER_DICTIONARY_STATS
DROP
…
Dictionary Statistics: Best Practices
The following are some guidelines for collecting statistics on the data dictionary:
• Dictionary objects: Whatever the interval you use to analyze the objects in your schemas,
the recommended method is to use either GATHER_DATABASE_STATS or
GATHER_SCHEMA_STATS, with OPTIONS set to GATHER AUTO, assuming that the monitoring feature is enabled By doing so, you ensure that only the objects that need to be reanalyzed are processed every time You can also use the new
GATHER_DICTIONARY_STATSprocedure Additionally, you may want to analyze the dictionary after a sufficient number of DDL operations have occurred
• Fixed objects: It should be sufficient to analyze fixed objects once during a typical system
workload Subsequent collection is not necessary unless workload characteristics change dramatically For example, if you are connected as the SYS user, you can gather statistics
of all fixed objects with the following command:
exec dbms_stats.gather_fixed_objects_stats('ALL');
Note: For more information about DBMS_STATS procedures, see the Oracle Database PL/SQL
Packages and Types Reference guide.
Trang 31Copyright © 2005, Oracle All rights reserved.
8-8
Miscellaneous Statistics-Related Changes
The DBMS_STATS package has new values:
– AUTO
Miscellaneous Statistics-Related Changes
Oracle Database 10g introduces new values for the GRANULARITY and DEGREE arguments of
the GATHER_*_STATS procedures to simplify the determination of the calculated statistics Unless you are an experienced user, you should use the new default values:
- AUTO_DEGREE: This value enables the Oracle server to decide the degree of
parallelism automatically It is either 1 (serial execution) or DEFAULT_DEGREE (the system default value based on the number of CPUs and initialization parameters) according to the size of the object
Trang 32Copyright © 2005, Oracle All rights reserved.
8-9
Locking Statistics
• Is mainly used for volatile tables:
With Oracle Database 10g, you can lock statistics on a specified table with the new
LOCK_TABLE_STATSprocedure of the DBMS_STATS package You can lock statistics on a table without statistics to prevent automatic statistics collection so that you can use dynamic sampling on a volatile table with no statistic You can also lock statistics on a volatile table at a point when it is fully populated so that the table statistics are more representative of the table population
You can also lock statistics at the schema level by using the LOCK_SCHEMA_STATS procedure.You can query the STATTYPE_LOCKED column in the {USER | ALL |
DBA}_TAB_STATISTICS view to determine whether the statistics on the table are locked.You can use the UNLOCK_TABLE_STATS procedure to unlock the statistics on a specified table
Note: When you lock the statistics on a table, all the dependent statistics are considered locked
This includes table statistics, column statistics, histograms, and dependent index statistics
Trang 33Copyright © 2005, Oracle All rights reserved.
8-10
Using the DBMS_STATS Package
• Override statistics locking
Using the DBMS_STATS Package
With Oracle Database 10g, there is a new argument for the DELETE_*_STATS,
IMPORT_*_STATS, RESTORE_*_STATS, and SET_*_STATS procedures of the
DBMS_STATSpackage You can set the value of FORCE to TRUE to overwrite the statistics even if they are locked
Trang 34Copyright © 2005, Oracle All rights reserved.
• To collect system statistics
• To collect statistics on fixed objects
Automatic Statistics Collection: Considerations
For tables that are being bulk-loaded, the statistics-gathering procedures should be run
immediately following the load process
Automatic statistics collection is not supported for external tables, system statistics, and statistics
on fixed objects (such as the dynamic performance tables)
Trang 35Copyright © 2005, Oracle All rights reserved.
8-12
History of Optimizer Statistics
DBA_TAB_STATS_HISTORY
New statistics
Old statistics
DBA_OPTSTAT_OPERATIONS
31 days
RESTORE_TABLE_STATS
Operation date
History of Optimizer Statistics
Whenever optimizer statistics are modified using the DBMS_STATS package, old versions of the statistics are saved automatically for future restoration You can restore statistics by using the RESTOREprocedures of the DBMS_STATS package These procedures use a time stamp as an argument and restore statistics as of that time stamp This is useful if newly collected statistics lead to some suboptimal execution plans and if you want to revert to the previous set of statistics.You can use the DBA_OPTSTAT_OPERATIONS view to determine the start and end time of all DBMS_STATSoperations executed at the schema and database level The
DBA_TAB_STATS_HISTORYview contains the history of table statistics modifications for the past 31 days by default This means that you are able to restore the optimizer statistics to any time in the last 31 days The old statistics are purged automatically at regular intervals based on the statistics history retention setting
Note: Old versions of statistics are not stored when the ANALYZE command has been used for
collecting statistics You cannot use the RESTORE procedures to restore user-defined statistics
Trang 36Copyright © 2005, Oracle All rights reserved.
Managing Historical Optimizer Statistics
• RESTORE_TABLE_STATSrestores statistics of a table as of a specified time stamp
It also restores statistics of associated indexes and columns If the table statistics were locked at the specified time stamp, the procedure locks the statistics
• RESTORE_SCHEMA_STATSrestores statistics of all tables of a schema as of a specifiedtime stamp
• RESTORE_DATABASE_STATSrestores statistics of all tables in the database as of a specified time stamp
• RESTORE_FIXED_OBJECTS_STATSrestores statistics of all fixed tables as of a
specified time stamp You must have the SYSDBA or ANALYZE ANY DICTIONARYsystem privilege to execute this procedure
• RESTORE_DICTIONARY_STATSrestores statistics of all dictionary tables You must have either the SYSDBA privilege or both the ANALYZE ANY DICTIONARY and
ANALYZE ANYprivileges to execute this procedure
• RESTORE_SYSTEM_STATSrestores system statistics as of a specified time stamp
• Retention is configurable using the ALTER_STATS_HISTORY_RETENTION procedure GET_STATS_HISTORY_RETENTIONgives you the current statistics history retention value GET_STATS_HISTORY_AVAILABILTY gives you the oldest time stamp for which statistics history is available
• If automatic purging is disabled, you can manually purge the old versions of statistics by using the PURGE_STATS procedure
Trang 37Copyright © 2005, Oracle All rights reserved.
8-14
Managing Optimizer Statistics Using EM
Managing Optimizer Statistics Using EM
To manage the optimizer statistics, you can use the Manage Optimizer Statistics page Using this page, you can do the following:
• Configure GATHER_STATS_JOB, as discussed in the lesson titled “Automatic
Management.”
• Use the Gather Statistics wizard when GATHER_STATS_JOB fails to meet your needs, such as when you want to gather statistics immediately The wizard steps you through the specification of sampling size, schedule, and the scope of the process (database, schema, table, and so on) among other things With this wizard, you can also gather statistics on dictionary tables as well as fixed tables
• Use the Restore Statistics wizard to restore the statistics of the databases or their related objects to a specified time stamp in the past This, of course, is dependent on the retention period that had been set on the Statistics Options page The wizard steps you through identifying the objects, the restore-from time, and the scheduling of the job
• Use the Lock Statistics and Unlock Statistics wizards to identify the schema or tables for which to lock or unlock statistics, and specify the schedule for the job to run
• Use the Delete Statistics wizard to delete statistics across objects that you designate
Trang 38Copyright © 2005, Oracle All rights reserved.
8-15
DML Table Monitoring Changes
STATISTICS_LEVEL=TYPICAL
DBMS_STATS.ALTER_DATABASE_TAB_MONITORING();
DBMS_STATS.ALTER_SCHEMA_TAB_MONITORING
('SH',TRUE);
DML Table Monitoring Changes
Starting with Oracle Database 10g, the STATISTICS_LEVEL initialization parameter works as
a global switch for the table-monitoring mechanism instead of using the [NO]MONITORINGclauses in the {CREATE|ALTER} TABLE statements
If STATISTICS_LEVEL is set to BASIC, the monitoring feature is disabled If set to
TYPICAL(the default) or ALL, the monitoring feature is enabled
This change simplifies the operation and also makes it consistent with other related statistics However, you can no longer enable monitoring at the object level because the
[NO]MONITORING clauses are now obsolete
The modification-monitoring mechanism is now enabled by default, and users of the GATHER AUTOor STALE feature of DBMS_STATS no longer have to enable monitoring explicitly for every table under the default settings
You can still use the [NO]MONITORING clauses in the {CREATE|ALTER} TABLE statements as well as the ALTER_SCHEMA_TAB_MONITORING and
ALTER_DATABASE_TAB_MONITORINGprocedures of the DBMS_STATS package, but these clauses and procedures are now considered non-operational
Note: There is no table monitoring for temporary tables.
Trang 39Copyright © 2005, Oracle All rights reserved.
8-16
Rule-Based Optimizer Obsolescence
supported:
Database 10g
• ALL_ROWS is the default value for
Rule-Based Optimizer Obsolescence
Rule-based optimizer (RBO) as a functionality is no longer supported RBO still exists in Oracle
Database 10g but is an unsupported feature No code changes have been made to RBO, and no bug fixes are provided Oracle Database 10g supports only the cost-based optimizer (CBO), and all applications running on Oracle Database 10g should use that optimizer Review the following OracleMetaLink desupport notice (189702.1) for RBO:
http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT
&p_id=189702.1
This notice provides details about the desupport of RBO and the migration of applications based
on RBO to query optimization The following are some consequences of the desupport of RBO:
• CHOOSEand RULE are no longer supported as values for the OPTIMIZER_MODE
initialization parameter The functionalities of those parameter values still exist but will be removed in a future release This is also true for the corresponding optimizer hints
• ALL_ROWSis the default value for the OPTIMIZER_MODE initialization parameter
• Existing applications relying on RBO must be moved to CBO
The use of the RBO prevents applications from leveraging many of the key features and
enhancements that have been introduced since Oracle database version 7
Trang 40Copyright © 2005, Oracle All rights reserved.
8-17
Automatic SQL Tuning: Overview
tuning process and replaces manual SQL tuning.
mode.
SQL statements.
Automatic SQL Tuning: Overview
Automatic SQL Tuning is a new capability of the query optimizer that automates the entire SQL tuning process Using the newly enhanced query optimizer to tune SQL statements, the
automatic process replaces manual SQL tuning, which is a complex, repetitive, and
time-consuming function The SQL Tuning Advisor exposes the features of Automatic SQL Tuning to the user The enhanced query optimizer has two modes:
• In normal mode, the optimizer compiles SQL and generates an execution plan The normal mode of the optimizer generates a reasonable execution plan for the vast majority of SQL statements In normal mode, the optimizer operates with very strict time constraints,
usually a fraction of a second, during which it must find a good execution plan
• In tuning mode, the optimizer performs additional analysis to check whether the execution plan produced under normal mode can be further improved The output of the query
optimizer in tuning mode is not an execution plan but a series of actions, along with their rationale and expected benefit (for producing a significantly superior plan) When called under tuning mode, the optimizer is referred to as Automatic Tuning Optimizer (ATO) The tuning performed by ATO is called Automatic SQL Tuning
Under tuning mode, the optimizer can take several minutes to tune a single statement ATO is meant to be used for complex and high-load SQL statements that have a nontrivial impact on the entire system