Recover Oracle Database upon losing all Control Files



Similar documents
If you have not multiplexed your online redo logs, then you are only left with incomplete recovery. Your steps are as follows:

Oracle 12c Recovering a lost /corrupted table from RMAN Backup after user error or application issue

Oracle 11gR2 : Recover dropped tablespace using RMAN tablespace point in time recovery

Database Recovery For Newbies

Restore and Recovery Tasks. Copyright 2009, Oracle. All rights reserved.

DOCUMENTATION ORACLE BACKUP & RESTORE OPERATIONS

11. Configuring the Database Archiving Mode.

Backup/Restore Oracle 8i/9i/10g

Database Disaster Recovery using only RMAN Backups

RMAN What is Rman Why use Rman Understanding The Rman Architecture Taking Backup in Non archive Backup Mode Taking Backup in archive Mode

Strategies for Oracle Database Backup and Recovery: Case Studies. Mingguang Xu

Oracle Backup and Recover 101. Osborne Press ISBN

12. User-managed and RMAN-based backups.

Oracle Data Guard for High Availability and Disaster Recovery

Oracle 11g DBA Training Course Content

Best Practices White Paper Using Oracle Database 10g Automatic Storage Management with FUJITSU Storage

Using RMAN to restore a database to another server in an ASM environment

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

Oracle TDE Tablespace Encryption

Oracle Data Recovery Advisor

What's the Point of Oracle Checkpoints? Harald van Breederode Oracle University 29-OCT-2009

This appendix describes the following procedures: Cisco ANA Registry Backup and Restore Oracle Database Backup and Restore

Oracle Database 12c: Admin, Install and Upgrade Accelerated

Backing Up Oracle Databases with Handy Backup

D12C-AIU Oracle Database 12c: Admin, Install and Upgrade Accelerated NEW

Oracle. Brief Course Content This course can be done in modular form as per the detail below. ORA-1 Oracle Database 10g: SQL 4 Weeks 4000/-

TECHNICAL REPORT. Nimble Storage Oracle Backup and Recovery Guide

Backup Types. Backup and Recovery. Categories of Failures. Issues. Logical. Cold. Hot. Physical With. Statement failure

Use RMAN to relocate a 10TB RAC database with minimum downtime. Tao Zuo tao_zuo@npd.com NPD Inc. 9/2011

HOW TO. RMAN Restore for Standby 10gR2

Agenda. Overview Configuring the database for basic Backup and Recovery Backing up your database Restore and Recovery Operations Managing your backups

Oracle 11g DBA Online Course - Smart Mind Online Training, Hyderabad. Oracle 11g DBA Online Training Course Content

Oracle 10g Feature: RMAN Incrementally Updated Backups

LOGGING OR NOLOGGING THAT IS THE QUESTION

ORACLE CORE DBA ONLINE TRAINING

Automatic Backup in Oracle Database

Oracle Backup and Recovery Best Practices Dell Compellent Storage Center. Dell Compellent Technical Best Practices

Getting all the pieces: Reliable Backup/Recovery

The safer, easier way to help you pass any IT exams. Exam : 1Z Upgrade Oracle9i/10g/11g OCA to Oracle Database 12c OCP.

Zen Internet. Online Data Backup. Zen Vault Professional Plug-ins. Issue:

Restoring To A Different Location With EBU And RMAN An AppsDBA Consulting White Paper

Oracle Backup & Recovery

RMAN BACKUP & RECOVERY. Recovery Manager. Veeratteshwaran Sridhar

ASM and for 3rd Party Snapshot Solutions - for Offhost. Duane Smith Nitin Vengurlekar RACPACK

BrightStor ARCserve Backup

HP LeftHand SAN Solutions

Using Recovery Manager with Oracle Data Guard in Oracle9i. An Oracle White Paper January 2007

NEC Storage NV Series

PRM For Oracle Database 3.1 GUI:

How To Restore An Org Server With Anor Backup For Windows (Oracle)

Oracle Database 10g: Backup and Recovery

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle server: An Oracle server includes an Oracle Instance and an Oracle database.

Clonación de una Base de Datos Oracle 11gR2 Activa usando RMAN. CLONACIÓN DE UNA BASE DE DATOS ORACLE 11gR2 ACTIVA USANDO RMAN

Using Recovery Manager with Oracle Data Guard in Oracle Database 10g. An Oracle White Paper April 2009

COURCE TITLE DURATION. Oracle Database 11g: Administration Workshop I

Oracle Recovery Manager 10g. An Oracle White Paper November 2003

