{"id":305,"date":"2017-02-24T13:50:16","date_gmt":"2017-02-24T12:50:16","guid":{"rendered":"https:\/\/www.carajandb.com\/2017\/02\/24\/flashback-pdb-with-version-12-1-0-2\/"},"modified":"2018-02-10T12:23:00","modified_gmt":"2018-02-10T11:23:00","slug":"flashback-pdb-with-version-12-1-0-2","status":"publish","type":"post","link":"https:\/\/carajandb.com\/en\/2017\/02\/24\/flashback-pdb-with-version-12-1-0-2\/","title":{"rendered":"Flashback PDB with Version 12.1.0.2"},"content":{"rendered":"<h2>Flashback Pluggable Database<\/h2>\n<p>Oracle 12.2 will be general available within the next few weeks including several new fetaures for Flashback Pluggable Database. But it will take some more month before customers will adopt 12.2 for their production database and we need some more experience with the PDB Undo management. Because thats the requirement for Flashback Pluggable Database. But you can use this feature alread with 12.1.0.2 if your environment relies on Data Guard.This configuration might be an interesting alternative because it ends up with two individual PDBs &#8211; the original and the flashback version.<\/p>\n<p><!--more--><br \/>\nThis is the base configuraiton:<\/p>\n<ul>\n<li>Server 1: beethovens1 with the primary database \u00a0LUDWIG_S1 and the PDB DEMO<\/li>\n<li>server 2: beethovens2 with the standby database LUDWIG_S2<\/li>\n<\/ul>\n<p>The goal is to create a pluggable database named DEMO_CLONE as a flashback of DEMO at 10:00 A.M. with a full functioning Data Guard configuration.<\/p>\n<h3>Flashback Standby Datenbank<\/h3>\n<p>For this tasks it would have been sufficient to create the PDB while the CDB is opened read only. But often it&#8217;s necessary to open the PDB or the CDB for some changes in advance (e.g. to unlock an account). That&#8217;s the reason why we are using the Snapshot Standby feature of Data Guard.<\/p>\n<pre>oracle@beethovens2[LUDWIG1]% dgmgrl sysdg\/sysdgLUDWIG@LUDWIG_S2\r\n\r\nDGMGRL&gt; show configuration\r\n\r\nConfiguration - LUDWIG_DG\r\n\r\n  Protection Mode: MaxAvailability\r\n  Members:\r\n  LUDWIG_S1 - Primary database\r\n    LUDWIG_S2 - Physical standby database\r\n\r\nFast-Start Failover: DISABLED\r\n\r\nConfiguration Status:\r\nSUCCESS   (status updated 29 seconds ago)\r\n\r\nDGMGRL&gt; show database \"LUDWIG_S2\"\r\n\r\nDatabase - LUDWIG_S2\r\n\r\n  Enterprise Manager Name: LUDWIG_S2.hv.devk.de\r\n  Role:                    PHYSICAL STANDBY\r\n  Intended State:          APPLY-ON\r\n  Transport Lag:           0 seconds (computed 1 second ago)\r\n  Apply Lag:               0 seconds (computed 1 second ago)\r\n  Average Apply Rate:      5.00 KByte\/s\r\n  Real Time Query:         OFF\r\n  Instance(s):\r\n    LUDWIG1 (apply instance)\r\n    LUDWIG2\r\n\r\nDatabase Status:\r\nSUCCESS\r\n\r\nDGMGRL&gt; CONVERT DATABASE \"LUDWIG_S2\" TO SNAPSHOT STANDBY;\r\nConverting database \"LUDWIG_S2\" to a Snapshot Standby database, please wait...\r\nDatabase \"LUDWIG_S2\" converted successfully\r\n\r\nDGMGRL&gt; EXIT;\r\n\r\nracle@beethovens2[LUDWIG1]%:~&gt; sqlplus \/ as sysdba\r\n\r\nSQL&gt; select db_unique_name, database_role, open_mode, flashback_on from v$database;\r\n\r\nDB_UNIQUE_NAME                 DATABASE_ROLE    OPEN_MODE\r\n------------------------------ ---------------- --------------------\r\nLUDWIG_S2                        SNAPSHOT STANDBY READ WRITE\r\n\r\nSQL&gt; exit\r\n<\/pre>\n<p>As you can see the standby database is now opened read write. In the next step a Guaranteed Restore Point (GRP) will be created and the flashback database to the timestamp 10:00 A.M. will be initiated:<\/p>\n<pre>oracle@beethovens2[LUDWIG1]%:~&gt; sqlplus \/ as sysdba\r\n\r\nSQL&gt; SHUTDOWN IMMEDIATE\r\nDatabase closed.\r\nDatabase dismounted.\r\nORACLE instance shut down. \r\nSQL&gt;startup mount\r\nORACLE instance started.\r\n\r\nTotal System Global Area 1.5737E+10 bytes\r\nFixed Size                  3729312 bytes\r\nVariable Size            2919237728 bytes\r\nDatabase Buffers         1.2784E+10 bytes\r\nRedo Buffers               29822976 bytes\r\nDatabase mounted.\r\n\r\nSQL&gt; CREATE RESTORE POINT before_flashback GUARANTEE FLASHBACK DATABASE;\r\n\r\nRestore point created.\r\n\r\nSQL&gt; FLASHBACK DATABASE TO TIMESTAMP to_date('23.02.2017 10:00:00','DD.MM.YYYY HH24:MI:SS');\r\n\r\nFlashback complete.\r\n\r\nSQL&gt; ALTER DATABASE OPEN RESETLOGS;\r\n\r\nDatabase altered.\r\n<\/pre>\n<p>The datbase is now opened read write and we could create a manifest (UNPLUG INTO XML) to copy the PDB to an independant CDB (e.g. via a firewall or other restricted area). But in our case a database link is sufficient.<\/p>\n<pre>oracle@beethovens1[LUDWIG1]%:~&gt; sqlplus \/ as sysdba\r\nSQL&gt; !mkdir \/u03\/temp\/LUDWIG\/DEMO_CLONE\r\n\r\nSQL&gt; CREATE DATABASE LINK \"LUDWIG_S2\" CONNECT TO c##johannes IDENTIFIED BY abc123def USING 'LUDWIG_S2';\r\n\r\nSQL&gt; CREATE PLUGGABLE DATABASE demo_clone FROM DEMO@LUDWIG_S2 file_name_convert=('DEMO','DEMO_CLONE');\r\n<\/pre>\n<p>Before opening the PDB_DEMO_CLONE we need to reactivate the Data Guard configuration. It is of course possible to use RMAN but if it&#8217;s not required because of the timeframe we can simply copy the closed data files (see Blog &#8220;<a href=\"index.php?option=com_content&amp;view=article&amp;id=300:pdb-cloning-with-data-guard&amp;catid=27:johannes-ahrends-en&amp;Itemid=170\" target=\"_blank\" rel=\"noopener\">PDB Cloning with Data Guard<\/a>&#8220;). There is one minor restriction: before we can flashback the CDB to the GRP the PDB$SEED needs to be opened read write otherwise the following error will show up:<\/p>\n<pre>SQL&gt; flashback database to restore point before_flashback;\r\nflashback database to restore point before_flashback\r\n*\r\nERROR at line 1:\r\nORA-01122: database file 2 failed verification check\r\nORA-01110: data file 2: '\/u03\/oradata\/TC02\/pdbshared\/pdbseed\/system.dbf'\r\nORA-01207: file is more recent than control file - old control file\r\n<\/pre>\n<p>Since it is officially not possible or supported to open the Seed database read write we need a kind of a hack but that one is obvious because otherwise it wouldn&#8217;t be possible to patch or update the seed PDB. The SESSION parameter &#8220;_oracle_script&#8221; (who ever will associate this parameter with the PDB$SEED?) will allow the seed database to be opened read write and apply changes if necessary. To overcome the flashback issue it&#8217;s sufficient to open it read write once and reopen it read only afterwards. And now the flashback database to GRP works:<\/p>\n<pre>oracle@beethovens2[LUDWIG1]%:~&gt; sqlplus \/ as sysdba\r\n\r\nSQL&gt; ALTER SESSION SET \"_oracle_script\"=TRUE;\r\n\r\nSession altered.\r\n\r\nSQL&gt; ALTER PLUGGABLE DATABASE pdb$seed OPEN READ WRITE FORCE;\r\n\r\nPluggable database altered.\r\n\r\nSQL&gt; ALTER PLUGGABLE DATABASE pdb$seed OPEN READ ONLY FORCE;\r\n\r\nPluggable database altered.\r\n\r\nSQL&gt; shutdown immediate\r\nDatabase closed.\r\nDatabase dismounted.\r\nORACLE instance shut down.\r\n\r\nSQL&gt; startup mount\r\nORACLE instance started.\r\n\r\nTotal System Global Area 1.5737E+10 bytes\r\nFixed Size                  3729312 bytes\r\nVariable Size            2919237728 bytes\r\nDatabase Buffers         1.2784E+10 bytes\r\nRedo Buffers               29822976 bytes\r\nDatabase mounted.\r\nSQL&gt; FLASHBACK DATABASE TO RESTORE POINT before_flashback;\r\n\r\nFlashback complete.\r\nSQL&gt; DROP RESTORE POINT before_flashback;\r\n<\/pre>\n<p>Now the snapshot standby can be reconverted into a physical standby again:<\/p>\n<pre>oracle@beethovens1[LUDWIG1]% dgmgrl sysdg\/sysdgLUDWIG@LUDWIG_S1\r\n\r\nDGMGRL&gt; convert database \"LUDWIG_S2\" to physical standby;\r\nConverting database \"LUDWIG_S2\" to a Physical Standby database, please wait...\r\nDatabase \"LUDWIG_S2\" converted successfully\r\n<\/pre>\n<p>That&#8217;s it mainly. But there is the know problem with the creation of a PDB in a Data Guard environment. Because the PDB DEMO_CLONE has been created we need to recover the standby database. This works as described in the blog &#8220;<a href=\"index.php?option=com_content&amp;view=article&amp;id=300:pdb-cloning-with-data-guard&amp;catid=27:johannes-ahrends-en&amp;Itemid=170\" target=\"_blank\" rel=\"noopener\">PDB Cloning with Data Guard<\/a>&#8220;. It&#8217;s sufficient to copy the data files to the standby databaes and start the apply as often as there are data files. Now the Data Guard is in sync again and we have an additional PDB with a former point in time.<\/p>\n<p>Have fun while testing and using this feature and please provide some feedback!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Flashback Pluggable Database Oracle 12.2 will be general available within the next few weeks including several new fetaures for Flashback Pluggable Database. But it will take some more month before customers will adopt 12.2 for their production database and we need some more experience with the PDB Undo management. Because thats the requirement for Flashback Pluggable Database. But you can use this feature alread with 12.1.0.2 if your environment relies on Data Guard.This configuration might be an interesting alternative because it ends up with two individual PDBs &#8211; the original and the flashback version.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","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":[],"tags":[272,168,307,274,275],"class_list":["post-305","post","type-post","status-publish","format-standard","hentry","tag-flashback-2","tag-flashback-database","tag-multitenant-2","tag-oracle-12c-3","tag-pluggable-database-2"],"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":{"_fgj2wp_old_id":["305"],"_yoast_wpseo_metadesc":["Flashback Pluggable Database"],"_yoast_wpseo_metakeywords":["Multitenant Database, Flashback, Oracle 12c, Pluggable Database"],"layout_show-author-box":["1"],"_layout_show-author-box":["field_5a64ee9cc6490"],"_edit_lock":["1518261654:3"],"_edit_last":["3"],"_vc_post_settings":["a:1:{s:10:\"vc_grid_id\";a:0:{}}"],"_yoast_wpseo_content_score":["30"],"layout_header":["light"],"_layout_header":["field_5a48111185e5f"],"layout_background":[""],"_layout_background":["field_5a481193c0995"],"layout_hide_services":["0"],"_layout_hide_services":["field_5a4811c5c0996"],"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":[""],"_yoast_wpseo_focuskw_text_input":["Flashback Database"],"_yoast_wpseo_focuskw":["Flashback Database"],"_yoast_wpseo_linkdex":["61"],"rank_math_primary_category":[""],"rank_math_description":["Flashback Pluggable Database"],"rank_math_focus_keyword":["Flashback Database"],"rank_math_news_sitemap_robots":["index"],"rank_math_robots":["a:1:{i:0;s:5:\"index\";}"],"rank_math_seo_score":["21"],"astra_style_timestamp_css":["1773738284"],"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":["2"],"wpil_links_outbound_internal_count_data":["eJztkstqwzAQRX8leNGdE9tJkzIhFNpAKfS161KMJRErkSUhy01K6L93JIeSQvsH2UnDnTtnHggVHBUUy1coryF7d0qzZyukZk\/K7DIop3DsYAGZpi9TIltGcQdTyHqvM3qV8zlkTQgOJhMvNfaGN1VRzcYcPW7RiHrMbTtRRsjD2DXu1rqgrFlRkHFrgjThClu3\/FByv0IfFNcyBZRYTYsCnKhzrq1RZpPvVWhygQHzTY9eJBnHQMpqAVvboDGyy7Hx0ogulyYJHoNsSVEuiog7I1jbhfisCPx\/4qi4gUwRoTdIrdZQDvku5b\/QhwyQkq1PdjSlt\/Xd6H6AHUXY0ZpgRw8RNs2KRoxCSMHqT+Z0v1Em+hZDKW1jL9ZEJXmdhpOsi9MC9o3qnPSMe4lB\/myjLAm0Y9gHG2Xn4eCR7wjnbHcx3FrRa8l+qatTkVT4EIb4l6K2L8dxOY4\/j+PrG5IAabY="],"wpil_links_outbound_external_count":["0"],"wpil_links_outbound_external_count_data":["eJxLtDKwqq4FAAZPAf4="],"wpil_sync_report2_time":["2024-08-27T11:47:27+00:00"],"_uag_css_file_name":["uag-css-305.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":0,"uagb_excerpt":"Flashback Pluggable Database Oracle 12.2 will be general available within the next few weeks including several new fetaures for Flashback Pluggable Database. But it will take some more month before customers will adopt 12.2 for their production database and we need some more experience with the PDB Undo management. Because thats the requirement for Flashback&hellip;","_links":{"self":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/305","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=305"}],"version-history":[{"count":1,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/305\/revisions"}],"predecessor-version":[{"id":6798,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/posts\/305\/revisions\/6798"}],"wp:attachment":[{"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/media?parent=305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/categories?post=305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/carajandb.com\/en\/wp-json\/wp\/v2\/tags?post=305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}