Oracle® Database Administrator's Guide 11g Release (11.1) B28310-03 October 2007 Oracle Database Administrator’s Guide, 11g Release (11.1) B28310-03 Copyright © 2001, 2007, Oracle All rights reserved Primary Author: Steve Fogel Contributing Author: Tony Morales, Padmaja Potineni, Sheila Moore Contributors: David Austin, Bharat Baddepudi, Prasad Bagal, Cathy Baird, Mark Bauer, Eric Belden, Allen Brumm, Atif Chaudhry, Sudip Datta, Mark Dilman, Jacco Draaijer, Harvey Eneman, Marcus Fallen, Amit Ganesh, GP Gongloor, Vira Goorah, Carolyn Gray, Joan Gregoire, Shivani Gupta, Daniela Hansell, Lilian Hobbs, Bill Hodak, Wei Huang, Pat Huey, Robert Jenkins, Bhushan Khaladkar, Balaji Krishnan, Srinath Krishnaswamy, Vasudha Krishnaswamy, Bala Kuchibhotla, Sushil Kumar, Vikram Kumar, Paul Lane, Adam Lee, Bill Lee, Sue K Lee, Chon Lei, Yunrui Li, Ilya Listvinsky, Bryn Llewellyn, Catherine Luu, Scott Lynn, Raghu Mani, Vineet Marwah, Colin McGregor, Mughees Minhas, Krishna Mohan, Sheila Moore, Valarie Moore, Niloy Mukherjee, Sujatha Muthulingam, Gary Ngai, Waleed Ojeil, Rod Payne, Hanlin Qian, Ananth Raghavan, Mark Ramacher, Ravi Ramkissoon, Ann Rhee, Yair Sarig, Vikram Shukla, Bipul Sinha, Anupam Singh, Wayne Smith, Jags Srinivasan, Deborah Steiner, Janet Stern, Michael Stewart, Mahesh Subramaniam, Nick Taylor, Anh-Tuan Tran, Alex Tsukerman, Kothanda Umamageswaran, Guhan Viswanathan, Eric Voss, Daniel M Wong, Wanli Yang, Paul Youn, Wei Zhang The Programs (which include both the software and documentation) contain proprietary information; 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, except to the extent required to obtain interoperability with other independently created software or as specified by law, 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 This document is not warranted to be 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 If the Programs are delivered to the United States Government or anyone licensing or using the Programs on behalf of the United States Government, the following notice is applicable: U.S GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations As such, use, duplication, disclosure, modification, and adaptation of the Programs, including documentation and technical data, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement, and, to the extent applicable, the additional rights set forth in FAR 52.227-19, Commercial Computer Software Restricted Rights (June 1987) Oracle USA, Inc., 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 we disclaim liability for any damages caused by such use of the Programs Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates Other names may be trademarks of their respective owners The Programs may provide links to Web sites and access to content, products, and services from third parties Oracle is not responsible for the availability of, or any content provided on, third-party Web sites You bear all risks associated with the use of such content If you choose to purchase any products or services from a third party, the relationship is directly between you and the third party Oracle is not responsible for: (a) the quality of third-party products or services; or (b) fulfilling any of the terms of the agreement with the third party, including delivery of products or services and warranty obligations related to purchased products or services Oracle is not responsible for any loss or damage of any sort that you may incur from dealing with any third party Contents Preface xxvii Audience xxvii Documentation Accessibility xxvii Related Documents xxviii Conventions xxviii What's New in Oracle Database Administrator's Guide? xxix Oracle Database 11g Release (11.1) New Features in the Administrator's Guide xxix Part I Basic Database Administration Getting Started with Database Administration Types of Oracle Database Users 1-1 Database Administrators 1-1 Security Officers 1-2 Network Administrators 1-2 Application Developers 1-2 Application Administrators 1-3 Database Users 1-3 Tasks of a Database Administrator 1-3 Task 1: Evaluate the Database Server Hardware 1-3 Task 2: Install the Oracle Database Software 1-4 Task 3: Plan the Database 1-4 Task 4: Create and Open the Database 1-5 Task 5: Back Up the Database 1-5 Task 6: Enroll System Users 1-5 Task 7: Implement the Database Design 1-5 Task 8: Back Up the Fully Functional Database 1-5 Task 9: Tune Database Performance 1-5 Task 10: Download and Install Patches 1-6 Task 11: Roll Out to Additional Hosts 1-6 Submitting Commands and SQL to the Database 1-6 About SQL*Plus 1-7 Connecting to the Database with SQL*Plus 1-7 Identifying Your Oracle Database Software Release 1-11 iii Release Number Format Checking Your Current Release Number About Database Administrator Security and Privileges The Database Administrator's Operating System Account Administrative User Accounts Database Administrator Authentication Administrative Privileges Selecting an Authentication Method for Database Administrators Using Operating System Authentication Using Password File Authentication Creating and Maintaining a Password File Using ORAPWD Setting REMOTE_LOGIN_ PASSWORDFILE Adding Users to a Password File Maintaining a Password File Data Utilities 1-11 1-12 1-13 1-13 1-13 1-14 1-15 1-16 1-18 1-19 1-21 1-21 1-23 1-23 1-25 1-25 Creating and Configuring an Oracle Database About Creating an Oracle Database 2-1 Considerations Before Creating the Database 2-2 Creating a Database with DBCA 2-4 Creating a Database with the CREATE DATABASE Statement 2-4 Step 1: Specify an Instance Identifier (SID) 2-5 Step 2: Ensure That the Required Environment Variables Are Set 2-6 Step 3: Choose a Database Administrator Authentication Method 2-6 Step 4: Create the Initialization Parameter File 2-7 Step 5: (Windows Only) Create an Instance 2-7 Step 6: Connect to the Instance 2-8 Step 7: Create a Server Parameter File 2-8 Step 8: Start the Instance 2-9 Step 9: Issue the CREATE DATABASE Statement 2-9 Step 10: Create Additional Tablespaces 2-13 Step 11: Run Scripts to Build Data Dictionary Views 2-13 Step 12: Run Scripts to Install Additional Options (Optional) 2-13 Step 13: Back Up the Database 2-14 Step 14: (Optional) Enable Automatic Instance Startup 2-14 Understanding the CREATE DATABASE Statement 2-14 Protecting Your Database: Specifying Passwords for Users SYS and SYSTEM 2-15 Creating a Locally Managed SYSTEM Tablespace 2-15 About the SYSAUX Tablespace 2-16 Using Automatic Undo Management: Creating an Undo Tablespace 2-17 Creating a Default Permanent Tablespace 2-18 Creating a Default Temporary Tablespace 2-18 Specifying Oracle-Managed Files at Database Creation 2-18 Supporting Bigfile Tablespaces During Database Creation 2-20 Specifying the Database Time Zone and Time Zone File 2-21 Specifying FORCE LOGGING Mode 2-22 iv Understanding Initialization Parameters Determining the Global Database Name Specifying a Flash Recovery Area Specifying Control Files Specifying Database Block Sizes Specifying the Maximum Number of Processes Specifying the DDL Lock Timeout Specifying the Method of Undo Space Management AboutThe COMPATIBLE Initialization Parameter Setting the License Parameter Troubleshooting Database Creation Dropping a Database Managing Initialization Parameters Using a Server Parameter File What Is a Server Parameter File? Migrating to a Server Parameter File Creating a Server Parameter File Storing the Server Parameter File on HARD-Enabled Storage The SPFILE Initialization Parameter Changing Initialization Parameter Values Clearing Initialization Parameter Values Exporting the Server Parameter File Backing Up the Server Parameter File Recovering a Lost or Damaged Server Parameter File Viewing Parameter Settings Defining Database Services Deploying Services Configuring Services Using Services Considerations After Creating a Database Some Security Considerations Enabling Transparent Data Encryption Creating a Secure External Password Store Installing the Oracle Database Sample Schemas Database Data Dictionary Views 2-23 2-25 2-26 2-26 2-27 2-28 2-28 2-28 2-29 2-30 2-30 2-30 2-31 2-31 2-32 2-32 2-34 2-36 2-36 2-38 2-38 2-38 2-39 2-39 2-40 2-41 2-42 2-42 2-43 2-43 2-44 2-44 2-45 2-45 Starting Up and Shutting Down Starting Up a Database Options for Starting Up a Database Understanding Initialization Parameter Files Preparing to Start Up an Instance Starting Up an Instance Altering Database Availability Mounting a Database to an Instance Opening a Closed Database Opening a Database in Read-Only Mode Restricting Access to an Open Database Shutting Down a Database 3-1 3-1 3-2 3-4 3-4 3-7 3-7 3-7 3-8 3-8 3-8 v dropping, 22-12 file mapping views, 13-22 FOR UPDATE clause and, 22-2 invalid, 22-5 join See join views location transparency in distributed databases, 30-19 managing, 22-1, 22-4 managing privileges with, 30-20 name resolution in distributed databases, 29-29 ORDER BY clause and, 22-2 remote object security, 30-20 restrictions, 22-5 USER_RESUMABLE, 17-12 using, 22-4 V$ARCHIVE, 11-14 V$ARCHIVE_DEST, 11-8 V$DATABASE, 11-15 V$LOG, 11-14 V$LOGFILE, 10-12 V$OBJECT_USAGE, 19-14 wildcards in, 22-3 WITH CHECK OPTION, 22-2 virtual columns, 18-2 indexing, 19-3 W wallet, Oracle, 12-8, 18-6 wildcards in views, 22-3 window groups creating, 27-30 disabling, 27-32 dropping, 27-31 dropping a member from, 27-32 enabling, 27-32 overview, 26-10 using, 27-30 window logs, 27-23 windows (Scheduler) altering, 27-25 closing, 27-26 creating, 27-23 disabling, 27-27 dropping, 27-26 enabling, 27-27 opening, 27-25 overlapping, 27-28 overview, 26-9 using, 27-22 WORM devices and read-only tablespaces, 12-19 WRH$_UNDOSTAT view, 14-12 X XMLTypes in transportable tablespaces, 12-32 Index-27 Index-28 ... xxviii What''s New in Oracle Database Administrator''s Guide? xxix Oracle Database 11g Release (11.1) New Features in the Administrator''s Guide xxix Part I Basic Database Administration... an Oracle Database About Creating an Oracle Database 2-1 Considerations Before Creating the Database 2-2 Creating a Database with DBCA 2-4 Creating a Database. .. Getting Started with Database Administration Types of Oracle Database Users 1-1 Database Administrators 1-1 Security Officers 1-2 Network Administrators