ORACLG«Oracle Press Oracle Backup & Recovery Rama Velpuri Osborne McGraw-Hill Berkeley New York St. Louis San Francisco Auckland Bogota Hamburg London Madrid Mexico City Milan Montreal New Delhi Panama City Paris Säo Paulo Singapore Sydney Tokyo Toronto
Contents FOREWORD, IX ACKNOWLEDGMENTS, INTRODUCTION, XIII XI 1 An Overview of Backup and Recovery, Why Plan Backups? 2 What Causes Systems to Fail? 2 Hardware Protection and Redundancy 4 ARCHIVELOG Mode Versus NOARCHIVELOG Mode 4 Diagnostic Facilities and Debugging the RDBMS 5 Overview of Backups 6 Operating System Backups 6 Cold Database Backups 7 The HOT Backup 8 The Logical Backup Export 9 Automating Backups 9 Overview of Recovery 10 Types of Errors 10 Types of Recovery 13 Recovery with Physical Backups 14
Recovery with Logical Backups 14 2 The Oracle Architecture and Configuration 17 Oracle Files on Your System 18 The Oracle Code 18 The Data Files 18 The Redo Log Files 19 The Control File 19 The INIT.ORA File 19 The Oracle Trace Files 20 Database Operation 22 The System Global Area 22, Oracle Processes 24 Database Startup and Shutdown 28 Data Storage 30 Tablespaces and Data Files 30 Segments, Extents, and Blocks 34 Database Configuration 46 Managing Control Files 47 Managing Online Redo Log Files 49 Managing Archive Redo Log Files 52 Configuring the Oracle Parallel Server Option 56 3 Backup Principles 59 Database Design and Basic Backup Rules 60 Physical Backups 62 Offline (Cold) Backups 62 Online (Hot) Backups 64 Logical Backups 69 Export Parameters 71 Export Modes 71 Sample Export Procedure 74 Backup Commands in Various Operating Systems 75 Backup/Restore in VMS Environment 75 Backup/Restore in UNIX Environment 76 Backup/Restore in IBM MVS Environment 87 Backup/Restore in Desktop Environment 91 Backups in Special Environments 93 Backup Considerations in an OLTP Environment 94 Backup Considerations in a DSS Environment 95 Hot Standby Databases 95 4 Backup Scripts in UNIX and VMS Environments 101 Backup Scripts in VMS Environment 102
BACKUP_MAIN.COM 103 EXPORT_DATABASE.COM 107 HOT_BACKUP.COM 112 COLD_BACKUP.COM 121 BACKUP_TABLESPACE.COM 133 INSTANCE_UP.COM 137 ENV_SYMBOLS.COM 138 SHUTDOVVN_IMMEDIATE.COM 139 STARTUP_DBAMODE.COM 141 SUBMIT.COM 143 db_name_devices.com 144 Tbs_To_Datafiles.sql 144 Tbs_Logfiles.sql 145 Backup Scripts in a UNIX Environment 145 dbbackup 148 dbbackup_begin 151 dbexport_begin 162 dbbackup_sched.dat 164 5 Recovery Principles 167 Definitions and Internal Recovery Concepts 168 Redo Generation and Estimation 168 System Change Number (SCN) 171 Redo Threads 174 Redo Log Switching 176 Checkpoints 178 Log History 185 Structures of Control Files, Data Files and Log Files 185 Recovery Methods 187 Redo Application 187 Block Recovery 192 Thread Recovery 192 Media Recovery 195 Database Recovery and Implementation 200 Tablespace Recovery 211 Data File Recovery 213 Creating Control File and Data Files 216 Recovery with the Import Utility 219 Re-Creating the Database from an Incremental Export 220 Recovery Strategy 222 Failure Analysis 224 System Outage Survey 224 Down System and Recovery Survey 226
Recommendations for Disaster Recovery 228 6 Diagnostic Facilities and Debugging the RDBMS 233 Oracle Trace Files 234 Diagnostic Tools 237 Setting Trace Events 238 INIT.ORA Parameters 245 Other Diagnostic Utilities 248 Debugging the RDBMS 251 Control File Dump 251 Redo Log File Dump 258 Data File Dump 261 Oracle Errors and Resolution 265 Common Oracle Errors 265 Oracle Internal Errors 279 7 Case Studies of Backup and Recovery 291 Case 1: NOARCHIVELOG Mode and Recovery 292 Case 2: Dropping Data Files in NOARCHIVELOG Mode 294 Case 3: Loss of a System Data File 296 Case 4: Loss of a Non-SYSTEM Data File Without Rollback Segments 298 Case 5: Loss of a Non-SYSTEM Data File with Rollback Segments 303 Case 6: Loss of an Unarchived Online Log File 307 Case 7: Database Crash During HOT Backups 309 Case 8: Recovery with a Backup Control File 313 Case 9: Space Management in Release 7.1 316 Case 10: Resizing Data Files in Release 7.2 320 Case 11: Recovery Through RESETLOGS 322 Case 12: Creating Data Files 329 Case 13: System Clock Change and Point-in-Time Recovery 331 Case 14: Offline Tablespaces and Media Recovery 337 Case 15: Read-Only Tablespaces and Recovery 342 Summary 355 A New Features of Oracle7 Releases 7.1 and 7.2 359 New Features of Release 7.1 360 Server Manager 360 Symmetrie Replication 360 Consistent Snapshot Refresh 361 SQL and PL/SQL Enhancements 361
Read-Only Tablespaces 362 Parallel Recovery 363 Parallel Query Option 364 Dynamic SQL 366 New Features of Release 7.2 366 Database Administration Enhancements 366 Application Development Enhancements 369 Miscellaneous Features 370