{"id":812,"date":"2014-10-02T19:49:44","date_gmt":"2014-10-02T17:49:44","guid":{"rendered":"http:\/\/www.ludovicocaldara.net\/dba\/?p=812"},"modified":"2020-08-18T16:39:03","modified_gmt":"2020-08-18T14:39:03","slug":"maa-multitenant-presentation","status":"publish","type":"post","link":"https:\/\/www.ludovicocaldara.net\/dba\/maa-multitenant-presentation\/","title":{"rendered":"Oracle RAC, Oracle Data Guard, and Pluggable Databases: When MAA Meets Oracle Multitenant (OOW14)"},"content":{"rendered":"<p>Here you can find the material related to my session at <strong>Oracle Open World 2014<\/strong>. I&#8217;m sorry I&#8217;m late in publishing them, but I challenge you to find spare time during Oracle Open World! It&#8217;s the busiest week of the year! (Hard Work, Hard Play)<\/p>\n<p><strong>\u00a0Slides<\/strong><\/p>\n<p><iframe loading=\"lazy\" width=\"476\" height=\"400\" src=\"\/\/www.slideshare.net\/slideshow\/embed_code\/39808230\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p><strong>\u00a0Demo 1 video<\/strong><br \/>\n<iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"\/\/www.youtube.com\/embed\/V1tkO54TTqs\" allowfullscreen=\"allowfullscreen\" frameborder=\"0\"><\/iframe><\/p>\n<p><strong>Demo 2 video<\/strong><\/p>\n<p><iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"\/\/www.youtube.com\/embed\/Wuajt5qexTU\" allowfullscreen=\"allowfullscreen\" frameborder=\"0\"><\/iframe><\/p>\n<p><strong>Demo 1 script<\/strong><\/p>\n<pre class=\"lang:sh decode:true\">clear\r\n\r\nfunction pause () {\r\n\techo\r\n\tread -p \"$*\"\r\n\techo\r\n}\r\n\r\ntnsping cdbatl\r\n\r\npause \"next... status db\"\r\nclear\r\necho \\$ srvctl status database -db CDBATL\r\n\r\nsrvctl status database -db CDBATL\r\n\r\npause \"next... status pdb\"\r\n\r\nclear\r\n\r\nsqlplus sys\/racattack@cdbatl as sysdba &lt;&lt;EOF\r\n\tset echo on\r\n\tselect INST_ID, CON_ID, name, OPEN_MODE\r\n\t from gv\\$pdbs\r\n\t  where con_id!=2\r\n\t  order by name, inst_id;\r\n\texit\r\nEOF\r\n\r\npause \"next... add singleton service\"\r\n\r\nclear\r\n\r\n###  add service MAAZAPP SINGLETON\r\ncmd=\"srvctl add service -db CDBATL -service  maazapp -serverpool CDBPOOL -cardinality singleton -role primary -failovertype select -failovermethod basic -policy automatic -failoverdelay 2 -failoverretry 180 -pdb maaz\"\r\necho \\$ $cmd\r\neval $cmd\r\n\r\npause \"next... start service\"\r\nclear\r\n\r\ncmd=\"srvctl start service -db CDBATL -service maazapp -instance CDBATL_1\"\r\necho \\$ $cmd\r\neval $cmd\r\n\r\npause \"next... status pdb\"\r\n\r\nclear\r\n\r\nsqlplus sys\/racattack@cdbatl as sysdba &lt;&lt;EOF\r\n\tset echo on\r\n\tselect INST_ID, CON_ID, name, OPEN_MODE\r\n\t from gv\\$pdbs\r\n\t  where con_id!=2\r\n\t  order by name, inst_id;\r\n\texit\r\nEOF\r\n\r\n\r\ncmd=\"srvctl status database -db cdbatl\"\r\necho\r\necho \\$ $cmd\r\neval $cmd\r\n\r\ncmd=\"srvctl status service -service maazapp -db cdbatl\"\r\necho\r\necho \\$ $cmd\r\noutput=`$cmd`\r\necho $output\r\n\r\ncurrent=`echo $output | awk '{print $NF}'`\r\nif [ $current == \"raca01\" ] ; then\r\n\ttarget=\"raca02\"\r\nelse\r\n\ttarget=\"raca01\"\r\nfi\r\n\r\n\r\npause \"pause... please launch demo1_client.sh\"\r\npause \"next... relocate service from $current to $target\"\r\n\r\nclear\r\n\r\ncmd=\"srvctl relocate service -db CDBATL -service maazapp -currentnode $current -targetnode $target\"\r\necho \\$ $cmd\r\neval $cmd\r\n\r\n\r\npause \"next... status pdb\"\r\n\r\nclear\r\n\r\nsqlplus sys\/racattack@cdbatl as sysdba &lt;&lt;EOF\r\n\tset echo on\r\n\tselect INST_ID, CON_ID, name, OPEN_MODE\r\n\t from gv\\$pdbs\r\n\t  where con_id!=2\r\n\t  order by name, inst_id;\r\n\texit\r\nEOF\r\n\r\npause \"next... close pdb immediate on old inst\"\r\n\r\nclear\r\n\r\nsqlplus sys\/racattack@cdbatl as sysdba &lt;&lt;EOF\r\n\tset echo on\r\n alter pluggable database maaz close immediate instances=('CDBATL_1');\r\n\texit\r\nEOF\r\n\r\npause \"next... status pdb\"\r\n\r\nclear\r\n\r\nsqlplus sys\/racattack@cdbatl as sysdba &lt;&lt;EOF\r\n\tset echo on\r\n\tselect INST_ID, CON_ID, name, OPEN_MODE\r\n\t from gv\\$pdbs\r\n\t  where con_id!=2\r\n\t  order by name, inst_id;\r\n\texit\r\nEOF\r\n\r\npause \"next... modify service to uniform\"\r\n\r\nclear\r\n\r\ncmd=\"srvctl modify service -db CDBATL -service maazapp -cardinality uniform\"\r\necho \\$ $cmd\r\neval $cmd\r\n\r\npause \"next... status pdb\"\r\nclear\r\nsqlplus sys\/racattack@cdbatl as sysdba &lt;&lt;EOF\r\n\tset echo on\r\n\tselect INST_ID, CON_ID, name, OPEN_MODE\r\n\t from gv\\$pdbs\r\n\t  where con_id!=2\r\n\t  order by name, inst_id;\r\n\texit\r\nEOF\r\n\r\necho\r\ncmd=\"srvctl status service -service maazapp -db cdbatl\"\r\necho \\$ $cmd\r\neval $cmd \r\n\r\nexit\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Demo 2 script<\/strong><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:sh decode:true\">txtblk='\\e[0;30m' # Black - Regular\r\ntxtred='\\e[0;31m' # Red\r\ntxtgrn='\\e[0;32m' # Green\r\ntxtrst='\\e[0m'    # Text Reset\r\n\r\nfunction echop () {\r\n\techo\r\n\techo -e \"${txtgrn}$*${txtrst}\"\r\n}\r\n\r\nfunction echos () {\r\n\techo\r\n\techo -e \"${txtred}$*${txtrst}\"\r\n}\r\n\r\nfunction pause() {\r\n\techo\r\n\tread -p \"$*\"\r\n\techo\r\n}\r\n\r\nclear\r\n\r\nechop \"Status of the PRIMARY DATABASE\"\r\nsqlplus sys\/racattack@cdbatl as sysdba &lt;&lt;EOF\r\n\tset echo on\r\n\tselect db_unique_name, database_role from v\\$database;\r\n\tselect inst_id, con_id, name,open_mode from gv\\$pdbs where con_id!=2 order by con_id, inst_id;\r\n\texit\r\nEOF\r\n\r\npause \"next... standby status\"\r\nclear\r\nechos \"Status of the STANDBY DATABASE\"\r\n\r\nsqlplus sys\/racattack@cdbgva as sysdba &lt;&lt;EOF\r\n\tset echo on\r\n\tselect db_unique_name, database_role from v\\$database;\r\n\tselect open_mode from v\\$database;\r\n\tselect inst_id, con_id, name,open_mode from gv\\$pdbs where con_id!=2 order by con_id, inst_id;\r\n\texit\r\nEOF\r\n\r\n\r\n\r\npause \"next... dgmgrl status\"\r\nclear\r\nechos \"Data Guard configuration and status of the STANDBY database\"\r\ndgmgrl &lt;&lt;EOF\r\nconnect sys\/racattack\r\nshow configuration;\r\nshow database 'CDBGVA';\r\nexit\r\nEOF\r\n\r\n\r\npause \"please do tail -f on the apply instance\"\r\npause \"next... create new pdb ludo on primary \"\r\nclear\r\n\r\nechop \"Create new pluggable database on the primary: \"\r\nechop \"create pluggable database ludo admin user ludoadmin identified by ludoadmin;\"\r\nsqlplus sys\/racattack@cdbatl as sysdba &lt;&lt;EOF\r\n\tset echo on\r\n\tcreate pluggable database ludo admin user ludoadmin identified by ludoadmin;\r\n\r\n\tselect inst_id, con_id, name,open_mode from gv\\$pdbs where con_id!=2 order by con_id, inst_id;\r\n\texit\r\nEOF\r\n\r\npause \"next... create service for primary on both clusters\"\r\nclear\r\n\r\nechop \"Create service for primary ROLE on the primary cluster (CDBATL) via SSH\"\r\n\r\ncmd=\"srvctl add service -db CDBATL -service  ludoapp -serverpool CDBPOOL -cardinality singleton -role primary -failovertype select -failovermethod basic -policy automatic -failoverdelay 1 -failoverretry 180 -pdb ludo\"\r\necho \"\\$ ssh raca01 $cmd\"\r\nssh raca01 \". \/home\/oracle\/.bash_profile ; $cmd\"\r\n\r\nechos \"Create service for primary ROLE on the standby cluster (CDBGVA)\"\r\n\r\ncmd=\"srvctl add service -db CDBGVA -service  ludoapp -serverpool CDBPOOL -cardinality singleton -role primary -failovertype select -failovermethod basic -policy automatic -failoverdelay 1 -failoverretry 180 -pdb ludo\"\r\necho \"\\$ $cmd\"\r\neval $cmd\r\n\r\n\r\npause \"next... start service on primary\"\r\nclear\r\nechop \"Starting service on the primary via SSH\"\r\ncmd=\"srvctl start service -db CDBATL -service  ludoapp\"\r\necho \"\\$ ssh raca01 $cmd\"\r\nssh raca01 \". \/home\/oracle\/.bash_profile ; $cmd\"\r\n\r\n\r\n\r\npause \"next... create read only service for physical standby on both clusters\"\r\nclear\r\n\r\nechop \"Creating temporarily the readonly service for PRIMARY ROLE on the primary cluster (CDBATL) via SSH\"\r\ncmd=\"srvctl add service -db CDBATL -service  ludoread -serverpool CDBPOOL -cardinality singleton -role primary -failovertype select -failovermethod basic -policy automatic -failoverdelay 1 -failoverretry 180 -pdb ludo\"\r\necho \"\\$ ssh raca01 $cmd\"\r\nssh raca01 \". \/home\/oracle\/.bash_profile ; $cmd\"\r\n\r\nechop \"Starting the readonly service for PRIMARY ROLE on the primary cluster (CDBATL) via SSH\"\r\ncmd=\"srvctl start service -db CDBATL -service  ludoread\"\r\necho \"\\$ ssh raca01 $cmd\"\r\nssh raca01 \". \/home\/oracle\/.bash_profile ; $cmd\"\r\n\r\nechop \"Modifying the readonly service from PRIMARY ROLE to PHYSICAL STANDBY on the primary cluster (CDBATL) via SSH\"\r\ncmd=\"srvctl modify service -db CDBATL -service  ludoread -role physical_standby -pdb ludo\"\r\necho \"\\$ ssh raca01 $cmd\"\r\nssh raca01 \". \/home\/oracle\/.bash_profile ; $cmd\"\r\n\r\n\r\nechos \"Creating the readonly service for PHYSICAL STANDBY on the standby cluster (CDBGVA)\"\r\ncmd=\"srvctl add service -db CDBGVA -service  ludoread -serverpool CDBPOOL -cardinality singleton -role physical_standby -failovertype select -failovermethod basic -policy automatic -failoverdelay 1 -failoverretry 180 -pdb ludo\"\r\necho \"\\$ $cmd\"\r\neval $cmd\r\n\r\npause \"next... start read only service\"\r\n\r\nclear\r\nechos \"Starting the readonly service on the standby cluster\"\r\n\r\ncmd=\"srvctl start service -db CDBGVA -service  ludoread\"\r\necho \"\\$ $cmd\"\r\neval $cmd\r\n\r\n\r\npause \"next... standby status\"\r\nclear\r\n\r\nechos \"Standby status\"\r\nsqlplus sys\/racattack@cdbgva as sysdba &lt;&lt;EOF\r\n\tselect db_unique_name, database_role from v\\$database;\r\n\tselect open_mode from v\\$database;\r\n\tselect inst_id, con_id, name,open_mode from gv\\$pdbs where con_id!=2 order by con_id, inst_id;\r\n\texit\r\nEOF\r\n\r\npause \"please connect to the RW service\"\r\n\r\npause \"next... dgmgrl status and validate\"\r\nclear\r\n\r\nechos \"Validate Standby database\"\r\n\r\ndgmgrl &lt;&lt;EOF\r\nconnect sys\/racattack\r\nshow configuration;\r\nvalidate database 'CDBGVA';\r\nexit\r\nEOF\r\n\r\npause \"next... switchover to CDBGVA\"\r\nclear\r\n\r\nechos \"Switchover to CDBGVA! (it takes a while)\"\r\ndgmgrl &lt;&lt;EOF\r\nconnect sys\/racattack\r\nswitchover to 'CDBGVA';\r\nexit\r\nEOF\r\n<\/pre>\n<p>There&#8217;s one slide describing the procedure for cloning one PDB using the standbys clause. Oracle has released a Note while I was preparing my slides (one month ago) and I wasn&#8217;t aware of it, so you may also checkout this note on MOS:<\/p>\n<p><span style=\"font-weight: bold; color: #000000;\">Making Use of the STANDBYS=NONE Feature with Oracle Multitenant (Doc ID 1916648.1)<\/span><\/p>\n<p><strong>UPDATE<\/strong>: I&#8217;ve blogged about it in a more recent post: <a title=\"Tales from the Demo Grounds part 2: cloning a PDB with ASM and Data Guard (no ADG)\" href=\"https:\/\/www.ludovicocaldara.net\/dba\/demo-grounds-clone-pdb-asm-dg\/\" target=\"_blank\" rel=\"noopener noreferrer\">Tales from the Demo Grounds part 2: cloning a PDB with ASM and Data Guard (no ADG)<\/a><\/p>\n<p><strong>UPDATE 2:<\/strong>\u00a0I&#8217;ve written another blog post about these topics: <a title=\"Cloning a PDB with ASM and Data Guard (no ADG) without network transfer\" href=\"https:\/\/www.ludovicocaldara.net\/dba\/clone-pdb-asm-dg-no-network-transfer\/\">Cloning a PDB with ASM and Data Guard (no ADG) without network transfer<\/a><\/p>\n<p>Cheers!<\/p>\n<p>&nbsp;<\/p>\n<p>&#8212;<\/p>\n<p>Ludovico<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here you can find the material related to my session at Oracle Open World 2014. I&#8217;m sorry I&#8217;m late in publishing them, but I challenge you to find spare time during Oracle Open World! It&#8217;s the busiest week of the &hellip; <a href=\"https:\/\/www.ludovicocaldara.net\/dba\/maa-multitenant-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":{"footnotes":""},"categories":[116,327,326,329,3,52,328,149,132],"tags":[202,295,292,289,75,23,203],"class_list":["post-812","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-oracle-mt","category-oracle-rac","category-triblog","tag-active-data-guard","tag-adg","tag-data-guard","tag-multitenant","tag-oracle-database-12c","tag-rac","tag-real-application-clusters"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/812","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=812"}],"version-history":[{"count":5,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/812\/revisions"}],"predecessor-version":[{"id":1982,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/812\/revisions\/1982"}],"wp:attachment":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/media?parent=812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/categories?post=812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/tags?post=812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}