{"id":107,"date":"2012-10-23T16:04:24","date_gmt":"2012-10-23T14:04:24","guid":{"rendered":"http:\/\/www.dolicapax.org\/?p=107"},"modified":"2012-10-24T00:53:32","modified_gmt":"2012-10-23T22:53:32","slug":"restore-database-to-new-oda","status":"publish","type":"post","link":"https:\/\/www.dolicapax.org\/?p=107","title":{"rendered":"Restore database to new or redeployed ODA"},"content":{"rendered":"<p>Doing a restore from an RMAN backup to a freshly deployed Oracle Database Appliance seems like a\u00a0conceivable scenario, so I figured it would be nice to have tried it at least once.<\/p>\n<p>For this test, I have a backupset on <em>\/s01\/backup\/testdb\/\u00a0<\/em>and no backup catalog. I have deployed the ODA using the parameter file from the original deploy, so that network and grid infrastrcuture configuration as well as database and instance names are the same.<\/p>\n<p>First, we need the DBID of the old database. One place to see it is in the file name of the control file auto backup. The first number is the DBID:\u00a0testdb_c-60599356-20121022-03<\/p>\n<p>We must also figure out the controfile autobackup format, I have it set to\u00a0<em>\/s01\/backup\/testdb\/testdb_%F<\/em><\/p>\n<p>Similarly we need the location of the SPFILE on the new database, which we can find with\u00a0<em>show parameter spfile<\/em>.\u00a0In this case it&#8217;s\u00a0<em>+DATA\/testdb\/testdb.ora<\/em><\/p>\n<p>Now we can shut down the instance on both nodes, and fire up RMAN on node 1 to restore the SPFILE.<\/p>\n<blockquote><p>set ORACLE_SID=testdb1<br \/>\nrman target \/<br \/>\nset DBID = \u00a060599356;<br \/>\nstartup nomount;<br \/>\nset \u00a0CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO &#8216;\/s01\/backup\/testdb\/testdb_%F&#8217;;<br \/>\nrestore spfile to pfile &#8216;\/tmp\/dummy.ora&#8217; from autobackup;<br \/>\nshutdown immediate;<br \/>\nstartup nomount pfile=&#8217;\/tmp\/dummy.ora&#8217;;<br \/>\nrestore spfile to &#8216;+DATA\/testdb\/spfiletestdb.ora&#8217; from autobackup;<br \/>\nshutdown immediate;<\/p><\/blockquote>\n<p>Ok, we first restored the spfile and converted it to a dummy pfile &#8211; just so we could get the newly deployed spfile out of the way, start the database from the pfile, and restore the spfile back to it&#8217;s original location. Next up is the control files:<\/p>\n<blockquote><p>startup nomount;<br \/>\nrestore controlfile from autobackup;<br \/>\nshutdown immediate;<br \/>\nstartup nomount;<\/p><\/blockquote>\n<p>That was rather easy. If you do have archive logs or backup pieces that are newer than the control file snapshot, they should now be cataloged:<\/p>\n<blockquote><p>catalog archivelog \/s01\/secondary_archive\/2012_10_23_testdb_4445.arc;<\/p><\/blockquote>\n<p>I don&#8217;t have anything to add, so I&#8217;m all set for restore.<\/p>\n<blockquote><p>alter database mount;<br \/>\nrestore database;<br \/>\nrecover database;<\/p><\/blockquote>\n<p>Since I don&#8217;t have a copy of the most current archive log, I must then settle for an incomplete recovery and open the database with resetlogs;<\/p>\n<blockquote><p>alter database open resetlogs;<\/p><\/blockquote>\n<p>Database is back in business. Any changes between time of backup \u00a0and \u00a0time of failure are lost.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Doing a restore from an RMAN backup to a freshly deployed Oracle Database Appliance seems like a\u00a0conceivable scenario, so I figured it would be nice to have tried it at least once. For this test, I have a backupset on &hellip; <a href=\"https:\/\/www.dolicapax.org\/?p=107\">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":[19,20,4],"tags":[18,24,34],"class_list":["post-107","post","type-post","status-publish","format-standard","hentry","category-oda-oracle","category-oracle","category-tech","tag-oda","tag-oracle-2","tag-restore"],"_links":{"self":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=107"}],"version-history":[{"count":7,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions"}],"predecessor-version":[{"id":109,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts\/107\/revisions\/109"}],"wp:attachment":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=107"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=107"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}