Oracle英文版培训课件之Implement Streams:les04_第1页
Oracle英文版培训课件之Implement Streams:les04_第2页
Oracle英文版培训课件之Implement Streams:les04_第3页
Oracle英文版培训课件之Implement Streams:les04_第4页
Oracle英文版培训课件之Implement Streams:les04_第5页
已阅读5页,还剩15页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

System-CreatedRulesObjectivesAftercompletingthislesson,youshouldbeabletodothefollowing:Identifythedifferenttypesofsystem-createdrulesUseanegativerulesettopreventaStreamsclientfromperformingitstaskonanindividualobjectUsesubsetrulestorestrictthedatathatflowsthroughthestreamCustomizesystem-createdrulesQuerythedatadictionaryforinformationabout

system-createdrulesUsingRulesinOracleStreamsThefollowingStreamsclientsuserulesandrulesets:CaptureprocessPropagationjobApplyprocessMessagingclientThesamerulesetcanbeusedbymultipleStreamsclientsinthesamedatabase.MultiplerulesinarulesetarecombinedwiththeORoperator.UsingRulesinOracleStreamsYoucanuserulestodefinethegranularityatwhichacaptureprocess,propagationjob,orapplyprocessreplicatesdata.Levelsofgranularity:DatabaseSchemaTableSubsetofrowsinatableDMLoperationsonlyDDLoperationsonlySubsetofoperationsthatareperformedagainstatableGeneratingSystem-CreatedRulesYouuseproceduresintheDBMS_STREAMS_ADMpackagetogeneratesystem-createdrules.Foraspecificcomponent:ADD_TABLE_RULESADD_SCHEMA_RULESADD_GLOBAL_RULESADD_SUBSET_RULES

ADD_*_PROPAGATION_RULESFormultiplecomponents:MAINTAIN_SIMPLE_TTS,MAINTAIN_TTSMAINTAIN_GLOBALMAINTAIN_SCHEMASMAINTAIN_TABLESGeneratingSystem-CreatedRulesTheproceduresintheDBMS_STREAMS_ADMpackagethatgeneratesystem-createdrulesalsoperformthefollowingactions:Createacaptureprocess,propagationjob,orapplyprocessifthespecifiedprocessorjobdoesnotalreadyexistCreatearulesetforthespecifiedcaptureprocess,propagationjob,orapplyprocessifarulesetdoesnotalreadyexistfortheprocessorjobCreatezeroormorerulesandaddtherulestotherulesetfortheprocessorjobSystem-CreatedRule:ExampleSystem-createdruleconditionforthetable-levelrule:EXECUTEDBMS_STREAMS_ADM.ADD_TABLE_RULES(-table_name=>'hr.employees',-streams_type=>'apply',-streams_name=>'apply_site1_lcrs',-queue_name=>'streams_queue',-source_database=>'');:dml.get_object_owner()='HR'and:dml.get_object_name()='EMPLOYEES'AND:dml.is_null_tag()='Y'AND:dml.get_source_database_name()='SITE1.NET'System-CreatedRuleComponentsUseabuilt-inevaluationcontextMayhaveoneormoreassociatedactioncontextsCapture

rulesetEvaluationcontextEvaluationcontextActioncontextTableruleEvaluationcontextSchemaruleUsingSubsetRuleswithOracleStreamsSubsetrulescanbecreatedforcapture,propagation,andapplywiththeDBMS_STREAMS_ADMpackage.Site1CaptureSite2PropApplyCreatingSubsetRulesBEGINDBMS_STREAMS_ADM.ADD_SUBSET_RULES(table_name=>'hr.regions',dml_condition=>'region_id=2',streams_type=>'capture',streams_name=>'hr_capture', queue_name=>'hr_queue');END;/RowSubsettingdml_condition=>'order_status<5'online04-JUN-0423890direct05-MAY-0424567direct14-DEC-04245194ORDER_STATUSonline18-NOV-042390ORDER_MODEORDER_DATEORDER_ID0direct04-OCT-0424535direct 31-OCT-042457CustomizingSystem-CreatedRules(:ddl.get_object_owner()='HR')and(:ddl.get_object_type()!='INDEX')BEGINDBMS_STREAMS_ADM.ADD_SCHEMA_RULES(schema_name=>'hr',streams_type=>'apply',streams_name=>'apply_site1_lcrs',queue_name=>'strmadmin.streams_queue',include_dml=>FALSE,include_ddl=>TRUE,and_condition=>':lcr.get_object_type()!=''INDEX'''

);END;/NegativeRuleSetsCapturePositive

rulesetNegative

rulesetRuleEvaluationwithRuleSetsPositive

rulesetNegative

ruleset1Positive

rulesetNegative

ruleset234TRUETRUEFALSEFALSECaptureruleset_posHRschemaHR.JOB_HISTORYruleset_negNegativeRuleSets:ExampleCreatingNegativeRulesBEGINDBMS_STREAMS_ADM.ADD_TABLE_RULES(table_name=>'hr.locations',streams_type=>'capture',streams_name=>'capture1',queue_name=>'strmadmin.streams_queue',inclusion_rule=>FALSE);END;/MonitoringSystem-CreatedRulesStreamsclientrules:[ALL|DBA]_STREAMS_RULES[ALL|DBA]_STREAMS_GLOBAL_RULES[ALL|DBA]_STREAMS_SCHEMA_RULES[ALL|DBA]_STREAMS_TABLE_RULESStreamsclientrulesets:[ALL|DBA]_CAPTURE[ALL|DBA]_PROPAGATION[ALL|DBA]_APPLYMessagerulesandrulesets:[ALL|DBA]_STREAMS_MESSAGE_RULES[ALL|DBA]_STREAMS_MESSAGE_CONSUMERSMonitoringNegativeRuleSetsPROPAGATION_NAME--------------------------------------NEGATIVE_RULE_SET_OWNER---------------------------NEGATIVE_RULE_SET_NAME----------------------------------------PROP_TO_SITE2STRMADMINRULESET$_31SQL>SELECTPROPAGATION_NAME,

2>NEGATIVE_RULE_SET_OWNER,

3>NEGATIVE_RULE_SET_NAME4>FROMDBA_PROPAGATION;SummaryInthislesson,youshouldhavelearnedhowto:Identifythedifferenttypesofsystem-createdrulesUseanegativerulesettopreventaStreamsclientfromperformingitstaskonanindividualobjectUsesubsetrulestorestrictthedatathatflowsthroughthestreamCustomizesystem-createdrul

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论