1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Oracle9i Database Administrator’s Guide pdf

980 461 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Oracle9i Database Administrator’s Guide
Tác giả Ruth Baylis, Kathy Rich, Joyce Fee
Trường học Oracle Corporation
Chuyên ngành Database Administration
Thể loại hướng dẫn
Năm xuất bản 2001
Thành phố Redwood City
Định dạng
Số trang 980
Dung lượng 6,31 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

This guide is for people who administer the operation of an Oracle database system.Referred to as database administrators DBAs, they are responsible for creatingOracle databases, ensurin

Trang 2

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.

Trang 3

Send Us Your Comments xxix

Preface xxxi

What’s New in Oracle9i? xliii

Part I Basic Database Administration

1 The Oracle Database Administrator

Types of Oracle Users 1-2Database Administrators 1-2Security Officers 1-3Network Administrators 1-3Application Developers 1-3Application Administrators 1-4Database Users 1-4

Tasks of a Database Administrator 1-4Task 1: Evaluate the Database Server Hardware 1-5Task 2: Install the Oracle Software 1-5Task 3: Plan the Database 1-5Task 4: Create and Open the Database 1-6Task 5: Back Up the Database 1-7Task 6: Enroll System Users 1-7Task 7: Implement the Database Design 1-7

Trang 4

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

Trang 5

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

Trang 6

Errors and Recovery for the Server Parameter File 2-43Viewing Parameters Settings 2-43

3 Using Oracle-Managed Files

What are Oracle-Managed Files? 3-2Who Can Use Oracle-Managed Files? 3-2Benefits of Using Oracle-Managed Files 3-3Oracle-Managed Files and Existing Functionality 3-4

Enabling the Creation and Use of Oracle-Managed Files 3-4Setting 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-6How Oracle-Managed Files are Named 3-7Creating Oracle-Managed Files at Database Creation 3-8Creating Datafiles for Tablespaces 3-13Creating Tempfiles for Temporary Tablespaces 3-16Creating Control Files 3-17Creating Online Redo Log Files 3-19

Behavior of Oracle-Managed Files 3-20Dropping Datafiles and Tempfiles 3-21Dropping Online Redo Log Files 3-21Renaming Files 3-21Managing Standby Databases 3-22

Scenarios for Using Oracle-Managed Files 3-22Scenario 1: Create and Manage a Database with Multiplexed Online Redo Logs 3-22Scenario 2: Add Oracle-Managed Files to an Existing Database 3-27

4 Starting Up and Shutting Down

Starting Up a Database 4-2Options for Starting Up a Database 4-2Preparing to Start an Instance 4-3Using SQL*Plus to Start Up a Database 4-3Starting an Instance: Scenarios 4-5

Altering Database Availability 4-9Mounting a Database to an Instance 4-9

Trang 7

Opening a Closed Database 4-9Opening a Database in Read-Only Mode 4-10Restricting Access to an Open Database 4-10

Shutting Down a Database 4-11Shutting Down with the NORMAL Option 4-11Shutting Down with the IMMEDIATE Option 4-12Shutting Down with the TRANSACTIONAL Option 4-12Shutting Down with the ABORT Option 4-13

Quiescing a Database 4-13Placing a Database into a Quiesced State 4-14Restoring the System to Normal Operation 4-16Viewing 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-2Dedicated Server Processes 5-2Shared Server Processes 5-3

Configuring Oracle for the Shared Server 5-5Initialization Parameters for Shared Server 5-5Setting the Initial Number of Dispatchers (DISPATCHERS) 5-6Setting the Initial Number of Shared Servers (SHARED_SERVERS) 5-8Modifying Dispatcher and Server Processes 5-8Monitoring Shared Server 5-11

About Oracle Background Processes 5-11

Monitoring the Processes of an Oracle Instance 5-14Process and Session Views 5-14Monitoring Locks 5-15Trace Files and the Alert File 5-15

Managing Processes for Parallel Execution 5-18Managing the Parallel Execution Servers 5-18Altering Parallel Execution for a Session 5-19

Managing Processes for External Procedures 5-20

Trang 8

Setting up an Environment for Calling External Procedures 5-21Example of tnsnames.ora Entry for External Procedure Listener 5-22Example of listener.ora Entry for External Procedures 5-22

Terminating Sessions 5-22Identifying Which Session to Terminate 5-23Terminating an Active Session 5-24Terminating an Inactive Session 5-24

6 Managing Control Files

What Is a Control File? 6-2

Guidelines for Control Files 6-2Provide Filenames for the Control Files 6-2Multiplex Control Files on Different Disks 6-3Place Control Files Appropriately 6-3Back Up Control Files 6-3Manage the Size of Control Files 6-4

Creating Control Files 6-4Creating Initial Control Files 6-4Creating Additional Copies, Renaming, and Relocating Control Files 6-5Creating New Control Files 6-5

Troubleshooting After Creating Control Files 6-9Checking for Missing or Extra Files 6-9Handling Errors During CREATE CONTROLFILE 6-10

Backing Up Control Files 6-10

Recovering a Control File Using a Current Copy 6-10Recovering from Control File Corruption Using a Control File Copy 6-10Recovering 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-2Redo Threads 7-2Online Redo Log Contents 7-2How Oracle Writes to the Online Redo Log 7-3

Trang 9

Planning the Online Redo Log 7-5Multiplexing Online Redo Log Files 7-5Placing Online Redo Log Members on Different Disks 7-9Setting the Size of Online Redo Log Members 7-9Choosing the Number of Online Redo Log Files 7-10Controlling Archive Lag 7-10

