Using RMAN Backup Files from Standby Database to Recover Primary

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

Database Disaster Recovery using only RMAN Backups

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

Recreate Physical Standby Database after Recovery of Primary Database

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

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

Oracle 10g Feature: RMAN Incrementally Updated Backups

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

HOW TO. RMAN Restore for Standby 10gR2

RMAN BACKUP & RECOVERY. Recovery Manager. Veeratteshwaran Sridhar

12. User-managed and RMAN-based backups.

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

DOCUMENTATION ORACLE BACKUP & RESTORE OPERATIONS

! " # #$ " " %" & "'( " "' ( ) " * ""! ). " / ( * ( "# 0! " ). '

Oracle Database 10g: Backup and Recovery

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

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

Database Recovery For Newbies

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

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

Oracle Database Cross Platform Migration Lucy Feng, DBAK

BrightStor ARCserve Backup

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

Oracle Data Guard for High Availability and Disaster Recovery

Recover Oracle Database upon losing all Control Files

11. Oracle Recovery Manager Overview and Configuration.

Oracle Backup and Recover 101. Osborne Press ISBN

TECHNICAL REPORT. Nimble Storage Oracle Backup and Recovery Guide

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

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

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

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

Cross Platform Transportable Tablespaces Migration in Oracle 11g

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

Oracle Database 12c Recovery Manager New Features

Oracle 11g DBA Training Course Content

Oracle 11g Database Administration

PRM For Oracle Database 3.1 GUI:

Oracle Database 10g: Backup and Recovery 1-2

Maximum Availability Architecture. Oracle Best Practices For High Availability

Installation Companion Oracle Data Guard on Amazon EC2 Configuration Guide

Disclaimer. Maximum Availability Architecture

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

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

High Performance Oracle RAC Clusters A study of SSD SAN storage A Datapipe White Paper

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

Oracle Database 12c: Admin, Install and Upgrade Accelerated

MAX_RMAN_08137_IGNORE=5 DISK_RETENTION_POLICY='RECOVERY WINDOW OF 7 DAYS'

Performing Database and File System Backups and Restores Using Oracle Secure Backup

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

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/-

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

ORACLE CORE DBA ONLINE TRAINING

Oracle Storage Options

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

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

Oracle Cloud Storage and File system

11. Configuring the Database Archiving Mode.

HP LeftHand SAN Solutions

Best Practices White Paper Using Oracle Database 11g R2 Automatic Storage Management with FUJITSU Storage (Windows version)

CA ARCserve Backup for Windows

Delivery Method: Instructor-led, group-paced, classroom-delivery learning model with structured, hands-on activities.

<Insert Picture Here> RMAN Configuration and Performance Tuning Best Practices

Getting all the pieces: Reliable Backup/Recovery

Oracle Database 10g: Administration Workshop II Release 2

Using Physical Replication and Oracle Database Standard Edition for Disaster Recovery. A Dbvisit White Paper

CA ARCserve Backup for Linux

Oracle Data Recovery Advisor

RMAN Recipes for Oracle Database 11g : A Problem-Solution Approach by Darl Kuhn, Sam Alapati and Arup Nanda Apress. (c) Copying Prohibited.

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

EMC Replication Manager Integration with Oracle Database Server

Ultimate Guide to Oracle Storage

DisasterRecoverywith. DisasterRecoverywith Oracle Data Guard10gR2

VMAX 3 AND ORACLE. Yaron Dar & Udgith Mankad VMAX Partner Engineering ORACLE BEST PRACTICES FOR REPLICATIONS, BACKUP/RECOVERY, AND PROTECTPOINT

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

Oracle Data Guard Fast Start Failover understood!

Rob Zoeteweij Zoeteweij Consulting

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

High Availability Databases based on Oracle 10g RAC on Linux

Oracle Data Guard. Caleb Small Puget Sound Oracle Users Group Education Is Our Passion

Exadata for Oracle DBAs. Longtime Oracle DBA

WHITE PAPER. Oracle RMAN Design Best Practices with Data Domain. Storage. Deduplication

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

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

Data virtualization: playing with Oracle 12c on Docker containers

Backing Up Oracle Databases with Handy Backup

