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, so here we go:
Credits
I have to give special credits to my colleague Robert Bialek. I’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 work. Most of the content included in the slides has been created by Robert, not me. (Thank you for your help! :-))
Slides
Demo recording
Demo script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
clear function db { export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 export 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 } function gsm { export ORACLE_HOME=/u01/app/oracle/product/12.1.0/gsmhome_1 export 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 } db echo "#### CURRENT CONFIGURATION: CLASSIC DATA GUARD, 3 DATABASES ####" dgmgrl -echo sys/password1@oltp_de <<EOF show configuration EOF echo "next: GSM config" read -p "" gsm echo "#### GSM CONFIGURATION ####" echo "GDS COMMAND: config" gdsctl <<EOF connect gsm_admin/password1@gsm1 config exit EOF echo "next: ADD GDSPOOL" read -p "" echo "#### ADD GDSPOOL ####" echo "GDS COMMAND: add gdspool -gdspool sales" gdsctl <<EOF connect gsm_admin/password1@gsm1 add gdspool -gdspool sales exit EOF echo "next: ADD BROKERCONFIG" read -p "" echo "#### ADD BROKERCONFIG ####" echo "GDS COMMAND: add brokerconfig -connect gsm02.trivadistraining.com:1521/oltp_de -pwd password1 -gdspool sales -region germany" gdsctl <<EOF connect gsm_admin/password1@gsm1 add brokerconfig -connect gsm02.trivadistraining.com:1521/oltp_de -pwd password1 -gdspool sales -region germany exit EOF echo "next: config databases" read -p "" echo "#### CONFIG DATABASES ####" echo "GDS COMMAND: config database" gdsctl <<EOF connect gsm_admin/password1@gsm1 config database exit EOF echo "next: modify databases" read -p "" echo "#### MODIFY DATABASES ####" echo "GDS COMMAND: modify database -database oltp_ch1 -region switzerland modify database -database oltp_ch2 -region switzerland " gdsctl <<EOF connect gsm_admin/password1@gsm1 modify database -database oltp_ch1 -region switzerland modify database -database oltp_ch2 -region switzerland config database exit EOF echo "next: add service read/write" read -p "" echo "#### ADD SERVICE R/W ####" echo "GDS COMMAND: add service -gdspool sales -service gsales_rw -role primary -preferred_all -failovertype SELECT -failovermethod BASIC -failoverretry 5 -failoverdelay 3 -locality LOCAL_ONLY -region_failover start service -service gsales_rw services" gdsctl <<EOF connect gsm_admin/password1@gsm1 add service -gdspool sales -service gsales_rw -role primary -preferred_all -failovertype SELECT -failovermethod BASIC -failoverretry 5 -failoverdelay 3 -locality LOCAL_ONLY -region_failover start service -service gsales_rw services exit EOF echo "next: ADD SERVICE R/O" read -p "" echo "#### ADD SERVICE R/O ####" echo "GDS COMMAND: add 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 start service -service gsales_ro services " gdsctl <<EOF connect gsm_admin/password1@gsm1 add 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 start service -service gsales_ro services exit EOF echo "next: stop apply ch1 (run cli_ro_short.sh first)" read -p "" db echo "#### STOP APPLY DATA GUARD ON OLTP_CH1 ####" dgmgrl -echo sys/password1@oltp_de <<EOF edit database oltp_ch1 set state='apply-off'; EOF echo "next: gds services" read -p "" gsm echo "#### GDS SERVICES ####" echo "GDS COMMAND: services " gdsctl <<EOF connect gsm_admin/password1@gsm1 services exit EOF echo "next: stop apply ch2 (run cli_ro_short.sh first)" read -p "" db echo "#### STOP APPLY DATA GUARD ON OLTP_CH2 ####" dgmgrl -echo sys/password1@oltp_de <<EOF edit database oltp_ch2 set state='apply-off'; EOF echo "next: gds services" read -p "" gsm echo "#### GDS SERVICES ####" echo "GDS COMMAND: services " gdsctl <<EOF connect gsm_admin/password1@gsm1 services exit EOF echo "next: gds services" read -p "" gsm echo "#### GDS SERVICES ####" echo "GDS COMMAND: services " gdsctl <<EOF connect gsm_admin/password1@gsm1 services exit EOF echo "next: start apply ch1 and ch2" read -p "" db echo "#### START APPLY DATA GUARD ON OLTP_CH1 and OLTP_CH2 ####" dgmgrl -echo sys/password1@oltp_de <<EOF edit database oltp_ch1 set state='apply-on'; EOF echo "sleeping 5" sleep 5 dgmgrl -echo sys/password1@oltp_de <<EOF edit database oltp_ch2 set state='apply-on'; EOF echo "next: gds services" read -p "" gsm echo "#### GDS SERVICES ####" echo "GDS COMMAND: services " gdsctl <<EOF connect gsm_admin/password1@gsm1 services exit EOF echo "next: gds services" read -p "" gsm echo "#### GDS SERVICES ####" echo "GDS COMMAND: services " gdsctl <<EOF connect gsm_admin/password1@gsm1 services exit EOF echo "next: switchover to CH1 (run cli_ro_long.sh and cli_rw_long.sh first)" read -p "" db echo "#### VALIDATE DATABASE OLTP_CH1 ####" dgmgrl -echo sys/password1@oltp_de <<EOF validate database oltp_ch1; EOF echo "next: switchover" read -p "" echo "#### SWITCHOVER TO OLTP_CH1 ####" dgmgrl -echo sys/password1@oltp_de <<EOF switchover to oltp_ch1; EOF echo "next: gds services" read -p "" |
And the script to revert the demo:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
clear function db { export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 export 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 } function gsm { export ORACLE_HOME=/u01/app/oracle/product/12.1.0/gsmhome_1 export 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 } db dgmgrl -echo sys/password1@oltp_de <<EOF switchover to oltp_de; EOF gsm echo "#### STOP and DELETE SERVICE, REMOVE BROKERCONFIG, REMOVE POOL ####" gdsctl <<EOF connect gsm_admin/password1@gsm1 stop service -service gsales_ro stop service -service gsales_rw remove service -service gsales_ro remove service -service gsales_rw remove brokerconfig remove gdspool -gdspool sales config exit EOF db dgmgrl -echo sys/password1@oltp_de <<EOF show configuration EOF echo "DEMO reverted." read -p "" |
Cheers
—
Ludovico
The following two tabs change content below.
Latest posts by Ludovico (see all)
- New views in Oracle Data Guard 23c - January 3, 2024
- New in Data Guard 21c and 23c: Automatic preparation of the primary - December 22, 2023
- Does FLASHBACK QUERY work across incarnations or after a Data Guard failover? - December 13, 2023