Creating Online Redo Log Groups and Members 7-12Creating Online Redo Log Groups 7-13Creating Online Redo Log Members 7-13

Relocating and Renaming Online Redo Log Members 7-14

Dropping Online Redo Log Groups and Members 7-16Dropping Log Groups 7-16Dropping 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-2Running a Database in NOARCHIVELOG Mode 8-2Running a Database in ARCHIVELOG Mode 8-3

Controlling the Archiving Mode 8-4Setting the Initial Database Archiving Mode 8-5Changing the Database Archiving Mode 8-5Enabling Automatic Archiving 8-6Disabling Automatic Archiving 8-8Performing Manual Archiving 8-9

Specifying the Archive Destination 8-9Specifying Archive Destinations 8-9Understanding Archive Destination Status 8-12

Specifying the Mode of Log Transmission 8-13Normal Transmission Mode 8-14Standby Transmission Mode 8-14

Trang 10

Managing Archive Destination Failure 8-15Specifying the Minimum Number of Successful Destinations 8-16Re-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-22Fixed Views 8-23The 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-2Redo Log Files 9-3Dictionary Options 9-4Tracking of DDL Statements 9-5Storage Management 9-6Extracting Data Values from Redo Log Files 9-6LogMiner Restrictions 9-7LogMiner Views 9-7

Using LogMiner 9-8Extracting a Dictionary 9-9Specifying Redo Log Files for Analysis 9-12Starting LogMiner 9-13Analyzing Output from V$LOGMNR_CONTENTS 9-17Using LogMiner to Perform Object-Level Recovery 9-18Ending a LogMiner Session 9-18

Example Uses of LogMiner 9-19Example: Tracking Changes Made By a Specific User 9-19Example: Calculating Table Access Statistics 9-21

10 Managing Job Queues

Enabling Processes Used for Executing Jobs 10-2

Managing Job Queues 10-3The DBMS_JOB Package 10-3Submitting a Job to the Job Queue 10-4

Trang 11

How Jobs Execute 10-9Removing a Job from the Job Queue 10-10Altering a Job 10-10Broken Jobs 10-12Forcing a Job to Execute 10-13Terminating a Job 10-13

Viewing Job Queue Information 10-14Displaying Information About a Job 10-14Displaying Information About Running Jobs 10-14

11 Managing Tablespaces

Guidelines for Managing Tablespaces 11-2Use Multiple Tablespaces 11-2Specify Tablespace Default Storage Parameters 11-3Assign Tablespace Quotas to Users 11-3

Creating Tablespaces 11-4Locally Managed Tablespaces 11-5Dictionary-Managed Tablespaces 11-9Temporary Tablespaces 11-11

Managing Tablespace Allocation 11-14Storage Parameters in Locally Managed Tablespaces 11-14Storage Parameters for Dictionary-Managed Tablespaces 11-15Coalescing Free Space in Dictionary-Managed Tablespaces 11-16

Altering Tablespace Availability 11-19Taking Tablespaces Offline 11-19Bringing Tablespaces Online 11-21Altering the Availability of Datafiles or Tempfiles 11-21

Using Read-Only Tablespaces 11-22Making a Tablespace Read-Only 11-23Making a Read-Only Tablespace Writable 11-25Creating a Read-Only Tablespace on a WORM Device 11-25Delaying the Opening of Datafiles in Read Only Tablespaces 11-26

Dropping Tablespaces 11-27

Troubleshooting Tablespace Problems with DBMS_SPACE_ADMIN 11-28Scenario 1: Fixing Bitmap When Allocated Blocks are Marked Free (No Overlap) 11-29

Trang 12

Scenario 2: Dropping a Corrupted Segment 11-30Scenario 3: Fixing Bitmap Where Overlap is Reported 11-30Scenario 4: Correcting Media Corruption of Bitmap Blocks 11-30Scenario 5: Migrating from a Dictionary-Managed to a Locally Managed Tablespace 11-31

Transporting Tablespaces Between Databases 11-31Introduction to Transportable Tablespaces 11-32Limitations 11-33Compatibility Considerations for Transportable Tablespaces 11-33Transporting Tablespaces Between Databases: A Procedure 11-34Object Behaviors 11-40Using Transportable Tablespaces 11-42

Viewing Tablespace Information 11-46Listing Tablespaces and Default Storage Parameters: Example 11-47Listing the Datafiles and Associated Tablespaces of a Database: Example 11-48Displaying Statistics for Free Space (Extents) of Each Tablespace: Example 11-48

12 Managing Datafiles

Guidelines for Managing Datafiles 12-2Determine the Number of Datafiles 12-2Determine the Size of Datafiles 12-4Place Datafiles Appropriately 12-4Store Datafiles Separate from Redo Log Files 12-4

Creating Datafiles and Adding Datafiles to a Tablespace 12-5

Changing a Datafile’s Size 12-6Enabling and Disabling Automatic Extension for a Datafile 12-6Manually Resizing a Datafile 12-7

Altering Datafile Availability 12-8Bringing Datafiles Online or Taking Offline in ARCHIVELOG Mode 12-9Taking Datafiles Offline in NOARCHIVELOG Mode 12-9Altering the Availability of All Datafiles or Tempfiles in a Tablespace 12-9

Renaming and Relocating Datafiles 12-10Renaming and Relocating Datafiles for a Single Tablespace 12-11Renaming and Relocating Datafiles for Multiple Tablespaces 12-13

Verifying Data Blocks in Datafiles 12-14

Viewing Datafile Information 12-14

Trang 13

13 Managing Undo Space

What is Undo? 13-2

Specifying the Mode for Undo Space Management 13-3Starting an Instance in Automatic Undo Management Mode 13-3Starting an Instance in Manual Undo Management Mode 13-4

