Covers Oracle 10g Releases 1 and 2

Learn to install the right software and create
databases, users, and objects
Learn to use Partitioning, Job Scheduling, SSL,
ASM, RMAN, and advanced features
Go inside the Windows Registry, Services, and
UNIX file permissions

Oracle Database 10g
From Nuts to Soup
First Edition (Build 030)

Written by Mark Johnson
Owner and Principal Database Engineer
Remington Database Solutions, LLC

Oracle Database 10g:
From Nuts to Soup
First Edition

Mark Johnson
Owner and Principal Database Engineer
Remington Database Solutions, LLC

Published By:
Remington Database Solutions, LLC
Mark Johnson, Owner
21397 Fitzgerald Drive, Ashburn, VA 20147-5814, U.S.A.
http://www.RemiData.com/
Orders:
Orders may be placed on-line at the Publisher’s URL, which is listed above.
Volume discounts are available to employers purchasing copies for their
employees, and to libraries; volume discounts are not available to individuals.
Feedback:
Errors and omissions can be submitted to The Publisher via email at
errata@RemiData.com. The Publisher does not offer compensation for
submissions. All submissions become property of the publisher. Submissions
may be used or discarded without notice to or recognition of the submitting party.
Registration
Persons and organizations are asked to register when purchasing this book.
Registration requires a valid email address. Notices of free updates and error
corrections will only be sent to registered customers; notices and error corrections
will not posted on The Publisher’s web site.
Privacy
Customer information is kept private. It is never, sold, distributed, or shared.
Sales information is kept for 30 days to support billing. Non-sales customer data,
such as email addresses, are kept indefinitely by the Publisher and are used
exclusively by the Publisher. For example, to notify customers of updates and
error corrections.
Legal Notices
Copyright © 2006 by Mark Johnson. All rights reserved. No part of this book
may be reproduced or transmitted in any form or by any means, electronic or
mechanical, including photocopying, recording, or by any information storage and
retrieval system, without written permission from The Publisher, except for the
inclusion of brief quotations in a review. This book may not be sold in part of
whole without express written permission from The Publisher.
All trademarks used herein remain the property of their original owners.
Contacting the Author
If you would like to arrange for the Author to assist with Oracle activities at your
organization, you may do so at the publisher’s address noted above. Mr. Johnson
offers a range of services including: consulting, studies, database engineering,
PL/SQL programming, and Oracle administration.

And In loving memory of my mother-inlaw. . Murray. Margaret S.This book is dedicated to the memory of the students and faculty of Virginia Tech whose lives were lost on April 16. 2007. Dr. “Mimi”.

.

......................................... 63 Fifth Normal Form (5NF) ............................................................................ 56 Relational ........................................... 59 Rule 0: Unnamed Rule ........................................................................................................................................................................ 63 Second Normal Form (2NF) ...................................................... 48 About the Title ............................................................................................................... 64 ......................................................... 49 Organization............................................................... 61 Rule 9: Logical Data Independence ................................................... 56 Object-Oriented................. 52 Goals of Databases ........................................................... 53 Remove Programmer Ownership ............................................ 63 Boyce-Codd (BCNF)....................................................................... 56 Hierarchical............................................................................................................................................................................................................................................................ 60 Rule 2: Guaranteed Access Rule.......................................... 58 E........................................................................... F... 53 Minimize Redundancy.................................................................................................... 62 Normalization and Normal Forms .................................................................................................................................................................................... 61 Rule 5: Comprehensive Data Sub-language Rule ........................................................... 63 Fourth Normal Form (4NF) .......................................................................................... 48 Covered Versions of Oracle.................................... 60 Rule 1: The Information Rule ........................................................................................................................................................................... 56 Network .................................................... 52 Data Independence .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 50 Chapter 2: What Is a Database.......................................................................................................................... 62 Rule 11: Distribution Independence............................. 60 Rule 4: Dynamic On-Line Catalog Based on the Relational Model ................................................................................................................................................................................................................................. 60 Rule 3: Systematic Treatment of Null Values ........................ 54 History of Databases ................................. Update.................................................................Table of Contents Table of Contents Chapter 1: Introductions...................... Codd’s 12 Rules for Relational Data Bases ......................................................................................... 62 Rule 12: Non-Subversion Rule ........................ 61 Rule 7: High-level Insert........................................... 54 Types of Databases.......... and Delete.......................................................... 51 Database Defined .......................................................................... 63 Third Normal Form (3NF) ........................................................ 61 Rule 10: Integrity Independence ...................................................................... 47 About this Book .................................................................................. 57 Object-Relational ................................... 50 About the Author ............. 62 First Normal Form (1NF) ............................................... 61 Rule 6: View Updating Rule..................................................... 49 Audience.............................. 61 Rule 8: Physical Data Independence .................... 49 Disclaimers ..................................

............................................................................................................................................................................................................................................................................................................................................................................................................................................................ 76 Foreign Key Constraints .................................................................................... 72 The INCLUDING and OVERFLOW Clauses...................................... 97 Make DB Links “Neat” with Synonyms............................................ and Functions............................. 94 Database Links ........................................ 80 Check Constraints............................................................................. 98 Database Link Pitfalls............................................................................................................................................. 96 Using Database Links ..................... 75 Keys and Constraints........................................... 93 Packages................. 92 Permissions for Views ...................... 89 Synonyms........................................................................................................... 67 About Extents.. 86 Replication Notes for Sequences.......................... 76 Primary Key Constraints.......................................... 97 Using Database Links for Streams Replication ............................ 71 Index-Organized Tables (IOT).................... 64 Creating Tables .................. 90 Public Synonyms ................................................................... 64 Tables and Columns .............................................................. 101 ................................................................................................................................................................................................................................................................. 78 Unique Key Constraints........................................................................... 90 Views ................................................................................. 73 IOT Mapping Tables .......................................................... 88 RAC Notes for Sequences ............................................................................................................................................. 68 External Tables................................... 86 Sequence Generators ................... 84 Triggers on Schemas ....... 100 Terminology and Concepts......................................................................................................................................................................................................................................................................................................................................................................... 75 IOT Dictionary Views .................. 71 Finding External Tables........................................................................................................................ 70 Describing External Tables........................................ 81 Triggers................................................................................................ 65 Altering Tables ............................................................................................. 82 Creating Triggers On The Fly . 66 Rows Represent Data........................................................................................ 98 Data Modeling and Database Design .............................. 70 Creating External Tables ...................................................................................................................................................... 83 Triggers on Views ............................................................................................................................... 95 Creating Database Links ............. 80 Indexes............. 84 Triggers at the Database Level.......................................................................................... 79 Not Null Constraints................................................................................................................................................................................ 67 About Table Segments............................................ Procedures.............................................................................................................................Table of Contents Types of Database Objects ................................................................................................. 85 A Problem with Timestamps........................................................................................................... 98 Database Languages and Command Types ............................................................

................................................................................................................................................................................................................................................................................................ 131 Oracle Version 7................ 130 Oracle Version 2................................................................ 117 The Physical Database Design (PDD) Phase .................................................................................................................................................... 127 The Link Between Oracle and IBM System R ........................................ 107 Data Modeling and Database Design Tasks ............................................................................................................................................................... 131 Oracle Version 4.............................................................................................................................................................................................................................................................................................. 132 Oracle Version 10......................................... 113 The Logical Database Design (LDD) Phase ................. 101 Supertype Entities..................................... 129 Oracle............................................................................................ 109 The Logical Data Modeling (LDM) Phase ................................................................................................ The ORDBMS .........................................................................................................Table of Contents Entity Types ............................................................................................... 104 Relationships ......................................................................................................... 104 Cardinality..... 133 Oracle’s Competition ............................... 101 Associative Entity Types ........................................... 108 Activities ............................................................................................................................................................................................................................................................................ 103 Optionality ......................................................................................... 132 Oracle Version 11................................................................................................................................................................................... 105 Normalization............................................................................................................................. 103 Identifiers & Keys ..... The Company................... 111 The Physical Data Modeling (PDM) Phase ........................................................................... 131 Oracle Version 5.... 133 ................. 130 Oracle Version 3........... 124 Chapter 3: What is Oracle ............ 109 Breakdown of Phases and Activities ......................... 131 Oracle Version 9....................... 130 Oracle Version 1.............. 101 Parent and Child Entities ...... 123 The New Standard............................................................. 102 Entity Instances ............................................................................ 109 The Conceptual Data Modeling (CDM) Phase ... 103 Attributes....................................................... 131 Oracle Version 8............................................................................................................................................................................................................ 122 The Legacy Standard.......................................................... 107 CRUD ................. 108 Phases ..................... 131 Oracle Version 6.................................................... 126 Oracle Trivia .................................................. 133 Summary of Differences............................................................................................................................................................... 101 Entities ...................................................................................................................................................................................................................................................................................................................................................... 128 Oracle Trivia ......................................................................................................................................................................... 126 Oracle...................................................................... 106 CASE ... 120 Units of Measure ....................................................................................................................................

........................................................................................................................................................ 135 SQL Server 2000 Enterprise Edition............................................... 150 Plan and Implement the Backup and Recovery Plan ..................................... 146 The Times Are a Changing................................................... 137 Logical Characteristics .............................. 136 Physical Characteristics ...................................................... 152 Programming Assistance ...................................................... 161 Where to Get Training........................................................................................................................................................................................................................................ 147 Basic Duties of the DBA ................................................................................................................. 157 Why Get Certified ..................................................... 153 Documentation ......................................................................................................................................................................................................................................................... 161 Scheduling an Exam......................................................................................................................................................................................................................... 160 10g Accreditations...... 152 Data Analysis .............................................................................................................................................................................................. 151 Routine Maintenance............................................. 163 Compare The Oracle9i and 10g OCP Requirements .................................................................................................................................. 162 Taking an Exam .................................... 146 Identify Hardware and Operating System Requirements....................................................................... 151 Post-Implementation DBA Duties ........................................................................................................................... ......... 148 Define Standards and Naming Conventions ............ 148 Update the Physical Data Model............... 155 Chapter 5: Are You Certified .............................................................. 143 Chapter 4: The Oracle Database Administrator............................................................................................................................................................................... 150 Troubleshooting ..........................................................................................................5................................................................................................ 156 The Goal .............. 146 Configure the Hardware and Operating System ......................................................................................................................................................................................................................................... 154 Evaluate New Software .................. 157 Oracle 10g Certification Requirements........ 135 Scalability and Licensing.................... 165 ........................................ 150 Monitor and Tune Database Performance ....................Table of Contents A Quick Story about Product Selection.... 159 10g OCM ................................................................................................................... 145 What Do DBAs Do ...................................... 146 Optional / Preliminary Duties of a DBA ................................................................................................... 158 10g OCP.............................................. 149 Define and Manage Database Security....................................................................................................................................................................... 147 Design the Physical Database ........................................ 149 Install the Oracle Server Software ....... 152 Capacity Expansion Planning .. 164 Links to More Information ...... 141 PostgreSQL.. 158 10g OCA......... 140 Sybase ASE 12....................................................................................................................................................................................................................................................... 153 Upgrades and Migrations..............................

.................................................. 183 External Procedure Scheduling .................................................CREATE_ERROR_LOG....................................................... 168 Bigfile Tablespaces ................................ 171 Buffer Cache Flushing.................................................................................... 174 DBMS_CRYPTO.................................................................................................................................................................................. 193 OEM for Net Configuration................................................... 183 Drop Database Command........... 166 Cross-Platform New Features (No-Cost) ........................................................... 197 Rename Tablespace .......................................................................................................... 187 Installation Process.................................................................................................................. 192 OEM MetaLink Integration ............................................. 186 Oracle HTML DB to Be Renamed Oracle Application Express (APEX)....................................................Table of Contents Chapter 6: Oracle10g New Features ............................................................................................................................................................. 173 Database Password Encryption (Logins)................................ 179 Understanding DBMS_ERRLOG.................................................................................................................................... 182 Dropping DML Error Log Tables ....................................................... 192 OEM Database Cloning..................................... 181 Using DML Error Logging .................................................................................................................................................................................. 184 Guaranteed Undo Retention............................................................................................................................................ 167 Automatic Shared Memory Management (ASMM) ......................................................................................... 196 Remote Function Calls ...................................... 176 Default User Tablespace....... 191 Memory Corruption Checking ..................................................................................................................................................................................................................................... 173 Data Types (BINARY_FLOAT and BINARY_DOUBLE)........................................................................................................................................... 195 Recycle Bin............................................ 180 Creating an Error Log Table ..... 195 Regular Expressions ................ 190 Getting Started with HTML DB............................................................................................................................................................................................................................................................................................ 179 Limitations ...................................................................................................................................................................................................... 191 HTML DB Security Issues......................... 177 DML Error Logging . 197 Row Timestamp ......................... 175 DBMS_OUTPUT Unlimited Output........................... 172 Data Pump Import and Export ...................................... 198 ......................................................................................................................... 167 Automatic Optimizer Statistics Collection ............................................................................ 184 Feature Usage Tracking.......................................................... 193 Online Segment Shrink........ 178 Prerequisites ........................................... 197 Scheduler .......................... 189 URLs for Using and Maintaining HTML DB.................................................................................................................... 184 HTML DB........................... 186 What is HTML DB ............................................................................................ 187 Installation Issues .................................................. 192 OEM Oracle Home Cloning ....................... 195 Redo Logfile Sizing Advisor .................... 193 Proactive Tablespace Monitoring......................................................................................................

................................................................................. 229 .............................. 217 TDE Security Issues .............................................................................. 223 Flashback .......................................................... 218 Undo Tablespace Sizing Advisor................................................................................................................................ 212 Automatic Workload Repository (AWR) ........................................................................................................................................................................................................................................................................................................................................... 224 ODBC Support For Linux ................ 229 What 10g Lacks ................................................................................... 220 Large Page Support ...................... 226 RMAN Compressed Backups ........................................................................................................................................................................................................................................................................................................................................... 222 Enhancements to Existing Features and Options........................................................ 216 The Encryption Key Table..... 201 Temporary Tablespace Groups .............................................. 217 TDE Replication Issues ....... 228 VPD Support for Parallel Queries....... 218 New Features for the Windows Platform ........................................................................................................................................................................ 199 Tablespace Repositories and File Groups....................................................................................................... 205 Versioned Tablespaces ............................................................ 226 Partitioning Enhancements .............................................. 220 NUMA Support............................................................................................................................................ 221 Oracle Database for 64-Bit Windows...................................................................................................... 225 Oracle Net Easy Connect........................................................................................ 222 What is Not Supported under 64-Bit Oracle for Windows............................... 226 RMAN Block Change Tracking....................................................................... 213 RMAN Encrypted Backups .. 221 Windows Fibers Support ...................................................... 208 Cross-Platform New Features (Additional Cost).............................................................................................................................................. 214 The Wallet and Master Encryption Key ................................................................... 225 OEM Configuration Using the OUI ................................................................................................................... 214 Transparent Data Encryption (TDE) .. 229 Larger VARCHAR2 Columns .............................................. 209 Active Session History (ASH) ................................................ 214 Estimating a Segment’s Future Size.......................................................................................... 206 VPD Column Level Security ......................................................................... 225 OUI .............. 204 Upgrade Information Tools ..... 227 Streams Improvements .......................................... 228 VPD Static Security Polices....................................................................... 204 User Defined Quoting Characters ................................ 223 DBCA Support for RAC and ASM.......................................................................................................... 224 LOB Sizes .................. 214 Identifying Candidates for Online Segment Shrink .....................................................Table of Contents SQL*Plus Proxy User Logins ...... 201 Undo Retention Tuning .................................................................................................................................................................... 213 Segment Advisor .................................................................................. 209 Automatic Database Diagnostics Monitor (ADDM) ...................................................................................... 224 Globalization / Unicode................................................................

....... 247 Descriptions of Windows-Specific Install Options................................................................... 248 Oracle Counters for Windows Performance Monitor ....................................................................................................................................... 230 An Easy Way to Switch Between Oracle Homes .......................................................................................................................................................... 247 Oracle Diagnostics Pack .. 250 Oracle Provider for OLE DB ..................................................................... 234 Standard Edition....................................... 243 Oracle Development Kit .................... 238 About Release Numbers ....................................................................................................................... 240 Oracle Database 10g.............................................................................................................................. 243 Oracle Connection Manager .................. 247 Oracle Change Management Pack ............................................................. 235 Which Version of Oracle Should You Use .... 242 Oracle COM Automation Features ................................................................................................... 234 Which Edition of Oracle Should You Use?.................. 242 Oracle Data Mining Scoring Engine ... 249 Oracle Objects for OLE (OO4O) ............. 246 iSQL*Plus ................................................................................................................................................................ 231 Replicable Sequence Generators.................. 235 Lite Edition .................................................................................................................................... 246 Descriptions of OEM Options ........................................................................................ 231 Chapter 7: Oracle Server Software .............................. 241 Oracle Advanced Security (ASO) .................................................................................................. 247 Oracle Windows Documentation ................. 248 Oracle Administration Assistant for Windows ......................................................................................................................................................... 235 Personal Edition .................... 240 Oracle Real Application Clusters (RAC) ..............Table of Contents Longer Object Names....................................................... 247 Oracle Tuning Pack ...... 250 Oracle ODBC Driver .............................................................................................. 250 ......................................... 242 Oracle OLAP...................................................... 242 Oracle Label Security ............................... 242 Oracle Net Listener ............................................ 243 Oracle Enterprise Manager (OEM) 10g Grid Control.................................................................................................................................................................. 239 Descriptions of Core Features and Options ........................................................................................................... 234 Standard Edition One .................................................... 233 A Quick Heads Up ................................................... 248 Oracle Services for Microsoft Transaction Server (MTS) ......... 241 Oracle Spatial.............................. 245 Oracle Transparent Gateways ................................................................................................. 247 Oracle Configuration Management Pack............................................................................................................................................................................................................................................................................................................................................................. 241 Oracle Partitioning ...................................... 243 Oracle Enterprise Manager (OEM) 10g Database Control........................................................... 230 A Better Installer and a Fool Proof Un-Installer ............................................................................................................................................................................................................................................................................................................................................ 234 Enterprise Edition. 235 Express Edition (XE)..................................................................................................................................................................

................................ 263 Step-by-Step Instructions............................................................................................................................ 253 Components ................................... 256 Oracle Records DB......................................................... 262 Known Issues Installing 10g............................................................................ Anyways ........................................................................ 257 Oracle Secure Enterprise Search (SES)............................................................... 253 Overview........................................................................ 256 Administration......... 264 Full Install: an Example................................................................................... 251 Oracle Audit Vault ................................................................................... 259 Installing Oracle10g Server ....................................................................................................................................................................................... 256 Oracle Secure Backup .............................................................. 279 Task 4: Defrag Your Disks ......... 293 Client Installation Packages............................................................................. 296 What Files Need To Be Stored on the Client ............................................................................................................... 299 .............................................. 294 Administrator .................... 276 Task 1: Install Java Native Compiler (NCOMP) ........................... 261 Pre-Installation Steps.............................. 254 Requirements.......................................................................... 283 Installing Oracle 10g Express Edition (XE) ...................................................................................................NET ................................... 251 Oracle Content DB .............................................................. 299 Which CD .............................................................................................................................................................................. 250 Descriptions of New 10................ 281 Un-Installing Oracle Server .......... 295 Custom........................2 Software ....................................................................... 262 Launching the Oracle Universal Installer ......................................... 260 Get Your Stuff Together.. 276 Task 2: Install the Latest Patchset ........................................................................................................................................... 261 What You Should Know Before You Begin the Installation...................................................................................................................................................................... 258 Oracle TimesTen In-Memory Database .................... 281 About Silent Installs ........................................................................ 299 Installing Oracle10g Client.............................................................................................................................. 291 What Software Constitutes Oracle Client........................ 297 A Progression of Client-Server Models................................... 272 Post Installation Tasks............................................................... 284 Chapter 8: Oracle Client Software.......................................................................................................... 252 Oracle Database Vault .....................................Table of Contents Oracle Data Provider for ............................................................................ 276 Task 3: Get the Latest Security Patches ....................... 255 Installation.............................................................................................................................................................................................................................. 295 Runtime............................................................................................................................................................................................................................................................... 294 Instant Client ...................... 297 What Does “Client” Mean............................................................................................................. 292 Three Enterprise Manager Clients?.................................................................................................................................................................................................................................................................................. 280 Task 5: Backup the Server .......................................... 297 Thin-Client or Fat............................................................

..................................................... 327 RAC Factors ..................... 318 Which Windows Operating Systems are Certified to Run Oracle Server .................................................................................................................................................. RBAL........................................ Error! Bookmark not defined............................... 327 Living Large ................................................................................................................................................................................... 300 Step-By-Step Instructions ........................................................................................................................................................................................................................................................... 321 Recommended Minimum Hardware . 328 Chapter 11: The Oracle Server Architecture ............................... Error! Bookmark not defined.......................................................................... 322 Hard Disk...................................... 324 CPU .......................................................................................................... 330 ASMB........... Additional File Mapping Processes ...... 311 What is an Oracle Home................................................... 307 Un-Installing Oracle Client.......................................................................................................................... 319 System Requirements: How Low Can You Go? .............................................................................. 325 Video ........................... Error! Bookmark not defined......... 326 RAID Considerations ..... The Big Picture .............................................................................................................................................................................................................................................. 313 Why Switch Between Oracle Homes ..... 308 Mixing Versions of Oracle Client and Server ............................................................Table of Contents Who Should Install Software .......... 310 About Silent Installs .............................. 313 How To Switch Between Oracle Homes.............. 312 What is Multi-Home Oracle .............................. 322 RAM ........... 322 Video .......................................................... 317 Do You Need a Server Operating System? ..................... 323 RAID .............................................................. Error! Bookmark not defined............................................................... 310 Chapter 9: Owning Multiple Oracle Homes......................................................................................................................................... 300 Getting Patches and Critical Updates....................... 324 Production Minimums ................................. 323 Other Storage Devices .............................................................................................................................................. 336 ...............................How Big Can I Make My Server? .... 334 Instances and Services............................. 322 CPU .................................. 335 Memory Structures........................................................................................................................................................................... 312 Do Not Mix Software in an Oracle Home........................ Error! Bookmark not defined.... 314 Chapter 10: Understanding System Requirements .............................................................................................................. ARBn......................................................................................... 331 FMON...................................................................................................................................................... 324 RAM ..................................................................................................................................... 318 About UNIX Operating System Requirements................................................................................................................................................................................................................................................................................................................................................................................................................................................. FMPUTL............................. 330 Additional ASM Background Processes ............... 326 Hard Disk.................................................

