绑定完请刷新页面
取消
刷新

分享好友

×
取消 复制
Oracle数据同步之SharePlex安装测试
2020-10-09 14:37:01

1 SharePlex 软件路径和数据路径

 软件路径productdir:程序文件和库文件

数据路径vardir:工作路径,包括:队列文件、日志文件、与当前复制环境相关的组件。

注意:不要删除、重命名或者编辑SharePlex默认安装的文件和目录,有隐藏文件是数据

复制必须的文件。即使空文件也必须保留,这些文件是SharePlex进程需要的。


sp_cop进程:该进程协调Share_Plex的复制进程,如Capture,Read,Export,Import,Post进程,SharePlex队列,

                       该进程初始化所有的后台进程,维护复制网络中与其他系统的通信功能。

                       该进程很少与用户交互,除了启动和关闭外,该进程一旦运行就成为后台进程。

sp_ctrl进程:启动,关闭以及监控SharePlex


SharePlex复制相关进程,源库read,capture,export,    目标库:import post

后续三个重要步骤


1 安装SharePlex软件

这个需要设置两个目录productdirvardir,需要用户名和序列号

2配置数据库,执行ora_setup脚本,根据提示输入即可,这个在源和目标都要执行。


3 迁移数据


导出数据

[oracle@sp11 ~]$ expdp system/oracle1234 directory=dir1 dumpfile=sales1.dmp tables=scott.sales,scott.customers flashback_scn=1783585;


Export: Release 12.2.0.1.0 - Production on Tue Sep 29 10:28:20 2020


Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.


UDE-28002: operation generated ORACLE error 28002

ORA-28002: the password will expire within 7 days


Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

Starting "SYSTEM"."SYS_EXPORT_TABLE_01":  system/******** directory=dir1 dumpfile=sales1.dmp tables=scott.sales,scott.customers flashback_scn=1783585 

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER

Processing object type TABLE_EXPORT/TABLE/TABLE

Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT

Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT

. . exported "SCOTT"."CUSTOMERS":"PA"                    5.921 KB       2 rows

. . exported "SCOTT"."CUSTOMERS":"PB"                    5.921 KB       2 rows

. . exported "SCOTT"."SALES":"PA"                        5.921 KB       2 rows

. . exported "SCOTT"."SALES":"PB"                        5.921 KB       2 rows

Master table "SYSTEM"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

******************************************************************************

Dump file set for SYSTEM.SYS_EXPORT_TABLE_01 is:

  /home/oracle/sales1.dmp

Job "SYSTEM"."SYS_EXPORT_TABLE_01" successfully completed at Tue Sep 29 10:29:27 2020 elapsed 0 00:01:05


导入数据


[oracle@sp22 ~]$ impdp system/oracle directory=dir1 dumpfile=sales1.dmp


Import: Release 12.2.0.1.0 - Production on Mon Oct 5 02:01:24 2020


Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.


UDI-28002: operation generated ORACLE error 28002

ORA-28002: the password will expire within 7 days


Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded

Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** directory=dir1 dumpfile=sales1.dmp 

Processing object type TABLE_EXPORT/TABLE/TABLE

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

. . imported "SCOTT"."CUSTOMERS":"PA"                    5.921 KB       2 rows

. . imported "SCOTT"."CUSTOMERS":"PB"                    5.921 KB       2 rows

. . imported "SCOTT"."SALES":"PA"                        5.921 KB       2 rows

. . imported "SCOTT"."SALES":"PB"                        5.921 KB       2 rows

Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT

Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS

Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT

Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER

 Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at Mon Oct 5 02:01:55 2020 elapsed 0 00:00:29


4 激活配置文件 

activate config myconfig


myconfig内容如下: 

Datasource:o.prod

SCOTT.sales SCOTT.sales sp22@o.prods

SCOTT.CUSTOMERS SCOTT.CUSTOMERS sp22@o.prods


sp_ctrl (sp11:3500)> show config


Tables Replicating with Key:


  "SCOTT"."CUSTOMERS"   KEY: CUST_ID

  "SCOTT"."SALES"   KEY: SALES_ID


File Name  :myconfig

Datasource :prod

Activated  :29-Sep-20 10:27:05

Actid      :5


Total Objects                 :2

Total Objects Replicating     :2

Total Objects Not Replicating :0


View config summary in /splex/vardir921/log/prod_config_log


激活配置文件后,会自动启动源和目标库的响应后台进程,并开始次同步数据。


源:

sp_ctrl (sp11:3500)> show


Process    Source                               Target                 State                   PID

---------- ------------------------------------ ---------------------- -------------------- ------

Export     sp11                                 sp22                   Running               20582

Capture    o.prod                                                      Running               14584

Read       o.prod                                                      Running               14591

目标库:

sp_ctrl (sp22:3500)> show


Process    Source                               Target                 State                   PID

---------- ------------------------------------ ---------------------- -------------------- ------

Import     sp11                                 sp22                   Running               14013

Post       o.prod-sp11                          o.prods                Running               14407


分享好友

分享这个小栈给你的朋友们,一起进步吧。

Oracle运维新鲜事-技术与管理各占半边天
创建时间:2020-08-04 11:34:57
本技术栈旨在分享技术心得,运维趣事,故障处理经验,调优案例,故障处理涉及集群,DG,OGG,大家生产中遇到的问题基本都会囊括了,我会发布生产库遇到的故障,希望在交流中互助互益,共同提高,也希望大家讨论,如果您有生产中遇到的集群问题,也可以在这里提出来,一起讨论,现实中也帮助不少同学解决了生产库的故障。
展开
订阅须知

• 所有用户可根据关注领域订阅专区或所有专区

• 付费订阅:虚拟交易,一经交易不退款;若特殊情况,可3日内客服咨询

• 专区发布评论属默认订阅所评论专区(除付费小栈外)

栈主、嘉宾

查看更多
  • Abraham林老师
    栈主
  • 小雨滴
    嘉宾
  • hawkliu
    嘉宾
  • u_97a59a25246404
    嘉宾

小栈成员

查看更多
  • 栈栈
  • dapan
  • 小菜鸟___
  • hwayw
戳我,来吐槽~