Managing Undo Tablespaces 13-5Creating an Undo Tablespace 13-6Altering an Undo Tablespace 13-7Dropping an Undo Tablespace 13-7Switching Undo Tablespaces 13-8Establishing User Quotas for Undo Space 13-9Setting the Retention Period for Undo Information 13-9Viewing Information About Undo Space 13-11

Managing Rollback Segments 13-13Guidelines for Managing Rollback Segments 13-13Creating Rollback Segments 13-18Altering Rollback Segments 13-21Explicitly Assigning a Transaction to a Rollback Segment 13-24Dropping Rollback Segments 13-25Viewing Rollback Segment Information 13-25

Part III Schema Objects

14 Managing Space for Schema Objects

Managing Space in Data Blocks 14-2Specifying the PCTFREE Parameter 14-2Specifying the PCTUSED Parameter 14-5Selecting Associated PCTUSED and PCTFREE Values 14-7Specifying the Transaction Entry Parameters: INITRANS and MAXTRANS 14-8

Setting Storage Parameters 14-9Identifying the Storage Parameters 14-9Setting Default Storage Parameters for Segments in a Tablespace 14-13Setting Storage Parameters for Data Segments 14-13Setting Storage Parameters for Index Segments 14-13

Trang 14

Setting Storage Parameters for LOBs, Varrays, and Nested Tables 14-14Changing Values for Storage Parameters 14-14Understanding Precedence in Storage Parameters 14-14Example of How Storage Parameters Effect Space Allocation 14-15

Managing Resumable Space Allocation 14-16Resumable Space Allocation Overview 14-17Enabling and Disabling Resumable Space Allocation 14-21Detecting Suspended Statements 14-22Resumable Space Allocation Example: Registering an AFTER SUSPEND Trigger 14-24

Deallocating Space 14-26Viewing the High Water Mark 14-27Issuing Space Deallocation Statements 14-27Examples of Deallocating Space 14-28

Understanding Space Use of Datatypes 14-31

15 Managing Tables

Guidelines for Managing Tables 15-2Design Tables Before Creating Them 15-2Specify How Data Block Space Is to Be Used 15-2Specify the Location of Each Table 15-3Consider Parallelizing Table Creation 15-3Consider Using NOLOGGING When Creating Tables 15-4Estimate Table Size and Set Storage Parameters 15-4Plan for Large Tables 15-5Table Restrictions 15-6

Creating Tables 15-6Creating a Table 15-6Creating a Temporary Table 15-7Parallelizing Table Creation 15-8Automatically Collecting Statistics on Tables 15-9

Altering Tables 15-9Moving a Table to a New Segment or Tablespace 15-12Manually Allocating Storage for a Table 15-12Dropping Columns 15-12

Redefining Tables Online 15-14

Trang 15

Steps for Online Redefinition of Tables 15-15Intermediate Synchronization 15-17Abort and Cleanup After Errors 15-17Example of Online Table Redefinition 15-17Restrictions 15-18

Dropping Tables 15-19

Managing Index-Organized Tables 15-20What are Index-Organized Tables 15-21Creating Index-Organized Tables 15-22Maintaining Index-Organized Tables 15-26Analyzing Index-Organized Tables 15-28Using the ORDER BY Clause with Index-Organized Tables 15-29Converting Index-Organized Tables to Regular Tables 15-29

Managing External Tables 15-30Creating External Tables 15-31Altering External Tables 15-34Dropping External Tables 15-35System and Object Privileges for External Tables 15-35

Viewing Information About Tables 15-35

16 Managing Indexes

Guidelines for Managing Indexes 16-2Create Indexes After Inserting Table Data 16-3Index the Correct Tables and Columns 16-3Order Index Columns for Performance 16-5Limit the Number of Indexes for Each Table 16-5Drop Indexes That Are No Longer Required 16-5Specify Index Block Space Use 16-5Estimate Index Size and Set Storage Parameters 16-6Specify the Tablespace for Each Index 16-6Consider Parallelizing Index Creation 16-7Consider Creating Indexes with NOLOGGING 16-7Consider Costs and Benefits of Coalescing or Rebuilding Indexes 16-8Consider Cost Before Disabling or Dropping Constraints 16-9

Creating Indexes 16-9

Trang 16

Creating an Index Explicitly 16-10Creating a Unique Index Explicitly 16-11Creating an Index Associated with a Constraint 16-11Collecting Incidental Statistics when Creating an Index 16-13Creating a Large Index 16-13Creating an Index Online 16-13Creating a Function-Based Index 16-14Creating a Key-Compressed Index 16-18

Altering Indexes 16-19Altering Storage Characteristics of an Index 16-20Rebuilding an Existing Index 16-20Monitoring Index Usage 16-21

Monitoring Space Use of Indexes 16-21

Dropping Indexes 16-22

Viewing Index Information 16-23

17 Managing Partitioned Tables and Indexes

What Are Partitioned Tables and Indexes? 17-2

Partitioning Methods 17-3When to Use the Range Partitioning Method 17-4When to Use the Hash Partitioning Method 17-5When to Use the List Partitioning Method 17-5When to Use the Composite Partitioning Method 17-7

Creating Partitioned Tables 17-8Creating Range-Partitioned Tables 17-9Creating Hash-Partitioned Tables 17-10Creating List-Partitioned Tables 17-11Creating Composite Partitioned Tables 17-12Creating Partitioned Index-Organized Tables 17-13Partitioning Restrictions for Multiple Block Sizes 17-15

Maintaining Partitioned Tables 17-16Updating Global Indexes Automatically 17-19Adding Partitions 17-20Coalescing Partitions 17-23Dropping Partitions 17-24