D78850GC10. Oracle Database 12c Backup and Recovery Workshop. Summary. Introduction. Prerequisites

1 Backup/Restore Oracle 8i/9i

DisasterRecoverywith. DisasterRecoverywith Oracle Data Guard10gR2

Recreate Physical Standby Database after Recovery of Primary Database

ORACLE DATABASE 11G: COMPLETE

REDCENTRIC SOFTWARE ORACLE PLUG-IN FOR SOLARIS AGENT X86 VERSION

D12CBR Oracle Database 12c: Backup and Recovery Workshop NEW

Oracle Backup, Recovery, and Performance Tuning using EMC Avamar and Oracle RMAN

Rob Zoeteweij Zoeteweij Consulting

Oracle Database 11g: Administration Workshop II DBA Release 2

SAP with Oracle Real Application Clusters 11g Release 2 and Oracle Automatic Storage Management 11g Release 2

Maximum Availability Architecture. Oracle Best Practices For High Availability

Configuring Backup Settings Configuring and Managing Persistent Settings for RMAN Configuring Autobackup of Control File Backup optimization

Backup/Recovery Strategy and Impact on Applications. Jacek Wojcieszuk, CERN IT Database Deployment and Persistancy Workshop October, 2005

AV-004: Administering and Programming with ORACLE

The First Example of TimesTen with Oracle on Windows

Oracle Database 10g: Administration Workshop II Release 2

Backup and Recovery. Oracle RMAN 11 g. Oracle Press ORACLG. Matthew Hart. Robert G. Freeman. Mc Graw Hill. Lisbon London Madrid Mexico City Milan

Configuring Backup Settings. Copyright 2009, Oracle. All rights reserved.

Oracle Database 11g: Administration Workshop II DBA Release 2

Oracle Database Links Part 2 - Distributed Transactions Written and presented by Joel Goodman October 15th 2009

Oracle Database B

VMware Backup & Recovery

Oracle Database 11g: Administration Workshop II Release 2

Oracle Database 11g: Administration Workshop I Release 2

Zero Downtime Backup solution for Oracle10g

Oracle 9i Database Release 2 Enterprise Edition

Oracle Database 11g: Administration Workshop I Release 2

Why Not Oracle Standard Edition? A Dbvisit White Paper By Anton Els

Oracle Database 11g: Administration Workshop I

Encrypting MySQL data at Google. Jonas Oreland and Jeremy Cole

How To Recover From A Crash On An Orgsoorora Database

Oracle 11g Database Administration

Oracle 11g Administration

OCP: Oracle Database 12c Administrator Certified Professional Study Guide. Exam 1Z0-063

Enterprise DBA Part 1B: Backup and Recovery Workshop

Oracle Database 10g: Backup and Recovery 1-2

Demos - Workshop. -- Configure the RMAN

ORACLE DBA 11G TRAINING

Transcription:

Recover Oracle Database upon losing all Control Files R.Wang Oct 19, 07 (Firstly, published at OraclePoint.com ) Preface: This is experimental case study about recovering oracle database upon losing all control files. This experimental is conducted on Windows XP Professional with Oracle database 10.2.0 in archivelog mode Steps of Experiment 1. Backup control file SQL> alter database backup controlfile to 'C:\oracle\product\10.2.0\oradata\orcl\control_back.ctl'; 2. Add new tablespace SQL> create tablespace rec_test_1 datafile 'C:\oracle\product\10.2.0\oradata\orcl\rec_test_1.dbf' size 3M; Tablespace created. SQL> create table t_test_1 (n number) tablespace rec_test_1; Table created. SQL> insert into t_test_1 values(1); 1 row created. SQL> commit; Commit complete. 3. Do complete database shutdown and then database open SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started.

