{"id":1992,"date":"2016-12-30T23:00:28","date_gmt":"2016-12-31T05:00:28","guid":{"rendered":"https:\/\/bijoos.com\/oraclenotes\/?p=1992"},"modified":"2026-02-07T15:27:12","modified_gmt":"2026-02-07T21:27:12","slug":"12-days-of-cloud-exploring-dbaas-with-data-guard","status":"publish","type":"post","link":"https:\/\/bijoos.com\/oraclenotes\/2016\/1992\/","title":{"rendered":"12 Days of #Cloud: Exploring #DBaaS with Data Guard"},"content":{"rendered":"<h2>12 Days of #Cloud: Day 11<\/h2>\n<p><a href=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/image22.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"wp-image-1821 alignleft\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/image22.png?resize=82%2C47&#038;ssl=1\" alt=\"\" width=\"82\" height=\"47\" \/><\/a>After a few failed attempts, I was successful in creating a Data Guard DBaaS Instance. Since I was playing with a trial account, the resources were limited. I guess when I had another database running, there is not much storage left to create two instances in Data Guard configuration. Anyway, that is my guess.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"wp-image-1993  alignright\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_5867439f7eefe.png?resize=440%2C330&#038;ssl=1\" alt=\"\" width=\"440\" height=\"330\" \/>Creating a Data Guard DBaaS service is pretty similar to <a href=\"https:\/\/bijoos.com\/oraclenotes\/2016\/1782\">creating a standard DBaaS instance<\/a>. Choose &#8220;Create Instance&#8221; from the Oracle Database Cloud Service. Notice that I chose &#8220;Enterprise Edition &#8211; Extreme Performance&#8221; as the software edition. You can create a Data Guard configuration using any Enterprise Edition option, but only Extreme Performance gives you the &#8220;Active Data Guard&#8221;. \u00a0Though an Oracle Data Guard configuration can contain one primary database and up to thirty standby destinations, the Oracle Data Guard configuration in Database Cloud Service includes one primary database and one standby database.\u00a0Oracle Active Data Guard (also known as real-time query) provides read-only access to the physical standby database while it is synchronized with the primary database.<\/p>\n<p id=\"MkmEypt\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-1995  alignleft\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_586748427d901.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>If you choose the software edition as Enterprise Edition, you will get the bottom portion to configure standby database. Click the check box to enable Data Guard configuration.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Once you click on the Create Service in the summary screen, it takes about 50 minutes to create Data Guard instance, which includes<\/p>\n<ul>\n<li>Primary Instance VM and database<\/li>\n<li>Standby Instance VM and standby database<\/li>\n<li>Listener and TNSNAMES.ORA configurations<\/li>\n<li>Data Guard Configuration with standby database running in read-only\u00a0mode for queries<\/li>\n<li>Perform service reliability checks on both nodes<\/li>\n<\/ul>\n<p id=\"yaWjmwo\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-1996  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58674a94e34cc.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>Click on the DBaaS instance to view details. The screenshot below shows the two nodes and their status.<\/p>\n<p id=\"XYAJLgS\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-1997  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58674ad2e5744.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>Note, -dg01 is my primary database node and -dg02 is my standby database node.<\/p>\n<p id=\"ExOMqrn\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-1998  alignright\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58674c4de01a7.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>The menu beside the node names as well as on the top includes three additional items related to Data Guard.<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.oracle.com\/en\/cloud\/paas\/database-dbaas-cloud\/csdbi\/data-guard-switchover.html\">Switchover<\/a>:\u00a0A switchover operation enables the primary database to switch roles with its standby database. There is no data loss during a switchover. After a switchover, each database continues to participate in the Oracle Data Guard configuration in its new role.<\/li>\n<li><a href=\"https:\/\/docs.oracle.com\/en\/cloud\/paas\/database-dbaas-cloud\/csdbi\/data-guard-failover.html\">Failover<\/a>:\u00a0A failover operation changes a standby database to the primary role in response to a primary database failure. The current primary database is shut down.<\/li>\n<li><a href=\"https:\/\/docs.oracle.com\/en\/cloud\/paas\/database-dbaas-cloud\/csdbi\/data-guard-reinstate-failed-primary.html\">Reinstate<\/a>:\u00a0After performing a failover to the standby database, you may be able to restore your original disaster-recovery solution by reinstating the failed primary database. You can use the Data Guard broker&#8217;s reinstate capability to make the failed primary database a viable standby database for the new primary.<\/li>\n<\/ul>\n<p>Use the public IP address to log into each Linux node. I see the two nodes pretty identical.<\/p>\n<p id=\"VVDcUrg\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full wp-image-2000 \" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58674cfa1a04f.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>Connect to the primary database (the\u00a0result\u00a0is same from standby as well) and query V$DATAGUARD_CONFIG.<\/p>\n<p id=\"JCOdKdm\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"wp-image-2001  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58674d48b2867.png?resize=533%2C293&#038;ssl=1\" alt=\"\" width=\"533\" height=\"293\" \/><\/p>\n<p>The tnsnames.ora is identical on both nodes, with pretty exhaustive configuration entries. The CDB, as well as PDB have FAILOVER configuration.<\/p>\n<p id=\"OJLIvkB\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"wp-image-2002  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58674dbeb3539.png?resize=433%2C328&#038;ssl=1\" alt=\"\" width=\"433\" height=\"328\" \/><\/p>\n<p>There are eight services running on both nodes. The naming is pretty self-explanatory.<\/p>\n<p id=\"TdlBSqw\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2003  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58674e0fbd98a.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2004  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58674ed228b35.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>And there are eight tnsnames.ora entries as well. I have only one PDB, if there are more PDBs, I guess more services and more TNSNAMES.ORA entries would be created.<\/p>\n<p>The log transport configuration on primary database is:<\/p>\n<p id=\"SBIHIMJ\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2005  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58674fabb06fb.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>The <a href=\"https:\/\/docs.oracle.com\/en\/cloud\/paas\/database-dbaas-cloud\/csdbi\/dbaascli.html\">dbaascli <\/a>utility has options to manage the Data Guard database roles. Before I start using <a href=\"https:\/\/docs.oracle.com\/en\/cloud\/paas\/database-dbaas-cloud\/csdbi\/dbaascli.html\">dbaascli<\/a>, applying the best practice I learned and updating the cloud toolset to the\u00a0latest version on both nodes.<\/p>\n<p>$\u00a0dbaascli dbpatchm &#8211;run -toolsinst -rpmversion=16.4.5.1_161213.1526<\/p>\n<p id=\"NIqrXjI\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2006  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_586750976f668.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>$ dbaascli dataguard status<\/p>\n<p id=\"uFPrOmX\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2007  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_586750d2a8bf7.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>$\u00a0dbaascli dataguard status &#8211;details yes<\/p>\n<p id=\"zXJDICg\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2008  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_586750fc4f10f.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>Enough of exploring the configurations. Let&#8217;s do some real Data Guard operations. First, I am going to use the Cloud Database Service Console to do a switchover &#8211; the current primary (-dg01) will become standby, and the current standby (-dg02) will become primary.<\/p>\n<p>Just for the sake of completeness, I am going to create a table under user Bill. After the switchover will validate the table on the new primary database for existence.<\/p>\n<p id=\"tTOirKM\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2011  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58675250a8558.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>Click on the Cloud Service menu and choose &#8220;Switchover&#8221;.<\/p>\n<p id=\"zlIICqZ\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2009  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_586751ab0aa8c.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>Voila, the role is reversed. No intervention! Took about 5 minutes.<\/p>\n<p id=\"hbTKBBK\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2010  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_586751e55be6d.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>And the table still exist.<\/p>\n<p id=\"XZUBqlN\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2012  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_586752a61449f.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>SQL also shows the database role is reversed.<\/p>\n<p id=\"pObBSqC\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2013  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_586752bd8a72b.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>I am assuming the Cloud Service is using the dbaascli tool for switchover, failver, reinstate operations. Let me use dbaascli to perform a manual failover.<\/p>\n<p>$ dbaascli dataguard status<\/p>\n<p id=\"BEoeoaD\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2014  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_5867532d40909.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>$\u00a0dbaascli dataguard failover<\/p>\n<p id=\"ZgJEKQp\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2015  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_586753488779b.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>The current primary database is now shutdown (abort), and the standby database is made primary. No active standby database.<\/p>\n<p>$\u00a0dbaascli dataguard status<\/p>\n<p id=\"GRGQkyv\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2016  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_586753a888453.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>The ORA-16661 message is a good indication that the physical standby database can be reinstated. Let&#8217;s try using dbaascli.<\/p>\n<p>$ dbaascli dataguard reinstate<\/p>\n<p id=\"ZGKrfwu\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2017  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_5867540cdddbc.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>$ dbaascli dataguard status<\/p>\n<p id=\"WqxNGEZ\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2018  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58675423e34ee.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>Well, forgot to mention that the standby database we have is in fact &#8220;Active Data Guard (Real-time Query)&#8221;.<\/p>\n<p>Check the OPEN_MODE in V$DATABASE as well as try to query the database.<\/p>\n<p id=\"BllqESS\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full wp-image-2019  aligncenter\" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_5867548220327.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>12 Days of #Cloud: Day 11 After a few failed attempts, I was successful in creating a Data Guard DBaaS Instance. Since I was playing with a trial account, the resources were limited. I guess when I had another database running, there is not much storage left to create two instances in Data Guard configuration. &#8230; <a title=\"12 Days of #Cloud: Exploring #DBaaS with Data Guard\" class=\"read-more\" href=\"https:\/\/bijoos.com\/oraclenotes\/2016\/1992\/\" aria-label=\"Read more about 12 Days of #Cloud: Exploring #DBaaS with Data Guard\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[55],"class_list":["post-1992","post","type-post","status-publish","format-standard","hentry","category-cloud-autonomous","tag-oracle-cloud"],"acf":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/1992","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/comments?post=1992"}],"version-history":[{"count":1,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/1992\/revisions"}],"predecessor-version":[{"id":2985,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/1992\/revisions\/2985"}],"wp:attachment":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/media?parent=1992"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/categories?post=1992"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/tags?post=1992"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}