Trang 17

Exchanging Partitions 17-27Merging Partitions 17-29Modifying Default Attributes 17-32Modifying Real Attributes of Partitions 17-33Modifying List Partitions: Adding or Dropping Values 17-34Moving Partitions 17-36Rebuilding Index Partitions 17-37Renaming Partitions 17-39Splitting Partitions 17-39Truncating Partitions 17-42

Partitioned Tables and Indexes Examples 17-45Moving the Time Window in a Historical Table 17-45Converting a Partition View into a Partitioned Table 17-46

Viewing Information About Partitioned Tables and Indexes 17-47

18 Managing Clusters

Guidelines for Managing Clusters 18-2Choose Appropriate Tables for the Cluster 18-4Choose Appropriate Columns for the Cluster Key 18-4Specify Data Block Space Use 18-5Specify the Space Required by an Average Cluster Key and Its Associated Rows 18-5Specify the Location of Each Cluster and Cluster Index Rows 18-6Estimate Cluster Size and Set Storage Parameters 18-6

Creating Clusters 18-6Creating Clustered Tables 18-7Creating Cluster Indexes 18-8

Altering Clusters 18-8Altering Clustered Tables 18-9Altering Cluster Indexes 18-10

Dropping Clusters 18-10Dropping Clustered Tables 18-11Dropping Cluster Indexes 18-11

Viewing Information About Clusters 18-11

Trang 18

19 Managing Hash Clusters

When to Use Hash Clusters 19-2Situations Where Hashing Is Useful 19-3Situations Where Hashing Is Not Advantageous 19-3

Creating Hash Clusters 19-4Creating Single-Table Hash Clusters 19-5Controlling Space Use Within a Hash Cluster 19-5Estimating Size Required by Hash Clusters 19-8

Altering Hash Clusters 19-9

Dropping Hash Clusters 19-9

Viewing Information About Hash Clusters 19-9

20 Managing Views, Sequences, and Synonyms

Managing Views 20-2Creating Views 20-2Updating a Join View 20-5Altering Views 20-10Dropping Views 20-10Replacing Views 20-10

Managing Sequences 20-11Creating Sequences 20-12Altering Sequences 20-13Dropping Sequences 20-13

Managing Synonyms 20-13Creating Synonyms 20-14Dropping Synonyms 20-14

Viewing Information About Views, Synonyms, and Sequences 20-15

21 General Management of Schema Objects

Creating Multiple Tables and Views in a Single Operation 21-2

Renaming Schema Objects 21-3

Analyzing Tables, Indexes, and Clusters 21-3Using Statistics for Tables, Indexes, and Clusters 21-4Validating Tables, Indexes, Clusters, and Materialized Views 21-9

Trang 19

Listing Chained Rows of Tables and Clusters 21-10

Truncating Tables and Clusters 21-12Using DELETE 21-12Using DROP and CREATE 21-13Using TRUNCATE 21-13

Enabling and Disabling Triggers 21-14Enabling Triggers 21-16Disabling Triggers 21-16

Managing Integrity Constraints 21-17Integrity Constraint States 21-17Setting Integrity Constraints Upon Definition 21-20Modifying or Dropping Existing Integrity Constraints 21-21Deferring Constraint Checks 21-22Reporting Constraint Exceptions 21-23

Managing Object Dependencies 21-25Manually Recompiling Views 21-27Manually Recompiling Procedures and Functions 21-27Manually Recompiling Packages 21-27

Managing Object Name Resolution 21-28

Changing Storage Parameters for the Data Dictionary 21-28Structures in the Data Dictionary 21-29Errors that Require Changing Data Dictionary Storage 21-31

Displaying Information About Schema Objects 21-31Using PL/SQL Packages to Display Information About Schema Objects 21-31Using Views to Display Information About Schema Objects 21-33

22 Detecting and Repairing Data Block Corruption

Options for Repairing Data Block Corruption 22-2

About the DBMS_REPAIR Package 22-2DBMS_REPAIR Procedures 22-2Limitations and Restrictions 22-3

Using the DBMS_REPAIR Package 22-3Task 1: Detect and Report Corruptions 22-4Task 2: Evaluate the Costs and Benefits of Using DBMS_REPAIR 22-5Task 3: Make Objects Usable 22-7

Trang 20

Task 4: Repair Corruptions and Rebuild Lost Data 22-7

DBMS_REPAIR Examples 22-8Using ADMIN_TABLES to Build a Repair Table or Orphan Key Table 22-9Using the CHECK_OBJECT Procedure to Detect Corruption 22-10Fixing Corrupt Blocks with the FIX_CORRUPT_BLOCKS Procedure 22-12Finding Index Entries Pointing into Corrupt Data Blocks: DUMP_ORPHAN_KEYS 22-13Rebuilding Free Lists Using the REBUILD_FREELISTS Procedure 22-13Enabling or Disabling the Skipping of Corrupt Blocks: SKIP_CORRUPT_BLOCKS 22-14

Part IV Database Security

23 Establishing Security Policies

System Security Policy 23-2Database User Management 23-2User Authentication 23-2Operating System Security 23-3

Data Security Policy 23-3

User Security Policy 23-4General User Security 23-4End-User Security 23-6Administrator Security 23-8Application Developer Security 23-10Application Administrator Security 23-12

Password Management Policy 23-12Account Locking 23-13Password Aging and Expiration 23-14Password History 23-15Password Complexity Verification 23-16

Auditing Policy 23-20

A Security Checklist 23-20

24 Managing Users and Resources

Session and User Licensing 24-2Concurrent Usage Licensing 24-2

