Oracle 9i设置简单步骤一步一步学

更新时间:2023-07-07 20:29:57 阅读: 评论:0

Oracle 9i设置步骤:

源数据库SIDsource
目标数据库SIDtarget

一。设置如下初始化参数:
AQ_TM_PROCESSES = 1周忱10z
GLOBAL_NAMES = true
JOB_QUEUE_PROCESSES >=2
COMPATIBLE = 9.2.0 or higher
LOG_PARALLELISM = 1

二。源数据库必须工作在自动归档模式:
*.log_archive_start=true
*.log_archive_dest_1='LOCATION=/tpdata/admin/source/arc'


三。在source社团宣传海报上建strmadmin用户:
create ur strmadmin identified by strmadmin default tablespace DATA诚实的什么
grant connect,resource,lect_catalog_role to strmadmin
grant execute on dbms_aqadm to strmadmin
grant execute on dbms_capture_adm to strmadmin
grant execute on dbms_propagation_adm to strmadmin
grant execute on dbms_streams_adm to strmadmin

BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_SET_OBJ,
grantee => 'strmadmin',
grant_option => FALSE);
END;
/

BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_OBJ,
grantee => 'strmadmin',
grant_option => FALSE);
END;
/
四。在source上建streams queue
connect strmadmin/strmadin@source
SQL> exec dbms_streams_adm.t_up_queue();
PL/SQL procedure successfully completed
五。建sourcetargetdblink
create databa link target connect to strmadmin identified by strmadmin using 'target'
风起云淡六。在target上建strmadmin用户
create ur strmadmin identified by strmadmin default tablespace DATA
grant connect,resource,lect_catalog_role to strmadmin
grant all st to strmadmin
(其中wy.testtarget库里面的target table
grant execute on dbms_apply_adm to strmadmin
grant execute on dbms_aqadm to strmadmin
grant execute on dbms_streams_adm to strmadmin
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_SET_OBJ,
grantee => 'strmadmin',
grant_option => FALSE);
END;
/
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_OBJ,
grantee => 'strmadmin',
grant_option => FALSE);
END;
儿童脑筋急转弯大全/
七。在target上建streams queue
connect strmadmin/strmadin@target
SQL> exec dbms_streams_adm.t_up_queue();
PL/SQL procedure successfully completed
八。在source上建LogMiner tablespace
create tablespace logmnrts datafile '/tpdata/app/oracle/oradata/source/logmnrts.dbf' size 100M
SQL> exec dbms_logmnr_d.t_tablespace('logmnrts');
PL/SQL procedure successfully completed
九。在source上打开source stsupplenmental logging
alter st add supplemental log group log_group_jobs_pk (id) always
十。在source上配置Propagation
conn strmadmin/strmadin@source
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_PROPAGATION_RULES(
table_name => 'wy.test',
streams_name => 'source_to_target',
source_queue_name => 'strmadmin.streams_queue',
destination_queue_name => 'strmadmin.streams_queue@target',
include_dml => true,
include_ddl => true,
source_databa => 'source');
END;
/

十一。在source上配置Capture:
conn strmadmin/strmadin@source

BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES(
table_name => 'wy.test',
streams_type => 'capture',
streams_name => 'capture_source',
queue_name => 'strmadmin.streams_queue',
include_dml => true,
include_ddl => true);
END;
/
十二。Instantiate步骤:
这个步骤假设sourcetarget上,表wy.test都存在,而且结构一致,做instantiate实际上是一个export/import的步骤,在这个例子里,会把表wy.testinstantiate SCN倒出来,再导入到target上,保证两表instantiate SCN的一致,这是target新春快乐祝福语上的apply开始正常工作的必须前提
exp wy/wy@source file=wy_test.dmp tables=test object_consistent=y rows=n
imp wy/wy@target file=wy_test.dmp ignore=y commit=y streams_instantiation=y
十三。droptargetwy.testsupplenmental log group
will的过去式conn wy/wy@target
alter st drop supplemental log group log_group_jobs_pk
十四。在target上配置Apply
conn strmadmin/strmadmin@target

BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES(
table_name => 'wy.test',
streams_type => 'apply',
streams_name => 'apply_target',
queue_name => 'strmadmin.streams_queue',
include_dml => true,
include_ddl => true,
source_databa => 'source');
END;
/
十五。启动target上的Apply
BEGIN
DBMS_APPLY_ADM.SET_PARAMETER(
apply_name => 'apply_target',
parameter => 'disable_on_error',
value => 'n');
END;
/


BEGIN
DBMS_APPLY_ADM.START_APPLY(
apply_name => 'apply_target');
END;
/

十六。启动source上的Capture
conn strmadmin/strmadin@source

BEGIN
DBMS_CAPTURE_ADM.START_CAPTURE(
capture_name => 'capture_source');
END;
/

十七。验证同步效果

同步1000行数据 3
同步10000行数据 10
同步100000行数据普通话资料 10分钟

本文发布于:2023-07-07 20:29:57,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/1084232.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:工作   步骤   自动   设置   数据库   模式   归档   社团
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图