{"id":1250,"date":"2015-12-04T16:21:58","date_gmt":"2015-12-04T14:21:58","guid":{"rendered":"http:\/\/www.ludovicocaldara.net\/dba\/?p=1250"},"modified":"2020-08-18T16:28:34","modified_gmt":"2020-08-18T14:28:34","slug":"gds-presentation","status":"publish","type":"post","link":"https:\/\/www.ludovicocaldara.net\/dba\/gds-presentation\/","title":{"rendered":"Oracle Active Data Guard and Global Data Services in Action!"},"content":{"rendered":"<p>In a few days I will give a presentation at UKOUG Tech15 about Global Data Services, it will be the first time that I present this session.<\/p>\n<p>I usually like to give the link to the material to my audience, so here we go:<\/p>\n<p><strong>Credits<\/strong><\/p>\n<p>I have to give special credits to my colleague <strong><a href=\"https:\/\/www.linkedin.com\/profile\/view?id=ADEAABEED0kBkMQX6vZ_ab0ODSQahc9IZpXp-V4&amp;authType=NAME_SEARCH&amp;authToken=0nI9&amp;locale=en_US&amp;srchid=337029861449211433946&amp;srchindex=1&amp;srchtotal=14&amp;trk=vsrp_people_res_name&amp;trkInfo=VSRPsearchId%3A337029861449211433946%2CVSRPtargetId%3A285478729%2CVSRPcmpt%3Aprimary%2CVSRPnm%3Atrue%2CauthType%3ANAME_SEARCH\">Robert Bialek<\/a><\/strong>. I&#8217;ve got a late confirmation for this session and my slide deck was not ready at all, so I have used a big part of his original\u00a0work. Most of the content included in the slides has been created by Robert, not me. (Thank you for your help! :-))<\/p>\n<p><strong>Slides<\/strong><\/p>\n<p><iframe loading=\"lazy\" width=\"595\" height=\"485\" style=\"border: 1px solid #CCC; border-width: 1px; margin-bottom: 5px; max-width: 100%;\" src=\"\/\/www.slideshare.net\/slideshow\/embed_code\/key\/HNQW2KzmPnnysM\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\"> <\/iframe><\/p>\n<p><strong>Demo recording<\/strong><br \/>\n<iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/T9Nfzncbycc\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><strong>Demo script<\/strong><\/p>\n<pre class=\"lang:sh decode:true \">clear\r\n\r\nfunction db {\r\nexport ORACLE_HOME=\/u01\/app\/oracle\/product\/12.1.0\/dbhome_1\r\nexport PATH=$ORACLE_HOME\/bin:$ORACLE_HOME\/OPatch:\/usr\/lib64\/qt-3.3\/bin:\/usr\/local\/bin:\/bin:\/usr\/bin:\/usr\/local\/sbin:\/usr\/sbin:\/sbin\r\n}\r\n\r\nfunction gsm {\r\nexport ORACLE_HOME=\/u01\/app\/oracle\/product\/12.1.0\/gsmhome_1\r\nexport PATH=$ORACLE_HOME\/bin:$ORACLE_HOME\/OPatch:\/usr\/lib64\/qt-3.3\/bin:\/usr\/local\/bin:\/bin:\/usr\/bin:\/usr\/local\/sbin:\/usr\/sbin:\/sbin\r\n}\r\n\r\ndb\r\n\r\necho \"#### CURRENT CONFIGURATION: CLASSIC DATA GUARD, 3 DATABASES ####\"\r\ndgmgrl -echo sys\/password1@oltp_de &lt;&lt;EOF\r\nshow configuration\r\nEOF\r\necho \"next: GSM config\"\r\nread -p \"\"\r\n\r\ngsm\r\necho \"#### GSM CONFIGURATION ####\"\r\necho \"GDS COMMAND:\r\nconfig\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nconfig\r\nexit\r\nEOF\r\necho \"next: ADD GDSPOOL\"\r\nread -p \"\"\r\n\r\n\r\necho \"#### ADD GDSPOOL ####\"\r\necho \"GDS COMMAND:\r\nadd gdspool -gdspool sales\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nadd gdspool -gdspool sales\r\nexit\r\nEOF\r\necho \"next: ADD BROKERCONFIG\"\r\nread -p \"\"\r\n\r\n\r\necho \"#### ADD BROKERCONFIG ####\"\r\necho \"GDS COMMAND:\r\nadd brokerconfig -connect gsm02.trivadistraining.com:1521\/oltp_de -pwd password1 -gdspool sales -region germany\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nadd brokerconfig -connect gsm02.trivadistraining.com:1521\/oltp_de -pwd password1 -gdspool sales -region germany\r\nexit\r\nEOF\r\necho \"next: config databases\"\r\nread -p \"\"\r\n\r\n\r\necho \"#### CONFIG DATABASES ####\"\r\necho \"GDS COMMAND:\r\nconfig database\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nconfig database\r\nexit\r\nEOF\r\necho \"next: modify databases\"\r\nread -p \"\"\r\n\r\necho \"#### MODIFY DATABASES ####\"\r\necho \"GDS COMMAND: \r\nmodify database -database oltp_ch1 -region switzerland\r\nmodify database -database oltp_ch2 -region switzerland\r\n\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nmodify database -database oltp_ch1 -region switzerland\r\nmodify database -database oltp_ch2 -region switzerland\r\nconfig database\r\nexit\r\nEOF\r\necho \"next: add service read\/write\"\r\nread -p \"\"\r\n\r\n\r\necho \"#### ADD SERVICE R\/W ####\"\r\necho \"GDS COMMAND: \r\nadd service -gdspool sales -service gsales_rw -role primary -preferred_all -failovertype SELECT -failovermethod BASIC -failoverretry 5 -failoverdelay 3 -locality LOCAL_ONLY -region_failover\r\nstart service -service gsales_rw\r\nservices\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nadd service -gdspool sales -service gsales_rw -role primary -preferred_all -failovertype SELECT -failovermethod BASIC -failoverretry 5 -failoverdelay 3 -locality LOCAL_ONLY -region_failover\r\nstart service -service gsales_rw\r\nservices\r\nexit\r\nEOF\r\necho \"next: ADD SERVICE R\/O\"\r\nread -p \"\"\r\n\r\necho \"#### ADD SERVICE R\/O ####\"\r\necho \"GDS COMMAND: \r\nadd service -gdspool sales -service gsales_ro -role PHYSICAL_STANDBY -failover_primary -lag 20 -preferred_all -failovertype SELECT -failovermethod BASIC -failoverretry 5 -failoverdelay 3 -locality LOCAL_ONLY -region_failover\r\nstart service -service gsales_ro\r\nservices\r\n\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nadd service -gdspool sales -service gsales_ro -role PHYSICAL_STANDBY -failover_primary -lag 20 -preferred_all -failovertype SELECT -failovermethod BASIC -failoverretry 5 -failoverdelay 3 -locality LOCAL_ONLY -region_failover\r\nstart service -service gsales_ro\r\nservices\r\nexit\r\nEOF\r\necho \"next: stop apply ch1 (run cli_ro_short.sh first)\"\r\nread -p \"\"\r\n\r\ndb\r\necho \"#### STOP APPLY DATA GUARD ON OLTP_CH1 ####\"\r\ndgmgrl -echo sys\/password1@oltp_de &lt;&lt;EOF\r\nedit database oltp_ch1 set state='apply-off';\r\nEOF\r\necho \"next: gds services\"\r\nread -p \"\"\r\n\r\n\r\ngsm\r\necho \"#### GDS SERVICES ####\"\r\necho \"GDS COMMAND: \r\nservices\r\n\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nservices\r\nexit\r\nEOF\r\necho \"next: stop apply ch2 (run cli_ro_short.sh first)\"\r\nread -p \"\"\r\n\r\ndb\r\necho \"#### STOP APPLY DATA GUARD ON OLTP_CH2 ####\"\r\ndgmgrl -echo sys\/password1@oltp_de &lt;&lt;EOF\r\nedit database oltp_ch2 set state='apply-off';\r\nEOF\r\necho \"next: gds services\"\r\nread -p \"\"\r\n\r\ngsm\r\necho \"#### GDS SERVICES ####\"\r\necho \"GDS COMMAND: \r\nservices\r\n\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nservices\r\nexit\r\nEOF\r\necho \"next: gds services\"\r\nread -p \"\"\r\n\r\ngsm\r\necho \"#### GDS SERVICES ####\"\r\necho \"GDS COMMAND: \r\nservices\r\n\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nservices\r\nexit\r\nEOF\r\necho \"next: start apply ch1  and ch2\"\r\nread -p \"\"\r\n\r\ndb\r\necho \"#### START APPLY DATA GUARD ON OLTP_CH1 and OLTP_CH2 ####\"\r\ndgmgrl -echo sys\/password1@oltp_de &lt;&lt;EOF\r\nedit database oltp_ch1 set state='apply-on';\r\nEOF\r\necho \"sleeping 5\"\r\nsleep 5\r\ndgmgrl -echo sys\/password1@oltp_de &lt;&lt;EOF\r\nedit database oltp_ch2 set state='apply-on';\r\nEOF\r\necho \"next: gds services\"\r\nread -p \"\"\r\n\r\ngsm\r\necho \"#### GDS SERVICES ####\"\r\necho \"GDS COMMAND: \r\nservices\r\n\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nservices\r\nexit\r\nEOF\r\necho \"next: gds services\"\r\nread -p \"\"\r\n\r\ngsm\r\necho \"#### GDS SERVICES ####\"\r\necho \"GDS COMMAND: \r\nservices\r\n\"\r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nservices\r\nexit\r\nEOF\r\necho \"next: switchover to CH1 (run cli_ro_long.sh and cli_rw_long.sh first)\"\r\nread -p \"\"\r\n\r\n\r\ndb\r\necho \"#### VALIDATE DATABASE OLTP_CH1 ####\"\r\ndgmgrl -echo sys\/password1@oltp_de &lt;&lt;EOF\r\nvalidate database oltp_ch1;\r\nEOF\r\necho \"next: switchover\"\r\nread -p \"\"\r\necho \"#### SWITCHOVER TO OLTP_CH1 ####\"\r\ndgmgrl -echo sys\/password1@oltp_de &lt;&lt;EOF\r\nswitchover to oltp_ch1;\r\nEOF\r\necho \"next: gds services\"\r\nread -p \"\"\r\n<\/pre>\n<p>And the script to revert the demo:<\/p>\n<pre class=\"lang:sh decode:true \">clear\r\n\r\nfunction db {\r\nexport ORACLE_HOME=\/u01\/app\/oracle\/product\/12.1.0\/dbhome_1\r\nexport PATH=$ORACLE_HOME\/bin:$ORACLE_HOME\/OPatch:\/usr\/lib64\/qt-3.3\/bin:\/usr\/local\/bin:\/bin:\/usr\/bin:\/usr\/local\/sbin:\/usr\/sbin:\/sbin\r\n}\r\n\r\nfunction gsm {\r\nexport ORACLE_HOME=\/u01\/app\/oracle\/product\/12.1.0\/gsmhome_1\r\nexport PATH=$ORACLE_HOME\/bin:$ORACLE_HOME\/OPatch:\/usr\/lib64\/qt-3.3\/bin:\/usr\/local\/bin:\/bin:\/usr\/bin:\/usr\/local\/sbin:\/usr\/sbin:\/sbin\r\n}\r\n\r\ndb\r\ndgmgrl -echo sys\/password1@oltp_de &lt;&lt;EOF\r\nswitchover to oltp_de;\r\nEOF\r\n\r\ngsm\r\necho \"#### STOP and DELETE SERVICE, REMOVE BROKERCONFIG, REMOVE POOL ####\"\r\n \r\ngdsctl &lt;&lt;EOF\r\nconnect gsm_admin\/password1@gsm1\r\nstop service -service gsales_ro\r\nstop service -service gsales_rw\r\nremove service -service gsales_ro\r\nremove service -service gsales_rw\r\nremove brokerconfig\r\nremove gdspool -gdspool sales\r\nconfig\r\nexit\r\nEOF\r\n\r\ndb\r\ndgmgrl -echo sys\/password1@oltp_de &lt;&lt;EOF\r\nshow configuration\r\nEOF\r\n\r\necho \"DEMO reverted.\"\r\nread -p \"\"\r\n<\/pre>\n<p>Cheers<\/p>\n<p>&#8212;<\/p>\n<p>Ludovico<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a few days I will give a presentation at UKOUG Tech15 about Global Data Services, it will be the first time that I present this session. I usually like to give the link to the material to my audience, &hellip; <a href=\"https:\/\/www.ludovicocaldara.net\/dba\/gds-presentation\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[116,327,326,329,3,52,132],"tags":[],"class_list":["post-1250","post","type-post","status-publish","format-standard","hentry","category-events-and-conferences","category-oracle-maa","category-oracle","category-oracle-dg","category-oracledb","category-12c","category-triblog"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/comments?post=1250"}],"version-history":[{"count":3,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1250\/revisions"}],"predecessor-version":[{"id":1253,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1250\/revisions\/1253"}],"wp:attachment":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/media?parent=1250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/categories?post=1250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/tags?post=1250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}