Trang 21

Named User Limits 24-5Viewing Licensing Limits and Current Values 24-6

User Authentication Methods 24-7Database Authentication 24-8External Authentication 24-9Global Authentication and Authorization 24-11Proxy Authentication and Authorization 24-13

Managing Oracle Users 24-16Creating Users 24-16Altering Users 24-20Dropping Users 24-21

Managing Resources with Profiles 24-22Enabling and Disabling Resource Limits 24-23Creating Profiles 24-24Assigning Profiles 24-25Altering Profiles 24-25Using Composite Limits 24-25Dropping Profiles 24-27

Viewing Information About Database Users and Profiles 24-27Listing All Users and Associated Information 24-29Listing All Tablespace Quotas 24-29Listing All Profiles and Assigned Limits 24-30Viewing Memory Use for Each User Session 24-31

25 Managing User Privileges and Roles

Identifying User Privileges 25-2System Privileges 25-2Object Privileges 25-4

Managing User Roles 25-4Predefined Roles 25-5Creating a Role 25-7Specifying the Type of Role Authorization 25-8Dropping Roles 25-10

Granting User Privileges and Roles 25-11Granting System Privileges and Roles 25-11

Trang 22

Granting Object Privileges and Roles 25-12Granting Privileges on Columns 25-13

Revoking User Privileges and Roles 25-14Revoking System Privileges and Roles 25-14Revoking Object Privileges and Roles 25-14Cascading Effects of Revoking Privileges 25-16Granting to and Revoking from the User Group PUBLIC 25-17

When Do Grants and Revokes Take Effect? 25-17The SET ROLE Statement 25-18Specifying Default Roles 25-18Restricting the Number of Roles that a User Can Enable 25-19

Granting Roles Using the Operating System or Network 25-19Using Operating System Role Identification 25-20Using Operating System Role Management 25-22Granting and Revoking Roles When OS_ROLES=TRUE 25-22Enabling and Disabling Roles When OS_ROLES=TRUE 25-22Using Network Connections with Operating System Role Management 25-22

Viewing Privilege and Role Information 25-23Listing All System Privilege Grants 25-25Listing All Role Grants 25-25Listing Object Privileges Granted to a User 25-25Listing the Current Privilege Domain of Your Session 25-26Listing Roles of the Database 25-27Listing Information About the Privilege Domains of Roles 25-27

26 Auditing Database Use

Guidelines for Auditing 26-2Decide Whether to Use the Database or Operating System Audit Trail 26-2Keep Audited Information Manageable 26-2Guidelines for Auditing Suspicious Database Activity 26-3Guidelines for Auditing Normal Database Activity 26-4

Managing Audit Trail Information 26-4What Information is Contained in the Audit Trail? 26-4Events Audited by Default 26-5Setting Auditing Options 26-6

Trang 23

Turning Off Audit Options 26-10Enabling and Disabling Database Auditing 26-12Controlling the Growth and Size of the Audit Trail 26-13Protecting the Audit Trail 26-15

Fine-Grained Auditing 26-16

Viewing Database Audit Trail Information 26-17Creating the Audit Trail Views 26-17Deleting the Audit Trail Views 26-18Using Audit Trail Views to Investigate Suspicious Activities 26-18

Part V Database Resource Management

27 Using the Database Resource Manager

What Is the Database Resource Manager? 27-2What Problems Does the Database Resource Manager Address? 27-2How Does the Database Resource Manager Address These Problems? 27-2What are the Elements of the Database Resource Manager? 27-3Understanding Resource Plans 27-4

Administering the Database Resource Manager 27-8

Creating a Simple Resource Plan 27-10

Creating Complex Resource Plans 27-11Using the Pending Area for Creating Plan Schemas 27-12Creating Resource Plans 27-14Creating Resource Consumer Groups 27-16Specifying Resource Plan Directives 27-17

Managing Resource Consumer Groups 27-20Assigning an Initial Resource Consumer Group 27-21Changing Resource Consumer Groups 27-21Managing the Switch Privilege 27-22

Enabling the Database Resource Manager 27-24

Putting It All Together: Database Resource Manager Examples 27-25Multilevel Schema Example 27-25Example of Using Several Resource Allocation Methods 27-27

An Oracle Supplied Plan 27-28

Monitoring and Tuning the Database Resource Manager 27-29

Trang 24

Creating the Environment 27-29Why Is This Necessary to Produce Expected Results? 27-30Monitoring Results 27-31

Viewing Database Resource Manager Information 27-31Viewing Consumer Groups Granted to Users or Roles 27-32Viewing Plan Schema Information 27-33Viewing Current Consumer Groups for Sessions 27-33Viewing the Currently Active Plans 27-34

Part VI Distributed Database Management

28 Distributed Database Concepts

Distributed Database Architecture 28-2Homogenous Distributed Database Systems 28-2Heterogeneous Distributed Database Systems 28-5Client/Server Database Architecture 28-6

Database Links 28-8What Are Database Links? 28-8What Are Shared Database Links? 28-10Why Use Database Links? 28-11Global Database Names in Database Links 28-12Names for Database Links 28-14Types of Database Links 28-15Users of Database Links 28-16Creation of Database Links: Examples 28-19Schema Objects and Database Links 28-20Database Link Restrictions 28-22

Distributed Database Administration 28-23Site Autonomy 28-23Distributed Database Security 28-24Auditing Database Links 28-31Administration Tools 28-31

Transaction Processing in a Distributed System 28-33Remote SQL Statements 28-33Distributed SQL Statements 28-34

Trang 25