Total System Global Area 289406976 bytes Fixed Size 1248576 bytes Variable Size 121635520 bytes Database Buffers 159383552 bytes Redo Buffers 7139328 bytes Database mounted. Database opened. 4. Do incomplete shutdown (needs recovery) SQL> shutdown abort; ORACLE instance shut down. 5. Delete all control files (simulate media error) Delete all of the control files of database I m working on. 6. Find time point upon which you want to recover In alert log file (alert_orcl.log in my case), we noticed that following entries. Fri Oct 19 12:33:35 2007 alter database backup controlfile to 'C:\oracle\product\10.2.0\oradata\orcl\control_back.ctl' Fri Oct 19 12:33:36 2007 Completed: alter database backup controlfile to 'C:\oracle\product\10.2.0\oradata\orcl\control_back.ctl' Fri Oct 19 12:34:16 2007 create tablespace rec_test_1 datafile 'C:\oracle\product\10.2.0\oradata\orcl\rec_test_1.dbf' size 3M Fri Oct 19 12:34:16 2007 Completed: create tablespace rec_test_1 datafile 'C:\oracle\product\10.2.0\oradata\orcl\rec_test_1.dbf' size 3M Fri Oct 19 12:35:20 2007 In this case, we d like to recover the tablespace newly created. So, we pick the time point Fri Oct 19 12:35:20 2007 as showed in color red. 7. Check the latest written redo log file SQL> startup mount ORACLE instance started. Total System Global Area 289406976 bytes Fixed Size 1248576 bytes Variable Size 121635520 bytes Database Buffers 159383552 bytes Redo Buffers 7139328 bytes Database mounted. SQL> select group#, thread#, sequence#, bytes, members,archived, status from v$log; GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARCHIV STATUS ---------- ---------- ---------- ---------- ---------- ------ ---------------------- 1 1 1 52428800 1 NO CURRENT

3 1 0 52428800 1 YES UNUSED 2 1 0 52428800 1 YES UNUSED SQL> select group#, status, type, substr(member, 1,48) from v$logfile; GROUP# STATUS TYPE SUBSTR(MEMBER,1,48) ---------- -------------- -------------- -------------------------------------------------------------------------------------- 3 ONLINE C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO03.LOG 2 ONLINE C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG 1 ONLINE C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG So, the logfile C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG is the one we need to use to recover database. 8. Recover database upon the time point found above SQL> recover database using backup controlfile until time '2007-10-19 12:35:20'; ORA-00279: change 1129633 generated at 10/19/2007 12:31:52 needed for thread 1 C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2007_10_19\O1 _MF_1_20_%U_.ARC ORA-00280: change 1129633 for thread 1 is in sequence #20 C:\oracle\product\10.2.0\oradata\orcl\redo01.log ORA-00283: recovery session canceled due to errors ORA-01244: unnamed datafile(s) added to control file by media recovery ORA-01110: data file 7: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REC_TEST_1.DBF' ORA-01112: media recovery not started Due to backup control file was created before adding new tablespace, the control file doesn t contain information of newly created tablespace rec_test_1. Comparably, archived redo logfile contains the name of this tablespace. That s the reason that error ORA-01244 and ORA-01110 were raised. 9. Alter name of datafile which is not shown in backup control At this circumstance, the only thing we need to do is to change the name of data file 7 to datafile of newly created tablespace t_test_1. This action will have control file recognize the datafile of tablespace t_test_1. SQL> alter database create datafile 7 as 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REC_TEST_1.DBF';

10. Retry the recovery without identifying time point as of step 8 SQL> recover database using backup controlfile; ORA-00279: change 1129880 generated at 10/19/2007 12:34:16 needed for thread 1 C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2007_ 10_19\O1_MF_1_20_%U_.ARC ORA-00280: change 1129880 for thread 1 is in sequence #20 C:\oracle\product\10.2.0\oradata\orcl\redo01.log Log applied. Media recovery complete. After that, Log applied and Media recovery complete show that media recovery is done successfully. 11. Open database with resetlogs option SQL> alter database open resetlogs; SQL> select * from t_test_1; N ---------- 1 Query on table t_test_1 (in tablespace rec_test_1) is successful. That means database is recovered without losing tablespace rec_test_1. Note: 1. If the redo log file is not identified properly, the following error will occur. SQL> recover database using backup controlfile until time '2007-10-19 12:35:20'; ORA-00279: change 1129633 generated at 10/19/2007 12:31:52 needed for thread 1 C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2007_10 _19\O1_MF_1_20_%U_.ARC ORA-00280: change 1129633 for thread 1 is in sequence #20 C:\oracle\product\10.2.0\oradata\orcl\redo03.log ---- in this case, should be redo01.log ORA-00328: archived log ends at change 1129632, need later change 1129633 ORA-00334: archived log: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO03.LOG' ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: 'C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF'

2. It s impossible to recover database at this circumstance if the database is in noarchivelog mode. Ahout the Author: R. Wang currently works as Oracle DBA in Canada. He is responsible for database performance tuning and high availability. With over 10 years experience in architecting and building oracle systems, Rui is an evangelist for oracle technology and products. Rui is OCP and received master degree in computer science from Simon Fraser University in Canada. Visit Rui s blog at http://www.oraclepoint.com/oralife