............................ 365 Pnnn.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. 338 Buffer Pools ............................................................................................................................................................................................................................................................................................................................................... 357 SMON............................................................................................................... 348 The Data Dictionary Cache............................................................................................ 353 The User Session Data Area .................................................................................................... 356 When Do Background Processes Start ............................................ 361 RECO. 343 Java Pool ........................................................................ 349 Active Session History Buffer...................................................................................... 352 The Stack Space Area.............................................................................................................................................................................................. 347 Redo Log Buffer Cache ......................................................................................... 363 QMNn................................................................................................................................................................................................. 359 CKPT ............ 345 Large Pool....................... 340 Various nK Buffer Cache...................................................................................................................................... 356 The Mandatory Background Processes ........................................................ 336 System Global Area (SGA) Structures............... 350 Shared Pool Sizing and Tuning .......................................... 362 Jnnn.................................................. 347 Shared Pool .................................... 350 Fixed Area............ 353 The Sort Area ............................................................... 358 PMON.................................................................................................................................. 363 MMAN ...................... 349 Flashback Database Buffer ......................................................................................... 360 ARCn....................... 350 Streams Pool........................................................................................................................................................................................................................... 338 Database Buffer Cache ................................................................................. 341 Flashback Buffer .........................................................................................................Table of Contents Granule ........................................................................................................................................................................................................ 354 Background Processes ............................................... 363 MMON .................. 365 .......... 364 MMNL....................................................... 362 CJQn ........................................................................................ 345 Oracle Storage Management (OSM) Buffer .............................................................................................................................................................................................................. 360 LGWR ...... 358 DBWn............................................................................ 361 Snnn.................................................................................................................................................................. 348 The Library Cache ............................................................................................... 354 Allocating Memory to SGA and PGA Components .............. 352 Program Global Area (PGA) Structures................................................................................ 361 Dnnn .... 365 PSPn ................. 340 The Hit Ratio.......................................... 353 The Cursor State Area .........................................................................................................................................................................

........................................................................... 369 LMD ........................................................................................................................................................................................................................................ 378 Understanding RAID Configurations ....................................................... 367 FMON.......................................... 379 RAID 5.......................................................................................... 376 Caching ........................................................ 373 Terminology. Stripe Size........................................................................................................................................................................ 369 DIAG ............................................................................................. 375 What is RAID..................................................................................... 367 Additional File Mapping Processes ............................................................................................................................................................................... 366 ARBn...................... 374 RAID ................................... 382 RAID 1+0 (RAID 10) ...................................................................................................... 380 RAID 0+1............................................ 375 Concurrency ......................................... 373 The Importance of File Name Suffixes ................... 374 Understanding RAID Terminology and Concepts ................................................................................. 384 What Files Can Be Multiplexed ................................... 373 General Restrictions On Database Files .......................................................................................................................................... 385 ..................................................... and Chunks ........................................................... 375 Stripe Width...................................................................................................................................................................................................................................................... 368 FMPUTL.......................................................................................... 367 DMnn............. 370 GES...................... 384 What Is Multiplexing............ 366 RBAL................................................................................................... 370 LMSn............................................................................................. 369 LCKn ............................. 385 Isolating the Multiplexed Copies of Files...................... 366 Additional ASM Background Processes ........................................................................................................................................................................... 369 Additional RAC Background Processes..................................................................................................................................................... 370 GSD ................................................................... 367 DWnn........... 366 ASMB........................................................................................................... 369 LMON ................................................................................................................Table of Contents RVWR ....................................................... 367 Additional Data Pump Background Processes ....... 372 Getting Started .................................................................................... 383 Multiplexing.......................................................................................................................................................................... 379 RAID 0............ 370 GCS ............... 370 Chapter 12: The Oracle Database Files...................................................................................................................... 370 Additional RAC Foreground Processes ...................... 365 CTWR...................................................................................................................... 370 The Oracle Net Listener Process............................................................................................................................................................................................................................................................................................................................................................................. 382 Which RAID Is Right ............................................................................................................................................................................................................................................... 379 RAID 1.........................................................................

................................................................................................................................... 399 Storage Considerations ............................................................................................................................................................................................................................................................................................................................................. 396 Backup / Recovery Considerations ............................................................................................................ 397 Tempfiles .......................................................................................................................... 416 .... 401 Views ............................... 411 Purpose ................................................. 394 Quantity .. 395 Location and Naming Convention ........................................................................ 402 Location and Naming Convention ............................................................................... 408 Deleting Control Files ..................................................................................................................................................................................................................................................................... 388 Location and Naming Convention ............................................................ 402 Size ................................................................................................................................................................................................. 399 Size ....................................................... 413 Location and Naming Convention .............................. 410 Views ................. 392 Backup / Recovery Considerations ..................................................................................................... 398 Location and Naming Convention ................... 400 Backup / Recovery Considerations .............................................................................. 387 Purpose .......................................................................................................................................................................................... 409 Backup / Recovery Considerations ...................................................................................................................................................................................................... 401 Control Files ...................................... 388 Quantity ................................................... 386 Points to Remember........................................................................................................................................................................ 395 Storage Considerations ........................................................................................................................................................................................................................................................................ 411 On-Line Redo Log Files ........................................................................................................................................ 389 Size ........................................................................................................................................................................................................................ 412 Quantity . 403 Storage Considerations ........................ 390 Storage Considerations ...................................................................................................................................................................... 394 Undo Files.. 395 Size .................................................................... 386 Examples................................................................................................................................................................................................................................................................................................................................. 401 Purpose .............. 386 Datafiles........................................................................... 404 Adding More Control Files.............................. 414 Size ............................................................ 398 Purpose ................................................................................ 394 Purpose ........................................................ 393 Views ....................................... 396 Views ..... 402 Quantity ..................... 404 Creating the First Control Files............................................................................... 405 Moving and Renaming Control Files .......................................... 398 Quantity ....................................................................................................Table of Contents Moving and Renaming Database Files................................................................................................. 415 Storage Considerations ...............................................

