{"id":105,"date":"2020-10-24T11:37:45","date_gmt":"2020-10-24T11:37:45","guid":{"rendered":"https:\/\/maboc.nl\/?p=105"},"modified":"2020-10-24T11:41:41","modified_gmt":"2020-10-24T11:41:41","slug":"restore-and-recover-a-database-as-far-as-we-can-go","status":"publish","type":"post","link":"https:\/\/maboc.nl\/?p=105","title":{"rendered":"Restore and recover a database as far as we can go"},"content":{"rendered":"\n<p>Something went wrong&#8230;we need the database back to the point we have archivelogs of:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>List incarnation (just to see what we have&#8230;no actual need to)<\/li><li>Restore database (getting the datafiles back in place)<\/li><li>Recover database (creating an actual working database with all updates we can possibly find in the archives)<\/li><li>Open the database (and start working again)<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>RMAN> list incarnation;\n\n\nList of Database Incarnations\nDB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time\n------- ------- -------- ---------------- --- ---------- ----------\n1       1       CDB01    1590200411       PARENT  1          17-APR-19\n2       2       CDB01    1590200411       CURRENT 1920977    07-OCT-20\n\nRMAN> startup force mount;\n\nOracle instance started\ndatabase mounted\n\nTotal System Global Area     620756648 bytes\n\nFixed Size                     9137832 bytes\nVariable Size                339738624 bytes\nDatabase Buffers             268435456 bytes\nRedo Buffers                   3444736 bytes\n\nRMAN> restore database;\n\nStarting restore at 24-OCT-20\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=441 device type=DISK\n\nskipping datafile 5; already restored to file \/u02\/datafiles\/CDB01\/pdbseed\/system01.dbf\nskipping datafile 6; already restored to file \/u02\/datafiles\/CDB01\/pdbseed\/sysaux01.dbf\nskipping datafile 8; already restored to file \/u02\/datafiles\/CDB01\/pdbseed\/undotbs01.dbf\nchannel ORA_DISK_1: starting datafile backup set restore\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\nchannel ORA_DISK_1: restoring datafile 00001 to \/u02\/datafiles\/CDB01\/system01.dbf\nchannel ORA_DISK_1: restoring datafile 00003 to \/u02\/datafiles\/CDB01\/sysaux01.dbf\nchannel ORA_DISK_1: restoring datafile 00004 to \/u02\/datafiles\/CDB01\/undotbs01.dbf\nchannel ORA_DISK_1: restoring datafile 00007 to \/u02\/datafiles\/CDB01\/users01.dbf\nchannel ORA_DISK_1: reading from backup piece \/u04\/backups\/bloemkool\/tuvdp87q_1_1\nchannel ORA_DISK_1: piece handle=\/u04\/backups\/bloemkool\/tuvdp87q_1_1 tag=TAG20201024T132202\nchannel ORA_DISK_1: restored backup piece 1\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:25\nchannel ORA_DISK_1: starting datafile backup set restore\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\nchannel ORA_DISK_1: restoring datafile 00009 to \/u02\/datafiles\/CDB01\/PDB01\/system01.dbf\nchannel ORA_DISK_1: restoring datafile 00010 to \/u02\/datafiles\/CDB01\/PDB01\/sysaux01.dbf\nchannel ORA_DISK_1: restoring datafile 00011 to \/u02\/datafiles\/CDB01\/PDB01\/undotbs01.dbf\nchannel ORA_DISK_1: restoring datafile 00012 to \/u02\/datafiles\/CDB01\/PDB01\/users01.dbf\nchannel ORA_DISK_1: restoring datafile 00013 to \/u02\/datafiles\/CDB01\/PDB01\/martijn01.dnf\nchannel ORA_DISK_1: reading from backup piece \/u04\/backups\/bloemkool\/tvvdp898_1_1\nchannel ORA_DISK_1: piece handle=\/u04\/backups\/bloemkool\/tvvdp898_1_1 tag=TAG20201024T132202\nchannel ORA_DISK_1: restored backup piece 1\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:16\nFinished restore at 24-OCT-20\n\nRMAN> recover database;\n\nStarting recover at 24-OCT-20\nusing channel ORA_DISK_1\n\nstarting media recovery\n\narchived log for thread 1 with sequence 2144 is already on disk as file \/u03\/archiving\/CDB01\/1_2144_1053215134.dbf\nchannel ORA_DISK_1: starting archived log restore to default destination\nchannel ORA_DISK_1: restoring archived log\narchived log thread=1 sequence=2140\nchannel ORA_DISK_1: reading from backup piece \/u04\/backups\/bloemkool\/u1vdp8a7_1_1\nchannel ORA_DISK_1: piece handle=\/u04\/backups\/bloemkool\/u1vdp8a7_1_1 tag=TAG20201024T132319\nchannel ORA_DISK_1: restored backup piece 1\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:01\narchived log file name=\/u03\/archiving\/CDB01\/1_2140_1053215134.dbf thread=1 sequence=2140\nchannel ORA_DISK_1: starting archived log restore to default destination\nchannel ORA_DISK_1: restoring archived log\narchived log thread=1 sequence=2141\nchannel ORA_DISK_1: restoring archived log\narchived log thread=1 sequence=2142\nchannel ORA_DISK_1: restoring archived log\narchived log thread=1 sequence=2143\nchannel ORA_DISK_1: reading from backup piece \/u04\/backups\/bloemkool\/u3vdp8n3_1_1\nchannel ORA_DISK_1: piece handle=\/u04\/backups\/bloemkool\/u3vdp8n3_1_1 tag=TAG20201024T133011\nchannel ORA_DISK_1: restored backup piece 1\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:01\narchived log file name=\/u03\/archiving\/CDB01\/1_2141_1053215134.dbf thread=1 sequence=2141\narchived log file name=\/u03\/archiving\/CDB01\/1_2142_1053215134.dbf thread=1 sequence=2142\nmedia recovery complete, elapsed time: 00:00:03\nFinished recover at 24-OCT-20\n\nRMAN> alter database open;\n\nStatement processed\n\nRMAN><\/code><\/pre>\n\n\n\n<p>There, your database is back, up to the point until we have archivelogs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Something went wrong&#8230;we need the database back to the point we have archivelogs of: List incarnation (just to see what we have&#8230;no actual need to) Restore database (getting the datafiles back in place) Recover database (creating an actual working database with all updates we can possibly find in the archives) Open the database (and start [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,20],"tags":[21,24,27,26],"class_list":["post-105","post","type-post","status-publish","format-standard","hentry","category-oracle","category-rman","tag-backup","tag-oracle","tag-recovery","tag-rman"],"_links":{"self":[{"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/posts\/105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/maboc.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=105"}],"version-history":[{"count":3,"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/posts\/105\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/posts\/105\/revisions\/108"}],"wp:attachment":[{"href":"https:\/\/maboc.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/maboc.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/maboc.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}