版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
AdministeringaStreamsEnvironmentObjectivesAftercompletingthislesson,youshouldbeabletodothefollowing:AlteraStreamsenvironmentRemoveStreamscomponentsAdministerrulesthatareusedbyStreamscomponentsTroubleshootcommonapplyfailuresManagingtheCaptureProcessTheDBMS_CAPTURE_ADMpackagehasthefollowingproceduresformanagingthecaptureprocess:START_CAPTURESTOP_CAPTUREDROP_CAPTURESET_PARAMETERINCLUDE_EXTRA_ATTRIBUTEALTER_CAPTURE,whichenablesyouto:SpecifyorremovearulesetSetthestartSCNSpecifyingExtraAttributesforCaptureBEGINDBMS_CAPTURE_ADM.INCLUDE_EXTRA_ATTRIBUTE(capture_name=>'CAPTURE1',attribute_name=>'username');DBMS_CAPTURE_ADM.INCLUDE_EXTRA_ATTRIBUTE(capture_name=>'CAPTURE1',attribute_name=>'tx_name');END;/ModifyingtheCaptureProcessCaptureprocessparameterscontrolthewayinwhichacaptureprocessoperates.SetparameterswiththeSET_PARAMETERprocedureofDBMS_CAPTURE_ADM.BEGINDBMS_CAPTURE_ADM.SET_PARAMETER(capture_name=>'capture1',parameter=>'parallelism',value=>'4');END;/ManagingCaptureProcessSCNsCAPTUREFirst
SCNRequired
checkpoint
SCNMaximum
checkpoint
SCN9248909579921025868105310941117Start
SCNModifyingFIRST_SCNandSTART_SCNIncreasethevalueoffirst_scnforacaptureprocessto:RemoveunneededLogMinercheckpointinformationfromtheLogMinerdictionaryEnsurethatoldarchivedredologscanbesafelyremovedfromdiskSetthestart_scnforacaptureprocesstoatimeinthepasttorecapturechangesfromtheredologs.EXECDBMS_CAPTURE_ADM.ALTER_CAPTURE(-capture_name =>'CAPTURE1',-first_scn =>2524278);ModifyingFIRST_SCNandSTART_SCNIncreasethevalueoffirst_scnforacaptureprocessto:RemoveunneededLogMinercheckpointinformationfromtheLogMinerdictionaryEnsurethatoldarchivedredologscanbesafelyremovedfromdiskSetthestart_scnforacaptureprocesstoatimeinthepasttorecapturechangesfromtheredologs.EXECDBMS_CAPTURE_ADM.ALTER_CAPTURE(-capture_name =>'CAPTURE1',-first_scn =>2524278);AlteringFIRST_SCNforaCaptureProcessFirst
SCNStart
SCNRequired
checkpoint
SCNMaximum
checkpoint
SCN1First
SCNStart
SCNRequired
checkpoint
SCNMaximum
checkpoint
SCN2ABCDEFGHIJK11222RemovingUnnecessary
ArchivedLogFilesTheDBA_LOGMNR_PURGED_LOGdatadictionaryviewliststhearchivedredologfilesthatarenolongerneededbyanycaptureprocess.SQL>SELECT*FROMDBA_LOGMNR_PURGED_LOG;FILE_NAME---------------------------------------------------/u01/app/oracle/oradata/amer/archive/amer_1_415_531060081.dbf/u01/app/oracle/oradata/amer/archive/amer_1_416_531060081.dbf/u01/app/oracle/flash_recovery_area/ED_AMER/archivelog/2004_07_27/o1_mf_1_417_0jdz18wo_.arcPurgingtheStagingQueueTheDBMS_AQADM.PURGE_QUEUE_TABLEprocedure:RemovesmessagesfrompersistentqueuesIsusefulforbothsingle-consumerandmulticonsumerqueuesCanbecustomizedtopurgeonlymessagesthatmeetspecificconditionsPurgingtheStagingQueueWhenpurgingeventsfromaqueue,youcanspecify:ApurgeconditionWhetheranexclusivelockisobtainedduringthepurgeoperationDECLAREpurge_optDBMS_AQADM.aq$_purge_options_t;BEGINpurge_opt.block:=TRUE;DBMS_AQADM.PURGE_QUEUE_TABLE(queue_table=>'STRMADMIN.STREAMS_QUEUE_TABLE',purge_condition=>'queue=''STREAMS_QUEUE''',purge_options=>purge_opt);END;PurgeConditions:ExamplesPurgealleventsinaqueuetable
Purgealleventsforaqueueinaqueuetable
Purgealleventsinaparticularstateforaqueue
PurgeallmessagesforaconsumerPurgemessagesbasedonenqueuetime
purgecondition:NULLpurgecondition:queue='streams_queue'purgecondition:queue='hr_queue'andmsg_state='READY'purgecondition:consumer_name='ORDERS_DEQ'purgecondition:enq_time>'30-MAR-06'ManagingPropagationsUsetheDBMS_PROPAGATION_ADMpackagemethodstomanagepropagation:DBMS_PROPAGATION_ADM.START_PROPAGATIONmethodstartsapropagation.DBMS_PROPAGATION_ADM.STOP_PROPAGATIONstopsapropagation.AlteringthePropagationScheduleBEGINDBMS_AQADM.ALTER_PROPAGATION_SCHEDULE(queue_name=>'strmadmin.hr_queue',destination=>'SITE2.NET',duration=>300,next_time=>'SYSDATE+900/86400',latency=>30);END;/ManagingApplyProcessesTheDBMS_APPLY_ADMpackagecontainsthefollowingprocedures:START_APPLYALTER_APPLY,whichyoucanuseto:SpecifyorremovearulesetSpecifyorremoveamessage,DDL,orprecommithandlerSpecifyanapplyuserSpecifyorremoveatagforapplyeventsSTOP_APPLYDROP_APPLYModifyingtheApplyProcessSetparameterswiththeSET_PARAMETERprocedureofDBMS_APPLY_ADM.ThevalueforaparameterisalwaysenteredasaVARCHAR2,regardlessoftheparameter’sdatatype.EXECDBMS_APPLY_ADM.SET_PARAMETER(-'apply_site1_lcrs','disable_on_error','N');StartingStreamsProcessesThecaptureandapplyprocessesaredisabledaftercreation.UsetheSTART_APPLYorSTART_CAPTUREprocedurestoenabletheprocesses:BEGINDBMS_APPLY_ADM.START_APPLY(apply_name=>'apply_site1_msg');END;/StoppingStreamsProcessesUsetheSTOP_APPLYorSTOP_CAPTUREprocedurestodisabletheprocesses:Theprocessstatusismaintainedacrossdatabaseshutdowns.Anapplyprocessstopsandrestartsautomaticallyifparallelismisaltered.RuntheSTOP_PROPAGATIONproceduretostopanexistingpropagation.EXECUTEDBMS_CAPTURE_ADM.STOP_CAPTURE(-capture_name=>'hr_capture');ManagingStreamsProcessRuleSetsSpecifyorremovearulesetforaprocess:DBMS_CAPTURE_ADM.ALTER_CAPTUREDBMS_APPLY_ADM.ALTER_APPLYDBMS_PROPAGATION_ADM.ALTER_PROPAGATIONAddrulestoarulesetforaprocess:DBMS_STREAMS_ADM.ADD_*_RULESDBMS_STREAMS_ADM.ADD_*_PROPAGATION_RULESDBMS_RULE_ADM.ADD_RULERemovearulefromarulesetusedby
aStreamsprocess:DBMS_STREAMS_ADM.REMOVE_RULEDBMS_RULE_ADM.REMOVE_RULEAddingNewRules:ExampleBEGINDBMS_STREAMS_ADM.ADD_SUBSET_PROPAGATION_RULES(table_name=>'HR.EMPLOYEES',dml_condition=>'job_idLIKE''SA%''',streams_name=>'prop_to_site3',
source_queue_name=>'strmadmin.hr_queue',
destination_queue_name
=>
'ix.streams_queue@',source_database=>NULL);END;/ManagingRulesandRuleSetsByusingtheDBMS_RULE_ADMpackage,youcan:AlteraruleChangearuleconditionChangeorremovetheruleevaluationcontextChangeorremovetherule’sactioncontextChangeorremovethecommentforaruleRemovearulefromarulesetDroparulefromthedatabaseDroparulesetfromthedatabaseAlteringaRuleBEGINDBMS_RULE_ADM.ALTER_RULE(rule_name=>'strmadmin.hr_emp_dml',condition=>':dml.get_object_owner()=''HR''AND:dml.get_object_name()=''EMPLOYEES''
AND:dml.get_compatible()=
DBMS_STREAMS.COMPATIBLE_9_2',evaluation_context=>NULL);END;/DroppingRuleSetsUsethedrop_unused_rule_setsparameterof:DBMS_CAPTURE_ADM.DROP_CAPTUREDBMS_APPLY_ADM.DROP_APPLYDBMS_PROPAGATION_ADM.DROP_PROPAGATIONDropstherulesetsalongwiththeStreamsclientEXECUTEDBMS_CAPTURE_ADM.DROP_CAPTURE(-capture_name=>'hr_capture',-drop_unused_rule_sets=>TRUE);RemovingaStagingQueueEXECUTEDBMS_STREAMS_ADM.REMOVE_QUEUE(-queue_name=>'STRMADMIN.streams_queue',-drop_unused_queue_table=>TRUE,-cascade=>TRUE);CascadeRemovingAllStreamsComponentsEXECUTEDBMS_STREAMS_ADM.REMOVE_STREAMS_CONFIGURATION();ManagingStreamswithEMNotesTroubleshootingApplyFailuresChecklist:Checkthestateoftheprocesses.DisabledWastheapplyprocessstoppedbyanotherDBA?Wasthecaptureprocesseverstarted?AbortedChecktheappropriatetracefileformessages.Arethereerrorsintheerrorqueue?Checkapplyprocesslatencyfornewlystartedapplyprocesses.Verifycapture,propagation,andapplyrules.Checkforprocesserrormessages.IstheApplyProcessCurrent?Querydictionaryviewstodeterminelatencyandactivity:V$STREAMS_APPLY_COORDINATORDBA_APPLY_PROGRESSSELECT(HWM_TIME-HWM_MESSAGE_CREATE_TIME)*86400"LatencyinSeconds",HWM_MESSAGE_CREATE_TIME"EventCreation",HWM_TIME"ApplyTime",HWM_MESSAGE_NUMBER"AppliedMessage#"FROMV$STREAMS_APPLY_COORDINATOR;CheckingforRulesConfirmthattheStreamsrulesetsarenotemptyandthatalltherulesareenabledbyqueryingDBA_STREAMS_RULESandDBA_RULE_SET_RULES.Checktheactualruleconditions.SELECTstreams_name,streams_type,sr.rule_set_name,sr.rule_nameFROMdba_rule_set_rulesrsr,
dba_streams_rulessrWHEREsr.rule_name=rsr.rule_nameANDrsr.rule_set_rule_enabled!='ENABLED';SELECTrule_name,streams_type,rule_conditionFROMDBA_STREAMS_RULES
WHERErule_name='ORDERS%';ORA-26687:InstantiationSCNNotSetForapplytoexecutecapturedchangeevents,thetargetdatabaseobjectmustbeinstantiated.IfapplyfailswithORA-26687,searchformissinginstantiationSCNs:DBA_APPLY_INSTANTIATED_OBJECTS(tableDML)DBA_APPLY_INSTANTIATED_SCHEMAS(schemaDDL)DBA_APPLY_INSTANTIATED_GLOBAL(globalDDL)Correcttheerrorby:SettingtheinstantiationSCNwithDataPump,ortheExportandImportutilitiesExecutingtheSET_*_INSTANTIATION_SCNprocedurestomanuallysettheinstantiationSCNStreamsDictionaryInformationStreamsdictionaryinformationmustbeavailableateachdestinationsite:Containsobjectnumbers,objectnames,objecttypes,columnnames,andothercriticalinformationforeachsourceobjectStoredinLogMinertablesStreamsdictionaryinformationisgeneratedatthesourcesitethrough:DBMS_CAPTURE_ADM.PREPARE_*_INSTANTIATIONDBMS_STREAMS_ADM.ADD_*_RULEDBMS_CAPTURE_ADM.BUILDCheckingforApplyReaderTraceFilesIfthedestinationStreamsdictionarydoesnotcontaininformationforanobjectreferencedinacapturedevent,thenitgeneratesanerror.Searchtheparallelexecutionserverprocesstracefilefortheinstanceforthephrase:
MISSINGStreamsmulti-versiondatadictionaryDeterminewhatobjectismissingfromtheStreamsdictionary.Missingdictionaryinformationisnotanapplyerror.grepMISSING*p0*MissingMultiversion
DataDictionaryInformationTopopulatetheStreamsdictionaryinformationattheapplysite:Determinethescopeofmissinginformation(table,schema,orglobal)attheapplysiteAtthesourcedatabase,prepareforinstantiation:DBMS_CAPTURE_ADM.PREPARE_SCHEMA_INSTANTIATION('HR');SummaryInthislesson,
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- GB/T 25223-2024動植物油脂甾醇組成和甾醇總量的測定氣相色譜法
- 2024年度云南省高校教師資格證之高等教育法規(guī)考前沖刺模擬試卷A卷含答案
- 2024-2025學(xué)年廣東省汕頭市潮陽一中明光學(xué)校高三(上)月考物理試卷(10月)(含答案)
- 2024年冷凝水回收裝置項(xiàng)目投資申請報告代可行性研究報告
- 贛南師范大學(xué)《環(huán)境監(jiān)測實(shí)驗(yàn)》2022-2023學(xué)年第一學(xué)期期末試卷
- 阜陽師范大學(xué)《材料科學(xué)與工程基礎(chǔ)》2022-2023學(xué)年第一學(xué)期期末試卷
- 福建師范大學(xué)協(xié)和學(xué)院《文獻(xiàn)檢索》2022-2023學(xué)年第一學(xué)期期末試卷
- 福建師范大學(xué)《中國地理》2023-2024學(xué)年第一學(xué)期期末試卷
- 2024年二級建造師機(jī)電-考點(diǎn)押題
- 工程質(zhì)量重大風(fēng)險預(yù)控和工程質(zhì)量事故處置指引
- 水質(zhì)監(jiān)測運(yùn)維方案
- 《清潔能源的應(yīng)用》課件
- 醫(yī)生經(jīng)紀(jì)人服務(wù)合同
- 16.分式共19節(jié)集體備課
- 城市人員走失搜救方案
- 完整版成品及半成品保護(hù)措施
- 管理培訓(xùn)教材-NPI新產(chǎn)品導(dǎo)入
- 視盤水腫治療及護(hù)理
- 質(zhì)量保證體系評價-評價表(ASES-ver.1.6)
- 短視頻的拍攝與剪輯
- 【題型專項(xiàng)特訓(xùn)】三年級數(shù)學(xué)上冊第五單元倍的認(rèn)識專項(xiàng)訓(xùn)練-解答題(人教版含答案)
評論
0/150
提交評論