Oracle Database: SQL and PL/SQL Fundamentals NEW

LOGGING OR NOLOGGING THAT IS THE QUESTION

Oracle Database 11g: Administration And Backup & Recover

Oracle VM Server Recovery Guide. Version 8.2

ORACLE DATABASE 11G: COMPLETE

Oracle Database B

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

How to Migrate your Database to Oracle Exadata. Noam Cohen, Oracle DB Consultant, E&M Computing

How to protect, restore and recover SQL 2005 and SQL 2008 Databases

About the Author About the Technical Contributors About the Technical Reviewers Acknowledgments. How to Use This Book

Oracle Database 11g: Administration Workshop II DBA Release 2

Setup Flashback Database on Data Guard Physical Standby Database for SAP Customers

Pass4Sure.1z0-034_120.Q&A

Transcription:

Oracle actively promotes the offloading of workload from the primary database to what would otherwise be a completely passive standby database. The suggestions for what to offload include reporting and backup tasks. This paper specifically focuses on taking backups from a physical standby database. The trigger for this work was a discussion in the office about taking backups from a physical standby. The sticking point was that some members of the team were of the belief that there are problems with using backups generated from a physical standby database to recover the primary database. Logic told me that the relationship between a primary database and its physical standby databases would mean that there should be no problems. A physical standby database is, in my mind at least, an image copy of the primary that is being updated with the transactions from the primary database via the redo stream. Anyway, it was time for some testing My Data Guard test system was built using Oracle VM Server and Oracle Enterprise Linux with Database 10g server templates. This made getting a system ready to test was pretty straightforward. The initial tests I conducted were to use an RMAN catalog in order to take backups from both the primary and standby databases. This gave me an insight into how backups from primary and standby databases work. The important points for me were: Providing the catalog is available to both primary and standby, both databases are aware of backupsets and copies regardless of which database they are created on. If you use RMAN to delete backupsets or copies from a node other than the one they are created on an error will be reported, as the files do not exist on the local filesystem. If a backupset is taken from a standby database then that backup set will be known to the primary database through the catalog. This means that the backupset pieces from the standby can be used for restores on the primary providing they are moved to the catalogued location on the primary. After the initial tests I attempted to use backupsets and copies taken from the physical standby database on the primary. This worked without problems and I reported my successes the following morning The challenge then became a little more restrictive, No, not using a recovery catalog. Oh, I m talking about with 9i. And, the database must be in managed recovery mode. So, with the new rules of engagement I set about my task. My logic was that without a recovery catalog I would need to use the CATALOG command in order to make RMAN (via the controlfile) aware of the backupsets or copies. The restriction of 9i meant that I could not use backupsets. So, the plan was: Martin Nash ORAganism 2009 Page 1 of 6

1. Use BACKUP AS COPY on the standby database 2. Remove a datafile from the primary 3. Copy the appropriate RMAN copy to the primary host 4. CATALOG the DATAFILECOPY on the primary host via RMAN 5. RESTORE the missing data file 6. RECOVER the newly restored data file 7. Open database And, this is what happened. Starting standby database on node 2... [oracle@dg02 ~]$ sqlplus /nolog SQL*Plus: Release 10.2.0.4.0 - Production on Fri Apr 10 10:19:08 2009 10:19:08 @> conn / as sysdba Connected to an idle instance. 10:19:16 SYS@dg10g> startup nomount ORACLE instance started. Total System Global Area 612368384 bytes 2085872 bytes 180358160 bytes Database Buffers 423624704 bytes Redo Buffers 6299648 bytes 10:19:25 SYS@dg10g> alter database mount standby database; Database altered. Elapsed: 00:00:09.70 10:19:45 SYS@dg10g> alter database recover managed standby database disconnect from session; Database altered. Elapsed: 00:00:07.03 10:20:22 SYS@dg10g> select process, status from v$managed_standby; PROCESS STATUS --------- ------------ ARCH CONNECTED ARCH CONNECTED MRP0 WAIT_FOR_LOG Elapsed: 00:00:00.00 10:20:42 SYS@dg10g> Starting primary database on node 1... [oracle@dg01 ~]$ sqlplus /nolog SQL*Plus: Release 10.2.0.4.0 - Production on Fri Apr 10 10:21:25 2009 10:21:25 @> conn / as sysdba Connected to an idle instance. 10:21:30 SYS@dg10g> startup ORACLE instance started. Total System Global Area 612368384 bytes 2085872 bytes 184552464 bytes Martin Nash ORAganism 2009 Page 2 of 6

