Oracle9 i Database Administrator’s Guide Release 1 (9.0.1) June 2001 Part No. A90117-01 Oracle9i Database Administrator’s Guide, Release 1 (9.0.1) Part No. A90117-01 Copyright © 2001, Oracle Corporation. All rights reserved. Primary Author: Ruth Baylis Contributing Authors: Kathy Rich, Joyce Fee Graphic Designer: Valarie Moore Contributors: Lance Ashdown, Mark Bauer, Allen Brumm, Michele Cyran, Mary Ann Davidson, Harvey Eneman, Amit Ganesh, Carolyn Gray, Wei Huang, Robert Jenkins, Mark Kennedy, Jonathan Klein, Sushil Kumar, Bill Lee, Nina Lewis, Phil Locke, Yunrui Li, Diana Lorentz, Sujatha Muthulingam, Gary Ngai, Lois Price, Ananth Raghavan, Ann Rhee, John Russell, Rajiv Sinha, Vinay Srihari, Jags Srinivasan, Anh-Tuan Tran, Deborah Steiner, Janet Stern, Michael Stewart, Ashwini Surpur, Alex Tsukerman, Kothanda Umamageswaran, Randy Urbano, Steven Wertheimer, Daniel Wong The Programs (which include both the software and documentation) contain proprietary information of Oracle Corporation; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this document is error free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation. If the Programs are delivered to the U.S. Government or anyone licensing or using the programs on behalf of the U.S. Government, the following notice is applicable: Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial computer software" and use, duplication, and disclosure of the Programs, including documentation, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement. Otherwise, Programs delivered subject to the Federal Acquisition Regulations are "restricted computer software" and use, duplication, and disclosure of the Programs shall be subject to the restrictions in FAR 52.227-19, Commercial Computer Software - Restricted Rights (June, 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065. The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and Oracle Corporation disclaims liability for any damages caused by such use of the Programs. Oracle is a registered trademark, and LogMiner, Oracle Call Interface, Oracle Database Configuration Assistant, Oracle Enterprise Manager, Oracle Label Security, Real Application Clusters, Oracle OLAP Services, Oracle Spatial, Oracle Text, PL/SQL, SQL*Plus are trademarks or registered trademarks of Oracle Corporation. Other names may be trademarks of their respective owners. iii Contents Send Us Your Comments xxix Preface xxxi What’s New in Oracle9 i ? xliii Part I Basic Database Administration 1 The Oracle Database Administrator Types of Oracle Users 1-2 Database Administrators 1-2 Security Officers 1-3 Network Administrators 1-3 Application Developers 1-3 Application Administrators 1-4 Database Users 1-4 Tasks of a Database Administrator 1-4 Task 1: Evaluate the Database Server Hardware 1-5 Task 2: Install the Oracle Software 1-5 Task 3: Plan the Database 1-5 Task 4: Create and Open the Database 1-6 Task 5: Back Up the Database 1-7 Task 6: Enroll System Users 1-7 Task 7: Implement the Database Design 1-7 iv Task 8: Back Up the Fully Functional Database 1-7 Task 9: Tune Database Performance 1-8 Identifying Your Oracle Database Software Release 1-8 Release Number Format 1-8 Checking Your Current Release Number 1-9 Database Administrator Security and Privileges 1-9 The Database Administrator’s Operating System Account 1-10 Database Administrator Usernames 1-10 Database Administrator Authentication 1-12 Administrative Privileges 1-12 Selecting an Authentication Method 1-14 Using Operating System (OS) Authentication 1-16 Using Password File Authentication 1-17 Password File Administration 1-18 Using ORAPWD 1-19 Setting REMOTE_LOGIN_ PASSWORDFILE 1-20 Adding Users to a Password File 1-21 Maintaining a Password File 1-23 Database Administrator Utilities 1-24 SQL*Loader 1-24 Export and Import 1-24 2 Creating an Oracle Database Considerations Before Creating a Database 2-2 Planning for Database Creation 2-2 Meeting Creation Prerequisites 2-4 Deciding How to Create an Oracle Database 2-4 The Oracle Database Configuration Assistant 2-5 Advantages of Using the Oracle Database Configuration Assistant 2-6 Creating a Database 2-6 Configuring Database Options 2-10 Deleting a Database 2-10 Managing Templates 2-10 Manually Creating an Oracle Database 2-11 Step 1: Decide on Your Instance Identifier (SID) 2-12 v Step 2: Establish the Database Administrator Authentication Method 2-12 Step 3: Create the Initialization Parameter File 2-13 Step 4: Connect to the Instance 2-15 Step 5: Start the Instance 2-15 Step 6: Issue the CREATE DATABASE Statement 2-16 Step 7: Create Additional Tablespaces 2-18 Step 8: Run Scripts to Build Data Dictionary Views 2-19 Step 9: Run Scripts to Install Additional Options (Optional) 2-19 Step 10: Create a Server Parameter File (Recommended) 2-19 Step 11: Back Up the Database 2-20 Oracle9i Features that Simplify Database Creation and Management 2-20 Creating an Undo Tablespace 2-20 Creating a Default Temporary Tablespace 2-21 Using Oracle-Managed Files 2-22 Setting and Managing the Time Zone 2-23 Troubleshooting Database Creation 2-24 Dropping a Database 2-24 Considerations After Creating a Database 2-24 Some Security Considerations 2-25 Installing Oracle’s Sample Schemas 2-26 Initialization Parameters and Database Creation 2-28 Determining the Global Database Name 2-28 Specifying Control Files 2-29 Specifying Database Block Sizes 2-30 Setting Initialization Parameters that Affect the Size of the SGA 2-31 Specifying the Maximum Number of Processes 2-34 Specifying the Method of Undo Space Management 2-34 Setting License Parameters 2-35 Managing Initialization Parameters Using a Server Parameter File 2-36 What is a Server Parameter File? 2-37 Migrating to a Server Parameter File 2-38 Creating a Server Parameter File 2-38 The SPFILE Initialization Parameter 2-39 Using ALTER SYSTEM to Change Initialization Parameter Values 2-40 Exporting the Server Parameter File 2-42 vi Errors and Recovery for the Server Parameter File 2-43 Viewing Parameters Settings 2-43 3 Using Oracle-Managed Files What are Oracle-Managed Files? 3-2 Who Can Use Oracle-Managed Files? 3-2 Benefits of Using Oracle-Managed Files 3-3 Oracle-Managed Files and Existing Functionality 3-4 Enabling the Creation and Use of Oracle-Managed Files 3-4 Setting the DB_CREATE_FILE_DEST Initialization Parameter 3-5 Setting the DB_CREATE_ONLINE_LOG_DEST_n Initialization Parameter 3-6 Creating Oracle-Managed Files 3-6 How Oracle-Managed Files are Named 3-7 Creating Oracle-Managed Files at Database Creation 3-8 Creating Datafiles for Tablespaces 3-13 Creating Tempfiles for Temporary Tablespaces 3-16 Creating Control Files 3-17 Creating Online Redo Log Files 3-19 Behavior of Oracle-Managed Files 3-20 Dropping Datafiles and Tempfiles 3-21 Dropping Online Redo Log Files 3-21 Renaming Files 3-21 Managing Standby Databases 3-22 Scenarios for Using Oracle-Managed Files 3-22 Scenario 1: Create and Manage a Database with Multiplexed Online Redo Logs 3-22 Scenario 2: Add Oracle-Managed Files to an Existing Database 3-27 4 Starting Up and Shutting Down Starting Up a Database 4-2 Options for Starting Up a Database 4-2 Preparing to Start an Instance 4-3 Using SQL*Plus to Start Up a Database 4-3 Starting an Instance: Scenarios 4-5 Altering Database Availability 4-9 Mounting a Database to an Instance 4-9 vii Opening a Closed Database 4-9 Opening a Database in Read-Only Mode 4-10 Restricting Access to an Open Database 4-10 Shutting Down a Database 4-11 Shutting Down with the NORMAL Option 4-11 Shutting Down with the IMMEDIATE Option 4-12 Shutting Down with the TRANSACTIONAL Option 4-12 Shutting Down with the ABORT Option 4-13 Quiescing a Database 4-13 Placing a Database into a Quiesced State 4-14 Restoring the System to Normal Operation 4-16 Viewing the Quiesce State of an Instance 4-16 Suspending and Resuming a Database 4-16 Part II Oracle Server Processes and Storage Structure 5 Managing Oracle Processes Server Processes 5-2 Dedicated Server Processes 5-2 Shared Server Processes 5-3 Configuring Oracle for the Shared Server 5-5 Initialization Parameters for Shared Server 5-5 Setting the Initial Number of Dispatchers (DISPATCHERS) 5-6 Setting the Initial Number of Shared Servers (SHARED_SERVERS) 5-8 Modifying Dispatcher and Server Processes 5-8 Monitoring Shared Server 5-11 About Oracle Background Processes 5-11 Monitoring the Processes of an Oracle Instance 5-14 Process and Session Views 5-14 Monitoring Locks 5-15 Trace Files and the Alert File 5-15 Managing Processes for Parallel Execution 5-18 Managing the Parallel Execution Servers 5-18 Altering Parallel Execution for a Session 5-19 Managing Processes for External Procedures 5-20 viii Setting up an Environment for Calling External Procedures 5-21 Example of tnsnames.ora Entry for External Procedure Listener 5-22 Example of listener.ora Entry for External Procedures 5-22 Terminating Sessions 5-22 Identifying Which Session to Terminate 5-23 Terminating an Active Session 5-24 Terminating an Inactive Session 5-24 6 Managing Control Files What Is a Control File? 6-2 Guidelines for Control Files 6-2 Provide Filenames for the Control Files 6-2 Multiplex Control Files on Different Disks 6-3 Place Control Files Appropriately 6-3 Back Up Control Files 6-3 Manage the Size of Control Files 6-4 Creating Control Files 6-4 Creating Initial Control Files 6-4 Creating Additional Copies, Renaming, and Relocating Control Files 6-5 Creating New Control Files 6-5 Troubleshooting After Creating Control Files 6-9 Checking for Missing or Extra Files 6-9 Handling Errors During CREATE CONTROLFILE 6-10 Backing Up Control Files 6-10 Recovering a Control File Using a Current Copy 6-10 Recovering from Control File Corruption Using a Control File Copy 6-10 Recovering from Permanent Media Failure Using a Control File Copy 6-11 Dropping Control Files 6-11 Displaying Control File Information 6-12 7 Managing the Online Redo Log What Is the Online Redo Log? 7-2 Redo Threads 7-2 Online Redo Log Contents 7-2 How Oracle Writes to the Online Redo Log 7-3 ix Planning the Online Redo Log 7-5 Multiplexing Online Redo Log Files 7-5 Placing Online Redo Log Members on Different Disks 7-9 Setting the Size of Online Redo Log Members 7-9 Choosing the Number of Online Redo Log Files 7-10 Controlling Archive Lag 7-10 Creating Online Redo Log Groups and Members 7-12 Creating Online Redo Log Groups 7-13 Creating Online Redo Log Members 7-13 Relocating and Renaming Online Redo Log Members 7-14 Dropping Online Redo Log Groups and Members 7-16 Dropping Log Groups 7-16 Dropping Online Redo Log Members 7-17 Forcing Log Switches 7-18 Verifying Blocks in Redo Log Files 7-18 Clearing an Online Redo Log File 7-19 Viewing Online Redo Log Information 7-20 8 Managing Archived Redo Logs What Is the Archived Redo Log? 8-2 Choosing Between NOARCHIVELOG and ARCHIVELOG Mode 8-2 Running a Database in NOARCHIVELOG Mode 8-2 Running a Database in ARCHIVELOG Mode 8-3 Controlling the Archiving Mode 8-4 Setting the Initial Database Archiving Mode 8-5 Changing the Database Archiving Mode 8-5 Enabling Automatic Archiving 8-6 Disabling Automatic Archiving 8-8 Performing Manual Archiving 8-9 Specifying the Archive Destination 8-9 Specifying Archive Destinations 8-9 Understanding Archive Destination Status 8-12 Specifying the Mode of Log Transmission 8-13 Normal Transmission Mode 8-14 Standby Transmission Mode 8-14 x Managing Archive Destination Failure 8-15 Specifying the Minimum Number of Successful Destinations 8-16 Re-Archiving to a Failed Destination 8-18 Tuning Archive Performance by Specifying Multiple ARCn Processes 8-19 Controlling Trace Output Generated by the Archivelog Process 8-21 Viewing Information About the Archived Redo Log 8-22 Fixed Views 8-23 The ARCHIVE LOG LIST Command 8-24 9 Using LogMiner to Analyze Redo Log Files Understanding the Value of Analyzing Redo Log Files 9-2 Things to Know Before You Begin 9-2 Redo Log Files 9-3 Dictionary Options 9-4 Tracking of DDL Statements 9-5 Storage Management 9-6 Extracting Data Values from Redo Log Files 9-6 LogMiner Restrictions 9-7 LogMiner Views 9-7 Using LogMiner 9-8 Extracting a Dictionary 9-9 Specifying Redo Log Files for Analysis 9-12 Starting LogMiner 9-13 Analyzing Output from V$LOGMNR_CONTENTS 9-17 Using LogMiner to Perform Object-Level Recovery 9-18 Ending a LogMiner Session 9-18 Example Uses of LogMiner 9-19 Example: Tracking Changes Made By a Specific User 9-19 Example: Calculating Table Access Statistics 9-21 10 Managing Job Queues Enabling Processes Used for Executing Jobs 10-2 Managing Job Queues 10-3 The DBMS_JOB Package 10-3 Submitting a Job to the Job Queue 10-4 [...]... s Oracle9i Database Concepts Chapter 1 of Oracle9i Database Concepts contains an overview of the concepts and terminology related to Oracle and provides a foundation for the more detailed information in this guide This chapter is a starting point to become familiar with the Oracle database server, and is recommended reading before starting Oracle9i Database Administrator’s Guide The remainder of Oracle9i. .. Distributed Database Systems 28-2 Heterogeneous Distributed Database Systems 28-5 Client/Server Database Architecture 28-6 Database Links 28-8 What Are Database Links? 28-8 What Are Shared Database Links? 28-10 Why Use Database Links? 28-11 Global Database Names in Database Links 28-12 Names for Database Links... 28-14 Types of Database Links 28-15 Users of Database Links 28-16 Creation of Database Links: Examples 28-19 Schema Objects and Database Links 28-20 Database Link Restrictions 28-22 Distributed Database Administration 28-23 Site Autonomy 28-23 Distributed Database Security 28-24 Auditing Database Links... server software and migrating existing Oracle databases to newer formats (for example, version 8 databases to Oracle9i format) This guide is not an installation or migration manual If your primary interest is installation, see your operating system specific Oracle installation guide If your primary interest is database or application migration, see the Oracle9i Database Migration manual Readers Interested... Listing Roles of the Database Listing Information About the Privilege Domains of Roles 26 Auditing Database Use Guidelines for Auditing Decide Whether to Use the Database or Operating System Audit Trail Keep Audited Information Manageable Guidelines for Auditing Suspicious Database Activity Guidelines for Auditing Normal Database Activity ... This guide is for people who administer the operation of an Oracle database system Referred to as database administrators (DBAs), they are responsible for creating Oracle databases, ensuring their smooth operation, and monitoring their use This preface contains these topics: s Audience s Organization s Related Documentation s Conventions s Documentation Accessibility Note: The Oracle9i Database Administrator’s. .. partitioned tables and indexes, you must have the Oracle9i Enterprise Edition or Oracle9i Personal Edition For information about the differences between the various editions of Oracle9i and the features and options that are available to you, please refer to Oracle9i Database New Features xxxi Audience Readers of this guide are assumed to be familiar with relational database concepts They are also assumed to... 26-17 26-18 26-18 Database Resource Management Using the Database Resource Manager What Is the Database Resource Manager? What Problems Does the Database Resource Manager Address? How Does the Database Resource Manager Address These Problems? What are the Elements of the Database Resource Manager? Understanding Resource Plans Administering the Database Resource... of Oracle and advanced database application designers might also find information in this guide useful However, database application developers should also see the Oracle9i Application Developer’s Guide - Fundamentals and the documentation for the tool or language product they are using to develop Oracle database applications Organization This document contains: Part I: Basic Database Administration... Creating Database Links Specifying Link Types Specifying Link Users Using Connection Qualifiers to Specify Service Names Within Link Names Creating Shared Database Links Determining Whether to Use Shared Database Links Creating Shared Database Links Configuring Shared Database Links Managing Database Links Closing Database . Oracle9 i Database Administrator’s Guide Release 1 (9.0.1) June 2001 Part No. A90117-01 Oracle9i Database Administrator’s Guide, Release 1 (9.0.1) Part. 1-9 Database Administrator Security and Privileges 1-9 The Database Administrator’s Operating System Account 1-10 Database Administrator Usernames 1-10 Database