Kamran Agayev's Oracle Blog

Oracle Certified Master

Archive for the 'RMAN Backup and Recovery' Category

RMAN “Catalog start with” returns “no files found to be unknown to the database”

Posted by Kamran Agayev A. on 2nd January 2016

Interesting issue happened today (running 11.2.0.3 DB on Linux) while using “CATALOG START WITH” command in RMAN. Although I was having all backups under /orabackup folder, RMAN didn’t find anything, reporting “no files found to be unknown to the database” message:

RMAN> catalog start with ‘/orabackup’;

searching for all files that match the pattern /orabackup
no files found to be unknown to the database

RMAN>

 

I changed the permission to “chmod 777” and checked the owner, used different patterns like “/orabackup/*”, “/orabackup/” and  “/orabackup/*.bkp” but failed. Then I decided to create a folder under the /orabackup folder, moved all files in it and tried “CATALOG START WITH” command again, and succeeded.

RMAN> catalog start with ‘/orabackup’;

searching for all files that match the pattern /orabackup
no files found to be unknown to the database

RMAN>

[oracle@db1 ~]$ cd /orabackup/
[oracle@db1 orabackup]$ mkdir test
[oracle@db1 orabackup]$ mv *.bkp test/
RMAN> catalog start with ‘/orabackup/test’;

searching for all files that match the pattern /orabackup/test

List of Files Unknown to the Database
=====================================
File Name: /orabackup/test/mydb_database_btqqatr2_1_1.bkp
File Name: /orabackup/test/mydb_database_bsqqakoq_1_1.bkp
File Name: /orabackup/test/mydb_arch_buqqatrp_1_1.bkp
File Name: /orabackup/test/mydb_contolfile_bvqqatsc_1_1.bkp
File Name: /orabackup/test/mydb_spfile_c0qqatsk_1_1.bkp

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files…
cataloging done

List of Cataloged Files
=======================
File Name: /orabackup/test/mydb_database_btqqatr2_1_1.bkp
File Name: /orabackup/test/mydb_database_bsqqakoq_1_1.bkp
File Name: /orabackup/test/mydb_arch_buqqatrp_1_1.bkp
File Name: /orabackup/test/mydb_contolfile_bvqqatsc_1_1.bkp
File Name: /orabackup/test/mydb_spfile_c0qqatsk_1_1.bkp

RMAN>

 

 

Posted in Administration, RMAN Backup and Recovery | 11 Comments »

My book is published!

Posted by Kamran Agayev A. on 13th September 2013

My book is out!

I would like to announce to all my fellow DBA friends that my book is published and is available at Amazon.

http://www.amazon.com/Oracle-Backup-Recovery-secrets-In-Focus/dp/0984428232/

It took me more than one year to write it. 3 years ago I got an email from Rampant Techpress where they asked me if I can write a book about RMAN Backup and Recovery. I wasn’t ready at that time, but decided to accept that challenge and agreed. The first man came in my mind to help me at that time was my friend Aman Sharma. He also agreed and we started the journey together.

After writing the first chapter I realized that we really need to have technical reviewers, so I asked Syed Sabdar and Hemant K. Chitale if they can help us. Fortunately they agreed.  I would like to thank them both as they did a great job and made a lot of corrections

All chapters are based on practical scenarios and deep research and I hope it will help you to understand RMAN in depth, to create your own RMAN backup strategy and to recover from any type of failures you can face in your production database. There’re a lot of scenarios under each chapter with an explanation and step by step guide to help you to reproduce them on your test environment

book

Posted in Administration, RMAN Backup and Recovery | 14 Comments »

RMAN Video Tutorial Series – Using Virtual Private Catalog in RMAN 11g

Posted by Kamran Agayev A. on 19th October 2010

In this video tutorial I demonstrate the new feature of RMAN that comes with Oracle 11g – Virtual Private Catalog. Enjoy it

To download the .mp4 format of this file, use the following link:

http://www.kamranagayev.com/Video_Tutorials/Virtual_Private_Catalog.mp4

Here’s the direct vimeo link of the tutorial:

http://vimeo.com/15962290

Posted in RMAN Backup and Recovery, Video Tutorials | 6 Comments »

RMAN Video Tutorial Series – Upgrading and Moving Recovery Catalog with IMPORT CATALOG command using RMAN in Oracle 11g

Posted by Kamran Agayev A. on 18th October 2010

In this video tutorial I demonstrate the scenario where I upgrade the recovery catalog with UPGRADE CATALOG command from Oracle 10g to 11g and move it to the second recovery catalog using new command that is introduced in Oracle 11g – IMPORT CATALOG. Enjoy it

To download the .mp4 format of this file, use the following link:

http://www.kamranagayev.com/Video_Tutorials/Import_Catalog.mp4

Here’s the direct vimeo link of the tutorial:

http://www.vimeo.com/15924303

Posted in RMAN Backup and Recovery, Video Tutorials | 6 Comments »

RMAN Video Tutorial Series – Cloning database without connecting to the target database and recovery catalog in Oracle 11gR2

Posted by Kamran Agayev A. on 24th August 2010

In this video tutorial I show the cloning of the database using RMAN without connecting to the target database and recovery catalog. Enjoy it

 

 

To download the .mp4 format of this file, use the following link:

http://www.kamranagayev.com/Video_Tutorials/RMAN_11gR2_duplicate_feature.mp4

Posted in RMAN Backup and Recovery, Video Tutorials | 17 Comments »

RMAN Video Tutorial Series – Convert database from Windows to Linux using RMAN

Posted by Kamran Agayev A. on 20th August 2010

In this video tutorial I show the convertion of the database from Windows to Linux using CONVERT DATABASE command in RMAN. Enjoy it

To download the .mp4 version of this file, use the following link

http://www.kamranagayev.com/Video_Tutorials/RMAN_Convert_Database.mp4

Posted in RMAN Backup and Recovery, Video Tutorials | 44 Comments »

Oracle Flashback Data Archive (Total Recall)

Posted by Kamran Agayev A. on 21st July 2010

Starting from Oracle 11g version, it’s possible to keep every transaction made to the table and keep it as long as you want. Before 11g, in order to get before image of any row, either we were getting it from archived redo log files (if they are kept) using Log Miner, or were writing a trigger to save the data in another log table. But now, using Flashback Data Archive feature, we don’t need to use Log Miner or trigger to track changes made to the table. The new background process, FBDA (Flashback Data Archive) tracks all changes made to the table and stores it in a file in a compressed and partitioned format. However, you can’t use this feature with clustered, temporary, nested, remote or external tables and LONG or nested columns

It tracks all transactional changes made to specific tables for the specific time interval. To use Flashback Data Archive feature the user needs to have the FLASHBACK ARCHIVE ADMINISTER system privilege. Moreover, the FLASHBACK ARCHIVE object privilege should be granted to the user to enable historical data tracking. In the following scenario we show you the configuration and usage of this feature in detailed examples

–          Create a new user and grant him the required privileges:

[sourcecode]

SQL> create user usr identified by usr;

User created.

SQL> grant connect, resource, flashback archive administer to usr;

Grant succeeded.

SQL>  [/sourcecode]

–          Create a new separate tablespace for data archive

[sourcecode]

SQL> CREATE TABLESPACE tbs_arch DATAFILE ‘c:\flashback_archive.dbf’ size 10m;

Tablespace created.

SQL> [/sourcecode]

–          Create flashback archive on this tablespace using CREATE FLASHBACK ARCHIVE command as follows:

[sourcecode] SQL> create flashback archive fl_archive

  2  tablespace tbs_arch retention 1 year;

Flashback archive created.

SQL> [/sourcecode]

With above command we’ve created a Flashback Archive named FL_ARCHIVE which resides in the tablespace TBS_ARCH and holds information for 1 year. It means that we can use any Flashback Query which contains 1 year historical information regarding the table that assigned to this flashback archive

–          Now, create a table, insert one row and assign it to this flashback archive:

[sourcecode] SQL> create table tbl_fl_archive (id number, name varchar2(20));

Table created.

SQL> insert into tbl_fl_archive values(1,’Flashback Archive’);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from tbl_fl_archive;

        ID NAME

———- ——————–

         1 Flashback Archive

SQL> alter table tbl_fl_archive flashback archive fl_archive;

Table altered.

SQL> [/sourcecode]

The historical change on the table TBL_FL_ARCHIVE is now will be written to the flashback archive named FL_ARCHIVE.

–          To test it, delete all rows and use Flashback Query on that table. Remember, it will not look for the UNDO data, it will look to the flashback archive file for the changes

[sourcecode] SQL> select to_char(sysdate,’ddmmyyyy hh24:mi:ss’) ddate from dual;

DDATE

—————–

13022010 12:46:49

SQL> delete from tbl_fl_archive;

1 row deleted.

SQL> commit;

Commit complete.

SQL> select * from tbl_fl_archive;

no rows selected

SQL> select * from tbl_fl_archive as of timestamp to_timestamp(‘13022010 12:46:49′,’ddmmyyyy hh24:mi:ss’);

        ID NAME

———- ——————–

         1 Flashback Archive

SQL>  [/sourcecode]

In order to show and proof that it doesn’t look to the UNDO tablespace for the historical information on the rows for the specific time, create new undo tablespace and make it default by dropping the old one. Then use Flashback Versions on that table:

[sourcecode] SQL> conn / as sysdba

Connected.

SQL> show parameter undo_tablespace;

NAME                                 TYPE        VALUE

——————— ———–    ———   ————

undo_tablespace                      string      UNDOTBS1

SQL> select a.name from v$datafile a, v$tablespace b where a.ts#=b.ts# and b.name=’UNDOTBS1′;

NAME

————————————————

C:\APP\ADMINISTRATOR\ORADATA\DB2\UNDOTBS01.DBF

SQL> create undo tablespace undotbs2 datafile ‘C:\APP\ADMINISTRATOR\ORADATA\DB2\UNDOTBS02.dbf’ size 10m;

Tablespace created.

SQL> alter system set undo_tablespace=’UNDOTBS2′;

System altered.

SQL> startup force

ORACLE instance started.

Total System Global Area  431038464 bytes

Fixed Size                  1333676 bytes

Variable Size             251659860 bytes

Database Buffers          171966464 bytes

Redo Buffers                6078464 bytes

Database mounted.

Database opened.

SQL> show parameter undo_tablespace;

NAME                                 TYPE        VALUE

—————————              ———– ————

undo_tablespace                      string      UNDOTBS2 [/sourcecode]

As you see, we’re currently using the different UNDO tablespace that hasn’t any information about before images of data blocks of the TBL_FL_ARCHIVE. Now, let’s use Flashback Query against to that table:

[sourcecode] SQL> conn us1/us1

Connected.

SQL> select * from tbl_fl_archive as of timestamp to_timestamp(‘13022010 12:45:30′,’ddmmyyyy hh24:mi:ss’);

        ID NAME

———- ——————–

         1 Flashback Archive

SQL>  [/sourcecode]

This query gets the data from Flashback Data Archive

Modify the Flashback Data Archive

 

Use ALTER FLASHBACK ARCHIVE command to change the retention time, purge data or add or remove the tablespace. For this you need to have FLASHBACK ARCHIVE ADMINISTER privilege granted.  

–          To change the retention time, use:

[sourcecode] SQL> alter flashback archive fl_archive modify retention 6 month;

Flashback archive altered.

SQL> [/sourcecode]

–          To change tablespace quota of the tablespace that is used by a flashback data archive, use:

[sourcecode] SQL> alter flashback archive fl_archive add tablespace tbs_arch quota 50m;

Flashback archive altered.

SQL> [/sourcecode]

–          To add another tablespace for flashback data archive, use:

[sourcecode] SQL> create tablespace tbs_arch2 datafile ‘c:\flashback_archive2.dbf’ size 10m;

Tablespace created.

SQL> alter flashback archive fl_archive add tablespace tbs_arch2 quota 10m;

Flashback archive altered.

SQL> [/sourcecode]

–          To remove the tablespace from use by flashback data archive, use:

[sourcecode] SQL> alter flashback archive fl_archive remove tablespace tbs_arch2;

Flashback archive altered.

SQL> [/sourcecode]

–          To purge the data that’s in Flashback Data Archive, use PURGE BEFORE SCN (TIMESTAMP) or PURGE ALL as follows:

[sourcecode] SQL> ALTER FLASHBACK ARCHIVE fl_archive PURGE ALL;

Flashback archive altered.

SQL> ALTER FLASHBACK ARCHIVE fl_archive purge before timestamp to_timestamp(‘13022010 12:49:30′,’ddmmyyyy hh24:mi:ss’);

Flashback archive altered.

SQL> ALTER FLASHBACK ARCHIVE fl_archive purge before scn 988827;

Flashback archive altered.

SQL> [/sourcecode]

Dropping Flashback Data Archive

 

To drop flashback data archive use:

[sourcecode] SQL> drop flashback archive fl_archive;

Flashback archive dropped.

SQL> [/sourcecode]

Using default Flashback Data Archive for the system

 

As default, Oracle doesn’t use any flashback data archive. To set default flashback data archive, use the following command by connecting as SYS user:

[sourcecode] SQL> conn / as sysdba

Connected.

SQL> alter flashback archive fl_arc set default;

Flashback archive altered.

SQL> [/sourcecode]

By setting default flashback data archive, you will not need to specify it manually on each table you want to keep changes

To disable flashback archive for a table, use:

 

[sourcecode] SQL> alter table tbl_fl_archive no flashback archive;

Table altered.

SQL> [/sourcecode]

Query Flashback Data Archive

 

There’re mainly three views that are used to query the information regarding Flashback Data Archive.

The first view is DBA_FLASHBACK_ARCHIVE which gives information about Flashback Data Archive files

[sourcecode] SQL> select * from dba_flashback_archive;

FLASHBACK_ARCHIVE_NAME FLASHBACK_ARCHIVE# RETENTION_IN_DAYS CREATE_TIME

LAST_PURGE_TIME     

—————      ————–             ————  ———-

FL_ARCH                       2                 365           13-FEB-10

08.05.14.000000000 PM                    13-FEB-10 08.05.14.000000000 PM  [/sourcecode]

The second view is DBA_FLASHBACK_ARCHIVE_TS which gives information about tablespace that contains flashback data archives:

[sourcecode] SQL> select * from dba_flashback_archive_ts;

FLASHBACK_ARCHIVE_NAME       FLASHBACK_ARCHIVE#  TABLESPACE_NAME QUOTA_IN_MB

——————     —————–   ————-    ———-

FL_ARCH                        2                TBS_ARCH        FL_ARC [/sourcecode]

The third view is FLASHBACK_ARCHIVE_TABLES which displays the information of the tables that uses Flashback Data Archive:

[sourcecode] SQL> select * from dba_flashback_archive_tables;

TABLE_NAME    OWNER_NAME    FLASHBACK_ARCHIVE_NAME   ARCHIVE_TABLE_NAME

———-    ———-    ———————-   ——————

TBL_FL_ARCHIVE  US1        FL_ARC               SYS_FBA_HIST_69845 [/sourcecode]

As it was told above, Flashback Data Archie technology stores data in Compressed and Partitioned format. It should be checked easily. Get the name of the main table that’s used to store the data and query USER_TAB_PARTITIONS view as follows:

[sourcecode] SQL> select table_name,tablespace_name from user_tables;

TABLE_NAME                     TABLESPACE_NAME

—————————— ——————————

SYS_FBA_HIST_69845

SYS_FBA_TCRV_69845             TBS_ARCH

SYS_FBA_DDL_COLMAP_69845       TBS_ARCH

TBL_FL_ARCHIVE                 USERS

SQL> select table_name, partition_name, compression, compress_for from user_tab_partitions where table_name=’SYS_FBA_HIST_69845′;

TABLE_NAME                     PARTITION_NAME                 COMPRESS

—————-           ————–                 ———

SYS_FBA_HIST_69845             HIGH_PART                      ENABLED 

SQL> [/sourcecode]

Posted in RMAN Backup and Recovery | 15 Comments »

RMAN Video Tutorial Series – Creating Duplicate and Standby database using RMAN

Posted by Kamran Agayev A. on 25th June 2010

In this video tutorial I show creation of duplicate and standby database using RMAN. Enjoy it

 

To download the .mp4 version of this file, use the following link

http://www.kamranagayev.com/Video_Tutorials/Duplicate_and_Standby_database_with_RMAN.mp4

Posted in RMAN Backup and Recovery | 36 Comments »

RMAN Data Recovery Advisor in Oracle 11g – scenario based explanation

Posted by Kamran Agayev A. on 21st May 2010

One of the great new features of RMAN in Oracle 11g is the new tool named Data Recovery Advisor. This tool automates the diagnose of the data failure and corruption, advises the recovery steps and performs automatic recovery of the database failure.  This tool could be used from GUI as well as from CLI.

In the following scenario we’ll use Data Recovery Advisor to recover the lost data

–          We have three tablespaces (USERS, USERS02, USERS03)

–          We create two tables on two tablespaces (tbl_test01 on USERS and tbl_test02 on USERS02)

–          We corrupt the datafiles of USERS and USERS02 tablespace and delete the USERS03 datafile

–          Using LIST FAILURE command we see list three data failure (two data block corruption and one missing datafile)

–          We get advice for all these problems and manually restore the third datafile and recover it

–          We use REPAIR FAILURE command to make RMAN automatically repair the data block corruption

Let’s start performing the above scenario

–          Create two new tablespaces (USERS02, USER03) and create two tables on USERS and USERS02 tablespaces.

[sourcecode] SQL> create tablespace users02 datafile ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS02.DBF’ size 1m;

Tablespace created.

SQL> create tablespace users03 datafile ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS03.DBF’ size 1m;

Tablespace created.

SQL> create table tbl_test01 (name varchar2(10)) tablespace users;

Table created.

SQL> create table tbl_test02 (name varchar2(10)) tablespace users02;

Table created.

SQL> insert into tbl_test01 values(‘my_test01’);

1 row created.

SQL> insert into tbl_test02 values(‘my_test02’);

1 row created.

SQL> commit;

Commit complete.

SQL>

[/sourcecode]

–          Take backup of the database

[sourcecode] RMAN> backup database plus archivelog; [/sourcecode]

–          Corrupt the datafiles using techniques that are described in the Performing Block Media Recovery with RMAN video tutorial. Then flush the buffer cache and query the table. You’ll get “ORA-01578: ORACLE data block corrupted” error. Query the V$DATABASE_BLOCK_CORRUPTION view. You can get an empty result, however after a while Oracle automatically detects and updates the view. Then shutdown the database, delete the datafile that belongs to the USERS03 tablespace, mount the database and use ALTER DATABASE DATAFILE ‘path_of_the_users03.dbf’ OFFLINE; command to make it offline and start the database:

[sourcecode]

SQL> alter system flush buffer_cache;

System altered.

SQL> select * from tbl_test01;

select * from tbl_test01

              *

ERROR at line 1:

ORA-01578: ORACLE data block corrupted (file # 4, block # 72)

ORA-01110: data file 4: ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS01.DBF’

SQL> alter system flush buffer_cache;

System altered.

SQL> select * from tbl_test02;

select * from tbl_test02

              *

ERROR at line 1:

ORA-01578: ORACLE data block corrupted (file # 5, block # 16)

ORA-01110: data file 5: ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS02.DBF’

SQL> select * from v$database_block_corruption;

no rows selected

[/sourcecode]

Wait a while and run the command again:

[sourcecode]

SQL> select * from v$database_block_corruption;

     FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# CORRUPTIO

———- ———- ———- —————— ———

         4         72          1                  0 CHECKSUM

         5         16          1                  0 CHECKSUM

SQL> shut abort

SQL> startup mount;

SQL> alter database datafile ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS03.DBF’ offline;

Database altered.

SQL> alter database open;

Database altered.

SQL>

[/sourcecode]

–          Now use LIST FAILURE command to let RMAN gather the data failures you have:

[sourcecode] C:\>rman target /

RMAN> list failure;

using target database control file instead of recovery catalog

List of Database Failures

=========================

Failure ID Priority Status    Time Detected Summary

———- ——– ——— ————- ——-

328        HIGH     OPEN      20-MAY-10     One or more non-system datafiles are  missing

308        HIGH     OPEN      20-MAY-10     Datafile 5: ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS02.DBF’ contains one or more corrupt blocks

122        HIGH     OPEN      20-MAY-10     Datafile 4: ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS01.DBF’ contains one or more corrupt blocks

You can get detailed information on any listed failure:

RMAN> list failure 328 detail;

List of Database Failures

=========================

Failure ID Priority Status    Time Detected Summary

———- ——– ——— ————- ——-

328        HIGH     OPEN      20-MAY-10     One or more non-system datafiles are

 missing

  Impact: See impact for individual child failures

  List of child failures for parent failure ID 328

  Failure ID Priority Status    Time Detected Summary

  ———- ——– ——— ————- ——-

  331        HIGH     OPEN      20-MAY-10     Datafile 6: ‘C:\APP\ADMINISTRATOR\ORADATA\TT\USERS03.DBF’ is missing

    Impact: Some objects in tablespace USERS03 might be unavailable

–          Now use ADVISE FAILURE command to get necessary advises and ready scripts to perform a recovery

RMAN> advise failure all;

List of Database Failures

=========================

Failure ID Priority Status    Time Detected Summary

———- ——– ——— ————- ——-

328        HIGH     OPEN      20-MAY-10     One or more non-system datafiles ar

 missing

308        HIGH     OPEN      20-MAY-10     Datafile 5: ‘C:\APP\ADMINISTRATOR\O

ADATA\TT\USERS02.DBF’ contains one or more corrupt blocks

122        HIGH     OPEN      20-MAY-10     Datafile 4: ‘C:\APP\ADMINISTRATOR\O

ADATA\TT\USERS01.DBF’ contains one or more corrupt blocks

analyzing automatic repair options; this may take some time

using channel ORA_DISK_1

analyzing automatic repair options complete

Mandatory Manual Actions

========================

no manual actions available

Optional Manual Actions

=======================

1. If file C:\APP\ADMINISTRATOR\ORADATA\TT\USERS03.DBF was unintentionally renaed or moved, restore it

Automated Repair Options

========================

Option Repair Description

—— ——————

1      Restore and recover datafile 6; Perform block media recovery of block 16 in file 5; Perform block media recovery of block 72 in file 4

  Strategy: The repair includes complete media recovery with no data loss

  Repair script: c:\app\administrator\diag\rdbms\tt\tt\hm\reco_3231280737.hm

RMAN>

[/sourcecode]

So we have a detailed information on what we have and how we can perform a recovery. We need to restore and recover the datafile 6 and perform block media recovery on datafile 4 and 5. RMAN created a script which could be run to perform the whole recovery. Here’s the source of the script:

[sourcecode]

   # restore and recover datafile

   sql ‘alter database datafile 6 offline’;

   restore datafile 6;

   recover datafile 6;

   sql ‘alter database datafile 6 online’;

   # block media recovery

   recover datafile 5 block 16

   datafile 4 block 72;

[/sourcecode]

Let’s perform the first action manually. So run the following commands in RMAN

[sourcecode] RMAN>    sql ‘alter database datafile 6 offline’;

RMAN>    restore datafile 6;

RMAN>    recover datafile 6;

RMAN>    sql ‘alter database datafile 6 online’;

Now use ADVISE FAILURE command again.  It will diagnose the failures and update the result:

RMAN> advise failure all;

List of Database Failures

=========================

Failure ID Priority Status    Time Detected Summary

———- ——– ——— ————- ——-

308        HIGH     OPEN      20-MAY-10     Datafile 5: ‘C:\APP\ADMINISTRATOR\OR

ADATA\TT\USERS02.DBF’ contains one or more corrupt blocks

122        HIGH     OPEN      20-MAY-10     Datafile 4: ‘C:\APP\ADMINISTRATOR\OR

ADATA\TT\USERS01.DBF’ contains one or more corrupt blocks

analyzing automatic repair options; this may take some time

using channel ORA_DISK_1

analyzing automatic repair options complete

Mandatory Manual Actions

========================

no manual actions available

Optional Manual Actions

=======================

no manual actions available

Automated Repair Options

========================

Option Repair Description

—— ——————

1      Perform block media recovery of block 16 in file 5; Perform block media recovery of block 72 in file 4

  Strategy: The repair includes complete media recovery with no data loss

  Repair script: c:\app\administrator\diag\rdbms\tt\tt\hm\reco_1778061078.hm

[/sourcecode]

–          Now let’s preview the repair plan of RMAN and repair all data. For this, use REPAIR FAILURE PREVIEW command and REPAIR FAILURE as follows:

[sourcecode]

RMAN> repair failure preview;

Strategy: The repair includes complete media recovery with no data loss

Repair script: c:\app\administrator\diag\rdbms\tt\tt\hm\reco_1778061078.hm

contents of repair script:

   # block media recovery

   recover datafile 5 block 16

   datafile 4 block 72;

RMAN> repair failure;

Strategy: The repair includes complete media recovery with no data loss

Repair script: c:\app\administrator\diag\rdbms\tt\tt\hm\reco_1778061078.hm

contents of repair script:

   # block media recovery

   recover datafile 5 block 16

   datafile 4 block 72;

Do you really want to execute the above repair (enter YES or NO)? YES

executing repair script

Starting recover at 20-MAY-10

using channel ORA_DISK_1

channel ORA_DISK_1: restoring block(s)

channel ORA_DISK_1: specifying block(s) to restore from backup set

restoring blocks of datafile 00005

restoring blocks of datafile 00004

<…output trimmed ….>

<…output trimmed ….>

starting media recovery

media recovery complete, elapsed time: 00:00:07

Finished recover at 20-MAY-10

repair failure complete

RMAN>

[/sourcecode]

–          Now query the tables:

[sourcecode]

SQL> select * from tbl_test01;

NAME

———-

my_test01

SQL> select * from tbl_test02;

NAME

———-

my_test02

SQL>

[/sourcecode]

Posted in Administration, RMAN Backup and Recovery | 7 Comments »

RMAN VIDEO Tutorial series – Performing Block Media Recovery with RMAN

Posted by Kamran Agayev A. on 18th March 2010

Today I want to show you the demonstration of the article that was posted before on “Corruption data block and performing block media recovery”. I’ll try to prepare series of video tutorials on different Backup and Recovery scenarios using RMAN which is covered in my book – “Oracle Backup & Recovery: Expert secrets for using RMAN and Data Pump

This video tutorial explains the manual block corruption techniques both on Linux and Windows (which shouldn’t be tested on production database!) and performing Block Media Recovery with RMAN. Enjoy it!

To download the .mp4 format of this video, use the following link:

http://www.kamranagayev.com/Video_Tutorials/Block_Media_Recovery.mp4

Posted in RMAN Backup and Recovery, Video Tutorials | 15 Comments »