Database Buffers Redo Buffers Database mounted. Database opened. 10:22:25 SYS@dg10g> 419430400 bytes 6299648 bytes Showing contents of RMAN repository on node 1... [oracle@dg01 ~]$ rman target / Recovery Manager: Release 10.2.0.4.0 - Production on Fri Apr 10 10:25:23 2009 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: DG10G (DBID=3174575825) list backupset; using target database control file instead of recovery catalog list copy; specification does not match any archive log in the recovery catalog Showing contents of RMAN repository on node 2... [oracle@dg02 ~]$ rman target / Recovery Manager: Release 10.2.0.4.0 - Production on Fri Apr 10 10:25:16 2009 Copyright (c) 1982, 2007, Oracle. All rights reserved. connected to target database: DG10G (DBID=3174575825, not open) list backupset; using target database control file instead of recovery catalog list copy; specification does not match any archive log in the recovery catalog Switching Logfile on node 1 10:27:06 SYS@dg10g> alter system switch logfile; System altered. Elapsed: 00:00:07.11 10:27:52 SYS@dg10g> Watching it being received on node 2 10:27:23 SYS@dg10g> select process, status from v$managed_standby; PROCESS STATUS --------- ------------ ARCH CLOSING ARCH OPENING MRP0 WAIT_FOR_LOG RFS RECEIVING 6 rows selected. Elapsed: 00:00:00.00 10:27:49 SYS@dg10g> Martin Nash ORAganism 2009 Page 3 of 6

Backing up datafile 1 from the standby... backup as copy datafile 1 format '/home/oracle/backup/%u.rman'; Starting backup at 10-APR-2009 10:32:15 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile copy input datafile fno=00001 name=+data/dg10g/datafile/system.272.682766427 output filename=/home/oracle/backup/data_d-dg10g_i-3174575825_ts-system_fno-1_1akc44pg.rman tag=tag20090410t103215 recid=25 stamp=683807601 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15 Finished backup at 10-APR-2009 10:33:31 Starting Control File and SPFILE Autobackup at 10-APR-2009 10:33:31 piece handle=+data/dg10g/autobackup/2009_04_10/s_683807266.331.683807613 comment=none Finished Control File and SPFILE Autobackup at 10-APR-2009 10:33:38 Confirming that RMAN on node 1 is not away of the copy list copy; List of Archived Log Copies Key Thrd Seq S Low Time Name ------- ---- ------- - -------------------- ---- 125 1 67 A 10-APR-2009 10:21:52 +DATA/dg10g/archivelog/2009_04_10/thread_1_seq_67.284.683807227 127 1 68 A 10-APR-2009 10:27:04 +DATA/dg10g/archivelog/2009_04_10/thread_1_seq_68.283.683807275 Crashing ASM instance on node 1 in order to remove datafile 1... ASM is aware that the RDBMS instance is accessing the datafile, so will not let it be removed. Performing a STARTUP FORCE on the ASM instance will shutdown abort the RDBMS instance and allow the datafile to be removed from within ASM. It has been pointed out that simply shutting down the RDBMS instance would have the same effect of allowing the removal of the datafile from ASM. [oracle@dg01 ~]$. oraenv ORACLE_SID = [dg10g]? +ASM [oracle@dg01 ~]$ sqlplus /nolog SQL*Plus: Release 10.2.0.4.0 - Production on Fri Apr 10 10:34:59 2009 10:34:59 @> conn / as sysdba Connected. 10:35:04 SYS@+ASM> startup force ASM instance started Total System Global Area 130023424 bytes 2082208 bytes 102775392 bytes ASM Cache 25165824 bytes ASM diskgroups mounted 10:35:24 SYS@+ASM> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0-64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Removing datafile 1 on node 1 [oracle@dg01 ~]$ asmcmd -p ASMCMD [+] > ls data/dg10g/datafile SYSAUX.279.682752985 SYSTEM.281.683806229 Martin Nash ORAganism 2009 Page 4 of 6