Shared SQL for Remote and Distributed Statements 28-34Remote Transactions 28-35Distributed Transactions 28-35Two-Phase Commit Mechanism 28-35Database Link Name Resolution 28-36Schema Object Name Resolution 28-39Global Name Resolution in Views, Synonyms, and Procedures 28-42

Distributed Database Application Development 28-44Transparency in a Distributed Database System 28-44Remote Procedure Calls (RPCs) 28-46Distributed Query Optimization 28-47

Character Set Support 28-47Client/Server Environment 28-49Homogeneous Distributed Environment 28-49Heterogeneous Distributed Environment 28-50

29 Managing a Distributed Database

Managing Global Names in a Distributed System 29-2Understanding How Global Database Names Are Formed 29-2Determining Whether Global Naming Is Enforced 29-3Viewing a Global Database Name 29-4Changing the Domain in a Global Database Name 29-4Changing a Global Database Name: Scenario 29-5

Creating Database Links 29-8Obtaining Privileges Necessary for Creating Database Links 29-8Specifying Link Types 29-9Specifying Link Users 29-11Using Connection Qualifiers to Specify Service Names Within Link Names 29-13

Creating Shared Database Links 29-14Determining Whether to Use Shared Database Links 29-14Creating Shared Database Links 29-15Configuring Shared Database Links 29-16

Managing Database Links 29-18Closing Database Links 29-19Dropping Database Links 29-19

Trang 26

Limiting the Number of Active Database Link Connections 29-20

Viewing Information About Database Links 29-21Determining Which Links Are in the Database 29-21Determining Which Link Connections Are Open 29-24

Creating Location Transparency 29-26Using Views to Create Location Transparency 29-26Using Synonyms to Create Location Transparency 29-28Using Procedures to Create Location Transparency 29-30

Managing Statement Transparency 29-32

Managing a Distributed Database: Scenarios 29-34Creating a Public Fixed User Database Link 29-34Creating a Public Fixed User Shared Database Link 29-35Creating a Public Connected User Database Link 29-36Creating a Public Connected User Shared Database Link 29-36Creating a Public Current User Database Link 29-37

30 Developing Applications for a Distributed Database System

Managing the Distribution of an Application’s Data 30-2

Controlling Connections Established by Database Links 30-2

Maintaining Referential Integrity in a Distributed System 30-3

Tuning Distributed Queries 30-3Using Collocated Inline Views 30-4Using Cost-Based Optimization 30-5Using Hints 30-8Analyzing the Execution Plan 30-10

Handling Errors in Remote Procedures 30-12

31 Distributed Transactions Concepts

What Are Distributed Transactions? 31-2

Session Trees for Distributed Transactions 31-4Clients 31-6Database Servers 31-6Local Coordinators 31-6Global Coordinator 31-7Commit Point Site 31-7

Trang 27

Two-Phase Commit Mechanism 31-11Prepare Phase 31-12Commit Phase 31-15Forget Phase 31-16

In-Doubt Transactions 31-17Automatic Resolution of In-Doubt Transactions 31-17Manual Resolution of In-Doubt Transactions 31-20Relevance of System Change Numbers for In-Doubt Transactions 31-20

Distributed Transaction Processing: Case Study 31-21Stage 1: Client Application Issues DML Statements 31-21Stage 2: Oracle Determines Commit Point Site 31-23Stage 3: Global Coordinator Sends Prepare Response 31-23Stage 4: Commit Point Site Commits 31-24Stage 5: Commit Point Site Informs Global Coordinator of Commit 31-25Stage 6: Global and Local Coordinators Tell All Nodes to Commit 31-25Stage 7: Global Coordinator and Commit Point Site Complete the Commit 31-26

32 Managing Distributed Transactions

Setting Distributed Transaction Initialization Parameters 32-2Limiting the Number of Distributed Transactions 32-2Specifying the Commit Point Strength of a Node 32-3

Viewing Information About Distributed Transactions 32-4Transaction Naming 32-4Determining the ID Number and Status of Prepared Transactions 32-5Tracing the Session Tree of In-Doubt Transactions 32-7

Deciding How to Handle In-Doubt Transactions 32-9Discovering Problems with a Two-Phase Commit 32-9Determining Whether to Perform a Manual Override 32-10Analyzing the Transaction Data 32-11

Manually Overriding In-Doubt Transactions 32-12Manually Committing an In-Doubt Transaction 32-12Manually Rolling Back an In-Doubt Transaction 32-14

Purging Pending Rows from the Data Dictionary 32-14Executing the PURGE_LOST_DB_ENTRY Procedure 32-15Determining When to Use DBMS_TRANSACTION 32-15

Trang 28

Manually Committing an In-Doubt Transaction: Example 32-16Step 1: Record User Feedback 32-18Step 2: Query DBA_2PC_PENDING 32-18Step 3: Query DBA_2PC_NEIGHBORS on Local Node 32-20Step 4: Querying Data Dictionary Views on All Nodes 32-21Step 5: Commit the In-Doubt Transaction 32-24Step 6: Check for Mixed Outcome Using DBA_2PC_PENDING 32-24

Data Access Failures Due To Locks 32-25Transaction Timeouts 32-25Locks fenables you torom In-Doubt Transactions 32-26

Simulating Distributed Transaction Failure 32-26

Managing Read Consistency 32-27

Index

Trang 29

Send Us Your Comments

Oracle9i Database Administrator’s Guide, Release 1 (9.0.1)

Part No A90117-01

Oracle Corporation welcomes your comments and suggestions on the quality and usefulness of thisdocument Your input is an important part of the information used for revision

■ Did you find any errors?

■ Is the information clearly presented?

■ Do you need more information? If so, where?

■ Are the examples correct? Do you need more examples?

