<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Oracle - Concepts et Exemples &#187; Recovery Cases</title>
	<atom:link href="https://blog.developpez.com/pachot/category/microlearning/rman/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.developpez.com/pachot</link>
	<description>Les fonctionalités et concepts d&#039;Oracle à partir de traductions et de démos</description>
	<lastBuildDate>Sun, 03 Apr 2016 20:36:21 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Recovery cases: un bloc corrompu</title>
		<link>https://blog.developpez.com/pachot/recovery-cases-un-bloc-corrompu/</link>
		<comments>https://blog.developpez.com/pachot/recovery-cases-un-bloc-corrompu/#comments</comments>
		<pubDate>Sun, 24 Nov 2013 22:00:11 +0000</pubDate>
		<dc:creator><![CDATA[pachot]]></dc:creator>
				<category><![CDATA[Recovery Cases]]></category>
		<category><![CDATA[bloc corrompu]]></category>
		<category><![CDATA[RMAN]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/pachot/?p=1049</guid>
		<description><![CDATA[Recovery en cas de bloc corrompu. Au lieu de restaurer tout un datafile, on peut ne restaurer que les blocs corrompus. S&#8217;il y en a peu, c&#8217;est plus rapide et évite de mettre le datafile offline. Ici un exemple sur &#8230; <a href="https://blog.developpez.com/pachot/recovery-cases-un-bloc-corrompu/">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recovery en cas de bloc corrompu. Au lieu de restaurer tout un datafile, on peut ne restaurer que les blocs corrompus. S&rsquo;il y en a peu, c&rsquo;est plus rapide et évite de mettre le datafile offline.<br />
<span id="more-1049"></span><br />
Ici un exemple sur une base de demo créée <a href="http://blog.developpez.com/pachot/cas-de-recovery-en-12c/" title="Cas de recovery en 12c">ici</a>.</p>
<p>Voici les blocs qui stokent les données de OE.ORDERS:</p>
<pre>
RMAN&gt; select file_id,block_id,blocks from dba_extents where owner='OE' and segment_name='ORDERS';
using target database control file instead of recovery catalog
   FILE_ID   BLOCK_ID     BLOCKS
---------- ---------- ----------
         2        968          8
</pre>
<p>8 blocs alloués à partir du bloc 968. Je vais corrompre le bloc 971 en lui mettant des données aléatoires avec la commande dd, et je vérivie avec dbv:</p>
<pre>
+ dd if=/dev/urandom count=1 bs=8k seek=971 of=/u/DEMO/DATA/DEMO100/example01.dbf conv=notrunc
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 0.00157981 s, 5.2 MB/s

+ dbv /u/DEMO/DATA/DEMO100/example01.dbf
DBVERIFY - Verification starting : FILE = /u/DEMO/DATA/DEMO100/example01.dbf
Page 971 is marked corrupt
Corrupt block relative dba: 0x028003cb (file 10, block 971)
Bad header found during dbv:
Data in bad block:
 type: 90 format: 3 rdba: 0xfd75bf2c
 last change scn: 0xd97e.9447efe5 seq: 0xc7 flg: 0x96
 spare1: 0x80 spare2: 0x4f spare3: 0x225f
 consistency value in tail: 0x767ce7f0
 check value in block header: 0xe831
 computed block checksum: 0x9a28
</pre>
<p>Le bloc est bien corrompu, d’où l’erreur suivante lors d&rsquo;un select:</p>
<pre>
RMAN&gt; alter system flush buffer_cache;
using target database control file instead of recovery catalog
Statement processed
RMAN&gt; select /*+ FULL(ORDERS) */ count(*) from OE.ORDERS;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 11/17/2013 20:16:06
ORA-01578: ORACLE data block corrupted (file # 2, block # 971)
ORA-01110: data file 2: '/u/DEMO/DATA/DEMO100/example01.dbf'
</pre>
<p>On va d&rsquo;abord tester Recovery Advisor:</p>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
using target database control file instead of recovery catalog
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
8098       HIGH     OPEN      17-NOV-13     Datafile 2: '/u/DEMO/DATA/DEMO100/example01.dbf' contains one or more corrupt blocks
</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
8098       HIGH     OPEN      17-NOV-13     Datafile 2: '/u/DEMO/DATA/DEMO100/example01.dbf' contains one or more corrupt blocks

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=378 device type=DISK
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 971 in file 2  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_3695178258.hm
</pre>
<p>mais Recovery Advisor ne propose que le restore/recover du datafile entier.</p>
<p>Je vérifie d&rsquo;abord qu&rsquo;il n&rsquo;y a pas d&rsquo;autres blocs corrompus:</p>
<h4>RMAN&gt; validate datafile 2;</h4>
<pre>
RMAN&gt; validate datafile 2;
Starting validate at 17-NOV-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting validation of datafile
channel ORA_DISK_1: specifying datafile(s) for validation
input datafile file number=00002 name=/u/DEMO/DATA/DEMO100/example01.dbf
channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
2    FAILED 0              31954        45841           1913733   
  File Name: /u/DEMO/DATA/DEMO100/example01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              4534            
  Index      0              1219            
  Other      1              8133            

validate found one or more corrupt blocks
See trace file /u/DEMO/diag/rdbms/demo100/DEMO100/trace/DEMO100_ora_14863.trc for details
Finished validate at 17-NOV-13
</pre>
<h4>RMAN&gt; select * from v$database_block_corruption;</h4>
<pre>
RMAN&gt; select * from v$database_block_corruption;
     FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# CORRUPTIO     CON_ID
---------- ---------- ---------- ------------------ --------- ----------
         2        971          1                  0 CORRUPT            0
</pre>
<p>Un seul bloc, donc je préfère faire un BLOCKRECOVER:</p>
<h4>RMAN&gt; blockrecover datafile 2 block 971;</h4>
<pre>
RMAN&gt; blockrecover datafile 2 block 971;
Starting recover at 17-NOV-13
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 00002
channel ORA_DISK_1: reading from backup piece /u/DEMO/backup/12op4mt1_1_1
channel ORA_DISK_1: piece handle=/u/DEMO/backup/12op4mt1_1_1 tag=TAG20131116T205457
channel ORA_DISK_1: restored block(s) from backup piece 1
channel ORA_DISK_1: block restore complete, elapsed time: 00:00:15

starting media recovery

archived log for thread 1 with sequence 2 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_2_98hmq0s6_.arc
archived log for thread 1 with sequence 1 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_1_98hmwbsf_.arc
archived log for thread 1 with sequence 2 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_2_98hp41w7_.arc
archived log for thread 1 with sequence 3 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_3_98hpgdt4_.arc
archived log for thread 1 with sequence 4 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_4_98hpgd5z_.arc
archived log for thread 1 with sequence 5 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_5_98hpgdh8_.arc
archived log for thread 1 with sequence 1 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_1_98hr6zvl_.arc
archived log for thread 1 with sequence 2 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_2_98hr701w_.arc
archived log for thread 1 with sequence 3 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_3_98hr70cc_.arc
archived log for thread 1 with sequence 1 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_1_98hrcjy5_.arc
archived log for thread 1 with sequence 2 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_2_98hrck57_.arc
archived log for thread 1 with sequence 3 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_3_98hrckdn_.arc
archived log for thread 1 with sequence 1 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_1_98hrcrp5_.arc
archived log for thread 1 with sequence 2 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_2_98kwmzy5_.arc
archived log for thread 1 with sequence 3 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_3_98l3gos8_.arc
archived log for thread 1 with sequence 4 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_4_98l3xxyc_.arc
archived log for thread 1 with sequence 5 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_5_98l5hjrn_.arc
media recovery complete, elapsed time: 00:00:15
Finished recover at 17-NOV-13
</pre>
<p>C&rsquo;est fait, on vérifie le datafile:</p>
<h4>RMAN&gt; validate datafile 2;</h4>
<pre>
RMAN&gt; validate datafile 2;
Starting validate at 17-NOV-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting validation of datafile
channel ORA_DISK_1: specifying datafile(s) for validation
input datafile file number=00002 name=/u/DEMO/DATA/DEMO100/example01.dbf
channel ORA_DISK_1: validation complete, elapsed time: 00:00:01
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
2    OK     0              31954        45841           1913733   
  File Name: /u/DEMO/DATA/DEMO100/example01.dbf
  Block Type Blocks Failing Blocks Processed
  ---------- -------------- ----------------
  Data       0              4535            
  Index      0              1219            
  Other      0              8132            

Finished validate at 17-NOV-13


</pre>
<p>Plus de corruption. On peut relancer la requête:
<pre>
</pre>
<h4>RMAN&gt; select /*+ FULL(ORDERS) */ count(*) from OE.ORDERS;</h4>
<pre>
RMAN&gt; select /*+ FULL(ORDERS) */ count(*) from OE.ORDERS;
  COUNT(*)
----------
       105
</pre>
<p><strong>La base est restée ouverte, le datafile est resté online.</strong><br />
C&rsquo;est le dépannage le plus rapide, malheureusement il n&rsquo;est pas proposé par Recovery Advisor.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Recovery cases: perte de tous les fichiers (sauf FRA)</title>
		<link>https://blog.developpez.com/pachot/recovery-cases-perte-de-tous-les-fichiers/</link>
		<comments>https://blog.developpez.com/pachot/recovery-cases-perte-de-tous-les-fichiers/#comments</comments>
		<pubDate>Sat, 23 Nov 2013 22:00:59 +0000</pubDate>
		<dc:creator><![CDATA[pachot]]></dc:creator>
				<category><![CDATA[Recovery Cases]]></category>
		<category><![CDATA[RMAN]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/pachot/?p=1060</guid>
		<description><![CDATA[Recovery en cas de perte de: spfile, control, datafiles et redo logs. On a toujours la FRA par contre, avec l&#8217;autobackup et les derniers archivelogs. On récupère le spfile à partir de l&#8217;autobackup, le controlfile à partir de son miroir, &#8230; <a href="https://blog.developpez.com/pachot/recovery-cases-perte-de-tous-les-fichiers/">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recovery en cas de perte de: spfile, control, datafiles et redo logs. On a toujours la FRA par contre, avec l&rsquo;autobackup et les derniers archivelogs.<br />
On récupère le spfile à partir de l&rsquo;autobackup, le controlfile à partir de son miroir, puis incomplete database recovery.</p>
<p><span id="more-1060"></span><br />
Un exemple sur une base de demo créée <a href="http://blog.developpez.com/pachot/cas-de-recovery-en-12c/">ici</a>.</p>
<p>On supprime tout:</p>
<pre>
+ rm /u/DEMO/DATA/DEMO100/control01.ctl /u/DEMO/DATA/DEMO100/example01.dbf /u/DEMO/DATA/DEMO100/redo01bis.log /u/DEMO/DATA/DEMO100/redo01.log /u/DEMO/DATA/DEMO100/redo02bis.log /u/DEMO/DATA/DEMO100/redo02.log /u/DEMO/DATA/DEMO100/redo03bis.log /u/DEMO/DATA/DEMO100/redo03.log /u/DEMO/DATA/DEMO100/sysaux01.dbf /u/DEMO/DATA/DEMO100/system01.dbf /u/DEMO/DATA/DEMO100/temp01.dbf /u/DEMO/DATA/DEMO100/undotbs01.dbf /u/DEMO/DATA/DEMO100/users01.dbf /app/oracle/product/12c/dbs/spfileDEMO100.ora
</pre>
<p>Un shutdown abort pour arrêter l&rsquo;instance:<br />
SQL&gt;&gt; shutdown abort;<br />
ORACLE instance shut down.</p>
<hr />
<pre>Recovery Manager: Release 12.1.0.1.0 - Production on Mon Nov 18 16:01:02 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
connected to target database (not started)
</pre>
<h4>RMAN&gt; startup;</h4>
<pre>
RMAN&gt; startup;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/app/oracle/product/12c/dbs/initDEMO100.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 11/18/2013 16:01:06
ORA-00205: error in identifying control file, check alert log for more info
</pre>
<p>On n&rsquo;a plus de init.ora ni spfile donc le startup a créé une instance DUMMY utile seulement pour restaurer le spfile.<br />
Il faut préciser où le trouver en donnant le chemin de la FRA et le DB UNIQUE NAME.</p>
<h4>RMAN&gt; restore spfile from autobackup recovery area &lsquo;/u/DEMO/FRA&rsquo; db_unique_name &lsquo;DEMO100&prime;;</h4>
<pre>
RMAN&gt; restore spfile from autobackup recovery area '/u/DEMO/FRA' db_unique_name 'DEMO100';
Starting restore at 18-NOV-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=424 device type=DISK

recovery area destination: /u/DEMO/FRA
database name (or database unique name) used for search: DEMO100
channel ORA_DISK_1: AUTOBACKUP /u/DEMO/FRA/DEMO100/autobackup/2013_11_17/o1_mf_s_831765902_98lcw1g4_.bkp found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u/DEMO/FRA/DEMO100/autobackup/2013_11_17/o1_mf_s_831765902_98lcw1g4_.bkp
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 18-NOV-13

</pre>
<p>On continue avec recovery advisor:</p>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
2          CRITICAL OPEN      17-NOV-13     Control file /app/oracle/product/12c/dbs/cntrlDEMO100.dbf is missing


</pre>
<p>On est toujours sur l&rsquo;instance dummy. Il faut redémarrer pour prendre en compte le spfile restauré.</p>
<h4>RMAN&gt; startup force;</h4>
<pre>
RMAN&gt; startup force;
Oracle instance started
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 11/18/2013 16:01:15
ORA-00205: error in identifying control file, check alert log for more info


</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
WARNING: new failures were found since last LIST FAILURE command
List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
9843       CRITICAL OPEN      18-NOV-13     Control file /u/DEMO/DATA/DEMO100/control01.ctl is missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=123 device type=DISK
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      Use a multiplexed copy to restore control file /u/DEMO/DATA/DEMO100/control01.ctl  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2201126679.hm


</pre>
<h4>RMAN&gt; repair failure;</h4>
<pre>
RMAN&gt; repair failure;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2201126679.hm

contents of repair script:
   # restore control file using multiplexed copy
   restore controlfile from '/u/DEMO/FRA/DEMO100/control02.ctl';
   sql 'alter database mount';

Do you really want to execute the above repair (enter YES or NO)? executing repair script

Starting restore at 18-NOV-13
using channel ORA_DISK_1

channel ORA_DISK_1: copied control file copy
output file name=/u/DEMO/DATA/DEMO100/control01.ctl
output file name=/u/DEMO/FRA/DEMO100/control02.ctl
Finished restore at 18-NOV-13

sql statement: alter database mount
released channel: ORA_DISK_1
repair failure complete

</pre>
<p>Maintenant qu&rsquo;on a le spfile et controlfile, on continue:</p>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
9933       CRITICAL OPEN      18-NOV-13     System datafile 1: '/u/DEMO/DATA/DEMO100/system01.dbf' is missing
9924       CRITICAL OPEN      18-NOV-13     Online log group 3 is unavailable
9915       CRITICAL OPEN      18-NOV-13     Online log group 2 is unavailable
9906       CRITICAL OPEN      18-NOV-13     Online log group 1 is unavailable
8          HIGH     OPEN      18-NOV-13     One or more non-system datafiles are missing
9930       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03bis.log is missing
9927       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03.log is missing
9921       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo02bis.log is missing
9918       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo02.log is missing
9912       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo01bis.log is missing
9909       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo01.log is missing


</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
9933       CRITICAL OPEN      18-NOV-13     System datafile 1: '/u/DEMO/DATA/DEMO100/system01.dbf' is missing
9924       CRITICAL OPEN      18-NOV-13     Online log group 3 is unavailable
9915       CRITICAL OPEN      18-NOV-13     Online log group 2 is unavailable
9906       CRITICAL OPEN      18-NOV-13     Online log group 1 is unavailable
8          HIGH     OPEN      18-NOV-13     One or more non-system datafiles are missing
9930       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03bis.log is missing
9927       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03.log is missing
9921       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo02bis.log is missing
9918       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo02.log is missing
9912       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo01bis.log is missing
9909       HIGH     OPEN      18-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo01.log is missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=7 device type=DISK
analyzing automatic repair options complete

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. If file /u/DEMO/DATA/DEMO100/redo03bis.log was unintentionally renamed or moved, restore it
2. If file /u/DEMO/DATA/DEMO100/redo03.log was unintentionally renamed or moved, restore it
3. If file /u/DEMO/DATA/DEMO100/redo02bis.log was unintentionally renamed or moved, restore it
4. If file /u/DEMO/DATA/DEMO100/redo02.log was unintentionally renamed or moved, restore it
5. If file /u/DEMO/DATA/DEMO100/redo01bis.log was unintentionally renamed or moved, restore it
6. If file /u/DEMO/DATA/DEMO100/redo01.log was unintentionally renamed or moved, restore it
7. Try flush redo using ALTER SYSTEM FLUSH REDO TO 'standby name' command.  Then perform a Data Guard role change (failover).  Available standbys: DEMO110.

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Perform incomplete database recovery to SCN 2438795  
  Strategy: The repair includes point-in-time recovery with some data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2306086548.hm


</pre>
<h4>RMAN&gt; repair failure;</h4>
<pre>
RMAN&gt; repair failure;
Strategy: The repair includes point-in-time recovery with some data loss
Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2306086548.hm

contents of repair script:
   # database point-in-time recovery
   restore database until scn 2438795;
   recover database until scn 2438795;
   alter database open resetlogs;

Do you really want to execute the above repair (enter YES or NO)? executing repair script

Starting restore at 18-NOV-13
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u/DEMO/DATA/DEMO100/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u/DEMO/DATA/DEMO100/example01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u/DEMO/DATA/DEMO100/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u/DEMO/DATA/DEMO100/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u/DEMO/DATA/DEMO100/users01.dbf
channel ORA_DISK_1: reading from backup piece /u/DEMO/backup/1nop7c4r_1_1
channel ORA_DISK_1: piece handle=/u/DEMO/backup/1nop7c4r_1_1 tag=TAG20131117T210946
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:25
Finished restore at 18-NOV-13

Starting recover at 18-NOV-13
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 2 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_2_98l8v5jn_.arc
archived log for thread 1 with sequence 1 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_1_98l90oc4_.arc
archived log for thread 1 with sequence 2 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_2_98lb0yd7_.arc
archived log for thread 1 with sequence 3 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_3_98lbrvkl_.arc
archived log for thread 1 with sequence 1 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_1_98lcvcz2_.arc
archived log for thread 1 with sequence 2 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_2_98lczm3t_.arc
archived log for thread 1 with sequence 3 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_3_98lkwck9_.arc
archived log for thread 1 with sequence 4 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_18/o1_mf_1_4_98lykw5o_.arc
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_2_98l8v5jn_.arc thread=1 sequence=2
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_1_98l90oc4_.arc thread=1 sequence=1
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_2_98lb0yd7_.arc thread=1 sequence=2
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_3_98lbrvkl_.arc thread=1 sequence=3
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_1_98lcvcz2_.arc thread=1 sequence=1
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_2_98lczm3t_.arc thread=1 sequence=2
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_17/o1_mf_1_3_98lkwck9_.arc thread=1 sequence=3
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_18/o1_mf_1_4_98lykw5o_.arc thread=1 sequence=4
media recovery complete, elapsed time: 00:00:21
Finished recover at 18-NOV-13

Statement processed
repair failure complete

Recovery Manager complete.</pre>
<p><strong>On a tout récupéré jusqu&rsquo;au dernier SCN disponible dans les archive log.</strong><br />
Grâce à la FRA qui contient l&rsquo;autobackup, le restore/recover est assez simple. On a eu besoin de connaître le chemin de la FRA ainsi que le nom de la base.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovery cases: perte du spfile</title>
		<link>https://blog.developpez.com/pachot/recovery-cases-perte-du-spfile/</link>
		<comments>https://blog.developpez.com/pachot/recovery-cases-perte-du-spfile/#comments</comments>
		<pubDate>Fri, 22 Nov 2013 22:00:23 +0000</pubDate>
		<dc:creator><![CDATA[pachot]]></dc:creator>
				<category><![CDATA[Recovery Cases]]></category>
		<category><![CDATA[RMAN]]></category>
		<category><![CDATA[spfile]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/pachot/?p=1056</guid>
		<description><![CDATA[Recovery en cas de perte du spfile. On le récupère à partir de l&#8217;autobackup, vers un autre fichier, qu&#8217;on peut copier à sa place initiale. Un exemple sur une base de demo créée ici. Je supprime spfile et init.ora + &#8230; <a href="https://blog.developpez.com/pachot/recovery-cases-perte-du-spfile/">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recovery en cas de perte du spfile. On le récupère à partir de l&rsquo;autobackup, vers un autre fichier, qu&rsquo;on peut copier à sa place initiale.<br />
<span id="more-1056"></span><br />
Un exemple sur une base de demo créée <a href="http://blog.developpez.com/pachot/cas-de-recovery-en-12c/">ici</a>.</p>
<p>Je supprime spfile et init.ora</p>
<pre>
+ rm /app/oracle/product/12c/dbs/*DEMO100.ora
</pre>
<p>Je vérifie les paramètres sous sqlplus:</p>
<pre>
SQL&gt; show parameter db_unique_name
NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
db_unique_name			     string	 DEMO100

SQL&gt;  show parameter db_recovery_file_dest
NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest		     string	 /u/DEMO/FRA

SQL&gt;  show spparameter db_recovery_file_dest
db_recovery_file_dest_size	     big integer 4800M
SQL&gt; ORA-01565: error in identifying file
'/app/oracle/product/12c/dbs/spfileDEMO100.ora'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

</pre>
<p>On a une erreur lorsqu&rsquo;il s&rsquo;agit de lire le spfile.</p>
<hr />
<pre>Recovery Manager: Release 12.1.0.1.0 - Production on Sun Nov 17 22:06:58 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
connected to target database: DEMO100 (DBID=2395255289)

</pre>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
using target database control file instead of recovery catalog
Database Role: PRIMARY

no failures found that match specification
</pre>
<p>Recovery Advisor ne propose rien</p>
<h4>RMAN&gt; restore spfile from autobackup;</h4>
<pre>
RMAN&gt; restore spfile from autobackup;
Starting restore at 17-NOV-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=243 device type=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 11/17/2013 22:07:05
RMAN-06564: must use the TO clause when the instance is started with SPFILE
</pre>
<p>On ne peut pas le restaurer à sa place lorsque l&rsquo;instance est démarrée.<br />
On va le restaurer vers une destination temporaire.</p>
<h4>RMAN&gt; restore spfile to &lsquo;/tmp/spfileDEMO100.ora&rsquo; from autobackup ;</h4>
<pre>
RMAN&gt; restore spfile to '/tmp/spfileDEMO100.ora' from autobackup ;
Starting restore at 17-NOV-13
using channel ORA_DISK_1

recovery area destination: /u/DEMO/FRA
database name (or database unique name) used for search: DEMO100
channel ORA_DISK_1: AUTOBACKUP /u/DEMO/FRA/DEMO100/autobackup/2013_11_17/o1_mf_s_831765902_98lcw1g4_.bkp found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20131117
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u/DEMO/FRA/DEMO100/autobackup/2013_11_17/o1_mf_s_831765902_98lcw1g4_.bkp
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 17-NOV-13
</pre>
<p>Il n&rsquo;y a plus qu&rsquo;à le mettre à sa place:</p>
<pre>
+ cp /tmp/spfileDEMO100.ora /app/oracle/product/12c/dbs
</pre>
<p><strong>aucun arrêt n&rsquo;a été nécessaire</strong></p>
<p>Si on n&rsquo;avait pas pu restaurer le spfile, il est toujours possible de retrouver les paramètres:<br />
&#8211; dans l&rsquo;alert.log: ils sont écrits à chaque démarrage<br />
&#8211; avec un &lsquo;create pfile &#8230; from memory&rsquo; pour récupérer tous les paramètres courants (&gt;= 11g)<br />
&#8211; à partir d&rsquo;un backup, tant qu&rsquo;on sait où est le backup (le controlfile et/ou le repository rman le savent)</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovery cases: perte de tous les controlfiles</title>
		<link>https://blog.developpez.com/pachot/recovery-cases-perte-de-tous-les-controlfiles/</link>
		<comments>https://blog.developpez.com/pachot/recovery-cases-perte-de-tous-les-controlfiles/#comments</comments>
		<pubDate>Thu, 21 Nov 2013 17:15:30 +0000</pubDate>
		<dc:creator><![CDATA[pachot]]></dc:creator>
				<category><![CDATA[Recovery Cases]]></category>
		<category><![CDATA[control files]]></category>
		<category><![CDATA[RMAN]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/pachot/?p=1042</guid>
		<description><![CDATA[Recovery en cas de perte de tous les controlfiles. d’un controlfile multiplexé. Un catalogue permet d&#8217;identifier le backup (le controlfile n&#8217;est plus là pour en avoir la trace), mais utiliser autobackup avec la destination par défaut (Fast Recovery Area) permet &#8230; <a href="https://blog.developpez.com/pachot/recovery-cases-perte-de-tous-les-controlfiles/">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recovery en cas de perte de tous les controlfiles. d’un controlfile multiplexé. Un catalogue permet d&rsquo;identifier le backup (le controlfile n&rsquo;est plus là pour en avoir la trace), mais utiliser autobackup avec la destination par défaut (Fast Recovery Area) permet aussi de le trouver automatiquement.<span id="more-1042"></span></p>
<p>Ici un exemple en utilisant Recovery Advisor, sur une base de demo créée <a href="http://blog.developpez.com/pachot/cas-de-recovery-en-12c/" title="Cas de recovery en 12c">ici</a>.</p>
<p>Voici mes controlfiles:</p>
<h4>RMAN&gt; select status,name from v$controlfile;</h4>
<pre>
RMAN&gt; select status,name from v$controlfile;
using target database control file instead of recovery catalog
STATUS 
-------
NAME                                                                            
--------------------------------------------------------------------------------
/u/DEMO/DATA/DEMO100/control01.ctl
/u/DEMO/FRA/DEMO100/control02.ctl
Recovery Manager complete.</pre>
<p>Je les supprime tous:</p>
<h3>Failure simulation</h3>
<pre>
+ rm /u/DEMO/DATA/DEMO100/control01.ctl /u/DEMO/FRA/DEMO100/control02.ctl
+ ls -l '/u/DEMO/DATA/DEMO100/control*.ctl'
ls: cannot access /u/DEMO/DATA/DEMO100/control*.ctl: No such file or directory
</pre>
<p>Impossible de se connecter avec RMAN:</p>
<hr />
<pre>Recovery Manager: Release 12.1.0.1.0 - Production on Sat Nov 16 21:46:16 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06003: ORACLE error from target database: 
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u/DEMO/DATA/DEMO100/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
</pre>
<p>Je redémarre alors en nomount avec sqlplus:</p>
<pre>
SQL*Plus: Release 12.1.0.1.0 Production on Sat Nov 16 21:46:17 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL&gt; startup force;
ORACLE instance started.

Total System Global Area  417546240 bytes
Fixed Size		    2289064 bytes
Variable Size		  327156312 bytes
Database Buffers	   79691776 bytes
Redo Buffers		    8409088 bytes
ORA-00205: error in identifying control file, check alert log for more info


SQL&gt; Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
</pre>
<p>Et voici la résolution automatique avec Recovery Advisor:</p>
<hr />
<pre>Recovery Manager: Release 12.1.0.1.0 - Production on Sat Nov 16 21:46:22 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
connected to target database: DEMO100 (not mounted)

</pre>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
using target database control file instead of recovery catalog
List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
7004       CRITICAL OPEN      16-NOV-13     Control file /u/DEMO/FRA/DEMO100/control02.ctl is missing
7001       CRITICAL OPEN      16-NOV-13     Control file /u/DEMO/DATA/DEMO100/control01.ctl is missing


</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
7004       CRITICAL OPEN      16-NOV-13     Control file /u/DEMO/FRA/DEMO100/control02.ctl is missing
7001       CRITICAL OPEN      16-NOV-13     Control file /u/DEMO/DATA/DEMO100/control01.ctl is missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=123 device type=DISK
analyzing automatic repair options complete

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. If file /u/DEMO/FRA/DEMO100/control02.ctl was unintentionally renamed or moved, restore it
2. If file /u/DEMO/DATA/DEMO100/control01.ctl was unintentionally renamed or moved, restore it
3. If this is a standby database, restore the controlfile for a standby database using RESTORE STANDBY CONTROLFILE FROM AUTOBACKUP command
4. If this is a primary database and a standby database is available, then perform a Data Guard failover initiated from the standby

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Restore a backup control file  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2694228121.hm

</pre>
<h4>RMAN&gt; repair failure;</h4>
<pre>
RMAN&gt; repair failure;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2694228121.hm

contents of repair script:
   # restore control file
   restore controlfile from autobackup;
   sql 'alter database mount';

Do you really want to execute the above repair (enter YES or NO)? executing repair script

Starting restore at 16-NOV-13
using channel ORA_DISK_1

recovery area destination: /u/DEMO/FRA
database name (or database unique name) used for search: DEMO100
channel ORA_DISK_1: AUTOBACKUP /u/DEMO/FRA/DEMO100/autobackup/2013_11_16/o1_mf_s_831675812_98hmwolx_.bkp found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP /u/DEMO/FRA/DEMO100/autobackup/2013_11_16/o1_mf_s_831675812_98hmwolx_.bkp
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/u/DEMO/DATA/DEMO100/control01.ctl
output file name=/u/DEMO/FRA/DEMO100/control02.ctl
Finished restore at 16-NOV-13

sql statement: alter database mount
released channel: ORA_DISK_1
repair failure complete
</pre>
<p>Mais la base n&rsquo;est pas encore ouverte. Il faut encore faire un recover using backup controlfile même si les datafiles sont à jour.</p>
<pre>
</pre>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
7055       CRITICAL OPEN      16-NOV-13     System datafile 1: '/u/DEMO/DATA/DEMO100/system01.dbf' needs media recovery
7052       CRITICAL OPEN      16-NOV-13     Control file needs media recovery
760        HIGH     OPEN      16-NOV-13     One or more non-system datafiles need media recovery


</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
Starting implicit crosscheck backup at 16-NOV-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=362 device type=DISK
Crosschecked 2 objects
Finished implicit crosscheck backup at 16-NOV-13

Starting implicit crosscheck copy at 16-NOV-13
using channel ORA_DISK_1
Finished implicit crosscheck copy at 16-NOV-13

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_3_98hp5f06_.arc
File Name: /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_2_98hp41w7_.arc
File Name: /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_4_98hpdox7_.arc
File Name: /u/DEMO/FRA/DEMO100/autobackup/2013_11_16/o1_mf_s_831675812_98hmwolx_.bkp

Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
7055       CRITICAL OPEN      16-NOV-13     System datafile 1: '/u/DEMO/DATA/DEMO100/system01.dbf' needs media recovery
7052       CRITICAL OPEN      16-NOV-13     Control file needs media recovery
760        HIGH     OPEN      16-NOV-13     One or more non-system datafiles need media recovery

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 you have the correct version of the control file, then shutdown the database and replace the old control file
2. If you restored the wrong version of data file /u/DEMO/DATA/DEMO100/system01.dbf, then replace it with the correct one
3. If you restored the wrong version of data file /u/DEMO/DATA/DEMO100/example01.dbf, then replace it with the correct one
4. If you restored the wrong version of data file /u/DEMO/DATA/DEMO100/sysaux01.dbf, then replace it with the correct one
5. If you restored the wrong version of data file /u/DEMO/DATA/DEMO100/undotbs01.dbf, then replace it with the correct one
6. If you restored the wrong version of data file /u/DEMO/DATA/DEMO100/users01.dbf, then replace it with the correct one
7. Try flush redo using ALTER SYSTEM FLUSH REDO TO 'standby name' command.  Then perform a Data Guard role change (failover).  Available standbys: DEMO110.

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Recover database  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2263175920.hm


</pre>
<h4>RMAN&gt; repair failure;</h4>
<pre>
RMAN&gt; repair failure;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2263175920.hm

contents of repair script:
   # recover database
   recover database;
   alter database open resetlogs;

Do you really want to execute the above repair (enter YES or NO)? executing repair script

Starting recover at 16-NOV-13
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 2 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_2_98hp41w7_.arc
archived log for thread 1 with sequence 3 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_3_98hp5f06_.arc
archived log for thread 1 with sequence 4 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_4_98hpdox7_.arc
archived log for thread 1 with sequence 5 is already on disk as file /u/DEMO/DATA/DEMO100/redo02.log
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_2_98hp41w7_.arc thread=1 sequence=2
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_3_98hp5f06_.arc thread=1 sequence=3
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_4_98hpdox7_.arc thread=1 sequence=4
archived log file name=/u/DEMO/DATA/DEMO100/redo02.log thread=1 sequence=5
media recovery complete, elapsed time: 00:00:01
Finished recover at 16-NOV-13

Statement processed
repair failure complete



Recovery Manager complete.</pre>
<p><strong>Arrêt de la base le temps de restaurer le controlfile. Aucune perte de donnée mais ouverture en resetlogs.</strong> A noter qu&rsquo;il a fallu lancer deux fois recovery advisor.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovery cases: perte d&#8217;un controlfile multiplexé</title>
		<link>https://blog.developpez.com/pachot/recovery-cases-perte-dun-controlfile-multiplexe/</link>
		<comments>https://blog.developpez.com/pachot/recovery-cases-perte-dun-controlfile-multiplexe/#comments</comments>
		<pubDate>Wed, 20 Nov 2013 22:00:50 +0000</pubDate>
		<dc:creator><![CDATA[pachot]]></dc:creator>
				<category><![CDATA[Recovery Cases]]></category>
		<category><![CDATA[control file]]></category>
		<category><![CDATA[RMAN]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/pachot/?p=1038</guid>
		<description><![CDATA[Recovery en cas de perte d’un controlfile multiplexé. Il reste l&#8217;autre membre. Après redémarrage en nomount pour avoir des fichiers consistents, il suffit de restaurer le controlfile manquant à partir de celui qui reste. Ici un exemple en utilisant Recovery &#8230; <a href="https://blog.developpez.com/pachot/recovery-cases-perte-dun-controlfile-multiplexe/">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recovery en cas de perte d’un controlfile multiplexé. Il reste l&rsquo;autre membre. Après redémarrage en nomount pour avoir des fichiers consistents, il suffit de restaurer le controlfile manquant à partir de celui qui reste.<br />
<span id="more-1038"></span></p>
<p>Ici un exemple en utilisant Recovery Advisor, sur une base de demo créée <a href="http://blog.developpez.com/pachot/cas-de-recovery-en-12c/" title="Cas de recovery en 12c">ici</a>.</p>
<p>Voici mes controlfiles:</p>
<h4>RMAN&gt; select status,name from v$controlfile;</h4>
<pre>
RMAN&gt; select status,name from v$controlfile;
using target database control file instead of recovery catalog
STATUS 
-------
NAME                                                                            
--------------------------------------------------------------------------------
/u/DEMO/DATA/DEMO100/control01.ctl
/u/DEMO/FRA/DEMO100/control02.ctl
Recovery Manager complete.</pre>
<p>J&rsquo;en supprime un:</p>
<h3>Failure simulation</h3>
<pre>
+ rm /u/DEMO/DATA/DEMO100/control01.ctl
+ ls -l '/u/DEMO/DATA/DEMO100/control*.ctl'
ls: cannot access /u/DEMO/DATA/DEMO100/control*.ctl: No such file or directory
</pre>
<p>Erreur dès que j&rsquo;essaie de me connecter avec RMAN:</p>
<hr />
<pre>Recovery Manager: Release 12.1.0.1.0 - Production on Sat Nov 16 21:41:41 2013

Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06003: ORACLE error from target database: 
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u/DEMO/DATA/DEMO100/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
</pre>
<p>Donc je redémarre en nomount avec sqlplus:</p>
<pre>
SQL*Plus: Release 12.1.0.1.0 Production on Sat Nov 16 21:41:41 2013
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL&gt; startup force;
ORACLE instance started.

Total System Global Area  417546240 bytes
Fixed Size		    2289064 bytes
Variable Size		  327156312 bytes
Database Buffers	   79691776 bytes
Redo Buffers		    8409088 bytes
ORA-00205: error in identifying control file, check alert log for more info

SQL&gt; Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
</pre>
</td>
<p>Et voici la résolution automatique avec Recovery Advisor:</p>
<hr />
<pre>Recovery Manager: Release 12.1.0.1.0 - Production on Sat Nov 16 21:41:47 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.
connected to target database: DEMO100 (not mounted)

</pre>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
using target database control file instead of recovery catalog
List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
6878       CRITICAL OPEN      16-NOV-13     Control file /u/DEMO/DATA/DEMO100/control01.ctl is missing


</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
6878       CRITICAL OPEN      16-NOV-13     Control file /u/DEMO/DATA/DEMO100/control01.ctl is missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=123 device type=DISK
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      Use a multiplexed copy to restore control file /u/DEMO/DATA/DEMO100/control01.ctl  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_3683885895.hm


</pre>
<h4>RMAN&gt; repair failure;</h4>
<pre>
RMAN&gt; repair failure;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_3683885895.hm

contents of repair script:
   # restore control file using multiplexed copy
   restore controlfile from '/u/DEMO/FRA/DEMO100/control02.ctl';
   sql 'alter database mount';

Do you really want to execute the above repair (enter YES or NO)? executing repair script

Starting restore at 16-NOV-13
using channel ORA_DISK_1

channel ORA_DISK_1: copied control file copy
output file name=/u/DEMO/DATA/DEMO100/control01.ctl
output file name=/u/DEMO/FRA/DEMO100/control02.ctl
Finished restore at 16-NOV-13

sql statement: alter database mount
released channel: ORA_DISK_1
repair failure complete

Do you want to open the database (enter YES or NO)? database opened



Recovery Manager complete.</pre>
<p><strong>Arrêt de la base le temps de recopier le controlfile existant. Aucune perte de donnée.</strong></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovery cases: perte de tous les redo log</title>
		<link>https://blog.developpez.com/pachot/recovery-cases-perte-de-tous-les-redo-log/</link>
		<comments>https://blog.developpez.com/pachot/recovery-cases-perte-de-tous-les-redo-log/#comments</comments>
		<pubDate>Tue, 19 Nov 2013 16:00:07 +0000</pubDate>
		<dc:creator><![CDATA[pachot]]></dc:creator>
				<category><![CDATA[Recovery Cases]]></category>
		<category><![CDATA[redo log]]></category>
		<category><![CDATA[RMAN]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/pachot/?p=1020</guid>
		<description><![CDATA[Recovery en cas de perte de tous les redo logs. Le système ne peut pas continuer. Les transactions couvertes par les redo perdus, mais pas encore appliquées par le checkpoint, sont perdues. Il faut restaurer toute la base et appliquer &#8230; <a href="https://blog.developpez.com/pachot/recovery-cases-perte-de-tous-les-redo-log/">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recovery en cas de perte de tous les redo logs. Le système ne peut pas continuer. Les transactions couvertes par les redo perdus, mais pas encore appliquées par le checkpoint, sont perdues.<br />
Il faut restaurer toute la base et appliquer tout le redo disponible (archived redo logs) puis ouvrir la base en resetlogs, et faire un nouveau backup.<br />
<span id="more-1020"></span></p>
<p>Ici un exemple en utilisant Recovery Advisor, sur une base de demo créée <a href="http://blog.developpez.com/pachot/cas-de-recovery-en-12c/" title="Cas de recovery en 12c">ici</a>.</p>
<p>J&rsquo;ai les redo logs suivants:</p>
<h4>RMAN&gt; select &lsquo;group#=&rsquo;||group#||&rsquo; member=&rsquo;||member from v$logfile order by 1;</h4>
<pre>
RMAN&gt; select 'group#='||group#||' member='||member from v$logfile order by 1;
using target database control file instead of recovery catalog
'GROUP#='||GROUP#||'MEMBER='||MEMBER                                            
--------------------------------------------------------------------------------
group#=1 member=/u/DEMO/DATA/DEMO100/redo01.log         
group#=1 member=/u/DEMO/DATA/DEMO100/redo01bis.log      
group#=2 member=/u/DEMO/DATA/DEMO100/redo02.log         
group#=2 member=/u/DEMO/DATA/DEMO100/redo02bis.log      
group#=3 member=/u/DEMO/DATA/DEMO100/redo03.log         
group#=3 member=/u/DEMO/DATA/DEMO100/redo03bis.log      
</pre>
<p>Je supprime tous les redo logs:</p>
<h3>Failure simulation</h3>
<pre>
+ rm /u/DEMO/DATA/DEMO100/redo01bis.log /u/DEMO/DATA/DEMO100/redo01.log /u/DEMO/DATA/DEMO100/redo02bis.log /u/DEMO/DATA/DEMO100/redo02.log /u/DEMO/DATA/DEMO100/redo03bis.log /u/DEMO/DATA/DEMO100/redo03.log
+ ls -l '/u/DEMO/DATA/DEMO100/redo0*.log'
ls: cannot access /u/DEMO/DATA/DEMO100/redo0*.log: No such file or directory
</pre>
<p>Si on pouvait toujours écrire dans les fichiers, il faudrait immédiatement faire un checkpoint et un shutdown normal. Mais ici c&rsquo;est trop tard:</p>
<h4>RMAN&gt; alter system archive log current;</h4>
<pre>
RMAN&gt; alter system archive log current;
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 11/16/2013 21:00:40
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u/DEMO/DATA/DEMO100/redo03bis.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 3 thread 1: '/u/DEMO/DATA/DEMO100/redo03.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3</pre>
<p>Et je dois faire un shutdown abort et redémarrer en mount:</p>
<pre>
RMAN&gt; shutdown abort
Oracle instance shut down

RMAN&gt; startup
Oracle instance started
database mounted
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 11/16/2013 21:01:00
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u/DEMO/DATA/DEMO100/redo02bis.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 2 thread 1: '/u/DEMO/DATA/DEMO100/redo02.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
</pre>
<p>Voici la résolution automatique avec Recovery Advisor:</p>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
using target database control file instead of recovery catalog
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
6679       CRITICAL OPEN      16-NOV-13     Online log group 3 is unavailable
6670       CRITICAL OPEN      16-NOV-13     Online log group 2 is unavailable
6661       CRITICAL OPEN      16-NOV-13     Online log group 1 is unavailable
6685       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03bis.log is missing
6682       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03.log is missing
6676       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo02bis.log is missing
6673       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo02.log is missing
6667       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo01bis.log is missing
6664       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo01.log is missing


</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
6679       CRITICAL OPEN      16-NOV-13     Online log group 3 is unavailable
6670       CRITICAL OPEN      16-NOV-13     Online log group 2 is unavailable
6661       CRITICAL OPEN      16-NOV-13     Online log group 1 is unavailable
6685       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03bis.log is missing
6682       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03.log is missing
6676       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo02bis.log is missing
6673       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo02.log is missing
6667       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo01bis.log is missing
6664       HIGH     OPEN      16-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo01.log is missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=365 device type=DISK
analyzing automatic repair options complete

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. If file /u/DEMO/DATA/DEMO100/redo03bis.log was unintentionally renamed or moved, restore it
2. If file /u/DEMO/DATA/DEMO100/redo03.log was unintentionally renamed or moved, restore it
3. If file /u/DEMO/DATA/DEMO100/redo02bis.log was unintentionally renamed or moved, restore it
4. If file /u/DEMO/DATA/DEMO100/redo02.log was unintentionally renamed or moved, restore it
5. If file /u/DEMO/DATA/DEMO100/redo01bis.log was unintentionally renamed or moved, restore it
6. If file /u/DEMO/DATA/DEMO100/redo01.log was unintentionally renamed or moved, restore it
7. Try flush redo using ALTER SYSTEM FLUSH REDO TO 'standby name' command.  Then perform a Data Guard role change (failover).  Available standbys: DEMO110.

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Perform incomplete database recovery to SCN 2263300  
  Strategy: The repair includes point-in-time recovery with some data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_3275529026.hm


</pre>
<h4>RMAN&gt; repair failure;</h4>
<pre>
RMAN&gt; repair failure;
Strategy: The repair includes point-in-time recovery with some data loss
Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_3275529026.hm

contents of repair script:
   # database point-in-time recovery
   restore database until scn 2263300;
   recover database until scn 2263300;
   alter database open resetlogs;

Do you really want to execute the above repair (enter YES or NO)? executing repair script

Starting restore at 16-NOV-13
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u/DEMO/DATA/DEMO100/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u/DEMO/DATA/DEMO100/example01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u/DEMO/DATA/DEMO100/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u/DEMO/DATA/DEMO100/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u/DEMO/DATA/DEMO100/users01.dbf
channel ORA_DISK_1: reading from backup piece /u/DEMO/backup/12op4mt1_1_1
channel ORA_DISK_1: piece handle=/u/DEMO/backup/12op4mt1_1_1 tag=TAG20131116T205457
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:35
Finished restore at 16-NOV-13

Starting recover at 16-NOV-13
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 2 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_2_98hmq0s6_.arc
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_16/o1_mf_1_2_98hmq0s6_.arc thread=1 sequence=2
media recovery complete, elapsed time: 00:00:08
Finished recover at 16-NOV-13

Statement processed
repair failure complete

Recovery Manager complete.</pre>
<p><strong>La base a du être arrêtée et, parce qu’on a perdu du redo courant et actif, on a perdu des transactions. Et la base a été ouverte en resetlogs.</strong> C&rsquo;est un scnéario à éviter et c&rsquo;est pourquoi il faut multiplexer les redo logs pour éviter de perdre tous les membres en cas de panne.</p>
<p>DataGuarg peut aussi éviter la perte de transactions lorsqu&rsquo;on est en Maximum Availability (toutes les transactions commitées sont appliquées sur la standby) , ou lordqu</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovery cases: perte d&#8217;un membre de redo log</title>
		<link>https://blog.developpez.com/pachot/recovery-cases-perte-dun-membre-de-redo-log/</link>
		<comments>https://blog.developpez.com/pachot/recovery-cases-perte-dun-membre-de-redo-log/#comments</comments>
		<pubDate>Mon, 18 Nov 2013 19:00:47 +0000</pubDate>
		<dc:creator><![CDATA[pachot]]></dc:creator>
				<category><![CDATA[Recovery Cases]]></category>
		<category><![CDATA[redo logs]]></category>
		<category><![CDATA[RMAN]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/pachot/?p=1003</guid>
		<description><![CDATA[Recovery en cas de perte d’un membre de redo log. Le système continue car les redo logs sont multiplexés. Il suffit de les recréer (après un switch logfile si c&#8217;est le courant qui manque). Ici un exemple en utilisant Recovery &#8230; <a href="https://blog.developpez.com/pachot/recovery-cases-perte-dun-membre-de-redo-log/">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recovery en cas de perte d’un membre de redo log. Le système continue car les redo logs sont multiplexés. Il suffit de les recréer (après un switch logfile si c&rsquo;est le courant qui manque).<br />
<span id="more-1003"></span></p>
<p>Ici un exemple en utilisant Recovery Advisor, sur une base de demo créée <a href="http://blog.developpez.com/pachot/cas-de-recovery-en-12c/" title="Cas de recovery en 12c">ici</a>.</p>
<p>j&rsquo;ai les logfiles suivants (3 groupes de 2 membres):</p>
<pre>
RMAN&gt; select 'group#='||group#||' member='||member from v$logfile order by 1;
using target database control file instead of recovery catalog
'GROUP#='||GROUP#||'MEMBER='||MEMBER                                            
--------------------------------------------------------------------------------
group#=1 member=/u/DEMO/DATA/DEMO100/redo01.log         
group#=1 member=/u/DEMO/DATA/DEMO100/redo01bis.log      
group#=2 member=/u/DEMO/DATA/DEMO100/redo02.log         
group#=2 member=/u/DEMO/DATA/DEMO100/redo02bis.log      
group#=3 member=/u/DEMO/DATA/DEMO100/redo03.log         
group#=3 member=/u/DEMO/DATA/DEMO100/redo03bis.log      
</pre>
<p>Je supprime un membre de chaque groupe:</p>
<pre>
+ rm /u/DEMO/DATA/DEMO100/redo01bis.log /u/DEMO/DATA/DEMO100/redo02bis.log /u/DEMO/DATA/DEMO100/redo03bis.log
+ ls -l /u/DEMO/DATA/DEMO100/redo*.log 
-rw-r-----. 1 oracle oinstall 52429312 Nov 15 19:42 /u/DEMO/DATA/DEMO100/redo01.log
-rw-r-----. 1 oracle oinstall 52429312 Nov 15 19:42 /u/DEMO/DATA/DEMO100/redo02.log
-rw-r-----. 1 oracle oinstall 52429312 Nov 15 19:38 /u/DEMO/DATA/DEMO100/redo03.log
</pre>
<p>La base continue de fonctionner:</p>
<pre>
RMAN&gt; commit;
Statement processed
RMAN&gt; alter system switch logfile;
Statement processed
RMAN&gt; alter system switch logfile;
Statement processed
RMAN&gt; alter system archive log current;
Statement processed
</pre>
<p>Mais avec des erreurs dans l&rsquo;alert.log:</p>
<pre>
Fri Nov 15 19:42:33 2013
Errors in file /u/DEMO/diag/rdbms/demo100/DEMO100/trace/DEMO100_lgwr_13104.trc:
ORA-00313: open failed for members of log group 3 of thread 1
ORA-00312: online log 3 thread 1: '/u/DEMO/DATA/DEMO100/redo03bis.log'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Fri Nov 15 19:42:33 2013
Errors in file /u/DEMO/diag/rdbms/demo100/DEMO100/trace/DEMO100_lgwr_13104.trc:
ORA-00321: log 3 of thread 1, cannot update log file header
ORA-00312: online log 3 thread 1: '/u/DEMO/DATA/DEMO100/redo03bis.log'
Fri Nov 15 19:42:33 2013
Errors in file /u/DEMO/diag/rdbms/demo100/DEMO100/trace/DEMO100_lgwr_13104.trc:
ORA-00313: open failed for members of log group 3 of thread 1
Fri Nov 15 19:42:33 2013
Thread 1 advanced to log sequence 24 (LGWR switch)
  Current log# 3 seq# 24 mem# 0: /u/DEMO/DATA/DEMO100/redo03.log
</pre>
<p>Voici la résolution automatique avec Recovery Advisor:</p>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
using target database control file instead of recovery catalog
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
6289       HIGH     OPEN      15-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03bis.log is missing
6286       HIGH     OPEN      15-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo02bis.log is missing
6283       HIGH     OPEN      15-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo01bis.log is missing


</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
6289       HIGH     OPEN      15-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03bis.log is missing
6286       HIGH     OPEN      15-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo02bis.log is missing
6283       HIGH     OPEN      15-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo01bis.log is missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=130 device type=DISK
analyzing automatic repair options complete

Mandatory Manual Actions
========================
1. If file /u/DEMO/DATA/DEMO100/redo03bis.log was unintentionally renamed or moved, restore it
2. Contact Oracle Support Services if the preceding recommendations cannot be used, or if they do not fix the failures selected for repair

Optional Manual Actions
=======================
1. If file /u/DEMO/DATA/DEMO100/redo02bis.log was unintentionally renamed or moved, restore it
2. If file /u/DEMO/DATA/DEMO100/redo01bis.log was unintentionally renamed or moved, restore it

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Drop and re-create redo log group member /u/DEMO/DATA/DEMO100/redo02bis.log; Drop and re-create redo log group member /u/DEMO/DATA/DEMO100/redo01bis.log 
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_1059050515.hm
</pre>
<p>On remarque qu&rsquo;il ne s&rsquo;agit que des groupes 1 et 2.<br />
La proposition étant de les supprimer et les recréer, on ne peut pas faire ça pour le redo log courant.</p>
<h4>RMAN&gt; repair failure;</h4>
<pre>
RMAN&gt; repair failure;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_1059050515.hm

contents of repair script:
   # drop/recreate redo log group member
   sql "begin sys.dbms_ir.execsqlscript(filename =&gt; ''/u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_1999793821.hm'' ); end;";
   # drop/recreate redo log group member
   sql "begin sys.dbms_ir.execsqlscript(filename =&gt; ''/u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_93228091.hm'' ); end;";

Do you really want to execute the above repair (enter YES or NO)? executing repair script

sql statement: begin sys.dbms_ir.execsqlscript(filename =&gt; ''/u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_1999793821.hm'' ); end;

sql statement: begin sys.dbms_ir.execsqlscript(filename =&gt; ''/u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_93228091.hm'' ); end;
repair failure complete
</pre>
<p>Le contenu des scripts reco_1999793821.hm et reco_93228091.hm&rsquo; sont:</p>
<pre>
begin
/*Drop the Log Member*/
execute immediate 'ALTER DATABASE DROP LOGFILE MEMBER ''/u/DEMO/DATA/DEMO100/redo02bis.log''';
/*Add the Log Member (This will create a new file)*/
execute immediate 'ALTER DATABASE ADD LOGFILE MEMBER ''/u/DEMO/DATA/DEMO100/redo02bis.log'' REUSE TO GROUP 2';
end;
</pre>
<pre>
begin
/*Drop the Log Member*/
execute immediate 'ALTER DATABASE DROP LOGFILE MEMBER ''/u/DEMO/DATA/DEMO100/redo01bis.log''';
/*Add the Log Member (This will create a new file)*/
execute immediate 'ALTER DATABASE ADD LOGFILE MEMBER ''/u/DEMO/DATA/DEMO100/redo01bis.log'' REUSE TO GROUP 1';
end;
</pre>
<p>On a donc recréé les groupes 1 et 2.</p>
<p>Mais il reste le group 3 auquel il manque un fichier:</p>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
6289       HIGH     OPEN      15-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03bis.log is missing


</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
6289       HIGH     OPEN      15-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03bis.log is missing

analyzing automatic repair options; this may take some time
using channel ORA_DISK_1
analyzing automatic repair options complete

Mandatory Manual Actions
========================
1. If file /u/DEMO/DATA/DEMO100/redo03bis.log was unintentionally renamed or moved, restore it
2. Contact Oracle Support Services if the preceding recommendations cannot be used, or if they do not fix the failures selected for repair

Optional Manual Actions
=======================
no manual actions available

Automated Repair Options
========================
no automatic repair options available
</pre>
<p>Recovery advisor ne nous propose rien pour celui-ci ca c&rsquo;est le redo log courant.<br />
C&rsquo;est pourtant simple: il suffit de faire un switch log file:</p>
<pre>
</pre>
<h4>RMAN&gt; alter system switch logfile;</h4>
<pre>
RMAN&gt; alter system switch logfile;
Statement processed
</pre>
<p>Et Recovery Advisor a une proposition comme plus haut: une fois qu&rsquo;il n&rsquo;est plsu actif, on peut le supprimer et le recréer.</p>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
6289       HIGH     OPEN      15-NOV-13     Online log member /u/DEMO/DATA/DEMO100/redo03bis.log is missing

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 /u/DEMO/DATA/DEMO100/redo03bis.log was unintentionally renamed or moved, restore it

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Drop and re-create redo log group member /u/DEMO/DATA/DEMO100/redo03bis.log  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_743548653.hm


</pre>
<h4>RMAN&gt; repair failure;</h4>
<pre>
RMAN&gt; repair failure;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_743548653.hm

contents of repair script:
   # drop/recreate redo log group member
   sql "begin sys.dbms_ir.execsqlscript(filename =&gt; ''/u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_3147502739.hm'' ); end;";

Do you really want to execute the above repair (enter YES or NO)? executing repair script

sql statement: begin sys.dbms_ir.execsqlscript(filename =&gt; ''/u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_3147502739.hm'' ); end;
repair failure complete
Recovery Manager complete.</pre>
<p>Le script reco_3147502739.hm étant:</p>
<pre>
begin
/*Drop the Log Member*/
execute immediate 'ALTER DATABASE DROP LOGFILE MEMBER ''/u/DEMO/DATA/DEMO100/redo03bis.log''';
/*Add the Log Member (This will create a new file)*/
execute immediate 'ALTER DATABASE ADD LOGFILE MEMBER ''/u/DEMO/DATA/DEMO100/redo03bis.log'' REUSE TO GROUP 3';
end;
</pre>
<p><strong>La base est restée ouverte et fonctionnelle grâce au fait d&rsquo;avoir multiplexé les redo logs. Aucune perte de données. </strong><br />
Dommage que Recovery Advisor n&rsquo;ait pas eu l&rsquo;idée de faire un switch logfile pour réparer le log courant aussi.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovery cases: perte d&#8217;un datafile SYSTEM</title>
		<link>https://blog.developpez.com/pachot/recovery-cases-perte-dun-datafile-system/</link>
		<comments>https://blog.developpez.com/pachot/recovery-cases-perte-dun-datafile-system/#comments</comments>
		<pubDate>Sun, 17 Nov 2013 19:30:11 +0000</pubDate>
		<dc:creator><![CDATA[pachot]]></dc:creator>
				<category><![CDATA[Recovery Cases]]></category>
		<category><![CDATA[RMAN]]></category>
		<category><![CDATA[SYSTEM]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/pachot/?p=934</guid>
		<description><![CDATA[Recovery en cas de perte d’un datafile du tablespace SYSTEM: Pas d&#8217;arrêt normal possible (on ne peut pas mettre SYSTEM offline) donc shutdown abort et il faut faire un restore datafile + recover datafile puis réouvrir la base. Ici un &#8230; <a href="https://blog.developpez.com/pachot/recovery-cases-perte-dun-datafile-system/">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recovery en cas de perte d’un datafile du tablespace SYSTEM: Pas d&rsquo;arrêt normal possible (on ne peut pas mettre SYSTEM offline) donc shutdown abort et il faut faire un restore datafile + recover datafile puis réouvrir la base.<br />
<span id="more-934"></span></p>
<p>Ici un exemple en utilisant Recovery Advisor, sur une base de demo créée <a href="http://blog.developpez.com/pachot/cas-de-recovery-en-12c/" title="Cas de recovery en 12c">ici</a>.</p>
<p>J&rsquo;ai les datafiles suivants:</p>
<pre>
RMAN&gt; report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name DEMO100

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    790      SYSTEM               ***     /u/DEMO/DATA/DEMO100/system01.dbf
2    323      EXAMPLE              ***     /u/DEMO/DATA/DEMO100/example01.dbf
3    790      SYSAUX               ***     /u/DEMO/DATA/DEMO100/sysaux01.dbf
4    160      UNDOTBS1             ***     /u/DEMO/DATA/DEMO100/undotbs01.dbf
6    10       USERS                ***     /u/DEMO/DATA/DEMO100/users01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    88       TEMP                 32767       /u/DEMO/DATA/DEMO100/temp01.dbf
</pre>
<p>Je supprime le datafile du tablespace SYSTEM:</p>
<pre>
+ rm /u/DEMO/DATA/DEMO100/system01.dbf
+ ls -l /u/DEMO/DATA/DEMO100/system01.dbf
ls: cannot access /u/DEMO/DATA/DEMO100/system01.dbf: No such file or directory
</pre>
<p>d&rsquo;où l&rsquo;erreur suivante:
<pre>
RMAN&gt; shutdown immediate;
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of shutdown command at 11/12/2013 16:22:08
ORA-01116: error in opening database file 1
ORA-01110: data file 1: '/u/DEMO/DATA/DEMO100/system01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3</pre>
<p>Résolution en utilisant Recovery Advisor:</p>
<pre>
RMAN&gt; list failure;
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of list command at 11/12/2013 16:22:10
ORA-00604: error occurred at recursive SQL level 1
ORA-01116: error in opening database file 1
ORA-01110: data file 1: '/u/DEMO/DATA/DEMO100/system01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
</pre>
<p>Ce n&rsquo;est pas possible car la base est restée ouverte:</p>
<pre>
RMAN&gt; select open_mode from v$database;
OPEN_MODE           
--------------------
READ WRITE          
</pre>
<p>On redémarre (la base va rester en mount):
<pre>
RMAN&gt; startup force

Oracle instance started
database mounted
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 11/12/2013 16:22:23
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '/u/DEMO/DATA/DEMO100/system01.dbf'

</pre>
<p>et on peut continuer Recovery Advisor:</p>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
using target database control file instead of recovery catalog
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
3704       CRITICAL OPEN      12-NOV-13     System datafile 1: '/u/DEMO/DATA/DEMO100/system01.dbf' is missing


</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
3704       CRITICAL OPEN      12-NOV-13     System datafile 1: '/u/DEMO/DATA/DEMO100/system01.dbf' is missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5 device type=DISK
analyzing automatic repair options complete

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. If file /u/DEMO/DATA/DEMO100/system01.dbf was unintentionally renamed or moved, restore it

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Restore and recover datafile 1  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2148409986.hm


</pre>
<h4>RMAN&gt; repair failure;</h4>
<pre>
RMAN&gt; repair failure;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2148409986.hm

contents of repair script:
   # restore and recover datafile
   restore ( datafile 1 );
   recover datafile 1;
   sql 'alter database datafile 1 online';

Do you really want to execute the above repair (enter YES or NO)? executing repair script

Starting restore at 12-NOV-13
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u/DEMO/DATA/DEMO100/system01.dbf
channel ORA_DISK_1: reading from backup piece /u/DEMO/backup/0qoon9qd_1_1
channel ORA_DISK_1: piece handle=/u/DEMO/backup/0qoon9qd_1_1 tag=TAG20131111T185157
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:55
Finished restore at 12-NOV-13

Starting recover at 12-NOV-13
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 11 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_11/o1_mf_1_11_9826sn83_.arc
archived log for thread 1 with sequence 12 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_12_983tcnhw_.arc
archived log for thread 1 with sequence 13 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_13_9840xv86_.arc
archived log for thread 1 with sequence 14 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_14_9841jrl3_.arc
archived log for thread 1 with sequence 15 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_15_9841wbqh_.arc
archived log for thread 1 with sequence 16 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_16_984dgnq2_.arc
archived log for thread 1 with sequence 17 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_17_984f83n6_.arc
archived log for thread 1 with sequence 18 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_18_984g92pf_.arc
archived log for thread 1 with sequence 19 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_19_984gm55y_.arc
archived log for thread 1 with sequence 20 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_20_984jdzkt_.arc
archived log for thread 1 with sequence 21 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_21_984jqp6m_.arc
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_11/o1_mf_1_11_9826sn83_.arc thread=1 sequence=11
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_12_983tcnhw_.arc thread=1 sequence=12
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_13_9840xv86_.arc thread=1 sequence=13
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_14_9841jrl3_.arc thread=1 sequence=14
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_15_9841wbqh_.arc thread=1 sequence=15
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_16_984dgnq2_.arc thread=1 sequence=16
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_17_984f83n6_.arc thread=1 sequence=17
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_18_984g92pf_.arc thread=1 sequence=18
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_19_984gm55y_.arc thread=1 sequence=19
media recovery complete, elapsed time: 00:00:07
Finished recover at 12-NOV-13

sql statement: alter database datafile 1 online
repair failure complete

Do you want to open the database (enter YES or NO)? database opened

Recovery Manager complete.</pre>
<p><strong>La base a été indisponible le temps du restore/recovery. Aucune perte de données.</strong></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovery cases: perte d&#8217;un datafile SYSAUX</title>
		<link>https://blog.developpez.com/pachot/recovery-cases-perte-dun-datafile-sysaux/</link>
		<comments>https://blog.developpez.com/pachot/recovery-cases-perte-dun-datafile-sysaux/#comments</comments>
		<pubDate>Sat, 16 Nov 2013 22:00:44 +0000</pubDate>
		<dc:creator><![CDATA[pachot]]></dc:creator>
				<category><![CDATA[Recovery Cases]]></category>
		<category><![CDATA[RMAN]]></category>
		<category><![CDATA[SYSAUX]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/pachot/?p=921</guid>
		<description><![CDATA[Recovery en cas de perte d’un datafile du tablespace SYSAUX: il suffit de mettre le datafile offline, de faire un restore datafile + recover datafile et de le remettre online. Ici un exemple en utilisant Recovery Advisor, sur une base &#8230; <a href="https://blog.developpez.com/pachot/recovery-cases-perte-dun-datafile-sysaux/">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recovery en cas de perte d’un datafile du tablespace SYSAUX: il suffit de mettre le datafile offline, de faire un restore datafile + recover datafile et de le remettre online.<br />
<span id="more-921"></span></p>
<p>Ici un exemple en utilisant Recovery Advisor, sur une base de demo créée <a href="http://blog.developpez.com/pachot/cas-de-recovery-en-12c/" title="Cas de recovery en 12c">ici</a>.</p>
<p>J&rsquo;ai les datafiles suivants:
<pre>
RMAN&gt; report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name DEMO100

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    790      SYSTEM               ***     /u/DEMO/DATA/DEMO100/system01.dbf
2    323      EXAMPLE              ***     /u/DEMO/DATA/DEMO100/example01.dbf
3    0        SYSAUX               ***     /u/DEMO/DATA/DEMO100/sysaux01.dbf
4    160      UNDOTBS1             ***     /u/DEMO/DATA/DEMO100/undotbs01.dbf
6    10       USERS                ***     /u/DEMO/DATA/DEMO100/users01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    88       TEMP                 32767       /u/DEMO/DATA/DEMO100/temp01.dbf</pre>
<p>Je supprime le datafile du tablespace SYSAUX:</p>
<pre>
+ rm /u/DEMO/DATA/DEMO100/sysaux01.dbf
+ ls -l /u/DEMO/DATA/DEMO100/sysaux01.dbf
ls: cannot access /u/DEMO/DATA/DEMO100/sysaux01.dbf: No such file or directory
</pre>
<p>d&rsquo;où l&rsquo;erreur suivante:
<pre>
RMAN&gt; select max(end_interval_time) from dba_hist_snapshot;
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 11/12/2013 16:17:39
ORA-01116: error in opening database file 3
ORA-01110: data file 3: '/u/DEMO/DATA/DEMO100/sysaux01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
</pre>
<p>Résolution en utilisant Recovery Advisor:</p>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
using target database control file instead of recovery catalog
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
8          HIGH     OPEN      12-NOV-13     One or more non-system datafiles are missing


</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
8          HIGH     OPEN      12-NOV-13     One or more non-system datafiles are missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=14 device type=DISK
analyzing automatic repair options complete

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. If file /u/DEMO/DATA/DEMO100/sysaux01.dbf was unintentionally renamed or moved, restore it

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Restore and recover datafile 3  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2158280577.hm


</pre>
<h4>RMAN&gt; repair failure;</h4>
<pre>
RMAN&gt; repair failure;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_2158280577.hm

contents of repair script:
   # restore and recover datafile
   sql 'alter database datafile 3 offline';
   restore ( datafile 3 );
   recover datafile 3;
   sql 'alter database datafile 3 online';

Do you really want to execute the above repair (enter YES or NO)? executing repair script

sql statement: alter database datafile 3 offline

Starting restore at 12-NOV-13
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00003 to /u/DEMO/DATA/DEMO100/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /u/DEMO/backup/0qoon9qd_1_1
channel ORA_DISK_1: piece handle=/u/DEMO/backup/0qoon9qd_1_1 tag=TAG20131111T185157
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:56
Finished restore at 12-NOV-13

Starting recover at 12-NOV-13
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 11 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_11/o1_mf_1_11_9826sn83_.arc
archived log for thread 1 with sequence 12 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_12_983tcnhw_.arc
archived log for thread 1 with sequence 13 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_13_9840xv86_.arc
archived log for thread 1 with sequence 14 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_14_9841jrl3_.arc
archived log for thread 1 with sequence 15 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_15_9841wbqh_.arc
archived log for thread 1 with sequence 16 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_16_984dgnq2_.arc
archived log for thread 1 with sequence 17 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_17_984f83n6_.arc
archived log for thread 1 with sequence 18 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_18_984g92pf_.arc
archived log for thread 1 with sequence 19 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_19_984gm55y_.arc
archived log for thread 1 with sequence 20 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_20_984jdzkt_.arc
archived log for thread 1 with sequence 21 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_21_984jqp6m_.arc
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_11/o1_mf_1_11_9826sn83_.arc thread=1 sequence=11
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_12_983tcnhw_.arc thread=1 sequence=12
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_13_9840xv86_.arc thread=1 sequence=13
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_14_9841jrl3_.arc thread=1 sequence=14
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_15_9841wbqh_.arc thread=1 sequence=15
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_16_984dgnq2_.arc thread=1 sequence=16
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_17_984f83n6_.arc thread=1 sequence=17
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_18_984g92pf_.arc thread=1 sequence=18
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_19_984gm55y_.arc thread=1 sequence=19
media recovery complete, elapsed time: 00:00:13
Finished recover at 12-NOV-13

sql statement: alter database datafile 3 online
repair failure complete



Recovery Manager complete.</pre>
<p><strong>La base est restée ouverte, seul le datafile en question était indisponible pendant la panne. Aucune perte de données.</strong></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovery cases: perte d&#8217;un datafile (non système)</title>
		<link>https://blog.developpez.com/pachot/dropuserdatafile_advisory/</link>
		<comments>https://blog.developpez.com/pachot/dropuserdatafile_advisory/#comments</comments>
		<pubDate>Fri, 15 Nov 2013 21:59:57 +0000</pubDate>
		<dc:creator><![CDATA[pachot]]></dc:creator>
				<category><![CDATA[Recovery Cases]]></category>
		<category><![CDATA[datafile]]></category>
		<category><![CDATA[RMAN]]></category>

		<guid isPermaLink="false">http://blog.developpez.com/pachot/?p=907</guid>
		<description><![CDATA[Recovery en cas de perte d&#8217;un datafile non système: il suffit de mettre le datafile offline, de faire un restore datafile + recover datafile et de le remettre online. Ici un exemple en utilisant Recovery Advisor, sur une base de &#8230; <a href="https://blog.developpez.com/pachot/dropuserdatafile_advisory/">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Recovery en cas de perte d&rsquo;un datafile non système: il suffit de mettre le datafile offline, de faire un restore datafile + recover datafile et de le remettre online.<br />
<span id="more-907"></span><br />
Ici un exemple en utilisant Recovery Advisor, sur une base de demo créée <a href="http://blog.developpez.com/pachot/cas-de-recovery-en-12c/" title="Cas de recovery en 12c">ici</a>.</p>
<p>J&rsquo;ai les datafiles suivants: </p>
<pre>
RMAN&gt; report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name DEMO100

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    790      SYSTEM               ***     /u/DEMO/DATA/DEMO100/system01.dbf
2    323      EXAMPLE              ***     /u/DEMO/DATA/DEMO100/example01.dbf
3    790      SYSAUX               ***     /u/DEMO/DATA/DEMO100/sysaux01.dbf
4    160      UNDOTBS1             ***     /u/DEMO/DATA/DEMO100/undotbs01.dbf
6    10       USERS                ***     /u/DEMO/DATA/DEMO100/users01.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    88       TEMP                 32767       /u/DEMO/DATA/DEMO100/temp01.dbf
Recovery Manager complete.</pre>
<p>Je supprime le datafile du tablespace USERS:</p>
<pre>
+ rm /u/DEMO/DATA/DEMO100/users01.dbf
+ ls -l /u/DEMO/DATA/DEMO100/users01.dbf
ls: cannot access /u/DEMO/DATA/DEMO100/users01.dbf: No such file or directory
</pre>
<p>d&rsquo;où l&rsquo;erreur suivante en interrogeant une table de ce tablespace:</p>
<pre>
RMAN&gt; select * from TEST;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 11/12/2013 16:04:36
ORA-01116: error in opening database file 6
ORA-01110: data file 6: '/u/DEMO/DATA/DEMO100/users01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
</pre>
<p>Voici la résolution automatique avec Recovery Advisor:</p>
<h4>RMAN&gt; list failure;</h4>
<pre>
RMAN&gt; list failure;
using target database control file instead of recovery catalog
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
8          HIGH     OPEN      12-NOV-13     One or more non-system datafiles are missing


</pre>
<h4>RMAN&gt; advise failure;</h4>
<pre>
RMAN&gt; advise failure;
Database Role: PRIMARY

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
8          HIGH     OPEN      12-NOV-13     One or more non-system datafiles are missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=243 device type=DISK
analyzing automatic repair options complete

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. If file /u/DEMO/DATA/DEMO100/users01.dbf was unintentionally renamed or moved, restore it

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Restore and recover datafile 6  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_1074024518.hm


</pre>
<h4>RMAN&gt; repair failure;</h4>
<pre>
RMAN&gt; repair failure;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u/DEMO/diag/rdbms/demo100/DEMO100/hm/reco_1074024518.hm

contents of repair script:
   # restore and recover datafile
   sql 'alter database datafile 6 offline';
   restore ( datafile 6 );
   recover datafile 6;
   sql 'alter database datafile 6 online';

Do you really want to execute the above repair (enter YES or NO)? executing repair script

sql statement: alter database datafile 6 offline

Starting restore at 12-NOV-13
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00006 to /u/DEMO/DATA/DEMO100/users01.dbf
channel ORA_DISK_1: reading from backup piece /u/DEMO/backup/0qoon9qd_1_1
channel ORA_DISK_1: piece handle=/u/DEMO/backup/0qoon9qd_1_1 tag=TAG20131111T185157
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 12-NOV-13

Starting recover at 12-NOV-13
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 11 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_11/o1_mf_1_11_9826sn83_.arc
archived log for thread 1 with sequence 12 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_12_983tcnhw_.arc
archived log for thread 1 with sequence 13 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_13_9840xv86_.arc
archived log for thread 1 with sequence 14 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_14_9841jrl3_.arc
archived log for thread 1 with sequence 15 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_15_9841wbqh_.arc
archived log for thread 1 with sequence 16 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_16_984dgnq2_.arc
archived log for thread 1 with sequence 17 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_17_984f83n6_.arc
archived log for thread 1 with sequence 18 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_18_984g92pf_.arc
archived log for thread 1 with sequence 19 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_19_984gm55y_.arc
archived log for thread 1 with sequence 20 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_20_984jdzkt_.arc
archived log for thread 1 with sequence 21 is already on disk as file /u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_21_984jqp6m_.arc
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_11/o1_mf_1_11_9826sn83_.arc thread=1 sequence=11
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_12_983tcnhw_.arc thread=1 sequence=12
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_13_9840xv86_.arc thread=1 sequence=13
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_14_9841jrl3_.arc thread=1 sequence=14
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_15_9841wbqh_.arc thread=1 sequence=15
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_16_984dgnq2_.arc thread=1 sequence=16
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_17_984f83n6_.arc thread=1 sequence=17
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_18_984g92pf_.arc thread=1 sequence=18
archived log file name=/u/DEMO/FRA/DEMO100/archivelog/2013_11_12/o1_mf_1_19_984gm55y_.arc thread=1 sequence=19
media recovery complete, elapsed time: 00:00:02
Finished recover at 12-NOV-13

sql statement: alter database datafile 6 online
repair failure complete
Recovery Manager complete.</pre>
<p><strong>La base est restée ouverte, seul le datafile en question était indisponible pendant la panne. Aucune perte de données.</strong></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