UNDOTBS1.278.682752907 USERS.280.683476541 ASMCMD [+] > rm data/dg10g/datafile/system.281.683806229 ASMCMD [+] > exit [oracle@dg01 ~]$ Attempting to start database on node 1... [oracle@dg01 ~]$ sqlplus /nolog SQL*Plus: Release 10.2.0.4.0 - Production on Fri Apr 10 10:40:19 2009 10:40:19 @> conn / as sysdba Connected to an idle instance. 10:40:23 SYS@dg10g> startup ORACLE instance started. Total System Global Area 612368384 bytes 2085872 bytes 184552464 bytes Database Buffers 419430400 bytes Redo Buffers 6299648 bytes Database mounted. ORA-01157: cannot identify/lock data file 1 - see DBWR trace file ORA-01110: data file 1: '+DATA/dg10g/datafile/system.281.683806229' 10:40:40 SYS@dg10g> Copying data file copy backed up on node 2 (standby) to node 1 [oracle@dg02 ~]$ scp backup/data_d-dg10g_i-3174575825_ts-system_fno-1_1akc44pg.rman dg01:./backup/ oracle@dg01's password: data_d-dg10g_i-3174575825_ts-system_fno-1_1akc44pg.rman 100% 610MB 38.1MB/s 00:16 [oracle@dg02 ~]$ Catalog the copied data file on node 1 (primary)... catalog datafilecopy '/home/oracle/backup/data_d-dg10g_i-3174575825_ts-system_fno- 1_1akc44pg.rman'; cataloged datafile copy datafile copy filename=/home/oracle/backup/data_d-dg10g_i-3174575825_ts-system_fno- 1_1akc44pg.rman recid=36 stamp=683808283 Restore data file 1 on node 1 (primary)... restore datafile 1; Starting restore at 10-APR-2009 10:45:20 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=151 devtype=disk channel ORA_DISK_1: restoring datafile 00001 input datafile copy recid=36 stamp=683808283 filename=/home/oracle/backup/data_d-dg10g_i- 3174575825_TS-SYSTEM_FNO-1_1akc44pg.rman destination for restore of datafile 00001: +DATA/dg10g/datafile/system.281.683806229 channel ORA_DISK_1: copied datafile copy of datafile 00001 output filename=+data/dg10g/datafile/system.281.683808321 recid=37 stamp=683808398 Finished restore at 10-APR-2009 10:46:46 Recover data file 1 on node 1 (primary)... Martin Nash ORAganism 2009 Page 5 of 6

recover datafile 1; Starting recover at 10-APR-2009 10:46:53 using channel ORA_DISK_1 starting media recovery media recovery complete, elapsed time: 00:00:03 Finished recover at 10-APR-2009 10:46:57 Open database on node 1 (primary)... alter database open; database opened Confirm database role 10:47:39 SYS@dg10g> select database_role from v$database; DATABASE_ROLE ---------------- PRIMARY Elapsed: 00:00:00.19 10:47:59 SYS@dg10g> Confirm that node 2 is still in managed recovery mode... 10:48:26 SYS@dg10g> select process, status from v$managed_standby; PROCESS STATUS --------- ------------ ARCH CLOSING ARCH CLOSING MRP0 WAIT_FOR_LOG Elapsed: 00:00:00.00 10:48:28 SYS@dg10g> select database_role from v$database; DATABASE_ROLE ---------------- PHYSICAL STANDBY Elapsed: 00:00:00.01 10:48:41 SYS@dg10g>... I think that proves that you do not need to use a RMAN catalog, you can use Oracle 9i commands only and you do not have to stop managed recover in order to use the backups taken from a standby database in order to recover a primary. OK, there are some restrictions. Well, there is one restriction that seems pretty important: the fact that you cannot CATALOG backupsets in 9i. But, that has gone in 10g. So, that s another reason to upgrade. Obviously there are many factors to consider before moving all backups from the primary site to a physical standby and I would be very interested to hear from people who have encountered problems using a physical standby to perform their backups. Martin Nash ORAganism 2009 Page 6 of 6