{"id":118,"date":"2020-10-24T12:51:00","date_gmt":"2020-10-24T12:51:00","guid":{"rendered":"https:\/\/maboc.nl\/?p=118"},"modified":"2020-10-24T12:51:00","modified_gmt":"2020-10-24T12:51:00","slug":"restore-and-recover-a-database-when-datafiles-are-awol","status":"publish","type":"post","link":"https:\/\/maboc.nl\/?p=118","title":{"rendered":"Restore and recover a database when datafiles are awol"},"content":{"rendered":"\n<p>A sysadmin wasn&#8217;t paying attention and deleted a few datafile from the (running) database. What can we do? Actually we will do the same as <a href=\"https:\/\/maboc.nl\/?p=105\" data-type=\"post\" data-id=\"105\">here<\/a>.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Startup database in mount mode<\/li><li>Restore the database<\/li><li>Recover the database<\/li><li>Open the database<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>RMAN> startup force mount;\r\n\r\nOracle instance started\r\ndatabase mounted\r\n\r\nTotal System Global Area     620756648 bytes\r\n\r\nFixed Size                     9137832 bytes\r\nVariable Size                339738624 bytes\r\nDatabase Buffers             268435456 bytes\r\nRedo Buffers                   3444736 bytes\r\n\r\nRMAN> restore database;\r\n\r\nStarting restore at 24-OCT-20\r\nallocated channel: ORA_DISK_1\r\nchannel ORA_DISK_1: SID=434 device type=DISK\n\nskipping datafile 5; already restored to file \/u02\/datafiles\/CDB01\/pdbseed\/system01.dbf\r\nskipping datafile 6; already restored to file \/u02\/datafiles\/CDB01\/pdbseed\/sysaux01.dbf\r\nskipping datafile 8; already restored to file \/u02\/datafiles\/CDB01\/pdbseed\/undotbs01.dbf\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00001 to \/u02\/datafiles\/CDB01\/system01.dbf\r\nchannel ORA_DISK_1: restoring datafile 00003 to \/u02\/datafiles\/CDB01\/sysaux01.dbf\r\nchannel ORA_DISK_1: restoring datafile 00004 to \/u02\/datafiles\/CDB01\/undotbs01.dbf\r\nchannel ORA_DISK_1: restoring datafile 00007 to \/u02\/datafiles\/CDB01\/users01.dbf\r\nchannel ORA_DISK_1: reading from backup piece \/u04\/backups\/bloemkool\/uevdpcfd_1_1\r\nchannel ORA_DISK_1: piece handle=\/u04\/backups\/bloemkool\/uevdpcfd_1_1 tag=TAG20201024T143421\r\nchannel ORA_DISK_1: restored backup piece 1\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:26\r\nchannel ORA_DISK_1: starting datafile backup set restore\r\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\r\nchannel ORA_DISK_1: restoring datafile 00009 to \/u02\/datafiles\/CDB01\/PDB01\/system01.dbf\r\nchannel ORA_DISK_1: restoring datafile 00010 to \/u02\/datafiles\/CDB01\/PDB01\/sysaux01.dbf\r\nchannel ORA_DISK_1: restoring datafile 00011 to \/u02\/datafiles\/CDB01\/PDB01\/undotbs01.dbf\r\nchannel ORA_DISK_1: restoring datafile 00012 to \/u02\/datafiles\/CDB01\/PDB01\/users01.dbf\r\nchannel ORA_DISK_1: restoring datafile 00013 to \/u02\/datafiles\/CDB01\/PDB01\/martijn01.dnf\r\nchannel ORA_DISK_1: reading from backup piece \/u04\/backups\/bloemkool\/ufvdpcgq_1_1\r\nchannel ORA_DISK_1: piece handle=\/u04\/backups\/bloemkool\/ufvdpcgq_1_1 tag=TAG20201024T143421\r\nchannel ORA_DISK_1: restored backup piece 1\r\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:15\r\nFinished restore at 24-OCT-20\r\n\r\nRMAN> recover database;\r\n\r\nStarting recover at 24-OCT-20\r\nusing channel ORA_DISK_1\r\n\r\nstarting media recovery\r\nmedia recovery complete, elapsed time: 00:00:01\r\n\r\nFinished recover at 24-OCT-20\r\n\r\nRMAN> alter database open;\r\n\r\nStatement processed\r\n\r\nRMAN><\/code><\/pre>\n\n\n\n<p>pffff&#8230;.that was easy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A sysadmin wasn&#8217;t paying attention and deleted a few datafile from the (running) database. What can we do? Actually we will do the same as here. Startup database in mount mode Restore the database Recover the database Open the database pffff&#8230;.that was easy.<\/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":[24,25,22,26],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-oracle","category-rman","tag-oracle","tag-recover","tag-restore","tag-rman"],"_links":{"self":[{"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/posts\/118","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=118"}],"version-history":[{"count":1,"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":119,"href":"https:\/\/maboc.nl\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions\/119"}],"wp:attachment":[{"href":"https:\/\/maboc.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/maboc.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/maboc.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}