{"id":137,"date":"2009-03-13T13:26:00","date_gmt":"2009-03-13T16:26:00","guid":{"rendered":"http:\/\/www.soudba.com.br\/?p=137"},"modified":"2009-03-13T13:26:00","modified_gmt":"2009-03-13T16:26:00","slug":"recuperacao-incompleta","status":"publish","type":"post","link":"https:\/\/www.soudba.com.br\/?p=137","title":{"rendered":"Recuperacao incompleta"},"content":{"rendered":"<p>When is Incomplete Recovery Necessary?<br \/>Incomplete recovery means losing data on purpose. It occurs when complete recovery is impossible or you want to lose some information that was entered by mistake.<br \/>It is not possible to skip the recovery of a bad transaction and recover all other work.<br \/>There are cases where incomplete recovery won\u2019t be possible with the current controlfile:<br \/>All copies of the controlfile are lost (and it is not possible to recover with a CREATE CONTROLFILE command)<br \/>The current controlfile does not accurately describe the database that needs to be restored (typically due to dropped tablespaces)<br \/>The syntax for recovery using a backup controlfile includes the UNTIL keyword even if the recovery is complete.<br \/>All datafiles except temporary tablespaces are restored. Undo tablespaces are restored.<br \/>The Method for Incomplete Recovery<br \/>It is often a good idea to perform a complete offline backup before beginning an incomplete recovery to ensure no loss of data.<br \/>Steps to incomplete recovery:<br \/>Mount the database<br \/>Restore all datafiles (they don\u2019t need to be from same backupset \/ time), and controlfile if necessary<br \/>Recover the database UNTIL time, cancel or change number<br \/>OPEN with RESETLOGS<br \/>OPEN with RESETLOGS initializes the online redo files creating a new incarnation of the database. An incarnation of a database has a new thread of redo, beginning at log switch sequence number 1.<br \/>Backups and archivelogs are specific to an incarnation and therefore those generated by one incarnation must be kept separate from those generated by a previous incarnation.<br \/>Only SYSDBA can perform incomplete recoveries<br \/>UNTIL TIME Recovery<br \/>SQL&gt; shutdown immediate;<br \/>SQL&gt; startup mount;<br \/>\u2014No restore b\/c OS or other means are used to restore necessary files\u2014<br \/>SQL&gt; recover database UNTIL TIME &#8216;2006-08-15:14:07:00&#8217;<br \/>The time format must be in the format YYYY-MM-DD:HH24:MM:SS irrespective of NLS_DATE_FORMAT<br \/>SQL&gt; alter database open resetlogs;<br \/>\u2014\u2013ALTERNATIVE in RMAN\u2014\u2013<br \/>RMAN&gt; run {<br \/>RMAN&gt; shutdown immediate;<br \/>RMAN&gt; startup mount;<br \/>RMAN&gt; sql &#8220;alter session set nls_date_format=&#8221;dd-mon-yyyy hh24:mi:ss&#8221;&#8221;;<br \/>RMAN&gt; set until time &#8217;15-aug-2006 14:11:00&#8242;;<br \/>RMAN&gt; restore database;<br \/>RMAN&gt; recover database;<br \/>RMAN&gt; alter database open resetlogs;}<br \/>UNTIL CANCEL \/ UNTIL SEQUENCE (RMAN) Recovery<br \/>Cancel-based recovery is typically needed after complete recovery has failed: the recovery required an archive or online log that was missing.<br \/>SQL&gt; shutdown immediate;<br \/>SQL&gt; startup mount;<br \/>\u2014No restore b\/c OS or other means are used to restore necessary files\u2014<br \/>SQL&gt; recover database UNTIL CANCEL;<br \/>SQL&gt; alter database open resetlogs;<br \/>\u2014\u2013ALTERNATIVE in RMAN\u2014\u2013<br \/>RMAN&gt; run {<br \/>RMAN&gt; shutdown immediate;<br \/>RMAN&gt; startup mount;<br \/>RMAN&gt; set until sequence 10305 thread 1;<br \/>RMAN&gt; restore database;<br \/>RMAN&gt; recover database;<br \/>RMAN&gt; alter database open resetlogs;}<br \/>UNTIL CHANGE \/ UNTIL SCN Recovery<br \/>SQL&gt; shutdown immediate;<br \/>SQL&gt; startup mount;<br \/>\u2014No restore b\/c OS or other means are used to restore necessary files\u2014<br \/>SQL&gt; recover database UNTIL CHANGE 309121;<br \/>SQL&gt; alter database open resetlogs;<br \/>\u2014\u2013ALTERNATIVE in RMAN\u2014\u2013<br \/>RMAN&gt; run {<br \/>RMAN&gt; shutdown immediate;<br \/>RMAN&gt; startup mount;<br \/>RMAN&gt; set until scn 309121;<br \/>RMAN&gt; restore database;<br \/>RMAN&gt; recover database;<br \/>RMAN&gt; alter database open resetlogs;}<br \/>Incomplete Recovery Using EM<br \/>Maintenance -&gt; Perform Recovery<br \/>Recovery of the Controlfile<br \/>SQL&gt; alter database backup controlfile to trace<br \/>USER_DUMP_DEST will determine where trace file is created<br \/>You should always create a trace file whenever you make physical changes to the structure of the database.<br \/>SQL&gt; alter database backup controlfile to \u2018\u2019<br \/>Restore a Controlfile with SQL*Plus<br \/>startup mount;<br \/>SQL&gt; recover database until cancel using backup controlfile;<br \/>Backup \/ Restore a Controlfile with RMAN<br \/>RMAN&gt; backup as copy current controlfile;<br \/>RMAN&gt; backup as backupset current controlfile;<br \/>RMAN&gt; backup tablespace system include current controlfile;<br \/>RMAN&gt; configure controlfile autobackup on;<br \/>RMAN&gt; restore controlfile from autobackup;<br \/>Parameters<br \/>USER_DUMP_DEST<br \/>CONTROL_FILES<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When is Incomplete Recovery Necessary?Incomplete recovery means losing data on purpose. It occurs when complete recovery is impossible or you want to lose some information that was entered by mistake.It is not possible to skip the recovery of a bad &hellip; <a href=\"https:\/\/www.soudba.com.br\/?p=137\">Continue lendo <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":[260,262,263,323],"tags":[],"class_list":["post-137","post","type-post","status-publish","format-standard","hentry","category-rman-incomplete-recover","category-rman-scn","category-rman-until-cancel","category-until-time"],"_links":{"self":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts\/137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=137"}],"version-history":[{"count":0,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts\/137\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}