{"id":122,"date":"2011-07-21T20:47:05","date_gmt":"2011-07-21T18:47:05","guid":{"rendered":"http:\/\/www.ludovicocaldara.net\/dba\/?p=122"},"modified":"2011-07-21T20:47:05","modified_gmt":"2011-07-21T18:47:05","slug":"dog-eat-dog-oracle-deletes-itself-by-mistake","status":"publish","type":"post","link":"https:\/\/www.ludovicocaldara.net\/dba\/dog-eat-dog-oracle-deletes-itself-by-mistake\/","title":{"rendered":"Dog eat Dog&#8230; Oracle deletes itself by mistake!"},"content":{"rendered":"<p>While implementing the backup on a new DB inherited from a customer, I scheduled our standard backup &#8220;type disk&#8221; procedure through rman, on Windows.<br \/>\nThe morning after I saw that the &#8220;delete obsolete&#8221; tried to delete ALL CURRENT DATAFILES!!<\/p>\n<p><code>i criteri di conservazione RMAN verranno applicati al comando<br \/>\ni criteri di conservazione RMAN sono impostati su una ridondanza 1<br \/>\ncanale allocato: ORA_DISK_1<br \/>\ncanale ORA_DISK_1: sid=29 devtype=DISK<br \/>\nEliminazione dei seguenti backup e copie obsoleti:<br \/>\nTipo                 Chiave Ora fine          Nome file\/Handle<br \/>\n-------------------- ------ ------------------ --------------------<br \/>\nSet di backup        917    28-GIU-11<br \/>\n...<br \/>\nSet di backup        927    29-GIU-11<br \/>\nBackup piece       1005   29-GIU-11          H:\\ORACLE\\BACKUP\\ORAPERSP\\RMAN\\SPFILEBCK_20110629<br \/>\nCopia file di dati  14     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\INDX01.DBF<br \/>\nCopia file di dati  16     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\TOOLS01.DBF<br \/>\nCopia file di dati  17     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\USERS01.DBF<br \/>\nCopia file di dati  18     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\DRSYS01.DBF<br \/>\nCopia file di dati  19     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\EXAMPLE01.DBF<br \/>\nCopia file di dati  20     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\ODM01.DBF<br \/>\nCopia file di dati  21     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\XDB01.DBF<br \/>\nCopia file di dati  22     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\CWMLITE01.DBF<br \/>\nCopia file di dati  23     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\TBLDATI01.ORA<br \/>\nCopia file di dati  24     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\TBLINDEX01.ORA<br \/>\nCopia file di dati  25     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\OEM_REPOSITORY1.ORA<br \/>\nCopia file di dati  26     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\SYSTEM01.DBF<br \/>\nCopia file di dati  27     29-NOV-10          E:\\ORACLE\\ORADATA\\ORAPERSP\\UNDOTBS01.DBF<br \/>\nbackup piece eliminata<br \/>\n...<br \/>\nbackup piece eliminata<br \/>\nhandle di backup piece=H:\\ORACLE\\BACKUP\\ORAPERSP\\RMAN\\C-2220366420-20110628-02 recid=990 stamp=755031582<br \/>\nbackup piece eliminata<br \/>\nhandle di backup piece=H:\\ORACLE\\BACKUP\\ORAPERSP\\RMAN\\C-2220366420-20110629-00 recid=1002 stamp=755130872<br \/>\nbackup piece eliminata<br \/>\nhandle di backup piece=H:\\ORACLE\\BACKUP\\ORAPERSP\\RMAN\\CTL_20110629 recid=1004 stamp=755130883<br \/>\nbackup piece eliminata<br \/>\nhandle di backup piece=H:\\ORACLE\\BACKUP\\ORAPERSP\\RMAN\\SPFILEBCK_20110629 recid=1005 stamp=755130885<br \/>\nRMAN-00571: ===========================================================<br \/>\nRMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============<br \/>\nRMAN-00571: ===========================================================<br \/>\nRMAN-03009: failure of delete command on ORA_DISK_1 channel at 06\/29\/2011 22:34:55<br \/>\nORA-19584: file E:\\ORACLE\\ORADATA\\ORAPERSP\\INDX01.DBF gi\u00e0 in usoRecovery Manager ha terminato.<br \/>\n<\/code><\/p>\n<p>That&#8217;s because all current datafiles were registered into recovery catalog as backup copy. With a recovery redundancy of 1, all datafiles were set as obsolete!  But since it&#8217;s windows, a delete command doesn&#8217;t delete datafiles if they are already in use. What it was on unix? We had just luck!<\/p>\n<p>Then we had to uncatalog all copies.<\/p>\n<p><code><br \/>\nRMAN> list copy;<\/p>\n<p>la specifica non corrisponde a nessuno dei log di archivio del Recovery Catalog<\/p>\n<p>Lista di copie del file di dati<br \/>\nChiave     SCN Ckp file S Ora di completamento    Nome Ora ckp<br \/>\n------- ---- - -------------------- ---------- -------------------- ----<br \/>\n26      1    X 29-NOV-10            18535127593 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\SYSTEM01.DBF<br \/>\n27      2    X 29-NOV-10            18535127762 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\UNDOTBS01.DBF<br \/>\n14      3    X 29-NOV-10            18535122625 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\INDX01.DBF<br \/>\n16      4    X 29-NOV-10            18535123721 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\TOOLS01.DBF<br \/>\n17      5    X 29-NOV-10            18535124423 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\USERS01.DBF<br \/>\n18      6    X 29-NOV-10            18535124439 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\DRSYS01.DBF<br \/>\n19      7    X 29-NOV-10            18535124453 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\EXAMPLE01.DBF<br \/>\n20      8    X 29-NOV-10            18535124554 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\ODM01.DBF<br \/>\n21      9    X 29-NOV-10            18535125790 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\XDB01.DBF<br \/>\n22      10   X 29-NOV-10            18535125874 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\CWMLITE01.DBF<br \/>\n23      11   X 29-NOV-10            18535125887 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\TBLDATI01.ORA<br \/>\n24      12   X 29-NOV-10            18535126750 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\TBLINDEX01.ORA<br \/>\n25      13   X 29-NOV-10            18535127211 29-NOV-10            E:\\ORACLE\\ORADATA\\ORAPERSP\\OEM_REPOSITORY1.ORA<br \/>\n<\/code><\/p>\n<p><code><br \/>\nRMAN> change copy of datafile 1..N uncatalog;<\/p>\n<p>copia non catalogata del file di dati<br \/>\nfilename di copia del file di dati=E:\\ORACLE\\ORADATA\\ORAPERSP\\INDX01.DBF recid=14 stamp=736336991<br \/>\nOggetti 1 non catalogati<br \/>\n...<br \/>\n<\/code><\/p>\n<p>until no &#8220;obsolete&#8221; current datafile were reported!<\/p>\n<p><code><br \/>\nRMAN> report obsolete;<\/p>\n<p>i criteri di conservazione RMAN verranno applicati al comando<br \/>\ni criteri di conservazione RMAN sono impostati su una ridondanza 1<br \/>\nnon sono stati trovati backup obsoleti<br \/>\n<\/code><\/p>\n<p>Lesson learned: never schedule delete obsolete without actually checking what could be deleted!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While implementing the backup on a new DB inherited from a customer, I scheduled our standard backup &#8220;type disk&#8221; procedure through rman, on Windows. The morning after I saw that the &#8220;delete obsolete&#8221; tried to delete ALL CURRENT DATAFILES!! i &hellip; <a href=\"https:\/\/www.ludovicocaldara.net\/dba\/dog-eat-dog-oracle-deletes-itself-by-mistake\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[9,22,44],"class_list":["post-122","post","type-post","status-publish","format-standard","hentry","category-oracledb","tag-oracle","tag-oracle-database","tag-rman"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":7,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/122\/revisions"}],"predecessor-version":[{"id":129,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/122\/revisions\/129"}],"wp:attachment":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/media?parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/categories?post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/tags?post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}