....... 417 Archived Redo Log Files.................................................................... 420 Size ......................................................................................... 434 Background Process Trace Files ................................................................... 416 Views .......... 450 Instance Types ................................................................................................................ 424 Views ....................................... 439 What is OMF ........................................................ 433 Trace Files .......................................... 435 User Process Trace Files............................................................................. 443 OMF Naming Conventions....................... 449 Is There a Trade-Off.. 440 Configuring Your Database for OMF ........................................................... 440 Create a SPFILE................................................................................................................................................................................................................................................................................................................................... 440 Create OMF Directories ............................................................................................................................................................. 423 When To Delete Archlogs If Using LogMiner Technologies. 441 Set the OMF Initialization Parameters ................................................................ 445 Whether or Not to Use Oracle Managed Files.................................................................................................................................................... 437 Specify a File Location using CREATE DIRECTORY......................................................................... 445 Chapter 14: Automatic Storage Management (ASM)..................................................... 442 OMF File Sizes ................................................... 425 Alert Log....... 441 Changing the OMF Locations.................................................................................................................................................................................................................................. 450 ....................................... 436 Specify a File Location using UTL_FILE_DIR ............................................. 430 Server Parameter File (SPFILE) ................................ora).................... 422 Backup / Recovery Considerations .......................................................... 421 Storage Considerations ................ 418 Purpose ................................................................................................................. 436 UTL_FILE ........................................................................... 448 Overview of ASM ........ 428 Export DataPump Files.............................................................................................................. 419 Location and Naming Convention ........................................................................................................................................................................................ 426 Export Files........... 435 Core Dumps .................................................................................................................... 444 Example 2: Modifying a Tablespace................................................................................................................................................................... 440 Understanding What’s New in 10g OMF .............................................................Table of Contents Backup / Recovery Considerations ......................................................................................................................................... 443 Some Examples.................................................................................................................................... 444 Example 1: Creating a Database ................................................................................................................................... 419 Quantity ............................................................ 437 Chapter 13: Oracle Managed Files .............. 429 Initialization Parameter File (init.... 423 Retention Considerations................................................................................................ 428 Flashback Database Log Files .................................................................... 429 Password File ....................................................................................................................................................................................................................................................................................................................................

............................................................ 453 How to Create an ASM Instance..................................... 481 Configuring Oracle Net for Load Balancing..................................................... 462 Dedicated Server Bequeath Connections.................... 455 Overview of Oracle Net................. 466 How Do I Get ExtProc....... 485 Web Application Load Balancing Tips ........ora Will Oracle Use ..................................................................... Oracle Shared Servers......ora .......................................................................................................................... 462 Shared Server Connections ............................................................................................................................................................................... 474 Which Tnsnames................................................................................................................................................................................................ 471 IPC Connections..................................................... 467 Security Considerations . 452 Mirroring with ASM .................. 458 Protecting the Oracle Listener.....................................ora..................................................................................................... 453 Installing ASM.......................... 458 What is the Oracle Listener ....................................ora ......................ORA for ExtProc........ 489 ... 474 Tnsnames...................................ora and Sqlnet.............. 456 The Oracle Listener ... 453 Privileges for Creating and Maintaining ASM Instances ................... 468 Configuring the TNSNAMES........................................................... 480 Got Heterogeneous Connections? .................................................................... 459 Configuring the Oracle Listener.............................................. 464 External Procedure Calls ............................ora and Sqlnet............ora Explained......... 453 Creating ASM Instances.......................... 454 Chapter 15: Oracle Net........ 475 Configuring file Tnsnames................................. 463 Configuring Shared Servers ...........ora ......................... 462 Configuring Dispatchers ................................................................................................................................................... 473 Configuration Files................... 481 Configuring Oracle Net for Failover .... 487 Configuring File Listener........................................................................ 476 Listener Entries in Tnsnames........................................................................................................................................................................................................ 460 Common Listener Error Messages ..... 453 Don’t Cook It ................... 466 What is ExtProc.......................................................... 467 Got Multiple Oracle Homes? ............................................................................................................................................................................................. 464 When to Use................................................................................ 486 Configuring File Sqlnet.................................................................................................................... 452 About ASM Instance Failures............................................................................................................ 468 Configuring the Oracle Listener for ExtProc...................................................................................................................................................................................................................................................................................... 460 What Are Dedicated and Shared Servers......................................................................................... 470 Bequeath Connections ........ 479 IFILE Entries in Tnsnames................................... or Not Use.......... 451 Do You Need Multiple Disk Groups...........................................................................Table of Contents About Disk Groups and Failure Groups. 461 Dedicated Server Redirect Connections ..................................................................................................................................................................................... 456 A Typical Configuration............................................................................................................................................................................................................................ora .....................................

........................................................................................................................ 491 When Does Listener............................. 504 Configuring SSL Per-Instance .......................................................................................... 492 What’s New in File Listener.......................................... 490 Interpreting Listener....................................................ora ............................................................................. 519 The Editions of Windows Server 2003....................................................... 516 How To Determine If You Have 32-Bit or 64-Bit Windows ...ora ....................................... 509 On the Windows Platform ................................................ 516 Microsoft Vista Compatibility Notes ........... 500 The Oracle Advanced Security Option (ASO) .....................................................................ora........ 512 Chapter 16: Windows Issues ........................ 519 The History of Windows Server 2003................... 489 How to Configure Listener.............................................................. 518 Getting Oracle 10g for Vista................................................................................................................... 522 Prepare Your Database ........................... 497 The Listener Control Utility ...................................................................................................................................... 500 Automating LSNRCTL STOP at System Shutdown ............................................... 501 ASO Network Encryption ............................................................ 528 ..........................................................................Table of Contents What is Listener.. 527 CPU .............................................................. 496 External Naming ........................................................................ora..... 515 General 64-bit Compatibility Notes .......................................................................... 518 All About Microsoft Windows Server 2003.............................................................................................................................................................. 527 RAM.................................................................................................................................................................. 495 Local Naming.................................................................................................. 502 ASO Data Integrity .................. 525 File System Limitations................................................................................................................................................................ 524 Test and Back-Out As Needed ................................... 521 Maximizing The Process Size ...................................................................................................................................................................................................................................................................... and Where is It ..........................ora Need DESCRIPTION_LIST ........................................................................................................................................ 490 Naming the Listener ....................................................................................................... 492 Log and Trace Files............. 517 What Is Not Supported on Vista ................................................................................................ 491 Securing the Oracle Listener.................................................................................................................................................................................................................................. 497 Automating LSNRCTL START at System Startup ............. 514 Operating System Compatibility.................................... 503 ASO Secure Socket Layer (SSL) Support........................... 494 Naming Methods.......................................... 495 Directory Naming.... 525 Operating System Limitations ......... 508 On the UNIX Platform........................................................................................... 520 Windows Server 2003 Compatibility Notes ................ 496 Easy Connect Naming ................................................................................................................ 493 Port Numbers ................................................ 511 Using SSL with JDBC Connections.... 522 Maximizing The Database Buffer Cache......................................................... 523 Prepare The Operating System..........................................................................

................................................................. 538 Oracle<HomeName>TNS<ListenerName> ........................................................................................................................................................................ 537 Oracle<HomeName>SNMPPeerEncapsulator .... 543 DATA_PUMP_DIR ............................................................................................................................................................................................. 542 General Oracle Server Registry Settings .................................................................................................................................................................. 531 Introduction to Windows Services ............................................................................................................................................................................................. 550 ................................................. 544 NLS_LANG ... 529 Processes & Threads ......................................................................................... 541 The Windows Registry.................................. 545 NLS_DATE_FORMAT..................................Table of Contents Installing 4 GB Might Not Give You 4 GB............. 541 Overview............................ 546 ORA_CWD ....... 533 OracleCCService ............................................................................................... 549 ORA_<SID>_SHUTDOWN ................................................................................. 546 ORA_<SID>_ AUTOSTART.................................... 549 ORA_<SID>_SHUTDOWNTYPE........................................................ 547 ORA_<SID>_LPENABLE.................................................................................................................................................. 534 OracleCRService ................................................................................................................................................... 549 ORA_TZFILE .. Disabled ................ 539 Oracle<HomeName>ProcessManager ................ Manual........................................................... 544 Pitfalls with NLS_LANG .......................................................................... 537 Oracle<HomeName>iSQL*Plus............................................ 535 OracleMTSRecoveryService................ 548 ORA_<SID>_PWFILE...... 536 Oracle<HomeName>ClrAgent ....................................................................................... 535 OracleEVMService.............. 544 MSTOOLS_HELP .............................................................................. 538 Oracle<HomeName>SNMPPeerMasterAgent ............................................... 532 Oracle’s Services.................................. 540 OracleService<SID>................................................................................................................................. 549 ORA_<SID>_SHUTDOWN_TIMEOUT ............................................................... 540 Oracle<HomeName>ClrAgent ................... 530 Services.............. 536 Oracle<HomeName>CMan ........................................ 535 OracleJobScheduler<SID> ............................................................................................................... 536 Oracle<HomeName>CMAdmin .... 547 ORA_<SID>_LPSIZE................................................................................................................................................................................................................................................... 534 OracleCSService ............. 546 OO4O (oh-oh-four-oh) ................................ 547 ORA_<SID>_PFILE .......................................................... 531 Service Status: Automatic...................................................... 533 OracleClusterVolumeService.............................................................................................................................................................................................. 550 ORACLE_AFFINITY ...................................................... 534 OracleDBConsole<SID> .................................................................................................................................................................................................................................................................................... 546 OLEDB ................................................................................................................................................................................................................................

................... 565 Using SQL*Plus to Shutdown the Database...................................................................................................Table of Contents ORACLE_BASE................................................................................. 556 ORAMTS_OSCREDS_MATCH_LEVEL................................. 552 ORACLE_SID ................................................................................................................................................................................... 557 Other Environment Variables .......................... 573 Operating System Requirements.... 554 TNS_ADMIN............................................................................ 555 Registry Keys for Microsoft Transaction Server (MTS)....................................................................................................................................... 571 Installing One-Off Patches .............. 552 OSAUTH_PREFIX_DOMAIN ....................................................... 551 ORACLE_HOME_KEY ..................................................... 573 The “oracle” User and “dba” Group Accounts............................................................... 565 Using SQL*Plus to Startup the Database .............................................. 552 OSAUTH_ENFORCE_STRICT........................................................................................................................................................................................................................................ 568 Chapter 17: Using Oracle 10g on Sun Solaris ..................................... 571 The Relationship Between Oracle and Sun ........ 558 LD_LIBRARY_PATH...... 559 PATH......................................................................................................................... 556 ORAMTS_NET_CACHE_MAXFREE ............................................. 553 RDBMS_CONTROL .................................................................................................................................................. 552 ORACLE_PRIORITY............................................................................................... 576 ........................................... 558 LOCAL (OBSOLETE)............................................................................................................ 551 ORACLE_HOME ................................................................................................................................................................................. 556 ORAMTS_SESS_TXNTIMETOLIVE ......................................... 559 ORACLE_HOME (NOT RECOMMENDED).......... 553 SQLPATH.................................................... 560 ORADIM ................................................................................................................................................................................................................................................................................................................. 551 ORACLE_HOME_NAME .......................... 557 Registry Keys for RAC...................................................................................................................................................... 566 Setting Processor Priority .................. 553 OSAUTH_X509_NAME.............................................. 557 Oracle Client Registry Settings........................................... 560 TNS_ADMIN...................................................................................................................................................................................................................................................................................................................... 556 ORAMTS_NET_CACHE_TIMEOUT .................................................................. 563 Windows Services .................................................................................................................. 554 WaitToKillAppTimeout................................................................................. 558 CLASSPATH........................................................ 550 ORACLE_GROUP_NAME ........................................................ 556 ORAMTS_CONN_POOL_TIMEOUT................................................................. 561 The Undocumented “EX” Parameter ..... 574 Shells ........................................... 564 Net Start and Net Stop............................... 553 RDBMS_ARCHIVE ................................ 566 Setting Processor Affinity .................................................................................................................. 562 Starting and Stopping Oracle Server on Windows ...........

...................... 584 Shared Memory Parameters............................................................................................... 577 Permissions as Three Digit Numbers ........................................................................................................................ 587 Miscellaneous Kernel Parameters .................................................... 585 shmsys:shminfo_shmseg ...................................................... 584 Kernel Parameters for Solaris 9 and Earlier ............ 598 Search and Replace Operations..... 577 Setting and Permissions and Owners ..................................... 598 Cut and Paste Commands .......................... 604 ................................................................................. 587 noexec_user_stack......................................... 581 Sample C Shell Profile for Oracle Client ................... 578 User Profiles .............. 585 shmsys:shminfo_shmmin............................................................................................................................... 597 Cursor Movement Operations............................................................................................................................. 579 Commonly Used Environment Variables..................................................................................... 580 Sample Korn Shell Profile for Oracle Server ....................................... 586 semsys:seminfo_semmni ............................................................. 599 Miscellaneous Operations........... 601 Selecting the Hardware.............................................................................................................................. 592 Helpful UNIX Commands................ 586 semsys:seminfo_semmsl.......................................................................................................................................................................................................................................................................... 586 semsys:seminfo_semmns...................... 590 Launching the Oracle Universal Installer on Solaris .................................................... 601 Planning the File System ............................................................................................... 600 Building a New Solaris 10 (SPARC) Server ....................................................................................... 588 Registering Port Numbers ................................................................................. 603 Plan Your Directory Structure ................................................................................................... 585 shmsys:shminfo_shmmax ......................................................................................................... 588 Sample Kernel Parameter Entries ......................................................................................................................................................................................... 585 shmsys:shminfo_shmmni............................................................................................................................................................ 578 Four Digit Permissions ............. 586 semsys:seminfo_semmnu ............................................................................................... 595 Tips for Using VI ................................. 587 semsys:seminfo_semume....................................................................................... 602 System Partitions .......................................... 599 Exiting VI ............................................... 583 Semaphores........................................................................................................................................................................................................ 588 Resource Controls for Solaris 10 .................................... 593 Projects Commands ............................. 601 About the T2000 Server................... 585 Semaphore Parameters ...................................................................Table of Contents Permissions ............................................. 586 semsys:seminfo_semmap.................................................................................................................................................................................................................................................................... 603 Application Partitions .............................................................................................................................................................................................................................................................................................................. 591 Installing One-Off Patches ............................................................................... 582 Got Graphics ...........

................................................................................................................................................................................................................................ 606 Installing the Operating System............................................................................................ 629 Maintaining Parameters in a SPFILE ................................. 626 Strings............................................................................................................ Oh My! ... 608 Pre-Oracle Installation Punch List ....................... 616 Steps for Installing Oracle Database 10g......................... 631 ......................................... 607 Set Miscellaneous Kernel Parameters ................................................... 608 The Alternative............................................................................... 621 Steps for Installing Oracle Patchsets ................................................................. 619 Steps for Installing Oracle Companion Software............................................................................ 613 Troubleshooting the Project ..................................................................................... 609 Create File Systems for Oracle................................................ 626 Knowing When a Parameter Can Be Modified ........................................... 607 Verify Network Settings ............................................................................................................... 630 The COMMENT Clause ........................................................................................................................ 615 Login as Oracle and Optionally Set the Password ................................................................................................ 606 Post-Operating System Installation Punch List ...... 630 The SCOPE Clause..................................................................................................................................................................... Numbers............................. 624 What is an Initialization Parameter ............................................................................................................................................... 622 Create a Database ............................ 629 Maintaining Parameters in a PFILE ................ 630 Overriding SPFILE Values at Startup ............................................... 621 Post-Patchset Security Issues .......................................................... 609 Create the Oracle Installation Group (Optional) .......................................................................... 630 The SID Clause ................................................... 629 The Parameter Clause ............................................ 609 Create the OSDBA Group .................................. 615 Setup the Oracle User’s Environment .........................................................................................Table of Contents To RAID or Not to RAID ...................................................................................................................................................................................... Booleans............................... 610 Create the Oracle Operator Group (Optional).................................... 608 Enable Auto-Mounting of the CD/DVD Drive ........................................... 623 Chapter 18: Initialization Parameters........................................................................... 619 Post Installation Considerations........ 611 Create the Oracle User......................................................................... 609 Verify Sun Packages Required by Oracle....................................................................................................................... 627 Initialization Parameter Files and Server Parameter Files ................................... 631 Working with Hidden Parameters .... 631 Removing Parameters from the SPFILE ....................................................................................................... 605 Gathering Installer-Required Facts Before You Begin ........ 620 Installing Oracle 10g R2 Patchset Software ......................................................................................................................................................................... 606 Pick the Installation Media .... 616 Installing Oracle 10g Companion Software..................................................... 615 Installing the Oracle Database 10g Software................... 613 Enable and Activate the Project ...... 611 Create the Oracle Project ....... 625 Tuning Parameters.......

............................................................................................................................................................................................................................................................................................................... 643 LOCK_SGA..................................................... 649 PGA_AGGREGATE_TARGET................................................................................................... 654 AUDIT_SYSLOG_LEVEL ......................................................................................................................................................................... 652 Security Parameters............................................................................................................................................................ 651 SORT_AREA_RETAINED_SIZE............................... 634 Viewing Initialization Parameters in OEM Database Control.......................................................................................... 636 Database Naming Parameters .................................................................................................. 653 AUDIT_SYS_OPERATIONS .......... 640 DB_CACHE_ADVICE ..............Table of Contents More Information ..................................................... 637 DB_NAME ..................... 654 O7_DICTIONARY_ACCESSIBILITY ........................................................................................................................... 649 PGA Sizing Parameters ............................................................... 632 Displaying Initialization Parameters and Values ................................................................................................. 636 The Initialization Parameters ...................... 635 Viewing Hidden Initialization Parameters........................................................... 638 INSTANCE_NAME...................................................................................................................................................................................................................... 638 SGA Sizing Parameters .............................. 638 SERVICE_NAMES............................ 638 RDBMS_SERVER_DN ..................................................................................................... 644 SGA_MAX_SIZE .............................................................. 641 DB_CACHE_SIZE................................................................................................................. 632 View V$SYSTEM_PARAMETER ................................. 653 _TRACE_FILES_PUBLIC.............. 654 AUDIT_TRAIL... 637 DB_UNIQUE_NAME................................................ 633 View V$SPPARAMETER .................................................. 648 USE_INDIRECT_DATA_BUFFERS.................................................................................................................................................... 633 V$PARAMETER_VALID_VALUES......................................................................................................... 633 View V$PARAMETER ........................................................................................................ 651 SORT_AREA_SIZE.................................................... 655 .... 653 AUDIT_FILE_DEST ........................... 632 Using the SQL*Plus SHOW Command to Inspect Parameters.................................................. 639 DB_BLOCK_BUFFERS ...................................................................................................... 649 WORKAREA_SIZE_POLICY................................................................................................................................................................................................................................. 642 JAVA_POOL_SIZE ...................................... 644 SGA_TARGET ....................................................... 634 Special Views for NLS Parameters.......................... 645 SHARED_POOL_SIZE............................................................................................................................................................... 637 DB_DOMAIN..... 643 LARGE_POOL_SIZE ...................................................................................................... 642 DB_NK_CACHE_SIZE ......................... 635 Are You Using Obsolete Parameters?................. 646 SHARED_POOL_RESERVED_SIZE.............. 647 STREAMS_POOL_SIZE ..........................................................................................................

....1 Databases.................................................................. 673 Location Parameters .................................... 658 REMOTE_OS_AUTHENT ......................................................................................................................... 671 SESSION_CACHED_CURSORS ............ 659 General / Miscellaneous Parameters ................................................1 Databases....................................................................................................... 656 REMOTE_LOGIN_PASSWORDFILE ...................... 659 REMOTE_OS_ROLES .... 657 Oracle 10........................... 663 DB_BLOCK_SIZE................................................................................................................................................................. 664 DB_FILES .......................................................................................2 Databases.......................................................................................................... 674 CONTROL_FILES....... 672 SESSIONS .............. 662 Oracle 10.......................................................................................................................................................... 660 CURSOR_SHARING................................ 667 JOB_QUEUE_PROCESSES ..................................... 667 LOCAL_LISTENER .... 674 AUDIT_FILE_DEST .............................................................................................................................. 662 DB_BLOCK_CHECKSUM ........................................................................................................ 662 Oracle 10...................................................... 674 BACKGROUND_DUMP_DEST .......................................................................................2 Databases..................................................................................................................................................................................................... 666 INSTANCE_TYPE . 666 GLOBAL_NAMES ........................................................................................ 665 DBWR_IO_SLAVES ................................................................ 675 CORE_DUMP_DEST ...................................................................................................................................................................................................................................Table of Contents OS_AUTHENT_PREFIX...........................................................................................................................2 Databases................................................................................... 668 PROCESSES..................................................................................................................... 660 COMPATIBLE ...................................................................... 676 USER_DUMP_DEST...................................... 657 Oracle 10............................................................... 671 RESOURCE_MANAGER_PLAN........................ 659 CLUSTER_DATABASE ....................................1 Databases............................................................................................................ 669 RECYCLEBIN..................................... 661 DB_BLOCK_CHECKING....................... 662 Oracle 10................................................................................................................................................................... 656 OS_ROLES ................................... 671 SESSION_MAX_OPEN_FILES ................................................................................................ 673 TRACE_ENABLED .............. 670 RESOURCE_LIMIT ......................................................................................................................................................................... 676 ....................................................................... 663 DB_FILE_MULTIBLOCK_READ_COUNT .................... 662 Oracle 10..................................................................................................................................................................................................................................... 673 TRANSACTIONS..................... 668 OPEN_CURSORS ................................................................................................................................................. 672 SPFILE........... 665 DB_WRITER_PROCESSES......................................... 659 _RECYCLEBIN.......................... 670 REMOTE_LISTENER .................

................................................................................................................................. 690 SHARED_SERVERS.................................................................................................... 679 LOG_CHECKPOINTS_TO_ALERT .............................................................. 686 Shared Server Parameters ................................ 698 LOG_ARCHIVE_DUPLEX_DEST .................. 677 LOG_BUFFER........................................................................................................................................................................ 705 LOG_ARCHIVE_TRACE ............................................................................................................................................................... 691 DB_RECOVERY_FILE_DEST ..................................................... 678 LOG_CHECKPOINT_INTERVAL.......Table of Contents UTL_FILE_DIR........ 684 UNDO_TABLESPACE.............................................................. 682 TIMED_OS_STATISTICS........................................................................................................................................................................................................................................................... 687 CIRCUITS ............................. 679 LOG_CHECKPOINT_TIMEOUT..2 Behavior ............................................................................................................................ 685 Materialized View Parameters .......... 677 Redo Log Parameters ............. 680 OPTIMIZER_MODE ..................................... 703 LOG_ARCHIVE_MAX_PROCESSES ................ 706 ................................................................................. 686 QUERY_REWRITE_INTEGRITY ........................................................................... 698 Alternate and Spill Over Destinations for Archlogs......................................... 693 FAST_START_PARALLEL_ROLLBACK .................... 705 LOG_ARCHIVE_START ................................................................................................................................................................................................................... 691 DB_FLASHBACK_RETENTION_TARGET ..................................... 677 10............................................ 687 MAX_DISPATCHERS ......... 687 DISPATCHERS ........................................................................................................................................................................................................ 688 MAX_SHARED_SERVERS............................................................................ 677 10........................................... 690 Backup and Recovery Parameters........................................ 693 FAST_START_MTTR_TARGET...................................................................................................................................................................... 684 UNDO_RETENTION ........................................................... 703 LOG_ARCHIVE_FORMAT ...................... 697 LOG_ARCHIVE_DEST_STATE_N............................................................................ 692 DB_RECOVERY_FILE_DEST_SIZE ............................. 680 OPTIMIZER_DYNAMIC_SAMPLING............................. 683 Undo Parameters ............................................................ 684 UNDO_MANAGEMENT ......................................................................... 705 LOG_ARCHIVE_MIN_SUCCEED_DEST....................................................................................... 680 Optimizer and Statistics Parameters................................................ 681 STATISTICS_LEVEL ....................................................................................................................................................................................................... 695 LOG_ARCHIVE_DEST_N....................................................... 686 QUERY_REWRITE_ENABLED............................................................................................................... 696 Important note regarding LOG_ARCHIVE_DEST_10 ...................................................................... 683 TIMED_STATISTICS ... 695 LOG_ARCHIVE_DEST .......................1 Behavior .................................... 689 SHARED_SERVER_SESSIONS ....................................

........................................................................................................................................... 725 SYS....................................................................................................................................................................................... 720 CTXSYS................................................. 707 ASM_DISKGROUPS..................................................................................... 707 ASM Parameters ......................................................................................................................... 708 ASM_POWER_LIMIT...................................Table of Contents REMOTE_ARCHIVE_ENABLE ............................................................. 724 OUTLN............................................................................................................................................................................... 724 SCOTT ............................................................................................................. 716 SPFILEs and Automatic Shared Memory Management ....................................................... 723 OLAPSYS................................................................................................................................................................................................................................................................................................................................................................................................................................................ 711 When to Use a SPFILE................................. 723 MDSYS ................................................................................. 714 Updating a SPFILE ..... 716 The Asterisk........................................... 708 ASM_DISKSTRING.. 711 Why Not Use a SPFILE ...................................................................................................... 712 Where to Put Your SPFILE ..................................................................................................................................................................... 723 ORDSYS ............................ 720 DIP ................................................................................................................................................................................. 714 Creating a SPFILE ................ 706 DB_CREATE_ONLINE_LOG_DEST_N ..... 708 Chapter 19: The Server Parameter File (SPFILE) ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ 717 Chapter 20: Oracle’s Pre-Installed Schemas ....................................................................................................................................................................................... 726 WMSYS.............................................................. 710 RAC Attack .............................................. 726 TSMSYS............... 716 Backing up the SPFILE ...................................................................................................................... 713 Naming Conventions for SPFILEs................................. 726 XDB ......................................................................................................................... 722 MDDATA.............. 723 ORDPLUGINS ................... 725 SYSMAN............................................................................... 727 .................................................................................................................. 719 ANONYMOUS................................................................................................................................................................ 721 DBSNMP........................................ 722 DMSYS . 715 Deleting a SPFILE .............................................................. 725 SYSTEM .................... 722 LBACSYS ........................................................................................................................................................... 706 DB_CREATE_FILE_DEST ...................................................................................................... 721 DIP ...................................................................................................... 724 SI_INFORMTN_SCHEMA ........... 709 What is a SPFILE................................................................................................................................................................ 706 OMF Parameters ............

.................................................................. 763 The UNDO TABLESPACE Clause ................ 752 Deploying PFILE and SPFILE While Creating a Database .................................................. 755 A Very Simple Example to Get You Moving...................................................................................................................... 731 Plan the Installation ..... 744 Create a Windows Service Using ORADIM .... 731 The Process from 30.................................................................................................................................................................. 739 Directories for Oracle Archived Redo Log Files ............. 767 ............................................................................. 736 Directories for Oracle Database Admin Files ... 730 The Tools of My Trade.......................... 748 Create a Password File Using ORAPWD .............................................. 751 Deploy your Initialization Parameter File ........ 757 The USER SYSTEM Clause......... 730 The Process.............................................................................. 746 Calling ORADIM While Creating a Database..................................................................................Table of Contents Chapter 21: Creating Oracle10g Databases by Hand............................................... 737 Directories for Oracle Database Files.... 743 Managing and Deleting Archlogs............... 763 The CHARACTER SET Clause ..... 758 The FORCE LOGGING Clause.............................................................. 733 Scripting the Process .... 759 The DEFAULT TEMPORARY TABLESPACE Clause ......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................... 735 Directories for Oracle COTS Software ....................................................................................................................... 763 The SET DEFAULT BIGFILE/SMALLFILE TABLESPACE Clause ...................................................................................................................... 742 The RAID Effect .........................000 Feet....... 753 The CREATE DATABASE Command ................................................................................. 765 The NATIONAL CHARACTER SET Clause....... 743 Compressing Archlogs to Save Space ......................................................................... 743 Directories for Oracle Recovery Files ................ 757 The USER SYS Clause................................................... 732 Configure the Server................... 740 Using Multiple Archiver Destinations........................................................................................................................ 757 Database Name............................ 761 The LOGFILE Clause.................... 732 Create the Database ................. 752 Where to Put Your PFILE or SPFILE.................................................................................................. 762 The FORCE LOGGING Clause.................................... 758 The DATAFILE Clause................................................................................................................................. 734 Plan and Create the Necessary Directories........................................................................................................................................................................................................................ 728 Why I Don’t Like Using Wizards to Create Databases............................................................. 755 Components of the CREATE DATABASE Command .......... 729 When to Use a Wizard............................ 760 The SYSAUX DATAFILE Clause ... 758 The DEFAULT TABLESPACE Clause................................................................... 749 Calling ORAPWD While Creating a Database...............................................................................................000 Feet........................................................................................... 731 The Process from 10.......................................

.............................................................. 780 Pre-Requires to Installing XML DB In Your Database............................. 783 Configuring OEM Database Control..................................................2.......................................................................... 769 Example 1: Simple Form .............................. Gather the Facts.................................... 780 The Installation Process ......................... 795 The Floppy Drive Bug for Windows Users .......................................................................................................................................Table of Contents The ARCHIVELOG Clause.................................................................................. Disable Unlicensed Functionality ............................................................................................................................ 782 Final Points on Installing XML DB ...................................................... 775 Before You Begin........ Understand Your Options...................... 788 Fourth............................... 781 Tips for Windows 2003 SP1 Users ................................................................. 769 Control Files.. 795 Troubleshooting Database Control Setup............................ 786 Manually Configuring Database Control in Oracle 10........................................................ 779 Install Oracle XML DB .............................. 790 Removing Database Control ............................................................................................................. 778 Install the Oracle Java Virtual Machine (JVM) ........................................................................................................................................................... 769 Example 2: With Some Details ...... 799 What is the DBCA ......................... 785 Third.............................. 768 The MAXLOGMEMBERS Clause............................................................ 784 First......... 801 ................................................................................................... 791 Removing Database Control in Oracle 10g Release 1 ....... 769 Examples.................................................................................. 792 Database Control Port Numbers............................................................ 776 Create the Data Dictionary ........... 791 Removing Database Control in Oracle 10g Release 2 .................................. 768 The MAXLOGFILES Clause ..................... 798 Chapter 22: Creating Oracle 10g Databases by Wizard.................... 773 What Catalogs Are There / Which Ones Do I Need .................................................................................................................................................................................................................................................. Define A Few Variables .................................................... 800 Capture scripts for creating databases ............ 781 Installing XML DB In Your Database........................... 790 Some Post-Configuration Thoughts ........................ 786 Manually Configuring Database Control in Oracle 10... 770 Example 3: Enough Detail to Hurt Your Head .......... 777 Install SQL*Plus Extensions........................................................................................................................ 796 Connecting Database Control to Multiple Databases at Once......................................1.......................................................................................................................... 783 Oracle Spatial........ 800 What Do I Do with the DBCA............................................................................................................................................................................................... 784 Second.... Manually Configure OEM Database Control........................................................................ 793 Administrators and Super Administrators ..................................................................................................................................................................................... 801 Configure Database Options .................. 778 Install Oracle Text ........................................................................................... 770 Creating Directories on the Fly....................................................................................................................... 773 Installing the Catalogs .................................................. 793 Auto-Starting the Database Control Process ..

......shut it down first.......................... 819 Unset the Windows Wallpaper ............................................................................................................................................................................................................................. 837 Using ORADIM to Startup Oracle............ 802 Using the DBCA to Create a Database Template ......................................................... 831 STARTUP EXCLUSIVE ............................. 839 RAC Startup Notes........................................ 826 Startup Options .............................................................................................................. 815 Pitfalls of the DBCA .................................................................................................................................Table of Contents Launching the DBCA....................................... 818 Disable CPU-Intensive Screen Savers .... 839 ORA-01031: insufficient privileges ........ 819 Disable Windows Active Desktop ........................................................................................................................................................... 836 ALTER DATABASE OPEN................................... 833 STARTUP RESTRICT.... 828 STARTUP NOMOUNT ........................................................................................................................................................................................................................................................ 835 STARTUP PARALLEL (OBSOLETE)..................................................................................................... a Full Example.......................................................... 841 ........... 822 What Does Starting the Database Do............................................................................................................ 840 ORA-01507: database not mounted ...................................... 825 Automating Startup ....................................................................................... 801 Using the DBCA to Create a New Database from Scratch ....................................... 823 The Startup Process.................................. 830 STARTUP................... 815 Using the DBCA to Create a New Database from a Template............................ 820 Adjust Your Anti-Virus Software ........................ 825 Automating Startup on Windows.................................................................... 816 Chapter 23: Polishing Your Windows Database Server .................................. 825 Other Pre-Requisites .................................................................................................. 840 ORA-01081: cannot start already-running ORACLE ........ 832 STARTUP FORCE ... 836 About Restricted Session.................................................................................... 840 ORA-01033: ORACLE initialization or shutdown in progress ......................................................................... 840 ORA-01034: ORACLE not available............................................................................. 820 Adjust Your Windows Registry Keys ............................................. 824 Permissions ......................................................................................................................................................... 826 Automating Startup on Solaris....................................................................................................................................................................................... 839 Startup Errors.................................................................................................................................................................................................................... hostdef extension doesn't exist.. 838 Using RMAN to Startup Oracle................................................................................................................................. 835 ALTER DATABASE MOUNT...................................................................................................................................................... 833 STARTUP MIGRATE .. 823 Tools of the Trade ........... 821 Chapter 24: Database Startup ....................................................................................................................................................... 839 ORA-01041: internal error.................................................................................................................................................................... 829 STARTUP MOUNT......................... 838 Startup Triggers................................. 834 STARTUP UPGRADE..........

.................................................................................................... 860 GATHER_DATABASE_STATS ............................................ 861 GATHER_SCHEMA_STATS.... 841 ORA-12514: TNS:listener does not currently know of service requested in connect descriptor.......................... 847 SHUTDOWN IMMEDIATE................................ 842 Chapter 25: Database Shutdown................. 847 SHUTDOWN ABORT.................................................................................................................................................................................................................................................................................... 851 What is the Recycle Bin . 844 Tools of the Trade ....................................................................................................... 855 Chapter 27: Optimizer Statistics .............................................. 863 .................................................................................. 852 Enable / Disable the Recycle Bin...................................... 846 SHUTDOWN....................... 861 GATHER_TABLE_STATS ..................................... 850 Chapter 26: The Recycle Bin........................ 849 Using RMAN to Shutdown Oracle ..................................... 849 Shutdown Triggers .................................................... 847 SHUTDOWN TRANSACTIONAL [LOCAL] .............. 857 Making it Work............Table of Contents ORA-01219: database not open: queries allowed on fixed tables/views only ...................................................................................................................................... 850 RAC Shutdown Notes .......................................... ........................................................................................................................................................................................................................ 843 What Does Shutting Down the Database Do...................................................................... 844 Permissions .............................................. 842 ORA-12560: TNS:protocol adapter error.................................................................................... 841 ORA-12528: TNS:listener: all appropriate instances are blocking new connections .......................... 859 Manual Collection of Statistics on Application Tables................................................................................................................................................................................................................................................................ 857 What Are Statistics History ........ 862 GATHER_INDEX_STATS................................................................................................................ 859 Privileges ......................................................................................................................................................................................................................................................................................................................................................................... 854 Restrictions on the Recycle Bin .................... 846 Shutdown Options..................................................................................................................... 853 Oracle 10g Release 2 ...... 858 Installation and Configuration Issues ............................................................ 844 Other Pre-Requisites .............................................................................................................. 853 Clearing the Recycle Bin.......................................................................................................................................................................................... 848 ALTER DATABASE CLOSE........ 852 Oracle 10g Release 1 .................................................................................................................................................................... 848 Using ORADIM to Shutdown Oracle ............................... 846 SHUTDOWN NORMAL ................................................................................................................................. 853 Restoring Tables From the Recycle Bin.................. 845 Automating Shutdown......................................................................... 859 Automatic Statistics Collection for Application Tables............................................................... 856 What Are Statistics....................................................

............................................... 870 Determining When Statistics are Missing .................................. 866 DEGREE............................................................................... 879 Storage Requirements for the AWR............... 884 Specifying the Flush Level ...................................................................................... 876 How do I know if my database has a job to gather statistics? ................................................................................................ 876 How do I disable automatic statistics collection? ................................................................................................................ 872 Using FORCE to Override the Lock .......................................................................................................Table of Contents GATHER_DICTIONARY_STATS........................................................................................... 867 CASCADE..................................................................................................................................................................................................................... 864 OPTIONS............ 880 Privileges .......................................................................................................................................... 883 Creating AWR Snapshots ................................................. 876 How does automatic statistics collection relate to Oracle 8i and 9i? .................... 879 How AWR Works ................ 876 What if the maintenance window closes before the job ends? ........................................................ 880 Manually Managing AWR Statistics.................................................................................................................................... 886 Creating a (STATSPACK-Like) Statistics Report.............................................. 864 Default Parameter Values .................................................................................................... 865 METHOD_OPT .... 876 When does the maintenance window open? ................................................................................................................................. 876 How do I resume automatic statistics collection after disabling it?.... 876 When does job run to collect statistics?................................................................................................................................................. 878 Overview ..................... 880 Altering AWR’s Default Collection and Retention Periods............................................................................... 885 Dropping AWR Snapshots..................................................................................................................................... 887 ........................................... 874 Default Statistics Values........................................................................................ 865 ESTIMATE_PERCENT........................................................... 868 NO_INVALIDATE............................................ 869 Dynamic (Real) Tables ................................................................................................................................................................. 881 Creating AWR Baselines ............................................. 868 Gathering Statistics on Dictionary Tables ....................... 863 GATHER_SYSTEM_STATS ............. 869 Fixed Object................................................................................................................................... 882 Dropping AWR Baselines ..................................... 867 GRANULARITY .................................. 877 What Happened to the Rule Based Optimizer ............................................ 875 FAQs .......................................................................................................................................................................................................... 873 About Histograms ............................ 876 Does Automatic Optimizer Statistics Collection use the AWR?............................................................. 872 Dynamic Sampling of Statistics............ 885 Comparing Baselines................................................................................................................................................................................................................................. 870 Locking Statistics in Place............. 876 Which initialization parameters should I focus on? ........................................................................................................ 877 Chapter 28: Automatic Workload Repository (AWR).................... 879 AWR Versus STATSPACK ...............................

............................................................................................................... 893 Disabling Flashback Database ............................................................................................................. 916 Database Users with Host Managed Password .................................................................................................................................................................................................................................... 892 Flashback Database System Requirements.......... 898 A Few Tips for Flashback Drop................................................................................................................................................................................................ 894 Monitoring Flashback Database Storage Issues................................................... 890 Permissions Required for Using Oracle Flashback.. 887 DBA_HIST_BASELINE........................................................................................... 909 Schemas .................................................................................................................. 903 Restrictions and Limitations ............................................................. 888 Chapter 29: Oracle Flashback........ 917 Enterprise Database Users .................. 905 Oracle Flashback Versions Query................................................................................................................................................ 904 Oracle Flashback Query .......... 916 Database Users with Database Managed Password ......................................................................................................................... 920 Plain Vanilla.................................................Table of Contents Views for Monitoring AWR Snapshots .................................. 896 Oracle Flashback Drop..... 887 DBA_HIST_SNAPSHOT ............................................................................................................................................................ 910 Are Application Schemas the Same as User Schemas ................................................................ 887 DBA_HIST_WR_CONTROL ................................................................................ 911 Case Matters.............................................................................................................................................................................................................................................................................................................................................................................. 900 Restrictions and Limitations for Flashback Drop .. 904 Oracle Flashback Transaction Query .......................................................... 920 .................. 906 Chapter 30: Database Security............................................................................ 915 Types of User Accounts ................................................................................ 897 Enabling and Disabling Flashback Drop ........................................................................................... 889 What is Oracle Flashback ............... 902 Flashing Back Related Data..... 900 Implications of Dropping a Tablespace......................................................... 908 Introduction to Database Security........................................................................................................................... 914 Dropping Schemas ..................................................................................... 910 Creating and Maintaining Schemas............................................................................................................................................................. 919 Sample CREATE USER Commands ........................................... 919 Schemaless Enterprise Database Users ........... 901 Oracle Flashback Table .............. 891 Oracle Flashback Database........................................... 915 Ghost Accounts ............................................................................ 892 Enabling Flashback Database ................................................ 909 Schemas are Swim Lanes ........................................................................................................ 894 Using Flashback Database ..................................................................................................................................................................................................... 909 What is a Schema ..... 896 RAC Considerations for Oracle Flashback Database.... 897 Using Flashback Drop ........................................................ 915 Users.......

....................................................................................................................................................... 932 DBA_COL_TAB_PRIVS_RECD............................................ 921 Create a User with an Old Password ............................................................................... 940 Are Roles the Same as User Groups ............................................................................................................................................ 923 Privileges ........ 938 EXECUTE_CATALOG_ROLE ...... 923 Password Verification Functions .................................................................... 928 The WITH GRANT OPTION Clause ......................................... 940 Roles Past........................................................................................................................................................................... and Future.................................................................................. 942 ROLE_SYS_PRIVS ..................... 932 DBA_COL_PRIVS ............................................................................................................... 930 Privileges Needed to Query the Data Dictionary................................................. 933 What Are Roles ............ and Dropping Roles .................... 938 DELETE_CATALOG_ROLE ............ 936 CONNECT............................................................................................................................................................. 939 RECOVERY_CATALOG_OWNER...................................................................................................................................... Present............................. 934 Creating. 933 Quick Tips for Using Roles ................................................................................ 933 Roles................... 941 Views for Managing Roles ........... 931 Views for Managing Privileges................................................................................................................ 937 RESOURCE.......................................................................... 928 What are Object Privileges ......................... Modifying..................................................................................................................................................................... 929 What are System Privileges ....................................................................................................................................................................................................................................................................................................................................................................... 938 EXP_FULL_DATABASE........................ 938 IMP_FULL_DATABASE ................................. 936 Commonly Granted (Pre-Defined) Roles .................................Table of Contents Passwords For Users Identified Externally.......................................................... 940 Using Roles as Labels or Flags ....................................... 921 Create a User Without the CREATE USER Command .............................................. 930 What are the SYSDBA and SYSOPER Privileges ...................................................................................................... 941 ROLE_ROLE_PRIVS ......................................... 937 SELECT_CATALOG_ROLE.................................. 937 DBA. 932 DBA_SYS_PRIVS ..................... 929 The WITH ADMIN OPTION Clause ........................................................ 934 Granting Roles to Users......................................................................................................................................... 932 ROLE_SYS_PRIVS .................................................. 939 AQ_USER_ROLE.................................................................................................................................... 939 AQ_ADMINISTRATOR_ROLE.......... 935 The “WITH ADMIN OPTION” Clause ................................................................................................................................. 941 DBA_ROLE_PRIVS ....... 941 DBA_ROLES.............................................................. 939 HS_ADMIN_ROLE ...................................................................... 943 .................................................................................................................................................................................................................................................................... 932 DBA_TAB_PRIVS ............... 932 SESSION_PRIVS.............

...................................... 944 Restrictions on Grants ........................................................ 970 Introduction.................................................................................................................................................................................................... 951 Auditing DDL and DML Commands................................................................................................... 975 ................. 952 What Data Does Auditing Not Capture........ 951 What Data Does Auditing Capture ................ 967 DBA_PRIV_AUDIT_OPTS....... 958 Check Your Audit Settings.................................... 963 Viewing Audit Data .................................................................................................................. 962 Auditing Proxy Users ............................................................................................................................................................................................................................................................................................................................................................................................................................................... 947 What is Auditing .................................................................................................................................................................... 955 Step 2: Bounce the Database..................................... 971 Breaking it Down ....................................................................................................................................................................................................................................................... 946 Introducing Oracle Audit............................................... 955 Step 1: Configure the Database................................... 973 Running Scheduler Jobs............................................................................................... 944 Chapter 31: Introduction to Oracle Auditing....................... 967 DBA_STMT_AUDIT_OPTS ................................................................. 956 Step 3: Issue AUDIT Commands........................ 954 Turn Auditing On and Off ....................................... 965 DBA_AUDIT_STATEMENT ................................. 973 Listing Scheduler Jobs ....................................... 950 Audit the Auditing System ..................................................... 971 Jobs .............................................................................................................................................................................................................. 950 Audit Security Related Commands ....... 943 SESSION_ROLES ........................................................................................................... 949 Audit Logins and Logoffs............................................................................................................................. 953 Permissions Needed to Manage Auditing .......................... 957 Auditing SYS and Other SYSDBA Users.......................................................... 974 Stopping Scheduler Jobs ............................................................................................................................. 948 What Can Be Audited...................................................................................................................... 956 Example: Auditing Connections ...................... 957 To Audit All Users or Specific Users.................................... 954 Install Auditing .................................................................................... 959 Where is Audit Data Stored.......... 968 Fine Grained Auditing (FGA)............................................................................ 947 Changes In 10g........................................................................................................................................................................................................................................................................................................................................ 947 What Does Oracle Audit By Default..................................................................................................... 966 DBA_OBJ_AUDIT_OPTS............................................................................................ 968 Chapter 32: The Oracle Scheduler ................................ 965 DBA_AUDIT_OBJECT...................................................................... 948 Audit By Access or By Session ................................................ 964 DBA_COMMON_AUDIT_TRAIL...................Table of Contents ROLE_TAB_PRIVS ................... 965 DBA_AUDIT_SESSION .........................

..................................................................................................................... 991 RAC Considerations.. 977 Job Classes .....................................................................................................................................SQL to Set Global Variables in the SQL*Plus Environment.......................................... 985 Putting It All Together............................................................. 982 Permissions .............................................................. 984 Windows ...... 1000 Use File GLOGIN........................................................................................................................................................ 988 Initialization Parameters .............................................. 983 Dropping Schedules............................................. 993 Chapter 33: SQL*Plus....SQL to Set Local Variables in the SQL*Plus Environment . 1008 Format Columns with the COLUMN Command................................................................................................................................................ 980 Creating Programs ................................................................................................................................................................................................................................... 984 Permissions ................... 998 Rule #1 – How to End a Command in SQL*Plus... it Does Not Help SQL*Plus .................... 996 What Is SQL*Plus....... 1000 Create a Customized Windows Shortcut .............................................................................................................................. 1004 Storing Your SET Commands........ 979 Programs ...................................................................................................................... 998 Installing SQL*Plus .........Table of Contents Disabling and Enabling Scheduler Jobs ........................................................................................... 999 Rule #2 – Formatting is For You............................................................................................................................................................................................. 1013 ...... 1012 Hiding Your Identity .................................................................. 984 Window Groups ............................................................................................. 999 Configuring SQL*Plus ......................................... 992 Scheduler Example – A Simple Standalone Job........................................ 1002 Tips for Profile Files.................................................................................................................................................. 997 How Do I Get SQL*Plus ...... 1011 Starting SQL*Plus.. 1009 Define a Default Editor................................................. 989 Privileges ........................................................................................................................................................ 1008 An Example of SET and SHOW............................................... 988 Job Log ........................................................................................................................................................... 976 About External Jobs............................... 1002 Use the SET Command to Set the SQL*Plus Environment ................................................................................... 982 Schedules ................................................. 981 Dropping Programs ....................................................................................................................... 986 Why it is better Than Oracle’s Old Job System........................................................................................................ 1003 Variables You Can Set With the SET Command ........ 976 Dropping Scheduler Jobs ........................................................................................................................................................................................................... 982 Creating Schedules ............................................................................................................ 1002 Use File LOGIN.......... 983 Listing Schedules .......................... 1008 Using SHOW to Display a Variables Current Status ............................................................................................................................................................................................................................................................................. and all Other Variables................ 988 Permissions .................. 987 Configuring the Scheduler................. 1003 How to Use the SET Command ......................................

... 1047 How To Clear Column Formats................................................................................................................ 1055 The FROM Clause............................................................................................ 1030 Running Scripted Commands ................................. 1049 Changing Your Database Password ................................. 1050 Exiting SQL*Plus.................................... 1037 Fetch Scripts into SQL*Plus Using the GET Command .................... 1021 Re-Connect Any Time Using CONNECT .................................................................................................................... 1030 Manually Issuing Commands .................... 1028 &&var ........................................................ 1044 Formatting Columns ........................................................................................ 1046 Printing ...... 1043 Formatting Query Results................................... 1053 Standards and Compliance ................................................................................................................................................ 1024 Connecting to a Database With SSL ........................................................Something .................. 1048 How to Clear The SQL Buffer ................................................ 1034 Accepting Input...................................................................................................................................... 1054 The SELECT Clause ....................................................................................... 1031 Issue Operating System Commands from SQL*Plus ................................................................ 1028 &var1.......................................................................................................................................................................................................... 1046 Saving Output to a File .............................................................................................................................................................................................. 1054 SELECT...............................Table of Contents Connecting to a Database .................................................................................................. 1038 Edit SQL*Plus Command in Your Default Editor............................ 1051 Chapter 34: Structured Query Language (SQL) ............. 1029 &var1....................................................................................................................................................................................................... 1055 ................................................................................................... 1052 Introduction to SQL ................................................................................... 1014 Set ORACLE_SID ................................................................................................................................................................................................................................&var2 ............................................. 1028 &var .......... 1023 Connection Status Messages......................................................................................... 1021 Security Issues.......... 1044 Un-Formatting columns.................................................. 1035 Save from SQL*Plus to a File ...................................................................................... 1055 The WHERE Clause .................................................................... 1043 Get the Screen Ready.......................................................................................... 1054 Syntax ................................................................................. 1039 DOS Tricks ............................ 1047 The CLEAR Command .................................................................................................................................................... 1018 Connect Via Proxy . 1038 SQL*Plus Built-In Editing Commands ................ 1014 Connect Using the SQL*Plus Command Line Version .................................................. 1025 Substitution Variables ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ 1022 Connect Later When Using /NOLOG .................................................................... 1049 How to Clear the Screen.................................... 1041 All About Output ...... 1029 Issuing Commands and Running Scripts...........

................................................................. 1056 Security Considerations .................................................................................................................................................... 1076 Syntax ................................................................................................. 1065 Examples....... 1074 ALTER TABLE .......................................................................................... 1060 Syntax ........................................................................................................................................................................................................................................................................................... 1062 UPDATE ...................................................................................................................... 1070 CREATE TABLE ........................................................ 1069 After Thoughts .......................................................................................................................................................................................................................... 1071 Security Considerations ........ 1075 Examples.. 1075 Syntax .................................................... 1063 Security Considerations ............................................................................................................................................... 1062 Syntax ............. 1061 Security Considerations ................................................................................................................................................................................................................................................................... 1078 Examples................................................................................................................................................................................... 1066 Security Considerations ............................................................................................................ 1062 Examples........................................................................................................................ 1071 Syntax ................................................................................................. 1066 Syntax ................................. 1057 INSERT ............................................................................................................................... 1077 Security Considerations ............................ 1077 DROP TABLE ...................................................... 1077 Security Considerations ... 1064 Security Considerations ................................................................................................................................................................................. 1057 Selecting Against DUAL .................................................................................................................................................................................................................................. 1078 Add Comments to Your Schema ..................................................................................................................... 1078 ..................... 1064 Syntax ............................................................................................................................................................................................... 1063 DELETE ..................................................................................................................................................................................................................................................................................................................... 1076 RENAME ....................... 1073 Examples.......................................... 1067 Security Considerations ................................................................................................................................................................................................................................................................................. 1056 The ORDER BY Clause .............................................................................................................................. 1066 CREATE TABLESPACE . 1067 Syntax ...................................... 1057 Examples....................................................................... 1075 Security Considerations ............................................. 1066 Examples........... 1068 About Locally Managed Extent Sizes ...................................................................................................................................Table of Contents IN versus EXISTS ........................ 1077 Syntax ....... 1065 TRUNCATE ......................................................... 1068 Examples..................................................................................... 1077 Examples..................................................................................... 1073 CREATE TABLE AS SELECT (CTAS) ......... 1063 Examples......................

............. 1101 Data Pump Setup............................................................................................................................................................................................................................................................................... 1097 The Data Pump API (PL/SQL Supplied Packages) ................................................................ 1089 LEVEL...................................... 1082 Date & Time Conversion Functions...................... 1096 Background Processes ............................................................................ 1090 ORA_ROWSCN ................................................................................................................................................................................................................. 1087 NVL ... 1097 Data Pump Views......................... 1091 ROWNUM................................................................................................. 1104 Modes of Data Pump Export.......................................................................... 1104 Estimating the Size of Exports........................ 1099 Data Pump Security..................................................................................................Table of Contents Working with Dates ............................................................................................................................ 1088 NULLIF ............................... 1108 Working with Distributed Databases ................................................................................................................................................................................................................. 1079 Intro to Date and Time Data Types ...................................................................................................................................................................... 1084 TO_CHAR .......... 1084 TO_DATE................................................................................................................ 1097 DATA_PUMP_DIR ............................................................................................................................................................................................... 1086 Testing Columns for NULL Values ..................................... 1087 Functions for Working with NULLs .......................................................................... 1096 The Components of Data Pump ........................ 1109 Checking the Status of an Export. 1109 ...................................................................................................................................................................... 1092 Chapter 35: Oracle Data Pump ....................................................................... 1085 Working with Nulls ..................................................................................... 1102 Getting Help......... 1104 Preparing for Export ............................................................ 1095 What Data Pump Cannot Do........................... 1080 How Oracle Stores Dates and Times.......................................... 1089 NEXTVAL.............................................................. 1088 Understanding Pseudo Columns ..... 1096 Master Control Table... 1080 Displaying System Date and Time Data.............................................................................. 1094 Introduction to Data Pump ............................................................ 1085 NULL Values Can Change Query Results ........................................................ 1108 Naming the Data Pump Job .............. 1106 Controlling the Output................... 1081 Understanding the Date & Time Format Mask................................................................................................ 1099 Security on Directory Objects................................................................................................................................................................................. 1100 Security on Data Pump ......................................................................................... 1091 ROWID............................................................... 1100 Invoker’s Rights Issues......................................................... 1103 Exporting Data Using Data Pump Export ........................................................................................................................................................................................................................................................................................................................................................................................................................... 1088 NLV2 .................. 1105 An Example of Using Data Pump Export............................................................................................

.......................................................................................................................................... 1113 The Parameters.............................................................................................................................................. 1136 Views to Describe Partitions......................... 1116 An Example of Using Data Pump Import..................................................................................................................................................... 1114 QUERY........ 1123 When Creating Tables .................................................................................. 1113 NETWORK_LINK........................ 1134 Global Non-Prefixed Indexes ..................................................................................................................................................................................................................................................... 1115 REMAP_TABLESPACE ..................... 1122 What’s New in Oracle 10g Partitioning ..................................... 1140 How to Remove Oracle Partitioning ........................ 1125 Hash Partitioning................................................................................................................................. 1126 Range Partitioning................................ 1113 FLASHBACK_TIME and FLASHBACK_SCN . 1141 .......................................................................................................................................................................................................................... 1112 What is Data Pump Import ........... 1130 Partitioning Tables with LOBs ......................................................................................... 1123 Add a Partition to the End of a Partitioned Table ......... 1129 Composite Partitioning Using Templates..................................................................... 1137 How to Install and Configure Oracle Partitioning ................................................................................................................................................. 1125 Types of Table Partitioning ....................................... 1140 Limitations of Oracle Partitioning . 1110 Exporting From Within PL/SQL Procedures.. 1124 Swap a Non-Partitioned Segment With a Partitioned Segment................................................................................................................................................... 1124 Split a Partition Within a Partitioned Table.................................... 1115 TABLE_EXISTS_ACTION .................Table of Contents Resuming an Export .......................................................................................... 1116 Chapter 36: Oracle Partitioning ....................................................................................... 1132 Types of Index Partitioning ............................... 1111 Importing Data Using Data Pump Import ............................................................................. 1136 Local Non-Prefixed Indexes ...................... 1125 List Partitioning..................................................................................................................... 1135 Local Prefixed Indexes ........................... 1115 TRANSFORM ...................................................................... 1140 How Much Does Partitioning Cost ......................... 1139 Add Oracle Partitioning to an Existing Home ............................. 1115 REMAP_DATAFILE ........................................................... 1123 When Can Partitions Be Created ........................................................................................................................................................ 1128 Composite Range + List Partitioning .......................................................................................... 1119 What is Oracle Partitioning ............................................. 1131 Compressing Table Partitions ........................................................................... 1124 Use Package DBMS_REDEFINITION................................................................................................................ 1114 PARALLEL .............................................................................. 1120 Who Should Use Partitioning ........................... 1134 Global Prefixed Indexes ............................................................................................................................ 1127 Composite Range + Hash Partitioning .................................................................... 1115 REMAP_SCHEMA.............................................................................................................................................

........................................................ 1167 Create the RMAN Recovery Catalog.......................................................................................... 1141 Partition Key Limitations .................................................................. 1169 About Connections.................................................. 1149 RMAN and the Flash Recovery Area.................................................... 1147 Cross-Version RMAN Compatibility Issues ............................................................ 1168 Configure Database Control as Your RMAN Interface .......... 1176 Reset the Database Profile ........ That is the Question .............................................................. 1144 Why Use RMAN.......... 1176 Backup Commands..................................................................................................................................................................................... 1173 Configure the Retention Period...................................................... 1174 Deleting Expired Backups and Archlogs............................ Libraries....................................................................................................................................... 1182 Backing Up When Space Is Limited ................................................. 1177 Omitting or Skipping Objects During Backups ......................... 1168 Register A Target Database ..................................................................................................................... 1177 Understanding the Syntax .............................................................................................................. 1145 What Are the Main Features of RMAN .................... 1184 .... 1178 To Backup or Copy.... 1170 Basic RMAN Commands .................................................... and Modules .................................................................................................. 1175 Show the Current Settings .......... 1156 Create the RMAN Schema .............. 1142 Chapter 37: Intro to Oracle Recovery Manager (RMAN) ..... 1144 What Are the Components of an RMAN Environment ............................................................................................... 1154 Install the RMAN Software ................................................................................................................................................................................................................................................................................................................................................................. 1180 Backing Up The Flash Recovery Area ................... 1152 Introduction to Media Managers............................................................... 1178 Backing Up and Copying Image Copies...................................................... 1150 Using RMAN to Reclaim Space in the FRA ......... 1155 Create an RMAN Recovery Catalog Database ..................................................................... 1173 Configure Auto-Backup of the Control File . 1146 What Are the Main Cons of RMAN .. 1171 Configure the Default Device Type ..................... 1155 Planning Comes First............................................................................................................................................. 1148 RMAN Versus Your Own Solution .............................. 1172 Configure the Default Destination and File Name Format.......... 1175 Resynchronize the Catalog .................... 1174 Deleting Backups ..........................................................................................................................................................................................................................................................................................................................................................Table of Contents General Limitations .......................................... 1153 Define Your RMAN Infrastructure ........................................................................................................ 1155 Run the DBCA To Create a New Database ....... 1151 RMAN and Media Managers / SBT Destinations................................................... 1170 Administrative Commands ........... 1143 What is RMAN ............................................................... 1179 Backing Up Archlogs ..................................................... 1152 Licensing Issues for Oracle RMAN ............................................................... 1153 Implementing RMAN............................................

................ 1213 Phases ..... 1196 Migration Methods.........................Generate a Transportable Tablespace Set ................................................................................. 1185 Restore and Recovery Commands ..... 1207 Phase 3 ................................................................................................................................ 1208 Oracle RMAN Duplicate Database ........................ 1209 Limitations ............................................................................................................................................. 1211 GoldenGate TDM.............................................. 1198 A Quick Review of the Export & Import Utilities ......... 1186 The Restore Process and Command Overview .................................................................... 1191 Introduction... 1204 Phases .................. 1185 Using Backup Commands to Scan for File Corruption.................................................................... 1214 Gone is the Rule Based Optimizer ............. 1213 Phase 1 ............................................. 1189 Using Tags to Restore a Named Backup ......................................................................................................................................... 1198 Time is Against You.................................2 ..............................................................................................................Table of Contents Using Tags to Name Backups . 1194 Additional Memory Requirements . 1213 Phase 2 ........................................................................................................................................................................Transfer the Tablespaces.. 1214 .......................................................................................................................................................................................................................................................................... 1211 Quest SharePlex for Oracle................................................... 1213 Consider These Oracle Issues Before Upgrading ....................................................................... 1199 Oracle Advanced Replication .................................................................................................................................. 1187 Typical Restore and Recover Commands......... 1189 Chapter 38: Upgrading to 10g & Migrating Platforms .................. 1193 Changing Word Size From 32-bit to 64-bit Oracle........................................................................... 1200 Oracle Streams Replication .. 1213 Phase 3 ...........................Convert the Endianness of Datafiles .......... 1192 Upgrading from 9............................................................................................................... 1206 Phase 2 ...................................................................................................................................................... 1214 Statistics are Gathered Automatically ...................... 1187 Restoring Archlogs ..............................2 to 10.....................................................Capture.............. 1210 Limitations ..... 1204 Limitations ....................................................Transport ............................................................................................................ 1201 What is Oracle Streams Replication.................................. 1186 The Recovery Process and Command Overview ........................................ 1210 Oracle RMAN’s CONVERT Command .................................................................... 1192 Migrating from Windows to Solaris............................................................................................................................................................................................................................. 1197 Oracle Export & Import............................................................................................................................ 1201 The Pros and Cons of Using Streams to Migrate and Upgrade a Database........................................ 1196 Tips and Suggestions.................................................................. 1208 Phase 4 ............................................................................................. 1195 Upgrade Methods.................................... 1213 Oracle Puts SharePlex Customers on Notice ............................... 1206 Phase 1 .........................................................Post ......................... 1202 Oracle Transportable Tablespaces ...Plug-In the Tablespaces .

....................................... Version and Word Size ................... 1238 Overview of the 10g RAC Installation Process .................................... 1239 Gathering the Facts and Getting the System Ready.. 1252 The Veritas Cluster Server Inter-Process Communication (VCS ICP) Library ................................ 1216 Initialization Parameter File Modifications ................................................ 1247 Sample LISTENER.................. Bourne................................... 1218 Old Initialization Parameters to Consider Changing....................................................................................................................... 1217 Old Initialization Parameters to Consider Removing.................................. 1215 The New Flash Recovery Area ................................................ 1250 Understanding the Veritas Libraries for RAC ........................... 1229 Identify Oracle's Required User Environment Variables ........... or Bash................. Grid Control.................... 1246 Sample SQLNET.................................................................................. 1249 Tips for Working with RAC Databases .................................. 1223 Define Directory Names / Paths........................................... 1237 Redundancy is Key................... 1237 Types of Files and Where to Store Them ........................................ 1254 ................................................................... 1226 Define Naming Conventions for Databases and Listeners ... 1236 Size Limitations ............................................ 1228 Select a UNIX Shell such as C.....................................................3 for Oracle RAC ............ 1221 Select Operating System Including Version and Word Size .... 1229 Chapter 39: A Quick Look at 10g RAC on Veritas SF/RAC with WebLogic.............................................................. 1221 Determine Need for 3rd Party File System Management..................................................................................... 1246 Sample TNSNAMES.....................................................................................................0....... 1222 Define Storage Requirements . 1227 Define Oracle Software Owner ..................................... 1220 Select Server Model and Specifications ...................................................... 1236 What’s Coming in Version 5 ....... 1216 Flashback....... 1223 Identify Oracle's Required Kernel Parameters...........................................................................ORA for RAC .... 1234 Supported Versions ...................... 1223 Select Oracle Software Including Edition............. 1225 Select Infrastructure Elements Like RMAN.......................................................1 to 10..................................................................................................... 1243 What's Different About Creating RAC Databases........... Undo Retention..............................UNIX User and Group Names...................Table of Contents The New SYSAUX Tablespace ............ 1251 The Veritas Cluster Server Membership Manager (VCS MM) Library ........................................2............................................... and ASO/SSL ................ 1217 New Initialization Parameters to Consider Adding................. 1240 Order of Operations........................................................................................................................ 1219 Plan Your New Sever Configuration Before Migrating............... 1232 What is Veritas SF/RAC ......................................................................2....................... 1231 What is Oracle RAC..................................................... 1220 Select Hardware Platform............................................................................................... 1241 Upgrading RAC from 10.........................................ORA for RAC ...................................................................................................................... 1222 Determine Need for Other 3rd Party Software .............................. and The Recycle Bin........................................................................................................................................... 1237 Files and Storage...................ORA for RAC............. Korn........... 1243 Patchset 10.................................................... 1244 Sample Oracle Net Files for RAC........................

................... 1270 ORA-00600 [kzaSqlBindLob1] ...... 1263 Reconfigure the Oracle Listener to Accommodate Connection Pools.................................. 1274 ORA-25191: cannot reference overflow table of an index-organized table.................... %%t and %%r .... 1273 ORA-19809: limit exceeded for recovery files............................... [1] ........................ 1275 ORA-38700: Limit of %s flashback database logs has been exceeded....................................... 1269 ORA-00093: _SHARED_POOL_RESERVED_MIN_ALLOC MUST BE BETWEEN 4000 AND 0........................ 1265 Examples...................................................... 1262 Introduction to WebLogic MultiPool ... [22923]..................................................................... 1270 ORA-00824: cannot set sga_target due to existing internal settings ....................................... 1265 RAC Considerations ...................................................................................... 1272 ORA-12640: Authentication Adapter Intialization Failed ................................................... 1268 LRM-00116: syntax error at 'TABLE:' following '='.................................................... 1262 Sample Thin Driver URLs........... 1275 ORA-39087: directory name <name> is invalid..................................................................................................... 1264 The Relevant Listener Parameter .... 1265 Understanding Your Options for Connection Load Balancing.................................................................................................. 1262 Skip Configuring tnsnames........................ 1266 Summary......................................................................................................... 1266 Pitfalls .......................................... 1272 ORA-12500: TNS:listener failed to start a dedicated server process ............. 1271 ORA-10636: ROW MOVEMENT is not enabled . 1274 ORA-28368: cannot auto-create wallet ..................... 1270 ORA-00600 [kdimodnu0: non-colvec supplement]........................................... Partitioning ..........................Table of Contents The Veritas Cluster Server Oracle Disk Manager (VCS ODM) Library ........................................................................................................ 1267 LRM-00104: 'n................................................................ 1268 ORA-00439: Feature not enabled...... 1274 ORA-27477: <object name> already exists.................... no available destinations ...................................................................................................................................................................................................................' is not a legal integer for 'parallel'................................................................................. 1275 ORA-38760: This database instance failed to turn on flashback database ........ 1270 ORA-00600 [Keltnfy-ldmInit] ......... 1271 ORA-10635: Invalid segment or tablespace type .......... 1274 ORA-26752: Unsupported LCR received .. 1275 ........ .............................................................. 1272 ORA-16014: log string sequence# string not archived.................................................................................. 1273 ORA-23616: Failure in executing block 30 for script 245971217D86310DE0440003BA73140D........ 1264 The Problem ....... 1273 ORA-19905: log_archive_format must contain %%s............................................................... 1273 ORA-24313: user already authenticated .................................................... 1270 ORA-600 [LibraryCacheNotEmptyOnClose] ........ 1263 No Remote Listeners... 1266 Chapter 40: Unusual and “Catch All” Errors ........ 1259 Using WebLogic with RAC............ 1272 ORA-12545: Connect failed because target host or object does not exist .. 1271 ORA-07445............................................................................................................................................................................... Please ............ 1257 Tasks to Perform When Patching Oracle and Veritas SF/RAC................................................................................. [46] ................................................................................................................................................................ora? .....................................................................

........................................................ 1276 OPatch Error 73 ................................................................................................... 1276 Chapter 41: A Very Brief Glossary..... 1278 PUBLISHER’S INDEX NOT INCLUDED WITH EBOOK DISTRIBUTION ........................Table of Contents ORA-39145: directory object parameter must be specified and non-null.........

and a discussion of the all important planning and preparation activities to be performed prior to implementing an RMAN solution in any environment. The information in this chapter is organized into the following sections: v What is RMAN v Why Use RMAN v Licensing Issues for Oracle RMAN v Implementing RMAN v About Connections v Basic RMAN Commands 1143 . commonly referred to as RMAN.Oracle Database 10g: From Nuts to Soup Chapter 37 Chapter 37: Intro to Oracle Recovery Manager (RMAN) This chapter provides an overview of the Oracle Recovery Manager utility. The installation and use of RMAN are covered.

Ø The Target Databases – These are the databases you want to backup or recover using RMAN. Later sections discuss the features and limitations of RMAN. The Recovery Catalog Database can be stored anywhere on your 1144 . and two more optional components of RMAN. It supports full and incremental backups. or simply rman on many UNIX platforms. Simply known as “The Catalog”. this is the software that can be used to backup and recover a target database. If you really need a GUI for RMAN. What Are the Components of an RMAN Environment To understand RMAN. The executable is stored in directory $ORACLE_HOME/bin. Encryption is supported for Enterprise Edition customers who have a current license for the Oracle Advanced Security Option (ASO). The three core components of RMAN. RMAN runs on all platforms that the Oracle database runs on. or a Recovery Catalog Database. which are optional. are described below: Ø The RMAN Utility Software – Also known as the RMAN Client. The following sections further describe RMAN in terms of its various components and capabilities.exe on Windows. the database you want to backup. The Recovery Catalog Database is an optional database with a special RMAN recovery catalog schema. They are referred to as “targets” because they are targets of your backup strategy. cannot be used to store scripts. it helps to think about the various components of RMAN. The repository can be implemented in two forms: the target database’s control file. hot and cold backups. and two types of compression (NULL and Binary). Every RMAN installation has three core components: the RMAN utility software. and only supports one target database. you can use the OEM Database Control. RMAN also works with several of the leading media managers. is an enterprise class tool for performing backup and recovery operations on Oracle databases. or RMAN. or tape library servers. the Repository Catalog Database stores all RMAN repository information from all of your target databases. By default the RMAN repository is stored in your target database’s control file. as opposed to a graphical user interface (GUI). but some RMAN functionality is not supported and can only be accessed through the RMAN CLUI. Ø The RMAN Repository – This is where Oracle stores metadata about each of your target databases and all of the backup and recovery operations performed on each of those target databases. and works with target databases version 8. The main executable is a file named rman. The RMAN client has a command-line user interface (CLUI). The RMAN utility also uses a proprietary and unique command set: RMAN does not use standard SQL or SQL*Plus commands.0 and higher. and a repository that keeps track of the target databases and related backup and recovery facts. but it is limited on space. There are additional components.Oracle Database 10g: From Nuts to Soup Chapter 37 What is RMAN Oracle Recovery Manager.

A few Oracle customers backup to locally attached disks. the RMAN product has come a long way. Ø Flash Recovery Area (FRA) – An optional component of the RMAN environment that is essentially a large disk area that RMAN can use to store backups.Oracle Database 10g: From Nuts to Soup Chapter 37 network. You have to wonder if they really got their money’s worth. Why Use RMAN In the sections that follow. so that if your target databases were lost in a disaster your Recovery Catalog Database would survive and be useful in reconstituting all of your target databases.An optional component of the RMAN environment such as a network attached tape server or optical jukebox. which is a software module for connecting RMAN to Tivoli Storage Manager.. I think you will be pleasantly surprised at how mature the product has become. 1145 . I discuss many reasons to consider using Oracle’s Recovery Manager (RMAN) utility for database backup and recovery operations. but most large organizations have Media Manager infrastructure in place. since RMAN was first introduced with Oracle 8. I discuss the main features of RMAN. IBM makes the Tivoli Data Protection for Oracle. I then provide a comparison of using RMAN versus your own (i. and require their database backup and recovery solutions work with that existing infrastructure. The FRA can be used to store archived redo logs. If you used it with Oracle 8 or 8i. home grown) backup and recovery scripts. but you need to determine the value of those extra features. Oracle makes available an API kit for Media Manager vendors to integrate their products with RMAN. A large organization could spend several million dollars on a 3rd party alternative to RMAN. such as the IBM Tivoli Storage Manager. including other geographic locations. and the Change Track Writer index used by RMAN to perform very fast incremental backups. The FRA can also be used to store Flashback Database Log files used by the Flashback Database command.e. as well as the primary negatives of RMAN. The most commonly used type of media manager is a tape system. Ø Media Manager . but RMAN works fine whether you store the archlogs in the FRA or not. Oracle generally does not provide interfaces to Media Managers. and got completely turned off to RMAN at that time (like I did). The FRA is also a great place to store multiplexed copies of your target database control files and on-line redo log files. then you should take another look at the 10g version of RMAN. For example. and spend another million dollars per year on annual maintenance agreements and upgrades over the lifespan of that product. It might not have every feature that a more expensive 3rd party product has. considering the features that are available in the free RMAN solution. Over the years. Keep in mind that Oracle RMAN is free.

No backup will be generated. Database files are typically compressed within backup sets. and can be read very quickly by RMAN. RMAN writes the information to the 1146 . If a full backup is taken while the database is hot (i. and it can be used to take a backup of things that changed. A backup set is a proprietary RMAN format that stores one or more files. And. such as datafiles. RMAN can access and backup those blocks very fast. for faster backups and smaller backup set files. and use less storage space on disk and tape. Ø Full and Incremental Backups –RMAN can be used to take a backup of the whole database. Competing products might refer to these as “online and off-line backups”. Ø Fast Incremental Backups – This is a new feature in RMAN 10g supported by the Block Change Tracking feature. Using this technique. the incremental backups of some competing products take longer because they have to check every block’s header to see if it has been changed since the last backup. Ø Backup Sets– RMAN allows you to backup database files as a backup set. or SPFILE. and will check the files at the block-level for physical corruption. archlogs. because backup sets typically contains multiple database files. a Backup Set) then RMAN skips the unused blocks above each segment’s high water mark.e. RMAN can quickly locate the blocks that need to be backed up. Ø Image Copies – RMAN allows you to copy database files as Image Copies. In this section I describe some of the main features found in RMAN. but with RMAN the copies are true bit-for-bit copies. If any corruptions are found. All competing products offer full backups. Instead. like an operating system copy command issued as part of a cold backup. RMAN will validate the names and locations of the files for logical corruption issues. Likewise. The database’s new Change Track Writer process continually updates a bitmap index stored on the file system with the ID numbers of blocks that have changed since the last backup. writes to tape run with fewer interruptions. RMAN makes image copies while the database is up and running. If an incremental database is taken while the database is live. The new features alone could fill a chapter in this book. because the bitmap index contains the block’s precise address. but their full backups take longer and produce larger backup sets because they don’t skip the empty blocks. Ø Block Corruption Detection and Repair – RMAN has a BACKUP VALIDATE command that can be used to validate your database files. Also. control files. An Image Copy is a true copy of a file. The index is generally very small. whereas Oracle and RMAN work together and support each other.Oracle Database 10g: From Nuts to Soup Chapter 37 What Are the Main Features of RMAN RMAN has numerous features making it an enterprise class backup and recovery solution. and does not need to issue any special commands to take the file off-line or put the tablespace in backup mode. then RMAN is able to capture just those blocks that have changed since some point in time.. but because it was made in RMAN it is recorded in the RMAN Recovery Catalog and can be used in automated recovery operations. which itself is a new feature in Oracle Database 10g.

Ø Recovery Catalog Database – By default Oracle only stores backup and recovery metadata in the target database’s control file. whereas RMAN simply skips all blocks beyond a certain address. Many competing products offer far less capable solutions to storing the backup and recovery metadata. Ø Encrypted Backups – RMAN can encrypt backups using a password or the credentials stored in an Oracle Wallet. Tip: in the 10. some 3rd party tools also do this. Oracle has changed the NULL Compression algorithm to be more efficient. where the metadata for all target databases is stored. Wallet-based encryption runs transparently to the system. In previous releases RMAN would only skip blocks that were never NULL. but it depends on your database. referred to as the Recovery Catalog Database. Encrypted backups requires Oracle 10. You can also replicate it to other locations for high availability and disaster survivability. What Are the Main Cons of RMAN There are several limitations of the RMAN product that could lead to incomplete recoveries after a major disaster. backup sets can often be compressed by factors between 2 and 4.2 or higher. unless you plan accordingly. If the control file is lost. Ø Compression – RMAN supports two types of compressed backups: NULL Compression and Binary. you can use RMAN to rectify the situation with the BLOCKRECOVERY CORRUPTION LIST command. as RMAN has no way to store or persist the password between operations. RMAN allows you to create a centralized repository. and you can only encrypt backups to tape if the media manager is Oracle’s own Oracle Secure Backup. then all metadata is lost. However. NULL Compression works by skipping blocks that have never contained data. Password based encryption requires you to enter the password on each backup and restore operation. and does not prompt the operator to enter any passwords. Because the repository is an Oracle database. which is really bad for post-disaster recovery operations. you can export the contents of the repository using Oracle DataPump Export and Import utilities. the same Wallet must always be available or you cannot restore the data. If physical block corruption is encountered. you cannot encrypt image copies made by RMAN. but they still have to scan each block to see if it contains data. By default. it can be secured and backed up. The repository is an Oracle database. For example.Oracle Database 10g: From Nuts to Soup Chapter 37 database’s data dictionary where it can be reviewed using the view V$DATABASE_BLOCK_CORRUPTION. but you can always force it to check for logical corruption using the BACKUP VALIDATE CHECK LOGICAL DATABASE command. but starting in 10. requires a separate license for Oracle’s Advanced Security Option (ASO). By incomplete. Binary compression is a new feature in RMAN 10g that utilizes the existing Oracle Server compression process for archlogs.2 release of RMAN.2 it will skip blocks that are currently NULL. I mean in 1147 . the BACKUP VALIDATE DATABASE command only checks for physical corruption.

Ø RMAN cannot backup non-Oracle databases. In other words. Please take the time to review the below list of shortfalls. you could use a different backup & recovery tool for each of them. The newer versions of RMAN contain commands that are not recognized by older target databases. whereas RMAN strictly supports physical backups and recoveries. you should ensure that the version of the RMAN executable precisely matches the version of the target database. but it most cases the environment would be missing certain things. the “unused block compression” feature. Ø RMAN cannot backup the Oracle Base or Oracle Home locations.1. and many customers run multiple versions of Oracle databases on the same server. RMAN does not monitor your archlogs destination for space pressure. no wizards) inside the RMAN utility. However. if you are using a Recovery Catalog database to store the 1148 . you cannot mix and match RMAN and database versions without restrictions. Compared to 3rd party tools. as both are stored outside of the database. and there are licensing restrictions on the encryption feature as well. The 3rd party tools might also allow you to initiate logical backups (i.Oracle Database 10g: From Nuts to Soup Chapter 37 some cases data could be missing. and does not automatically initiate backup/removal of archlogs to maintain free space like some 3rd party alternatives. or you could try to find one tool that covers them all.. None of these issues are showstoppers to preclude the use of RMAN. and update your disaster recovery plans accordingly: Ø RMAN cannot backup BFILEs or external tables. Most enterprise class backup and recovery tools also help you write scripts. but with RMAN you need to use the OEM Database Control to generate those scripts with limitations – or you can write them the hard way (i. If you are using advanced features like Data Guard. The new encryption features of RMAN might not be available to you depending on whether you have 10g Release 1 or 2. import and export operations) in addition to physical backups and recoveries.e. Cross-Version RMAN Compatibility Issues You can use various versions of RMAN to backup Oracle databases. which is also known as NULL Compression. Your Recovery Catalog database should correspond to the highest version of RMAN you are using. Additionally. If your organization has non-Oracle databases. According to Oracle Note 307022.e.. Ø RMAN cannot backup database password files or network configuration files. The same note also states that you should always use the latest release of Oracle Database Server for your Recovery Catalog. there are a few additional shortcomings. but still you should take them into consideration when deliberating between RMAN and a 3rd party product. then be sure to review the list of known issues between RMAN and those advanced features. generally continues to backup empty blocks up to the high water mark. you should always use the target database’s RMAN executable to backup the database.

and run it through a series of tests. If you are using SQL and PL/SQL commands.2 Recovery Catalog Database. and another for Oracle 10.2 Recovery Catalog Database and the new database’s metadata is stored in the 10. you have no way to know which blocks inside each datafile have changed since the last backup. 1149 . and then copy the database files to another location. Custom backups can be scheduled. because you take the time to debug your program. I typically build such solutions in Windows Notepad or VI using SQL*Plus and a few PL/SQL commands. enhance it.1. You might have one to use when backing up Oracle 8. for example. Writing your own backup solution requires no special tools or programming language skills other than rudimentary SQL and PL/SQL. Custom solutions are also typically dynamic.2 databases. If we assumed that the average hourly rate for a mid-to-senior Oracle DBA is $125/hour. so that any new tablespaces or files are automatically picked up by the backup routine.7 databases. It’s not uncommon to have multiple Recovery Catalog databases for use with RMAN. When a database is upgraded from 9.2 to 10. On some platforms it’s relatively easy to send the stream through a compression utility. by using a UNIX “cron table” or the Windows Scheduler feature. and even standard operating system commands. just like the more pricey alternatives. but on other platforms it is not so easy. Custom backups also have trouble with parallel operations and performance in general. custom backups typically just put the tablespaces into hot backup mode. and how those limitations are overcome by RMAN. and cannot do incremental backups. Cost is generally not a good argument for not using RMAN. even millions. because RMAN is free.Oracle Database 10g: From Nuts to Soup Chapter 37 RMAN repository. cost might be a good argument for using a home-grown solution versus a pricey 3rd party product. Let’s think for a minute: what might a home-grown solution have or lack compared to RMAN? Custom solutions can typically perform hot and cold backups. but some DBAs contend it makes their environment “cleaner” because it eliminates the pitfalls of mixing software versions.2 targets. Many 3rd party products charge large organizations hundreds of thousands of dollars. RMAN Versus Your Own Solution In this section I discuss the limitations of custom solutions. This is not required. Let’s say that it takes a whole week. then writing your own backup solution costs your customer $5. In two day’s you can draft your own backup solution. As described above.2. the old backup metadata is left in the 9.000. Using the latest version ensures the greatest degree of compatibility with the many versions of your target databases. That’s cheap. Another place where custom backup solutions tend to be lacking is compression. Custom solutions generally can only do full backups. another for managing backups of Oracle 9.

Earlier in this book I described the Flash Recovery Area (FRA) in terms of its various background processes. Assuming you have configured the database to use the FRA and related processes and memory areas. RMAN and the FRA interact in two basic ways: Ø RMAN can use the FRA to flashback your database Ø RMAN can backup the FRA to tape I want to focus on the first of the above two interactions between RMAN and the FRA. For example: if I set DB_RECOVERY_FILE_DEST = ‘/oraflash’ and I set DB_NAME=REMIDATA. Note. then Oracle applies those before images from the Flashback log files to the datafiles. and the current date. and the word “backupset”. To quickly recap.bkp”. Oracle will automatically store all Flashback log files in the FRA. and initialization parameters. the file name is OMF generated and ends with “. but it’s a major feat to backup to an enterprise class 3rd party media manager like IBM’s TSM. If you set the initialization parameter DB_RECOVERY_FILE_DEST to a valid value. /oraflash/REMIDATA/backupset/2006_07_29/<omf filename>. If you tell Oracle to flashback the database to a prior point in time or SCN. memory structures. It’s very easy to backup to disk. then RMAN will append to that value your database name. A terabyte FRA would not be unusual.bkp 1150 . you should next tell Oracle which files to store in the FRA. is generally not covered in this book because each 3rd party vendor has unique steps and procedures. Oracle creates a unique directory name for each backupset based on the DB Name plus date. log files. then you should also set the backup destination to be the FRA: a full image copy of the database as well as any full and incremental backup sets should be stored here. Tip: to store all of these files in the FRA. and one copy of each archived redo log file. The second item. If you are using RMAN. Typically. RMAN and the Flash Recovery Area In this section I discuss how RMAN uses the new Oracle 10g Flash Recovery Area (FRA). and it’s not too difficult to backup to a local tape drive. All files associated with the given backupset are stored in this one location. and then let those files be archived to tape as part of the operating system’s nightly backup routine. Writing backups to the FRA is a simple matter. then RMAN’s backups might go to a destination like the one shown below.Oracle Database 10g: From Nuts to Soup Chapter 37 Perhaps the greatest inability of the custom solution is to send the backup to a media manager such as a tape library system. backing up to tape. you need to allocate approximately three to four times as much disk space to the FRA as you did for your datafiles. Probably the best you could do is backup to a disk. one member from each on-line redo log group. If the before images get close but not close enough to the flashback point. Oracle captures the before images of blocks and writes them out to Flashback log files in the FRA. then Oracle rolls forward with the archlogs and on-line redo log files. In the end. you should store in the FRA one copy of your control file.

Tip: you should not use the FRA unless you are also using RMAN. Oracle provides the "oracle. For this reason.. If a datafile is missing or corrupted. which can be used to define a disk area as a pseudo-tape device. This tell Oracle the files are no longer required to remain in the FRA and can be removed to reclaim space. If you run the command in RMAN. However. then it is up to you to first ensure all prerequisites are satisfied.e. reclaimable space. then it will do that automatically. If the best way to get you back to a certain point in time is to restore backup files and roll forward. if you use RMAN and it determines rolling forward is required. Simply removing files from the FRA (i. Backing up the FRA to a disk location is not supported. whereas in SQL*Plus you have to take care of that yourself. Using RMAN to Reclaim Space in the FRA All files put into the FRA consume space against a quota. I recommend against creating your datafiles with the AUTOEXTEND ON clause if you will be using the Flashback Database feature. The only way to do all that is to use RMAN to backup the FRA to tape. using operating system commands) does not update Oracle’s metadata related to the FRA. Oracle realizes that many developers (including thousands of their own employees and contractors) do not have access to tape storage systems. then it will check to make sure all datafiles and required log files (flashback. and thus allows you to backup the FRA to disk using a SBT_TAPE channel even though you don't really have a tape system. you will notice column SPACE_RECLAIMABLE increases in the view V$RECOVERY_FILE_DEST after each backup of the FRA to tape. These are easily overcome. Also. What’s interesting is that Oracle will not do a recovery operation as part of a flashback. then you must recover that datafile using traditional media recovery techniques prior to flashing back the database. For example. on-line redo. and does not make Oracle aware of reclaimable space. Before you can use Flashback Database. it will ignore that and stick to its task of pulling the before images out of the flashback log files and injecting them into the datafiles.ENV=(BACKUP_DIR=/disk3)'. and your quota. If you will issue it in SQL*Plus.disksbt. such as a tape library. Ø You cannot flashback the database unless all datafiles are present. Ø You cannot flashback any datafiles that have grown after the time you want to flashback to. Using RMAN to backup the FRA to tape instructs Oracle to update the data dictionary tables that monitor space within the FRA.Oracle Database 10g: From Nuts to Soup Chapter 37 You can issue the same FLASHBACK DATABASE command in either SQL*Plus or RMAN. As noted earlier. RMAN> configure channel device type 'SBT_TAPE' parms 'SBT_LIBRARY=oracle. but you need to be aware of these issues and plan accordingly.disksbt" API. there are a few big showstoppers to consider. For example. Oracle is unable to manage space within the FRA unless you have configured RMAN to backup the FRA to a tertiary storage device. and archlogs) are present. 1151 .