■ What features did you like most?

If you find any errors or have any other suggestions for improvement, please indicate the documenttitle and part number, and the chapter, section, and page number (if available) You can send com-ments to us in the following ways:

■ Electronic mail: infodev_us@oracle.com

■ FAX: (650) 506-7227 Attn: Information Development

■ Postal service:

Oracle Corporation

Information Development Department

500 Oracle Parkway, M/S 4op11

Trang 31

This guide is for people who administer the operation of an Oracle database system.Referred to as database administrators (DBAs), they are responsible for creatingOracle databases, ensuring their smooth operation, and monitoring their use.This preface contains these topics:

Note: The Oracle9i Database Administrator’s Guide contains

information that describes the features and functionality of the

Oracle9i [Standard Edition], Oracle9i Enterprise Edition, and

Oracle9i Personal Edition products These products have the same

basic features However, several advanced features are available

only with the Oracle9i Enterprise Edition or Oracle9i Personal

Edition, and some of these are optional For example, to create

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.

Trang 32

Readers of this guide are assumed to be familiar with relational database concepts.They are also assumed to be familiar with the operating system environment underwhich they are running Oracle

Readers Interested in Installation and Migration Information

Administrators frequently participate in installing the Oracle server software andmigrating 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 Oracleinstallation guide

If your primary interest is database or application migration, see the Oracle9i

Database Migration manual.

Readers Interested in Application Design Information

In addition to administrators, experienced users of Oracle and advanced databaseapplication 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

Chapter 1, "The Oracle Database Administrator"

This chapter serves as a general introduction to typical tasks performed by databaseadministrators, such as installing software and planning a database

Chapter 2, "Creating an Oracle Database"

This chapter discusses considerations for creating a database and takes you throughthe steps of creating one Consult this chapter when in the database planning andcreation stage

Trang 33

Chapter 3, "Using Oracle-Managed Files"

This chapter describes how you can direct the Oracle database server to create andmanage your:

■ Datafiles

■ Tempfiles

■ Online redo log files

■ Control files

Chapter 4, "Starting Up and Shutting Down"

Consult this chapter when you wish to start up a database, alter its availability, orshut it down Parameter files related to starting up and shutting down are alsodescribed here

Part II: Oracle Server Processes and Storage Structure

Chapter 5, "Managing Oracle Processes"

This chapter helps you to identify different Oracle processes, such as dedicatedserver processes and shared server processes Consult this chapter when

configuring, modifying, tracking and managing processes

Chapter 6, "Managing Control Files"

This chapter describes all aspects of managing control files: naming, creating,troubleshooting, and dropping control files

Chapter 7, "Managing the Online Redo Log"

This chapter describes all aspects of managing the online redo log: planning,

creating, renaming, dropping, or clearing online redo log files

Chapter 8, "Managing Archived Redo Logs"

Consult this chapter for information about archive modes and tuning archiving

Chapter 9, "Using LogMiner to Analyze Redo Log Files"

This chapter describes the use of LogMiner to analyze redo log files

Trang 34

Chapter 10, "Managing Job Queues"

Consult this chapter before working with job queues All aspects of submitting,removing, altering, and fixing job queues are described

Chapter 11, "Managing Tablespaces"

This chapter provides guidelines to follow as you manage tablespaces, anddescribes how to create, manage, alter, drop and move data between tablespaces

Chapter 12, "Managing Datafiles"

This chapter provides guidelines to follow as you manage datafiles, and describeshow to create, change, alter, rename and view information about datafiles

Chapter 13, "Managing Undo Space"

Consult this chapter to learn how to manage undo space, either by using an undotablespace or rollback segments

Part III: Schema Objects

Chapter 14, "Managing Space for Schema Objects"

Consult this chapter for descriptions of common tasks, such as setting storageparameters, deallocating space and managing space

Chapter 15, "Managing Tables"

Consult this chapter for general table management guidelines, as well asinformation about creating, altering, maintaining and dropping tables

Chapter 16, "Managing Indexes"

Consult this chapter for general guidelines about indexes, including creating,altering, monitoring and dropping indexes

Chapter 17, "Managing Partitioned Tables and Indexes"

Consult this chapter to learn about partitioned tables and indexes and how to createand manage them

Chapter 18, "Managing Clusters"

Consult this chapter for general guidelines to follow when creating, altering, ordropping clusters

Trang 35

Chapter 19, "Managing Hash Clusters"

Consult this chapter for general guidelines to follow when creating, altering, ordropping hash clusters

Chapter 20, "Managing Views, Sequences, and Synonyms"

This chapter describes all aspects of managing views, sequences and synonyms

Chapter 21, "General Management of Schema Objects"

This chapter covers more varied aspects of schema management The operationsdescribed in this chapter are not unique to any one type of schema objects Consultthis chapter for information about analyzing objects, truncation of tables andclusters, database triggers, integrity constraints, and object dependencies

Chapter 22, "Detecting and Repairing Data Block Corruption"

This chapter describes methods for detecting and repairing data block corruption

Part IV: Database Security

Chapter 23, "Establishing Security Policies"

This chapter describes all aspects of database security, including system, data anduser security policies, as well as specific tasks associated with password

management

Chapter 24, "Managing Users and Resources"

This chapter describes session and user licensing, user authentication, and providesspecific examples of tasks associated with managing users and resources

Chapter 25, "Managing User Privileges and Roles"

This chapter contains information about all aspects of managing user privileges androles Consult this chapter to find out how to grant and revoke privileges and roles

Chapter 26, "Auditing Database Use"

This chapter describes how to create, manage and view audit information

Trang 36

Part V: Database Resource Management

