Oracle is a registered trademark, and LogMiner, Oracle Call Interface, Oracle Database Configuration Assistant, Oracle Enterprise Manager, Oracle Label Security, Real Application Cluster[r]
Trang 1Oracle9 i
Database Administrator’s Guide
Release 1 (9.0.1)
June 2001
Part No A90117-01
Trang 2Oracle9i 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 3iii
Contents
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-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
Trang 4Task 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 5v
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 6enabling on creation, 16-11
foreign key references when dropped, 21-22
indexes associated with, 16-11
UNLIMITED TABLESPACE privilege, 24-19
UNRECOVERABLE DATAFILE option
ALTER DATABASE statement, 7-20
UPDATE GLOBAL INDEX clause
of ALTER TABLE, 17-19
UPDATE privilege
revoking, 25-15
updates
location transparency and, 28-45
transparency, 29-32
USER_DB_LINKS view, 29-21
USER_DUMP_DEST initialization parameter, 5-16
USER_JOBS view
jobs in system, viewing, 10-14
usernames
SYS and SYSTEM, 1-10
users
altering, 24-20
assigning profiles to, 24-25
assigning tablespace quotas, 11-3
assigning unlimited quotas for, 24-19
authentication
about, 23-2, 24-7
changing default roles, 24-21
database authentication, 24-8
default tablespaces, 24-17
dropping, 24-21
dropping profiles and, 24-27
dropping roles and, 25-10
end-user security policies, 23-6
enrolling, 1-7
enterprise, 24-12, 25-10
external authentication, 24-9
global, 24-11
in a newly created database, 2-25
limiting number of, 2-36
listing, 24-27
listing privileges granted to, 25-25
listing roles granted to, 25-25
managing, 24-16
network authentication, 24-11 objects after dropping, 24-21 operating system authentication, 24-10 password security, 23-5
policies for managing privileges, 23-6 privileges for changing passwords, 24-20 privileges for creating, 24-16
privileges for dropping, 24-22 proxy authentication and authorization, 24-13 PUBLIC group, 25-17
schema-independent, 24-12 security and, 23-2
security for general users, 23-4 session, terminating, 5-24 specifying user names, 24-17 tablespace quotas, 24-18 unique user names, 2-36, 24-6 viewing information on, 24-29 viewing memory use, 24-31 viewing tablespace quotas, 24-29 utilities
Export, 1-24 for the database administrator, 1-24 Import, 1-24
SQL*Loader, 1-24 UTLCHAIN.SQL script listing chained rows, 21-10 UTLCHN1.SQL script
listing chained rows, 21-10 UTLLOCKT.SQL script, 5-15
V
V$ARCHIVE view, 8-22 V$ARCHIVE_DEST view obtaining destination status, 8-13
V$DATAFILE view, 11-47 V$DBFILE view, 2-24 V$DBLINK view, 29-25 V$DISPATCHER view monitoring shared server dispatchers, 5-8 V$DISPATCHER_RATE view
monitoring shared server dispatchers, 5-8 V$INSTANCE view
Trang 7for database quiesce state, 4-16
V$LOG view, 8-22
displaying archiving status, 8-22
online redo log, 7-20
viewing redo data with, 7-20
V$LOG_HISTORY view
viewing redo data, 7-20
V$LOGFILE view, 2-24
log file status, 7-17
viewing redo data, 7-20
V$OBJECT_USAGE view
for monitoring index usage, 16-21
V$PWFILE_USERS view, 1-22
V$QUEUE view
monitoring shared server dispatchers, 5-8
V$ROLLNAME view
finding PENDING OFFLINE segments, 13-28
V$ROLLSTAT view
finding PENDING OFFLINE segments, 13-28
undo segments, 13-12
V$SESSION view, 5-24
V$SORT SEGMENT view, 11-47
V$SORT_USER view, 11-47
V$TEMPFILE view, 11-47
V$THREAD view, 7-20
V$TIMEZONE_NAMES view
time zone table information, 2-24
V$TRANSACTION view
undo tablespaces information, 13-12
V$UNDOSTAT view
statistics for undo tablespaces, 13-12
V$VERSION view, 1-9
valid destination state
for archived redo logs, 8-12
varrays
storage parameters for, 14-14
verifying blocks
redo log files, 7-18
views
creating, 20-2
creating with errors, 20-4
Database Resource Manager, 27-31
displaying dependencies of, 21-35 dropped tables and, 15-20 dropping, 20-10
FOR UPDATE clause and, 20-3
join See join views.
location transparency using, 29-26 managing, 20-2, 20-11
managing privileges with, 29-28 name resolution in distributed databases, 28-42 ORDER BY clause and, 20-3
privileges, 20-2 privileges for dropping, 20-10 privileges for recompiling, 21-27 privileges to replace, 20-10 recompiling, 21-27 remote object security, 29-28 tables, 15-35
V$LOG, 7-20, 8-22
V$LOGFILE, 7-17, 7-20
wildcards in, 20-4
W
wildcards
in views, 20-4 WORM devices and read-only tablespaces, 11-25