p. 1
oracle® database 2 day dba 10g release 2 10.2 b14196-02 december 2005
[close]
p. 2
oracle database 2 day dba 10g release 2 10.2 b14196-02 copyright © 2004 2005 oracle all rights reserved primary author colin mcgregor contributing author sushil kumar antonio romero david austin steve fogel lance ashdown and douglas williams contributor michele cyran daniela hansell vasudha krishnaswamy peter laquerre venkat maddali mughees minhas jp polk mark townsend and wanli yang 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 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 we disclaim liability for any damages caused by such use of the programs oracle jd edwards peoplesoft and retek are registered trademarks of oracle corporation and/or its affiliates other names may be trademarks of their respective owners 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.
[close]
p. 3
contents preface xi audience xi documentation accessibility xi structure xii related documentation xiii conventions xiv 1 introduction about this book what this book is not how to use this book with related material the oracle database common oracle dba tasks tools for administering the database 1-1 1-1 1-1 1-2 1-2 1-2 2 installing oracle and building the database overview of installation 2-1 checking prerequisites 2-1 installation choices 2-2 basic installation 2-2 advanced installation 2-3 installing oracle software and database 2-4 using dbca to create and configure a database 2-6 starting dbca 2-7 creating a database with dbca 2-7 database templates 2-8 database identification 2-8 management options 2-8 database credentials 2-8 storage options 2-8 database file locations 2-9 recovery configuration 2-9 database content 2-9 initialization parameters 2-10 database storage 2-11 iii
[close]
p. 4
database creation options configuring database options with dbca deleting a database with dbca managing templates with dbca advantages of using templates types of templates dbca templates provided by oracle creating templates using dbca deleting dbca templates configuring automatic storage management with dbca upgrading a database overview of the database upgrade assistant pre-upgrade checks automated upgrade tasks support for real application clusters support for automatic storage management support for silent mode oracle database version restrictions starting the database upgrade assistant upgrading the database using the database upgrade assistant installation oracle by example series 2-11 2-12 2-12 2-12 2-12 2-12 2-13 2-13 2-14 2-14 2-14 2-14 2-15 2-15 2-15 2-15 2-15 2-16 2-16 2-17 2-21 3 getting started with oracle enterprise manager introduction to the oracle enterprise manager database control database management features online help navigational features starting and stopping the oracle enterprise manager console starting dbconsole in windows accessing the oracle enterprise manager database control granting database control administrative privileges setting up enterprise manager preferences defining blackout periods setting preferred credentials sql statements and other management tools sqlplus and isqlplus starting sqlplus starting isqlplus managing your database a roadmap getting started oracle by example series 3-1 3-1 3-2 3-2 3-2 3-3 3-3 3-4 3-5 3-5 3-6 3-6 3-7 3-7 3-7 3-8 4 configuring the network environment understanding network configuration oracle net listener configuration client configuration connection requests naming methods local naming 4-1 4-1 4-2 4-2 4-2 4-3 iv
[close]
p. 5
directory naming easy connect naming external naming tools for network configuration oracle net configuration assistant enterprise manager oracle net manager viewing listener configuration starting and shutting down the listener configuring oracle networking on client machines networking oracle by example series 4-3 4-3 4-3 4-3 4-3 4-4 4-4 4-4 4-5 4-5 4-6 5 managing the oracle instance overview of an instance and instance management about initialization parameters instance memory structure the system global area sga program global area pga oracle background processes accessing the database about database administration privileges server and client processes network connections shutting down and restarting the instance and database with enterprise manager starting and shutting down the database instance on windows viewing and modifying initialization parameters managing memory parameters modifying memory parameters instances oracle by example series 5-1 5-2 5-2 5-2 5-3 5-3 5-4 5-4 5-5 5-5 5-6 5-6 5-7 5-9 5-9 5-9 6 managing database storage structures exploring the storage structure of your database control files displaying control file information online redo log files displaying redo log file information multiplexing the redo log archive log files displaying archive log file information rollback segments displaying rollback segment information datafiles viewing datafile information tablespaces locally-managed vs dictionary-managed tablespaces tablespace type 6-1 6-2 6-2 6-2 6-3 6-3 6-4 6-4 6-4 6-4 6-4 6-5 6-5 6-5 6-5 v
[close]
p. 6
tablespace status 6-6 auto-extend tablespace 6-6 some tablespaces in the database 6-6 other storage structures 6-7 initialization parameter file 6-7 password file 6-8 backup files 6-8 performing common database storage tasks 6-8 viewing tablespaces in your database 6-8 creating a tablespace 6-8 modifying a tablespace 6-9 dropping a tablespace 6-10 reclaiming wasted space 6-10 viewing segment advisor recommendations 6-11 running the segment advisor manually 6-14 managing undo for your database 6-14 about undo data 6-14 undo tablespace size and retention time 6-15 automatic undo management 6-15 managing undo with enterprise manager 6-16 using the undo advisor 6-17 gaining advice from undo advisor 6-18 extending the undo tablespace 6-19 setting minimum undo retention time 6-20 making changes to the database storage structure 6-20 storage oracle by example series 6-20 7 administering users and security overview of users and security 7-1 sample schemas 7-2 administering roles 7-3 about privileges and roles 7-3 about administrative accounts 7-4 sys 7-4 system 7-5 administrative privileges 7-5 viewing roles 7-5 creating roles 7-6 modifying roles 7-6 dropping roles 7-7 administering profiles 7-7 administering database users 7-8 creating users 7-8 using a shortcut to create users 7-10 editing users 7-10 changing the tablespace quota for a user 7-10 unlocking accounts and resetting passwords 7-11 vi
[close]
p. 7
granting roles revoking roles dropping users users oracle by example series 7-11 7-12 7-12 7-12 8 managing schema objects overview of schema objects 8-1 exploring database schema objects 8-1 naming schema objects 8-2 managing tables 8-2 about tables 8-3 types of table 8-3 column attributes 8-3 table-level constraints 8-5 storage attributes 8-5 other table creation considerations 8-6 viewing tables 8-6 viewing table data 8-7 creating tables 8-8 estimating the size of new tables 8-9 creating a table example 8-9 modifying table attributes 8-11 adding a column 8-11 dropping a column 8-11 creating a new table constraint 8-11 modifying an existing constraint 8-12 dropping a constraint 8-13 loading data into tables 8-13 dropping a table 8-15 managing indexes 8-15 about indexes 8-16 indexes and performance 8-16 index types 8-16 viewing indexes 8-17 creating indexes 8-18 dropping indexes 8-18 managing views 8-19 about views 8-19 displaying views 8-20 creating a view example 8-20 dropping views 8-21 managing database-resident program units 8-21 managing packages 8-22 viewing packages 8-22 creating packages 8-23 editing packages 8-23 dropping packages 8-24 vii
[close]
p. 8
managing package bodies viewing package bodies managing standalone subprograms managing triggers working with other schema objects schemas oracle by example series 8-24 8-24 8-25 8-25 8-26 8-26 9 performing backup and recovery overview of database backup and recovery 9-1 oracle backup restore and recovery concepts 9-2 consistent and inconsistent backups 9-2 media recovery 9-3 the flash recovery area 9-3 the rman repository 9-4 configuring your database for basic backup and recovery 9-4 planning space usage and location for the flash recovery area 9-4 retention policy and the flash recovery area 9-4 sizing the flash recovery area 9-5 credentials for performing oracle enterprise manager backup and recovery 9-6 preferred credentials for backup and recovery 9-6 configuring the flash recovery area 9-6 configuring archivelog mode for the database 9-7 configuring backup settings 9-8 understanding backup device settings for disk 9-8 configuring backup policy settings 9-9 backing up your database 9-10 database backup concepts 9-10 full backups of datafiles 9-10 incremental backups of datafiles 9-10 incrementally updated backups rolling forward image copies of datafiles 9-11 using tags to identify backups 9-11 performing and scheduling backups with enterprise manager 9-11 performing a whole database backup with oracle enterprise manager 9-11 using the oracle-suggested backup strategy 9-15 scheduling other backup tasks 9-16 validating backups and testing your backup strategy 9-16 performing restore and recovery operations 9-17 recovering a whole database from backup 9-18 recovering from a lost spfile or control file 9-20 validating the restore of datafiles from rman backup 9-20 returning a table to a past state flashback table 9-21 enabling row movement on a table 9-21 performing flashback table 9-22 recovering dropped tables flashback drop 9-23 managing your backups 9-24 backup management concepts 9-24 using the manage current backups page 9-25 viii
[close]
p. 9
searching for backups on the manage current backups page managing current backups backup sets managing current backups image copies validating the contents of backup sets or image copies crosschecking backups deleting expired backups marking backups as available or unavailable deleting obsolete backups displaying backup reports backup and recovery oracle by example series 9-27 9-27 9-27 9-28 9-28 9-29 9-30 9-30 9-30 9-32 10 monitoring and tuning the database proactive database monitoring alerts performance self-diagnostics automatic database diagnostics monitor monitoring general database state and workload managing alerts viewing metrics and thresholds setting metric thresholds responding to alerts clearing alerts setting up direct alert notification diagnosing performance problems viewing performance analysis responding to performance findings modifying default addm behavior running addm manually using advisors to optimize database performance about performance advisors using the sql tuning advisor using the sql access advisor using the memory advisor setting new sga or pga targets determining performance impact for altering your sga or pga monitoring and tuning oracle by example series 10-1 10-1 10-2 10-2 10-4 10-4 10-6 10-7 10-8 10-8 10-9 10-9 10-9 10-10 10-10 10-11 10-11 10-13 10-14 10-15 10-15 10-16 10-17 11 managing oracle software about software management and patch releases applying a patch release determining your oracle software environment determining the oracle database version determining the location of your oracle home determining your hardware configuration setting your oracle metalink credentials staging the patch release installing the patch release 11-1 11-1 11-1 11-2 11-2 11-3 11-3 11-4 11-6 ix
[close]
p. 10
managing oracle software oracle by example series 11-7 a automatic storage management what is automatic storage management overview of disks disk groups and failure groups installing automatic storage management accessing the automatic storage management home page accessing the asm home page on a single instance system accessing the asm home page on a real application clusters system starting up and shutting down the asm instance monitoring disk group space usage creating a disk group dropping a disk group adding disks to a disk group dropping disks from a disk group backing up asm-managed files automatic storage management oracle by example series a-1 a-2 a-3 a-3 a-4 a-5 a-5 a-5 a-6 a-8 a-9 a-11 a-12 a-12 b overview of real application clusters what is real application clusters real application clusters database configuration scenario differences in administering real application clusters and single-instance oracle databases monitoring oracle real application clusters with enterprise manager overview of the cluster database home page viewing real application clusters database targets navigating to oracle enterprise manager cluster-related pages viewing and modifying real application clusters initialization parameters starting and stopping real application clusters databases and database instances starting and stopping real application clusters databases starting and stopping individual instances in real application clusters databases managing real application clusters backup and recovery redo log groups and redo threads in real application cluster databases backing up real application clusters databases overview of restore and recovery operations for a real application clusters database using a flash recovery area with a real application clusters database real application clusters oracle by example series b-1 b-1 b-2 b-2 b-2 b-4 b-4 b-5 b-6 b-6 b-6 b-7 b-7 b-8 b-8 b-9 b-9 index x
[close]
p. 11
preface this preface contains these topics audience documentation accessibility structure related documentation conventions audience oracle database 2 day dba is for anyone who wants to perform day-to-day administrative tasks with the oracle database prior knowledge or experience with managing databases is not required the only requirement is a basic knowledge of computers in particular this book is targeted toward the following groups of oracle users developers wanting to acquire basic dba skills anyone managing departmental servers database administrators managing an oracle database for small or medium business smb this book is equally useful for enterprise dbas it recommends best practices and describes efficient ways of performing administrative tasks with oracle enterprise manager as the primary interface documentation accessibility our goal is to make oracle products services and supporting documentation accessible with good usability to the disabled community to that end our documentation includes features that make information available to users of assistive technology this documentation is available in html format and contains markup to facilitate access by the disabled community accessibility standards will continue to evolve over time and oracle is actively engaged with other market-leading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers for more information visit the oracle accessibility program web site at http www.oracle.com/accessibility xi
[close]
p. 12
accessibility of code examples in documentation screen readers may not always correctly read the code examples in this document the conventions for writing code require that closing braces should appear on an otherwise empty line however some screen readers may not always read a line of text that consists solely of a bracket or brace accessibility of links to external web sites in documentation this documentation may contain links to web sites of other companies or organizations that oracle does not own or control oracle neither evaluates nor makes any representations regarding the accessibility of these web sites tty access to oracle support services oracle provides dedicated text telephone tty access to oracle support services within the united states of america 24 hours a day seven days a week for tty support call 800.446.2398 structure this document contains chapter 1 introduction this chapter contains an brief overview of oracle database administration chapter 2 installing oracle and building the database this chapter discusses how to install the oracle software and database it also describes how to configure additional databases and how to upgrade and older version of a database to the current version chapter 3 getting started with oracle enterprise manager this chapter introduces you to the oracle enterprise manager and how to use it chapter 4 configuring the network environment this chapter discusses how to configure a network so that clients can access your databases chapter 5 managing the oracle instance this chapter discusses starting and stopping the database instance and managing initialization parameters chapter 6 managing database storage structures this chapter discusses management of the database s storage structure chapter 7 administering users and security this chapter discusses how to add and maintain user accounts it includes information about using system privileges and roles to control user access to the database chapter 8 managing schema objects this chapter discusses managing tables indexes and other schema objects chapter 9 performing backup and recovery this chapter discusses how to backup and recover your database xii
[close]
p. 13
chapter 10 monitoring and tuning the database this chapter discusses monitoring database activities and diagnosing performance problems chapter 11 managing oracle software this chapter discusses how to keep your oracle software up-to-date with product fixes appendix a automatic storage management this appendix introduces automatic storage management appendix b overview of real application clusters this appendix introduces real application clusters related documentation for more information see these oracle resources oracle database administrator s guide oracle enterprise manager advanced configuration oracle database concepts oracle enterprise manager concepts oracle database net services administrator s guide oracle database sql reference oracle database reference oracle database backup and recovery basics oracle database backup and recovery advanced user s guide oracle real application clusters installation and configuration guide oracle database oracle clusterware and oracle real application clusters administration and deployment guide oracle database installation guide many of the examples in this book use the sample schemas which are installed by default when you select the basic installation option with an oracle database installation refer to oracle database sample schemas for information on how these schemas were created and how you can use them yourself printed documentation is available for sale in the oracle store at http oraclestore.oracle.com to download free release notes installation documentation white papers or other collateral please visit the oracle technology network otn you must register online before using otn registration is free and can be done at http otn.oracle.com/membership if you already have a username and password for otn then you can go directly to the documentation section of the otn web site at http otn.oracle.com/documentation xiii
[close]
p. 14
conventions the following text conventions are used in this document convention boldface italic monospace meaning boldface type indicates graphical user interface elements associated with an action or terms defined in text or the glossary italic type indicates book titles emphasis or placeholder variables for which you supply particular values monospace type indicates commands within a paragraph urls code in examples text that appears on the screen or text that you enter xiv
[close]
p. 15
1 introduction as an oracle database administrator dba you are responsible for the overall operation of the oracle database this chapter contains the following topics about this book the oracle database common oracle dba tasks tools for administering the database about this book oracle database 2 day dba is a database administration quick start guide that teaches you how to perform day-to-day database administrative tasks the goal of this book is to help you understand the concepts behind the oracle database it teaches you how to perform all common administration tasks needed to keep the database operational including how to perform basic troubleshooting and performance monitoring activities the primary administrative interface used in this book is oracle enterprise manager in database console mode featuring all the self-management capabilities introduced in the oracle database what this book is not oracle database 2 day dba is task oriented the objective is to describe why and when administrative tasks need to be performed where appropriate it describes the concepts necessary for understanding and completing the task at hand assuming the reader has no prior knowledge of the database this book is not an exhaustive discussion of all oracle database concepts for this type of information refer to oracle database concepts additionally for a complete discussion of administrative tasks refer to oracle database administrator s guide how to use this book with related material this book is part of comprehensive set of learning material for administering an oracle database which includes a 2 day dba oracle by example obe series available on the web and in an oracle university instructor-led class introduction 1-1
[close]