claiming that an archived redo log file is missing. and they provide their own software as a fancy user interface as well as a system interface (or module) between RMAN and their backup infrastructure. and Modules RMAN by itself can only backup to disk. RMAN and Media Managers / SBT Destinations In this section I discuss how RMAN can be used with tape devices and storage managers like IBM’s Tivoli Storage Manager. Other companies sell whole packages. tape library servers). the keyword DB_RECOVERY_FILE_DEST as shown above is a synonym for the Recovery Area. Generally speaking. RMAN> DELETE OBSOLETE.. Sitting between RMAN and the Media Manager is a Media Manager Library. RMAN out of the box cannot backup to tape. then you must make this point clear to the vendor. For example. Libraries. If your Oracle server catches on fire. A Media Manager runs the media infrastructure (i. Then. to do the actual backup of the recovery area you can use the RMAN command “BACKUP DB_RECOVERY_FILE_DEST” as shown here: RMAN> BACKUP DB_RECOVERY_FILE_DEST. you cannot use RMAN to backup to tape without a Media Manager Library or “module”. Oracle even offers a product called Oracle Secure Backup. If you really want to use RMAN in conjunction with a 3rd party Media Manager. the disks could be part of a corporate storage array that is mounted to your Windowsbased Oracle server as the D drive. The disks used to hold your RMAN backups can be internal or mounted. Symantec’s Veritas NetBackup. This module takes commands from RMAN and reworks them to be compatible to the Media Manager. Actually. and Computer Associates’ BrightStore ARCserve Backup. and is not a support means of backing up production database systems. EMC’s Legato NetWorker. Now that you have used RMAN to backup the FRA to a SBT device. There are plenty of 3rd party media managers. Some 3rd party products use RMAN to do the backups of your Oracle databases. your backups are safe because they are stored some place across the network on the corporate storage array. replacing RMAN altogether. you are free to delete some of the backups and archlogs from the FRA and make room for new files. 1152 .Oracle Database 10g: From Nuts to Soup Chapter 37 Please note the "oracle. This means you could also perform the exact same backup of the Flash Recovery Area using this command: RMAN> BACKUP RECOVERY AREA. Introduction to Media Managers.e.disksbt" API is for development systems only. then you need a Media Manager. or module. If you want to use RMAN to backup directly to tape. you see the section on “Backing Up the Flash Recovery Area” for information about how to resolve this issue. Tip: occassionally RMAN will fail to backup the FRA.

Oracle wants you to carve out a set of resources to be dedicated to Oracle Secure Backup. You should define a retention policy (i. which itself requires the Oracle Enterprise Edition. There are some advertised features of RMAN that are not freebies. Some organizations are fine with that. then you cannot use RMAN to do the backups. if your Media Manager vendor does not offer a Media Manager Library for RMAN. while other organizations require database backups utilize existing infrastructure. but that would be a backwards approach: Media Managers can be million dollar corporate investments. ASO is not required to use either of RMAN’s compression techniques. “do I need another license for Oracle to create a RMAN Recovery Catalog Database?” The answer is no. For example. The Oracle licensing documentation states you can create one repository (i..Oracle Database 10g: From Nuts to Soup Chapter 37 The trick here is.. Implementing RMAN Implementing RMAN is a process that consists of the following general tasks: Ø Define Your RMAN Infrastructure 1153 . I do want to point out a few things about Oracle Secure Backup: it is only available with Oracle 10. The database may hold your RMAN and Grid Control repositories only. and not for application data. The question I often hear is. Take retention policies for example. Licensing Issues for Oracle RMAN RMAN is free and bundled with the Oracle Server license. All of the vendors I listed at the start of this section provide Media Manager Libraries for RMAN. Just ask your Media Manager vendor about RMAN support. That is. and in my opinion it does share or integrate well with corporate media managers like TSM. catalog database) at no additional cost. and you should not pick the first one to support RMAN. as long as you have licenses for the Oracle running your target databases you are licensed to create and run a RMAN repository at no additional cost.e. Tip: there is a bug in Oracle’s documentation that states ASO is required to use RMAN compressed backups. RMAN Backup Encryption requires an expensive license for the Oracle Advanced Security Option (ASO). It need not be on the same server as your target databases. Oracle Secure Backup is discussed elsewhere in this book. However. so I won’t go into too much detail here. One thing to keep in mind when using RMAN with a 3rd party Media Manager is you will need to disable or ignore some of the Media Manager’s features.e. and then ask the resource vendor about a media manager for Oracle RMAN. recovery window) in RMAN. You could try asking Oracle. and there are many more. and disable or unset the retention policy in your Media Manager. Tip: start by looking at the tape library systems your organization already has in place.2 and higher. and some features are not available to customers using the Standard or Standard ONE editions of Oracle.

the database is then known as a Recovery Catalog Database. there are a number of planning issues to be addressed: Ø Will you use a Recovery Catalog Database or the target database’s control file to store the RMAN repository? Do you understand the differences between using one or the other? The rest of the questions assume you will create a Recovery Catalog Database. Ø Will your backups go to disk or tape? If disk. and if possible the RMAN database should be stored in a different room or building. will you be using a 3rd party media manager like the Tivoli Data Protection for Oracle module. or Data Guard? What about 3rd party solutions like Veritas HA. Define Your RMAN Infrastructure Before you begin the process of setting up RMAN in your customer’s environment. Ø Which server will host the RMAN Recovery Catalog Database? I recommend against storing the RMAN Recovery Catalog Database on the same physical server as any of your target databases. will it be local disk on each database server. and how big should the tablespaces be? Ø What will be the name of your RMAN Recovery Catalog Database? Ø What will be the name and password of your RMAN user account in the Recovery Catalog database? Ø How will you provide a highly available RMAN Recovery Catalog Database? Will you use RAC. and have you compared these implications to the expected efficiencies of your daily incremental backups? 17 When the Repository is put into a database. Ø Which tablespaces and catalogs do you need in the Recovery Catalog database.Oracle Database 10g: From Nuts to Soup Chapter 37 Ø Install The RMAN Software Ø Create an RMAN Recovery Catalog Database Ø Create The Recovery Catalog In The Repository17 Ø Register Each Target Database With RMAN Ø Test Backups and Recovery Each of these are tasks is addressed below as separate sections. or shared storage? If backing up to tape. 1154 . which requires you to enable the Block Change Tracking feature and its associated background processes and memory areas? Do you understand the performance implementations of this. and get backed up from there to tape? Ø Will you be using the new Fast Incremental Backups feature in RMAN 10g. or Streams Replication. or will you be using Oracle Secure Backup? Will your RMAN backups go to the Flash Recovery Area on disk.

It is interesting to note. and the SYSDBA privilege cannot backup data in a database protected by Oracle Database Vault. Maybe you will call it RMANCATD in the development environment. I recommend you either use a terminal emulator program like PuTTY. Tip: to connect to a target database on UNIX the password file must exist in ORACLE_HOME/dbs. or you use Oracle’s Database Control web-based administration utility. Create an RMAN Recovery Catalog Database The sections below detail the processes of planning and creating your Oracle RMAN Recovery Catalog database. Carpenters have a saying. and RMANCATT and RMANCATP 1155 . It is not part of the Oracle Client installation package. “Measure twice and cut once”. then skip this information. Install the RMAN Software Installing the Oracle 10g Database Server automatically installs the RMAN software into your Oracle Home. RMAN is only found in Oracle 10g Database Server installations. As you can see from the above listing. It will always be present. Technically that is a misnomer as the database is not the catalog. Tip: if you try to run RMAN on a computer that only has the Oracle Client software installed. on Windows you can put the password file anywhere as long as you set the Registry key ORA_SID_PWFILE. It is also referred to as “The Catalog”. Planning Comes First One of the first things to decide is what to name your new database. there is no option to block RMAN from being installed to your server. because it’s the repository for the recovery catalog. and using the same operating system user account that owns the Oracle Home containing the RMAN utility. but rather the holder of the catalog. Note: if you will not be using a Recovery Catalog database and will be using the target database’s control files instead. there are numerous decisions that need to be made before you install any software or get started with RMAN.bsq. However. No separate installation steps are required for RMAN. then no password is required. In a nutshell it means to remind us that resolving problems takes a lot more time than good planning.Oracle Database 10g: From Nuts to Soup Chapter 37 Ø What are the implications of using RMAN with Oracle options like Database Vault? If RMAN requires that you connect to the target database as a SYSDBA user. Tip: the Recovery Catalog Database is often called “The Repository”. then you will get an error that RMAN could not find the file $ORACLE_HOME/rdbms/admin/recovery. If you want to access RMAN from a client workstation. In all other cases a password file is required. then how will RMAN be used? Ø What are Oracle’s requirements for password files on your target databases? If you will be launching the RMAN utility on the same server as the target database.

then maybe you want a generic name like INFRA for infrastructure. then you need to add more space. XML DB. The name is up to you. Most people set the name to RMAN. The memory requirements are low for an RMAN database. If you do nothing else to protect the database. 1156 . and administrative files. Run the DBCA To Create a New Database The first step in the process of implementing RMAN is to create an RMAN Recovery Catalog Database. The first step is to launch the Oracle Database Configuration Assistant (DBCA. then plan to shut it down periodically to make cold backups that can be taken off the server and put in a safe place. If you were to lose the Recovery Catalog database and you did not have a backup. Your SGA will be somewhere between 640 MB and 1024 MB.sql and catproc. you should consider implementing Oracle RAC or Streams Replication to your RMAN Recovery Catalog database. In a high availability environment. Now you’re up to 5. or the Oracle Text catalogs because RMAN won’t use them. A medium sized organization with 50 target databases would need a minimum of 3.) Windows users will find the DBCA under Start > Programs > Oracle–HomeX > Configuration and Migration Tools > Database Configuration Assistant.Oracle Database 10g: From Nuts to Soup Chapter 37 in your test and production environments. depending on how many target databases you have and how long you want to keep backup and recovery information. but as you know Oracle 10g requires a lot of memory compared to previous releases. redo logs. and UNDO. SYSAUX.5 GB. The Recovery Catalog Database does not need a lot of features. And that assumes the database will only be used for RMAN. TEMP. RMAN needs approximately 70 MB per target database per year. This role includes system privileges that are equivalent to the CONNECT and RESOURCE roles. By the time you factor in your control files. After you create the RMAN user you must grant him the database role RECOVERY_CATALOG_OWNER.5 GB. The size of your new database might be anywhere from 2 GB to 8 GB. then you would lose all of the metadata for all of your target databases. If you are familiar with the Oracle catalog scripts. and your PGA Aggregate Target will be around 48 MB. You do not need to install the JVM. In many of my examples I use RMAN/RMANPWD. but that’s just an example and you should pick a real password. so there is no need to grant these additional roles to the RMAN user. you might get up to the 8 –10 GB range. you just need catalog. Another piece of easy house keeping is the name and password for the user ID that will own the RMAN catalog. and the password should be something easy to remember yet hard for others to guess.sql. You should also allocate 500 MB each for the tablespaces SYSTEM. This section provides step-by-step instructions for creating that database. If the database will also be used as a Grid Control repository. archlogs. making all of their backups obsolete. If the database will be used to support both RMAN and Grid Control.

the first screen to appear is a “Welcome” screen. When the following screen appears. make sure the option to Create a Database is selected and then click Next. Just click Next to continue to the next screen.Oracle Database 10g: From Nuts to Soup Chapter 37 When you launch the DBCA. 1157 .

ora specifies a default domain of WORLD. enter the name of your new database including any Oracle Net domain information. My sqlnet. On the following screen. the initialization parameter DB_NAME will be set to RMANREP and SERVICE_NAMES will be set to RMANREP.Oracle Database 10g: From Nuts to Soup Chapter 37 When the following screen appears. 1158 .WORLD. select Custom Database and click Next. As a result.WORLD. so I set the Global Database Name field to the concatenated values of my ORACLE_SID plus .

Oracle Database 10g: From Nuts to Soup

Chapter 37

On the below screen, you should accept the option for monitoring the database with
Oracle Enterprise Manager (that’s good practice for all of your databases) but you do not
want to configure daily backups of this database using RMAN, because RMAN cannot
backup itself. When ready to continue, click Next.

On the following screen, set your schema passwords and then click Next. To hurry the
process you can set all of them to the same password at this time, and worry about
assigning unique passwords to each schema later.

1159

Oracle Database 10g: From Nuts to Soup

Chapter 37

On the following screen, select the type of storage system you will be using and then
click Next. Typically, you should select File System. In Oracle 10g, however, ASM is
also a possibility, and provides the benefits of a logical volume manager to take care of
striping and mirroring your database files. However, do not pick ASM unless you know
ASM has already been configured and tested on your system. Raw Devices should not be
picked unless you are using Oracle RAC, but even then if you are using a clustered file
system like Veritas you would pick File System and not RAW.

On the next screen, you are asked to specify the location where you want Oracle to create
all of the database files, and then click Next. Here I have selected OMF, but it’s up to
you. If you are unsure, stop for a moment to research the various options as they are
described in this book.

Where I have selected OMF, Oracle automatically sets the database area to
“{ORACLE_BASE}\oradata”. In my case, that is D:\Oracle\Oradata. When the

1160

Oracle Database 10g: From Nuts to Soup

Chapter 37

database files are created, Oracle will automatically append the SID to the path, so my
OMF directory name is really D:\Oracle\Oradata\RMANREP.
Tip: if you have multiple mount points or disk partitions, so that the Oracle binaries are
on one and the Oracle database files are to be created on another, then the DBCA might
not work for you. The workaround is to put everything into a single locating using the
most simple OFA case, and then later you can move files to alternate locations.
One last thought before we continue: it is generally wise to multiplex control files and
redo log files. However, the “Multiplex” button on this particular screen only works if
you selected Oracle Managed Files (OMF). Don’t worry if you did not select OMF,
because Oracle still gives you an opportunity to define multiplexed file locations a few
screens from now.
On the following screen we are asked two things: do we want to use a Flash Recovery
Area, and do we want to run the database in Archivelog Mode. In this example, I
accepted the default values. Actually, for an RMAN Recovery Catalog database you
might use neither. (A lot of Oracle DBAs run their catalog databases in
NOARCHIVELOG mode and take a cold backup of the catalog database once a week.)
When ready, click Next to continue with the database creation process.

1161

On the above screen. Because this is an RMAN Recovery Catalog database. This next screen (step 10 of 12) has four tab pages. 1162 . I have deselected every option except the OEM Repository. and not an application data repository. and they add to your memory and disk space requirements. which is needed later during the configuration of the OEM Database Control. notice the button for Standard Database Components. Those extra components make patches and upgrades more difficult. RMAN simply does not need all of those advanced features and add-on products. and deselect some “standard” components. because if you are creating a RMAN repository you do not need to install JVM or Oracle Text. I recommend you click on it.Oracle Database 10g: From Nuts to Soup Chapter 37 The following screen asks you which schemas or catalogs to install into your new database. I will discuss each separately.

I have kept the default values. On the Sizing tab-page. The numbers I show here are typical for RMAN in small to medium offices. 1163 . so Oracle will use the numbers I provide to set initialization parameters SGA_TARGET and PGA_AGGREGATE_TARGET. shown below. As you can see. I have selected Custom and Automatic. and click on the tab-page for Sizing.Oracle Database 10g: From Nuts to Soup Chapter 37 The first tab page “Memory” is used to size the SGA and PGA. Do not click Next just yet. and should be increased in offices that backup a great many databases with RMAN.

1164 . because RMAN requires dedicated connections. On the Connection Mode tab-page (shown below) I have accepted the default value of Dedicated Server Mode. Please note the default values maybe different for each platform: in my case it is a 32-bit Microsoft Windows platform. click Next to continue to screen 11 of 12.Oracle Database 10g: From Nuts to Soup Chapter 37 On the Character Set tab-page. I kept the default values. When done reviewing the various tab pages described earlier. shown below.

click Next.Oracle Database 10g: From Nuts to Soup Chapter 37 Using the screen shown below. When ready to continue. as locally managed with automatically sized extents (i. All of the tablespaces will be set. and all redo log files will be 10 MB.e. There will also be three redo log groups with one member each. not uniform size) and Automatic Segment Storage Management (ASSM). by default. verify the list of tablespaces. datafiles. 1165 .. Perhaps the only adjustment you need to make to any of this information is that you might want to add a second file to each redo log group. (Recall earlier the discussion of Multiplexed Files). Each datafile will be set to AUTOEXTEND by default. and redo log files.

Oracle Database 10g: From Nuts to Soup Chapter 37 The last major screen is shown below. 1166 . No action is required on your part. but if you are not ready to create the database right now you can uncheck that option and check the boxes for Save as Database Template and/or Generate Database Creation Scripts. I always check the box for Generate Database Creation Scripts: reviewing the scripts at a later time will help you understand how Oracle works. the option to Create Database is selected. A confirmation screen will appear. The following progress monitor screen will appear. Regardless of whether I am creating the database or a template. Click OK to continue. By default.

-. The RMAN schema should only be created in the RMAN Recovery Catalog database.THESE EXAMPLES ASSUMES ORACLE MANAGED FILES (OMF). Notice in the above example that I did not grant CONNECT or CREATE SESSION to the user.Oracle Database 10g: From Nuts to Soup Chapter 37 Please note you cannot use the DBCA on this computer to perform any other tasks until the database has been created and this progress window has been closed. This is because the role RECOVERY_CATALOG_OWNER contains the system privileges CREATE SESSION and pretty much everything that the RESOURCE role contains. CREATE TEMPORARY TABLESPACE TEMP. in the databases to be backed up by RMAN you should not create the RMAN user.ORACLE WILL GENERATE FILE NAMES AND USE DEFAULT SIZES. In this section we will create that user and tablespace to hold the RMAN Repository schema objects. When you use the RMAN software to backup a database. -. ALTER SYSTEM SET DB_CREATE_FILE_DEST='C:\oracle\oradata\REMIDATA'. That is.ORACLE WILL ALSO USE LOCALLY MANAGED EXTENTS AND ASSM. The user’s name need not be RMAN: it can be anything you like. Here is a complete set of commands that can be run to create the RMAN user in your database. We will also grant the necessary privileges and roles to that schema. Nor did I grant RESOURCE or other roles to the RMAN user. so my example begins with a command to create a tablespace named RMAN.” Simply click Exit to end the process. storing schema objects requires a user account and a tablespace. GRANT RECOVERY_CATALOG_OWNER TO RMAN. -. as required by the RMAN software. CREATE USER RMAN IDENTIFIED BY RMANPWD DEFAULT TABLESPACE RMAN TEMPORARY TABLESPACE TEMP QUOTA UNLIMITED ON RMAN. a summary screen will appear that starts with the line “Database creation complete. 1167 . RMAN must connect to the target as SYSDBA. Also. CREATE TABLESPACE RMAN. Do not create the RMAN user in each of your target databases. Create the RMAN Schema In the preceding section we created a new Oracle 10g database to store an RMAN Repository. But. please recall that we cannot create a user unless there are tablespaces in the database. When the database has been created. as you know. which were not created in the earlier section.

then the target’s connect string simply becomes a “/”. It has no recovery catalog. then you must launch RMAN and reset the database’s profile in your catalog by running the RESET DATABASE command as follows: 1168 . and does not really know what RMAN is. If you open the target database with the RESETLOGS option. then launch RMAN and run the RESYNC CATALOG command as follows: % rman RMAN> CONNECT TARGET SYS/PWD@REMIDATA RMAN> CONNECT CATALOG RMAN/RMANPWD@RMANREP RMAN> RESYNC CATALOG. This is simply done by connecting RMAN to both the catalog and target databases. If you are running these RMAN commands on the same server as the target database. and issue the command CREATE CATALOG as shown here: % rman RMAN> CONNECT CATALOG RMAN/RMANPWD@RMANREP RMAN> CREATE CATALOG. In other words. It is always required to tell Oracle the type of database you are connecting to. and then issuing the REGISTER DATABASE command as shown below. connect to your new catalog database. it is a blank slate. Register A Target Database Before you can backup any databases using the new Recovery Catalog database. RMAN> EXIT. RMAN> EXIT. All you need to do is launch the RMAN utility. If you ever feel that your RMAN Recovery Catalog is out of sync with the actual files of your target database. They are the RESYNC CATALOG and RESET DATABASE commands. be it a catalog or target. you must catalog the databases that you want to backup. I want to introduce a few related commands here. you must register the target database in the catalog. % rman RMAN> CONNECT TARGET SYS/PWD@REMIDATA RMAN> CONNECT CATALOG RMAN/RMANPWD@RMANREP RMAN> REGISTER DATABASE. Notice in the above example we used the CONNECT CATALOG clause followed by a connection string. In other words. A comment about the above example. repeat these steps for each target database. RMAN> EXIT. You will repeat this process for each and every Oracle database you want to backup. In a later section are numerous examples of connecting to the RMAN Catalog and Target Databases.Oracle Database 10g: From Nuts to Soup Chapter 37 Create the RMAN Recovery Catalog When you first create a RMAN Recovery Catalog database.

. Ø Click on the radio button for Use Recovery Catalog. the CONNECT TARGET command rarely needs a username. “CONNECT TARGET /” is all you need for the TARGET connect string. Configure Database Control as Your RMAN Interface If you used the RMAN utility to establish a recovery catalog and register target databases. RMAN> EXIT. The connection should be as a SYSDBA user. and near the top will be the message “The recovery catalog has been resynchronized with the target database. Ø On the Confirmation screen click Finish. You can do it all on one line like this: % rman RMAN> CONNECT TARGET / CATALOG RMAN/RMANPWD@RMANREP RMAN> RESYNC CATALOG. Ø Navigate to the Maintenance page. You should be running RMAN from the target database’s host computer. and then click Next. there is no need to connect to the target and catalog databases on separate lines as shown in many of my examples. Ø When prompted.Oracle Database 10g: From Nuts to Soup Chapter 37 % rman RMAN> CONNECT TARGET SYS/PWD@REMIDATA RMAN> CONNECT CATALOG RMAN/RMANPWD@RMANREP RMAN> RESET DATABASE.” 1169 . you can leave the host credentials fields blanks. and then click on the button for Add Recovery Catalog. RMAN> EXIT. or SID.) When ready. password. (The userID is “oracle” on most UNIX servers. such as SYS. in which case you can connect using local operating system authentication. and then click on the link for Recovery Catalog Settings. To finish the setup so that Database Control can be used as a GUI for RMAN you should complete the following steps: Ø Launch OEM Database Control and connect to your application database (i. or Administrator on most Windows severs.e.. On the Resynchronize Catalog page ensure the right catalog database is selected. Ø You should test the setup by clicking on the Resynchronize Catalog link. because you have already created and populated the catalog database using the RMAN utlility. make sure the radio button named Use Recovery Catalog is selected. If all goes well you will be returned to the same screen. a target database). Also.e. Note. then none of this information will be available in OEM Database Control by default. and then enter the name and password of the userID that owns the oracle software on your catalog database server. Ø When returned to the Recovery Catalog Settings screen. click OK to continue. I. enter the details about the name and location of the recovery catalog database. As noted elsewhere in this chapter.

there are so many RMAN commands that there would be no way for me to describe and illustrate all of them here in this book. You cannot do it. This will cause the connection to fail. it does not do this for connections to the catalog database. RMAN always appends “AS SYSDBA” to all connection strings involving a target database.e. At this point you have the option of using the RMAN command line utility or the Database Control GUI to perform backup and recovery operations. That is. Therefore. Tip: you can put connection commands in scripts that are invoked from within RMAN. This completes the process of configuring OEM Database Control for use with your Oracle RMAN recovery catalog.Oracle Database 10g: From Nuts to Soup Chapter 37 Ø Click the Cancel button to return to the Maintenance page. you should first launch RMAN and then connect to your catalog and target databases from within RMAN. Frankly. If you need to connect or reconnect to the same database you were already connected to. If your target (i.. Suppose you are already in the RMAN utility connected to a certain target database. and you want to open another connection to the same target. any user who does a “ps –ef” command will see your entire command string including any passwords in clear text. If you launch RMAN and connect to the catalog and/or target all at once. I therefore stick to the basic and most frequently requested RMAN commands. Basic RMAN Commands In this section I describe and illustrate a large number of RMAN commands that are typically used by the DBA. You cannot connect RMAN to a target database using Oracle Shared Server connections. If you specifically include “AS SYSDBA” in your connection string. Connections to a target database must be as a SYSDBA user. This section is divided into three sub-sections: Ø Administrative Commands Ø Backup Commands 1170 . application) database uses Oracle Shared Servers. this mitigates the risk of anyone looking over your shoulder as you type a password. then you need to edit the Oracle Net files to force a dedicated server connection to be used by administrative applications like RMAN. Beware of password visibility. then your password might be visible to all other users on the server. then it will be there twice: once because you put it there and again because RMAN always puts it there. About Connections RMAN requires one or more dedicated server connections when connecting to a target database. This way your passwords are hidden from other users on the server. RMAN’s CONNECT command can only be issued if you are not already connected to the specified database. then you must open a new RMAN session.

First. % rman catalog rman/rmanpwd@rmanrep -. Also assume the recovery catalog within my RMAN Recovery Catalog database is named “RMAN” and has password “RMANPWD”. The first one begins with keyword TARGET. You should generally launch the RMAN utility on the host where your target database is running. Notice. The earlier example of connecting to both a target and catalog at the same time only works at the operating system command prompt. or after you get in the RMAN utility. % rman RMAN> connect catalog rman/rmanpwd@rmanrep These next examples are typical of when you want to do a backup. Connection Examples Let’s start with a classic example of connecting to a target database and the RMAN Recovery Catalog Database (i. and to set RMAN default behaviors. the Repository) at the same time. to ensure the correct Oracle Home binaries are used. Here are some additional examples of connecting to the RMAN Recovery Catalog Database (i.e. and I did not specify a database name because it gets picked up from the environment variable ORACLE_SID. In order to do a backup. -.Example 1: Launch RMAN and connect to both Catalog and Target. Once in RMAN. % setenv ORACLE_SID remidata % rman target / catalog rman/rmanpwd@rmanrep Notice in the above example I issued the operating system command “rman” followed by two clauses to be interpreted by the rman utility. assume my target database is my corporate applications database and it is named “REMIDATA”. you need to launch RMAN and connect to both the Recovery Catalog Database and a Target Database.. tell Oracle which target database to connect to.e. In these examples we are not connecting to any target databases. you need to connect to each database separately.Example 1: Launch RMAN and connect to catalog at same time. and assume that my RMAN Recovery Catalog database is named “RMANREP”. and not on the server where the RMAN Recovery Catalog Database is running. In this first example. you can either connect at the same time you invoke RMAN.. -. -.Oracle Database 10g: From Nuts to Soup Chapter 37 Ø Restore Commands Administrative Commands Administrative commands are essentially those RMAN commands that are not used to backup or restore databases. The second clause begins with keyword CATALOG and connects to a catalog database named RMANREP as user RMAN. the recovery catalog). and tells RMAN to connect to a target database.Example 2: Launch RMAN then connect to catalog. Administrative commands are used to connect RMAN to the target and catalog databases. I did not specify a user name or password because I am using operating system authentication. 1171 .

it overrides the default device type from DISK to SBT.Oracle Database 10g: From Nuts to Soup Chapter 37 % setenv ORACLE_SID REMIDATA -.after you get into RMAN connect to Target and Repository DBs. so that during backups Oracle will open five server processes to the device. % rman RMAN> connect TARGET sys/manager@REMIDATA RMAN> connect CATALOG rman/rmanpwd@rmanrep Tip: you must connect to target databases as a SYSDBA user. use the command SHOW DEFAULT DEVICE TYPE. Configure the Default Device Type All new RMAN installations are by default configured to send backups to disk. so RMAN appends that information to the connection string in the background.Example 3: Invoke RMAN utility on target db server. RMAN always -. First. This only applies to automatic channels. % rman TARGET / CATALOG rman/rmanpwd@rmanrep -. The above example does two things.Second. To check the current settings.As before. The “/” is used -.include “AS SYSDBA” or connection will fail. and you should connect to catalog databases as the RMAN repository owner. However. Notice in all of the above examples I did not specify the AS SYSDBA clause on any connections to the target database. An example of the command and typical results are shown here: RMAN> show default device type.Example 2: Invoke RMAN from the Repository DB server.the Catalog DB all in one big command. typically named RMAN. If you put AS SYSDBA in the connection string. This is because RMAN knows all connections to a target database must be as SYSDBA.it goes twice and causes an error. then it would be in the connection string twice and cause an error. -. so if you include it then -. The two device types are DISK and SBT. and then -. RMAN configuration parameters are: CONFIGURE DEFAULT DEVICE TYPE TO DISK. meaning if someone puts the backup commands in a RUN {} block then the default you set here will be ignored. invoke RMAN and make connections. it configures the new SBT device type to have a five degree of parallelism.passes that in the background. % rman TARGET sys/manager@REMIDATA CATALOG rman/rmanpwd@rmanrep --. Second. we also connect to both the Target DB and -. and the default is DISK. do not -. and then RMAN appended the same information in the background. You can tell Oracle whether to send backups to a disk device or a tape device using the RMAN command CONFIGURE with the DEFAULT DEVICE TYPE TO clause. RMAN> CONFIGURE DEVICE TYPE SBT PARALLELISM 5. The “RMAN” user is not a SYSDBA. RMAN> CONFIGURE DEFAULT DEVICE TYPE TO SBT. even though all such connections require SYSDBA privileges.to connect to the Target DB as SYS AS SYSDBA. # default 1172 .

if you set it both ways. in a nutshell. RMAN will revert to using the FRA as the default destination for backups. You can only set one type of retention policy.Oracle Database 10g: From Nuts to Soup Chapter 37 To reset the default device type to DISK. it clears the current value and resets it to the default value which is DISK. RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK CLEAR. There are way too many format mask elements in RMAN to describe all of them here. it’s typically in the form of “we need to be able to go back N days”. 1173 . and when a second backup of a file is completed the first may be marked Obsolete. which means the system will keep one backup of each database file. RMAN marks the oldest backup as Obsolete so that it can be removed from the system through another process. all RMAN backups go to the Flash Recovery Area (FRA). which is generally the directory $ORACLE_HOME/dbs. By default. which allows you to use a plethora of RMAN format mask elements. After the retention number has been exceeded. This time I include the FORMAT clause. you can either set it explicitly to DISK or set it to CLEAR. Here’s how retention policies work. If the FRA is not defined. These are known as RECOVERY WINDOW and REDUNDANCY respectively. I’ve never liked that policy. use the CLEAR option as shown below. RMAN> CONFIGURE DEFAULT DEVICE TYPE TO CLEAR. and do not use the FORMAT clause as shown below. For more information. Here’s an example of setting the retention policy to 30 days. I discussed this same command earlier in the chapter. then RMAN uses a port-specific default location. The above example sets the destination to directory /u03/orabackups. The default retention policy is REDUNDANCY 1. For example. Configure the Retention Period The retention policy tells RMAN how long to keep the backup in good standing. Configure the Default Destination and File Name Format Tip: I recommend that you use the FRA. and the %U parameter tells RMAN to generate system-unique file names. To clear the custom settings and revert back to RMAN’s default settings. so the last retention policy you define becomes the only one enforced by RMAN. This can be done using two units of measure: number of days old. When the custom settings have been cleared. Nothing is actually deleted at this point. RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u03/orabackups/%U'. see the Oracle Database Backup and Recovery Reference. When RMAN sees CLEAR. When a customer gives you backup requirements. or number of backups taken. To change the destination use the command CONFIGURE CHANNEL DEVICE TYPE. available on Oracle’s TechNet web site. then RMAN replaces the first one you define with the second one.

Any backups listed in the repository that are not found by the crosscheck are marked “Expired”. and the backup’s metadata from the RMAN repository: Ø You simply want to delete the backups from RMAN. RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON. Ø You want to delete backups that are marked “Expired” because the backups are no longer around but the metadata is still in RMAN. To delete obsolete backups. You can then run 1174 . it’s a good idea to also backup the control file. you first need to prove to RMAN that the backups are expired. Deleting Backups There are basically three cases where you want to delete a backup from the server.Oracle Database 10g: From Nuts to Soup Chapter 37 RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS. run the command DELETE OBSOLETE. There are optional clauses that can be appended to the end of the above command. Run the CROSSCHECK BACKUP command. The retention policy does not tell RMAN when to delete old backups. use the command DELETE COPY rather than DELETE BACKUP as shown earlier. Ø You want to delete backups that are marked “Obsolete” because the backups are outside your retention policy and no longer needed to satisfy recovery requirements. to turn off this feature you re-run the command replacing ON with OFF. Configure Auto-Backup of the Control File Anytime you backup an Oracle database. To delete image copy backups created by RMAN. which tells RMAN to verify each backup listed in the recovery catalog still exists. Obviously. RMAN will remove backups that are no longer needed to satisfy recovery requirements. You can configure RMAN to do this automatically. such as the OF clause to specify individual tablespaces or datafiles. To simply delete all backup sets of a target database use the DELETE BACKUP command. For example. based largely on the retention policy you defined with the administrative commands discussed in the earlier section “Configure the Retention Period”. This is configured using the CONFIGURE CONTROLFILE command as shown below. RMAN> DELETE BACKUP. To delete expired backups. to cleanup a test environment. RMAN> DELETE OBSOLETE. Rather. so that you never forget. it causes backups to be marked Obsolete so you (and RMAN) can quickly identify and manually delete them using the DELETE OBSOLETE command. This command will remove all backup sets and all associated metadata from the storage area as well as from the RMAN catalog.

Show the Current Settings To see the current settings use the SHOW command. RMAN> CROSSCHECK BACKUP. To get around this situation use the FORCE option as shown here: RMAN> DELETE FORCE NOPROMPT OBSOLETE. For example: RMAN> DELETE NOPROMPT OBSOLETE. RMAN will be unable to delete an obsolete backup due to an I/O problem.Oracle Database 10g: From Nuts to Soup Chapter 37 the DELETE EXPIRED BACKUP command. 1175 . you will use the ALL option as shown here: RMAN> SHOW ALL. Tip: RMAN will prompt for input when you issue a DELETE command. RMAN> SHOW DEFAULT DEVICE TYPE. which are rather selfexplanatory: RMAN> SHOW BACKUP OPTIMIZATION. RMAN> CROSSCHECK BACKUP. The commands look like this: RMAN> CROSSCHECK ARCHIVELOG ALL. a backup should be marked expired in the RMAN recovery catalog if the backup was deleted from storage. Here are a few. RMAN> DELETE EXPIRED BACKUP. After a while your RMAN recovery catalog might get out of sync with reality. RMAN provides a CROSSCHECK commands that you can use to find any backups or archlogs that are still listed in the recovery catalog but not present in the FRA or other backup destination. RMAN> SHOW ENCRYPTION ALGORITHM. which will remove the metadata for all expired backups from the recovery catalog. Typically. RMAN> SHOW CONTROLFILE AUTOBACKUP. and you will need to do some housekeeping. as shown here: RMAN> DELETE EXPIRED ARCHIVELOG ALL. Any archlogs and backups not found will be marked “EXPIRED” in the RMAN catalog. Occassionally. For example. The next step is to delete the expired items from disk using the RMAN command DELETE EXPIRED followed by the type of file. The SHOW command has a dozen options. RMAN> DELETE EXPIRED BACKUP. Deleting Expired Backups and Archlogs Catalog entries are considered “expired” when they no longer exist physically. to prevent this prompting use the NOPROMPT option.

there is no need to connect to the target and catalog databases on separate lines as shown in many of my examples. In fact. the CONNECT TARGET command rarely needs a username. then you must launch RMAN and reset the database’s profile in your catalog by running the RESET DATABASE command as follows: % rman RMAN> CONNECT TARGET SYS/PWD@REMIDATA RMAN> CONNECT CATALOG RMAN/RMANPWD@RMANREP RMAN> RESET DATABASE. The trick is this command must be executed at the operating system command prompt. as long as you do it at the operating system command prompt In this next example I show how to connect to the target as a SYSDBA and to the catalog database as RMAN. Also. 1176 . RMAN> EXIT. you should run the RESYNC CATALOG command on the same server as the target database. % rman CONNECT TARGET / CATALOG RMAN/RMANPWD@RMANREP RMAN> RESET DATABASE. You should be running RMAN from the target database’s host computer. “CONNECT TARGET /”. This ensures you are using the right version of RMAN for that database. As with most RMAN commands related to target databases. all at the same time. Reset the Database Profile If you open the target database with the RESETLOGS option. or SID. RMAN> EXIT. % rman RMAN> CONNECT TARGET / RMAN> CONNECT CATALOG RMAN/RMANPWD@RMANREP RMAN> RESYNC CATALOG. password. Resynchronize the Catalog If you ever feel that your RMAN Recovery Catalog is out of sync with the actual files of your target database. All you need is. you can do it all on one line. then you should launch RMAN and run the RESYNC CATALOG command as follows: % rman RMAN> CONNECT TARGET SYS/PWD@REMIDATA RMAN> CONNECT CATALOG RMAN/RMANPWD@RMANREP RMAN> RESYNC CATALOG. once inside RMAN you cannot connect to both databases in one command. RMAN> EXIT. RMAN> EXIT. in which case you can connect using local operating system authentication. As noted elsewhere in this chapter.Oracle Database 10g: From Nuts to Soup Chapter 37 RMAN> SHOW EXCLUDE.

then the database must be shutdown cleanly prior to starting the backup. so you do not need to open a SQL*Plus session to do it. tablespace. however. Understanding the Syntax The syntax of the basic BACKUP command in RMAN is as follows: RMAN> BACKUP [AS BACKUPSET | AS COPY] <THING>. which is what you want for full and incremental backups. DATAFILE <number>. as do many of RMAN's competing products. RMAN> BACKUP CURRENT CONTROLFILE. RMAN> BACKUP DATAFILE 6. RMAN> BACKUP DATABASE INCLUDE CURRENT CONTROLFILE. before you backup a database in NOARCHIVELOG mode you must do a STARTUP MOUNT command. It can be keywords like DATABASE.Oracle Database 10g: From Nuts to Soup Chapter 37 Backup Commands The basic RMAN commands for backing up an Oracle 10g databases are provided in the below sections. RMAN> STARTUP MOUNT. Backing Up In NOARCHIVELOG Mode Below are sample commands you can use to backup an Oracle 10g database that is running in NOARCHIVELOG mode. This can be done within RMAN. RMAN requires that the instance be started and the control files be mounted prior to starting the backup. RMAN will not shutdown or restart the database for you as part of the backup process. For example. datafile. The above sample commands will backup the database.) Notice. Therefore. or the current control file to the active backup device type (either tape or disk. The <THING> clause at the end of the command is used to tell RMAN what to backup. RMAN> BACKUP TABLESPACE USERS. The backup must include the current control file. You have two options: prior to the backup you can configure automatic backup of the controlfile using the command "CONFIGURE CONTROLFILE 1177 . If the database to be backed up is running in NOARCHIVELOG mode. but you can manually issue the commands from within the RMAN utility as shown above. Afterwards I explain why all of these commands are necessary. or the backup will not be useful in a restore operation. that my examples did not include the optional clause [AS BACKUPSET | AS COPY]. RMAN> ALTER DATABASE OPEN. % rman target / catalog rman/himom@rmandb RMAN> SHUTDOWN IMMEDIATE. TABLESPACE <name>. because by default RMAN includes the clause AS BACKUPSET. the following are valid RMAN commands: RMAN> BACKUP DATABASE. I was able to omit both. or CURRENT CONTROLFILE.

TRANSACTIONAL. I tell RMAN to always exclude a certain tablespace from backups. It cannot create incremental backups of a NOARCHIVELOG mode database. You can use the CONFIGURE command to change the default behavior to AS COPY. BACKUP DATABASE. If you want to tell RMAN to skip something that is on-line and ready for backups. Ø RMAN can only create full backups of a database that is in NOARCHIVELOG mode. In other words. use CONFIGURE EXCLUDE FOR TABLESPACE <NAME>. To Backup or Copy. issue an ALTER DATABASE OPEN command to switch from mount mode to fully open. Ø Do not attempt to start or open the database while the backup is running.Oracle Database 10g: From Nuts to Soup Chapter 37 AUTOBACKUP ON". and tell RMAN to no longer exclude any tablespaces. or SHUTDOWN with the following clauses: NORMAL. or you can manually grab the control file as part of a backup as shown in the above example. For example: RMAN> BACKUP SKIP INACCESSIBLE DATABASE. IMMEDIATE. RMAN> BACKUP DATABASE SKIP READONLY SKIP OFFLINE. and you will have to create a completely new backup. That is the Question If you do not specify AS BACKUPSET or AS COPY. so you should not issue a STARTUP command. The above command is not how you would normally tell Oracle to skip a tablespace or datafile. Oracle always backs up files to backup sets. Rather. For example: RMAN> RMAN> RMAN> RMAN> CONFIGURE EXCLUDE FOR TABLESPACE USER_SANDBOX. CONFIGURE EXCLUDE CLEAR. 1178 . You can also tell RMAN to skip the whole database. CONFIGURE EXCLUDE FOR TABLESPACE USER_PLAYPEN. Remember the instance is already started. then RMAN defaults to AS BACKUPSET. In the above example. After the backup has completed you can open the database. by inserting the clause SKIP INACCESSIBLE between the usual words BACKUP and DATABASE. unless you specifically request it to use image copies with the AS COPY option. That command is just to be used to tell RMAN to skip something that isn’t there to be backed up. Then I run a backup. For example. Omitting or Skipping Objects During Backups RMAN allows you to easily skip tablespaces that are offline or read only. The command SHUTDOWN ABORT is not appropriate. and will prevent RMAN from getting a viable backup. if it’s inaccessible when RMAN runs. This will invalidate the backup. This means you can use the SHUTDOWN command. There are a few more points I would like to make about backing up an Oracle 10g database running in NOARCHIVELOG mode: Ø The shutdown must be clean.

RMAN> BACKUP DATABASE. as shown below. A backupset has 1 or more “pieces”. then you can use the CONFIGURE command to set the max size of the set and pieces: RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK MAXSETSIZE 1G MAXPIECESIZE 20M. whether the blocks have been used or not. so the following commands are equivalent: RMAN> BACKUP AS BACKUPSET DATABASE. It is interesting to note that Oracle cannot write image copies directly to tape due to “fuzzy” reads: after RMAN creates the image file it must update the image with any blocks that have changed during the copy. If your BACKUP command specifies the AS COPY clause. If you are backing up to a backupset. and it can be keywords like DATABASE. the <THING> clause tells RMAN what to backup. the following are valid RMAN commands that can be used to backup an existing image copy of the specified thing: RMAN> BACKUP COPY OF DATABASE. RMAN creates image copies while the database is open and users are active. Oracle RMAN image copies are exact copies of the datafiles. RMAN> BACKUP AS COPY DATABASE. For example. TABLESPACE <name>. which you generally do not need to do since it’s the default. and otherwise the size is unlimited by default. because image copies do not break files into sets or pieces. Backing Up and Copying Image Copies If you have already used RMAN to create image copies of files. 1179 . as well as the final SCN. or DATAFILE <number>. They contain all of the blocks. The AS BACKUPSET option is the default. Let’s look at the same keywords now with the COPY OF clause. then RMAN will backup the object using an RMAN backupset that can be written on disk or tape. The number of pieces Oracle uses depends on the max size of a piece. Earlier I also gave examples of how to use those various keywords for the AS BACKUPSET clause. If you specify the AS BACKUPSET option. then RMAN will create an “image copy” of the object. then you can backup those image copies to a new backupset or image copy using the following RMAN command syntax: RMAN> BACKUP [AS BACKUPSET | AS COPY] COPY OF <THING>. or 1 to 16 archlogs. or RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY. but if the image was written to tape it would not be available for this final updating of blocks and SCN information. and the database need not be put into any special mode. Note: you cannot set the max sizes of sets and pieces when backing up AS COPY.Oracle Database 10g: From Nuts to Soup Chapter 37 RMAN> CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET. As noted earlier. A backupset is the basic unit of storage. It holds 1 to 4 datafiles.

Ø Backs up all archlogs that have not yet been backed up. you must use the BACKUP CONTROLFILECOPY [ALL] command. if you want to use this command then you must specify the name of the RMAN backup file that the control file was copied to. too. The trick is to backup the current redo information.cpy'. Instead. Tip: in the above examples notice one of them has COPY COPY. and not an active or current control file in use by the database. As you know the ALL keyword in that clause tells Oracle to delete all copies of archlogs from all Archiver destinations. Ø Runs the BACKUP ARCHIVELOG ALL command. Ø Backs up the database files. For example. This is correct. RMAN is smart enough to do all of that for you. Therefore. RMAN> BACKUP CONTROLFILECOPY 'c:\oracle\flash_area\ORCL_control. not the live tablespace. The first COPY tells RMAN to create an image copy vice backupset. RMAN> BACKUP CONTROLFILECOPY 'c:\oracle\flash_recovery_area\ORCL_control. The second COPY tells RMAN to backup the existing copy. Backing Up Archlogs There are a number of ways to backup the archived redo log files. RMAN> BACKUP CONTROLFILECOPY LIKE '%control_01%'. RMAN> BACKUP CONTROLFILECOPY ALL. To get that information you need to force a log switch. RMAN> BACKUP AS BACKUPSET COPY OF DATAFILE 6. with the PLUS ARCHIVELOG clause as shown here: BACKUP DATABASE PLUS ARCHIVELOG. Keep in mind that the BACKUP CONTROLFILECOPY command is used to backup a copy of a control file. you want to backup the archlogs at the same time you backup the database. Generally. The above command tells RMAN to do the following: Ø Issue an ALTER SYSTEM ARCHIVE LOG CURRENT command.Oracle Database 10g: From Nuts to Soup Chapter 37 RMAN> BACKUP AS COPY COPY OF TABLESPACE USERS. However. to ensure the active redo is archived and ready for backup. Ø Issue a second ALTER SYSTEM ARCHIVE LOG CURRENT command. to ensure the active redo is archived and ready for backup. use these two commands together: RMAN> BACKUP AS COPY CURRENT CONTROLFILE TO 'c:\oracle\flash_area\ORCL_control. so that it gets archived prior to the backup running. You can tell Oracle to delete the archlogs after a successful backup by using the clause DELETE [ALL] INPUT. one strange thing 1180 . You cannot use the BACKUP COPY OF command syntax to backup the copy of a control file.cpy'.cpy'.

then the second copy of each archlog will only get picked up by “the next” backup and then it will be deleted. then RMAN backs up all archlogs in the first destination 1181 . Sometimes you need to backup just the archived redo logs. The clause PLUS ARCHIVELOG DELETE ALL INPUT tells Oracle to backup one of each archlog and delete all copies of each archlog. I recommend you omit the word ALL.THIS COMMAND FAILS. If your database writes archlogs to two destinations. and pickup the other copies later. That is.THIS COMMAND WORKS. -. a given archlog is deleted from all Archiver destinations after a minimum of one good copy has been backed up. RMAN will not let you specify ALL in terms of Archiver destinations to be backed up.THIS COMMAND WORKS. There is actually a very good reason why you cannot specify ARCHIVELOG ALL within the BACKUP DATABASE command. This process was detailed earlier. In this context ALL tells RMAN to backup one copy of each archlog now. The optional DELETE ALL INPUT clause tells RMAN to remove all copies of each archlog after backing up just one copy of it. RMAN> BACKUP DATABASE PLUS ARCHIVELOG ALL DELETE ALL INPUT. Tip: the word "ALL" in BACKUP ARCHIVELOG ALL does not mean to backup all archlogs on the server right now. -. if you are not backing up the whole database and just using the BACKUP ARCHIVELOG command then the ALL keyword is allowed as discussed later. not every copy of it. so it’s already backing up all archlogs. leaving the other copies on the system for processing by the next backup command. However. for example. which gives you the clause PLUS ARCHIVELOG DELETE INPUT: this tells Oracle to backup the first copy of each archlog and then delete only the copy that was backed up. The above command backs up the first good copy of each archlog. without the rest of the database. then RMAN only deletes the one copy of the archlog that it backed up. If you multiplex to three destinations. If you used DELETE INPUT without ALL. For example: backup N archives and then deletes the first copy of each file generated after backup N-1 and the second copy of each file generated between backups N-2 and N-1. RMAN> BACKUP ARCHIVELOG ALL DELETE ALL INPUT. Whenever RMAN sees the PLUS ARCHIVELOG clause it is hard-coded to backup one good copy of each archlog using all available destinations. then it takes three backups to delete all copies of each archlog. or maybe you have scheduled a cron job to run every few hours to prevent the destination from filling up. because you would be down to just one copy of each archlog needed for recovery. consider these commands and notice which are OK and which are not: -. This puts you at risk. For example. In any case. and it also gets the third copy of each file generated between backups N-2 and N-3.Oracle Database 10g: From Nuts to Soup Chapter 37 is. RMAN> BACKUP DATABASE PLUS ARCHIVELOG DELETE ALL INPUT. If you are multiplexing archlogs to two locations. the command to backup just the archlogs looks like this: RMAN> BACKUP ARCHIVELOG ALL DELETE INPUT. This might be due to your archlog destination filling up in the middle of the day.

Oracle Database 10g: From Nuts to Soup

Chapter 37

and only uses the second destination when a file in the first destination cannot be used.
Then, during your next backup, RMAN will pickup the files in the second destination
because RMAN knows those files have never been backed up. Alternatively, you can
replace the keyword ALL with LIKE and specify a pattern or range of archlogs.
Suppose your archiver is set to write all archlogs to multiple destinations, and after each
file is backed up you want to delete all copies of the file. The solution is to use the
DELETE ALL INPUT clause. For example.
RMAN> BACKUP ARCHIVELOG ALL DELETE ALL INPUT;

What the above command does is backup one copy of every archived redo log file,
regardless of how many multiplexed destinations you are using, and then delete all copies
from all destinations. The command only deletes files that were backed up.
Many DBAs strongly believe in keeping two copies of each archlog file, so consider what
would happen to archlogs if you ran the above BACKUP command daily. The command
says to backup one copy and delete both copies. When the backup completes you would
have one copy of each archlog in your FRA (or other backup destination) but you would
no longer have redundancy. You would have a possible single point of failure. You
might therefore wish to backup archlogs every day and only delete the input files every
other day, or something like that. The BACKUP ARCHIVELOG command has various
parameters that you might find useful in constructing a bullet proof solution.
When you issue a command to backup archlogs, Oracle knows what archlogs have been
generated and need to be backed up. But, what happens if one or more of those archlogs
were deleted from the system. By default RMAN will error-out. In this case you must
tell RMAN to skip all archlogs that are missing with the SKIP INACCESSIBLE clause.
For example:
RMAN> BACKUP ARCHIVELOG ALL DELETE ALL INPUT SKIP INACCESSIBLE;

If you need to use the SKIP INACCESSIBLE clause, then odds are you also need to run
the CROSSCHECK command. After the crosscheck completes Oracle will know which
archlogs are no longer available for backups, and you can go back to using BACKUP
without the SKIP INACCESSIBLE clause. For example,
RMAN> BACKUP ARCHIVELOG ALL DELETE ALL INPUT SKIP INACCESSIBLE;
-- You get a lot of warnings about archlogs that don’t exist.
RMAN> CROSSCHECK ARCHIVELOG ALL;
RMAN> BACKUP ARCHIVELOG;

Backing Up The Flash Recovery Area
As noted earlier the Flash Recovery Area (FRA) is a disk-based cache of recovery files.
Included in those recovery files are backups. To be safe-and-sound, those backups and
all other recovery files need to be backed up to someplace off the server, such as tape.
Also, Oracle is unable to maintain free space in the FRA unless you use RMAN to
backup the FRA to a SBT device. It is therefore very important to know how to backup
the FRA.
1182

Oracle Database 10g: From Nuts to Soup

Chapter 37

Before you can backup the FRA you must configure a SBT device. RMAN will only
backup the FRA to a SBT device. I don’t cover SBT in detail here because it goes
outside the scope of this book, and most of you working in development labs or home
computers won’t have access to a true SBT device anyways. So, how to finish setting up
RMAN to think it has a SBT device? Oracle provides a driver named oracle.disksbt.
Configuring RMAN to use it is truly simple, as shown here:
RMAN> configure channel device type 'SBT_TAPE' parms
'SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/disk3)';

Tip: the oracle.disksbt driver is not for use on production systems, and you are
responsible for configuring a true SBT device such as Oracle Secure Backup or Tivoli
Data Protection for Oracle.
The second part of backing of the FRA is knowing the correct RMAN command. There
are two RMAN commands for backing up the FRA and you can use either one. Actually,
one is a synonym for the other. Both commands are shown here, and you can use either
one to backup the FRA.
RMAN> BACKUP DB_RECOVERY_FILE_DEST;
or
RMAN> BACKUP RECOVERY AREA;

If the FRA backup fails with ORA-19625 because of an allegedly missing archlog, then
run the CROSSCHECK and DELETE EXPIRED commands to get RMAN to recognize
the missing archlog is supposed to be missing and stop complaining about it.
Tip: sometimes when connected to a recovery catalog the CROSSCHECK command will
not find archlogs that are expired; run RMAN connected to the target database but NOT
connected to the recovery catalog and then run the command “CROSSCHECK
ARCHIVELOG FROM SCN NNN UNTIL SCN MMM” where NNN is the SCN of the
archlog that RMAN says is missing in action, and MMM is any higher number.
Afterwards, reconnect to the recovery catalog and run your backups as usual.
Now that you have used RMAN to backup the FRA to a SBT device, you are free to
delete some of the backups and archlogs from the FRA and make room for future
backups and archlogs. To remove obsolete backups from the FRA issue the following
command within the RMAN utility:
RMAN> DELETE FORCE NOPROMPT OBSOLETE;

If the Flash Recovery Area (FRA) is full even after you have deleted obsolete and
expired backups and archlog files, then you either need more disk space or you can work
some tricks. This trick is not really recommended for production systems, but for a test
you can simply reset your retention policy to a small value like “1 DAYS” and then rerun your command to delete obsolete backups. This process will force RMAN to update
the catalog with a new value for the amount of free space in the FRA. For example, you
might run through the following series of commands:
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
RMAN> DELETE OBSOLETE;
RMAN> CROSSCHECK ARCHIVELOG ALL;

1183

Oracle Database 10g: From Nuts to Soup

Chapter 37

RMAN> DELETE EXPIRED ARCHIVELOG ALL;
RMAN> CROSSCHECK BACKUP;
RMAN> DELETE EXPIRED BACKUP;

Space issues might remain after all of the above commands have been run. RMAN is
responsible for monitoring and managing the space pressure issues in the FRA, but it
won’t do these things at the end of each backup, and waits for obsolete and expired
objects to be removed via the RMAN interface. The next time you run a backup and
RMAN thinks there is insufficient space RMAN will defer the backup and then run a job
to look at the FRA and deal with space issues. RMAN will then update itself to reflect
the new reality of space issues, and should complete the original backup request. If not,
just re-run the backup command so RMAN cycles through this two-step process again.
Tip: when trying to resolve space issues do not manually delete flashback log files (.flb)
as this might cause the RVWR process to abort, and your instance to crash. The .flb files
are auto-deleted by the RVWR process when space pressure occurs, but because these
files are tied to archlogs RVWR will not delete any .flb files that correspond to archlogs
needed for recovery. To force RVWR to delete the .flb files you must take a databasewide outage to turn off Oracle Flashback Database and then turn it on again.
Alternatively, you can try adjusting initialization parameter
DB_FLASHBACK_RETENTION_TARGET to a lower number.
For more information, please see the section on “Backing Up The Flash Recovery Area”
in this chapter.
Backing Up When Space Is Limited
If a backup fails because there is insufficient space in the recovery area (i.e., the FRA)
then try backing up the recovery area using the command BACKUP RECOVERY AREA
and then deleting obsolete files by running the command DELETE OBSOLETE. There
might also be expired backups in the recovery catalog, thus making RMAN think space is
unavailable. You can run the commands CROSSCHECK BACKUP followed by
DELETE EXPIRED BACKUP. All of these commands are described in this chapter.
The DELETE OBSOLETE command only deletes backups that are outside your default
retention policy, unless you specify an alternate retention policy as part of the delete
command. For example:
DELETE OBSOLETE RECOVERY WINDOW OF 5 DAYS;

If a full backup of archlog files fails because there is insufficient space in the recovery
area (i.e., the FRA) then try a series of partial backups. When the first attempt is run it
will list all of the archlogs to be backed up, and one of the displayed column shows
“sequence=nnn”. This data corresponds to the log sequence number. You can tell
RMAN to only backup archlogs up to and including a certain log sequence number. For
example:
BACKUP ARCHIVELOG UNTIL LOGSEQ 265 DELETE INPUT;

After the backup has completed, you can backup the recovery area to make room for
more archlogs. Repeat this procedure as needed.

1184

RMAN> RECOVER DATABASE <PUT “UNTIL” CLAUSE HERE>. RMAN> BACKUP VALIDATE DATABASE. No backup will be generated. RMAN> BACKUP VALIDATE DATABASE ARCHIVELOG ALL. RMAN> LIST BACKUPSET SUMMARY. RMAN writes the information to the target database’s data dictionary where it can be reviewed using the view 1185 . Instead. with your most recent backup listed last.Oracle Database 10g: From Nuts to Soup Chapter 37 Using Tags to Name Backups Backups can be labeled using the TAG clause. you might notice additional backup files with a system generated tags: these file contains the control file and SPFILE backups. In addition to backup files having the tags you specified during backup. Using Backup Commands to Scan for File Corruption RMAN has a BACKUP VALIDATE command that can be used to validate your database files. just the database files are checked. RMAN applies separate tags to the two types of files. suppose you are about to add new functionality to your database like Oracle Streams Replication. RMAN will validate the names and locations of the files for logical corruption issues. If I were to omit either tag. Then. notice that immediately after telling RMAN to backup the database I specified a tag to be applied to the data files. and you want to make a backup before and after Streams has been implemented: RMAN> BACKUP DATABASE TAG BKP_PRE_STREAMS_DFILES 2> PLUS ARCHIVELOG TAG BKP_PRE_STREAMS_ARCS. while in the second example the database files and archived redo logs in all Archiver destinations are also validated. immediately after telling RMAN to also backup the archlogs I specified a second tag. This will list all of the backup sets. This makes it easy to restore from a particular backup. and will check the files at the blocklevel for physical corruption. RMAN> BACKUP DATABASE TAG BKP_POST_STREAMS_DFILES 2> PLUS ARCHIVELOG TAG BKP_POST_STREAMS_ARCS. In the first example shown below. then Oracle would substitute a system generated tag in its place. RMAN> RESTORE DATABASE FROM TAG = 'BKP_PRE_STREAMS'. When you backup the data files and archlogs in the same command. The tag will be displayed in the right-hand of the output. RMAN> STARTUP MOUNT. For example. If any corruptions are found. <DO YOUR STREAMS SETUP> RMAN> ALTER DATABASE OPEN. To see what Oracle created you might want to run the following command. if you plan to use tags you must remember to use then in all appropriate places. In the earlier example. YOU MESSED UP STREAMS … START OVER> RMAN> SHUTDOWN IMMEDIATE. Therefore. <DO YOUR STREAMS SETUP> <OOPS.

you need to know how and when Oracle overwrites existing files. and not the payload or data blocks. Alternatively. RMAN allows you to manually restore archlogs. then RMAN will validate that the necessary backups are still available. if the header is not corrupt then RMAN will not restore over the file unless you specify the FORCE option. RMAN will actually restore the files. The process has two parts: restore needed files from a backup. you can use RMAN to rectify the situation with the RMAN command named BLOCKRECOVERY CORRUPTION LIST. the BACKUP VALIDATE DATABASE command only checks for physical corruption. then RMAN will 1186 . The RESTORE command also has options to simulate a restore. or the whole database. By default. RMAN will figure out which archlogs need to be restored and do the restore for you automatically. and then recover the database to the desired point. and archlogs. but you can always force it to check for logical corruption using the BACKUP VALIDATE CHECK LOGICAL DATABASE command. That said. you still need to understand where RMAN restores archlogs to. lists of files. If any of your LOG_ARCHIVE_DEST_N parameters are set explicitly or implicitly to the value DB_RECOVERY_FILE_DEST. If you use the VALIDATE clause. RMAN supports this two-step process with two commands: RESTORE and RECOVER. whole and in part. Several of the more commonly used commands are illustrated and explained. if you want to restore the files to a new name or location you can use the SET NEWNAME command. RMAN only scans the header for corruption. just the database files are checked. When restoring files. Please note. However. and has become rather robust. this is generally not something you will do. The Restore Process and Command Overview The RESTORE command can be used to restore backup sets consisting of full backups and level 0 incremental backups. then RMAN will tell you which backups are needed to do the restore. If you use the VALIDATE clause. When you issue a RECOVER command. On restore RMAN scans the header block of the current file: if the header is corrupt then RMAN restores overtop of the corrupted file. and how it handles overwrites and space issues. control files. In the first example shown below. RMAN> BACKUP VALIDATE CHECK LOGICAL DATABASE ARCHIVELOG ALL. one or more tablespaces. Without any such clauses.Oracle Database 10g: From Nuts to Soup Chapter 37 V$DATABASE_BLOCK_CORRUPTION. Mind RMAN has been in existence for some time now. Restore and Recovery Commands This section describes the general process of using RMAN to restore and recover a database. while in the second example the database files and archived redo logs in all Archiver destinations are also validated. With each of these two commands you can work on individual files. RMAN> BACKUP VALIDATE CHECK LOGICAL DATABASE. and it can be used to restore image copies of datafiles. If physical block corruption is encountered.

If you are performing complete recovery. such as RECOVER DATABASE UNTIL SEQUENCE 578. By “available” we typically mean “files you have restored” such as by using the RESTORE command. but not when using a non-FRA location. That is. because that would be slower and because archlogs don’t contain objects created with the NOLOGGING option. Otherwise. and if they are not present RMAN automatically restores them from backups. make sure the database is shutdown and then use the RESTORE DATABASE command. Fortunately. RMAN won’t skip the incremental backup and simply roll the database forward using nothing but archlogs. If a full backup is restored. The auto-deletion of archlogs is the default when using the Flash Recovery Area (FRA). During recovery operations RMAN looks for the required archlogs on disk. If you don’t want these default behaviors. Alternatively. 1187 . then RMAN will apply the incremental backup first and then apply the archlogs. For example: RMAN> RECOVER DATABASE DELETE ARCHIVELOG MAXSIZE 5G. and will not restore read-only files with other corruption or any offline datafiles. RMAN will not restore the control file or SPFILE. then Oracle may use either a full backup or an incremental backup. To restore offline files you must restore them at the tablespace or datafile level. In both cases it can roll forward using archlogs. if you specify the CHECK READONLY clause then RMAN will restore read-only datafiles that have header block corruption only. By default. RMAN will by default restore all archlogs to your LOG_ARCHIVE_DEST_1 location. and will purge the restored archlogs automatically to maintain a maximum storage requirement of 5 GB. RMAN automatically deletes any archlogs restored to the Flash Recovery Area (or DB_RECOVERY_FILE_DEST) as soon as they are applied to the database. you have to do that using separate commands like RESTORE CONTROLFILE and RESTORE SPFILE. If you need to perform an incomplete recovery then you need to specify the UNTIL clause. Typical Restore and Recover Commands To restore the whole database. If an incremental backup is restored. then RMAN will roll forward using available archlogs. The Recovery Process and Command Overview The RECOVER command performs either complete or point-in-time media recovery using available datafiles and archlogs. then you need to issue the command SET ARCHIVELOG DESTINATION prior to running the RECOVER command. RMAN will not delete archlogs that were already on disk and not restored. Restoring archlogs may present a space issue. By default RMAN will perform complete recoveries. you can specify the DELETE ARCHIVELOG MAXSIZE clause in the RECOVER command.Oracle Database 10g: From Nuts to Soup Chapter 37 by default restore all archlogs to the DB_RECOVERY_FILE_DEST. if you issue the command RECOVER DATABASE then it will try to perform a complete recovery of the database. The above RECOVER DATABASE command will restore archlogs from backups as necessary. to tell RMAN the maximum amount of disk space to use for holding the restored archlogs. RMAN is very smart about this. RMAN will not restore offline or read-only datafiles. but not using the RESTORE DATABASE command.

Here’s an example of using the RESTORE SPFILE command: RMAN> RESTORE SPFILE. With the RECOVER there are basically three major things you can recover: the database. even after the recovery is complete and the database has been opened. RMAN> RECOVER DATABASE. SQL "ALTER TABLESPACE FOO ONLINE". Please note this clause deletes files from your database. To skip a tablespace during complete recovery operations. the RESTORE DATABASE command will never restore a SPFILE. After restoring the database and optionally any other required files. USERS. As noted earlier. For example. To restore and recover just a tablespace. RECOVER TABLESPACE FOO. With incomplete recovery the SKIP clause cannot be used. RMAN> RECOVER DATABASE. The command is quite simple as shown here: RMAN> RESTORE CONTROLFILE. Below are examples of these commands. RMAN> RECOVER DATAFILE '/u02/oradata/REMIDATA/tools. then you need to use the RESTORE SPFILE command. use the SKIP clause. RMAN> RECOVER TABLEPACE TOOLS. If you have lost your SPFILE and do not have a backup PFILE. RMAN> RECOVER DATABASE SKIP TABLESPACE FOO. If you have lost all copies of your control file.dbf'. you can use the SKIP FOREVER clause. and not the whole database. then you need to use the RESTORE CONTROLFILE command because using the RESTORE DATABASE command does not restore control files. and a comma-delimited list of datafiles. RESTORE TABLESPACE FOO. you will want to recover the database using the RECOVER DATABASE command. RMAN will take the tablespace offline and leave it offline. APPS7. make sure the tablespace is offline and then use the RESTORE TABLESPACE command followed by the RECOVER TABLESPACE command as shown here: RMAN> RMAN> RMAN> RMAN> SQL "ALTER TABLESPACE FOO OFFLINE IMMEDIATE". a comma-delimited list of tablespaces. RMAN will take the tablespace offline with the DROP option. and the associated datafiles will be dropped later. Instead.Oracle Database 10g: From Nuts to Soup Chapter 37 Here’s an example of restoring the target database: RMAN> RESTORE DATABASE CHECK READONLY. but remember that the RECOVER command should be used as part of a larger process that includes RESTORE and SQL commands as we saw in previous examples. 1188 .

you could use the SYSDATE function as shown below to restore all archlogs created in the past 2 days: RESTORE ARCHIVELOG SINCE TIME 'SYSDATE-2'. As noted earlier. To restore all archlogs from a particular SCN until present: RESTORE ARCHIVELOG FROM SCN=24010527. You can specify SEQUENCE or TIME. To restore all archlogs: RESTORE ARCHIVELOG ALL. RMAN> RESTORE DATABASE FROM TAG = 'BKP_PRE_STREAMS'. and the output is orded by date with backups listed from oldest to newest. restore just the ones created after a particular point. you can list backups using the RMAN command LIST BACKUP SUMMARY as shown below. YOU MESSED UP STREAMS … START OVER> RMAN> SHUTDOWN IMMEDIATE. For example. restore the ones created before a particular point. or system time. Below are several examples to illustrate this concept. you don’t need to specify SCN. RMAN> LIST BACKUP SUMMARY. The date string can be anything that evaluates to a valid Oracle date/time. The “points” can be specified as a SCN. For example: to restore all archlogs between two dates: RESTORE ARCHIVELOG BETWEEN TIME 'date string1' AND 'date string2'. <DO YOUR STREAMS SETUP> <OOPS. This makes it easy to restore from a particular backup. To restore all archlogs between two SCN: RESTORE ARCHIVELOG BETWEEN SCN 24010527 AND 24010529. Tip: if you forget the name of your backup. For example. and you want to make a backup before and after Streams has been implemented: RMAN> BACKUP DATABASE TAG BKP_PRE_STREAMS_DFILES 2> PLUS ARCHIVELOG TAG BKP_PRE_STREAMS_ARCS. or restore the ones created between two points. the output of the LIST BACKUP SUMMARY command includes the TAG as the right-most column. To restore all archlogs before a particular SCN until present: RESTORE ARCHIVELOG UNTIL SCN=24010527. Using Tags to Restore a Named Backup Backups can be labeled using the TAG clause. suppose you are about to add new functionality to your database like Oracle Streams Replication. 1189 .Oracle Database 10g: From Nuts to Soup Chapter 37 Restoring Archlogs When restoring archlogs you have four basic options: restore all of them. RMAN> STARTUP MOUNT. log sequence number.

if you created any datafiles after the tagged backup was made. <DO YOUR STREAMS SETUP> RMAN> ALTER DATABASE OPEN. One important note is. Follow the normal rules for recovering to a prior point-in-time. or log sequence. You will need to perform recovery as outlined in Oracle Note 130724.1. so if you are going to use custom tags then you need to supply two custom values. SCN. recover the database until a point-in-time. After you restore the tagged backup. then you will not be able to restore from the tagged backup as easily as shown in the above example.Oracle Database 10g: From Nuts to Soup Chapter 37 RMAN> RECOVER DATABASE <PUT “UNTIL” CLAUSE HERE>. The above example includes two “tag” clauses per backup statement. RMAN> BACKUP DATABASE TAG BKP_POST_STREAMS_DFILES 2> PLUS ARCHIVELOG TAG BKP_POST_STREAMS_ARCS. RMAN always applies a different tag to datafiles and archlogs. 1190 . As noted in the discussion of backups.

Sign up to vote on this title
UsefulNot useful