Chapter 27, "Using the Database Resource Manager"

This chapter describes how to use the Database Resource Manager to allocateresources

Part VI: Distributed Database Management

Chapter 28, "Distributed Database Concepts"

This chapter describes the basic concepts and terminology of Oracle’s distributeddatabase architecture

Chapter 29, "Managing a Distributed Database"

This chapter describes how to manage and maintain a distributed database system

Chapter 30, "Developing Applications for a Distributed Database System"

This chapter describes considerations important when developing an application to

run in a distributed database system.

Chapter 31, "Distributed Transactions Concepts"

This chapter describes what distributed transactions are and how Oracle maintainstheir integrity

Chapter 32, "Managing Distributed Transactions"

This chapter describes how to manage and troubleshoot distributed transactions

Related Documentation

For more information, see these Oracle resources:

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 moredetailed information in this guide This chapter is a starting point tobecome familiar with the Oracle database server, and is recommended

reading before starting Oracle9i Database Administrator’s Guide The remainder of Oracle9i Database Concepts explains the Oracle architecture and

features, and how they operate in more detail

Trang 37

Oracle9i Backup and Recovery Concepts

This book introduces you to the concepts of backup and recovery

Oracle9i User-Managed Backup and Recovery Guide

This guide contains details of backup and recovery and enables you back

up, copy, restore, and recover datafiles, control files, and archived redo logs

Oracle9i Recovery Manager User’s Guide and Reference

This guide contains information for using Recovery Manager (RMAN).RMAN is an Oracle tool that manages and automates backup and recoveryoperations

Oracle9i Database Performance Methods

This book exposes important considerations in setting up a database systemand can help you understand tuning your database It is mainly conceptual,defining terms, architecture, and design principles, and then outlinesproactive and reactive tuning methods

Oracle9i Database Performance Guide and Reference

This book can be used as a reference guide for tuning your Oracle databasesystem

Oracle9i Application Developer’s Guide - Fundamentals

Many of the tasks done by DBAs are shared by application developers Insome cases, descriptions of tasks seemed better located in an applicationlevel book, and in those cases, this fundamentals book is the primaryreference

In North America, printed documentation is available for sale in the Oracle Store athttp://oraclestore.oracle.com/

Customers in Europe, the Middle East, and Africa (EMEA) can purchase

documentation from

http://www.oraclebookshop.com/

Other customers can contact their Oracle representative to purchase printed

documentation

Trang 38

To download free release notes, installation documentation, white papers, or othercollateral, please visit the Oracle Technology Network (OTN) You must registeronline before using OTN; registration is free and can be done at

Conventions in Text

We use various conventions in text to help you more quickly identify special terms.The following table describes those conventions and provides examples of their use

Bold Bold typeface indicates terms that are

defined in the text or terms that appear in

Oracle9i Database Concepts

Ensure that the recovery catalog and target

database do not reside on the same disk.

You can specify this clause only for a NUMBER

Trang 39

Conventions in Code Examples

Code examples illustrate SQL, PL/SQL, SQL*Plus, or other command-linestatements They are displayed in a monospace (fixed-width) font and separatedfrom normal text as shown in this example:

SELECT username FROM dba_users WHERE username = ’MIGRATE’;

The following table describes typographic conventions used in code examples andprovides examples of their use

Note: Some programmatic elements use a

mixture of UPPERCASE and lowercase.

Enter these elements as shown.

Enter sqlplus to open SQL*Plus.

The password is specified in the orapwd file Back up the datafiles and control files in the

/disk1/oracle/dbs directory.

The department_id , department_name , and location_id columns are in the

hr.departments table.

Set the QUERY_REWRITE_ENABLED

initialization parameter to true.

[ ] Brackets enclose one or more optional

items Do not enter the brackets.

DECIMAL (digits [ , precision ])

{ } Braces enclose two or more items, one of

which is required Do not enter the braces.

{ENABLE | DISABLE}

| A vertical bar represents a choice of two

or more options within brackets or braces.

Enter one of the options Do not enter the vertical bar.

{ENABLE | DISABLE}

[COMPRESS | NOCOMPRESS]

Trang 40

Documentation Accessibility

Oracle's goal is to make our products, services, and supporting documentationaccessible to the disabled community with good usability To that end, ourdocumentation includes features that make information available to users ofassistive technology This documentation is available in HTML format, and containsmarkup to facilitate access by the disabled community Standards will continue toevolve over time, and Oracle is actively engaged with other market-leading

Horizontal ellipsis points indicate either:

■ That we have omitted parts of the code that are not directly related to the example

■ That you can repeat a portion of the code

CREATE TABLE AS subquery;

SELECT col1, col2, , coln FROM employees;

Other notation You must enter symbols other than

brackets, braces, vertical bars, and ellipsis points as shown.

UPPERCASE Uppercase typeface indicates elements

supplied by the system We show these terms in uppercase in order to distinguish them from terms you define Unless terms appear in brackets, enter them in the order and with the spelling shown.

However, because these terms are not case sensitive, you can enter them in lowercase.

SELECT last_name, employee_id FROM employees;

SELECT * FROM USER_TABLES;

DROP TABLE hr.employees;

lowercase Lowercase typeface indicates

programmatic elements that you supply.

For example, lowercase indicates names

of tables, columns, or files.

Note: Some programmatic elements use a

mixture of UPPERCASE and lowercase.

Enter these elements as shown.

SELECT last_name, employee_id FROM employees;

sqlplus hr/hr CREATE USER mjones IDENTIFIED BY ty3MU9;

Ngày đăng: 21/12/2013, 06:17

TỪ KHÓA LIÊN QUAN