




版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 【正版授權(quán)】 ISO 25062:2025 EN Systems and software engineering - Systems and software Quality Requirements and Evaluation (SQuaRE) - Common Industry Format (CIF) for reporting usability
- 2025年度跨境電商物流配送服務(wù)合作協(xié)議書(shū)4篇
- 廣東電力市場(chǎng)2024年半年報(bào)告
- 2025年度體育產(chǎn)業(yè)合伙人投資管理合同模板
- 2025年紡織片梭織機(jī)合作協(xié)議書(shū)
- 2025年度房地產(chǎn)項(xiàng)目開(kāi)發(fā)貸款合同范本
- 2025年智能物流運(yùn)輸車(chē)輛節(jié)能減排服務(wù)協(xié)議
- 美術(shù)教育的社會(huì)責(zé)任倡導(dǎo)計(jì)劃
- 生物課程教學(xué)設(shè)計(jì)工作坊計(jì)劃
- 學(xué)生美術(shù)能力測(cè)評(píng)體系建設(shè)計(jì)劃
- 方案設(shè)計(jì)初步設(shè)計(jì)施工圖設(shè)計(jì)要求模板
- 新中國(guó)成立后的中國(guó)國(guó)防
- 2023-2024人教版小學(xué)2二年級(jí)數(shù)學(xué)下冊(cè)(全冊(cè))教案【新教材】
- 浙江省炮制規(guī)范2015版電子版
- 小學(xué)《體育與健康》體育基礎(chǔ)理論知識(shí)
- JJG 144-2007標(biāo)準(zhǔn)測(cè)力儀
- GB/T 740-2003紙漿試樣的采取
- GB/T 7324-2010通用鋰基潤(rùn)滑脂
- GB/T 5916-2020產(chǎn)蛋雞和肉雞配合飼料
- 婦產(chǎn)科急診患者院前急救
- 急性會(huì)厭炎診療常規(guī)
評(píng)論
0/150
提交評(píng)論