{"id":7543,"date":"2019-06-17T17:07:47","date_gmt":"2019-06-17T15:07:47","guid":{"rendered":"https:\/\/www.carajandb.com\/blog\/2019\/cloning-mit-rman-ist-einfach\/"},"modified":"2019-06-17T17:47:33","modified_gmt":"2019-06-17T15:47:33","slug":"cloning-with-rman-is-easy","status":"publish","type":"post","link":"https:\/\/carajandb.com\/en\/2019\/06\/17\/cloning-with-rman-is-easy\/","title":{"rendered":"Cloning with RMAN is easy!"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In this blog I will show you how to use an RMAN backup to create a database clone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In my last blog &#8220;<a href=\"https:\/\/carajandb.com\/en\/blog\/2019\/recovery-with-rman-is-easy\/\">Recovery with RMAN is easy!<\/a>&#8221; I explained how RMAN can assist to recover from a data file corruption. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Fortunately failures like corrupted data files or loss of the entire database are very rarely. More often you might have the challenge to create a copy of the database on a different server for testing or Q&amp;A purposes. RMAN can assist directly with the duplicate command. But it might be a good idea to validate the backup while creating a new database. <br>So let&#8217;s restore the backup to our test server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the first step we need to copy the backup files to the new server (clapton). In addition we need an spfile but probably only once because by chance you need different parameters (e.g. sga_target) for your test environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Source (simon)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SQL&gt; CREATE pfile='\/tmp\/initPAUL.ora' from spfile;\nsimon:% scp \/tmp\/initPAUL.ora clapton:\/tmp\nsimon:% scp -r \/u03\/orabackup\/PAUL clapton:\/u03\/orabackup\/PAUL <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Before we can start the instance, some directory must exists. Esp. the audit dump directry is important. The instance will not start if it doesn&#8217;t exist.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">clapton:% mkdir \u2013p \/opt\/oracle\/admin\/PAUL\/adump\nclapton:% mkdir \u2013p \/opt\/oracle\/admin\/PAUL\/dpdump\nclapton:% mkdir \u2013p \/u02\/oradata\nclapton:% mkdir \u2013p \/u03\/orabackup\nclapton:% chown \u2013R oracle:oinstall \/opt\/oracle\/admin \/u02\/oradata \/u03\/orabackup <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now we are able to start the instance on clapton (probably with different parameters):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">clapton:% sqlplus \/ as sysdba\n \nSQL&gt; CREATE SPFILE FROM PFILE='\/tmp\/initPAUL.ora\u2019;\n \nSQL&gt; startup nomount <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Because the backup location is specified with the parameter <code>db_recovery_file_dest<\/code> the database or RMAN knows where to look for the backups. You can of course specify a different directory if you change the parameter accordingly. Now we are arble to restore the controlfile from the backup:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RMAN&gt; RESTORE CONTROLFILE FROM AUTOBACKUP;\n \nStarting restore at 29-MAY-19\nusing channel ORA_DISK_1\n \nrecovery area destination: \/u03\/orabackup\ndatabase name (or database unique name) used for search: PAUL\nchannel ORA_DISK_1: AUTOBACKUP \/u03\/orabackup\/PAUL\/autobackup\/2019_05_29\/o1_mf_s_1009541851_ggwq1w6x_.bkp found in the recovery area\nAUTOBACKUP search with format \"%F\" not attempted because DBID was not set\nchannel ORA_DISK_1: restoring control file from AUTOBACKUP \/u03\/orabackup\/PAUL\/autobackup\/2019_05_29\/o1_mf_s_1009541851_ggwq1w6x_.bkp\nchannel ORA_DISK_1: control file restore from AUTOBACKUP complete\noutput file name=\/u02\/oradata\/PAUL\/controlfile\/o1_mf_gfqy132z_.ctl\noutput file name=\/u03\/orabackup\/PAUL\/controlfile\/o1_mf_gfqy13hk_.ctl\nFinished restore at 29-MAY-19 <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the next step we are going to mount the controlfile and restore the database:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RMAN&gt; ALTER DATABASE MOUNT;\nreleased channel: ORA_DISK_1\nStatement processed \n\nRMAN&gt; RESTORE DATABASE;\n \nStarting restore at 29-MAY-19\nStarting implicit crosscheck backup at 29-MAY-19\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=38 device type=DISK\nCrosschecked 23 objects\nFinished implicit crosscheck backup at 29-MAY-19\n \nStarting implicit crosscheck copy at 29-MAY-19\nusing channel ORA_DISK_1\nFinished implicit crosscheck copy at 29-MAY-19\n \nsearching for all files in the recovery area\ncataloging files...\ncataloging done\n \n \nList of Cataloged Files\n=======================\nFile Name: \/u03\/orabackup\/PAUL\/autobackup\/2019_05_29\/o1_mf_s_1009547148_ggww7djy_.bkp\n \nusing channel ORA_DISK_1\n \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\/oradata\/PAUL\/datafile\/o1_mf_system_gfqxv3xm_.dbf\nchannel ORA_DISK_1: restoring datafile 00003 to \/u02\/oradata\/PAUL\/datafile\/o1_mf_sysaux_gfqxy3cn_.dbf\nchannel ORA_DISK_1: restoring datafile 00004 to \/u02\/oradata\/PAUL\/datafile\/o1_mf_undotbs1_gfqxztmj_.dbf\nchannel ORA_DISK_1: restoring datafile 00007 to \/u02\/oradata\/PAUL\/datafile\/o1_mf_users_gfqxzvw6_.dbf\nchannel ORA_DISK_1: reading from backup piece \/u03\/orabackup\/PAUL\/backupset\/2019_05_29\/o1_mf_nnndf_TAG20190529T134448_ggww5jj6_.bkp\n channel ORA_DISK_1: piece handle=\/u03\/orabackup\/PAUL\/backupset\/2019_05_29\/o1_mf_nnndf_TAG20190529T134448_ggww5jj6_.bkp tag=TAG20190529T134448\nchannel ORA_DISK_1: restored backup piece 1\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:15\nchannel ORA_DISK_1: starting datafile backup set restore\n\u2026\nchannel ORA_DISK_1: restored backup piece 1\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:07\nFinished restore at 29-MAY-19 <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally we need to recover the database by applying the archive logs.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RMAN&gt; RECOVER DATABASE;\n \nStarting recover at 29-MAY-19\nusing channel ORA_DISK_1\n \nstarting media recovery\n \narchived log for thread 1 with sequence 13 is already on disk as file \/u03\/orabackup\/PAUL\/archivelog\/2019_05_29\/o1_mf_1_13_ggww7bkc_.arc\narchived log file name=\/u03\/orabackup\/PAUL\/archivelog\/2019_05_29\/o1_mf_1_13_ggww7bkc_.arc thread=1 sequence=13\nunable to find archived log\narchived log thread=1 sequence=14\nRMAN-00571: ===========================================================\nRMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============\nRMAN-00571: ===========================================================\nRMAN-03002: failure of recover command at 05\/29\/2019 14:16:46\nRMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 14 and starting SCN of 1599466 <\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can ignore the error message because it only warns about the missing archive log &#8211; which is always the not yet created one.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now we are able to open the database and look for the content. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We killedtwo birds with one stone:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>We have a procedure to create database clones as needed.<\/li><li>We verified the RMAN backup.<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>In this blog I will show you how to use an RMAN backup to create a database clone. In my last blog &#8220;Recovery with RMAN is easy!&#8221; I explained how RMAN can assist to recover from a data file corruption. Fortunately failures like corrupted data files or loss of the entire database are very rarely. More often you might have the challenge to create a copy of the database on a different server for testing or Q&amp;A purposes. RMAN can assist directly with the duplicate command. But it might be a good idea to validate the backup while creating a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_crdt_document":"","_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[406],"tags":[50],"class_list":["post-7543","post","type-post","status-publish","format-standard","hentry","category-oracle-en","tag-rman"],"acf":{"occupation":"Write the Occupation of the Person","person_can-be-speaker":true,"person_is-team":true,"person_related-user-account":null,"person_ordering-number":50,"publication_speakers":null,"publication_content-language":["de"],"publication_files":null,"publication_event":"","publication_date":null},"spectra_custom_meta":{"layout_header":["light"],"_layout_header":["field_5a48111185e5f"],"layout_background":[""],"_layout_background":["field_5a481193c0995"],"layout_hide_services":["0"],"_layout_hide_services":["field_5a4811c5c0996"],"layout_show-author-box":["1"],"_layout_show-author-box":["field_5a64ee9cc6490"],"layout_show-categories-tags":["1"],"_layout_show-categories-tags":["field_5a64eee4c6491"],"blogpost_related-publications":[""],"_blogpost_related-publications":["field_5a480debdac62"],"blogpost_related-files":[""],"_blogpost_related-files":["field_5a480f377db29"],"_yoast_wpseo_primary_category":["406"],"_wpml_media_duplicate":["1"],"_wpml_media_featured":["1"],"_yoast_wpseo_content_score":["30"],"_wpml_location_migration_done":["1"],"_edit_lock":["1585580921:3"],"_last_translation_edit_mode":["native-editor"],"_edit_last":["3"],"_wp_old_slug":["cloning-mit-rman-ist-einfach"],"_wpml_word_count":["{\"total\":962,\"to_translate\":{\"de\":962}}"],"rank_math_primary_category":["406"],"rank_math_news_sitemap_robots":["index"],"rank_math_robots":["a:1:{i:0;s:5:\"index\";}"],"astra_style_timestamp_css":["1773726066"],"rank_math_internal_links_processed":["1"],"wpil_sync_report3":["1"],"wpil_links_inbound_internal_count":["0"],"wpil_links_inbound_internal_count_data":["eJxLtDKwqq4FAAZPAf4="],"wpil_links_outbound_internal_count":["1"],"wpil_links_outbound_internal_count_data":["eJx1kEFPwzAMhf9Kyb1L0w0G3ok7G9IuHCM3idqwNKmSlFFN++8k7YTGgZttPb\/PfggMLhqq3TuwRyAfgzZ876Qy\/E3bEwG2hkuALRCTWq4l2WVxgDWQ0RuSqu0GSBfjAJR6ZXC0oqurerMS6PETrWxWwvVUWdoY19K6Yi9JJ9yX8lN51rErfY+21KFUGCaaHbOhCzGX9ROQ\/12z4hmItlF5i+maBtiyP8z7h9QkA0zLzs926ZHjDV5keHHcvx4KHYoMf8iSnAJKqSRvJj6YsdU2+1YLyjiBUTs7Pw5EuIS2y6XVLaNzp8OgPBdeYVS\/gTGWDg0cx+iy7H4cPYqTtu1dvHncOzkaxf+o6xtkBn\/HZX69\/gAkVZOz"],"wpil_links_outbound_external_count":["0"],"wpil_links_outbound_external_count_data":["eJxLtDKwqq4FAAZPAf4="],"wpil_sync_report2_time":["2024-08-27T11:47:24+00:00"],"_uagb_previous_block_counts":["a:90:{s:21:\"uagb\/advanced-heading\";i:0;s:15:\"uagb\/blockquote\";i:0;s:12:\"uagb\/buttons\";i:0;s:18:\"uagb\/buttons-child\";i:0;s:19:\"uagb\/call-to-action\";i:0;s:15:\"uagb\/cf7-styler\";i:0;s:11:\"uagb\/column\";i:0;s:12:\"uagb\/columns\";i:0;s:14:\"uagb\/container\";i:0;s:21:\"uagb\/content-timeline\";i:0;s:27:\"uagb\/content-timeline-child\";i:0;s:14:\"uagb\/countdown\";i:0;s:12:\"uagb\/counter\";i:0;s:8:\"uagb\/faq\";i:0;s:14:\"uagb\/faq-child\";i:0;s:10:\"uagb\/forms\";i:0;s:17:\"uagb\/forms-accept\";i:0;s:19:\"uagb\/forms-checkbox\";i:0;s:15:\"uagb\/forms-date\";i:0;s:16:\"uagb\/forms-email\";i:0;s:17:\"uagb\/forms-hidden\";i:0;s:15:\"uagb\/forms-name\";i:0;s:16:\"uagb\/forms-phone\";i:0;s:16:\"uagb\/forms-radio\";i:0;s:17:\"uagb\/forms-select\";i:0;s:19:\"uagb\/forms-textarea\";i:0;s:17:\"uagb\/forms-toggle\";i:0;s:14:\"uagb\/forms-url\";i:0;s:14:\"uagb\/gf-styler\";i:0;s:15:\"uagb\/google-map\";i:0;s:11:\"uagb\/how-to\";i:0;s:16:\"uagb\/how-to-step\";i:0;s:9:\"uagb\/icon\";i:0;s:14:\"uagb\/icon-list\";i:0;s:20:\"uagb\/icon-list-child\";i:0;s:10:\"uagb\/image\";i:0;s:18:\"uagb\/image-gallery\";i:0;s:13:\"uagb\/info-box\";i:0;s:18:\"uagb\/inline-notice\";i:0;s:11:\"uagb\/lottie\";i:0;s:21:\"uagb\/marketing-button\";i:0;s:10:\"uagb\/modal\";i:0;s:18:\"uagb\/popup-builder\";i:0;s:16:\"uagb\/post-button\";i:0;s:18:\"uagb\/post-carousel\";i:0;s:17:\"uagb\/post-excerpt\";i:0;s:14:\"uagb\/post-grid\";i:0;s:15:\"uagb\/post-image\";i:0;s:17:\"uagb\/post-masonry\";i:0;s:14:\"uagb\/post-meta\";i:0;s:18:\"uagb\/post-taxonomy\";i:0;s:18:\"uagb\/post-timeline\";i:0;s:15:\"uagb\/post-title\";i:0;s:20:\"uagb\/restaurant-menu\";i:0;s:26:\"uagb\/restaurant-menu-child\";i:0;s:11:\"uagb\/review\";i:0;s:12:\"uagb\/section\";i:0;s:14:\"uagb\/separator\";i:0;s:11:\"uagb\/slider\";i:0;s:17:\"uagb\/slider-child\";i:0;s:17:\"uagb\/social-share\";i:0;s:23:\"uagb\/social-share-child\";i:0;s:16:\"uagb\/star-rating\";i:0;s:23:\"uagb\/sure-cart-checkout\";i:0;s:22:\"uagb\/sure-cart-product\";i:0;s:15:\"uagb\/sure-forms\";i:0;s:22:\"uagb\/table-of-contents\";i:0;s:9:\"uagb\/tabs\";i:0;s:15:\"uagb\/tabs-child\";i:0;s:18:\"uagb\/taxonomy-list\";i:0;s:9:\"uagb\/team\";i:0;s:16:\"uagb\/testimonial\";i:0;s:14:\"uagb\/wp-search\";i:0;s:19:\"uagb\/instagram-feed\";i:0;s:10:\"uagb\/login\";i:0;s:17:\"uagb\/loop-builder\";i:0;s:18:\"uagb\/loop-category\";i:0;s:20:\"uagb\/loop-pagination\";i:0;s:15:\"uagb\/loop-reset\";i:0;s:16:\"uagb\/loop-search\";i:0;s:14:\"uagb\/loop-sort\";i:0;s:17:\"uagb\/loop-wrapper\";i:0;s:13:\"uagb\/register\";i:0;s:19:\"uagb\/register-email\";i:0;s:24:\"uagb\/register-first-name\";i:0;s:23:\"uagb\/register-last-name\";i:0;s:22:\"uagb\/register-password\";i:0;s:30:\"uagb\/register-reenter-password\";i:0;s:19:\"uagb\/register-terms\";i:0;s:22:\"uagb\/register-username\";i:0;}"],"_uag_css_file_name":["uag-css-7543.css"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Johannes Ahrends","author_link":"https:\/\/carajandb.com\/en\/author\/9aa6cdb2095bd409\/"},"uagb_comment_info":1,"uagb_excerpt":"In this blog I will show you how to use an RMAN backup to create a database clone. In my last blog &#8220;Recovery with RMAN is easy!&#8221; I explained how RMAN can assist to recover from a data file corruption. Fortunately failures like corrupted data files or loss of the entire database are very rarely.&hellip;","_links":{"self":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/7543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/comments?post=7543"}],"version-history":[{"count":1,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/7543\/revisions"}],"predecessor-version":[{"id":7545,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/7543\/revisions\/7545"}],"wp:attachment":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/media?parent=7543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/categories?post=7543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/tags?post=7543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}