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c^hiZg^c\DgVXaZ[dg;dgijcZ*%%XdbeVc^Zh# B^X]VZa]Vhldg`ZYVhaZVY976[dgG68VcY9ViVbeaZbZciVi^dc8VhZHijYn[dg;^YZa^inCVi^dcVa;^cVcX^Va ;C;ºVcY]VhWZZcVeVgi^X^eVci^cDgVXaZ9ViVWVhZ7ZiVegd\gVbh#B^X]VZaheZX^Va^oZh^c YViVWVhZVcYDgVXaZ6eea^XVi^dc^beaZbZciVi^dch#=ZgZ¼hVa^c`idVXVhZhijYn/lll#dgVXaZ#Xdb$ iZX]cdad\n$YZeadn$VkV^aVW^a^in$]iYdXh$;C;T8VhZHijYn#]iba# Sreekanth Chintala ^hVcD8E"XZgi^[^ZY976!]VhWZZcjh^c\DgVXaZiZX]cdad\^Zh[dgbdgZi]Vc VYZXVYZ!VcY]VhbdgZi]Vc&*nZVghd[>IZmeZg^ZcXZ#HgZZ`Vci]heZX^Va^oZh^cDgVXaZ]^\] VkV^aVW^a^in!Y^hVhiZggZXdkZgn!VcY\g^YXdbeji^c\#HgZZ`Vci]^hVcVji]dgd[bVcniZX]c^XVal]^iZ eVeZghVcYV[gZfjZciheZV`ZgViDgVXaZDeZcLdgaY!>DJldjaYa^`ZidYZY^XViZi]^hWdd`idbn`^Yh!>h]VcVcYC^h]V0idbnl^[Z!Eg^nV0VcYbdhi ^bedgiVcianidbneVgZcih!l]dhZ\j^YVcXZVcYhjeedgi]VkZValVnhWZZc^ckVajVWaZ# —Nitin Vengurlekar
This page intentionally left blank
Contents ;dgZldgY # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # mk^^ 6X`cdlaZY\bZcih # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # m^m >cigdYjXi^dc # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # mm^
1 9ViVhAV\\^c\ # # # # # # # # # # # # # # # # # # # # # # # # # # # 9ZiZgb^c^c\L]Zi]ZgHFA6eean>hi]Z7diiaZcZX` # # # # # # # # # # # # # # # # # # # # # 9ZiZgb^c^c\L]^X]HFA6eean8dbedcZci>hi]Z7diiaZcZX` # # # # # # # # # # # # #
&'. &'. &() &)& &)* &)* &*, &*&*&*. &*.
IgdjWaZh]ddi^c\HFA6eean # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # JcYZghiVcY^c\GZhiVgih^cHFA6eean # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # IgdjWaZh]ddi^c\HideeZYHFA6eean # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 8dcXajh^dc # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
5 >beaZbZci^c\DgVXaZ9ViVbeaZbZci^c\DgVXaZ9ViVil^aa jhZVcVbZi]Vied^cihWVX`idi]Zeg^bVgnYViVWVhZ!hdi]Vil]Zci]^hhiVcYWnWZXdbZhi]Z eg^bVgnYViVWVhZhZZ8]VeiZg-!9ViVHI:C:G#DG6!lZVYYi]ZSDUViig^WjiZVhlZaa/ SID_LIST_listener_name= (SID_LIST= (SID_DESC= (SDU=32767) (GLOBAL_DBNAME=Matrix_DR0.domain) (SID_NAME=Matrix_DR0) (ORACLE_HOME=/scratch/OracleHomes)))
LZ]VkZcdlegZeVgZYi]Zeg^bVgnYViVWVhZidbV`Zdji\d^c\XdccZXi^dchidi]ZhiVcYWn YViVWVhZhVcYVXXZei^cXdb^c\XdccZXi^dch[gdbi]ZhiVcYWnYViVWVhZhjh^c\i]ZbVm^bjbH9J h^oZd[('!,+,!VcYk^XZkZghV[gdbhiVcYWnideg^bVgn#
TCP Tuning HZii^c\i]ZDgVXaZCZiH9J^hdcani]Z[^ghieVgid[ijc^c\VcZildg`¸i]ZDgVXaZ eVgi#CdllZcZZYid\dYZZeZgi]VcDgVXaZCZiVcYegZeVgZdjgI8EcZildg`aVnZ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idejidjg hiVcYWn^cVadXVi^dci]Vi^h*%b^aZh-%`bVlVn7dhidc!BVhhVX]jhZiih!idBVcX]ZhiZg!CZl =Vbeh]^gZVcYi]VilZ]VkZViZhiZYaViZcXnd[-bhcddcZa^kZh^cVeZg[ZXildgaY#Hddjg XVaXjaVi^dcadd`ha^`Zi]^h/ 79E2&**BW^ih$hZX-bh( LZXVceaj\i]dhZcjbWZgh^cidV79EXVaXjaVidg!a^`Zi]ZheZZY\j^YZ#cZi+79EXVaXjaVidg! VcYbjai^ean^ihVchlZgWndjgdkZg]ZVYd[(/ BDP = 155,000 * 3 BDP = 465,000 bytes
HddjghdX`ZiWj[[Zgh^oZldjaYWZ)+*!%%%WniZhdgVWdji%#)*B7#7ji]dlY^YlZgZVaan \Zii]VicjbWZg4=ZgZ¼hi]ZgZVabVi]/ Bandwidth: 155Mbits/sec = 155,000,000 bits/sec (155 * 1,000,000) Latency: 8ms = .008 sec (8 / 1000) BDP = 155,000,000 * .008 * 3 BDP = 3,720,000 bits / 8 (8 bits to a byte) BDP = 465,000 bytes
6hndjXVchZZ!i]ZhZVbdjcihVgZbjX]aVg\Zgi]Vci]ZYZ[VjaihdX`Zih^oZd[&+@# Cdll]Vi]VeeZch^[lZbdkZi]ZhiVcYWnYViVWVhZ[gdbBVcX]ZhiZg!CZl=Vbeh]^gZ!VcY eji^i^cCZlVg`!CZl?ZghZn4I]Vi^hVWdji''+b^aZh(+&`b!hd^[lZVhhjbZlZ]VkZi]ZhVbZ D8"(VcYi]VilZ¼aa\Zii]ZhVbZheZZYVhWZ[dgZ!djgaViZcXn^h\d^c\id\didVWdji(+bh#Hd l]ViYdZhi]ViYdiddjg79E4 BDP = 155Mbits/sec * 36ms * 3 BDP = 697,500 * 3 BDP = 2,092,500 bytes
HdcdllZcZZYidhZidjghdX`Zih^oZid'!%.'!*%%WniZh!dggdj\]an'B7#7jil]ViVWdji i]ZXVhZ^cl]^X]lZ]VkZildhiVcYWnYViVWVhZh¸dcZ^cBVcX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ceVgVbZiZg!l^i]djgegZk^djhild YZhi^cVi^dchaZi¼hVYYi]ZCOMPRESSIONViig^WjiZ/ log_archive_dest_2='service=Matrix_DR0 LGWR SYNC REOPEN=15 NET_TIMEOUT=15 COMPRESSION=ENABLE valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=Matrix_DR0' log_archive_dest_3='service=Matrix_DR1 LGWR ASYNC REOPEN=15 COMPRESSION=ENABLE valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=Matrix_DR1'
BVig^mT9G%l^aaWZXdbegZhhZYdcanl]ZcVc6G8=egdXZhh^hhZcY^c\V\Vecd XdbegZhh^dc[dgHNC8!gZbZbWZg4!VcYBVig^mT9G&l^aa]VkZi]ZgZYdXdbegZhhZYViVaa i^bZh#I]^hYdZhcdibZVci]Vii]ZgZYdgZbV^chXdbegZhhZYdcY^h`!Vhi]^hXdbegZhh^dc ^hdcanYjg^c\igVchedgi#I]ZYViV^hjcXdbegZhhZYVii]ZhiVcYWnh^YZWZ[dgZ^i^hlg^iiZc idi]ZHGA[^aZ# N
MAX_CONNECTIONS I]^hViig^WjiZlVh^cigdYjXZY^c&%gGZaZVhZ'idVaadlndjid
heZX^[ni]ZcjbWZgd[VgX]^kZegdXZhhZhi]Vih]djaYWZjhZY[dgi]ZhiVcYWnYZhi^cVi^dc
&(
CdiZ,'.**&¹GZYdIgVchedgi8dbegZhh^dc^cV9ViV[ndjiZcYidYdVadid[i]^c\hi]Vi;aVh]WVX`9ViVWVhZXVccdi ]VcYaZ!i]Zcndjb^\]ilVciidheZX^[nVYZaVn#;aVh]WVX`9ViVWVhZVcY9ViVi[jcXi^dchWn Yd^c\h^beaZhig^c\gZeaVXZbZci# db_file_name_convert='/Matrix/','/Matrix_DR0/'
I]^hldjaYigVchaViZi]ZYViV[^aZcVbZh[gdbi]^h '/u03/oradata/Matrix/sysaux.dbf'
idi]^h/ '/u03/oradata/Matrix_DR0/sysaux.dbf'
H^b^aVgan! db_file_name_convert='+DATA','+RECOVERY'
ldjaYed^cii]ZYViVWVhZidi]ZYViV[^aZh^ci]Z6HBY^h`\gdje+RECOVERY^chiZVYd[ +DATA#I]ZgZhid[i]ZeVi]XdjaYgZbV^ci]ZhVbZ#>cdjgZmVbeaZ!hiVcYWnXgZVi^dc jh^c\6HB!ndjl^aacdicZZYidYZ[^cZi]^heVgVbZiZg#
8]VeiZg'/ >beaZbZci^c\DgVXaZ9ViVbeaZbZci^c\DgVXaZ9ViV SELECT OWNER, TABLE_NAME FROM DBA_LOGSTDBY_NOT_UNIQUE WHERE (OWNER, TABLE_NAME) NOT IN (SELECT DISTINCT OWNER, TABLE_NAME FROM DBA_LOGSTDBY_UNSUPPORTED); OWNER TABLE_NAME ------------------------------ -----------------------------SCOTT BONUS SCOTT SALGRADE SH SALES SH COSTS SH SUPPLEMENTARY_DEMOGRAPHICS
=dlZkZg!_jhiWZXVjhZViVWaZh]dlhje^ci]Zk^ZlYdZhc¼ibZVci]Vi^igZVaan^hWVY!_jhii]Vi ndjl^aa\ZiVadid[ZmigVgZYdWZ^c\lg^iiZcidi]ZDGAhVcY]ZcXZhZciidi]ZhiVcYWnYViVWVhZh Vaad[i]Zb!e]nh^XVadgad\^XVa¸gZbZbWZgi]VigZYdigVchedgi]Vhcdi]^c\idYdl^i]i]Z6eean hZgk^XZh#I]Zk^ZlVahd]VhVXdajbcXVaaZY!hjgeg^h^c\anZcdj\]!BAD_COLUMN!i]Vi^[ZfjVaid Y!bZVchndj]VkZVXdajbci]ViXVccdiWZad\\ZYidi]ZgZYdhigZVb[dgjc^fjZcZhhjhZ!hdi]Zc ndjXdjaYZcYjejeYVi^c\i]Zlgdc\gdlVii]Zad\^XVahiVcYWnYViVWVhZ#Ndjbjhi[^mi]ZhZ iVWaZhWnVYY^c\hdbZjc^fjZcZhhdgVY^hVWaZYgZanXdchigV^ci/ SQL> SELECT OWNER, TABLE_NAME FROM DBA_LOGSTDBY_NOT_UNIQUE WHERE (OWNER, TABLE_NAME) NOT IN SELECT DISTINCT OWNER, TABLE_NAME FROM DBA_LOGSTDBY_UNSUPPORTED) AND BAD_COLUMN = 'Y'; no rows selected &+ &,
HZZ]iie/$$YdlcadVY#dgVXaZ#Xdb$YdXh$XY$7'-(*.T%&$hZgkZg#&&&$W'-'.)$YViVThjeedgi#]ib8=9beaZbZci^c\DgVXaZ9ViV[ndj]VkZVcniVWaZh^ci]Z¹cdijc^fjZºk^Zl!ZkZcl^i]djii]ZBAD_COLUMNd[Y!ndj hi^aacZZYid[^mi]Zjc^fjZcZhhdci]dhZVhlZaa0di]Zgl^hZ!ndjVgZ\d^c\idWZlg^i^c\dji VaVg\ZjccZXZhhVgnVbdjcid[gZYd#;dgZmVbeaZ!iV`Zi]ZHVaZh=^hidgnSUPPLEMENTARY_ DEMOGRAPHICSiVWaZ/ SQL> DESC SH.SUPPLEMENTARY_DEMOGRAPHICS Name Null? ----------------------------------------- -------CUST_ID NOT NULL EDUCATION OCCUPATION HOUSEHOLD_SIZE YRS_RESIDENCE AFFINITY_CARD BULK_PACK_DISKETTES FLAT_PANEL_MONITOR HOME_THEATER_PACKAGE BOOKKEEPING_APPLICATION PRINTER_SUPPLIES Y_BOX_GAMES OS_DOC_SET_KANJI COMMENTS
Type ------------NUMBER VARCHAR2(21) VARCHAR2(21) VARCHAR2(21) NUMBER NUMBER(10) NUMBER(10) NUMBER(10) NUMBER(10) NUMBER(10) NUMBER(10) NUMBER(10) NUMBER(10) VARCHAR2(4000)
6aad[i]ZhZXdajbchVgZ\d^c\idWZlg^iiZcdjiidi]ZgZYdhigZVbl]Zi]Zgi]ZnX]Vc\ZYdgcdi! _jhihdHFA6eeanXVc[^cYi]Zg^\]igdldci]Zad\^XVahiVcYWn#LZfjdiZ[gdbi]ZOracle Utilities bVcjVa!8]VeiZg&-!jcYZg¹HjeeaZbZciVaAd\\^c\º/&If the table has neither a primary key nor a non-null unique index key, then all columns except LONG and LOB are supplementally logged; this is equivalent to specifying ALL supplemental logging for that row. Therefore, Oracle recommends that when you use database-level primary key supplemental logging, all or most tables be defined to have primary or unique index keys. 7ni]ZlVn!i]^hVeea^ZhidVcniVWaZi]Vi]Vhi]^hjc^fjZcZhhegdWaZb!ZkZci]dhZi]ViHFA 6eeanhVnhVgZjchjeedgiZY#Ndjl^aaWZ\ZcZgVi^c\gZYd[dgi]ZbVhlZaa!h]^ee^c\^iidi]Z hiVcYWnYViVWVhZhVcY]Vk^c\^ii]gdlcVlVn# ;^cVaan!l]Zcndj]VkZi]ZhZjc^fjZcZhh^hhjZhVcYndjgZhdakZi]Zbl^i]VY^hVWaZYG:AN XdchigV^ci!ndjhi^aacZZYid\didi]Zad\^XVahiVcYWnVcYVYYVc^cYZm[dgi]ZiVWaZhi]ViVgZ hjeedgiZYWnHFA6eean0di]Zgl^hZ!ndjVgZ\d^c\idWZYd^c\Vadid[[jaaiVWaZhXVchVcYHFA 6eeaneZg[dgbVcXZ^hcdi\d^c\idWZkZgn\ddY# I]^h!idd!^hYdXjbZciZY^ci]ZData Guard Concepts and AdministrationbVcjVa^c8]VeiZg) [dgi]ZkZgh^dcndjVgZgjcc^c\#
Start with a Physical Standby Jh^c\dcZd[i]ZbZi]dYhYZhXg^WZY^ci]ZegZXZY^c\hZXi^dcd[i]^hX]VeiZg!XgZViZVe]nh^XVa hiVcYWnYViVWVhZ#>[ndjVgZjh^c\i]Z7gd`Zg!YdcdiVYYi]^hcZle]nh^XVahiVcYWnYViVWVhZid &-
HZZ]iie/$$YdlcadVY#dgVXaZ#Xdb$YdXh$XY$7'-(*.T%&$hZgkZg#&&&$W'-(&.$ad\b^cZg#]ib^&%'&%+-#
102
DgVXaZ9ViV[ndjVgZjh^c\VcZm^hi^c\e]nh^XVahiVcYWni]Vi^h7gd`ZgXdcigdaaZY! ndjbjhiY^hVWaZi]ZiVg\ZiYViVWVhZ[gdbi]Z7gd`ZgWZ[dgZXdci^cj^c\#DcXZi]ZcZldgZm^hi^c\ e]nh^XVahiVcYWn^hhncX]gdc^oZYl^i]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99A0di]Zgl^hZ!HFA6eeanXdjaY [^cYi]Zeg^bVgndge]nh^XVahiVcYWnYViVWVhZ¼hYViV[^aZhVcYediZci^VaanYdhdbZYVbV\Zl]Zc egdXZhh^c\VcnALTER TABLESPACE99A#NdjYdi]^hWnZmZXji^c\i]Z[daadl^c\eVX`V\Zdc ndjgad\^XVahiVcYWnYViVWVhZ/ SQL> EXECUTE DBMS_LOGSTDBY.SKIP('ALTER TABLESPACE');
I]^hl^aaeji^c[dgbVi^dc^cidi]Zad\^XVahiVcYWnbZiVYViVi]Vil^aaiZaaHFA6eeanid^\cdgZVcn d[i]ZhZ99AXdbbVcYh^i[^cYh^ci]ZgZYdhigZVb#LZl^aaY^hXjhhi]^heVX`V\ZVcYbdgZ^c 8]VeiZg)# :kZgni]^c\^hgZVYncdl#I]Ze]nh^XVahiVcYWn]VhWZZci]gdj\]^ihX]Vc\ZhVcY^hcdlgZVYn idhZgkZ^c^ihcZlXVeVX^inVhndjgad\^XVahiVcYWn#6aai]VigZbV^chidYd^hhiVgiHFA6eean#H^cXZ lZ[daadlZYi]ZXdggZXiegdXZYjgZl]ZclZXgZViZYdjge]nh^XVahiVcYWn!hZkZgVaHGA[^aZh]VkZ VagZVYnWZZcXgZViZY!hdlZXVchiVgiHFA6eean^cgZVa"i^bZVeeanbdYZjh^c\i]ZIMMEDIATE `ZnldgY/ SQL>
ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
HFA6eeanl^aacdlhiVgijei]ZkVg^djhegdXZhhZhVhdjia^cZY^c8]VeiZg&VcYhiVgiidb^cZ i]ZgZYdi]VilVhhZciYjg^c\djgXgZVi^dcegdXZhh#CZlgZYd[gdbi]Zeg^bVgnl^aahiVgiXdb^c\ ^cVhhddcVhi]Zeg^bVgnYViVWVhZhl^iX]Zhi]Zdca^cZad\h^cXZgZYdigVchedgilVhVagZVYnhZije [dgdjge]nh^XVahiVcYWn#9dcdiZmeZXiidhZZcZlYViV[gdbndjgeg^bVgnYViVWVhZV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oracle Recovery 7ZXVjhZDgVXaZ¼hgZXdkZgnbZX]Vc^XhVgZYg^kZcWni]Z68>9bdYZa!^ihbV^cejgedhZ^hid egdk^YZYViV^ciZ\g^inVcYXdch^hiZcXnVXgdhh[V^ajgZh#I]Zi]gZZbV^c[V^ajgZhineZhVgZigVchVXi^dc! ^chiVcXZ!VcYbZY^V[V^ajgZh#>ci]^hhZXi^dc!lZ[dXjhdc^chiVcXZVcYbZY^VgZXdkZgn#
Instance Recovery >chiVcXZgZXdkZgndXXjghl]Zci]ZYViVWVhZ^chiVcXZ[V^ah¸^cdi]ZgldgYh!i]ZXdciZcihd[i]Z HnhiZbI^hVc^bedgiVciZaZbZcid[i]ZigVchVXi^dcWZXVjhZ^ibVg`hi]Z ZcYd[i]ZigVchVXi^dcVcYi]jh\jVgVciZZhi]Vii]ZgZYdegZk^djhan\ZcZgViZY^hegdeV\ViZYid Y^h`#I]^h^hVahdgZ[ZggZYidVhlog-force at commit#
Nologging Operations I]ZdcanZmXZei^dcidi]Zlg^iZ"V]ZVYeda^Xn^hl]ZcY^gZXieVi]lg^iZhVgZZbeadnZY¸[dg ZmVbeaZ!Y^gZXieVi]adVYsqlloaddgCREATE TABLE AS SELECT{^chZgideZgVi^dch#I]ZhZ igVchVXi^dchYdcdidg^\^cViZ^ci]ZWj[[ZgXVX]ZVcYi]jhZmea^X^ianjhZi]Zwrite-behind logging protocol#CZkZgi]ZaZhh!gZYd^h\ZcZgViZY[dgY^gZXieVi]lg^iZdeZgVi^dchVcY^hi]ZgZ[dgZ[jaan gZXdkZgVWaZ#9^gZXieVi]adVYhdXXjgVWdkZi]Z]^\]lViZgbVg`d[i]ZiVWaZ!hdi]ZYViV^hcdi
112
DgVXaZ9ViV[cdad\\^c\deZgVi^dchVgZYZiZXiZY!i]Z[daadl^c\hiZehXVcWZjhZYidgZXdkZgi]ZV[[ZXiZY YViV[^aZh#
8]VeiZg(/ GZYdEgdXZhh^c\
113
Managed Recovery 6ai]dj\]i]ZDgVXaZYdXjbZciVi^dchiViZhi]Vindjh]djaYjhZALTER DATABASE MANAGED STANDBY DATABASE idVaiZgi]ZWZ]Vk^dgd[bVcV\ZYgZXdkZgn!ndjXVcVahdjhZi]Z h]dgiZcZYkZgh^dc/RECOVER MANAGED STANDBY DATABASE #GZbZbWZgidValVnh jhZi]ZMANAGED`ZnldgY0di]Zgl^hZ!ndjl^aaWZeZg[dgb^c\bVcjVagZXdkZgnVcYWneVhh^c\ 9ViV[HGA[^aZhVgZcdijhZY!^cXdb^c\gZYd^hcdi`Zei^[i]ZXdccZXi^dcid i]Zeg^bVgn^hadhi¸[dgZmVbeaZ!l]Zci]Zeg^bVgnYViVWVhZ[V^ah!]ZcXZl]ZcV[V^adkZg dXXjgh!i]ZYViVi]VilVhWZ^c\hZciVii]Zi^bZd[i]ZY^hXdccZXi^hadhi#=dlZkZg!^[i]Vi gZYdYViVlVhlg^iiZc^cVcHGA!^i^heZgh^hiZciVcYVkV^aVWaZl]Zci]Z[V^adkZgdXXjgh#
N
Performance objective L]Zci]ZACHdgVc6G8=egdXZhhV[iZgDgVXaZ9ViVWVhZ &%gG&bVYZVXdccZXi^dcidi]ZhiVcYWn!^i]VYidlV^il]^aZi]ZG;HegdXZhhXgZViZY VcY^c^i^Va^oZYi]ZVgX]^kZad\dci]ZhiVcYWnWZ[dgZi]ZACH$6G8=XdjaYhiVgihZcY^c\ gZYd#I]^hXdjaYXVjhZVXdch^YZgVWaZeVjhZ^[i]Zad\[^aZh^oZlVhaVg\Z¸hjX]Vh*%%B7 dg& SELECT RECOVERY_MODE FROM V$ARCHIVE_DEST_STATUS WHERE DEST_ID=2; RECOVERY_MODE ----------------------MANAGED REAL-TIME APPLY
CdiZi]Vi^[i]ZDELAYViig^WjiZ^hheZX^[^ZY^ci]ZLOG_ARCHIVE_DEST_neVgVbZiZg!VcYgZVa"i^bZ Veean^hZcVWaZY!i]ZgZYdVeeanaV\i^bZ^h^\cdgZY# >chdbZXVhZh!i]ZgZYdgViZWZXdbZhidd]^\]VcYi]ZVeeanegdXZhh^hjcVWaZid`ZZeje l^i]gZVa"i^bZVeean#>ci]ZhZhXZcVg^dh!i]ZBGEdgAHEVjidbVi^XVaaneZg[dgbhi]ZgZYdVeean jh^c\i]ZVgX]^kZgZYdad\[^aZh#L]Zci]ZgZYdgViZ]VhhjWh^YZY!i]ZVeeanl^aaV\V^cgZhjbZ gZVa"i^bZVeeanjh^c\i]ZHGA# L^i]i]ZVYkZcid[gZVa"i^bZVeean!9ViVi^hkZgn^bedgiVcii]Vii]Z97LG egdXZhhZh]VkZZcdj\]>$DWVcYl^Yi]ideZg[dgbi]^hiVh`#Id^cXgZVhZ97LG i]gdj\]eji!ValVnhjhZcVi^kZVhncX]gdcdjh>$DWnhZii^c\DISK_ASYNCH_IO=TRUE YZ[Vjai#>ci]ZgVgZXVhZi]ViVhncX]gdcdjh>$D^hcdiVkV^aVWaZ!jhZDBWR_IO_SLAVES id^begdkZi]ZZ[[ZXi^kZYViVWadX`lg^iZgViZl^i]hncX]gdcdjh>$D# N As with all cases of database recovery, the most important factor is I/O bandwidth# DgVXaZbZY^VgZXdkZgn^hYg^kZcVcYegZYdb^cVcianYZeZcYZcidc>$DWVcYl^Yi]!VcY l^i]djihj[[^X^Zci>$DWVcYl^Yi]!i]ZVeeanegdXZhhl^aaWZhiVaaZY#I]jh^i^h^bedgiVciid ZchjgZi]ViZcdj\]>$DWVcYl^Yi]^hVkV^aVWaZdci]ZhiVcYWnh^iZ#8Va^WgViZT>D^hVcZl ji^a^in^cigdYjXZY^c&&g#I]ViVaadlhVjhZgid\Vj\Zi]ZdkZgVaa>$Di]gdj\]ejidci]Z hZgkZg#;dgbdgZYZiV^ahdc8Va^WgViZT>DhZZBZiVA^c`CdiZ,',%+'#& N Remember that media recovery is heavily dependent on the Oracle buffer cache#I]jhV aVg\ZYViVWVhZXVX]Zh^oZXVch^\c^[^XVcian^begdkZbZY^VgZXdkZgneZg[dgbVcXZ#L]^aZ^c bVcV\ZYgZXdk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ZYVii]Zad\^XVahiVcYWnYViVWVhZVcY ]dlidXjhidb^oZi]ZhZid[gZea^XViZYiVWaZh#HZXdcY!ndjcZZYidjcYZghiVcY]dlid Xjhidb^oZVad\^XVahiVcYWnYViVWVhZidiV`ZVYkVciV\Zd[^ihigjZedlZg/i]ZVW^a^inid d[[adVYndjgVeea^XVi^dch!Vaadl^c\i]ZXgZVi^dcd[VYY^i^dcVahX]ZbVdW_ZXihhjX]Vh bViZg^Va^oZYk^Zlh!^cYZmZh!VcYhddc#
N
Steady state operational issues 6ihiZVYnhiViZ!ndjcZZYid[dXjhdcildXdbedcZcih/ I]Z[^ghi^hi]ZgZYdigVchedgihZgk^XZi]VibV`ZhhjgZi]VigZYd\ZcZgViZYVii]Zeg^bVgn YViVWVhZVgg^kZhVii]ZhiVcYWnh^iZegdbeianVcYVaacZildg`Y^hXdccZXi^dchVgZ]VcYaZY igVcheVgZcian#I]^hlVhY^hXjhhZY^cYZiV^a^c8]VeiZg'#I]ZhZXdcY^hi]ZHFA6eean hZgk^XZi]Vib^cZhVcYVeea^Zhi]ZgZYdgZXdgYhidbV^ciV^ci]Zad\^XVahiVcYWnYViVWVhZ VcYegdk^YZhcZVggZVa"i^bZgZedgihVcYfjZg^Zh#LZl^aaXdcXZcigViZdci]ZHFA6eean hZgk^XZh^ci]^hX]VeiZg#
8]VeiZg)/ Ad\^XVaHiVcYWn N
129
Role transitions I]ZHFA6eeanhZgk^XZVahdegdk^YZhi]ZVW^a^inidX]Vc\ZgdaZh WZilZZcVeg^bVgnVcYVad\^XVahiVcYWnYViVWVhZ#GdaZigVch^i^dcXVcWZbdgZXdbeaZm ^cad\^XVahiVcYWnVhdeedhZYidhiZVYnhiViZdeZgVi^dcVaegdXZhhZh!WZXVjhZVeea^XVi^dc XdccZXi^k^incZZYhidWZXdch^YZgZY^cVYY^i^dcidi]ZegdXZhhZh^ckdakZYl^i]YViVWVhZ gdaZigVch^i^dchdci]ZcZleg^bVgn#GdaZigVch^i^dc!^ci]ZXdciZmid[HFA6eean!h]djaY WZgdji^cZaniZhiZY^cndjgY^hVhiZggZXdkZgn9GZck^gdcbZci#GdaZigVch^i^dcl^aacdiWZ XdkZgZY^ci]^hX]VeiZg!VhVbdgZYZiV^aZYY^hXjhh^dc^hegdk^YZY^c8]VeiZg-#
Characterizing the Dataset Available at the Logical Standby >ci]^hhZXi^dc!lZl^aaY^hXjhhkVg^djh^hhjZhgZaViZYidi]ZgZea^XViZYYViV/l]Vi\ZihgZea^XViZY! ]dlgZea^XViZYYViV^hegdiZXiZY[gdbVXX^YZciVabdY^[^XVi^dc!VcY]dlndjXVclg^iZXjhidb^oZ hdaji^dchl]ZgZcVi^kZgZYd"WVhZYgZea^XVi^dchjeedgi^haVX`^c\#I]ZclZl^aaY^hXjhhkVg^djh ^hhjZhgZaViZYidXjhidb^o^c\Vad\^XVahiVcYWnidgZVa^oZ^ih[jaaediZci^Va¸^cXajY^c\i]ZVW^a^inid d[[adVYVeea^XVi^dch[gdbi]Zeg^bVgnYViVWVhZ#
Characterizing the Dataset Replicated from the Primary Database 6ad\^XVahiVcYWn^h[^ghiVcY[dgZbdhiVhiVcYWn!hdhdbZfjZhi^dchVg^hZcVijgVaan/ N L]VieVgid[i]Zeg^bVgnYViVWVhZ¼hYViVhZil^aaWZgZea^XViZYVii]Zad\^XVahiVcYWn4 N 8VclZe^X`VcYX]ddhZi]ZiVWaZhi]ViVgZgZea^XViZYVii]Zad\^XVahiVcYWn4 N L]ViegZkZcihjhZgh[gdbbdY^[n^c\i]ZgZea^XViZYYViVVii]Zad\^XVahiVcYWnYViVWVhZ4 N >hi]ZgZVcnlVnidgZea^XViZhX]ZbVdW_ZXihi]ViYdcdi]VkZcVi^kZgZYd"WVhZY gZea^XVi^dchjeedgi4
Determining What Gets Replicated at the Logical Standby Database 9ViV EXECUTE DBMS_LOGSTDBY.INSTANTIATE_TABLE (SCHEMA_NAME => 'SALES', TABLE_NAME => 'CUSTOMERS', DBLINK3 => 'INSTANTIATE_TABL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jegdWVWanYdcdilVciidhZii]Zad\^XVahiVcYWnGUARDdci]Zeg^bVgnYViVWVhZ Zmea^X^ian#>[ndjlZgZidYdhd!^ildjaYfj^X`anWg^c\egdYjXi^dcidV]Vai# SQL> CONNECT SYS/ORACLE AS SYSDBA CONNECTED. SQL> ALTER DATABASE GUARD STANDBY; DATABASE ALTERED. SQL> CONNECT SCOTT/TIGER CONNECTED. SQL> UPDATE EMP SET SAL=9999 WHERE EMPNO=7902; UPDATE EMP SET SAL=9999 WHERE EMPNO=7902 * ERROR AT LINE 1: ORA-16224: DATABASE GUARD IS ENABLED
NdjldjaY\Zii]ZhVbZgZhjaihl^i]ALLdci]Zeg^bVgnYViVWVhZ#D[XdjghZALL^hVkZgn fj^X`lVnidbV`ZndjgegdYjXi^dcYViVWVhZVgZVY"dcanYViVWVhZl^i]djiVh]jiYdlc#
Myth Buster: Standard Log-based Replication Can Give You an Equivalent to Logical Standby – Part 2 L^i]djiDgVXaZ¼h^ciZ\gViZYHFA6eeanhdaji^dc!VgZea^XVi^dchdaji^dcXVccdiegdk^YZi]Z Wj^ai"^cegdiZXi^dcd[i]ZGUARD#
8]VeiZg)/ Ad\^XVaHiVcYWn
135
Replicating Unsupported Tables AZi¼hadd`Vii]Za^hid[YViVineZhi]ViHFA6eeanl^aacdihjeedgi^ci]ZXjggZcigZaZVhZd[DgVXaZ G97BH&&gGZaZVhZ&/ N DW_ZXiineZhVcYG:;h N 8daaZXi^dchVARRAYhVcYcZhiZYiVWaZh N MBAhidgZYVhdW_ZXi"gZaVi^dcVaVcYW^cVgnMBA N HZXjgZ;^aZaVg\ZdW_ZXihAD7h N 8dbegZhhZYiVWaZh Hdl]ViYdndjYd^[ndj]VkZhjX]YViVineZh^cndjgeg^bVgnYViVWVhZ!VcYndjh^bean XVccdiYdl^i]djii]ZbVii]Zad\^XVahiVcYWnYViVWVhZ4I]Zh^ijVi^dc^hcdiVhWaZV`Vhndj b^\]ii]^c`#L^i]hdbZVbdjcid[egd\gVbb^c\!ndjXVchi^aaYZeadnVad\^XVahiVcYWnYViVWVhZ Vhadc\VhndjXVcZchjgZi]Z[daadl^c\/ N I]ZgViZd[bdY^[^XVi^dcdci]ZhZiVWaZh^hcdikZgn]^\]#) N NdjXVcXdcigdal]Zc99AhiViZbZcihVgZZmZXjiZYdci]ZhZiVWaZhi]ViX]Vc\Zi]Z h]VeZd[i]ZiVWaZVYY$Ygde$bdY^[nXdajbch# >[ndjXVcZchjgZi]ZildegZgZfj^h^iZh!9ViViYdZh^iWn Vaadl^c\ndjid[^gZig^\\ZghVii]Zad\^XVahiVcYWnYViVWVhZVhX]Vc\ZhVgZWZ^c\Veea^ZYidi]Z bV^ciV^cZYiVWaZh#CdljhjVaanig^\\ZghVgZY^hVWaZY^ci]ZXdciZmid[HFA6eeanegdXZhhZh#L]n4 HVn![dgZmVbeaZ!i]Vindj]VkZViVWaZ=G#:BEADN::H^ci]Zeg^bVgnYViVWVhZ!l^i]Vig^\\Zg YZ[^cZYhjX]i]ViZkZgni^bZVcZlZbeadnZZ^hVYYZY^ci]ZiVWaZ!VcZcign^h^chZgiZY^cid >I#:BEADN::HidhiVgiVldg`dgYZgidVaadXViZVcZlXdbejiZg[dgi]ZZbeadnZZ#Hd^ci]ZgZYd higZVb!ndjl^aahZZgZYdgZXdgYhgZaViZYidi]Zdg^\^cVa^chZgiid=G#:BEADN::H[daadlZYWnV ig^\\ZgZY^chZgiid>I#:BEADN::H# NdjdWk^djhanYdcdilVciHFA6eeanid[^gZi]Zig^\\ZgVii]Zad\^XVahiVcYWnYViVWVhZ l]Zc^i^chZgihi]Zgdl^ci]Z=G#:BEADN::HiVWaZ!h^cXZ^i^h\d^c\idZcXdjciZgi]Z^chZgiid
Myth Buster: Standard Log-based Replication Can Give You an Equivalent to Logical Standby – Part 3 I]^gY"eVgingZea^XVi^dcegdYjXihYdcdi]VkZi]ZVW^a^inidY^hVWaZ[^g^c\d[i]Zig^\\Zgh#Hdid YZeadni]Zb!ndjl^aa]VkZidY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zgi]Vil^aaVahd[^gZVii]Zad\^XVahiVcYWnYViVWVhZ ^ci]ZXdciZmid[i]ZHFA6eeanegdXZhhZh!aZi¼hZmeadgZ]dl^iXVcWZjhZYidbV^ciV^cVc di]Zgl^hZjchjeedgiZYiVWaZ#,;dgZVX]iVWaZndjlVciidgZea^XViZjh^c\ig^\\Zghi]Vi[^gZVii]Z ad\^XVahiVcYWn!ndjl^aacZZYidXgZViZi]gZZhX]ZbVdW_ZXih/ N
A logging table I]^hl^aaWZjhZYidXVeijgZi]ZigVch[dgbZYbdY^[^XVi^dcidi]ZWVhZ iVWaZhjX]i]ViHFA6eeanXVcgZea^XViZi]Zad\\^c\iVWaZ#
N
A base table trigger I]^hl^aa[^gZVii]Zeg^bVgnYViVWVhZidXVeijgZi]ZX]Vc\Zh^ci]Z ad\\^c\iVWaZ#
N
A logging table trigger I]^hl^aa[^gZViWdi]i]Zeg^bVgnVcYi]Zad\^XVahiVcYWn YViVWVhZh!Wji^il^aacZZYidWZlg^iiZc^chjX]VlVni]Vi^ibV`ZhbdY^[^XVi^dchdcanVi i]Zad\^XVahiVcYWnYViVWVhZ#
AZi¼hadd`Vii]ZX]VgVXiZg^hi^Xhd[ZVX]d[i]ZhZ#
Characteristics of a Logging Table ;dgZ[[^X^ZciheVXZbVcV\ZbZci!ndjcZZYidYZh^\ci]Z ad\\^c\iVWaZVhVbZhhV\^c\iVWaZhdi]Vii]Zad\\^c\iVWaZh^oZYdZhcdi\gdlegdedgi^dcVaan l^i]i]ZWVhZiVWaZ#I]jh!ndjl^aacZZYidXVeijgZi]ZbdY^[^XVi^dcineZidi]Zad\\^c\iVWaZ# I]Zad\\^c\iVWaZbjhiXdciV^ci]Z[daadl^c\Xdajbch/ N 6XdajbcidhidgZi]ZVXi^dcidWZiV`ZcVii]Zad\^XVahiVcYWnYViVWVhZ# N 8dajbchidgZegZhZciZVX]Xdajbc^ci]ZWVhZiVWaZ/ N I]ZXdajbch^ci]ZWVhZiVWaZi]ViXVcWZc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bch^ci]Zad\\^c\iVWaZid^YZci^[ni]Zgdld[i]ZWVhZiVWaZ# I]ZhZVgZcZZYZYidegdXZhhi]ZUPDATEVcYDELETEhiViZbZcihXdggZXian#AZi¼hXVaa i]ZhZXdajbchidentification columns. N ;dgiVWaZhl^i]Veg^bVgn`Zn!i]ZXdajbchbV`^c\jei]Zeg^bVgn`Znh]djaYWZi]Z ^YZci^[^XVi^dcXdajbch# N >[ndjgiVWaZYdZhcdi]VkZVeg^bVgn`Zn!Wji]VhVcdc"cjaajc^fjZ^cYZm!bV`Z i]ZhZXdajbchndjg^YZci^[^XVi^dcXdajbch# N >[ndjgiVWaZYdZhcdi]VkZZ^i]ZgVeg^bVgn`Zndgcdc"cjaajc^fjZ^cYZm!ndjl^aa cZZYidjhZVaaXdajbch^cndjg^YZci^[^XVi^dchZi#-
Characteristics of the Trigger on the Base Table I]ZWVhZiVWaZig^\\ZgXVcZm^hiViWdi]i]Z eg^bVgnVcYi]Zad\^XVahiVcYWnYViVWVhZh#H^cXZi]^h^hVgZ\jaVg9BAig^\\Zg!^il^aacdi[^gZ^c i]ZXdciZmid[VHFA6eeanegdXZhh# N I]Zig^\\Zgh]djaYWZVgZ\jaVgig^\\Zgl^i]i]Zfire_once_onlyegdeZginhZiidTRUE# N ;dgVcn9BAdci]ZWVhZiVWaZ!i]Zig^\\Zgh]djaY N [^ghi^chZgiVgdl^ci]Zad\\^c\iVWaZ^YZci^[n^c\i]ZdeZgVi^dcVcYad\\^c\VaakVajZh cZZYZYidgZeaVni]ZdeZgVi^dc^ch^YZi]Zad\\^c\iVWaZig^\\ZgVii]Zad\^XVahiVcYWn YViVWVhZ0 N cZmiYZaZiZi]Zgdl[gdbi]Zad\\^c\iVWaZidegZkZcii]Zh^oZd[i]Zad\\^c\iVWaZ [gdb^cXgZVh^c\#
Characteristics of the Trigger on the Logging Table [daadl^c\X]VgVXiZg^hi^Xh/
I]Zad\\^c\iVWaZig^\\Zgbjhi]VkZi]Z
N I]Zfire_once_onlyegdeZginh]djaYWZhZiidFALSE# N I]Zig^\\Zgh]djaYcdieZg[dgbVcnX]Vc\ZhVii]Zeg^bVgnYViVWVhZ#NdjXVcYZiZgb^cZ l]Zi]Zgi]Zig^\\ZgcZZYhideZg[dgbVcnVXi^dcWn^ckd`^c\i]Zdbms_logstdby.is_ apply_server[jcXi^dc^ch^YZi]Zig^\\ZgWdYn# N I]Zig^\\ZgcZZYhideZg[dgbi]ZXdggZhedcY^c\VXi^dc^ci]ZWVhZiVWaZVh^cY^XViZYWn i]ZDML_TYPEXdajbc^ci]Zad\\^c\iVWaZ#>[ndjVgZldg`^c\dcAD7XdajbchjhZY idgZea^XViZVARRAYdgSDO_GEOMETRY!ndjl^aacZZYi]Zig^\\ZgideZg[dgbVhZXdcY UPDATEhiViZbZci[daadl^c\Vcn^chZgidgUPDATEd[i]ZWVhZiVWaZ#
Example of Trigger-based Replication in Action I]Z[daadl^c\ZmVbeaZh]dlhi]Zad\\^c\ iVWaZYZ[^c^i^dcVcYig^\\ZghdjgXZ[dgi]Z:BEADN::iVWaZ^ci]ZI:HIhX]ZbV!l]^X]XdciV^ch
-
>ci]^hXVhZ!ndjgWVhZiVWaZWZiiZgWZhbVaa^ch^oZdg]VkZVkZgnadljeYViZgViZ!h^cXZndjVgZ\d^c\id^cXjgi]Z Xdhid[V[jaa"iVWaZhXVc[dgZkZgnjeYViZY$YZaZiZYgdl#
138
DgVXaZ9ViV SET LONG 32009 SQL> SELECT DBMS_METADATA.GET_DDL(OBJECT_TYPE => 'TABLE', NAME => 'EMPLOYEE', SCHEMA => 'TEST') AS TABLE_DEF FROM DUAL; TABLE_DEF -----------------------------------------------------------------------CREATE TABLE "SYS"."EMP" ( "ID" NUMBER, "NAME" "TEST"."NAME_TYP" , CONSTRAINT "TEST_EMP_PK" PRIMARY KEY ("ID") USING 10 TABLESPACE "TEST_TBS" ENABLE ) 11 TABLESPACE "TEST_TBS" SQL> SELECT DBMS_METADATA.GET_DDL(OBJECT_TYPE => 'TYPE', NAME => 'NAME_TYP', SCHEMA => 'TEST') AS TYP_DEF FROM DUAL; TYP_DEF ---------------------------------------------------------------------------CREATE OR REPLACE TYPE "TEST"."NAME_TYP" AS OBJECT ( FIRST_NAME VARCHAR2(32), LAST_NAME VARCHAR2(32));
H^cXZndjjhZYDBMS_METADATA.GET_DDLndjVagZVYn`cdli]Zeg^bVgn`Zn[dgi]Z iVWaZ/^ci]^hXVhZ!^iXdch^hihd[dcZXdajbc!>9#I]Zad\\^c\iVWaZbjhiigVX`i]ZdaYVcY cZlkVajZhd[>9i]ZdaYkVajZ^hidYZiZgb^cZi]ZgdlidWZbdY^[^ZY#>[ViVWaZYdZh cdi]VkZVeg^bVgn`ZnYZ[^cZY!ndjl^aad[XdjghZcZZYidjhZVcdc"cjaajc^fjZ^cYZm# Gjci]Z[daadl^c\hiViZbZcidci]Zeg^bVgnYViVWVhZidXgZViZi]Zad\\^c\iVWaZ#HFA 6eeanl^aaXgZViZi]ZiVWaZVjidbVi^XVaandci]ZhiVcYWnYViVWVhZ#I]Zad\\^c\iVWaZ XdciV^chdcanWj^ai"^cYViVineZhhjeedgiZYWnHFA6eean#I]ZViig^WjiZhfirst_name! last_name[gdbi]ZNAME_TYPjhZg"YZ[^cZYineZVgZgZegZhZciZYVhhZeVgViZXdajbch log_first_name!log_last_name^ci]Zad\\^c\iVWaZjh^c\i]ZhVbZWj^ai"^cYViV ineZVhi]ZtypeViig^WjiZ#
.
LZcZZYidhZii]^h!h^cXZdbms_metadata.get_ddlgZijgchV8AD7!VcYWnYZ[VjaiHFAEajhh]dlhdcani]Z [^ghi-%X]VgVXiZghd[V8AD7Xdajbc# &% ;dggZVYVW^a^in!lZYdcdih]dli]ZXdbeaZiZdjieji]ZgZ# && LZ]VkZigjcXViZYi]Zdjieji]ZgZVhlZaa#
8]VeiZg)/ Ad\^XVaHiVcYWn
139
6aagZbV^c^c\Xdajbch[gdbi]ZWVhZiVWaZ^cdjgXVhZdeptVgZgZegZhZciZY^ci]Z ad\\^c\iVWaZlog_deptjh^c\i]ZhVbZYViVineZjhZY^ci]ZWVhZiVWaZ# SQL> CREATE TABLE TEST.LOG_EMPLOYEE ( ACTION VARCHAR2(1), LOG_ID_OLD NUMBER, LOG_ID_NEW NUMBER, LOG_FIRST_NAME VARCHAR2(32), LOG_LAST_NAME VARCHAR2(32), LOG_DEPT NUMBER); SQL> ALTER TABLE ADD CONSTRAINT TEST_LOG_EMP_PK PRIMARY KEY (LOG_ID_OLD);
2. 8gZViZi]ZWVhZiVWaZig^\\Zgi]Vil^aaWZ[^gZYdci]Zeg^bVgnYViVWVhZ[dgVcn9BA V\V^chii]ZWVhZiVWaZI:HI#:BEADN::^cdjgZmVbeaZ#I]Zig^\\Zgl^aa^chZgiVgdl^c i]Zad\\^c\iVWaZ[dgZVX]gdlbdY^[^ZYdci]ZWVhZiVWaZ# SQL> CREATE OR REPLACE TRIGGER TEST.EMPLOYEE_PRIMARY_TRIG AFTER DELETE OR INSERT OR UPDATE ON EMPLOYEE FOR EACH ROW DISABLE12 DECLARE L_THIS_ROW ROWID := NULL; BEGIN -- INSERT: 'I', LOG_ID_OLD AND LOG_ID_NEW BOTH GET THE SAME VALUE IF INSERTING THEN -- INSERT (ACTION = 'I'): INSERT INTO TEST.LOG_EMPLOYEE VALUES ('I' , :NEW.ID, :NEW.ID, :NEW.ID, :NEW.NAME.FIRST_NAME, :NEW.NAME.LAST_NAME, :NEW.DEPT) RETURNING ROWED INTO L_THIS_ROW; ELSIF UPDATING THEN -- UPDATE (ACTION = 'U'): LOG_ID_OLD AND LOG_ID_NEW ARE DIFFERENT INSERT INTO TEST.LOG_EMPLOYEE VALUES ('U' , :NEW.ID, :NEW.ID, :NEW.NAME.FIRST_NAME, :NEW.NAME.LAST_NAME, :NEW.DEPT) RETURNING ROWID INTO L_THIS_ROW; ELSIF DELETING THEN -- DELETE (ACTION = 'D'): AND WE ONLY NEED LOG_ID_OLD VALUE TO BE LOGGED INSERT INTO TEST.LOG_EMPLOYEE(ACTION, LOG_ID_OLD) VALUES ('D', :OLD.ID); END IF; -- DELETE THE ROW FROM THE LOGGING TABLE. -- THE STANDBY TRIGGER WILL NOT FIRE ON THE DELETE. DELETE FROM TEST.LOG_EMPLOYEE WHERE ROWED = L_THIS_ROW; END; /
&'
NdjcZZYidXgZViZi]^hVhY^hVWaZY^cdgYZgidhncX]gdc^oZi]ZXVeijg^c\d[i]ZX]Vc\Zhl^i]i]Z^chiVci^Vi^dcd[ i]ZjchjeedgiZYiVWaZhVii]Zad\^XVahiVcYWnYViVWVhZ#
140
DgVXaZ9ViVi^h[^gZYdci]Zad\^XVahiVcYWnYViVWVhZ[dgVcn9BA V\V^chii]Zad\\^c\iVWaZ:BEADN::TAD EXECUTE DBMS_DDL.SET_TRIGGER_FIRING_PROPERTY (SCHEMA_NAME => 'TEST', TRIGGER_NAME => 'EMPLOYEE_STANDBY_TRIG', FIRE_ONCE => FALSE);
5. LOCK TABLE TEST.EMPLOYEE IN SHARE MODE;
8]VeiZg)/ Ad\^XVaHiVcYWn
141
B. (SESSION#1) WE NEED TO SWITCH THE LOGFILE HERE, TO GET THE SCN TO BUMP UP SQL> ALTER SYSTEM SWITCH LOGFILE; C. (SESSION#1) WE CAN NOW QUERY V$DATABASE TO GET THE CURRENT SCN OF THE DATABASE SQL> SELECT CURRENT_SCN FROM V$DATABASE; CURRENT_SCN ---------------------------------52018672 D. (SESSION#2) ENABLE THE LOGGING TABLE TRIGGER SQL> ALTER TRIGGER TEST.EMPLOYEE_PRIM_TRIG ENABLE; E. (SESSION#1) ISSUE COMMIT TO RELEASE THE LOCK. SO THE WRITE OUTAGE ON THE TABLE IS MINIMAL. SQL> COMMIT; -- RELEASE THE LOCK F. (SESSION#1) USE THE SCN OBTAINED IN STEP C, TO EXPORT THE CONTENTS OF THE TABLE USING THE FLASHBACK_SCN CLAUSE OF DATAPUMP EXPORT SQL> EXPDP TEST/TEST TABLES=EMPLOYEE DIRECTORY=DPUMP_DIR1 DUMPFILE=EMP_SCN.DMP FLASHBACK_SCN = 52018672
6. >bedgii]ZYViV[dgI:HI#:BEADN::Vii]Zad\^XVahiVcYWnYViVWVhZ/ SQL> IMPDP TEST/TEST TABLES=EMPLOYEE DIRECTORY=DPUMP_DIR1 DUMPFILE=EMP_SCN.DMP
7. GZhiVgiHFA6eean SQL> ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
Customizing Your Logical Standby Database (or Creating a Local Dataset at the Logical Standby) Cdli]Vindj`cdl]dlidYZiZgb^cZl]ViYViVhZindjgad\^XVahiVcYWnYViVWVhZ^hbV^ciV^c^c\! ^i^hi^bZidZmeadgZi]ZXVeVW^a^i^Zhi]VibVYZndjlVciidYZeadnVad\^XVahiVcYWnYViVWVhZ^c i]Z[^ghieaVXZ/i]ZVW^a^inidXjhidb^oZ^iidd[[adVYegdXZhh^c\[gdbi]Zeg^bVgnYViVWVhZ#
Creating Materialized Views on the Logical Standby Database HFA6eeanYdZhcdigZea^XViZVcn99AhgZaViZYidi]ZbViZg^Va^oZYk^ZlhBKhdgBKad\h#&( =dlZkZg!ndjVgZ[gZZidXgZViZBKhVcYBKad\hdcbV^ciV^cZYiVWaZhVii]Zad\^XVahiVcYWn YViVWVhZ!VcYi]ZhZadXVaBKhl^aaWZgZ[gZh]ZY^cVlVni]VindjZmeZXi/Dc"Xdbb^igZ[gZh]l^aa WZig^\\ZgZYVhHFA6eeanegdXZhhZhXdbb^iVigVchVXi^dcl^i]bdY^[^XVi^dchidVWVhZiVWaZ0
&(
=dlZkZg!h^cXZVad\^XVahiVcYWn^hXgZViZY[gdbVe]nh^XVahiVcYWn!i]ZBKhVcYBKad\hi]VilZgZXgZViZYVi i]Zeg^bVgnYViVWVhZWZ[dgZndjXdckZgiZYndjge]nh^XVahiVcYWnYViVWVhZ^cidVad\^XVahiVcYWnl^aagZbV^c^ci]Z ad\^XVahiVcYWnYViVWVhZ#
142
DgVXaZ9ViV 'REFRESH_TT_MV_PRIM', JOB_TYPE => 'PLSQL_BLOCK', ENABLED => FALSE, AUTO_DROP => FALSE, START_DATE => SYSDATE, LIST => 'CUSTOMER.TRADE_TRACK_MV',REPEAT_INTERVAL => 'FREQ=HOURLY;INTERVAL=>12' , JOB_ACTION => 'BEGIN DBMS_MVIEW.REFRESH( LIST => 'CUSTOMER.TRADE_TRACK_MV', METHOD => 'F'); END; '); SQL> EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE(NAME => 'REFRESH_TT_MV_PRIM', ATTRIBUTE => 'ENABLED', VALUE => 'TRUE'); (B) AT MATRIX_DR0: SQL> EXECUTE DBMS_SCHEDULER.CREATE_JOB ((JOB_NAME => 'REFRESH_TT_MV_STDBY', JOB_TYPE => 'PLSQL_BLOCK', ENABLED => FALSE, AUTO_DROP => FALSE, START_DATE => SYSDATE, REPEAT_INTERVAL => 'FREQ=HOURLY;INTERVAL=>12', JOB_ACTION => 'BEGIN DBMS_MVIEW.REFRESH( LIST => 'CUSTOMER.TRADE_TRACK_MV', METHOD => 'F'); END; '); SQL> EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE(NAME => 'REFRESH_TT_MV_STDBY', ATTRIBUTE => 'DATABASE_ROLE', VALUE => 'PRIMARY'); SQL> EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE(NAME => 'REFRESH_TT_MV_STDBY', ATTRIBUTE => 'ENABLED', VALUE => 'TRUE');
8]VeiZg)/ Ad\^XVaHiVcYWn
143
CdiZi]ViVii]Zad\^XVahiVcYWnBVig^mT9G%!ndjcZZYZYVcVYY^i^dcVahiZed[X]Vc\^c\ i]Zdatabase_roleViig^WjiZ[dgi]Z_dWidPRIMARYVh^il^aaYZ[Vjaiidi]ZgdaZd[i]Z YViVWVhZ!l]^X]^hXjggZcianLOGICAL STANDBY# N
Case 2: NdjlVcihX]ZYjaZg_dWCHECK_SQL_APPLY_PROGRESSidgjcdci]ZYViVWVhZ i]Vi]VeeZchidWZi]Zad\^XVahiVcYWnYViVWVhZViVcn\^kZcbdbZci/ SQL> CREATE TABLE SYSTEM.SQL_APPLY_PROGRESS_GATHER AS SELECT SYSDATE, TIME_COMPUTED, NAME, VALUE FROM V$DATAGUARD_STATS; SQL > CREATE OR REPLACE PROCEDURE SYSTEM.SQL_APPLY_PROGRESS_GATHER AS BEGIN EXECUTE IMMEDIATE 'INSERT INTO SYSTEM.SQL_APPLY_PROGRESS_GATHER SELECT SYSDATE, TIME_COMPUTED, NAME, VALUE FROM V$DATAGUARD_STATS; COMMIT; END; /
6iWdi]BVig^mVcYBVig^mT9G%/ SQL> EXECUTE DBMS_SCHEDULER.CREATE_JOB (JOB_NAME => 'SQL_APPLY_STATS', JOB_TYPE => 'PLSQL_BLOCK', ENABLED => FALSE, AUTO_DROP => FALSE, START_DATE => SYSDATE, REPEAT_INTERVAL => 'FREQ=MINUTELY;INTERVAL=>15', JOB_ACTION => 'BEGIN SYSTEM.SQL_APPLY_PROGRESS_GATHER; END; '); SQL> EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE(NAME => 'SQL_APPLY_STATS', ATTRIBUTE => 'DATABASE_ROLE', VALUE => 'STANDBY'); SQL> EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE(NAME => 'SQL_APPLY_STATS', ATTRIBUTE => 'ENABLED', VALUE => 'TRUE');
CdiZ^ci]^hZmVbeaZi]VilZXdjaY]VkZXgZViZYi]Z_dWVhENABLEDl]ZclZXgZViZY^i ViBVig^mT9G%VcYh`^eeZYi]ZcZmiildhiZeh!h^cXZ^ildjaY]VkZ^c]Zg^iZYi]ZXdggZXi database_roleViig^WjiZi]ZgZ# N
Case 3:NdjlVcihX]ZYjaZg_dWUPDATE_BILLING_SUMMARYidgjcdcdcanBVig^mT9G% VcYdcanl]ZcBVig^mT9G%^hVad\^XVahiVcYWnYViVWVhZ/ AT MATRIX_DR0 SQL> EXECUTE DBMS_SCHEDULER.CREATE_JOB (JOB_NAME => 'UPDATE_BILLING_SUMMARY', JOB_TYPE => 'PLSQL_BLOCK', ENABLED => FALSE, AUTO_DROP => FALSE, START_DATE => SYSDATE, REPEAT_INTERVAL => 'FREQ=HOURLY;INTERVAL=>24', JOB_ACTION => 'BEGIN SYSTEM.UPD_BILLING_SUMMARY; END; ');
N
Case 4:NdjlVcihX]ZYjaZg_dWUPDATE_BILLING_SUMMARYidgjcdcandcBVig^mT 9G%!gZ\VgYaZhhd[i]ZgdaZd[i]ZYViVWVhZ/ AT MATRIX_DR0 SQL> EXECUTE DBMS_SCHEDULER.CREATE_JOB (JOB_NAME => 'UPDATE_BILLING_SUMMARY', JOB_TYPE => 'PLSQL_BLOCK', ENABLED => FALSE, AUTO_DROP => FALSE, START_DATE => SYSDATE, REPEAT_INTERVAL => 'FREQ=HOURLY;INTERVAL=>24', JOB_ACTION => 'BEGIN SYSTEM.UPD_BILLING_SUMMARY; END; ');
144
DgVXaZ9ViV EXECUTE DBMS_SCHEDULER.CREATE_JOB (JOB_NAME => 'UPDATE_BILLING_SUMMARY', JOB_TYPE => 'PLSQL_BLOCK', ENABLED => FALSE, AUTO_DROP => FALSE, START_DATE => SYSDATE, REPEAT_INTERVAL => 'FREQ=MINUTELY;INTERVAL=>15', JOB_ACTION => 'BEGIN SYSTEM.SQL_APPLY_PROGRESS_GATHER; END; '); SQL> EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE(NAME => 'UPDATE_BILLING_ SUMMARY', ATTRIBUTE => 'DATABASE_ROLE', VALUE => 'PRIMARY'); SQL> EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE(NAME => 'UPDATE_BILLING_ SUMMARY', ATTRIBUTE => 'ENABLED', VALUE => 'TRUE');
Offloading Log-based Replication (Streams Capture) to the Logical Standby NdjbVnWZ[Vb^a^Vgl^i]DgVXaZHigZVbhXVeijgZ!l]^X]^hDgVXaZ¼had\"WVhZYbjai^"bVhiZg gZea^XVi^dchdaji^dc#HigZVbhXVeijgZVcYVeean]VkZVadi^cXdbbdcl^i]9ViVci]^hXVhZ!^[ndjlZgZid[V^adkZgdghl^iX]dkZgidndjg e]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g#;dgi]ZHigZVbhXVeijgZid Xdci^cjZldg`^c\dci]Zad\^XVahiVcYWn!ndjl^aacZZYidlg^iZVgdaZigVch^i^dcig^\\Zga^`Zi]Z [daadl^c\/ CREATE OR REPLACE TRIGGER STREAMS_AQ_JOB_ROLE_CHANGE1 AFTER DB_ROLE_CHANGE ON DATABASE DECLARE CURSOR CAPTURE_AQ_JOBS IS SELECT JOB_NAME, DATABASE_ROLE FROM DBA_SCHEDULER_JOB_ROLES WHERE JOB_NAME LIKE 'AQ_JOB%';
&)
I]Ze]nh^XVahiVcYWnYViVWVhZ]Vhi]ZhVbZ97>9VcY\adWVaYViVWVhZcVbZVhi]Zeg^bVgnYViVWVhZ!hdi]Z HigZVbhXVeijgZl^aacdiZkZcgZVa^oZi]ViVhl^iX]dkZgdg[V^adkZg]Vh]VeeZcZYjcYZgcZVi]^i#>ildjaYadd`a^`Z hdbZdcZh^beanWdjcXZYi]ZYViVWVhZ^chiVcXZh#
8]VeiZg)/ Ad\^XVaHiVcYWn
145
U AQ_JOBS%ROWTYPE; MY_DB_ROLE VARCHAR2(16); BEGIN DBMS_SYSTEM.KSDWRT(DBMS_SYSTEM.ALERT_FILE, 'CHANGING ROLE OF AQ JOBS'); CURRENT_DB_ROLE := DBMS_LOGSTDBY.DB_ROLE(); OPEN AQ_JOBS; LOOP FETCH AQ_JOBS INTO U; EXIT WHEN AQ_JOBS%NOTFOUND; IF (U.DATABASE_ROLE = MY_DB_ROLE) THEN DBMS_SCHEDULER.SET_ATTRIBUTE(U.JOB_NAME, 'DATABASE_ROLE', MY_DB_ROLE); DBMS_SYSTEM.KSDWRT(DBMS_SYSTEM.ALERT_FILE, 'AQ JOB ' || U.JOB_NAME || ' CHANGED TO ROLE ' || MY_DB_ROLE); END IF; END LOOP; CLOSE AQ_JOBS; EXCEPTION WHEN OTHERS THEN BEGIN DBMS_SYSTEM.KSDWRT(DBMS_SYSTEM.ALERT_FILE, 'FAILED TO CHANGE ROLE OF AQ JOBS'); RAISE; END; END;
Understanding the Operational Aspects of a Logical Standby 7Z[dgZYZak^c\^cidi]ZdeZgVi^dcVaVheZXihd[HFA6eean!^i]Zaehid\ZiVc^YZVVWdji]dl^i^h ^beaZbZciZY#HdlZl^aaiV`ZVWg^Z[YZidjg^ch^YZi]Z^ciZgcVahd[HFA6eean#
Looking Inside SQL Apply HFA6eean^hi]ZaVnZgd[XdYZVcYVahdi]ZegdXZhh\gdjei]VibV^ciV^chi]ZDgVXaZad\^XVa hiVcYWnYViVWVhZ#I]gZZhd[ilVgZXdbedcZcihVgZgZhedch^WaZ[dgbV^ciV^c^c\Vad\^XVahiVcYWn YViVWVhZ/i]ZgZYdigVchedgihZgk^XZi]Vih]^ehi]ZgZYdhigZVbd[i]Zeg^bVgnYViVWVhZVcY eZg[dgbh\VegZhdaji^dc!i]Zb^c^c\hZgk^XZi]Vib^cZhi]ZgZYdVcYgZXdchigjXihi]ZZfj^kVaZci HFAhiViZbZcihVcYdg^\^cVaigVchVXi^dc\gdje^c\!VcYi]ZVeeanhZgk^XZi]VihX]ZYjaZhi]Zb^cZY igVchVXi^dch[dgXdcXjggZciVeea^XVi^dcVcYVXijVaanVeea^Zhi]Zb#6[djgi]hZgk^XZ^h]^YYZc^c eaV^ch^\]i¸i]ZXdgZYViVWVhZZc\^cZi]VieZg[dgbhi]ZbdY^[^XVi^dcVhY^gZXiZYWni]ZVeean hZgk^XZ#6ai]dj\]i]^hbVnWZdWk^djhidZkZgndcZ!lZbZci^dc^iid]^\]a^\]iVc^bedgiVci[VXi VWdjiVad\^XVahiVcYWnYViVWVhZ/^i^hVc^cYZeZcYZciYViVWVhZ!Vai]dj\]^ihZgkZhVhVhiVcYWnid i]Zeg^bVgnYViVWVhZ!VcYVhVgZhjaiVaaVheZXihd[WZhiegVXi^XZhgZaViZYidYViVWVhZijc^c\VcY bVcV\ZbZcii]Vindj\ZcZgVaanZbeadn^c`ZZe^c\ndjgYViVWVhZgjcc^c\l^i]dji^ciZggjei^dc hi^aaVeean^ci]ZXdciZmid[Vad\^XVahiVcYWnYViVWVhZ#
146
DgVXaZ9ViV$DhnhiZblZVgZV\\gZ\Vi^c\i]Z ]VgYlVgZjcYZgG97BH]ZgZ!i]ZVeeanZc\^cZl^aaWZXdbZhadl#>ci]ViXVhZ!Vai]dj\]ndj l^aacdi^XZi]ZhadlYdlc^cHFA6eean!i]ZjcYZgan^c\egdWaZb^hi]ZhnhiZbdg>$DadVY#Hd `ZZe^cb^cYVaai]gZZd[i]ZhZegdYjXZg"XdchjbZge^eZa^cZhVcYadd`ViVaad[i]Zbl]Zc ign^c\idijcZHFA6eean[dgndjgad\^XVahiVcYWnYViVWVhZ#GZbZbWZgi]Vi^i^h!V[iZgVaa!dcan Vcdi]ZgYViVWVhZ#
Understanding the Process Architecture of SQL Apply 6hlZhV^YZVga^Zg!HFA6eeanXdch^hihd[ildXdbedcZcih/i]Zb^c^c\Zc\^cZVcYi]ZVeean Zc\^cZ#L]Zcndj^hhjZi]Zalter database start logical standby applyhiViZbZci! i]Z[^ghiWVX`\gdjcYegdXZhhidhiVgi^hi]Zad\^XVahiVcYWnXddgY^cVidgegdXZhhAHE%#I]^h^hi]Z 8DDG9>C6IDGegdXZhh[dgHFA6eean#I]^h^cijgcheVlchildhZihd[egdXZhhZh/i]Zb^c^c\ egdXZhhZh^c&&gi]ZhZ]VkZi]ZegZ[^mora_ms!^bean^c\b^c^c\hZgkZghVcYi]ZVeeanegdXZhhZh ^c&&gi]ZhZ]VkZi]ZegZ[^mora_as!^bean^c\VeeanhZgkZgh# I]Zb^c^c\Zc\^cZXdbeg^hZhi]gZZineZhd[egdXZhhZh/ N
READER I]ZgZ^hdcandcZgZVYZgegdXZhh#>ih_dW^hidgZVYi]ZgZYdhigZVbZ^i]Zg [gdbi]ZVgX]^kZYad\hdg[gdbi]ZhiVcYWngZYdad\[^aZPHGAR#>iYdZhcdiYdVcn igVch[dgbVi^dcd[i]ZgZYdgZXdgYhZmXZeiidbV`ZVXden^c^ihh]VgZYWj[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9ZeZcY^c\dci]Zldg`adVYndjVgZgjcc^c\Vii]Z eg^bVgnYViVWVhZVcYi]ZgZYd\ZcZgVi^dcgViZ!ndjbVncdihZZi]ZZci^gZbZbdgnWZ^c\jhZYWn HFA6eean#7jidcVkZgnVXi^kZhnhiZbl^i]V]^\]gZYd\ZcZgVi^dcgViZ!i]Zb^c^c\Zc\^cZl^aa XdchjbZVaad[i]ZA8GXVX]ZVcY[^aa^il^i]igVchVXi^dchidWZVeea^ZYWni]ZVeeanZc\^cZ# JhjVaani]Zb^c^c\XdbedcZci^hbjX][VhiZgi]Vci]ZVeeanXdbedcZci]ZcXZi]ZgVi^dd['%/& WZilZZci]ZVeea^ZghVcYegZeVgZghVcYl^aa[^aai]ZZci^gZbZbdgnVaadXViZYidA8GXVX]ZWZ[dgZ i]ZVeea^Zgh]VkZVX]VcXZidhiVgiXdchjb^c\i]ZegZeVgZYigVchVXi^dch#I]Zb^c^c\Zc\^cZi]Zc WVX`hd[[VcY\dZhidhaZZejci^ai]ZVeea^ZghXdchjbZVcYgZaZVhZZcdj\]igVchVXi^dchhdi]Vi i]ZA8GXVX]Z^h*%eZgXZciZbein#6ii]^hed^ci!i]Zb^c^c\egdXZhhZhl^aalV`ZjeVcYadd`[dg VYY^i^dcVagZYdgZXdgYhidigVch[dgb^cidA8GhVcY\gdje^cidigVchVXi^dch#>[ndjlVciid[^cYdji ]dlbjX]d[i]ZMAX_SGA^hVXijVaan\Zii^c\jhZYWnHFA6eeanegdXZhhZh!ndjXVc^hhjZi]Z [daadl^c\fjZgn/ SQL> SELECT USED_MEMORY_SIZE FROM V$LOGMNR_SESSION WHERE SESSION_ID = (SELECT VALUE FROM V$LOGSTDBY_STATS WHERE NAME = 'SESSION ID'); USED_MEMORY_SIZE ---------------167600
L]nYdndjcZZYid^hhjZi]ZhjWfjZgnidgZhig^Xii]ZdjiejiidVh^c\aZsession_id4GZ[Zg WVX`idi]ZhZXi^dc!¹D[[adVY^c\Ad\"WVhZYGZea^XVi^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ZHFA6eean#I]ZVeeanZc\^cZ]VhidgZbZbWZgl]^X] igVchVXi^dch^i]VhhjXXZhh[jaanVeea^ZY!hdi]Vi^iYdZhcdiignidVeeani]ZbV\V^c#I]^h^hYdcZWn ^chZgi^c\Vgdl^YZci^[n^c\i]ZM>9&,i]VilVhVhh^\cZYVii]Zeg^bVgnYViVWVhZ^cidVbZiVYViV iVWaZsystem.logstdby$apply_progressVheVgid[i]ZigVchVXi^dci]VigZea^XViZhi]Z X]Vc\ZhYdcZVii]Zeg^bVgnYViVWVhZ#LZXVc]ZVgndjhXgZVb^c\VagZVYn!¹LV^iHFA6eean XVcgjc[dgZkZg#I]^hiVWaZl^aa\Zi]j\ZVcYZVijebnl]daZYViVWVhZºNZh!^ildjaY#7jiHFA 6eeaneZg^dY^XVaanejg\Zhi]ZiVWaZWnXgZVi^c\VcZleVgi^i^dcVcYYgdee^c\i]ZdaYdcZ!VcY^i gZbZbWZghVcH8CWZadll]^X]VaaigVchVXi^dch]VkZWZZchjXXZhh[jaanVeea^ZY#I]^hH8C h]dlc^cv$logstdby_progress.applied_scnVcYi]Zgdlh^csystem.logstdby$apply_ progress[dgbi]ZVeeanZc\^cZ¼hX]ZX`ed^ci^c[dgbVi^dc# I]Zb^c^c\Zc\^cZcZZYhid`ZZebdgZZaVWdgViZX]ZX`ed^ci^c[dgbVi^dc#>bV\^cZi]Z [daadl^c\hXZcVg^d/HdbZgd\jZVeea^XVi^dcdcZi]Vi[dg\diidad\ndjdjid[ndjghZhh^dcZkZc V[iZg^i]VhWZZcaZ[i^YaZ[dgVXdjeaZd[YVnhhiVgiZYVlg^iZigVchVXi^dcWVcYaZ[i^ideZc[dg XdjeaZd[YVnh#I]ZigVchVXi^dcbVYZV[ZlX]Vc\Zh!Wji^iY^YcdiXdbb^idggdaai]ZbWVX`# Cdl^i^hildYVnhaViZg!VcYndjhideHFA6eean#DWk^djhan!HFA6eeanXdjaYcdiXdbb^ii]Z X]Vc\ZhYdcZWnigVchVXi^dcW#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`ZcdbdgZi]VcVb^cjiZ idYdi]^h#=dlZkZg!^[ndjVgZldg`^c\dcVhnhiZbi]Vi^h\ZcZgVi^c\&%B7$hZX!ndjXVccdijhZ &%]djghVhndjgnVgYhi^X`idYZiZgb^cZV\Z!WZXVjhZndjbVn]VkZidgZVY(+%cndjg^ciZgVXi^dchl^i]DgVXaZiZX]hjeedgi!ndjbVnVahdZcXdjciZgi]ZiZgblogminer memory spill#I]^h^h i]ZhVbZVhad\b^cZgeV\^c\djibZbdgn[gdbi]ZA8Gidi]Zhe^aaiVWaZheVXZ^ci]ZYViVWVhZ# &, XIDgZ[Zghidi]ZigVchVXi^dc^YZci^[^Zgi]Vi^hVhh^\cZYWni]ZDgVXaZG97BHidZkZgnigVchVXi^dci]VibdY^[^Zh i]ZYViVWVhZ#
150
DgVXaZ9ViV[ndjcdi^XZi]Viv$logstdby_progress.restart_scn^h cdibdk^c\[dgVadc\i^bZ!ndj]VkZa^`ZanZcXdjciZgZYdcZdgbdgZaVg\ZigVchVXi^dch!VcYi]Z b^c^c\Zc\^cZ]VhhjheZcYZY^ihX]ZX`ed^ci^c\jci^ai]ZaVg\ZigVchVXi^dch]VkZVaaWZZc hjXXZhh[jaanXdbb^iiZY#
Understanding Transaction “Chunking” Inside SQL Apply DcZ^bedgiVcilVni]ViHFA6eeanY^[[Zgh[gdbbdhidi]Zgad\"WVhZYgZea^XVi^dchdaji^dch VkV^aVWaZ[dgDgVXaZ9ViVWVhZ^h^ihVW^a^inidVeeanaVg\ZigVchVXi^dchZkZcWZ[dgZi]ZigVchVXi^dc ]VhWZZcXdbb^iiZYVii]Zeg^bVgnYViVWVhZ#HFA6eeanjhZhVc^ciZgcVa]Zjg^hi^XidYZiZgb^cZ l]Zi]ZgVigVchVXi^dc^haVg\Zdgcdi#&-I]Zb^c^c\Zc\^cZYZa^kZghVhbVaaigVchVXi^dcVhVl]daZ jc^i!dcXZ^iZcXdjciZghi]ZXdbb^igZXdgY!idi]ZVeeanZc\^cZ#AV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gd[A8Gh#I]ZgZXVcWZbdgZ[dg^chiVcXZ! Yjg^c\VeVgi^i^dcadVYdeZgVi^dcdcViVWaZl^i]AD7XdajbchdgaZhh[dg^chiVcXZ!^cXVhZd[igVchVXi^dch ^ckdak^c\egdYjXiYViVbVg`jeaVc\jV\ZPE9BARdeZgVi^dch#Hdndjh]djaYcdibV`ZVcnVhhjbei^dcVWdjii]Z cjbWZgd[deZgVi^dchXdciV^cZYl^i]^cVigVchVXi^dcX]jc`#
8]VeiZg)/ Ad\^XVaHiVcYWn
151
igVchVXi^dchVcY^ihVhhdX^ViZYdei^b^hi^XhX]ZYja^c\Yd]VkZVhjWiaZ^beVXidcHFA6eean eZg[dgbVcXZ!VcYi]Vi^hi]Zide^Xd[djgcZmihjWhZXi^dc#
Understanding How DML Transactions Are Scheduled HFA6eeanVaadlh[dgildbdYZhd[igVchVXi^dcVeea^XVi^dc/dcZl]ZgZi]ZXdbb^idgYZg^c\Vi i]Zeg^bVgnYViVWVhZ^hbV^ciV^cZYhig^XianVii]Zad\^XVahiVcYWni]^h^hi]ZYZ[VjaihZii^c\d[ igVchVXi^dchX]ZYja^c\!VcYi]Zdi]Zgl]ZgZi]ZXdbb^idgYZg^c\^hcdihig^XianZc[dgXZYVhadc\ VhcdgdlYZeZcYZcXnZm^hihWZilZZcildigVchVXi^dch#Ndj\Zii]ZhZXdcY!aZhhhig^XihZii^c\VcY ediZci^VaandcZl^i]bdgZeZg[dgbVcXZ!ZheZX^Vaan^[ndjgldg`adVY^hDAIE"a^`Zl^i]hbVaa$ bZY^jb"h^oZYigVchVXi^dchXdbb^ii^c\Vi]^\]gViZ#NdjYdi]^hl^i]i]Z[daadl^c\hiViZbZci/ SQL> EXECUTE DBMS_LOGSTDBY.APPLY_SET (NAME => 'PRESERVE_COMMIT_ORDER', VALUE => FALSE);
CdiZi]VicdbViiZgl]^X]bdYZndjhZi!HFA6eeanl^aaegZhZgkZigVchVXi^dcWdjcYVg^Zh X]Vc\Zhi]ViXdbb^iiZYVidb^XVaanVii]Zeg^bVgnYViVWVhZXdbb^iVidb^XVaanVii]ZhiVcYWn YViVWVhZVcYl^aa]dcdggdlYZeZcYZcX^Zh^[ildigVchVXi^dchbdY^[ni]ZhVbZgdl!i]Znl^aa WZXdbb^iiZY^ci]ZhVbZdgYZgVii]Zad\^XVahiVcYWnVhi]ZnlZgZVii]Zeg^bVgnYViVWVhZ# NOTE Many third-party replication solutions do not offer the integrity of the transaction boundary. The performance numbers that they cite are often collected when they are violating the integrity of the transaction (by applying changes that happened together in the context of multiple transactions). ;dghdbZVeea^XVi^dch!i]^hbVnWZZcdj\]#7ji^[ndjVgZgjcc^c\i]ZhjeeanX]V^cd[V bV_dggZiV^aZg!ndjXVccdiV[[dgYidjeYViZi]ZXVg\dbVc^[Zhi^ci]gZZY^[[ZgZciigVchVXi^dchl]Zc ^ilVhYdcZ^cVh^c\aZigVchVXi^dcVii]Zeg^bVgn#Hdl]ViYdZhhig^XidgYZg^c\bZVc4Hig^Xi dgYZg^c\dgegZhZgk^c\Xdbb^idgYZgbZVchi]ViXdbb^ihVgZ^hhjZYVcYZmZXjiZY^ci]ZhVbZ dgYZgVh^ci]Zeg^bVgn#6kVa^YigVchVXi^dc]^hidgn=&^hh]dlc^cIVWaZ)" IVWaZ)"'h]dlhVedhh^WaZigVchVXi^dc]^hidgnVii]Zad\^XVahiVcYWn^[i]ZegdeZgin preserve_commit_order^hhZiidTRUE#CdiZi]ViVai]dj\]Vii]Zeg^bVgnYViVWVhZ!gdlhG( VcYG)d[iVWaZI'lZgZjeYViZYV[iZgigVchVXi^dcM]VhXdbb^iiZY!HFA6eean^h[gZZidVeean i]ZbWZ[dgZ^iXdbb^ihM!h^cXZMVcYNbdY^[nY^h_d^cihZihd[gdlh#HFA6eeanl^aa!]dlZkZg! YZaVni]ZXdbb^id[igVchVXi^dcNVcY^hhjZ^iV[iZgM]VhWZZchjXXZhh[jaanXdbb^iiZY!h^cXZlZ ]VkZY^gZXiZY^iidegZhZgkZi]ZXdbb^idgYZg^c\ZcXdjciZgZYVii]Zeg^bVgnYViVWVhZ# AZi¼hcdlhZZ]dli]^hl^aaY^[[Zg^[ereserve_commit_orderlVhhZiidFALSEhZZIVWaZ)"(# CdiZi]Vi^ci]^hXVhZ!HFA6eeanXVc\dV]ZVYVcYXdbb^iN!h^cXZigVchVXi^dchMVcYNVgZ igjan^cYZeZcYZci#'%=VYi]ZncdiWZZc^cYZeZcYZcidg!^cdi]ZgldgYh!i]ZgZ^hVgdli]ViWdi]M VcYNbdY^[^ZY!i]ZhX]ZYja^c\d[Xdbb^ihldjaYcZZYidWZ^YZci^XVagZ\VgYaZhhd[i]Z preserve_commit_orderhZii^c\#>cdi]ZgldgYh!^[igjZgdlYZeZcYZcXnZm^hihWZilZZcild igVchVXi^dch!i]ZhZii^c\d[i]Zpreserve_commit_ordereVgVbZiZgYdZhcdibViiZg0lZValVnh ]VkZid]dcdgXdbb^idgYZg^c\i]VilZhVlVii]Zeg^bVgnYViVWVhZ#
'%
>cdi]ZgldgYh!i]ZnYdcdibdY^[ndkZgaVee^c\hZihd[gdlh#
152
DgVXaZ9ViVchZgiGdlG&d[IVWaZI'
'%
>chZgiGdlG'd[IVWaZI'
(%
JeYViZGdlG'd[IVWaZI&
)%
8dbb^iM
*%
>chZgiGdlG(d[IVWaZI'
+%
>chZgiGdlG)d[IVWaZI'
,%
8dbb^iN
TABLE 4-1.
An Example Transaction History H1 at the Primary Database
Time (or SCN)
APPLIER#1
APPLIER#2
&%%
JeYViZGdlG&d[IVWaZI&
>chZgiGdlG&d[IVWaZI'
&&%
>chZgiGdlG'd[IVWaZI'
&'%
>chZgiGdlG(d[IVWaZI'
&(%
>chZgiGdlG)d[IVWaZI'
&)%
JeYViZGdlG'd[IVWaZI&
&*%
8dbb^iM
&+%
8dbb^iN
TABLE 4-2. An Example Transaction History (Associated with H1) at the Logical Standby with preserve_commit_order Set to TRUE
Time (or SCN)
APPLIER#1 (Applying X)
APPLIER#2 (Applying Y)
&%%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igViZ\nid]VcYaZaVg\ZigVchVXi^dch#>iVhhjbZhi]Vi^[ildigVchVXi^dch MVcYNVgZdc\d^c\Vii]ZhVbZi^bZ!DgVXaZgdl"adX`^c\higViZ\nbjhi]VkZegZkZciZYi]Zb [gdbVXfj^g^c\i]ZhVbZgdladX`!VcY]ZcXZi]ZnbjhiWZ^cYZeZcYZci#I]^h^hcdihig^XianigjZ! h^cXZDgVXaZYdZhVaadligVchVXi^dchidadX`gdlhl^i]¹hZaZXi[dgjeYViZºVcYi]ZcgZaZVhZi]Zb Wn^hhj^c\VgdaaWVX`idhVkZed^cihiViZbZci#HdYZeZcYZcXnXdbejiVi^dc^hjhZ[jadcanl]Zc ndjVgZign^c\idVeeanVX]Vc\Zi]VidXXjghV[iZgi]ZXdbb^id[Vcdi]ZgigVchVXi^dc#>ci]^hXVhZ! ndjcZZYi]ZYZeZcYZcXnidiZaandjl]Zi]ZgndjcZZYidlV^i[dgi]Zdi]ZgigVchVXi^dcid Xdbb^i[^ghiVh^c8VhZ'dgl]Zi]ZgndjXVc\dV]ZVYl^i]dji]Vk^c\idlV^i[dgi]Zdi]Zg igVchVXi^dcidXdbb^i8VhZ&#Hdl]ViYdndjYdl]Zcndj]VkZhjheZcYZYYZeZcYZcXn XdbejiVi^dc[dgV\^kZcigVchVXi^dc4NdjlV^i[dgi]ViigVchVXi^dcidXdbb^iWZ[dgZndjXVc hX]ZYjaZVcnA8Gi]VidXXjggZYV[iZgi]ZXdbb^id[i]ViigVchVXi^dc#I]^h^hZhhZci^VaanVcVeean WVgg^Zg!VcY^i^hgV^hZYVcni^bZVaVg\ZigVchVXi^dcXdbb^ih#
Understanding How DDL Statements Are Handled Inside SQL Apply Cdli]VilZ]VkZZmeadgZY]dlHFA6eeanhX]ZYjaZh9BAigVchVXi^dch!^i^hi^bZidadd`Vi 99AhX]ZYja^c\#IldVheZXihd[99AigVchVXi^dchVgZ^bedgiVciid`ZZe^cb^cY/99A hiViZbZcihVXiVhi]ZWVgg^ZghncX]gdc^oVi^dced^ci^ci]ZXdciZmid[HFA6eean!VcY99A hiViZbZcihVgZhX]ZYjaZYhZg^VaanWnHFA6eeanl^i]i]ZZmXZei^dcd[Create Table As SelecthiViZbZcih!l]^X]bVnWZhX]ZYjaZYXdcXjggZcian#
Myth Buster: Third-party Replication Products Provide Better Latency, Because the Mining Is Usually Done at the Primary Site I]^hbni]]Vhi]ZediZci^Va[dgWZ^c\igjZdcan[dghbVaaigVchVXi^dch#GZbZbWZgi]Vii]Z aViZcXnd[^ciZgZhi^hcdi_jhi^c]dlfj^X`ani]ZYViV^hXVeijgZY!Wjil]Zc^i^hVeea^ZY#>c VabdhiVaaXVhZh!i]^gY"eVgingZea^XVi^dcegdYjXihYdcdi]VkZi]ZZV\ZgigVchVXi^dc hX]ZYja^c\[ZVijgZi]Vi¼hVkV^aVWaZ^cHFA6eean#I]jhi]ZgZhedchZi^bZ[dgVaVg\Z igVchVXi^dc^ckdak^c\b^aa^dchd[gdlhl^aaWZfj^iZ]^\]#6hhjb^c\i]ViVigVchVXi^dcl^aa iV`ZZfjVai^bZidVeeanWdi]Vii]Zeg^bVgnVcYi]ZhiVcYWnV\ddYVhhjbei^dc[dgYViV adVYh!^[ndjhiVgiVYViVadVYi]ViiV`Zh']djghidXdbeaZiZ!bdhii]^gY"eVgingZea^XVi^dc hdaji^dchl^aacdihiVgiVeean^c\i]ZigVchVXi^dcjci^ai]Zn]VkZhZZci]ZXdbb^id[i]ZaVg\Z igVchVXi^dc#Hd^[i]ZadVYXdbeaZiZhVi&'E#B#Vii]Zeg^bVgn!i]ViYViVl^aaWZVkV^aVWaZVi 'E#B#VindjghiVcYWn¸cdiV\ddYeaVXZidWZ^ciZgbhd[YViVadhh#HFA6eeanl^aahiVgi Veean^c\i]ZigVchVXi^dcVhhddcVh^i^hYZZbZYidWZaVg\ZVcYl^aa]VkZi]ZYViVVkV^aVWaZ Vii]ZhiVcYWnbjX][VhiZg#
154
DgVXaZ9ViV SELECT STATUS_CODE AS SC, STATUS FROM V$LOGSTDBY_PROCESS WHERE TYPE = 'BUILDER' ; SC STATUS ----- --------------------------------------------------------------44604 BARRIER SYNCHRONIZATION ON DDL WITH XID 1.15.256 (WAITING ON 17 TRANSACTIONS)
I]^hiZaahndji]Vii]Zb^c^c\Zc\^cZ^hlV^i^c\idVeeanigVchVXi^dc&*#'*+VcYi]Vi &,igVchVXi^dchcZZYidWZVeea^ZY[dgi]ZWVgg^ZgXdcY^i^dcidWZhVi^h[^ZY#I]ZVeeanZc\^cZVahd ZciZghVWVgg^ZghncX]gdc^oVi^dced^cil]Zc^igZXZ^kZhi]Z99AigVchVXi^dc#I]^hbZVchVai]dj\] i]Zb^c^c\Zc\^cZ¼hWVgg^Zg^ha^[iZYVcYi]Z6C6ANO:GegdXZhhXVchiVgigZXZ^k^c\igVchVXi^dchi]Vi Xdbb^iiZYV[iZgi]Z99A!i]Z8DDG9>C6IDGegdXZhhl^aacdiVhh^\cVcnigVchVXi^dcjci^ai]Z 99AigVchVXi^dcZmXZei[dgCreate Table As SelecthiViZbZcihVi]VcY]VhWZZcVeea^ZY hjXXZhh[jaan#L]ViYdZhi]^hbZVc4>ibZVchi]Vil]ZcV99AigVchVXi^dc^h\Zii^c\Veea^ZY!Vaa 9BAigVchVXi^dchi]ViXdbb^iiZYWZ[dgZi]Z99A]VkZWZZchjXXZhh[jaanVeea^ZYVcYcdigVchVXi^dc X]jc`i]ViXdbb^iiZYV[iZgi]Z99AigVchVXi^dcdg]VcYZYidi]Z6C6ANO:GV[iZgi]Z99A igVchVXi^dc!h^cXZi]ZgZXVcWZildigVchVXi^dchi]ViXdbb^iVii]ZhVbZH8C^h^cegdXZhhd[ WZ^c\Veea^ZYWnVc6EEA>:GegdXZhh# ;gdbi]^hYZhXg^ei^dc!^i[daadlhi]ViHFA6eeanhX]ZYjaZh99AhiViZbZcihdi]Zgi]Vc Create Table As SelecthiViZbZcihhZg^Vaan#I]^h^hYdcZidbV^ciV^chV[Zin!Wji^iYdZh]VkZ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iZi]Z99AhiViZbZcih^ihZa[# 1. ;^ghibV`ZhjgZi]ViHFA6eeanYdZhcdiZmZXjiZINDEX REBUILDhiViZbZcih^ihZa[# HjeedhZndj]VkZ^YZci^[^ZYildaVg\Z^cYZmZh!IG69:T=>HIDGNT>9MVcYE6NB:CIT =>HIDGNT>9M!Wdi]^ci]Z8JHIDB:GhX]ZbV!i]ViVgZXVcY^YViZh[dgc^\]iangZWj^aYh# NdjXVcY^gZXiHFA6eeancdiidVeeanALTER INDEXhiViZbZcih[dgi]ZhZild^cYZmZh l^i]i]Z[daadl^c\hiViZbZcih/ SQL> A1TER DATABASE STOP LOGICAL STANDBY APPLY; SQL> EXECUTE DTMS_LOGSTDBY.SKIP(STMT => 'ALTER INDEX', SCHEMA_NAME => 'CUSTOMER', OBJECT_NAME => 'TRADE_HISTORY_IDX'); SQL> EXECUTE DTMS_LOGSTDBY.SKIP(STMT => 'ALTER INDEX', SCHEMA_NAME => 'CUSTOMER', OBJECT_NAME => 'PAYMENT_HISTORY_IDX');
2. CZmindjcZZYidbV`ZhjgZi]ViHFA6eeanhidehWZ[dgZ^iZcXdjciZghhjX]Vc^cYZm gZWj^aYdeZgVi^dc#NdjXVcYZh^\c^iWnValVnheZg[dgb^c\VhZci^cZa99AVii]Zeg^bVgn YViVWVhZWZ[dgZndjgZWj^aYi]Z^cYZmZh!VcYgZ\^hiZg^c\Vh`^e]VcYaZgVii]Zad\^XVa hiVcYWnhdi]ViHFA6eeanl^aahidel]Zc^ihZZhi]ZhZci^cZa99A#Id`ZZei]ZY^hXjhh^dc h^beaZ!VhhjbZi]Vii]ZhZci^cZa99A^hVIGJC86I:deZgVi^dc!hdi]VindjXVc^hhjZ^i dkZgVcYdkZgV\V^c# 8gZViZi]ZhZci^cZaiVWaZ[^ghi/ SQL> CREATE TABLE TEST.STOP_SQL_APPLY(A NUMBER);
6ii]Zad\^XVahiVcYWn!ndjcZZYidYdildi]^c\h/hideHFA6eeanl]ZcndjhZZi]Z IGJC86I:deZgVi^dcdci]ZiZhi#hideThfaTVeeaniVWaZ!VcYdcXZi]Z^cYZmgZWj^aYh]VkZ WZZcYdcZhjXXZhh[jaanVcYHFA6eean]VhWZZcgZhiVgiZY!ndjcZZYidbV`ZhjgZndjYd cdihideV\V^cdcZcXdjciZg^c\i]ZIGJC86I:iVWaZ#HdndjcZZYidlg^iZild egdXZYjgZhVii]Zad\^XVahiVcYWn/dcZcZZYhidWZ^ckd`ZYWZ[dgZndjhiVgii]Z^cYZm gZWj^aYdeZgVi^dchVii]Zeg^bVgn!VcYi]Zdi]ZgV[iZgi]Z^cYZmgZWj^aYhVgZYdcZVii]Z ad\^XVahiVcYWn/ SQL> CREATE TABLE TEST.SQL_APPLY_MESG(CHECK_MSG VARCHAR2, MSG_TIME DATE); SQL> CREATE OR REPLACE PROCEDURE SYS.STANDBY_START_REBUILD AS BEGIN INSERT INTO TEST.SQL_APPLY_MESG VALUES ('STOP', SYSDATE); COMMIT; END; / SQL> CREATE OR REPLACE PROCEDURE SYS.STANDBY_END_REBUILD AS BEGIN DELETE FROM TEST.SQL_APPLY_MESG; COMMIT; END; /
156
DgVXaZ9ViV CREATE OR REPLACE PROCEDURE SYS.PRIMARY_START_REBUILD AS BEGIN EXECUTE IMMEDIATE 'TRUNCATE TABLE TEST.STOP_SQL_APPLY'; END; /
3. CdlndjXVclg^iZi]Zh`^e]VcYaZgVii]Zad\^XVahiVcYWni]Vil^aahidedcandc ZcXdjciZg^c\i]ZIGJC86I:deZgVi^dcdci]ZiZhi#hZci^cZaTiVWaZdcan^[i]ZgZ^hVgdl ^ci]ZiZhi#hfaTVeeanTbZh\iVWaZ/ SQL> CREATE OR REPLACE PROCEDURE SYS.STOP_SQL_APPLY_ON_DDL (OLD_STMT IN VARCHAR2, STMT_TYP IN VARCHAR2, SCHEMA IN VARCHAR2, NAME IN VARCHAR2, XIDUSN IN NUMBER, XIDSLT IN NUMBER, XIDSQN IN NUMBER, ACTION OUT NUMBER, NEW_STMT OUT VARCHAR2) AS CHECK_MSG NUMBER := 0; BEGIN SELECT COUNT(MESSAGE_BODY) INTO CHECK_MSG FROM TEST. SQL_APPLY_MESG; -- WE ARE SIMPLY CHECKING WHETHER A ROW EXISTS OR NOT IN THE TABLE IF (CHECK_MSG = 1) THEN ACTION := DBMS_LOGSTDBY.SKIP_ACTION_ERROR; NEW_STMT := NULL; ELSE ACTION := DBMS_LOGSTDBY.SKIP_ACTION_APPLY; NEW_STMT := OLD_STMT; END IF; END; /
4. NdjcdlcZZYidgZ\^hiZgi]Zh`^e]VcYaZgidVheZX^[^X99AdeZgVi^dc/ SQL> EXECUTE DBMS_LOGSTDBY.SKIP( STMT => 'TRUNCATE TABLE', SCHEMA_NAME => 'TEST', OBJECT_NAME => 'STOP_SQL_APPLY');
Cdli]Vindj]VkZVaai]ZWj^aY^c\WadX`h!ndjXVcYZhXg^WZi]ZegdXZYjgZ[dg^cYZmgZWj^aYh/ STEP 1: AT THE LOGICAL STANDBY: MAKE SURE THAT SQL APPLY WILL STOP AT THE APPROPRIATE TIME. SQL> EXECUTE SYS.STANDBY_START_REBUILD; STEP 2: AT THE PRIMARY DATABASE: MAKE SURE THAT SQL APPLY STOPS BEFORE IT ENCOUNTERS THE INDEX REBUILD OPERATIONS SQL> EXECUTE SYS.PRIMARY_START_REBUILD;
8]VeiZg)/ Ad\^XVaHiVcYWn
157
6ii]Zeg^bVgnYViVWVhZ!ndjXVchiVgindjg^cYZmgZWj^aYh^ceVgVaaZa#Ndjl^aa]VkZid lV^i[dgHFA6eeanidhideWZ[dgZndjXVchiVgii]ZgZWj^aYdeZgVi^dch#NdjYdcdicZZYid iV`ZVcnbdgZVXi^dchVii]Zeg^bVgngZaViZYidi]Z^cYZmgZWj^aYh#6ii]Zad\^XVahiVcYWn i]dj\]!dcXZi]ZgZWj^aYh]VkZWZZc[^c^h]ZY!ndjl^aacZZYidbV`ZhjgZi]VidcgZhiVgi! HFA6eeanYdZhcdihidedcZcXdjciZg^c\i]ZIGJC86I:deZgV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L> EXECUTE DBMS_LOGSTDBY.APPLY_SET23 ('MAX_SERVERS',
64);
N HZiMAX_SGAid'%%B7/ SQL> EXECUTE DBMS_LOGSTDBY.APPLY_SET('MAX_SGA',
200);
N HZi_HASH_TABLE_SIZEid&%%%%%%%')&%b^aa^dc/ SQL> EXECUTE DBMS_LOGSTDBY.APPLY_SET('_HASH_TABLE_SIZE', 10000000);
N 9Z[Zg99Ahidd[["eZV`]djgh# N HZiPRESERVE_COMMIT_ORDERidFALSE# CdiZi]Vi[dgbVcnVeea^XVi^dch!i]ZYZ[Vjaihig^XidgYZg^c\^bedhZYWnHFA6eean^hcdi cZXZhhVgn!VcYndjXVcgZaVmi]^hl^i]djiV[[ZXi^c\i]ZXdggZXicZhhd[ndjgVeea^XVi^dchi]ViVgZ d[[adVYZYidi]Zad\^XVahiVcYWn# SQL> EXECUTE DBMS_LOGSTDBY.APPLY_SET('PRESERVE_COMMIT_ORDER', FALSE);
Determining Whether SQL Apply Is Lagging I]^h^hfj^iZh^beaZ#6h^beaZhZaZXi[gdbi]ZV$DATAGUARD_STATSk^Zll^aaegdk^YZndjl^i] i]ZVeeanhiVi^hi^Xh/ SQL> SELECT NAME, VALUE, UNIT FROM NAME VALUE -------------------- -----------APPLY FINISH TIME +00 00:00:03 APPLY LAG +00 00:00:05 TRANSPORT LAG +00 00:00:00
''
V$DATAGUARD_STATS; UNIT -----------------------------DAY(2) TO SECOND(1) INTERVAL DAY(2) TO SECOND(0) INTERVAL DAY(2) TO SECOND(0) INTERVAL
NdjcZZYidgZeZVii]Z6H=VcY6LGVcVanh^h#6ai]dj\]i]ZG97BHijc^c\lVhcdicZZYZY^c^i^Vaan!dcXZndj VaadXViZbdgZbZbdgnVcYegdXZhhZhidHFA6eean!^ibVni]Zc]^\]a^\]ii]ZcZZYidijcZi]ZG97BHdgi]Z>$D hjWhnhiZb#LZ]VkZZcXdjciZgZYVcjbWZgd[hjX]^chiVcXZh^ci]Z[^ZaY# '( 6hhjb^c\ndj]VkZV[djg"8EJWdml^i]YjVaXdgZegdXZhhdgh# ') HASH_TABLE_SIZEYZiZgb^cZhi]Zh^oZd[Vc^ciZgcVahigjXijgZjhZYidigVX`YZeZcYZcX^ZhWZilZZcY^[[ZgZci igVchVXi^dch#
8]VeiZg)/ Ad\^XVaHiVcYWn
159
I]ZkVajZhd[^ciZgZhiVgZapply lagVcYtransport lag#I]ZVeeanaV\kVajZ^cY^XViZh]dl XjggZcii]ZgZea^XViZYYViVVii]Zad\^XVahiVcYWn^h!VcYi]ZigVchedgiaV\kVajZ^cY^XViZh]dl bjX]d[i]ZgZYdYViVi]Vi]VhVagZVYnWZZc\ZcZgViZY^hb^hh^c\Vii]Zad\^XVahiVcYWn^ciZgbh d[gZYdgZXdgYh#Hd^[VeeanaV\^haVg\Zgi]VcndjgZmeZXiZYkVajZ!ndj]VkZVc^hhjZVcYndj cZZYidYg^aaYdlc#I]Zk^ZlVahdVchlZghi]ZgZYdigVchedgifjZhi^dcd[i]ZcZmihiZe# NOTE If the PVeeanaV\3ZmeZXiZYaV\Vii]Zad\^XVahiVcYWnR but PVeean aV\·igVchedgiaV\1ZmeZXiZYaV\Vii]Zad\^XVahiVcYWnR! then it is the redo transport that is keeping SQL Apply behind, and you need to look at your network.'*
Determining Whether SQL Apply Is the Bottleneck LZ]VkZVagZVYnh]dlcndj]dlidZa^b^cViZi]ZgZYdigVchedgiVhi]ZWdiiaZcZX`#I]ZcZmi i]^c\idYdl^aaWZidadd`Vindjg6LGVcY6H=gZedgi#I]^hl^aaZcVWaZndjid^YZci^[ndi]Zg WdiiaZcZX`h^ci]ZhnhiZb#;dg^chiVcXZ!ndjbVnWZVWaZid^YZci^[nVfjZgni]Vi^hYd^c\V[jaa iVWaZhXVcVcYXdbeZi^c\l^i]HFA6eean^ciZgbhd[8EJVcY>$DgZhdjgXZh!dgndjbVn[^cY i]ViVcjeYViZhiViZbZci^hhjZY[gdbHFA6eean^hjh^c\VWVYeaVcVcYcdie^X`^c\jeVc^cYZm i]Vi^ih]djaY]VkZ!VcYhddc#
Determining Which SQL Apply Component Is the Bottleneck DcXZndj]VkZZhiVWa^h]ZYi]ViHFA6eean^h^cYZZYi]ZWdiiaZcZX`!ndjcZZYid[^cYdjil]^X] eVgid[HFA6eeanid[dXjhdc#I]Z[^ghifjZgnidbV`ZhjX]VYZiZgb^cVi^dc^hidadd`Vii]Z egdYjXZg"XdchjbZge^eZa^cZ#>hi]Ze^eZa^cZ[jaa4 SQL> SELECT NAME, VALUE 'TRANSACTIONS%'; NAME -------------------TRANSACTIONS APPLIED TRANSACTIONS MINED
FROM V$LOGSTDBY_STATS WHERE NAME LIKE VALUE ------3764 4985
I]ZYZei]d[i]Ze^eZa^cZViVcn\^kZci^bZ^h(transactions mined – transactions applied)#Ndj l^aa]VkZidgjci]^hfjZgnVgdjcY&%dgbdgZi^bZhVi&"b^cjiZ^ciZgkVah#>[i]Zh^oZd[i]Ze^eZa^cZ ^hValVnhVgdjcYildi^bZhi]ZcjbWZgd[Veea^ZghdgbdgZ!i]Zb^c^c\Zc\^cZ^hYd^c\^ih_dW_jhi [^cZ!VcY^i^hi]ZVeeanXdbedcZcii]Vi^hWZ]^cY#>[!dci]Zdi]Zg]VcY!i]Zh^oZd[i]Ze^eZa^cZ^h YZXgZVh^c\dghiVn^c\ViVadlkVajZ!ndj]VkZidadd`Vii]Zb^c^c\Zc\^cZbdgZXadhZan#
Tuning the Mining Engine NdjXVcijcZi]Zb^c^c\Zc\^cZ^cildlVnh/^cXgZVhZi]ZcjbWZgd[egZeVgZgh'+dg^cXgZVhZi]Z h^oZd[i]ZA8GXVX]Z#
'*
HFA6eeanXVccdiVeeanhdbZi]^c\i]Vi]VhcdiWZZcgZXZ^kZYVii]ZhiVcYWn#GZ[Zgid8]VeiZg'# I]ZgZXVcWZdcandcZgZVYZgegdXZhhVcYdcZWj^aYZgegdXZhh#
'+
160
DgVXaZ9ViV:GegdXZhhZhVkV^aVWaZ# N HdbZ6EEA>:GegdXZhhZhVgZ^YaZ# HdaZi¼hhZZ]dllZl^aaZchjgZi]ViVaai]ZhZXdcY^i^dchVgZbZi#GZbZbWZgi]ViVaafjZg^Zh cZZYidWZ^hhjZYbjai^eaZi^bZhidZchjgZi]Vii]ZYViV^hXdch^hiZciVcYgZa^VWaZ# 1. BV`ZhjgZVaaEG:E6G:GHVgZWjhnYd^c\ldg`#', SQL> SELECT COUNT(1) AS IDLE_PREPARERS FROM V$LOGSTDBY_PROCESS WHERE TYPE = 'PREPARER' AND STATUS_CODE = 1616628; IDLE_PREPARER ------------0
2. BV`ZhjgZi]Vii]ZeZV`h^oZ^hlZaaWZadli]ZVbdjciVaadXViZY/ SQL> SELECT USED_MEMORY_SIZE FROM V$LOGMNR_SESSION WHERE SESSION_ID = (SELECT VALUE FROM V$LOGSTDBY_STATS WHERE NAME = 'LOGMINER SESSION ID'); USED_MEMORY_SIZE ---------------32522244
3. KZg^[ni]Vii]ZEG:E6G:GYdZhcdi]VkZZcdj\]gZVYnldg`[dgi]Z6EEA>:GegdXZhhZh/ SQL> SELECT (AVAILABLE_TXN PINNED_TXN) AS PIPELINE_DEPTH FROM V$LOGMNR_SESSION WHERE SESSION_ID = (SELECT VALUE FROM V$LOGSTDBY_STATS WHERE NAME = 'LOGMINER SESSION ID'); PIPELINE_DEPTH --------------8 SQL> SELECT COUNT(*) AS APPLIER_COUNT FROM V$LOGSTDBY_PROCESS WHERE TYPE = 'APPLIER'; APPLIER_COUNT ------------20
',
CdiZ^i^hY^[[^Xjaiid[^cYVEG:E6G:Gi]Vi^hcdi^cVc^YaZhiViZ!WZXVjhZ^cbdhiXVhZhi]ZnVgZlVnV]ZVYd[i]Z 6EEA>:GegdXZhhZh#Hdndjl^aacZZYidgjci]^hfjZgn^cVi^\]iaddeid\ZiVkVa^YgZhjai# '- DG6"&+&++/HFA6eeanegdXZhh^h^YaZ#
8]VeiZg)/ Ad\^XVaHiVcYWn
161
6ii]^hed^ci!Vaai]gZZXdcY^i^dch[dg^cXgZVh^c\i]ZcjbWZgd[EG:E6G:GH]VkZWZZcbZi# Cdl]dlYdndj^cXgZVhZi]ZcjbWZgd[egZeVgZgh47Z[dgZndjYdi]Vi!lZcZZYidadd`Vi]dl HFA6eeanVaadXViZhegdXZhhZh^c^ihY^hedhVa#HFA6eeanZmedhZhi]gZZeVgVbZiZghidXdcigdai]Z cjbWZgd[egdXZhhZh/MAX_SERVERS!PREPARE_SERVERS!VcYAPPLY_SERVERS#I]Z[daadl^c\ XdcY^i^dc]daYh/ MAX_SERVERS29 = PREPARE_SERVERS + APPLY_SERVERS + 3
JhjVaanndjh^beanheZX^[nMAX_SERVERSVcYaZiHFA6eeanY^k^YZi]ZVkV^aVWaZegdXZhhZh Vbdc\i]ZVeeanXdbedcZciVcYi]Zb^c^c\XdbedcZci#7nYZ[Vjai!HFA6eeanjhZhVegdXZhh VaadXVi^dcVa\dg^i]bi]ViVaadXViZhdcZPREPARE_SERVER[dgZkZgn'%hZgkZgegdXZhhZhVaadXViZY idHFA6eeanVhheZX^[^ZYWnMAX_SERVERS#>iVahda^b^ihi]ZcjbWZgd[PREPARE_SERVERSid*# I]jh!^[ndjhZiMAX_SERVERSidVcnkVajZWZilZZc&VcY'%!HFA6eeanVaadXViZhdcZhZgkZg egdXZhhidVXiVhVEG:E6G:G!VcYVaadXViZhi]ZgZhid[i]ZegdXZhhZhVh6EEA>:GHl]^aZhVi^h[n^c\ i]ZgZaVi^dch]^eegZk^djhanYZhXg^WZY#H^b^aVgan!^[ndjhZiMAX_SERVERSidVkVajZWZilZZc'&VcY )%!HFA6eeanVaadXViZhildhZgkZgegdXZhhZhidVXiVhEG:E6G:GHVcYi]ZgZhiVh6EEA>:GH#HFA 6eeanVaadlhndjiddkZgg^YZi]^hegdXZhhVaadXVi^dc[dgbjaVWnhZii^c\APPLY_SERVERSVcY PREPARE_SERVERSY^gZXian!egdk^YZYi]Vii]ZgZaVi^dch]^eVbdc\i]Zi]gZZeVgVbZiZghhiVnhigjZ# Hd!^cdjgXVhZ!lZldj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ii]VilZl^aaValVnh]VkZdcZG:69:G!dcZ7J>A9:G!VcYdcZ6C6ANO:G egdXZhh#I]Z8DDG9>C6IDGdgi]ZAHE%egdXZhh^hcdiXdjciZYl^i]^ci]ZhXdeZd[MAX_SERVERS# (% L^i]djiVcZmea^X^ihZii^c\!HFA6eeanl^aaVaadXViZi]ZZmigVegdXZhhidi]ZVeeanZc\^cZ#
162
DgVXaZ9ViV9A:egZeVgZgh#NdjXVcYZiZgb^cZl]Zi]Zgi]Z 7J>A9:GegdXZhh^h^YaZ^cVh^b^aVg[Vh]^dc#I]^hfjZgncZZYhidWZgjcZkZgn[ZlhZXdcYhVh lZaa# CdllZ¼aah]dlndj]dlidXdbejiZi]ZcdgbVa^oZYeV\ZdjiVXi^k^in#IdYdi]^h!ndjl^aa ]VkZiddWiV^cViaZVhiildhcVeh]dihd[eV\ZdjiVXi^k^indkZgVc^ciZgkVad[*id&%b^cjiZh# STEP 1. ISSUE THE FIRST QUERY. SQL> SELECT NAME, VALUE FROM V$LOGSTDBY_STATS WHERE NAME LIKE '%PAGE%' OR NAME LIKE '%UPTIME%' OR NAME LIKE '%IDLE%'; NAME ---------------------------COORDINATOR UPTIME (SECONDS) BYTES PAGED OUT SECONDS SPENT IN PAGEOUT SYSTEM IDLE TIME IN SECS
VALUE ------------1200856 30000 78 3210
STEP 2. ISSUE THE QUERY AGAIN SAY IN 10 MINUTES. SQL> SELECT NAME, VALUE FROM V$LOGSDTBY_STATS WHERE NAME LIKE '%PAGE%' OR NAME LIKE '%UPTIME%' OR NAME LIKE '%IDLE%'; NAME VALUE -------------------------- --------------COORDINATOR UPTIME(SECONDS) 1201456 BYTES PAGED OUT 1020000 SECONDS SPENT IN PAGEOUT 205 SYSTEM IDLE TIME IN SECS 3210 STEP 3. COMPUTE THE NORMALIZED PAGEOUT ACTIVITY. FOR EXAMPLE: CHANGE IN COORDINATOR UPTIME (U)= (1201456 1200856) = 600 SECS AMOUNT OF ADDITIONAL IDLE TIME (I)= (3210 3210) = 0 CHANGE IN TIME SPENT IN PAGEOUT (P) = (205 78) = 127 SECS PAGEOUT TIME IN COMPARISON TO UPTIME = P/(U-I) = 127/600 20%
Ndjh]djaYlg^iZVEA$HFAegdXZYjgZi]ViiV`ZhVc^ciZgkVaVcYegdk^YZhi]ZcdgbVa^oZY eV\ZdjicjbWZg#>YZVaan!i^bZheZci^ceV\Zdjih]djaYWZaZhhi]Vc*eZgXZcid[i]Zjei^bZ#Cdl ^i^hjhjVaanVXXZeiVWaZ[dgcdgbVa^oZYeV\ZdjiidWZ]^\]Zgi]Vci]ZZmeZXiZYi]gZh]daY ^c[gZfjZcian!Wji^[ndjXdci^cjZidiV`ZhcVeh]dihVcYXdbejiZi]^hkVajZ!VcYndj[^cYi]Vii]Z cdgbVa^oZYeV\Zdji`ZZehk^daVi^c\i]ZVXXZeiVWaZi]gZh]daY!ndjl^aacZZYid^cXgZVhZi]ZA8G XVX]Zh^oZ#DcXZndj]VkZYZiZgb^cZYi]Vindjl^aacZZYidX]Vc\Zi]ZMAX_SGA!i]ZhiViZbZci ^hkZgnh^beaZ/ SQL> EXECUTE DBMS_LOGSTDBY.APPLY_SET( NAME => 'MAX_SGA', VALUE => 1024);
8]VeiZg)/ Ad\^XVaHiVcYWn
163
Tuning the Apply Engine 6ii]^hed^ci!ndj]VkZYZiZgb^cZYi]Vii]ZVeeanXdbedcZci^hi]ZWdiiaZcZX`#
Increasing the Number of APPLIER Processes
I]Z[daadl^c\XdcY^i^dchbjhiWZbZi/
N I]Ze^eZa^cZWZilZZci]Zb^c^c\VcYVeeanXdbedcZci!^cdi]ZgldgYhi]ZA8GXVX]Z! ]VhZcdj\]gZVYnldg`VkV^aVWaZ# N I]ZgZ^hcd^YaZ6EEA>:GegdXZhhdgi]ZgZVgZjcVhh^\cZYaVg\ZigVchVXi^dch# LZ]VkZVagZVYnh]dlZYndj]dlidYZiZgb^cZl]Zi]Zgi]ZgZVgZcd^YaZ6EEA>:GegdXZhhZh# CdlaZi¼hadd`Vi]dlndjYZiZgb^cZl]Zi]ZgjcVhh^\cZYaVg\ZigVchVXi^dchZm^hi# STEP 1 (LOOK AT THE DEPTH OF THE PIPELINE BETWEEN THE MINING ENGINE AND THE APPLY ENGINE) SQL> SELECT (AVAILABLE_TXN PINNED_TXN) AS PIPELINE_DEPTH FROM V$LOGMNR_SESSION WHERE SESSION_ID = (SELECT VALUE FROM V$LOGSTDBY_STATS WHERE NAME = 'LOGMINER SESSION ID'); PIPELINE_DEPTH --------------256 SQL> SELECT COUNT(*) AS APPLIER_COUNT FROM V$LOGSTDBY_PROCESS WHERE TYPE = 'APPLIER'; APPLIER_COUNT ------------20 STEP 2(A): LOOK FOR IDLE APPLIERS SQL> SELECT COUNT(1) AS IDLE_APPLIER FROM V$LOGSTDBY_PROCESS WHERE TYPE = 'APPLIER' AND STATUS_CODE = 16166; IDLE_APPLIER -----------3
CdiZi]ViHFA6eeanjhZhV`HV[ZVa\dg^i]b[dgigVchVXi^dcVhh^\cbZci/^i]daYhkVeea^Zgh Vh^YZ[dgVeean^c\XdbeaZiZXdbb^iiZYigVchVXi^dch#7nYZ[Vjai!HFA6eeanhZihk(& idWZ Veegdm^bViZan&$+d[i]ZcjbWZgd[Veea^ZgegdXZhhZh#I]jh!ndjbVn]VkZVc^hhjZ!ZkZci]dj\] ndj[^cYVeea^Zghi]ViVgZ^YaZ^cndjghnhiZb# STEP 2(B): LOOK FOR UNASSIGNED LARGE TRANSACTIONS SQL> SELECT VALUE FROM V$LOGSTDBY_STATS WHERE NAME = 'LARGE TXNS WAITING TO BE ASSIGNED'; VALUE ---------12
(&
CdiZkbjhiViaZVhiWZ&dg\gZViZg!di]Zgl^hZndjbVnVhh^\cVaaVeea^ZghidjcXdbb^iiZYigVchVXi^dchVcY\Zi ^cidVYZVYadX`#
164
DgVXaZ9ViV SELECT NAME, VALUE NAME -------------DDL TXNS DELIVERED
FROM V$LOGSTDBY_STATS WHERE NAME = 'DDL TXNS DELIVERED'; VALUE --------------------------510
CdiZi]Vii]^hegdk^YZhi]ZidiVacjbWZgd[99AigVchVXi^dchi]Vi]VkZWZZcYZa^kZgZYidi]Z VeeanZc\^cZh^cXZi]ZaVhigZhiVgi#Ndjl^aacZZYid^hhjZi]^hfjZgndkZgVaVg\Z^ciZgkVaVcY hjWigVXii]ZildkVajZhidhZZ]dlbVcn99AhiViZbZcihlZgZYZa^kZgZYidi]ZVeeanZc\^cZ# CdiZi]VicdiVaa99AhiViZbZcihYZa^kZgZYidi]ZVeeanZc\^cZl^aaWZVeea^ZY¸i]Vi^h!99A hiViZbZcihi]ViVgZVhhdX^ViZYl^i]h`^eeZY^ciZgcVahX]ZbVhVgZcdiVeea^ZYWnHFA6eean#
Troubleshooting SQL Apply Ijc^c\HFA6eeanlVhY^hXjhhZY^cVhZeVgViZhZXi^dc¸^i^hValVnh^bedgiVciidZchjgZi]Vindj VgZ\Zii^c\i]Zbdhidjid[ndjgad\^XVahiVcYWn#I]ZgZVgZ!]dlZkZg!di]ZgVgZVh^cl]^X] egdWaZbhXVcdXXjg#H^cXZlZ^cXajYZVhZeVgViZigdjWaZh]ddi^c\X]VeiZg^ci]^hWdd`!lZl^aa XdcXZcigViZdcdcanV[Zl^hhjZh]ZgZgZ\VgY^c\HFA6eean#
Understanding Restarts in SQL Apply H^cXZVaa\ddY976hVgZ^ci]Z]VW^id[bdc^idg^c\i]Z^gVaZgiad\h!^[ndjVgZbVcV\^c\Vad\^XVa hiVcYWnYViVWVhZ!ndjl^aacZZYidbdc^idgi]ZDBA_LOGSTDBY_EVENTSk^Zll^i]ZfjVa^ciZch^in#
Understanding Restarts Due to ORA-4031 NdjbVnhZZi]Z[daadl^c\^ci]ZVaZgiad\/ ORA-4031: UNABLE TO ALLOCATE 2904 BYTES OF SHARED MEMORY ("SHARED POOL","UNKNOWN OBJECT","LOGMINER LCR C","KRVXRGR") INCIDENT DETAILS IN: /U01/APP/ORACLE/DIAG/RDBMS/APPLY/APPLY1/INCIDENT/INCDIR_6246890/APPLY1_MS00_13 611_I6246890.TRC KRVXERPT: ERRORS DETECTED IN PROCESS 47, ROLE READER. KRVXMRS: LEAVING BY EXCEPTION: 4031 ERRORS IN FILE /U01/APP/ORACLE/DIAG/RDBMS/APPLY/APPLY1/TRACE/APPLY1_MS00_13611.TRC: ORA-16234: RESTARTING TO RESET LOGICAL STANDBY LOGSTDBY STATUS: ORA-16111: LOG MINING AND APPLY SETTING UP LOGSTDBY STATUS: APPLY LWM 5368712584, HWM 5368712584, SCN 5368712584 LOGMINER: PARAMETERS SUMMARY FOR SESSION# = 1 LOGMINER: NUMBER OF PROCESSES = 3, TRANSACTION CHUNK SIZE = 201 LOGMINER: MEMORY SIZE = 200M, CHECKPOINT INTERVAL = 1000M
L]Vi^h\d^c\dc4L]nY^YHFA6eean\dYdlcl^i]DG6")%(&46cYl]nY^Y^icdiZcXdjciZg i]ZZggdgdcXZ^igZhiVgiZY4I]ZVchlZg]VhidYdl^i]]dli]Zb^c^c\Zc\^cZbVcV\ZhbZbdgn#
8]VeiZg)/ Ad\^XVaHiVcYWn
165
GZbZbWZgi]ZA8GXVX]Z4>i`ZZehA8Ghi]ViVgZVhhdX^ViZYl^i]bdY^[^XVi^dchbVYZidi]Z YViVWVhZ!VcYY^[[ZgZciA8GhgZfj^gZY^[[ZgZciVbdjcihd[bZbdgn#I]^h^hdWk^djh/Vc^chZgi hiViZbZci^chZgi^c\kVajZhidViVWaZl^i]&%Xdajbchl^aabdhia^`ZangZfj^gZaZhhheVXZi]VcdcZi]Vi ^chZgihkVajZh^cidViVWaZl^i](%%Xdajbchd[i]ZhVbZineZ#Iddei^b^oZeZg[dgbVcXZ!i]Zb^c^c\ Zc\^cZgZXnXaZhbZbdgnl^i]^c^ihdlca^hiVcYYdZhcdi[gZZ^iidi]Z]ZVe#Bdhid[i]Zi^bZ!i]^h ldg`hlZaa#=dlZkZg!l]Zci]Zldg`^c\hZiX]Vc\ZhYgVhi^XVaanhVn!i]ZA8GXVX]ZlVh[^aaZYl^i] A8Gh[dg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jheZX^[nWZ[dgZndjignidXgZViZV7gd`Zg Xdc[^\jgVi^dc#H^cXZlZVgZjh^c\6HB!i]ZnbjhiZm^hi^ci]Z6HBY^h`\gdjehDATAVcYFLASH#>[ ndjVgZ[daadl^c\eda^XnVcYndjVgZeaVX^c\i]Z[^aZh^ci]ZY^gZXidgn[dgi]ZYViVWVhZ!i]ZcBVig^m ldjaYVagZVYnZm^hi!d[XdjghZ#7jicdi]^c\ldjaYhidendj[gdbeaVX^c\i]ZXdc[^\jgVi^dc[^aZh Vcnl]ZgZ^c6HBi]VindjX]ddhZ!egdk^YZYi]ZY^gZXidg^ZhZm^hi#Jh^c\6HB8B9!ndjldjaY cVk^\ViZidi]ZYViVWVhZY^gZXidgnjcYZgDATAVcYFLASHVcYXgZViZVY^gZXidgnXVaaZY7GD@:G/ [+ASM] asmcmd ASMCMD> cd DATA ASMCMD> cd MATRIX ASMCMD> mkdir BROKER ASMCMD> cd ../.. ASMCMD> cd FLASH
8]VeiZg*/ >beaZbZci^c\DgVXaZ9ViV cd MATRIX ASMCMD> mkdir BROKER ASMCMD> exit
TIP Remember to pre-create the directories that you are going to use for the configuration files; otherwise the Broker will not be able to function and you won’t really know why unless you read the Broker logs and understand what they are saying. L]ZcndjXgZViZndjgXdc[^\jgVi^dcaViZgdc^ci]^hX]VeiZg!ndjl^aahZZi]Vii]Z7gd`Zg VXijVaan`ZZehi]ZgZVaXdc[^\jgVi^dcYViV[^aZ^cVcdi]ZgY^gZXidgnl]ZcndjjhZ6HB#6hndjXVc hZZ[gdbi]ZegZXZY^c\XdbbVcYh!lZXgZViZYVhjWY^gZXidgn^ci]ZYViVWVhZY^gZXidg^ZhXVaaZY 7GD@:G!VcYl]ZclZXgZViZi]ZXdc[^\jgVi^dc!i]Z7gd`Zgl^aaejiV[^aZ^ci]ViY^gZXidgnl^i] i]ZcVbZlZheZX^[^ZY^ci]ZeVgVbZiZg#7ji^[ndjadd`XadhZg!ndjl^aahZZi]Vii]ZcVbZ^h VXijVaanVa^c`idVcdi]Zg[^aZ^cVcdi]ZgY^gZXidgnXVaaZY96I6 cd DATA/MATRIX/BROKER ASMCMD> ls dr1matrix.dat ASMCMD> ls –l Type Redund Striped
Time
+DATA/MATRIX/DATAGUARDCONFIG/Matrix.298.671576301 ASMCMD> cd ../DATAGUARDCONFIG ASMCMD> ls –l Type Redund Striped Time DATAGUARDCONFIG UNPROT COARSE NOV 23 20:00:00 ASMCMD>
Sys N
Name dr1matrix.dat =>
Sys Y
Name Matrix.298.671576301
I]ZhZXdcYXdc[^\jgVi^dc[^aZ^ci]ZFLASHY^h`\gdjel^aaVahdWZa^c`ZYidi]ZhVbZ Y^gZXidgn^ci]ZFLASHY^gZXidgnigZZ# >[ndjhZii]ZhZeVgVbZiZghWji[dg\ZiidXgZViZi]ZY^gZXidg^Zhdci]Zeg^bVgnYViVWVhZ!ndjg CREATE CONFIGURATIONXdbbVcYl^aagZijgcV[^aZcdi[djcYZggdg[gdb9 Starting Data Guard Broker bootstrap DMON: Broker Configuration File Locations: dg_broker_config_file1 = "+DATA/matrix_dr0/broker/dr1matrix_dr0.dat"
182
DgVXaZ9ViVMT9G%Y^gZXidgndcWdi]i]ZDATAVcYFLASHY^h`\gdjeh#I]^hhZfjZcXZd[ Zggdghl^aaWZgZeZViZY[dgZkZgjci^andjY^hVWaZi]ZXdc[^\jgVi^dc!XgZViZi]Zb^hh^c\Y^gZXidgn! VcYi]ZcZcVWaZi]ZXdc[^\jgVi^dcV\V^c# DcXZndj]VkZeZg[dgbZYVaai]ZcZXZhhVgnY^gZXidgnldg`VcYhZii]ZeVgVbZiZgh^cVaad[ ndjgYViVWVhZh!ndjVgZgZVYnidhiVgijei]Z7gd`Zg#I]^h^hYdcZWnXdccZXi^c\idZVX]YViVWVhZ l^i]HFAEajhVcYhZii^c\i]Z7gd`ZgSTARTeVgVbZiZgidTRUE# SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;
I]^hYdZhcdiXgZViZVcn`^cYd[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L = TCP)(HOST = matrix_dr0.domain)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = Matrix_DR0.domain) ) )
;dgi]ZcZlDgVXaZ9ViVWVhZ&&gjhZg!i]^hcZlegdeZgin^hVcdWk^djhdeZgVi^dc!Wjil]Vi VWdjii]ZXjggZci7gd`ZgjhZg^cDgVXaZ&%g4L]Vi]VeeZchl]Zci]ZYViVWVhZ^hje\gVYZY[gdb &%gid&&g4I]Zdg^\^cVaXdc[^\jgVi^dcl^aaXdci^cjZidldg`!Wjii]ZXdccZXihig^c\i]Vii]Z7gd`Zg eji^cidi]ZInitialConnectIdentifierl^aaWZb^\gViZYidi]ZcZlXdc[^\jgVi^dcVhi]Z DGConnectIdentifieregdeZgin#I]^hbZVchi]Vindjl^aahi^aaWZjh^c\i]ZdaYbZi]dYl]ZgZi]Z 7gd`ZgjhZhi]ZXdccZXihig^c\^chiZVYd[ndjgICHC6B:#L]^X]Wg^c\hjhWVX`idi]ZhjW_ZXid[ i]Vi7gd`ZgMEIhZgk^XZ#I]^hVahdbZVchi]Vindjl^aahi^aaWZjh^c\i]ZdaYhZgk^XZVhadc\Vhndj X]ddhZcdiidX]Vc\Zi]ZDGConnectIdentifier#HdYdcdiY^hVWaZi]ZMEIhZgk^XZ!VhYZhXg^WZY ZVga^Zg!jci^andj[^mi]ZXdccZXi^YZci^[^Zg# TIP When you already have a Broker configuration, always change the nn n property for all of your databases to a real TNSNAME after you upgrade from 10\ to 11\!
The Broker and the Listener DWk^djhan!Vhl^i]VcnDgVXaZCZiHZgk^XZhXdccZXi^dc!i]Z7gd`ZgjhZhi]ZICHC6B:idgZhdakZ i]ZeVi]idi]ZYViVWVhZVcYi]Zc^c^i^ViZhVXdccZXi^dcidi]Za^hiZcZgVii]ZiVg\ZihnhiZbjh^c\ i]ZhZgk^XZcVbZndjeji^cidndjgICHC6B:Zcign#6cYh^cXZi]ZildbV^ceaVXZhi]Vii]ZhZ XdccZXi^dchVgZ^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 LOG_ARCHIVE_DEST_1='LOCATION= USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_ROLES,ALL_LOGFILES)'
=dlZkZg!^[ndjZmea^X^ianYZ[^cZYVadXVaVgX]^k^c\YZhi^cVi^dcjh^c\i]ZVALID_FOR Viig^WjiZVh[daadlh! LOG_ARCHIVE_DEST_1='LOCATION= USE_DB_RECOVERY_FILE_DEST VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILE)'
i]Zci]Z7gd`ZgXVccdiX]Vc\Z^iVcYl^aaVYYVcdi]ZgYZhi^cVi^dceVgVbZiZgZmea^X^ianYZ[^cZY[dg i]ZhiVcYWngZYdad\[^aZh!Vh[daadlh/ LOG_ARCHIVE_DEST_3='LOCATION=$ORACLE_HOME/dbs/arch VALID_FOR=(STANDBY_ROLE,STANDBY_LOGFILE)'
I]Z$ORACLE_HOME^ci]ZZmVbeaZgZegZhZcihi]ZVXijVaY^gZXidgnhig^c\#I]^hldc¼ibZVc bjX]dci]Zeg^bVgnVii]^hi^bZh^cXZi]ZhiVcYWngZYdad\[^aZhVgZcdiWZ^c\jhZY#7ji^il^aa
198
DgVXaZ9ViV[ndj]VkZndjgadXVaVgX]^k^c\YZ[^cZY^ci]^hbVccZg!ndjh]djaYX]Vc\Z^iidheZX^[n VALID_FOR=(ALL_ROLES,ALL_LOGFILES)WZ[dgZndjZcVWaZi]ZXdc[^\jgVi^dc# TIP Always use a flash recovery area and define your local archiving parameters to be L AR VE E L A E . RE VER LE E Di]ZgX]Vc\Zh]VkZWZZcbVYZ!ZheZX^Vaanidi]ZYZ[VjaikVajZhd[hdbZd[i]ZhZegdeZgi^Zh! WZilZZci]ZkVg^djhkZgh^dch#7ZXVjhZi]ZYZ[Vjai^ci]ZYViVWVhZGZYdIgVchedgik^Zl V$ARCHIVE_DESTY^Ycdi]daYi]ZXdggZXiYZ[Vjai[dgi]ZNET_TIMEOUTViig^WjiZ!i]Z7gd`ZghZi i]ZNET_TIMEOUTidNONET_TIM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gZ7gd`ZgXdc[^\jgVi^dc!ndjl^aacZZY n >WZ[dgZSET PROPERTY# idVYYON DATABASE I]Z7gd`Zgk^Zlh^ihegdeZgi^Zh[gdbVYViVWVhZgdaZeZgheZXi^kZVcYl^aaVXijedcVegdeZgin X]Vc\Zdcan^[^iXdch^YZghi]Vii]ZgdaZd[i]ZYViVWVhZndjVgZX]Vc\^c\bZZihi]ZgdaZgZfj^gZbZcih d[i]ZegdeZgin#I]Z7gd`ZgegdeZgi^ZhXVcWZ[jgi]ZgY^k^YZY^cid[^kZbV^cXViZ\dg^Zh/ N
Broker-specific properties I]ZhZV[[ZXii]ZlVni]Z7gd`ZgdeZgViZhVcY]dl;Vhi"HiVgi ;V^adkZg^hXdc[^\jgZY#
N
Database parameters I]ZhZVgZi]ZYViVWVhZeVgVbZiZghi]Vii]Z7gd`ZgdlchVcYVgZ Xdch^YZgZY9ViVbeaZbZci^c\DgVXaZ9ViV[ndjZmeZg^ZcXZ[gZfjZcicZildg`Wgdlcdjih!^ib^\]iWZldgi]l]^aZid ^cXgZVhZi]^hegdeZgin/ DGMGRL> EDIT DATABASE Matrix_DR0 SET PROPERTY ApplyInstanceTimeout=20; Property "applyinstancetimeout" updated DGMGRL>
I]ZPreferredApplyInstanceegdeZginVaadlhndjidiZaai]Z7gd`Zgl]ZgZndjldjaYa^`Z i]ZVeeanidgjcl]Zcndj]VkZVbjai^eaZ"cdYZG68hiVcYWn#7nYZ[Vjai!i]^hegdeZgin^hZbein! l]^X]iZaahi]Z7gd`Zg^iXVcejii]ZVeeanegdXZhh^c\dcVcnhiVcYWn^chiVcXZ^iX]ddhZh#>chdbZ XVhZh!^ibVnWZcZXZhhVgnidejii]ZVeeanhZgk^XZhdcVegZYZ[^cZYcdYZ#;dgZmVbeaZ!^[ndj ]VkZV[djg"cdYZG68hiVcYWnWjindjlVciidjhZi]gZZd[i]Z[djgcdYZh[dgiZhi^c\dgZkZc[dg Vcdi]ZgegdYjXi^dcYViVWVhZ!ndjb^\]ilVciidignVcY`ZZei]ZVeeanegdXZhh^c\dcdcZ eVgi^XjaVgcdYZ#NdjldjaYYdhdWnhZii^c\i]^hegdeZginidi]ZH>9l]^X]^hVahdi]Z^chiVcXZ aZkZaegdeZginSidNamed[i]Vi^chiVcXZ/ DGMGRL> EDIT DATABASE SET PROPERTY PreferredApplyInstance='Matrix_DR01'; Property "preferredapplyinstance" updated DGMGRL>
NdjcZZYidgZbZbWZgildi]^c\hVWdjii]^hegdeZgin/ N >[i]ZVeean^hVagZVYngjcc^c\dchdbZhnhiZb^ci]ZhiVcYWnG68!bdY^[n^c\i]^h egdeZginl^aacdibdkZi]ZVeeanhZgk^XZh# N I]ZVeeanl^aaWZbdkZYl]Zci]Z7gd`ZgYZX^YZh^icZZYhid[V^adkZgi]ZVeeanhZgk^XZh idVcdi]Zg^chiVcXZd[^ihX]ddh^c\l]Zc^iXVccdadc\ZgXdciVXii]ZXjggZciVeeancdYZ# I]Z7gd`Zgl^aacdiVjidbVi^XVaanbdkZi]ZVeeanhZgk^XZhWVX`idndjgegZ[ZggZY^chiVcXZ l]Zc^i^hgZVX]VWaZV\V^c# JcaZhhndj]VkZcdinZiZcVWaZYi]ZiVg\ZiYViVWVhZVcY]ZcXZi]ZVeeanhZgk^XZhVgZcdinZi gjcc^c\!^ibV`ZhcdhZchZidbdY^[ni]^hegdeZgin#>cWdi]XVhZhbZci^dcZY!ndjXVcjhZi]Z STATEX]Vc\ZeVgid[i]ZEDITXdbbVcYidbdkZi]ZVeeanhZgk^XZhidVheZX^[^X^chiVcXZ#LZ l^aaY^kZ^cidi]ZhiViZh^cVW^i!WjiVcZmVbeaZd[i]^hXdbbVcY[daadlh/ DGMGRL> EDIT DATABASE 'Matrix_DR0' SET STATE='APPLY-ON' WITH APPLY INSTANCE='Matrix_DR01'; Succeeded. DGMGRL> SHOW DATABASE 'Matrix_DR0' 'PreferredApplyInstance'; PreferredApplyInstance = 'Matrix_DR01'
I]^hldjaYhZii]ZPreferredApplyInstanceegdeZgin[dgndjVcYbdkZi]ZVeeanhZgk^XZhid i]ZYZh^gZY^chiVcXZ# TIP Unless you have a specific reason for setting the P A n n property, leave it blank and let the Broker choose the apply instance.
204
DgVXaZ9ViV EDIT DATABASE MATRIX SET PROPERTY LogArchive Format='%t%s%r_new.dbf'
7ji^ci]ZVaZgiad\d[BVig^m!ndjldjaYhZZi]Z[daadl^c\/ ALTER SYSTEM SET log_archive_format='%t%s%r_new.dbf' SCOPE=SPFILE SID='Matrix';
6cYjci^andjgZhiVgiZYi]ZiVg\ZiYViVWVhZBVig^m!^ci]^hXVhZ!ndjldjaYhZZi]Z[daadl^c\ Zggdgl]ZcndjeZg[dgbVSHOW DATABASE VERBOSE MATRIX!h^cXZi]ZXjggZci^c"bZbdgn kVajZcdadc\ZgbViX]Zhi]ZSPFILEkVajZ/ Current status for "matrix": Warning: ORA-16792: configurable property value is inconsistent with database setting
Dci]Zdi]Zg]VcY!VegdeZginhjX]VhStandbyFileManagement^hXdch^YZgZYWni]Z 7gd`ZgidWZVhiVcYWn"dcanegdeZgin#>il^aaX]Vc\Zi]ZkVajZd[i]ZegdeZgin^ci]ZXdc[^\jgVi^dc [^aZhWjii]ZALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO MANUALXdbbVcYl^aa WZ^hhjZYdcanl]Zci]ZYViVWVhZ^hhiVgiZY^ci]ZhiVcYWngdaZ#>cHFAEajh!i]ZeVgVbZiZgldjaY WZhZi^bbZY^ViZanWjicdijhZYjci^ai]ZYViVWVhZWZXVbZVe]nh^XVahiVcYWn# I]ZhVbZYdZhcdiVeeanidi]ZegdeZginLogShipping!l]^X]ZcVWaZhdgYZ[ZghGZYd IgVchedgiidi]VihiVcYWnYViVWVhZ#I]^h^hdcZd[i]dhZreverse properties¸reverse^ci]ZhZchZ i]VindjhZi^idcVYViVWVhZWjii]ZgZhjai^c\HFAXdbbVcYidX]Vc\Zi]ZYViVWVhZeVgVbZiZg^h ZmZXjiZYdcl]ViZkZgYViVWVhZ^hi]Zeg^bVgnVii]Zi^bZ#6hhjbZ![dgZmVbeaZ!i]ViBVig^m^hdjg
8]VeiZg*/ >beaZbZci^c\DgVXaZ9ViV SHOW DATABASE MATRIX LogShipping; LogShipping = 'ON' DGMGRL> EDIT DATABASE MATRIX SET PROPERTY LogShipping='OFF'; Property "logshipping" updated DGMGRL> SHOW DATABASE MATRIX LogShipping; LogShipping = 'OFF' DGMGRL> SHOW DATABASE MATRIX_DR0 LogShipping; LogShipping = 'ON' DGMGRL> EDIT DATABASE MATRIX_DR0 SET PROPERTY LogShipping='OFF'; Property "logshipping" updated DGMGRL> DGMGRL> SHOW DATABASE MATRIX_DR0 LogShipping; LogShipping = 'OFF'
I]^hldjaYhZijeBVig^mcdiidgZXZ^kZgZYdl]Zc^iWZXdbZhVhiVcYWnYViVWVhZVcYl^aa hidei]ZigVchedgid[gZYdidBVig^mT9G%^bbZY^ViZan#NdjXVckZg^[ni]^hWnZmVb^c^c\i]ZVaZgi ad\d[BVig^m#I]ZdcanZcignndjl^aahZZ^hi]Z[daadl^c\/ ALTER SYSTEM SET log_archive_dest_state_2='RESET' SCOPE=BOTH;
I]ZYZhi^cVi^dceVgVbZiZgcjbWZg'^hXjggZcianWZ^c\jhZYWn9ViV[ndjaZVkZi]ZDelayMinsegdeZginVi^ihYZ[Vjaid[%!dgndjhZi^ibVcjVaanid%!i]Z 7gd`Zgl^aaXdc[^\jgZi]ZVeeanhZgk^XZhdci]ZiVg\ZihiVcYWnYViVWVhZidjhZgZVa"i^bZVeean#>[ ndjhZii]ZDelayMinsegdeZginidVcnkVajZdi]Zgi]Vc%!i]Z7gd`Zgl^aaValVnhhiVgii]ZVeean hZgk^XZhl^i]djigZVa"i^bZVeeanVcYi]ZVeeanl^aaldg`dcan[gdbi]ZVgX]^kZad\[^aZhVcYi]Zc dcanV[iZgi]ZYZaVn]VheVhhZY#I]^h^hY^[[ZgZci[gdbi]ZbVcjVabZi]dYd[Xdc[^\jg^c\ndjg9ViV EDIT DATABASE Matrix_DR0 SET PROPERTY LsbyPreserveCommitOrder='FALSE'; Error: ORA-16788: unable to set one or more database configuration property values Failed. DGMGRL>
=dlZkZg!^[ndjX]Vc\Zi]ZegdeZgindcVeg^bVgnYViVWVhZ!i]ZbdY^[^XVi^dcl^aahjXXZZY WZXVjhZi]Zeg^bVgnXdjaYWZXdbZVad\^XVahiVcYWnYViVWVhZ^[Vhl^iX]dkZgidVad\^XVahiVcYWn YViVWVhZdXXjgh/ DGMGRL> EDIT DATABASE Matrix SET PROPERTY LsbyPreserveCommitOrder='FALSE'; Property "lsbypreservecommitorder" updated DGMGRL> DGMGRL> SHOW DATABASE Matrix LsbyPreserveCommitOrder; LsbyPreserveCommitOrder = 'FALSE' DGMGRL>
8]VeiZg*/ >beaZbZci^c\DgVXaZ9ViVc[VXi!i]ZegdeZginStandbyArchiveLocationl^aaYZ[Vjaiidndjg[aVh]gZXdkZgn VgZV^[ndjVgZjh^c\dcZ!VcYi]^h^hVWZhiegVXi^XZ#7ji^[i]ZegdeZginYdZhcdiYZ[Vjai!^ib^\]iWZ cZXZhhVgnidjhZY^[[ZgZciY^h`eVi]h[dgi]ZVgX]^kZad\hdcVhiVcYWn^[ndjVgX]^kZidVcdc·XajhiZg l^YZY^gZXidgn# Dci]Zad\^XVahiVcYWnh^YZ!^i^ha^`Zani]Vindj¼YlVciidbdY^[ni]ZVbdjcid[bZbdgnVcY VeeanegdXZhhZh[dgHFA6eeanWn^chiVcXZ^[ndjgG68ad\^XVahiVcYWn]VhjcZfjVah^oZhnhiZbh# H^cXZi]ZVeeanhZgk^XZhXdjaY[V^adkZgidVcncdYZ^ci]ZhiVcYWnG68!ndjldjaYlVcii]Z VeeanidgjcVcYidXdchjbZgZhdjgXZhVXXdgY^c\idi]Zh^oZd[i]ZhnhiZb#6cYigVX^c\!WZ^c\ jhZYidY^V\cdhZ9ViV[lZ VagZVYn]VkZStandbyArchiveLocationVhVYZ[VjaiYViVWVhZ"l^YZadXVi^dc[dgi]Z^cXd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WaZ Ta
HFA6eeanh`^eigVchVXi^dciVWaZ
6cY]ZgZVgZi]Z\ZcZgVagZedgihegdeZgi^Zh/ N
R c
E
r
GZXZ^kZfjZjZZcig^Zh
N
S
E
r
HZcYfjZjZZcig^Zh
N
S a
R por A^hid[ZggdghdglVgc^c\h
N
La
Lo IV^ad[i]Z9G8ad\[^aZ
N
Top a
E
;^kZidelV^iZkZcih
NdjXVchZZi]ZhVbZZggdgbZhhV\Z^ci]ZStatusReportegdeZgin/ DGMGRL> SHOW DATABASE Matrix StatusReport; STATUS REPORT INSTANCE_NAME SEVERITY ERROR_TEXT Matrix WARNING ORA-16714: the value of property LogArchiveMaxProcesses is inconsistent with the database setting
Jh^c\i]ZZggdgbZhhV\ZlZ\di[gdbdjgeg^bVgnYViVWVhZ»BVig^m¼lZXVcadd`Vii]Z InconsistentPropertiesegdeZginiddWiV^cbdgZ^c[dgbVi^dcdci]ZZggVcieVgVbZiZg/ DGMGRL> SHOW DATABASE Matrix InconsistentProperties ; INCONSISTENT PROPERTIES INSTANCE_NAME PROPERTY_NAME MEMORY_VALUE SPFILE_VALUE Matrix LogArchiveMaxProcesses 4 6 DGMGRL>
BROKER_VALUE 4
216
DgVXaZ9ViVA:i]^c`^c\ i]ViVii]ZcZmigZhiVgid[i]Zeg^bVgnYViVWVhZ!h^m6G8=egdXZhhZhldjaYWZhiVgiZYVcYcddcZ ldjaYWZi]Zl^hZg#LZaa!i]ZXjaeg^ildjaYWZ^c[dgVhjgeg^hZ!h^cXZi]Z7gd`ZgldjaYgZijgci]Z eVgVbZiZgid[djgegdXZhhZh!WZXVjhZi]Vi^h^ihk^Zld[i]ZldgaY#I]ZegdeZglVnldjaY]VkZ WZZcidjhZi]Z9A:# DGMGRL> EDIT DATABASE Matrix SET PROPERTY LogArchiveMaxProcesses=6; Property "logarchivemaxprocesses" updated DGMGRL> SHOW DATABASE Matrix StatusReport; STATUS REPORT INSTANCE_NAME SEVERITY ERROR_TEXT
H^cXZlZ]VkZgZhdakZYi]ZegdeZginl^i]i]ZeVgVbZiZghZii^c\!i]ZhiVijhgZedgih]dlhcd egdWaZbh#I]ZgZhid[i]ZgZVY"dcanegdeZgi^Zhldg`egZiinbjX]i]ZhVbZ/ DGMGRL> SHOW DATABASE Matrix LogXptStatus; LOG TRANSPORT STATUS PRIMARY_INSTANCE_NAME STANDBY_DATABASE_NAME Matrix matrix_dr0
STATUS
I]ZdcZgZVY"dcanegdeZgini]Vil^aaValVnhgZijgcadihd[^c[dgbVi^dc^hi]ZLatestLogegdeZgin# :mVb^c^c\i]^hegdeZginl^aaY^heaVni]ZiV^aZcYd[i]Z7gd`Zg9G8ad\[gdbi]ZhnhiZbl]ZgZi]Z iVg\ZiYViVWVhZgZh^YZh#I]^hl^aaVaadlndjidadd`Vii]ZaViZhibZhhV\Zhi]ViVgZWZ^c\VYYZYid i]Zad\[^aZ# I]ZTopWaitEventsegdeZginl^aaVahdY^heaVni]Zide[^kZZkZcih[gdbi]ZV$SYSTEM_EVENT k^Zld[i]ZiVg\ZiYViVWVhZ#
Removing the Broker >ci]^hX]VeiZg!lZ]VkZViiZbeiZYidh]dlndj]dli]Z7gd`Zgldg`h!VcYWnYd^c\hd!lZ]deZ i]VindjXVchZZ]dli]Z7gd`Zg]VhbVijgZYVcY^hVedlZg[janZih^beaZ^ciZg[VXZid9ViVgZbdkZ^i4ºValVnhhZZbhidXdbZje# GZbdk^c\9ViVA: [gdbndjgZY^iZYE;>A:#7jigZbdk^c\i]Z7gd`ZgVcYaZVk^c\ndjg9ViV 1 ibV`ZhcdhZchZViVaaidheZcYi]Zi^bZ!Z[[dgi!VcY bdcZnhZii^c\jeV9Ghdaji^dcdcanidVkd^Yjh^c\^il]ZcndjZmeZg^ZcXZVegdYjXi^dc[V^ajgZ# I]^hYdZhcdibZVci]VindjValVnh]VkZid[V^adkZg#NdjghZijebVnWZhdXdbeaZmi]Vi^i^h ZVh^ZgidhdakZVegdWaZb^ci]Zh]dgiiZgb^chiZVYd[gZhdgi^c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Zl^aaWg^Z[anY^hXjhh kVg^djhlVnhndjXVcjhZ;aVh]WVX`9ViVWVhZl^i]9ViVci]^hXVhZ!;aVh]WVX`9ViVWVhZYdZhcdi]VkZidWZZmegZhhanZcVWaZY h^cXZ9ViV SELECT DB_UNIQUE_NAME, PROTECTION_MODE, SYNCHRONIZATION_STATUS, 2> SYNCHRONIZED FROM V$ARCHIVE_DEST_STATUS DB_UNIQUE_NAME PROTECTION_MODE SYNCHRONIZATION_STATUS SYN --------------- -------------------- ---------------------- --NONE MAXIMUM PERFORMANCE CHECK CONFIGURATION NO matrix_dr0 MAXIMUM AVAILABILITY OK ES NONE MAXIMUM PERFORMANCE CHECK CONFIGURATION NO NONE MAXIMUM PERFORMANCE CHECK CONFIGURATION NO NONE MAXIMUM PERFORMANCE CHECK CONFIGURATION NO NONE MAXIMUM PERFORMANCE CHECK CONFIGURATION NO NONE MAXIMUM PERFORMANCE CHECK CONFIGURATION NO NONE MAXIMUM PERFORMANCE CHECK CONFIGURATION NO NONE MAXIMUM PERFORMANCE CHECK CONFIGURATION NO NONE MAXIMUM PERFORMANCE CHECK CONFIGURATION NO 10 rows selected.
6hndjXVchZZ^ci]^hVWdkZ!djgiVg\ZihiVcYWnVcYdjgdcanhiVcYWnB6IG>MT9G%^h hncX]gdc^oZYl^i]i]Zeg^bVgnYViVWVhZ#I]^h^hhj[[^X^ZciidkZg^[ni]Vii]ZhiVcYWn]VhgZXZ^kZY Vaai]ZgZYd#7ji^[SYNCHRONIZEDYdZhcdihVnYESdgndjVgZgjcc^c\^cBVm^bjb EZg[dgbVcXZbdYZ!ndjcZZYidYdVW^ibdgZldg`idkZg^[ni]ZgZYdhiVijh# SELECT CLIENT_PROCESS,PROCESS,SEQUENCE#,STATUS FROM V$MANAGED_STANDBY; CLIENT_P PROCESS SEQUENCE# STATUS -------- --------- ---------- -----------ARCH ARCH 326 CLOSING ARCH ARCH 0 CONNECTED ARCH ARCH 327 CLOSING ARCH ARCH 0 CONNECTED N/A MRP0 328 APPLYING_LOG LG R RFS 32 IDLE ARCH RFS 0 IDLE N/A RFS 0 IDLE 8 rows selected. SQL>
I]Zdjieji[gdbi]^hXdbbVcYl^aah]dlndji]ZXjggZcihZfjZcXZi]Vii]Zeg^bVgn^h hZcY^c\!VhZk^YZcXZYWni]ZCLIENT_PROCESSZfjVaidLGWR!l]^X]^hhZfjZcXZ('-^cdjg XVhZ#>[ndjVgZjh^c\HNC8dg6HNC8!ndjl^aa\Zii]ZhVbZgZhjai#>[!]dlZkZg!ndjVgZjh^c\ 6G8=gZbZbWZgi]Vi6G8=]VhWZZcYZegZXViZYWjihi^aaZm^hih^c&&gVcYegZk^djhkZgh^dch!
8]VeiZg-/ Hl^iX]dkZgVcY;V^adkZg
313
ndjh]djaYViaZVhihZZVc6G8=idG;HXdccZXi^dcl^i]i]ZaVhiVgX]^kZYhZfjZcXZ[gdbi]Z eg^bVgn!l]^X]h]djaYWZcdbdgZi]Vc&aZhhi]Vci]Zeg^bVgn!Vhh]dlc^ci]Z[daadl^c\ XdbbVcYZmZXjiZYdci]Zeg^bVgn/ SQL> SELECT THREAD#,SEQUENCE#,STATUS FROM V$LOG; THREAD# SEQUENCE# STATUS ---------- ---------- ---------------1 328 CURRENT 1 326 INACTIVE 1 327 INACTIVE SQL>
>[i]ZhiVcYWn^hcdigZXZ^k^c\i]ZXjggZcigZYd!ndjXVccdihl^iX]dkZg#CdiZi]Vi^[ndjg eg^bVgn^hVG68!ndjh]djaYhZZbjai^eaZAci]ZXVhZd[Ve]nh^XVahiVcYWnndjl^aahZZi]ZBGE%a^cZ^ci]ZV$MANAGED_ STANDBYfjZgna^`Zhd/ CLIENT_P -------N/A LGWR
PROCESS SEQUENCE# --------- ---------MRP0 328 RFS 328
STATUS -----------APPLYING_LOG IDLE
>[ndjVgZhl^iX]^c\dkZgidVe]nh^XVahiVcYWnVcYndjYdcdihZZi]ZBGE%a^cZ!i]Zci]Z Veean^hcdigjcc^c\#Idhl^iX]dkZg!ndjbjhihiVgii]ZVeeanhZgk^XZVcYlV^i[dg^iidXViX]je l^i]i]ZXjggZcigZYdhigZVbWZ[dgZhiVgi^c\# >[ndjhZZi]ZBGE%a^cZWji^i]VhVhiVijhd[WAIT_FOR_GAP!ndjXVccdihl^iX]dkZgjci^a i]Z\Ve]VhWZZcgZhdakZY# GZbZbWZgi]ViVhiVijhd[WAIT_FOR_LOGbZVchi]ViZ^i]ZgndjVgZcdigjcc^c\gZVa"i^bZVeean dgndj]VkZheZX^[^ZYVDELAY#>ci]ZXVhZd[VDELAY!ndjbjhihidei]ZVeeanegdXZhhVcYgZhiVgi^i jh^c\i]ZNODELAYfjVa^[^Zg0di]Zgl^hZ!ndjghl^iX]dkZgl^aacdiWZVWaZidXdbeaZiZ#
SQL Apply >[ndjVgZeZg[dgb^c\Vhl^iX]dkZgidVad\^XVahiVcYWn!i]ZgZl^aaWZcd^cY^XVi^dc ^ci]ZV$MANAGED_STANDBYk^ZlVWdjii]ZHFA6eeanegdXZhh!_jhii]ZgZYdigVchedgi#IdkZg^[n i]Vii]Zad\^XVahiVcYWn^hXVj\]ijel^i]i]Zeg^bVgn!jhZi]ZV$LOGSTDBY_PROGRESSk^Zl# =ZgZ¼hVcZmVbeaZ/ SQL> SELECT APPLIED_SCN, LATEST_SCN, MINING_SCN FROM V$LOGSTDBY_PROGRESS; APPLIED_SCN LATEST_SCN MINING_SCN ----------- ----------- ---------7178240496 7178240507 7178240507
>[i]ZgZYdigVchedgiX]ZX`[gdbV$MANAGED_STANDBY^hjeidYViZVcYi]ZMINING_SCNVcY LATEST_SCN[gdbi]ZVWdkZXdbbVcYVgZ^chncX!i]Zci]Zad\^XVahiVcYWn^hXVj\]ijeVcY
314
DgVXaZ9ViV[!dci]Zdi]Zg]VcY!igVchedgiadd`hXdggZXiWjii]ZMINING_SCN^hWZ]^cYi]Z LATEST_SCN!ndjbVn]VkZV\Ve#NdjXVcX]ZX`[dgi]^hWnjh^c\i]^hHFAXdbbVcY/ SQL> SELECT STATUS FROM V$LOGSTDBY_PROCESS WHERE TYPE = 'READER'; STATUS ---------------------------------------------------------------------ORA:01291 Waiting for logfile
>ci]^hXVhZ!ndj]VkZV\Vei]VibjhiWZgZhdakZYWZ[dgZWZ\^cc^c\i]Zhl^iX]dkZg!Vhl^i] Ve]nh^XVahiVcYWn#
Canceling Jobs and Backups ;^cVaan!ndjbjhiXVcXZaVcngjcc^c\_dWhdci]Zeg^bVgnYViVWVhZVcYY^hVWaZVcncZldcZh [gdbhiVgi^c\hjX]VhGB6CWVX`jeh!Veea^XVi^dcXaZVcje_dWh!DgVXaZIZmiHncX_dWh!VcYhd dc#>cVYY^i^dc!hideVcnGB6CWVX`jehi]ViVgZXjggZciangjcc^c\dci]ZiVg\ZihiVcYWnYViVWVhZ Vhi]^hXVc^ciZg[ZgZl^i]i]Zhl^iX]dkZg#;dgZmVbeaZ!id[^cYdji^[GB6C^hgjcc^c\!igni]Z [daadl^c\XdbbVcY/ SQL> SELECT PROCESS, OPERATION, R.STATUS, MBYTES_PROCESSED PCT, S.STATUS FROM V$RMAN_STATUS R, V$SESSION S WHERE R.SID=S.SID PROCESS OPERATION STATUS PCT STATUS ------------------ ------------------------- ---------------- --- -------19507 RMAN RUNNING 0 ACTIVE 19507 BACKUP BACKUPSET RUNNING 0 ACTIVE
DcXZndj]VkZeZg[dgbZYVaad[i]ZX]ZX`h^ci]^hhZXi^dcVcYgZhdakZYVcnegdWaZbh!ndj VgZgZVYnidXdci^cjZ#7ji^[ndjXVccdigZhdakZi]Zb!ndjbjhiVWVcYdci]Zhl^iX]dkZg#
Preprocessing Steps >[ndjghiVcYWnYViVWVhZeVhhZYi]ZbVcYVidgnX]ZX`hY^hXjhhZYhd[Vg!ndjVgZgZVYnidWZ\^ci]Z hl^iX]dkZg#Ndjg[^ghihiZe^hidhiVgibdc^idg^c\i]ZVaZgiad\hd[i]Zeg^bVgnVcYi]ZiVg\ZihiVcYWn YViVWVhZh#>[edhh^WaZ!YdVtail fd[ZVX]YViVWVhZ¼hVaZgiad\#>[ndjVgZjh^c\L^cYdlh!ndj¼aa [^cYi]^gY"eVgin[gZZiddahi]Vil^aaaZindjYdi]^h^[ndjlVci#=ZgZ¼hVcZmVbeaZdci]Zeg^bVgn YViVWVhZhnhiZb/ [Matrix] cd $ORACLE_BASE/diag/rdbms [Matrix] tail -f ./matrix/Matrix/trace/alert_Matrix.log Mon Jan 19 13:20:37 2009 Thread 1 cannot allocate new log, sequence 334 Private strand flush not complete Current log# 3 seq# 333 mem# 0: +DATA/matrix/onlinelog/group_3.297.671727289 Current log# 3 seq# 333 mem# 1: +FLASH/matrix/onlinelog/group_3.256.671727297 LGWR: Standby redo logfile selected to archive thread 1 sequence 334 LGWR: Standby redo logfile selected for thread 1 sequence 334 for destination LOG_ARCHIVE_DEST_2 Thread 1 advanced to log sequence 334 Current log# 1 seq# 334 mem# 0: +DATA/matrix/onlinelog/group_1.300.671727255
8]VeiZg-/ Hl^iX]dkZgVcY;V^adkZg
315
Current log# 1 seq# 334 mem# 1: +FLASH/matrix/onlinelog/group_1.266.671727263
6cY]ZgZ¼hi]ZXdggZhedcY^c\iVg\ZihiVcYWnVaZgiad\/ [Matrix] cd $ORACLE_BASE/diag/rdbms [Matrix] tail -f ./matrix_dr0/Matrix_DR0/trace/alert_Matrix_DR0.log Mon Jan 19 16:19:49 2009 Primary database is in MAXIMUM AVAILABILITY mode Standby controlfile consistent with primary kcrrvslf: active RFS archival for log 6 thread 1 sequence 333 RFS[8]: Successfully opened standby log 5: '+DATA/matrix_dr0/onlinelog/group_5.258.671757777' Mon Jan 19 16:19:51 2009 Media Recovery Waiting for thread 1 sequence 334 (in transit) Recovery of Online Redo Log: Thread 1 Group 5 Seq 334 Reading mem 0 Mem# 0: +DATA/matrix_dr0/onlinelog/group_5.258.671757777 Mem# 1: +FLASH/matrix_dr0/onlinelog/group_5.421.671757783
I]ZhZildVaZgiad\hl^aaiZaandjl]Vi^h]VeeZc^c\Yjg^c\i]Zhl^iX]dkZgegdXZhh!VcYndjh]djaY WZbdc^idg^c\i]ZbgZ\VgYaZhhd[l]^X]^ciZg[VXZndjVgZjh^c\idbVcV\Z9ViV ALTER SYSTEM SET LOG_ARCHIVE_TRACE=0;
>cVYY^i^dc!ndjXVcYZ[^cZV;aVh]WVX`9ViVWVhZ\jVgVciZZYgZhidgZed^ci[^ihVnh SESSIONS ACTIVE!i]ZcjhZi]ZWITH SESSIONS SHUTDOWNfjVa^[^Zgdci]Zhl^iX]dkZg XdbbVcY# 8dbeaZiZi]Zhl^iX]dkZgl^i]i]ZALTER DATABASE COMMIT TO PRIMARYXdbbVcY/ SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN; Database altered.
I]^hXdbbVcY[^c^h]Zhjei]ZegdXZhh^c\d[i]Zhl^iX]dkZgWnXaZVg^c\kVg^djhbZbdgn higjXijgZhVhcZZYZYVcYXdckZgi^c\i]ZhiVcYWnXdcigda[^aZidVcdgbVaYViVWVhZXdcigda[^aZ# L]ZcXdbeaZiZ!i]ZhiVcYWnXVcWZdeZcZYVhi]Zeg^bVgn/ Mon Jan 19 21:45:17 2009 ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN
8]VeiZg-/ Hl^iX]dkZgVcY;V^adkZg
319
Stopping the MRP I]ZBGEegdXZhhbjhiXdbeaZiZVeean^c\i]Z:DGgZYdVcYi]ZcZm^i#>cDgVXaZ&%g,^[ndj jhZYi]ZTHROUGH ALL SWITCHOVERhiVgijefjVa^[^Zgidi]ZMANAGED RECOVERYXdbbVcY! ndj]VYidhidei]ZBGEbVcjVaanWZ[dgZi]Zhl^iX]dkZgXdbbVcYXdjaYXdbeaZiZdci]Z hiVcYWn0di]Zgl^hZ^ildjaY[V^a#>cDgVXaZ9ViVWVhZ&&g,i]Zhl^iX]dkZgXdbbVcYl^aahide i]ZBGEdcXZi]ZgZ^hcdbdgZgZYdidVeean#I]ZTHROUGH ALL SWITCHOVERfjVa^[^Zg]Vh WZZcYZegZXViZYh^cXZDgVXaZ9ViVWVhZ&%gGZaZVhZ'#
ALTER DATABASE SWITCHOVER TO PRIMARY (Matrix_DR0) Backup controlfile written to trace file /Matrix_DR0_ora_20944.trc SwitchOver after complete recovery through change 7591537 Online log +DATA/matrix_dr0/onlinelog/group_1.259.671758349: Thread 1 Group 1 was previously cleared Online log +DATA/matrix_dr0/onlinelog/group_2.272.671758359: Thread 1 Group 2 was previously cleared Online log +DATA/matrix_dr0/onlinelog/group_3.274.671758367: Thread 1 Group 3 was previously cleared Standby became primary SCN: 7591535 Converting standby mount to primary mount. Switchover: Complete - Database mounted as primary (Matrix_DR0) Completed: ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN
>[ndjjhZYi]ZTHROUGH ALL SWITCHOVERhiVgijefjVa^[^Zg[dgi]ZBGE!i]Zhl^iX]dkZg XdbbVcYl^aahiVaa[dgVbVm^bjbd[&*b^cjiZh[dgi]ZBGEidhide#Ndjl^aahZZi]Za^cZ Media Recovery Continuing^ci]ZVaZgiad\/ Mon Jan 19 21:12:07 2009 Media Recovery Log +FLASH/matrix_dr0/archivelog/2009_01_19/thread_1_seq_337.350.676588325 Identified End-Of-Redo for thread 1 sequence 337 Resetting standby activation ID 2212007183 (0x83d88d0f) Media Recovery End-Of-Redo indicator encountered M a R co r Co Resetting standby activation ID 2212007183 (0x83d88d0f) Media Recovery Waiting for thread 1 sequence 338
I]^hbZVchi]Vii]ZBGE]VhWZZcidaYid^\cdgZi]Zhl^iX]dkZgndjjhZYi]ZTHROUGH ALL SWITCHOVERXaVjhZidhiVgibVcV\ZYgZXdkZgn#>[ndjZcXdjciZgi]^hh^ijVi^dc!i]Zhl^iX]dkZg l^aaXVcXZai]ZBGEVjidbVi^XVaandcXZ^i]VhVeea^ZYi]Z:DG/ Mon Jan 19 21:12:27 2009 alter database commit to switchover to primary with session shutdown ALTER DATABASE SWITCHOVER TO PRIMARY (Matrix_DR0) Maximum wait for role transition is 15 minutes. Mon Jan 19 21:12:57 2009
320
DgVXaZ9ViV[COMPATIBILITY^hcdihZiid&%#'#%#'dgndjVgZjh^c\Veg^dgkZgh^dcd[DgVXaZ!i]Zc cdidcanYdndjcZZYidh]jiYdlci]ZVjm^a^Vgn^chiVcXZh!WjindjbjhiY^hVWaZi]Z^gi]gZVYhdc Wdi]i]Zeg^bVgnYViVWVhZVcYi]ZiVg\Ziad\^XVahiVcYWnYViVWVhZ#DcXZi]Zhl^iX]dkZg^h XdbeaZiZ!ndjXVcgZ"ZcVWaZi]Zi]gZVYhVcYgZhiVgii]Z^chiVcXZh#
8]VeiZg-/ Hl^iX]dkZgVcY;V^adkZg
321
NOTE As of Oracle Database 11\, you no longer need to shut down any database instance (primary or logical standby) when you perform a switchover between your primary and a logical standby database. 6hl^i]Ve]nh^XVahiVcYWn!ndjXVcX]ZX`i]ZSWITCHOVER_STATUSXdajbcd[V$DATABASE idbV`ZhjgZi]Vii]Zeg^bVgn^h^cVhiViZidXdch^YZgVhl^iX]dkZg/ SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE; SWITCHOVER_STATUS ----------------TO STANDBY
7jiWZ[dgZndjXVcXdbbZcXZi]Zhl^iX]dkZg!ndjbjhi[^ghiegZeVgZi]ZildYViVWVhZh[dgi]Z deZgVi^dc#Jca^`ZVe]nh^XVahiVcYWn!l]^X]^hVcZmVXiXdend[i]Zeg^bVgn!Vad\^XVahiVcYWn XdjaYWZY^[[ZgZci!VcYdcXZi]ZgdaZh]VkZgZkZghZY!i]ZcZlad\^XVahiVcYWnYViVWVhZcZZYhid `cdll]Vii]ZcZleg^bVgnadd`ha^`ZhdHFA6eeanXVcegdXZhhi]ZgZYdhigZVb#IdhiVgii]Z egZeVgVi^dc!ndjZmZXjiZi]Z[daadl^c\hiViZbZcidci]ZXjggZcieg^bVgnYViVWVhZ/ ALTER DATABASE PREPARE TO SWITCHOVER TO LOGICAL STANDBY
I]^hiZaahi]Zeg^bVgni]ViVgdaZigVch^i^d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i^dcVgn^hWj^aiVcYhZci!^il^aah]dlPREPARING SWITCHOVERVcYndjXVc Xdci^cjZ#NdjXVcX]ZX`i]^hWnadd`^c\Vii]Zhl^iX]dkZghiVijhV\V^c#Cdl^il^aahVnTO LOGICAL STANDBY^chiZVYd[TO STANDBYVh^i]VhgZXZ^kZYVcYegdXZhhZYi]ZcZlY^Xi^dcVgn VcY`cdlhl]d^h\d^c\idWZi]ZWdhh/ SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE; SWITCHOVER_STATUS ----------------TO LOGICAL STANDBY
322
DgVXaZ9ViV ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY; Database altered.
8]VeiZg-/ Hl^iX]dkZgVcY;V^adkZg
323
NOTE Notice that we did not use the E on either of the two switchover commands in this case. This is because there is no need to knock users off to do the switchover with a logical standby. H^cXZi]ZgZlVhcdcZZYidh]jiYdlcVcnG68^chiVcXZh!ZkZgni]^c\dcWdi]h^YZh^hjeVcY gjcc^c\!VcYi]Zdcani]^c\aZ[iidYd^hidhiVgijeHFA6eeandci]ZcZlad\^XVahiVcYWn/ SQL> ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
6cnjhZg"VYYZYdW_ZXihidi]Zdg^\^cVaad\^XVahiVcYWncdli]Zeg^bVgnldjaYd[XdjghZcdi Zm^hi^ci]ZcZlad\^XVahiVcYWn!VcYi]Z^ggZYdldjaYWZh`^eeZYjci^andjXgZViZYVcY ^chiVci^ViZYi]ZbV\V^c^cndjgcZlad\^XVahiVcYWn# I]Vi^h^i6hl^i]e]nh^XVahiVcYWnhl^iX]dkZg!ndjgXa^Zcihl^iX]dkZgl^aadXXjgWVhZYdc ndjghZgk^XZgZadXVi^dchigViZ\n#
Using the Broker or Grid Control to Switchover LZlZcii]gdj\]i]ZEdlZgJhZgBZi]dY[^ghi^ci]^hX]VeiZghdi]VindjjcYZghiVcY9ViVci]ZcdgbVahZfjZcXZd[ZkZcih!i]ZBGEl^aacZZYi]ZgZYd i]Vi^hXdciV^cZY^chZfjZcXZcjbWZg(,,!WZXVjhZi]Vi^hl]ZgZlZlZgZdci]Zdg^\^cVaeg^bVgn l]Zci]Z[V^ajgZ]VeeZcZY#GZbZbWZgi]Vi!jca^`ZVhl^iX]dkZg!l]^X][dgXZhVad\hl^iX] [daadlZYWni]Z:DG^ci]Z]ZVYZgd[i]ZcZmiad\!i]ZFINISHXdbbVcYejihi]Z:DG^cidi]Z ]ZVYZgd[i]ZXjggZciad\[^aZ#I]^hWg^c\hjhWVX`idi]ZhjW_ZXid[THROUGH ALL SWITCHOVER# >[lZ]VYheZX^[^ZYi]^hYZegZXViZYfjVa^[^Zgl]ZclZhiVgiZYi]ZBGE!i]Zci]^h:DGldjaYWZ ^\cdgZYVcYi]ZVeeanldjaYXdci^cjZ#H^cXZlZY^YcdijhZ^ii]^hi^bZ!i]ZBGEhideeZY#7ji i]^hVahdidaYjhi]Vi^i`cdlhi]ZgZ^hbdgZgZYdWZndcYi]Z:DGVgX]^kZad\/ Media Recovery Log +FLASH/matrix/archivelog/2009_01_20/thread_1_seq_377.370.676680217 Identified End-Of-Redo for thread 1 sequence 377 Resetting standby activation ID 2216964717 (0x8424326d) Media Recovery End-Of-Redo indicator encountered Media Recovery Applied until change 7658944 MRP0: Media Recovery Complete: End-Of-REDO (Matrix) M a R co r arc o c o E O REDO MRP0: Background Media Recovery process shutdown (Matrix)
6aalZ]VkZidYd^hgZhiVgii]ZBGEdcXZV\V^c!VcY^il^aaXdci^cjZdcjci^a^hhZZhVcdi]Zg :DG^ci]Z^cXdb^c\gZYdVihdbZed^ci^ci]Z[jijgZ#6cdi]Zg^ciZgZhi^c\ed^ci^hi]ViV[V^adkZg ^c&&gl^aaVahdgZhZii]ZhZfjZcXZcjbWZgh[dgi]Zi]gZVYhiddcZbjX]a^`ZVcdeZcgZhZiad\h# >cDgVXaZ.i, i]^hldjaY]VkZYZhigdnZYdjghiVcYWnYViVWVhZ!WjicdiVcnbdgZ#H^cXZ&%g,9ViV SELECT merge_change# AS FLASHBACK_SCN, processed_change# AS RECOVERY_SCN FROM DBA_LOGSTDBY_HISTORY WHERE stream_sequence# = (SELECT MAX(stream_sequence#)-1 FROM DBA_LOGSTDBY_HISTORY); FLASHBACK_SCN RECOVERY_SCN ------------- -----------2
332
DgVXaZ9ViV STARTUP MOUNT ORACLE instance started. Database mounted. SQL> FLASHBACK DATABASE TO SCN 2; Flashback complete. SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY; Database altered. SQL> SHUTDOWN IMMEDIATE ORA-01507: database not mounted ORACLE instance shut down. SQL> STARTUP MOUNT ORACLE instance started. Database mounted.
I]^h^hcdiVe]nh^XVahiVcYWnYViVWVhZ^ci]ZcdgbVahZchZ0^i^hVe]nh^XVahiVcYWnYViVWVhZ VaaWn^ihZa[!h^cXZ^i]Vhcdeg^bVgn#I]ZcZleg^bVgn]VhVY^[[ZgZciDBIDVcYDB_NAME!VcYi]^h e]nh^XVahiVcYWnl^aacZ^i]ZggZXZ^kZcdgVeeani]ZgZYd[gdbi]Zeg^bVgn!l]^X]ldjaYcdi]Zae VcnlVnh^cXZlZVgZhi^aab^hh^c\i]ZgZYd[gdbi]Z[aVh]WVX`i^bZidi]Z[V^adkZgi^bZ#HdlZ ]VkZid[^\jgZdjil]ViVgX]^kZad\hlZcZZY[gdbi]Zad\^XVahiVcYWnbZiVYViVVcY]VcY"[ZZY i]ZbidBGE#7VX`idi]ZcZleg^bVgn¸VcY!jh^c\i]ZildH8ChndjdWiV^cZY!ZmZXjiZi]^h XdbbVcY/ SQL> SELECT file_name FROM DBA_LOGSTDBY_LOG WHERE first_change# = recovery_scn AND next_change# > flashback_scn; NAME ----------------------------------------------------------------------+FLASH/matrix/archivelog/2009_01_20/thread_1_seq_376.370.676680217 +FLASH/matrix/archivelog/2009_01_20/thread_1_seq_377.372.676680255
I]^hl^aa\^kZndjVh]dgia^hid[VgX]^kZad\hi]VindjcZZYidXVggnWVX`idi]ZdaYeg^bVgn VcYbV`Zi]Zb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ER DATABASE OPEN; Database altered.
Ndjg[V^aZYeg^bVgnYViVWVhZ^hcdlgZVYnidVhhjbZ^ihgdaZVhi]ZcZlad\^XVahiVcYWn YViVWVhZ#7jiWZ[dgZ^iXVcYdi]^h!^icZZYhid`cdll]Vii]ZcZleg^bVgnadd`ha^`Zhd^iXVc egdXZhhi]ZgZYd¸i]Vi^h!^icZZYhi]ZAd\B^cZgY^Xi^dcVgn#7ji!jca^`Zi]ZegdXZYjgZ^c8]VeiZg 'l]ZgZndjY^Yi]ZWj^aYdci]Zeg^bVgnVcYjhZYi]ZBGEidgZXdkZgjeidi]ZWj^aYVcYi]Zc aZiHFA6eeaniV`ZdkZg!ndjVgZVagZVYneVhii]Vied^ci#HdndjcZZYidiZaandjgcZlad\^XVa hiVcYWnidVh`i]Zeg^bVgnYViVWVhZ[dgVcZlXdend[i]ZY^Xi^dcVgnVcYVaai]ZgZYd^cWZilZZc# IdYdi]^h!ndjjhZVcVYY^i^dcVafjVa^[^Zgdci]ZAd\^XVaHiVcYWnEgdXZhhAHEXdbbVcYXVaaZY NEW PRIMARY!l]^X]^chigjXihHFA6eeanid\Zii]ZY^Xi^dcVgndkZgVYViVWVhZa^c`i]Vindj egdk^YZ/ SQL> CREATE PUBLIC DATABASE LINK r a o ca CONNECT TO system IDENTIFIED BY password USING 'service_name_of_new_primary_database'; SQL> ALTER DATABASE START LOGICAL STANDBY APPLY NEW PRIMARY r a o ca Database altered.
HFA6eeanl^aaXdccZXiidi]ZcZleg^bVgnjh^c\i]ZYViVWVhZa^c`VcYgZig^ZkZi]ZAd\B^cZg Y^Xi^dcVgn#DcXZi]ZY^Xi^dcVgn]VhWZZcWj^ai!HFA6eeanl^aaVeeanVaai]ZgZYdhZci[gdbi]Z cZleg^bVgnVcY\Zi^ihZa[hncX]gdc^oZY# NOTE One thing to remember is that SQL Apply will apply redo only for objects that existed in the old primary database before the failover. As with switchover, any user-added objects to the original logical standby (now the primary) would of course not exist and their redo would be skipped until you created and instantiated them again in your new log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g#NdjXVc ^chigjXii]Z7gd`ZgcdiidgZ^chiViZi]Z[V^aZYeg^bVgnVjidbVi^XVaanWnhZii^c\i]ZegdeZgin FastStartFailoverAutoReinstateidFALSE#=dlZkZg!_jhia^`Zi]Zeg^bVgnh]jiYdlc egdeZgin!i]^hegdeZgin^h^\cdgZY^[i]ZgZVhdc[dgi]Z[V^adkZglVhYjZidVjhZg"YZ[^cZYZkZci dgVYViV[^aZd[[a^cZZggdg#I]Z7gd`Zgl^aacZkZgignVcVjidbVi^XgZ^chiViZbZci^ci]ZhZXVhZh! VcYndjbjhigZbZYni]ZegdWaZbVcYeZg[dgbVbVcjVagZ^chiViZjh^c\i]Z9 ENABLE FAST_START FAILOVER; Enabled. DGMGRL> SHOW FAST_START FAILOVER; Fast-Start Failover: ENABLED Threshold: 45 seconds Target: matrix_dr0 Observer: (none) Lag Limit: 60 seconds (not in use) Shutdown Primary: TRUE Auto-reinstate: TRUE Configurable Failover Conditions
342
DgVXaZ9ViV
YES YES NO NO YES
CdlndjXVchZZZmVXianl]Vindj]VkZXdc[^\jgZY#I]Zdcani]^c\aZ[iidYd^hidhiVgii]Z DWhZgkZgdc^ihhnhiZb#L]Zci]ZDWhZgkZghiVgih!^il^aadeZcV[^aZXVaaZY;H;D#YVi^ci]Z XjggZciY^gZXidgnWnYZ[Vjai!l]ZgZ^il^aahidgZ^ihXdc[^\jgVi^dc^c[dgbVi^dcVWdjii]Z;H;DhZije ^i^hXdcigdaa^c\#H^cXZ^i^hedhh^WaZid]VkZbdgZi]VcdcZDWhZgkZgdci]ZhVbZhnhiZb Xdcigdaa^c\bjai^eaZ;H;DXdc[^\jgVi^dch!^i^hV\ddY^YZVidfjVa^[nl]ZgZi]^h[^aZh]djaY\dVcY l]VicVbZ^ih]djaYjhZ#I]^h^hhdi]Zbjai^eaZDWhZgkZghYdcdi\Zi^cidV[^\]iVWdjil]ddlch ;H;D#YViVcYi]ZgZ^hcdX]VcXZi]ViVcDWhZgkZgb^\]i\Zii]Zlgdc\Xdc[^\jgVi^dc[^aZ#I]^h^h YdcZWneaVX^c\i]ZFILEfjVa^[^Zgdcidi]ZSTARTXdbbVcY/ [Matrix] dgmgrl sys/oracle@matrix_dr0 DGMGRL for Linux: Version 11.1.0.6.0 – Production Copyright (c) 2000, 2005, Oracle. All rights reserved. Welcome to DGMGRL, type "help" for information. Connected. DGMGRL> START OBSERVER FILE o r a Ma r a ; Observer started
I]ZDWhZgkZgl^aahiVn^ci]^hl^cYdljci^andjhide^i[gdbVcdi]Zg9[ndjYdcdijhZ^i!i]ZBGEl^aahidel]ZcZkZg^i[^cYhVc:DG^ci]ZgZYd#I]Z fjVa^[^ZglVheg^bVg^anYZh^\cZY[dgjhZl^i]di]ZghiVcYWnYViVWVhZhhdi]Vil]ZcndjeZg[dgbZY Vhl^iX]dkZgdgV[V^adkZgidndjgiVg\Zie]nh^XVahiVcYWnYViVWVhZi]dhZdi]Zge]nh^XVahiVcYWn YViVWVhZhldjaY`ZZeg^\]idcVeean^c\# I]ZegdWaZblVh!l]Zc^ilVhjhZYdci]ZiVg\Zid[Ve]nh^XVahiVcYWnhl^iX]dkZg^c&%g,i]Z COMMIT TO SWITCHOVER TO PRIMARYXdbbVcYldjaY]Vc\VcYjai^bViZan[V^a!Xdc[jh^c\ ZkZgnWdYnVcYXVjh^c\eVc^X#Ndj]VYidgZbZbWZgidXVcXZa^ibVcjVaanWZ[dgZndjhiVgiZYi]Z hl^iX]dkZgdci]Ze]nh^XVahiVcYWnhdi]ZXdbbVcYldjaYldg`XdggZXian#I]ViegdWaZb]Vh WZZcXdggZXiZY^c&&g,l]ZgZi]Zhl^iX]dkZgXdbbVcY!VhlZ]VkZh]dlc!l^aahidei]ZBGE^[ gZfj^gZYVcY[^c^h]i]Zhl^iX]dkZg# 8dc[jh^dc]VhVahdVg^hZc[gdbi]Z[VXii]Vii]Z7gd`ZgXdci^cjZhidjhZi]ZfjVa^[^Zgi]gdj\]dji &%gGZaZVhZ'VcY&&g.7jii]Z7g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ECOVER MANAGED STANDBY DATABASE CANCEL;
2.
DeZci]ZYViVWVhZ[dggZVY"dcanVXXZhh/ SQL> ALTER DATABASE OPEN;
N IdgZijgci]ZYViVWVhZ[gdbgZVY"dcanidVeean^c\gZYd!gZhiVgii]ZhiVcYWnYViVWVhZ^c i]ZBDJCIbdYZVcYjhZi]^hXdbbVcY/ SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE 2> DISCONNECT FROM SESSION;
8]VeiZg./ 6Xi^kZ9ViV[ndjlVciidZcVWaZgZVa"i^bZVeeand[gZYd!jhZi]^h/ SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE 2> USING CURRENT LOGFILE DISCONNECT;
>cgZk^Zl!i]ZgZ^hcdgZVaY^[[ZgZcXZWZilZZci]Z^beaZbZciVi^dcd[Ve]nh^XVahiVcYWni]Vi ]VhWZZcdeZcZYgZVY"dcan^cDgVXaZ9ViVWVhZ&%gdgDgVXaZ9ViVWVhZ&&g^cVWVh^XgZVY"dcan Xdc[^\jgVi^dc#I]Zbdhi^bedgiVciXdcXZeiidgZbZbWZg^hi]VicdgZYdl^aaWZVeea^ZYidi]Z e]nh^XVahiVcYWnl]^aZi]Z^chiVcXZ^hdeZc^cgZVY"dcanbdYZ!VcYVaaVXXjbjaViZYgZYdhidgZY ^ci]ZVgX]^kZad\hdci]ZhiVcYWnhZgkZgl^aa]VkZidWZVeea^ZYidi]ZhiVcYWnYViVWVhZWZ[dgZ^i XVcVhhjbZi]ZgdaZd[i]Zeg^bVgn^chiVcXZYjg^c\V[V^adkZgdghl^iX]dkZgZkZci#
Snapshot Standby for QA and Test Environments L]ViY^[[ZgZci^ViZhVhcVeh]dihiVcYWn[gdbi]Ze]nh^XVahiVcYWn^cgZVY"dcanbdYZ4I]ZVchlZg ^hh^beaZ/i]Ze]nh^XVahiVcYWnWZXdbZh[jaanjeYViVWaZ#DgVXaZ^cigdYjXZYVil^hi^cDgVXaZ 9ViVWVhZ&%g9ViVcDgVXaZ9ViVWVhZ&&g,i]dj\]!gZYdXdci^cjZhidh]^e[gdbi]Zeg^bVgnidi]ZhcVeh]di hiVcYWn!WjicdgZYd^hVeea^ZYVcYndjggZXdkZgni^bZdW_ZXi^kZGIDl^aaWZadc\Zg^[ndj]VkZ id[V^adkZgYjg^c\i]ZhcVeh]dieZg^dY#
Read-Write Standby in Oracle Database 10g IdXgZViZVe]nh^XVahiVcYWnVcYdeZc^iVhVgZVY"lg^iZXadcZd[i]Zeg^bVgnYViVWVhZ!ndj¼aa cZZYideZg[dgbi]Z[daadl^c\hiZeh/ 1. EgZeVgZi]Ze]nh^XVahiVcYWnidZcVWaZV\jVgVciZZYgZhidgZed^ci#7ZXVjhZ;aVh]WVX` 9ViVWVhZgZfj^gZhi]Vii]Z[aVh]WVX`ad\hgZh^YZ^ci]Z[aVh]gZXdkZgnVgZV;G6lZcZZY idhZijeV[aVh]gZXdkZgnVgZ^[lZYdcdi]VkZdcZ/ SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=20G; SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='+FLASH';
NOTE Although we have set up our flash recovery area in Automatic Storage Management (ASM), you can also set up your flashback recovery area in a normal disk directory. In that case, you would use something like ER _F LE_ EST ' rc or d t ' this: _RE
354
DgVXaZ9ViV ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; SQL> CREATE RESTORE POINT before_open_standby GUARANTEE FLASHBACK DATABASE;
8gZVi^c\VcZVhn"id"gZbZbWZgcVbZhjX]Vhbefore_open_standbyVjidbVi^XVaan VhhdX^ViZh^il^i]VcH8Cdgi^bZhiVbe#L]ZcndjaViZgcZZYid[aVh]WVX`i]ZYViVWVhZ idgZhidgZ^iidVegZk^djhed^ci^ci^bZVheVgid[hncX]gdc^o^c\^il^i]i]Zeg^bVgn YViVWVhZVcYgZhiVgi^c\i]ZgZYdVeean!]Vk^c\Vh^beaZcVbZidgZ[ZgZcXZYjg^c\i]Z [aVh]WVX`egdXZhhb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i]Z [daadl^c\hiZe/ SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
=dlZkZg!^[i]ZVXi^kViZYe]nh^XVahiVcYWn]Vh[VaaZchj[[^X^ZcianWZ]^cYi]Zeg^bVgnYViVWVhZ! h^beanVaadl^c\\VegZhdaji^dciddXXjg^hcdiVk^VWaZVaiZgcVi^kZ#>ildjaYgZhjai^ciddbVcn VgX]^kZad\hWZ^c\gZfjZhiZY[dg\VegZhdaji^dc#>iXdjaYVahdWZi]ViVaad[i]ZcZXZhhVgnVgX]^kZ ad\hVgZcdiVkV^aVWaZdcY^h`VcnbdgZVii]Zeg^bVgnYViVWVhZ#>ci]^hhXZcVg^d!^iWZXdbZh cZXZhhVgnidiV`ZVc^cXgZbZciVaWVX`jed[i]Zeg^bVgnYViVWVhZVcYVeeani]Viidi]Ze]nh^XVa hiVcYWnYViVWVhZjh^c\GB6CidgZhncX]gdc^oZi]ZhiVcYWnYViVWVhZl^i]i]Zeg^bVgn# NOTE This procedure can also be used if the apply process was unable to resolve an archive log gap due to corruption of the archive log or a large gap in the redo between the primary and the standby. If this is the case, make sure that Redo Apply has been stopped first by executing the ALTER ATA ASE RE ER A A E STA ATA ASE A EL; command. IdXdbeaZiZi]^hegdXZYjgZ!jhZi]Z[daadl^c\hiZeh/ 1. >YZci^[ni]ZXjggZciH8Cdci]Ze]nh^XVahiVcYWnYViVWVhZWZ[dgZhiVgi^c\i]Z^cXgZbZciVa WVX`je!Vhi]ZWVX`jebjhiWZXgZViZY[gdbi]^hH8C[dglVgY#Dci]Ze]nh^XVahiVcYWn YViVWVhZ!ZmZXjiZi]Z[daadl^c\XdbbVcY/ SQL>SELECT CURRENT_SCN FROM V$DATABASE;
2. GZXdgYi]ZH8CgZijgcZY[dgi]ZcZmihiZe#
356
DgVXaZ9ViV BACKUP INCREMENTAL FROM SCN DATABASE FORMAT '/tmp/ForStandby_%U' tag 'FORSTDBYSYNCH';
CdiZi]Vi^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ZXViVad\ZY^cXgZbZciVaWVX`jee^ZXZh#=ZgZ¼h]dlideZg[dgbi]ZhZhiZeh[gdbi]Z e]nh^XVahiVcYWnYViVWVhZ/ $rman target / RMAN> CATALOG START WITH '/tmp/FORSTDBYSYNCH'; RMAN> RECOVER DATABASE NOREDO;
6. 7Z[dgZi]Ze]nh^XVahiVcYWnYViVWVhZXVcWngZijgcZYid^ihdg^\^cVahiViZ!V[ZlbdgZ hiZehgZbV^c#NdjbjhiXgZViZVhiVcYWnXdcigda[^aZWVX`jedci]Zeg^bVgnYViVWVhZVcY gZhidgZ^idci]Ze]nh^XVahiVcYWnYViVWVhZ#8dccZXiidi]ZEg^bVgnYViVWVhZVcYZmZXjiZ i]ZhZXdbbVcYh RMAN> BACKUP CURRENT CONTROLFILE FOR STANDBY FORMAT '/tmp/FORSTDBYCTRL.bak'; $scp /tmp/FORSTDBYCTRL.bak MATRIX_DR0:/tmp
7. 7VX`dci]Ze]nh^XVahiVcYWnYViVWVhZ!Ydi]^h/ RMAN> SHUTDOWN; RMAN> STARTUP MOUNT;
8. >[i]Zeg^bVgnVcYhiVcYWnYViV[^aZY^gZXidg^ZhVgZcdi^YZci^XVa!ndjcZZYidXdbeaZiZi]^h ^ciZgbZY^ViZhiZeVcYdci]Ze]nh^XVahiVcYWnYViVWVhZ!XdccZXiidGB6CVcYXViVad\ i]ZhiVcYWnYViV[^aZh!VcYhl^iX]i]ZYViVWVhZidjhZi]Z_jhi"XViVad\ZYYViV[^aZh/ RMAN> CATALOG START WITH '+DATA/MATRIX_DR0/DATAFILE/'; RMAN> SWITCH DATABASE TO COPY;
9. I]ZhVbZh^ijVi^dcZm^hihl^i]i]ZgZYdad\Y^gZXidg^Zhi]ViZm^hiZYl^i]i]ZYViV[^aZ Y^gZXidg^Zh#6\V^c!i]^h^hVc^ciZgbZY^ViZhiZe!VcY^[i]ZY^gZXidg^ZhVgZi]ZhVbZ!^i XVcWZh`^eeZY#Di]Zgl^hZ!jhZasmcmd^[^i^hVc6HB"bVcV\ZYYViVWVhZ!dgjhZVc DHji^a^inidgZbdkZVaadca^cZVcYhiVcYWngZYdad\h[gdbi]ZhiVcYWnY^gZXidg^Zh#
8]VeiZg./ 6Xi^kZ9ViVcVYY^i^dc!bV`ZhjgZi]Vii]ZLOG_FILE_NAME_CONVERTeVgVbZiZg]VhWZZchZiid XdckZgii]ZY^gZXidgneVi]h[gdbBVig^midBVig^mT9G%#6hVcZmVbeaZ!ndjldjaY ^cXajYZi]Z[daadl^c\^cndjgeVgVbZiZg[^aZ/ LOG_FILE_NAME_CONVERT='/MATRIX/','MATRIX_DR0/'.
10. NdjVahdcZZYidXaZVgVaad[i]ZgZYdad\\gdjehdci]ZhiVcYWn/ SQL> ALTER DATABASE CLEAR LOGFILE GROUP1; SQL> ALTER DATABASE CLEAR LOGFILE GROUP2;
11. L]Zcndj]VkZhjXXZhh[jaanXaZVgZYVaahiVcYWngZYdad\\gdjeh!gZ"ZcVWaZ;aVh]WVX` 9ViVWVhZdci]Ze]nh^XVahiVcYWnYViVWVhZ/ SQL> ALTER DATABASE FLASHBACK OFF; SQL> ALTER DATABASE FLASHBACK ON;
12. ;^cVaan!hi^aadci]Ze]nh^XVahiVcYWn!gZhiVgii]ZbVcV\ZYgZXdkZgnegdXZhh/ SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
Hdl]n!ndjb^\]iVh`!]VkZlZiV`Zcndji]gdj\]i]^heV^c[jaVcYaZc\i]negdXZhhidgZijgc Ve]nh^XVahiVcYWnid^ihdg^\^cVahiViZ^cbVcV\ZYgZXdkZgn46hlVhVaajYZYidZVga^Zg!^cDgVXaZ 9ViVWVhZ&%g9ViVcDgVXaZ9ViVWVhZ&&g9ViVci]ZaVg\ZghX]ZbZd[i]^c\h!]dlYdZhi]ZDgVXaZ9ViVWVhZ&&ghcVeh]dihiVcYWnYViVWVhZ Y^[[Zg[gdbi]ZDgVXaZ9ViVWVhZ&%g¹deZcgZVY"lg^iZhiVcYWnºlZY^hXjhhZY[dgF6VcYiZhi4 DeZgVi^dcVaan!i]ZgZVgZcdY^[[ZgZcXZh!VhWdi]VgZgZVY"lg^iZVcYVgZ[jaanjeYViVWaZl]^aZi]Zn VgZdeZc# L]Vindjl^aa[^cY!i]dj\]!^hi]Vii]ZegdXZhhd[bdk^c\i]ZYViVWVhZid[jaanjeYViVWaZVcY WVX`V\V^ciV`Zh[ZlZghiZeh!^hh^beaZg!VcY!bdhi^bedgiVci!]VhVh^\c^[^XVcianadlZgYZ\gZZd[ g^h`idi]Ze]nh^XVahiVcYWnYViVWVhZVcYidi]ZegdiZXi^dcd[ndjgeg^bVgnYViVWVhZi]Vci]Z egZk^djhkZgh^dc#HZii^c\jei]ZhcVeh]dihiVcYWnXVcWZVXXdbea^h]ZY^cVcjbWZgd[lVnh! ^cXajY^c\i]Z9ViV!:ciZgeg^hZBVcV\Zg&%#'#%#*!dgi]gdj\]HFAEajh#I]Z 9ViV SHUTDOWN IMMEDIATE Database closed. Database dismounted. ORACLE instance shut down.
8]VeiZg./ 6Xi^kZ9ViVSTARTUP MOUNT ORACLE instance started. Total System Global Area Fixed Si e Variable Si e Database Buffers Redo Buffers Database mounted.
422670336 1300352 276826240 138412032 6131712
359
bytes bytes bytes bytes bytes
3. DcXZWVX`^ci]ZBDJCIhiViZ!ZcVWaZ;aVh]WVX`9ViVWVhZ/ SQL> ALTER DATABASE FLASHBACK ON; Database altered.
4. Cdli]Vi;aVh]WVX`9ViVWVhZ^hZcVWaZY!ndjXVcV\V^cZcVWaZi]ZVeea^XVi^dcd[gZYd idi]Ze]nh^XVahiVcYWnYViVWVhZ^cegZeVgVi^dc[dgXdckZgi^c\^iid[jaanjeYViVWaZ#H^cXZ ndjVgZjh^c\i]Z7gd`Zg!jhZ9 EDIT DATABASE 'MATRIX_DR0'SET STATE='APPLY-ON'; Succeeded.
5. NdjVgZcdlgZVYnidYdi]ZVXijVaXdckZgh^dcidVhcVeh]dihiVcYWn#6aandj]VkZidYd ^hZciZgi]Z[daadl^c\XdbbVcYid9 SHOW CONFIGURATION Configuration Name: DGConfig1 Enabled: YES Protection Mode: MaxPerformance Databases: MATRIX - Primary database MATRIX_DR0 - Snapshot standby database Fast-Start Failover: DISABLED Current status for "DGConfig1": SUCCESS DGMGRL>
7. NdjcZZYidYdhdbZbdgZkZg^[^XVi^dc¸^ci]^hXVhZidVhhjgZndjghZa[i]VigZYd^h VXijVaanWZ^c\hZciidi]ZhiVcYWn[gdbi]Zeg^bVgnYViVWVhZ#NdjXVcVXXdbea^h]i]^hWn fjZgn^c\V$MANAGED_STANDBYdci]ZhcVeh]dihiVcYWnYViVWVhZVcYcdi^c\i]ZkVajZ ^ci]ZBLOCK#Xdajbc/ SQL> SELECT STATUS, SEQUENCE#, BLOCK# FROM V$MANAGED_STANDBY
360
DgVXaZ9ViV
8. Dci]Zeg^bVgnYViVWVhZ!XdccZXik^VHFAEajhVcY^chZgiVgdl^cidi]Zhr.regions iVWaZVh[daadlh/ SQL> INSERT INTO HR.REGIONS 2 VALUES (1, 'TEXAS'); 1 row created. SQL> COMMIT; Commit complete. SQL>
9. GZX]ZX`V$MANAGED_STANDBYVhndjY^YZVga^Zgdci]ZhcVeh]dihiVcYWnidkZg^[ni]Vi gZYd[gdbi]Zeg^bVgnYViVWVhZ^hWZ^c\Veea^ZY#Ndjh]djaYhZZi]Vii]ZBLOCK#]Vh X]Vc\ZY^ci]ZfjZgngZhjaih/ SQL> SELECT STATUS, SEQUENCE#, BLOCK# 2 FROM V$MANAGED_STANDBY 3 WHERE CLIENT_PROCESS='LGWR'; STATUS SEQUENCE# BLOCK# ---------- ---------- ------IDLE 83 2786 SQL>
10. I]^hh]dlhndji]Vii]ZgZYd^hhi^aaXdb^c\^c[gdbi]Zeg^bVgnYViVWVhZVcYndjVgZhi^aa egdiZXiZY#DcZi]^c\idcdiZ[gdbi]^hh^beaZZmVbeaZ^hi]Vii]Z^chZgiidi]Zeg^bVgn YViVWVhZl^aacdiV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Y idVe]nh^XVahiVcYWncdl#
8]VeiZg./ 6Xi^kZ9ViV CONVERT DATABASE 'MATRIX_DR0' TO PHYSICAL STANDBY; Converting database "MATRIX_DR0" to a Physical Standby database, please wait. Operation requires shutdown of instance "MATRIX_DR0" on database "MATRIX_DR0" Shutting down instance "MATRIX_DR0"… Database closed. Database dismounted. ORACLE instance shut down. Operation requires startup of instance "MATRIX_DR0" on database "MATRIX_DR0" Starting instance "MATRIX_DR0"… ORACLE instance started. Database mounted. Continuing to convert database "MATRIX_DR0"… Operation requires shutdown of instance "MATRIX_DR0" on database "MATRIX_DR0" Shutting down instance "MATRIX_DR0"… ORA-01109: database not open Database dismounted. ORACLE instance shut down. Operation requires startup of instance "MATRIX_DR0" on database "MATRIX_DR0" Starting instance "MATRIX_DR0"… ORACLE instance started. Database mounted. Database "MATRIX_DR0" converted successfully DGMGRL>
2. 7Za^ZkZ^idgcdi!i]Vi^hVabdhiVaai]ZgZ^hidgZijgc^c\i]ZhcVeh]dihiVcYWnidVe]nh^XVa hiVcYWn#NdjV\V^clVciideZg[dgbhdbZkZg^[^XVi^dcVcYkVa^YVi^dcidVhhjgZi]Vi ZkZgni]^c\^hVh^ih]djaYWZ!VcYi]ZaVhihiZe^hidgZijgci]Ze]nh^XVahiVcYWnidbVcV\ZY gZXdkZgnbdYZ!l]^X]ndj¼aaYdg^\]iV[iZgVfj^X`SHOWCONFIGURATION/ DGMGRL> SHOW CONFIGURATION Configuration Name: DGConfig1 Enabled: YES Protection Mode: MaxPerformance Databases: MATRIX - Primary database MATRIX_DR0 ca a a a a Fast-Start Failover: DISABLED Current status for "DGConfig1": SUCCESS DGMGRL>
362
DgVXaZ9ViV[i]Zeg^bVgnYViVWVhZ]Vh cdinZigZXdccZXiZYidi]ZhiVcYWnV[iZgi]ZXdckZgh^dc!ndjXVcXdccZXiVhHNH976idndjg eg^bVgnYViVWVhZVcYhl^iX]ad\[^aZh!Vai]dj\]i]^h^hcdicZXZhhVgn^[ndjVgZgjcc^c\^c BVm^bjb6kV^aVW^ain/ SQL> ALTER SYSTEM SWITCH LOGFILE; System altered. SQL>
I]^hl^aagZXdccZXii]ZAd\Lg^iZgCZildg`HZgk^XZACHegdXZhhid^ihG;HegdXZhhdci]Z hiVcYWn#CdlndjlVciid]VkZVadd`Vil]Vi]VeeZcZYidndjgYViV^ci]ZGZ\^dchiVWaZ!hd WVX`dci]Ze]nh^XVahiVcYWnYViVWVhZ!jhZ9 SHUTDOWN Database closed. Database dismounted. ORACLE instance shut down. SQL> STARTUP MOUNT ORACLE instance started. Total System Global Area 422670336 Fixed Size 1300352 Variable Size 343935104 Database Buffers 71303168 Redo Buffers 6131712 Database mounted. SQL>
bytes bytes bytes bytes bytes
8]VeiZg./ 6Xi^kZ9ViVconnect sys/oracle Connected. DGMGRL> EDIT DATABASE 'MATRIX_DR0'SET STATE='APPLY-ON'; Succeeded. DGMGRL>EXIT [oracle@matrix_dr0 ]
Ndj]VkZild!_jhiild!gZVahiZehi]VindjbjhiXdbeaZiZid\d[gdbi]Ze]nh^XVahiVcYWn YViVWVhZidV[jaanjeYViVWaZhcVeh]dihiVcYWnYViVWVhZVcYgZijgcV\V^cidndjge]nh^XVa hiVcYWnYViVWVhZ/ 1. 8dckZgii]Ze]nh^XVahiVcYWnYViVWVhZidVhcVeh]dihiVcYWnYViVWVhZ# 2. 8dckZgii]ZhcVeh]dihiVcYWnYViVWVhZidVe]nh^XVahiVcYWnYViVWVhZ# L]ZclZadd`WVX`Vii]ZgZfj^gZbZcihidVXXdbea^h]i]ZhVbZ[jaanjeYViVWaZdgdeZc gZVY"lg^iZhiVcYWnYViVWVhZ^cDgVXaZ9ViVWVhZ&%g!i]ZcjbWZgd[hiZeh&*^cidiVa!i]ZaZkZad[ XdbeaZm^in!VcYi]Zdeedgijc^in[dgZggdg^hh^\c^[^XVcian]^\]Zg#I]^hdcZ[ZVijgZZcVWaZhiZhi^c\ VcYF6V\V^chigZVa"ldgaYZck^gdcbZcih^cVcZmigZbZanZ[[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Veh]dihiVcYWn^hh^beanVbViiZgd[Vh^c\aZXdbbVcY/ DGMGRL> CONVERT DATABASE 'MATRIX_DR0' TO PHYSICAL STANDBY;
'
HZZlll#dgVXaZ#Xdb$iZX]cdad\n$egdYjXih$bVcV\ZVW^a^in$YViVWVhZ$eY[$le%,$dleTgZVaTVeea^XVi^dcTiZhi^c\T&&g #eY[
372
DgVXaZ9ViVci]ZZmVbeaZlZh]dlZYZVga^Zg!lZeZg[dgbZYhdbZkZg^[^XVi^dcVcYkVa^YVi^dc!Wji [daadl^c\i]ZZmZXji^dcd[i]^hXdbbVcY!i]ZhcVeh]dihiVcYWnlVhgZijgcZYid^ihdg^\^cVahiViZ VhVe]nh^XVahiVcYWn#DcZi]^c\ndjh]djaY]VkZcdiZY!i]dj\]!^hi]ViYjg^c\i]ZXdckZgh^dc egdXZhh!i]Z^chiVcXZlVhhideeZYVcYgZhiVgiZY#>cdi]ZgldgYh!VYZaVn^beVXihGIDVcYGED# I]^haZVYhjhiddjg[djgi]VcY[^cVaXdc[^\jgVi^dc^ci]^hX]VeiZg!6Xi^kZ9ViV STARTUP
2. HiVgiGZYd6eean# SQL> RECOVER MANAGED STANDBY DATABASE DISCONNECT USING CURRENT LOGFILE;
Jh^c\9ViVcVYY^i^dcidegdk^Y^c\adVYWVaVcX^c\VXgdhhY^[[ZgZciVYYgZhhZhdgcdYZhl^i]Vc ADDRESS_LIST!ndjXVcVahdadVYWVaVcXZXdccZXi^dchVXgdhhDESCRIPTIONSl^i]^cV DESCRIPTION_LIST#8dch^YZgi]Z[daadl^c\ZmVbeaZ/ SALES = (DESCRIPTION = (ADDRESS_LIST = (LOAD_BALANCE= YES
8]VeiZg&%/ 6jidbVi^c\H^iZVcY8a^Zci;V^adkZg (ADDRESS = (PROTOCOL (ADDRESS = (PROTOCOL (ADDRESS_LIST = (LOAD_BALANCE= YES (ADDRESS = (PROTOCOL (ADDRESS = (PROTOCOL (CONNECT_DATA= (SERVICE_NAME=SALES) )
381
= TCP)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dc!lZl^aaY^hXjhh]dlidXdc[^\jgZi]ZY^[[ZgZciI6;dei^dchVcY]dlI6;eaVnhV gdaZ^cVXa^Zci[V^adkZghdaji^dc#>[ndjlVcibdgZ^c[dgbVi^dcdc]dlidlg^iZXVaaWVX`hid[V^adkZg kVg^djhhZhh^dchiViZ^c[dgbVi^dcdgigVchVXi^dchiViZbZcih!Xdchjaii]ZDgVXaZYdXjbZciVi^dc# NOTE Transparent Application Failover is supported for all OCI and JDBC thick clients. Currently JDBC thin clients are not supported for use with TAF.
Configuring TAF I]Z[^ghihiZe^cXdc[^\jg^c\I6;^hid]VkZVegdeZganYZ[^cZYDgVXaZCZiVa^Vh#L]ZcVI6; [V^adkZgWZ\^ch!lZjhZXa^Zci"h^YZadVYWVaVcX^c\VcYXdccZXi"i^bZ[V^adkZgid\dWVX`idi]Z ADDRESS_LISTVcY\gVWV]dhiideZg[dgbi]ZgZXdccZXi#I]^hbZVchi]VilZh]djaYhiVgil^i] VcDgVXaZCZiVa^Vhi]Vi]VhViaZVhiilddgbdgZVYYgZhhZh^cVcADDRESS_LIST#7jiVhl^i] ZkZgngjaZ!i]ZgZ^hVcZmXZei^dc#>i^hedhh^WaZid]VkZVcDgVXaZCZiVa^Vhi]ViXdciV^chVh^c\aZ VYYgZhh^ci]ZADDRESS_LISTVcYjhZi]ZBACKUPViig^WjiZided^ciidVcdi]ZgDgVXaZCZiVa^Vh idjhZ[dgI6;[V^adkZgejgedhZh#L]^aZjh^c\i]ZBACKUPViig^WjiZYdZh]VkZ^iVYkVciV\Zh!^i YdZhcdi]VcYaZVaaXVhZh!hdlZldc¼iY^hXjhh^ihjhV\Z[jgi]Zg#
8]VeiZg&%/ 6jidbVi^c\H^iZVcY8a^Zci;V^adkZg
383
DcXZlZ]VkZVegdeZgan[dgbZYDgVXaZCZiVa^Vh!lZcZZYidYZX^YZ]dllZlVciid Xdc[^\jgZdjgI6;Viig^WjiZh#I6;Viig^WjiZh^cXajYZi]dhZYZhXg^WZY^ci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ONNECT Viig^WjiZXVcheZZYje[V^adkZg!h^cXZ^iYdZhcdi]VkZidXgZViZi]ZhZhh^dcVi[V^adkZgi^bZ!Wji lVhbV^canYZh^\cZY[dgVXi^kZ$eVhh^kZXajhiZgXdc[^\jgVi^dch#>cVYY^i^dc!i]ZDELAYVcY RETRIESViig^WjiZhh]djaYWZhZihdi]ViI6;Xdci^cjZhidgZignadc\Zcdj\][dgV9ViVcdjgZmVbeaZDgVXaZ CZiVa^Vh^ci]ZWZ\^cc^c\d[i]^hhZXi^dc!i]ZXa^Zcil^aaWZXdccZXi^c\idi]ZYViVWVhZjh^c\i]Z hZgk^XZSALES#I]^h^hVYViVWVhZhZgk^XZi]Vi^hXgZViZYVcYhiVgiZYWn^cXajY^c\^i^ci]Z SERVICE_NAMES^c^i#dgVeVgVbZiZg!Wnjh^c\SRVCTL^cVGZVa6eea^XVi^dc8ajhiZghG68!dgWn jh^c\i]ZDBMS_SERVICEEA$HFAeVX`V\Z#GZ\VgYaZhhd[l]^X]bZi]dYlVhjhZYidXgZViZdghiVgi i]ZhZgk^XZ!ndjjhZi]ZDBMS_SERVICEEA$HFAidXdc[^\jgZi]ZI6;Viig^WjiZh#;dgZmVbeaZ!dc i]ZYViVWVhZ!ZmZXjiZi]Z[daadl^c\/ exec DBMS_SERVICE.MODIFY_SERVICE( service_name => 'SALES', failover_method => 'BASIC', failover_type => 'SELECT', failover_retries => 20, failover_delay => 15);
CdbViiZg]dlndjXdc[^\jgZI6;!Z^i]ZgVii]ZXa^ZciaZkZadgdci]ZhZgkZgh^YZ!ndjXVc kZg^[nndjghZhh^dchXjggZciI6;hZii^c\WnfjZgn^c\i]ZV$SESSIONk^Zl#;dgZVX]hZhh^dc! V$SESSIONl^aaY^heaVni]Z[V^adkZgineZ![V^adkZgbZi]dY!VcY^[i]VihZhh^dc]VhZkZgWZZc[V^aZY dkZg^ci]ZeVhi#=ZgZ¼hVh^beaZHFAZmVbeaZidkZg^[nndjgXjggZciI6;hZii^c\h/ SQL> SELECT SERVICE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER FROM V$SESSION;
Fast Application Notification Ndj]VkZaZVgcZY]dlcZlXdccZXi^dchXVceZg[dgb[V^adkZgWZilZZcVYYgZhhZh^cVcADDRESS_ LISTVcY]dlZm^hi^c\XdccZXi^dchXVcVjidbVi^XVaaneZg[dgb[V^adkZgWZilZZc^chiVcXZh#7ji i]ZgZ¼hhi^aabdgZidaZVgc#>bV\^cZi]VindjVgZjh^c\djgZmVbeaZDgVXaZCZiVa^VhV[iZgXdc[^\jg^c\ i]ZhZgkZg"h^YZI6;[dgi]ZhVaZhhZgk^XZVcY]VkZXgZViZYcjbZgdjhXdccZXi^dchVXgdhhVild" ^chiVcXZG68XajhiZg#7ZXVjhZi]^h^hV9ViVcdgYZg[dg?978Xa^ZcihidhjWhXg^WZidDCHYVZbdchVcYgZXZ^kZ;6CZkZcih!i]Znbjhi [^ghiWZXdc[^\jgZY[dg;Vhi8dccZXi^dc;V^adkZg;8;#IdXdc[^\jgZ[dg;8;!Vaa?978Veea^XVi^dch bjhibZZii]Z[daadl^c\gZfj^gZbZcih/ N I]Z?978Veea^XVi^dcbjhiYdi]Z[daadl^c\/ N JhZi]ZDgVXaZ?978Yg^kZg# N =VkZi]Z^bea^X^iXdccZXi^dcXVX]ZZcVWaZY# N 8dccZXiidi]ZYViVWVhZjh^c\hZgk^XZh# N DCHYVZbdchbjhiWZgjcc^c\dci]ZYViVWVhZ]dhih# N I]Z?VkVK^gijVaBVX]^cZ?KB^cl]^X]ndjg?978^chiVcXZ^hgjcc^c\bjhi]VkZ oracle.ons.oraclehomehZiided^ciidndjgORACLE_HOME#
FAN OCI ;6CD8>^hYZh^\cZY[dg!VhndjXVcegdWVWan\jZhh!D8>Xa^Zcih#;6CD8>^hY^[[ZgZci[gdb;6C DCH^ci]Vi^iYdZhcdijhZDCHYVZbdchidhjWhXg^WZidVcYXdchjbZbZhhV\Zh0^chiZVY!^i]Vh i]ZYViVWVhZYZa^kZgbZhhV\ZhY^gZXianidi]ZD8>Xa^Zci#L]ZcVcD8>Xa^Zcii]Vi^hXdc[^\jgZY [dg;6CD8>XdccZXihidi]ZYViVWVhZ!VcZcign^heaVXZY^ci]Zreg$k^Zli]ViYZhXg^WZhi]Z Veea^XVi^dcVcY]dl^iXVcWZXdciVXiZY#6hi]ZhiViZd[gZhdjgXZhhjX]VhhZgk^XZh!^chiVcXZh!dg YViVWVhZhX]Vc\Zh!V;6CD8>bZhhV\Z^heaVXZY^cidi]ZYViVWVhZVaZgifjZjZ#DcXZi]Z bZhhV\Z^hfjZjZY!VYViVWVhZegdXZhhl^aalV`ZjeVcYhZcYi]ZbZhhV\ZidVaaD8>Xa^Zcihi]Vi VgZgZ\^hiZgZY^ci]Zreg$k^Zl#I]ZD8>Veea^XVi^dci]ZciV`Zhi]ZXdggZXiVXi^dchYZeZcY^c\dc i]Z;6CbZhhV\Z# ;dg;6CD8>Xa^ZcihidgZXZ^kZi]Z;6CbZhhV\Z!i]ZnbjhibZZii]Z[daadl^c\gZfj^gZbZcih/ N I]ZOCI_EVENTSbjhiWZZcVWaZYVii]ZZck^gdcbZciXgZVi^dci^bZdci]ZXa^Zci!Vh h]dlc]ZgZ/ ( OCIEnvCreate(...) )
N I]ZD8>Veea^XVi^dcbjhiWZa^c`ZYl^i]i]ZXa^ZcidgdeZgVi^c\hnhiZbi]gZVYa^WgVgn#
386
DgVXaZ9ViV 'SALES', failover_method => 'BASIC', failover_type => 'SELECT', failover_retries => 20, failover_delay => 15, aq_ha_notifications => true);
CdiZi]Vi^cdgYZgid\ZcZgViZ;6CD8>bZhhV\ZhYjg^c\V9ViV'publish_events', ob_type=>'executable', ob_action=>'/u01/oracle/failover_actions.sh', enabled=>TRUE ); END;
I]^hhXg^eiXVcXdciV^cVcnVXi^dchi]VindjlVcieZg[dgbZYVi[V^adkZg!hjX]VhhiVgi^c\ Veea^XVi^dcb^YYaZi^Zgh!hiVgi^c\bZhhV\ZfjZjZh!VcYhddc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Zi]ZipconfigXdbbVcY l^i]i]Z/flushdnsdei^dc/ Linux: /etc/init.d/nscd restart Microsoft Windows: ipconfig /flushdns
Configuring the Database CdgbVaanlZgZXdbbZcYi]Vii]ZYViVWVhZhZgk^XZi]Vii]ZXa^ZcijhZhidXdccZXiidi]ZYViVWVhZ WZhiVgiZYVcYVkV^aVWaZdcandci]ZYViVWVhZi]Vi]Vhi]Zeg^bVgngdaZ#I]^h^hidegZkZciXa^Zci XdccZXi^dch[gdbViiZbei^c\idXdccZXiidi]ZhiVcYWnYViVWVhZ#;dgi]ZXdbeaZiZh^iZ[V^adkZg hXZcVg^d!i]^h^hcdiVXdcXZgc!Vhi]ZigV[[^XbVcV\ZghVgZgZhedch^WaZ[dg[jccZa^c\XdccZXi^dch idi]ZXdggZXiVeea^XVi^dchZgkZghdci]ZXdggZXih^iZ# DcZYViVWVhZXdc[^\jgVi^dci]ViXVcV^Y^ci]ZXdbeaZiZh^iZ[V^adkZg^hi]ZXgZVi^dcd[V ig^\\ZgVgdjcYi]ZDB_ROLE_CHANGEhnhiZbZkZci#I]^hig^\\ZgXVcWZjhZYidVjidbViZiVh`hi]Vi cZZYidWZeZg[dgbZYdcXZi]ZYViVWVhZ[V^adkZg]VhXdbeaZiZY#;dgZmVbeaZ!i]ZYViVWVhZ ig^\\ZgXVcXVaaVcZmiZgcVahXg^eii]Vi^cijgchhiVgihi]ZVeea^XVi^dchZgkZghdgeZg]VehbZhhV\Z fjZjZh#>chdbZXVhZh!i]ZhXg^eiXVcWZjhZYidXdc[^\jgZigV[[^XbVcV\Zghdg9CHhZgkZgh#;dgVc ZmVbeaZd[i]^hig^\\Zg!hZZi]ZZVga^ZghZXi^dc!¹I]Z97TGDA:T8=6C9Zcign#=ZgZ¼hVcZmVbeaZ/ SALES = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL (ADDRESS = (PROTOCOL (ADDRESS = (PROTOCOL (ADDRESS = (PROTOCOL (LOAD_BALANCE = yes) ) (CONNECT_DATA= (SERVICE_NAME=SALES) ) )
= = = =
TCP)(HOST TCP)(HOST TCP)(HOST TCP)(HOST
= = = =
MATRIX1)(PORT = 1521)) MATRIX2)(PORT = 1521)) MATRIX_DR01)(PORT = 1521)) MATRIX_DR02)(PORT = 1521))
2. L]Zci]ZVeea^XVi^dcXdccZXi^dchVgZWZ^c\bVYZ!^[i]Znh]djaY]VeeZcidViiZbeiid XdccZXiidVcdaYeg^bVgn]dhii]Vi^hjcVkV^aVWaZ!i]ZXdccZXi^dcViiZbeiidi]Vi]dhi h]djaYaVhicdadc\Zgi]Vc(hZXdcYh#I]^hVaadlh[dgXdccZXi^dcViiZbeihid\Zii]gdj\] i]ZADDRESS_LISTfj^X`anjci^aVcZleg^bVgn]dhi^h[djcY#;dgVcD8>Xa^Zci!hZii]Z [daadl^c\^ci]ZhfacZi#dgV[^aZ/ SQLNET.OUTBOUND_CONNECT_TIMEOUT=3
;dg?978i]^X`VcYi]^cXa^Zcih!Xdc[^\jgZi]Z[daadl^c\egdeZgindci]Z9ViVHdjgXZ l]ViV?978Veea^XVi^dcjhZhidYZ[^cZi]ZXdccZXi^dcidi]ZYViVWVhZ/ SQLnetDef.TCP_CONNTIMEOUT_STR=3000
390
DgVXaZ9ViV 'sales', network_name => 'sales');
CdiZi]Vindjh]djaYcdi^cXajYZi]ZhZgk^XZcVbZ^ci]ZSERVICE_NAMESeVgVbZiZg# >chiZVY!ndjh]djaYVaadli]Zig^\\ZgYZhXg^WZY^ci]ZcZmihiZeidbVcV\Zi]ZhiVgi^c\ VcYhidee^c\d[i]ZhZgk^XZ# 2. ;dggZVhdcha^hiZY^ci]Z¹C^iinVeea^XVi^dchVcY?978i]^X`Veea^XVi^dch!ndj XVcjhZI6;idVjidbViZi]^hgZign#;dgVeea^XVi^dchi]ViXVccdibV`ZjhZd[I6;?978 i]^cVeea^XVi^dch!gZignad\^Xh]djaYWZWj^ai^cidi]ZVeea^XVi^dc#;dgZmVbeaZ!l]Zc VhZhh^dc[gdbi]ZXdccZXi^dceddagZXZ^kZhVcnZmXZei^dci]VigZhjaih^cVY^hXdccZXi hjX]VhVcDG6"(&&(Zggdg!i]ZVeea^XVi^dch]djaYVjidbVi^XVaanViiZbeiidgZXdccZXi i]VihZhh^dc#I]ZgZXdccZXi^dcViiZbeihh]djaYWZXdc[^\jgZYhdi]Vii]Znl^aaXdci^cjZ [dgi]ZaZc\i]d[i^bZi]Vi^iiV`Zhid[V^adkZgi]ZYViVWVhZaVnZgVcYWg^c\i]ZVeea^XVi^dc hZgk^XZhdca^cZ#
Database Configuration IdVjidbViZi]ZgZXdccZXi^dcd[Zm^hi^c\hZhh^dch[dgD8> Veea^XVi^dch!hZgkZg"h^YZI6;h]djaYWZXdc[^\jgZYdci]ZYViVWVhZ[dgi]ZhZgk^XZi]Vii]Z Veea^XVi^dcjhZhidXdccZXiidi]ZYViVWVhZ#=ZgZ¼hVcZmVbeaZ/ exec DBMS_SERVICE.MODIFY_SERVICE( service_name => 'SALES', failover_method => 'BASIC', failover_type => 'SELECT', failover_retries => 180, failover_delay => 1);
Third: Ultimate Client Failover >ci]^hXa^Zci[V^adkZgXdc[^\jgVi^dc!i]ZYViVWVhZVcYi]ZVeea^XVi^dcXdccZXi^dchVgZ[V^aZYdkZg VjidbVi^XVaan#L]Zci]Z[V^adkZg]VhXdbeaZiZY!i]ZVeea^XVi^dch]djaYWZcdi^[^ZYk^V;6C bZhhV\Zhi]Vii]ZdaYeg^bVgn^hjcVkV^aVWaZVcYi]ZVeea^XVi^dch]djaYXdccZXiidi]ZcZl eg^bVgnYViVWVhZ#
Client-side Configuration ;dgD8>Veea^XVi^dch!i]Z[daadl^c\gZfj^gZbZcihbjhiWZbZi^cdgYZgidgZXZ^kZ;6CD8> bZhhV\Zh/ 1. :cVWaZi]ZOCI_EVENTSVii]ZZck^gdcbZciXgZVi^dci^bZdci]ZXa^ZciVh[daadlh/ ( OCIEnvCreate(...) )
2. D8>Veea^XVi^dcbjhiWZa^c`ZYl^i]i]ZXa^Zcii]gZVYdgdeZgVi^c\hnhiZba^WgVgn# ?978Veea^XVi^dchh]djaYWZXdc[^\jgZY[dg;Vhi8dccZXi^dc;V^adkZg#>cVYY^i^dc!?978 Veea^XVi^dchh]djaYbZZii]Z;8;gZfj^gZbZcihi]VilZgZY^hXjhhZY^ci]Z¹C^iin[i]Zeg^bVgnVcYhiVcYWn]dhihVgZcdieVgi d[VXajhiZg!i]ZDCHYVZbdchdcZVX]]dhicZZYidWZXgZViZY#IdXgZViZVcYhiVgii]Z DCHYVZbdch!jhZVcDCHXdc[^\jgVi^dc[^aZidXdc[^\jgZDCH#I]^h[^aZh]djaYZm^hi^c i]ZDG68A:T=DB:$debc$Xdc[Y^gZXidgnV[iZg^chiVaaVi^dcd[i]ZDgVXaZhd[ilVgZhiVX`# >ih]djaYWZXdc[^\jgZYh^b^aVgidi]Z[daadl^c\/ localport=6100 remoteport=4200 loglevel=3 nodes=halinux03:6200,halinux04:6200
>ci]^hZmVbeaZ!i]ZnodeseVgVbZiZged^cihidi]Zeg^bVgnVcYhiVcYWn]dhih[daadlZY Wni]ZgZbdiZedgi[dgi]ZDCHYVZbdcgjcc^c\dci]Viedgi#DcXZi]ZXdc[^\jgVi^dc[^aZ ]VhWZZcXgZViZY!ndjXVchiVgii]ZDCHYVZbdcdci]Zb^YYaZi^ZgdgXa^ZcicdYZhWn ^hhj^c\i]Z[daadl^c\XdbbVcY/ $onsctl start
3. 6[iZgi]ZDCHYVZbdch]VkZWZZcXgZViZYVcYhiVgiZY!Xdc[^\jgZi]Z?978Veea^XVi^dcid gZbdiZanhjWhXg^WZidi]dhZYVZbdch/ ods.setONSConfiguration("halinux03:6200,halinux04:6200");
Database Configuration I]Z\ddYcZlh[dgi]dhZd[ndjl^i]D8>Veea^XVi^dch^hi]VindjVgZ egZiinbjX]YdcZVii]^hed^ci#L]Zci]ZD8>Veea^XVi^dcXdccZXihidi]ZYViVWVhZ!VaacZXZhhVgn ^c[dgbVi^dcidXdchigjXii]Z;6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Upgrades Using SQL Apply I]ZhiZehdjia^cZY^ci]^hhZXi^dcVhhjbZi]ViVad\^XVahiVcYWnVagZVYnZm^hihVcY^hXjggZcian WZ^c\jhZYidegdk^YZVgZedgi^c\YViVWVhZhdaji^dc[dgi]Zeg^bVgnYViVWVhZ#>cVYY^i^dc!lZVahd VhhjbZi]VijchjeedgiZYYViVWVhZYViVineZh[dgi]Zad\^XVahiVcYWnYViVWVhZVgZVagZVYn egdXZhhZYVcY]VcYaZYVXXdgY^c\an#8]VeiZg)Y^hXjhhZh]dlid]VcYaZjchjeedgiZYad\^XVa hiVcYWnYViVineZh# I]Z[daadl^c\]^\]"aZkZahiZehYZhXg^WZVgdaa^c\je\gVYZjh^c\Vad\^XVahiVcYWnYViVWVhZ/ 1. EgZei]ZZck^gdcbZci^cdgYZgidZhiVWa^h]Vad\^XVahiVcYWnXdc[^\jgVi^dc#:chjgZi]Vi [aVh]WVX`ad\\^c\^hZcVWaZYdci]Zeg^bVgnVcYhiVcYWn#>[^i^hcdiZcVWaZY!^il^aa gZfj^gZVhbVaadjiV\ZYViVWVhZh]jiYdlcVcYhiVgijebdjciidZcVWaZ^i/ SHUTDOWN IMMEDIATE - Note, for Oracle RAC environments this needs to be performed on all instances STARTUP MOUNT ALTER DATABASE FLASHBACK ON ALTER DATABASE OPEN
2. 9ViV[i]Z7gd`Zg^hWZ^c\jhZY!i]Z7gd`ZgbjhiWZY^hVWaZYdcWdi]i]Zeg^bVgnVcYhiVcYWn YViVWVhZh/ ALTER SYSTEM SET DG_BROKER_START=FALSE SCOPE=BOTH;
I]Z9ViV[VcVgX]^kZYgZYdad\gZedh^idgnlVhjhZY^chiZe+!ndjXVcjhZi]ZRMAN CATALOG XdbbVcYidXViVad\i]ZVgX]^kZYgZYdad\gZedh^idgnYZhi^cVi^dcidVkd^YgZhZcY^c\ i]dhZad\h/ RMAN> CATALOG START WITH '+FRA/Matrix_DR1/ARCHIVELOG/';
19. GZhiVgii]Zad\^XVahiVcYWnYViVWVhZ/ STARTUP MOUNT; ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
20. NdjXVccdlgZhiVgii]ZigVchedgihZgk^XZh[dggZYdidi]Zad\^XVahiVcYWn[gdbi]Zeg^bVgn YViVWVhZ/ ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE SCOPE=MEMORY
6ii]^hed^ci!i]Zeg^bVgn^hgjcc^c\i]ZadlZgkZgh^dcd[i]Zhd[ilVgZVcYi]Zad\^XVa hiVcYWn^hgjcc^c\i]Zje\gVYZhd[ilVgZkZgh^dc#Id[^c^h]jei]Zgdaa^c\je\gVYZegdXZhh! ndjh]djaYje\gVYZ$eViX]i]Zeg^bVgnYViVWVhZ#6hl^iX]dkZgl^aaWZeZg[dgbZYid X]Vc\Zi]Zeg^bVgnYViVWVhZgdaZidi]Zad\^XVahiVcYWngdaZ!VcYl^aa\di]gdj\]i]Z hVbZje\gVYZegdXZhh# 21. Dci]ZXjggZcieg^bVgn!WZ[dgZegdXZZY^c\l^i]i]Zhl^iX]dkZg!fjZgni]ZVDATABASE k^Zl[dgi]ZSWITCHOVER_STATUS#>[i]ZhiVijh^cY^XViZhTO STANDBY!i]Zc^i^hhV[Zid egdXZZY#Di]Zgl^hZ!hl^iX]dkZgl^i]SESSION DISCONNECT/ SELECT SWITCHOVER_STATUS FROM V$DATABASE; ALTER DATABASE COMMIT TO SWITCHOVER TO LOGICAL STANDBY;
22. H^b^aVgan!dci]Zad\^XVahiVcYWn!WZ[dgZegdXZZY^c\l^i]i]Zhl^iX]dkZg!fjZgni]Z VDATABASEk^Zl[dgi]ZSWITCHOVER_STATUS#>[i]ZhiVijh^cY^XViZhTOPRIMARY! i]Zc^i^hhV[ZidegdXZZY#Di]Zgl^hZhl^iX]dkZgl^i]SESSION DISCONNECT/ ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
23. I]Z[dgbZgad\^XVahiVcYWnYViVWVhZ^hcdli]Zeg^bVgnYViVWVhZVcYVahdg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aa^c\YViVWVhZje\gVYZegdXZhhjh^c\i]ZigVch^Zciad\^XVahiVcYWn^h^aajhigViZY^c ;^\jgZ&&" I]^hbZi]dY^hVeea^XVWaZ^cDgVXaZ9ViVWVhZ&%gG'VcY&&gG&hiVcYWnYViVWVhZZck^gdcbZcih# I]ZcdiVWaZY^[[ZgZcXZWZilZZci]ZDgVXaZ9ViVWVhZ&%gG'VcY&&gG&^hi]VicZlhnciVm^h ^cXajYZYid[VX^a^iViZi]^hXdckZgh^dcVcYbVcn[ZlZghiZehVgZgZfj^gZYidVXXdbea^h]i]^h^c&&g#
Preparation Preparation
1
Guaranteed Restore Point
Matrix (Prod)
MatrixDR Physical 2
Keep Identity
MatrixDR Logical
Synchronize
Upgrade
LogMiner Build Synchronize Flashback
5
Database to GSP
MatrixDR Logical
Switchover
MatrixDR Physical
Synchronize
Matrix (Prod)
4
Guaranteed Restore Point New $ORACLE_HOME Convert to Physical
6
7
Matrix (Prod)
FIGURE 11-1.
Switchover
8
Matrix (Prod)
9
MatrixDR Physical
Rolling database upgrade with transient logical standby
3
8]VeiZg&&/ B^c^b^o^c\EaVccZY9dlci^bZJh^c\9ViVchiVaaZg#>cdjgZmVbeaZXVhZ!lZl^aa cZZYidjhZDJ>[dgi]Z&%#,je\gVYZ# 21. EZg[dgbbV^ciZcVcXZdcjchjeedgiZYYViVineZh# 22. >[VcVgX]^kZYgZYdad\gZedh^idgnlVhjhZY!ndjXVcjhZi]ZRMAN CATALOGXdbbVcYid XViVad\i]ZVgX]^kZYgZYdad\gZedh^idgnad\hidVkd^YgZhZcY^c\i]dhZad\h/ RMAN> CATALOG START WITH '+PSTBY/MATRIX_DR0/ARCHIVELOG/';
23. DcXZi]Zje\gVYZ^hXdbeaZiZY!ndjXVcgZhiVgii]ZgZYdigVchedgiidi]Zad\^XVahiVcYWn VcYVahdhiVgijeHFA6eean#Dci]Zeg^bVgn/ SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE SCOPE=MEMORY;
Dci]Zad\^XVahiVcYWn/ SQL> STARTUP SQL> ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
(
HZZBZiVA^c`CdiZ)()&+)#&/¹9ViV[ndjVgZgjcc^c\l^i]COMPATIBLE hZiidadlZgi]Vc&%#'#%#'!Y^hVWaZi]Zi]gZVYhWZ[dgZ^c^i^Vi^c\Vhl^iX]dkZg#9di]ZhVbZidi]Z ad\^XVahiVcYWnYViVWVhZZmXZei[dgi]Z^chiVcXZl]ZgZHFA6eean^hgjcc^c\#GZ"ZcVWaZi]Zi]gZVYh VcYhiVgii]Z^chiVcXZhV[iZgi]Zhl^iX]dkZgdeZgVi^dc]VhXdbeaZiZYhjXXZhh[jaan#6ai]dj\]i]Z ^chiVcXZhVgZh]jiYdlc!i]ZgdaZX]Vc\Zl^aaWZVjidbVi^XVaanegdeV\ViZYidi]ZhZ^chiVcXZhl]Zc i]ZnVgZgZhiVgiZY# Dei^dch[dgjh^c\gdaa^c\je\gVYZl]ZcjchjeedgiZYYViVineZhZm^hiVgZVh[daadlh/ N HjheZcYdgegd]^W^iX]Vc\Zhidi]ZjchjeedgiZYYViVineZdW_ZXih#IZbedgVg^anhjheZcY dgegd]^W^iX]Vc\Zhidi]ZjchjeedgiZYiVWaZh[dgi]ZeZg^dYd[i^bZ^iiV`ZhideZg[dgb i]Zje\gVYZegdXZYjgZ# N JhZDBA_LOGSTDBY_EVENTSl^i]DgVXaZ9ViVEjbedgl^i]i]Z:medgi$>bedgiji^a^in#>[ ndjXVccdiegZkZciX]Vc\ZhidjchjeedgiZYiVWaZhYjg^c\i]Zje\gVYZ!VcnjchjeedgiZY igVchVXi^dchi]VidXXjgVgZgZXdgYZY^ci]Z976TADbedgiji^a^inid^bedgii]ZX]Vc\ZYiVWaZhidi]Zje\gVYZYYViVWVhZh#GZk^Zl hZXi^dc&'#)^cOracle Data Guard Concepts and Administration [dgbdgZ^c[dgbVi^dc# N JhZ:miZcYZY9ViVineZHjeedgi:9H!l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i^dcVaheVXZ^hcZZYZY[dgcZlWVX`jehdgVgX]^kZYad\h#
Example Configuration for Other Physical Standby Databases ;daadli]ZhZhiZehidXdc[^\jgZVcdi]Zge]nh^XVahiVcYWnYViVWVhZl]ZgZWVX`jehVgZcdiiV`Zc# >hhjZi]Z[daadl^c\XdbbVcYV[iZgXdccZXi^c\idZVX]d[i]Zdi]Zge]nh^XVahiVcYWnYViVWVhZh VcYi]ZgZXdkZgnXViVad\/ RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;
HZii^c\i]^hXdc[^\jgVi^dcdcZVX]d[i]Zdi]Zge]nh^XVahiVcYWnYViVWVhZhl]ZgZWVX`jehVgZ cdiWZ^c\iV`Zcl^aaZcVWaZVjidbVi^XYZaZi^dcd[VgX]^kZYad\hdci]^hhiVcYWnYViVWVhZi]Vi ]VkZWZZcVeea^ZYidVaadi]ZggZbdiZhiVcYWnYZhi^cVi^dch#6gX]^kZYad\hVgZYZaZiZY^[heVXZ^c i]Z[aVh]gZXdkZgnVgZVcZZYhidWZgZXaV^bZY[dgcZl[^aZh#Jh^c\i]^heda^XngZfj^gZhi]Vii]Z YViVWVhZjhZhV;aVh]GZXdkZgn6gZV;G6# GZ[ZgidCdiZ(%**+*#&¹EZgh^hiVci8dcigda[^aZ8dc[^\jgVi^dch[dgGB6C^cDgVXaZ.iVcY DgVXaZ&%gº[dgVYY^i^dcVa^c[dgbVi^dc#
Backup Strategies HZkZgVaWVX`jehigViZ\^Zhh]djaYWZXdch^YZgZYYZeZcY^c\dcndjgWjh^cZhh¼hgZXdkZgned^ci dW_ZXi^kZGEDVcYgZXdkZgni^bZdW_ZXi^kZGID#GZ[Zgid8]VeiZg'[dgYZiV^aZY^c[dgbVi^dc dcYZ[^c^c\ndjgWjh^cZhhgZfj^gZbZcih#I]ZhZdW_ZXi^kZh!Vadc\l^i]ndjgWjY\Zi!l^aaYg^kZ
416
DgVXaZ9ViVci]ZXVhZd[Vc^bV\Z Xden!i]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VcZ[[ZXi^kZan egdk^YZndjg[^ghiaZkZad[egdiZXi^dc[gdbedhh^WaZYViVWVhZdjiV\Zh# D[XdjghZ!h^cXZndjVgZjh^c\9ViV DUPLICATE TARGET DATABASE FOR STANDBY DORECOVER;
6aiZgcVi^kZan!ndjXVcjhZ^bV\ZXde^ZhidXgZViZVhiVcYWnYViVWVhZ#DcZd[i]Z gZfj^gZbZcih^hi]Vii]Zeg^bVgnYViVWVhZbjhiWZXadhZYXaZVcanVcYi]ZcbdjciZY#I]^h gZhig^Xi^dcbVnbV`Zi]ZjhZd[^bV\ZXde^Zh[dgVhiVcYWnXgZVi^dcaZhhViigVXi^kZl]Zc XdbeVgZYidi]ZjhZd[VWVX`jehZi#IdjhZi]^hbZi]dY!ndjldjaYh]jiYdlci]Zeg^bVgn YViVWVhZVcYi]ZcgZhiVgi^i^cbdjcibdYZ#NdjXVci]ZcXgZViZVc^bV\ZXdend[Vaad[i]Z YViV[^aZhVcYXgZViZVhiVcYWnXdcigda[^aZ#6[iZgi]^h^hYdcZ!ndjXVcdeZci]Zeg^bVgnYViVWVhZ VcYVgX]^kZi]ZXjggZciad\#I]^h^bV\ZXdenXVci]ZcWZiV`Zcidi]ZgZbdiZh^iZVcY!V[iZg[^m^c\ i]ZeVgVbZiZghVhjhjVa!bdjciZYjh^c\i]ZhiVcYWnXdcigda[^aZ# NOTE We added this example here for your information—but, to be honest, with its downtime requirements, we recommend using one of the U L ATE F R STA methods in RMAN.
Backups on a Standby Database I]Z[daadl^c\ZmVbeaZh]dlhVaai]ZXjggZciXdc[^\jgVi^dchZii^c\hdcdjghiVcYWnYViVWVhZVcY i]Zci]ZhZii^c\h[dgiV`^c\V[jaaWVX`je/ RMAN> show all; RMAN configuration parameters for database with db_unique_name MATRIX_DR0 are: CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
424
DgVXaZ9ViV backup incremental level 0 database TAG='standby_lvl0'; Starting backup at 05-JAN-09 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=142 device type=DISK channel ORA_DISK_1: starting incremental level 0 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00004 name=/media/orclvol1/oradata/matrix_dr0/users01.dbf input datafile file number=00003 name=/media/orclvol2/oradata/matrix_dr0/undotbs01.dbf channel ORA_DISK_1: starting piece 1 at 05-JAN-09 channel ORA_DISK_1: finished piece 1 at 05-JAN-09 piece handle=/media/orclvol3/matrix_df675356527_14_1 tag=STANDBY_LVL0 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting incremental level 0 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/media/orclvol1/oradata/matrix_dr0/system01.dbf input datafile file number=00005 name=/media/orclvol2/oradata/matrix_dr0/actor_d_01.dbf input datafile file number=00006 name=/media/orclvol2/oradata/matrix_dr0/actor_i_01.dbf input datafile file number=00002 name=/media/orclvol1/oradata/matrix_dr0/sysaux01.dbf channel ORA_DISK_1: starting piece 1 at 05-JAN-09 channel ORA_DISK_1: finished piece 1 at 05-JAN-09 piece handle=/media/orclvol3/matrix_df675356588_15_1 tag=STANDBY_LVL0 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15 Finished backup at 05-JAN-09
8]VeiZg&'/ 7VX`jeVcYGZXdkZgn8dch^YZgVi^dch
425
Starting Control File and SPFILE Autobackup at 05-JAN-09 piece handle=/u01/app/oracle/product/11.1.0/db_1/dbs/cfc-2215364109-2009010500 comment=NONE Finished Control File and SPFILE Autobackup at 05-JAN-09 RMAN>
DcXZi]ZWVX`je^hXdbeaZiZ!lZXVcY^heaVni]ZWVX`jehlZ]VkZbVYZWnjh^c\i]ZLIST BACKUPSET SUMMARYXdbbVcY/ RMAN> list backupset summary; List of Backups =============== Key TY LV S Device Type Completion Time ------- -- -- - ----------- --------------382 B F A DISK 04-JAN-09 383 B F A DISK 04-JAN-09 384 B F A DISK 04-JAN-09 385 B F A DISK 04-JAN-09 648 B 0 A DISK 05-JAN-09 649 B 0 A DISK 05-JAN-09 663 B F A DISK 05-JAN-09
#Pieces ------1 1 1 1 1 1 1
#Copies ------1 1 1 1 1 1 1
Compressed ---------NO NO NO NO NO NO NO
Tag -----------------TAG20090104T150544 TAG20090104T150911 TAG20090104T150952 TAG20090104T151104 STANDBY_LVL0 STANDBY_LVL0 TAG20090105T150510
I]Zc!jh^c\i]ZLIST BACKUPSETXdbbVcY!lZXVchZZi]ZYZiV^ahd[VheZX^[^XWVX`je/ RMAN> list backupset 649; List of Backup Sets =================== BS Key Type LV Si e Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------649 Incr 0 810.53M DISK 00:01:59 05-JAN-09 BP Key: 652 Status: AVAILABLE Compressed: NO Tag: STANDBY_LVL0 Piece Name: /media/orclvol3/matrix_df675356588_15_1 List of Datafiles in backup set 649 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---1 0 Incr 708412 05-JAN-09 /media/orclvol1/oradata/matrix_dr0/system01.dbf 2 0 Incr 708412 05-JAN-09 /media/orclvol1/oradata/matrix_dr0/sysaux01.dbf 5 0 Incr 708412 05-JAN-09 /media/orclvol2/oradata/matrix_dr0/actor_d_01.dbf 6 0 Incr 708412 05-JAN-09 /media/orclvol2/oradata/matrix_dr0/actor_i_01.dbf RMAN>
426
DgVXaZ9ViV backup archivelog from scn=708389 TAG='STANDBY_ARCHIVE'; Starting backup at 05-JAN-09 using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=48 RECID=26 STAMP=675356631 channel ORA_DISK_1: starting piece 1 at 05-JAN-09 channel ORA_DISK_1: finished piece 1 at 05-JAN-09 piece handle=/media/orclvol3/matrix_df675357372_17_1 tag=STANDBY_ARCHIVE comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 05-JAN-09 Starting Control File and SPFILE Autobackup at 05-JAN-09 piece handle=/u01/app/oracle/product/11.1.0/db_1/dbs/cfc-2215364109-2009010501 comment=NONE Finished Control File and SPFILE Autobackup at 05-JAN-09
>cDgVXaZ&&g!i]ZVgX]^kZYgZYdad\[V^adkZg[ZVijgZl^aaZcVWaZGB6CidXdbeaZiZVWVX`je ZkZcl]ZchdbZd[i]Zad\hVgZb^hh^c\dgXdggjei#>[ndj]VkZbjai^eaZVgX]^kZad\YZhi^cVi^dch Xdc[^\jgZYVcYViaZVhidcZVgX]^kZYad\Zm^hih[dgV\^kZchZfjZcXZVcYi]gZVY^cZ^i]Zgd[i]Z YZhi^cVi^dch!i]ZcGB6Cl^aaViiZbeiidWVX`^ije#>[GB6CZcXdjciZgh^hhjZhYjg^c\i]Z WVX`je!^il^aaX]ZX`i]Zdi]ZgVgX]^kZad\YZhi^cVi^dch[dgi]Vi[^aZ#
General Recovery Strategies >i^h^bedgiVcii]VindjjcYZghiVcYl]VindjggZXdkZgndei^dchVgZjcYZgY^[[ZgZcihXZcVg^dh#>c VYY^i^dc!ndjcZZYidZchjgZi]VindjgWVX`jehigViZ\nl^aahjeedgii]dhZgZXdkZgndei^dch# HjWhZfjZcian!ndjh]djaYiZhii]ZhZhXZcVg^dhVh[gZfjZcianVhedhh^WaZ[dgY^[[ZgZciineZhd[ [V^ajgZh!hjX]VhbZY^V[V^ajgZ!WadX`Xdggjei^dc!jhZgZggdg!VcYY^hVhiZggZXdkZgn#I]ZhZ[V^ajgZ ineZhVadc\l^i]di]ZggZXdkZgnXdcXZeihVgZY^hXjhhZY^cYZiV^a^c8]VeiZg(#
Media Failure BZY^V[V^ajgZhdXXjgl]Zci]ZYViVWVhZXVccdigZVY[gdbdglg^iZidVYViV[^aZ#I]^hXdjaYWZi]Z gZhjaid[]VgYlVgZ[V^ajgZh!dg^iXdjaYWZVgZhjaid[i]Z[^aZWZ^c\VXX^YZciVaanYZaZiZYdg dkZglg^iiZc#
Block Corruption 9ViVWadX`Xdggjei^dchdXXjg^c[^aZhVhVgZhjaid[bZbdgnXdggjei^dchi]ViVgZlg^iiZcidi]Z[^aZh VhlZaaVh>$DZggdghdci]ZjcYZgan^c\Y^h`h#NdjXVckZg^[nYViVWadX`Xdggjei^dcjh^c\i]Z [daadl^c\iddah#
8]VeiZg&'/ 7VX`jeVcYGZXdkZgn8dch^YZgVi^dch
427
>cGB6C!ndjXVcgjci]Z[daadl^c\XdbbVcYidX]ZX`[dge]nh^XVaVcYad\^XVaXdggjei^dch ^ci]ZYViVWVhZVhlZaaVhVgX]^kZad\h/ RMAN> BACKUP VALIDATE DATABASE ARCHIVELOG ALL; Starting backup at 14-JAN-09 starting full resync of recovery catalog full resync complete allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=127 device type=DISK channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=19 RECID=2 STAMP=675075647 . . . input archived log thread=1 sequence=54 RECID=73 STAMP=676072884 channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45 List of Archived Logs ===================== Thrd Seq Status Blocks Failing Blocks Examined Name ---- ------- ------ -------------- --------------- --------------1 19 OK 0 196894 /media/orclvol3/MATRIX/archivelog/2009_01_02/o1_mf_1_19_4owc0n2t_.arc . . . 1 54 OK 0 196861 /media/orclvol3/MATRIX/archivelog/2009_01_13/o1_mf_1_54_4ptrvyh5_.arc channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00004 name=/media/orclvol1/oradata/matrix/users01.dbf input datafile file number=00003 name=/media/orclvol2/oradata/matrix/undotbs01.dbf channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25 List of Datafiles ================= File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------3 OK 0 86136 131072 1156673 File Name: /media/orclvol2/oradata/matrix/undotbs01.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------Data 0 0 Index 0 0 Other 0 44936 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------4 OK 0 131030 131072 703802 File Name: /media/orclvol1/oradata/matrix/users01.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------Data 0 10
428
DgVXaZ9ViV BACKUP AS COPY DATAFILE 1 AUXILIARY FORMAT 2> '/u04/oradata/MATRIX_DR0/users.dbf';
3. HiVgiGB6CVcYXdccZXiidi]Zeg^bVgnYViVWVhZVhiVg\ZiVcYidi]ZgZXdkZgnXViVad\/ RMAN TARGET / CATALOG rman/@RCAT
4. JhZi]ZCATALOGDATAFILECOPYXdbbVcYidXViVad\i]^hYViV[^aZXdenhdi]ViGB6C XVcjhZ^i/ RMAN> CATALOG DATAFILECOPY '/u04/oradata/MATRIX_DR0/users.dbf';
5. JhZi]ZSWITCH DATAFILEXdbbVcYidhl^iX]i]ZYViV[^aZXdenhdi]Vii]^h[^aZ WZXdbZhi]ZXjggZciYViV[^aZ/ RUN SET NEWNAME FOR DATAFILE 1 TO '/u04/oradata/MATRIX/users.dbf'; SWITCH DATAFILE 1;
Loss of a Datafile on a Standby Database JhZi]Z[daadl^c\hiZehidgZXdkZgVadhiYViV[^aZdcVhiVcYWnYViVWVhZ/ 1. Hidei]ZGZYd6eeanjh^c\i]ZALTER DATABASEXdbbVcY/ SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
2. HiVgiGB6CVcYXdccZXiWdi]idi]ZhiVcYWnVcYgZXdkZgnXViVad\/ RMAN TARGET / CATALOG rcat/@RCAT
3. >hhjZi]Z[daadl^c\XdbbVcYhidgZhidgZVcYgZXdkZgYViV[^aZhdci]ZhiVcYWnYViVWVhZ/ RMAN> RESTORE DATAFILE 1; RMAN> RECOVER DATAFILE 1;
4. GZhiVgiHFA6eean/ SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
432
DgVXaZ9ViV RESTORE CONTROLFILE FROM AUTOBACKUP; RMAN> RESTORE CONTROLFILE FROM '/BACKUP_DIR/PIECE_NAME'; RMAN> RESTORE CONTROLFILE; => MOST RECENT BACKUP.
NdjXVci]ZchiVgiVcYbdjcindjgYViVWVhZ#9ZeZcY^c\dcndjgXdc[^\jgVi^dcndjXVcVahd gZ[ZgidCdiZ/)*.)&&¹HiZehidGZ"XgZViZVE]nh^XVaHiVcYWn8dcigda[^aZºVcYCdiZ,()-+'#& ¹HiZeWnHiZe SQL "ALTER DATABASE BACKUP CONTROLFILE TO TRACE";
DgjhZi]^h/ SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
>ci]ZVaZgiad\!ndjl^aahZZVa^cZh^b^aVgidi]Z[daadl^c\!l]^X]iZaahndjl]ZgZi]ZXdcigda [^aZXgZViZhXg^ei]VhWZZclg^iiZc/ Backup controlfile written to trace file /OracleHomes/diag/rdbms/matrix/Matrix/trace/Matrix_ora_ 28431.trc
Loss of an Online Redo Log File >[i]Zdca^cZgZYdad\[^aZhVgZbjai^eaZmZY!i]Zci]Zadhhd[dcZbZbWZgl^aacdi^beVXii]Z YViVWVhZ#NdjXVci]Zch]jiYdlci]ZYViVWVhZVcYXdeni]Zdi]ZgbZbWZghd[i]Z\gdjedkZg i]Zb^hh^c\dgYVbV\ZYbZbWZg/ 1. H]jiYdlci]ZYViVWVhZ# 2. 8deni]ZZm^hi^c\bjai^eaZmZYbZbWZgdkZgi]Zb^hh^c\dgYVbV\ZYbZbWZg# [matrix]$ ls control01.ctl redo02a.rdo sysaux01.dbf users01.dbf redo01a.rdo redo03a.rdo system01.dbf [matrix]$ cp redo03a.rdo /media/orclvol2/oradata/matrix/redo03b.rdo [matrix]$ cd /media/orclvol2/oradata/matrix
8]VeiZg&'/ 7VX`jeVcYGZXdkZgn8dch^YZgVi^dch [matrix]$ ls actor_d_01.dbf actor_i_01.dbf
control02.ctl control03.ctl
redo02b.rdo redo01b.rdo
temp01.dbf redo03b.rdo
433
undotbs01.dbf
3. HiVgijei]ZYViVWVhZ# >[Vaad[i]ZbZbWZghd[Vc^cVXi^kZ\gdjei]Vi]VhWZZcVgX]^kZYVgZadhi!i]Z\gdjeXVcWZ YgdeeZYVcYgZ"XgZViZY# >[i]ZXjggZci\gdjedgVc^cVXi^kZ\gdjei]Vi]VhcdinZiWZZcVgX]^kZY^hYVbV\ZYdg b^hh^c\!ndjbjhi[V^adkZgidi]ZhiVcYWnYViVWVhZ!dgiV`ZVadhhd[YViVVcYgZXdkZgeg^bVgnidV i^bZ_jhieg^dgidi]ViXjggZcidg^cVXi^kZ\gdje# >cDgVXaZ9ViVWVhZ&&g!ViddaXVaaZY9ViVGZXdkZgn6Yk^hdgXVc]ZaendjY^V\cdhZVcY[^m bZY^V[V^ajgZh#>il^aaYZiZgb^cZi]ZWZhigZXdkZgndei^dchVcYXVceZg[dgbi]ZgZXdkZgn# DcXZi]ZYViVWVhZ]VhYZiZXiZYi]Z[V^ajgZdgndj¼kZgjcY^V\cdhi^XX]ZX`hdgZmZXjiZYi]Z VALIDATEXdbbVcYh!i]ZgZhjaihVgZhidgZY^ci]Z6jidbVi^X9^V\cdhi^XGZedh^idgn69G# DcXZ69GgZXdgYhi]Z[V^ajgZh!ndjXVc^ckd`Zi]Z9ViVGZXdkZgn6Yk^hdg#=ZgZ¼hVcZmVbeaZd[ l]VindjldjaYhZZ^[i]Z[V^ajgZ]VhcdiWZZceaVXZY^c69G/ RMAN> list failure; no failures found that match specification
I]Z[daadl^c\^hVcZmVbeaZd[V9ViVGZXdkZgn6Yk^hdggZedgi[dgVb^hh^c\gZYdad\/ RMAN> advise failure; starting full resync of recovery catalog full resync complete List of Database Failures ========================= Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------702 HIGH OPEN 05-JAN-09 Redo log file /media/orclvol2/oradata/matrix/redo03b.rdo is missing Impact: Database might be unrecoverable or become unrecoverable analy ing automatic repair options; this may take some time allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=135 device type=DISK analy ing automatic repair options complete Mandatory Manual Actions ======================== no manual actions available Optional Manual Actions ======================= 1. If file /media/orclvol2/oradata/matrix/redo03b.rdo was unintentionally renamed or moved, restore it Automated Repair Options ========================
434
DgVXaZ9ViV[ndjign!ndj l^aahZZi]Z[daadl^c\Zggdg/ RMAN> LIST FAILURE; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of list command at 02/15/2009 18:33:58 RMAN-05533: LIST FAILURE is not supported on STANDBY database
I]Z9ViVGZXdkZgn6Yk^hdg^hVahdVkV^aVWaZ^cc[[aVh]WVX`^hZcVWaZYdci]Zeg^bVgn!ndjXVcgZXdkZgi]Zeg^bVgnVcYhiVcYWn YViVWVhZeg^dgidi]ZZggdgdXXjgg^c\#=dlZkZg!^[bZY^VgZXdkZgn^hgZfj^gZY!VgZhidgZVcY gZXdkZgnl^aaWZcZZYZY#Dci]Zeg^bVgn!Ydi]Z[daadl^c\# 1. Bdjcii]ZYViVWVhZZmXajh^kZ/ SQL> startup mount exclusive ORACLE instance started. Total System Global Area 1.0737E+10 bytes Fixed Size 2101912 bytes Variable Size 4160753000 bytes
8]VeiZg&'/ 7VX`jeVcYGZXdkZgn8dch^YZgVi^dch Database Buffers Redo Buffers Database mounted.
437
6492782592 bytes 81780736 bytes
2. ;aVh]WVX`i]ZYViVWVhZ/ SQL> flashback database to ' timestamp>; Flashback complete.
3. DeZci]ZYViVWVhZgZhZiad\h/ SQL> alter database open resetlogs; Database altered.
Dci]ZhiVcYWnYViVWVhZ!ndjl^aacZZYid^hhjZi]ZhVbZFLASHBACK STANDBY DATABASEhiViZbZcidci]ZhiVcYWnYViVWVhZWZ[dgZgZhiVgi^c\VeeanhZgk^XZh#CdiZi]VindjYd cdiZmZXjiZOPEN RESETLOGSdcVe]nh^XVahiVcYWnYViVWVhZV[iZgi]ZflashbackXdbbVcY#
Recovering from a Dropped Table I]Z[daadl^c\^hVcZmVbeaZd[gZXdkZg^c\[gdbi]ZVXX^YZciVaYgdee^c\d[ViVWaZ# 1. 9gdei]ZiVWaZ/ SQL> drop table matrix_user.movie_titles; Table dropped.
2. ;aVh]WVX`i]ZiVWaZ/ SQL> flashback table matrix_user.movie_titles to before drop; Flashback complete.
Recover a Missing Datafile from a Backup Taken on the Standby I]Z[daadl^c\XdkZghi]ZegdXZYjgZhndjl^aacZZYid[daadlidgZhidgZVYViV[^aZidi]Zeg^bVgn YViVWVhZl^i]VWVX`jei]VilVhiV`ZcdcVe]nh^XVahiVcYWn# RMAN> list failure; List of Database Failures ========================= Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------402 HIGH OPEN 12-FEB-09 One or more non-system datafiles are missing RMAN> repair failure preview; List of Database Failures =========================
438
DgVXaZ9ViV Strategy: The repair includes complete media recovery with no data loss Repair script: /u01/app/oracle/diag/rdbms/matrix/matrix/hm/reco_515388588.hm contents of repair script: # restore and recover datafile sql 'alter database datafile 7, 8 offline'; restore datafile 7, 8; recover datafile 7, 8; sql 'alter database datafile 7, 8 online';
1. D[[a^cZi]Zb^hh^c\YViV[^aZh/ RMAN> sql 'alter database datafile 7, 8 offline'; sql statement: alter database datafile 7, 8 offline
2. 6hhdX^ViZi]ZhiVcYWnWVX`jel^i]i]Zeg^bVgnYViVWVhZ/ RMAN> change backup tag='ORALINUX2_FULL_021209' from db_unique_name matrixdr reset db_unique_name; change backup piece db_unique_name backup piece handle=/media/orclvol3/matrix_df678591310_24_1 RECID=15 STAMP=678591326
8]VeiZg&'/ 7VX`jeVcYGZXdkZgn8dch^YZgVi^dch
439
change backup piece db_unique_name backup piece handle=/media/orclvol3/matrix_df678591351_25_1 RECID=16 STAMP=678591366 change backup piece db_unique_name backup piece handle=/media/orclvol3/matrix_df678591452_26_1 RECID=17 STAMP=678591467 Changed 3 objects db_unique_name
3. GjcVa^hihjbbVgnidZchjgZi]Vii]ZWVX`jehVgZcdlVXXZhh^WaZWni]Zeg^bVgnYViVWVhZ/ RMAN> LIST BACKUPSET SUMMARY; List of Backups =============== Key TY LV S Device Type Completion Time ------- -- -- - ----------- --------------1017 B 0 A DISK 11-FEB-09 ORALINUX1_FULL_021109 1018 B 0 A DISK 11-FEB-09 ORALINUX1_FULL_021109 1019 B 0 A DISK 11-FEB-09 ORALINUX1_FULL_021109 1037 B F A DISK 11-FEB-09 TAG20090211T223025 1096 B 0 A DISK 12-FEB-09 ORALINUX2_FULL_021209 1097 B 0 A DISK 12-FEB-09 ORALINUX2_FULL_021209 1098 B 0 A DISK 12-FEB-09 ORALINUX2_FULL_021209
#Pieces #Copies Compressed Tag ------- ------- ---------- --1 1 NO 1
1
NO
1
1
NO
1
1
NO
1
1
NO
1
1
NO
1
1
NO
4. GZhidgZi]ZYViV[^aZh[gdbi]ZhiVcYWnWVX`je/ RMAN> restore datafile 7, 8 from tag='ORALINUX2_FULL_021209'; Starting restore at 12-FEB-09 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00007 to /media/orclvol2/oradata/matrix/location_d_01.dbf channel ORA_DISK_1: reading from backup piece /media/orclvol3/matrix_df678591351_25_1 channel ORA_DISK_1: piece handle=/media/orclvol3/matrix_ df678591351_25_1 tag=ORALINUX2_FULL_021209 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00008 to /media/orclvol1/oradata/matrix/location_i_01.dbf channel ORA_DISK_1: reading from backup piece /media/orclvol3/matrix_df678591452_26_1
440
DgVXaZ9ViV recover datafile 7, 8 from tag='ORALINUX2_FULL_021209'; Starting recover at 12-FEB-09 using channel ORA_DISK_1 starting media recovery media recovery complete, elapsed time: 00:00:01 Finished recover at 12-FEB-09
6. HZii]ZYViV[^aZhdca^cZ/ RMAN> sql 'alter database datafile 7, 8 online'; sql statement: alter database datafile 7, 8 online
General Best Practices ;daadl^c\^cYjhignWZhiegVXi^X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Zad\h#>il^aaWVX`je[gdbdcZ YZhi^cVi^dcVcYYZaZiZVaaXde^Zhd[i]ZVgX]^kZad\^ci]Zdi]ZgYZhi^cVi^dch!l]ZgZVh DELETE INPUTl^aaWVX`je[gdbdcZadXVi^dcVcYi]ZcYZaZiZdcanl]Vi]VhWZZc WVX`ZYje#JhZi]ZGB6CXdbbVcYBACKUP RECOVERY FILESidXdenY^h`WVX`jeh^c i]Z[aVh]gZXdkZgnVgZVidiVeZ#
Conclusion 6hVYViVWVhZVYb^c^higVidg!ndjVgZgZhedch^WaZ[dgi]ZVkV^aVW^a^ind[i]ZYViVWVhZh^cndjg Zck^gdcbZci#>ci]^hX]VeiZg!lZkZY^hXjhhZYWVX`jeVcYgZXdkZgnhigViZ\^Zh!iZX]c^fjZh!VcY i]Z^ciZ\gVi^dcd[GB6C^cV9ViVi^hXgjX^Vai]VindjheZcYi^bZeaVcc^c\! iZhi^c\!VcYYdXjbZci^c\ndjgWVX`jeVcYgZXdkZgnhigViZ\^Zh#NdjgjcYZghiVcY^c\d[WVX`je VcYgZXdkZgnXdcXZeihVcYndjg`cdlaZY\Zd[l]^X]iZX]c^fjZhidjhZYjg^c\VheZX^[^XineZd[ gZXdkZgnl^aaZcVWaZndjidgZhedcY^cVi^bZanVcYZ[[^X^ZcibVccZgYjg^c\VcZbZg\ZcXn#Ndj l^aaVahdlVciidgZk^ZlDgVXaZ9ViVcVYY^i^dc!ndjVgZcdieZgb^iiZYidjhZVcnd[i]Z [daadl^c\HFAhiViZbZcih/ SQL> SQL> SQL> SQL>
ALTER ALTER ALTER ALTER
DATABASE DATABASE DATABASE DATABASE
RENAME ADD/DROP LOGFILE ADD/DROP STANDBY LOGFILE MEMBER CREATE DATAFILE AS
>[ndjViiZbeiidjhZVcnd[i]ZhZhiViZbZcihdci]ZhiVcYWnYViVWVhZ!i]Z[daadl^c\Zggdg^h gZijgcZY^[STANDBY_FILE_MANAGEMENT^hhZiidAUTO/ ORA-01511: error in renaming log/data files ORA-01270: RENAME operation is not allowed
NdjXVchi^aaVYYVcYYZaZiZhiVcYWngZYdad\[^aZh/ SQL> ALTER DATABASE ADD/DROP STANDBY LOGFILE;
Physical Standby Issues Ndjl^aaa^`ZanZcXdjciZghZkZgVaXdbbdc^hhjZhl]ZcbVcV\^c\Ve]nh^XVaYViVWVhZ/ N NdjXVccdibdjcii]Ze]nh^XVahiVcYWnYViVWVhZ# N I]ZhiVcYWnVgX]^kZYZhi^cVi^dc^hcdiYZ[^cZYegdeZgan# N I]ZhiVcYWnh^iZYdZhcdigZXZ^kZad\h# N I]ZhiVcYWnh^iZ^hcdiegdXZhh^c\i]Zad\hBGEYdlc!VcYhddc#
Unable to Mount the Physical Standby Database I]Ze]nh^XVahiVcYWnXVc¼iWZbdjciZY^[i]ZXdcigda[^aZlVhXgZViZYl^i]VcdeZgVi^c\hnhiZb· XgZViZYWVX`jedgVWVX`jeXgZViZYjh^c\VcALTER DATABASEhiViZbZciwithouti]ZSTANDBY dei^dch#I]ZhiVcYWnXdcigda[^aZbjhiWZXgZViZYl^i]i]ZALTER DATABASE CREATE STANDBY CONTROLFILEhiViZbZcidgi]ZGB6CBACKUP CURRENT CONTROLFILEl^i]i]ZFOR STANDBY dei^dc#
Primary Database Shutdown >[ndj]VkZXdc[^\jgZYhiVcYWngZYdad\[^aZhdcndjghiVcYWnYViVWVhZ!i]Zh^oZd[i]ZXjggZci hiVcYWngZYdad\[^aZdcZVX]hiVcYWnYViVWVhZbjhiWZi]ZhVbZh^oZVhi]ZgZYdad\[^aZdci]Z eg^bVgnYViVWVhZ#6[iZgVad\hl^iX]!^[cdVkV^aVWaZhiVcYWngZYdad\[^aZhbViX]i]Zh^oZd[i]ZgZYd ad\[^aZdci]Zeg^bVgnYViVWVhZ!i]Zeg^bVgnl^aah]jiYdlc^[^i^h^cBVm^bjbEgdiZXi^dcbdYZ#
8]VeiZg&(/ IgdjWaZh]ddi^c\9ViVciZgb^iiZcian:ggdghl^i]DG6"&'*,%VcYCdiZ&*&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dlZkZg!^[i]ZhiViZbZci^hcdihjXXZhh[ja!ndj l^aacZZYidXdci^cjZl^i]i]ZcZmihiZeh# 2. L]Zci]Zhl^iX]dkZglVhhiVgiZY!VigVXZ[^aZlVhlg^iiZc^ci]Zad\Y^gZXidgn#I]^h igVXZ[^aZXdciV^chi]ZHFAhiViZbZcihcZZYZYidgZ"XgZViZi]Zdg^\^cVaeg^bVgnXdcigda [^aZ#8VeijgZi]ZhiViZbZcih[gdbi]^h[^aZVcYZmZXjiZi]Zb[gdbHFAEajhdci]ZcZl hiVcYWnYViVWVhZ#I]ZcZlhiVcYWnYViVWVhZl^aagZkZgiWVX`idi]Zeg^bVgngdaZ# 3. H]jiYdlci]Zdg^\^cVae]nh^XVahiVcYWnYViVWVhZVcYXgZViZVcZlhiVcYWnXdcigda[^aZ dci]Zeg^bVgnYViVWVhZ#8deni]ZhiVcYWnXdcigda[^aZidi]Zdg^\^cVae]nh^XVahiVcYWn h^iZ#I]Z[daadl^c\^hVcZmVbeaZd[]dlidgZ"XgZViZi]ZhiVcYWnXdcigda[^aZ/ SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; SQL> SHUTDOWN IMMEDIATE;
8]VeiZg&(/ IgdjWaZh]ddi^c\9ViV ALTER DATABASE CREATE STANDBY controlfile as '';
4. GZhiVgii]Zdg^\^cVae]nh^XVahiVcYWn^chiVcXZ#>[i]^hegdXZYjgZ^hhjXXZhh[jaVcYVgX]^kZ \VebVcV\ZbZci^hZcVWaZY!i]Z;ZiX]6gX]^kZAd\;6AegdXZhhZhl^aahiVgiVcY gZVgX]^kZVcnb^hh^c\VgX]^kZYgZYdad\[^aZhidi]Ze]nh^XVahiVcYWnYViVWVhZ#NdjXVc cdlViiZbeii]Zhl^iX]dkZgV\V^cV[iZgXdggZXi^c\Vcn^hhjZhi]ViaZYidi]Z[V^ajgZd[ ^c^i^Vahl^iX]dkZg#
Switchover—Archived Redo Logs Are Not Applied 6[iZgVhjXXZhh[jahl^iX]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