ogg搭建oracle

阅读: 评论:0

ogg搭建oracle

ogg搭建oracle

(翻到一篇2020年笔记里记录的通过ogg搭建pg到oracle同步的过程,当成一种笔记发出来供参考,为了下一篇文章做准备)

源库:  oracle(11.2.0.4) 192.168.10.141

目标库:pgsql(10.12)     192.168.10.128

ogg软件版本:(19.1.0.0.4)

ogg软件下载:Oracle GoldenGate Downloads

glibc问题处理:.html

1.在源端和目标端安装ogg软件

源端:

一、配置相应文件:oggcore.rsp

sponseFileVersion=/home/oracle/oggcore.rsp

INSTALL_OPTION=ORA11g

SOFTWARE_LOCATION=/oracle/ogg

START_MANAGER=false

MANAGER_PORT=7809

DATABASE_LOCATION=/oracle/db/11.2.0.4

INVENTORY_LOCATION=/oracle/oraInventory

UNIX_GROUP_NAME=oinstall

二、静默安装OGG

./runInstaller -silent -nowait -responseFile /home/oracle/oggcore.rsp

oracle@szgtsp431-or@ecsdb>./runInstaller -silent -nowait -responseFile /home/oracle/oggcore.rsp

Starting Oracle

Checking Temp space: must be greater than 120 MB.   Actual 32405 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 2048 MB    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-08-14_08-57-27AM. Please wait ...oracle@szgtsp431-or@ecsdb>You can find the log of this install session at:

 /oracle/oraInventory/logs/installActions2020-08-14_08-57-27AM.log

Successfully Setup Software.

The installation of Oracle GoldenGate Core was successful.

Please check '/oracle/oraInventory/logs/silentInstall2020-08-14_08-57-27AM.log' for more details.

2.修改数据库为归档模式

oracle@szgtsp431-or@ecsdb>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Aug 14 09:06:34 2020

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            /oracle/oradata/archivelog

Oldest online log sequence     19

Next log sequence to archive   21

Current log sequence           21

3.开启数据库的强制日志和最小附加日志

alter database force logging;

alter database add supplemental log data;

alter system switch logfile;

确认是否开启了强制日志和最小附加日志

select force_logging,supplemental_log_data_min from v$database;

4.修改enable_goldengate_replication参数

alter system set enable_goldengate_replication=true scope=both;

若为集群,所有节点都要修改:

alter system set enable_goldengate_replication=true scope=both sid='*';

5.创建ogg用户和ogg用户表空间并授权

create tablespace tbs_ogg datafile '/oracle/oradata/datafile/tbs_ogg01.dbf' size 100M;

create user goldengate identified by 123456 default tablespace tbs_ogg temporary tablespace temp;

grant create session,alter session to goldengate;

grant alter system to goldengate;

grant resource to goldengate;

grant connect to goldengate;

grant select any dictionary to goldengate;

grant flashback any table to goldengate;

grant select any table to goldengate;

grant select any table to goldengate;

grant insert any table to goldengate;

grant update any table to goldengate;

grant delete any table to goldengate;

grant select on dba_clusters to goldengate;

grant execute on dbms_flashback to goldengate;

grant create table to goldengate;

grant create sequence to goldengate;

grant alter any table to goldengate;

grant dba to goldengate;

grant lock any table to goldengate;

6.开启表级附件日志

要同步某个schema的表数据或者多个schema的数据,需要对表开启附加日志

检查附件日志:

SELECT

owner,

table_name,

log_group_name,

log_group_type,

decode( always, 'ALWAYS', 'Unconditional', NULL, 'Conditional' ) always

FROM dba_log_groups

ORDER BY owner,table_name,log_group_name;

选择空闲时段打开所需复制表的附加日志:

oracle@szgtsp431-or@ecsdb>ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 19.1.0.0.4 OGGCORE_19.1.0.0.0_PLATFORMS_191017.1054_FBO

Linux, x64, 64bit (optimized), Oracle 11g on Oct 17 2019 23:13:12

Operating system character set identified as US-ASCII.

Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.

GGSCI (szgtsp431-or) 1> dblogin userid goldengate,password 123456

Successfully logged into database.

GGSCI (szgtsp431-or as goldengate@ecsdb) 2> add trandata ecs.*

2020-08-14 09:13:54  INFO    OGG-15132  Logging of supplemental redo data enabled for table ECS.DEPT.

2020-08-14 09:13:54  INFO    OGG-15133  TRANDATA for scheduling columns has been added on table ECS.DEPT.

2020-08-14 09:13:54  INFO    OGG-15135  TRANDATA for instantiation CSN has been added on table ECS.DEPT.

2020-08-14 09:13:54  INFO    OGG-15132  Logging of supplemental redo data enabled for table ECS.INFO.

2020-08-14 09:13:54  INFO    OGG-15133  TRANDATA for scheduling columns has been added on table ECS.INFO.

2020-08-14 09:13:54  INFO    OGG-15135  TRANDATA for instantiation CSN has been added on table ECS.INFO.

2020-08-14 09:13:54  INFO    OGG-15132  Logging of supplemental redo data enabled for table ECS.STUDENT_INFO.

2020-08-14 09:13:54  INFO    OGG-15133  TRANDATA for scheduling columns has been added on table ECS.STUDENT_INFO.

2020-08-14 09:13:54  INFO    OGG-15135  TRANDATA for instantiation CSN has been added on table ECS.STUDENT_INFO.

GGSCI (szgtsp431-or as goldengate@ecsdb) 3>

查看日志是否添加成功:

SQL> select *from (

  2  select owner,table_name from dba_tables where owner in ('BGLWT')

  3  minus

  4  select owner,table_name from dba_log_groups)

  5  order by owner,table_name;

no rows selected

返回0行,表示所有的表级附加日志添加成功。

7.配置管理进程

oracle@szgtsp431-or@ecsdb>ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 19.1.0.0.4 OGGCORE_19.1.0.0.0_PLATFORMS_191017.1054_FBO

Linux, x64, 64bit (optimized), Oracle 11g on Oct 17 2019 23:13:12

Operating system character set identified as US-ASCII.

Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.

GGSCI (szgtsp431-or) 1> dblogin userid goldengate,password 123456

Successfully logged into database.

GGSCI (szgtsp431-or as goldengate@ecsdb) 2> create subdirs

Creating subdirectories under current directory /home/oracle

Parameter file                 /oracle/ogg/dirprm: created.

Report file                    /oracle/ogg/dirrpt: created.

Checkpoint file                /oracle/ogg/dirchk: created.

Process status files           /oracle/ogg/dirpcs: created.

SQL script files               /oracle/ogg/dirsql: created.

Database definitions files     /oracle/ogg/dirdef: created.

Extract data files             /oracle/ogg/dirdat: created.

Temporary files                /oracle/ogg/dirtmp: created.

Credential store files         /oracle/ogg/dircrd: created.

Masterkey wallet files         /oracle/ogg/dirwlt: created.

Dump files                     /oracle/ogg/dirdmp: created.

GGSCI (szgtsp431-or as goldengate@ecsdb) 3> edit param mgr

PORT 7809

DYNAMICPORTLIST 7810-7980

PURGEOLDEXTRACTS ./dirdat/*, USECHECKPOINTS, MINKEEPDAYS 3

PURGEDDLHISTORY MINKEEPDAYS 7, MAXKEEPDAYS 10

LAGREPORTHOURS 1

LAGINFOMINUTES 30

LAGCRITICALMINUTES 45

GGSCI (szgtsp431-or as goldengate@ecsdb) 6>

8.配置抽取进程

GGSCI (szgtsp431-or as goldengate@ecsdb) 7> add extract extecs, tranlog, threads 1,begin now

EXTRACT added.

GGSCI (szgtsp431-or as goldengate@ecsdb) 8> add exttrail ./dirdat/lt, extract extecs

EXTTRAIL added.

GGSCI (szgtsp431-or as goldengate@ecsdb) 9> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           

EXTRACT     STOPPED     EXTECS      00:00:00      00:00:38    

GGSCI (szgtsp431-or as goldengate@ecsdb) 10> edit param  extecs

EXTRACT extecs

SETENV (ORACLE_HOME = "/oracle/db/11.2.0.4")

SETENV (ORACLE_SID = "ecsdb")

USERID goldengate, PASSWORD 123456

EXTTRAIL ./dirdat/lt

TRANLOGOPTIONS EXCLUDEUSER goldengate

TRANLOGOPTIONS DBLOGREADER

DBOPTIONS ALLOWUNUSEDCOLUMN

FETCHOPTIONS USESNAPSHOT, USELATESTVERSION, MISSINGROW REPORT

STATOPTIONS REPORTFETCH

WARNLONGTRANS 1h, CHECKINTERVAL 10m

DYNAMICRESOLUTION

DISCARDFILE ./dirrpt/extecs.dsc, APPEND, MEGABYTES 1024

DISCARDROLLOVER AT 6:00

REPORTROLLOVER AT 6:00

REPORTCOUNT EVERY 1 MINUTES, RATE

DDL INCLUDE MAPPED

DDLOPTIONS ADDTRANDATA, REPORT

DDLOPTIONS NOCROSSRENAME, REPORT

TABLE ECS.*;

9.配置投递进程

GGSCI (szgtsp431-or as goldengate@ecsdb) 11> add extract deliecs, exttrailsource ./dirdat/lt

EXTRACT added.

GGSCI (szgtsp431-or as goldengate@ecsdb) 12> add rmttrail ./dirdat/rt, extract deliecs, megabytes 500

RMTTRAIL added.

GGSCI (szgtsp431-or as goldengate@ecsdb) 13> edit param deliecs

EXTRACT deliecs

PASSTHRU

DYNAMICRESOLUTION

RMTHOST 192.168.10.100, MGRPORT 7809

RMTTRAIL ./dirdat/rt

DISCARDFILE ./dirrpt/deliecs.dsc, APPEND, MEGABYTES 1024

DISCARDROLLOVER AT 6:00

REPORTCOUNT EVERY 1 MINUTES, RATE

REPORT AT  0:00

REPORT AT  1:00

REPORT AT  2:00

REPORT AT  3:00

...

REPORT AT 22:00

REPORT AT 23:00

REPORTROLLOVER AT 00:00

STATOPTIONS RESETREPORTSTATS

TABLE ECS.*;     

10.启动抽取进程

GGSCI (szgtsp431-or as goldengate@ecsdb) 20> start extecs

Sending START request to MANAGER ...

EXTRACT EXTECS starting

GGSCI (szgtsp431-or as goldengate@ecsdb) 21> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           

EXTRACT     STOPPED     DELIECS     00:00:00      00:06:06    

EXTRACT     RUNNING     EXTECS      00:00:00      00:00:01    

11.配置目标端ogg软件

一、上传ogg软件并解压

二、配置ogg软件的环境变量

[pgsql@szgtsp428-or ~]$ vi .bash_profile

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

export PGHOME=/usr/local/pgsql

export PGDATA=/data/pgsql

export OGG_HOME=/data/ogg

export PATH=$PATH:$PGHOME/bin:$OGG_HOME

LD_LIBRARY_PATH=$PGHOME/lib

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib:$OGG_HOME/lib

export LD_LIBRARY_PATH

export ODBCINI=/home/pgsql/odbc.ini

export DD_ODBC_HOME=/data/ogg

[pgsql@szgtsp428-or ~]$ ggsci

Oracle GoldenGate Command Interpreter for PostgreSQL

Version 19.1.0.0.200714 OGGCORE_19.1.0.0.0OGGBP_PLATFORMS_200628.2141

Linux, x64, 64bit (optimized), PostgreSQL on Jun 29 2020 03:59:15

Operating system character set identified as UTF-8.

Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.

GGSCI (szgtsp428-or) 1>

12.目标端创建库及表

ecsdb=# l

                                List of databases

   Name    |  Owner   | Encoding |   Collate   |    Ctype    | Access privileges 

-----------+----------+----------+-------------+-------------+-------------------

 ecsdb     | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 

 postgres  | pgsql    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 

 template0 | pgsql    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/pgsql         +

           |          |          |             |             | pgsql=CTc/pgsql

 template1 | pgsql    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/pgsql         +

           |          |          |             |             | pgsql=CTc/pgsql

(4 rows)

ecsdb=# d

            List of relations

 Schema |     Name     | Type  |  Owner   

--------+--------------+-------+----------

 public | student_info | table | postgres

(1 row)

ecsdb=# select * from student_info;

 id | name | address 

----+------+---------

  1 | 张三 | 广州

  2 | 李四 | 深圳

  3 | 王五 | 上海

  4 | 赵六 | 北京

  5 | 孙七 | 武汉

  6 | 阿大 | 成都

  7 | 阿二 | 南京

(7 rows)

13.配置目标端管理进程并启动mgr

[pgsql@szgtsp428-or ogg]$ ggsci

Oracle GoldenGate Command Interpreter for PostgreSQL

Version 19.1.0.0.200714 OGGCORE_19.1.0.0.0OGGBP_PLATFORMS_200628.2141

Linux, x64, 64bit (optimized), PostgreSQL on Jun 29 2020 03:59:15

Operating system character set identified as UTF-8.

Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.

GGSCI (szgtsp428-or) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     STOPPED                                           

GGSCI (szgtsp428-or) 2> create subdirs

Creating subdirectories under current directory /data/ogg

Parameter file                 /data/ogg/dirprm: created.

Report file                    /data/ogg/dirrpt: created.

Checkpoint file                /data/ogg/dirchk: created.

Process status files           /data/ogg/dirpcs: created.

SQL script files               /data/ogg/dirsql: created.

Database definitions files     /data/ogg/dirdef: created.

Extract data files             /data/ogg/dirdat: created.

Temporary files                /data/ogg/dirtmp: created.

Credential store files         /data/ogg/dircrd: created.

Masterkey wallet files         /data/ogg/dirwlt: created.

Dump files                     /data/ogg/dirdmp: created.

GGSCI (szgtsp428-or) 3> edit param mgr

port 7809

GGSCI (szgtsp428-or) 4> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     STOPPED                                           

GGSCI (szgtsp428-or) 5> start mgr

Manager started.

GGSCI (szgtsp428-or) 7> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           

GGSCI (szgtsp428-or) 8>

这个时候在源端启动投递进程  deliecs

oracle@szgtsp431-or@ecsdb>ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 19.1.0.0.4 OGGCORE_19.1.0.0.0_PLATFORMS_191017.1054_FBO

Linux, x64, 64bit (optimized), Oracle 11g on Oct 17 2019 23:13:12

Operating system character set identified as US-ASCII.

Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.

GGSCI (szgtsp431-or) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           

EXTRACT     ABENDED     DELIECS     00:00:00      01:06:41    

EXTRACT     RUNNING     EXTECS      00:00:00      00:00:07    

GGSCI (szgtsp431-or) 2> start deliecs

Sending START request to MANAGER ...

EXTRACT DELIECS starting

GGSCI (szgtsp431-or) 3> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           

EXTRACT     RUNNING     DELIECS     00:00:00      01:06:55    

EXTRACT     RUNNING     EXTECS      00:00:00      00:00:01      

GGSCI (szgtsp431-or) 4> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           

EXTRACT     RUNNING     DELIECS     00:00:00      00:00:00    

EXTRACT     RUNNING     EXTECS      00:00:00      00:00:05    

14.目标端pgsql的参数调整

[pgsql@szgtsp428-or pgsql]$ vi /data/f

wal_level = logical           #minimal, replica, or logical

max_replication_slots = 10    #max number of replication slots

max_wal_sender = 10           #maximum number of wal sender processes

wal_receiver_status_interval=10s  #optional, keep the system default

wal_sender_timeout  = 60s          #optional, keep the system default

track_commit_timestamp=off        #optional, keep the system default

调整参数后重启pgsql

[pgsql@szgtsp428-or pgsql]$ pg_ctl status -D /data/pgsql/ -l /data/pgsql/logfile

pg_ctl: server is running (PID: 2370)

/usr/local/pgsql/bin/postgres "-D" "/data/pgsql"

[pgsql@szgtsp428-or pgsql]$ pg_ctl stop -D /data/pgsql/ -l /data/pgsql/logfile

waiting for server to done

server stopped

[pgsql@szgtsp428-or pgsql]$ pg_ctl start -D /data/pgsql/

waiting for server 2020-08-14 11:00:45.360 CST [2817] LOG:  listening on IPv4 address "0.0.0.0", port 5432

2020-08-14 11:00:45.361 CST [2817] LOG:  listening on IPv6 address "::", port 5432

2020-08-14 11:00:45.364 CST [2817] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"

2020-08-14 11:00:45.375 CST [2818] LOG:  database system was shut down at 2020-08-14 10:50:10 CST

2020-08-14 11:00:45.378 CST [2817] LOG:  database system is ready to accept connections

 done

server started

15.数据源配置

vi odbc.ini

[pgsql@szgtsp428-or ~]$ vi /home/pgsql/odbc.ini

[ODBC Data Sources]

PGDSN=DataDirect 10.12 PostgreSQL Wire Protocol

postgres=DataDirect 10.12 PostgreSQL Wire Protocol

scott=DataDirect 10.12 PostgreSQL Wire Protocol

[ODBC]

IANAAppCodePage=4

InstallDir=/data/ogg

[PGDSN]

Driver=/data/ogg/lib/GGpsql25.so

Description=DataDirect 10.12 PostgreSQL Wire Protocol

Database=ecsdb

HostName=127.0.0.1

PortNumber=5432

LogonID=postgres

Password=123456

16.连接测试

[pgsql@szgtsp428-or ~]$ cd /data/ogg

[pgsql@szgtsp428-or ogg]$ ggsci

Oracle GoldenGate Command Interpreter for PostgreSQL

Version 19.1.0.0.200714 OGGCORE_19.1.0.0.0OGGBP_PLATFORMS_200628.2141

Linux, x64, 64bit (optimized), PostgreSQL on Jun 29 2020 03:59:15

Operating system character set identified as UTF-8.

Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.

GGSCI (szgtsp428-or) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           

GGSCI (szgtsp428-or) 2> dblogin sourcedb pgdsn userid postgres, password postgres

2020-08-14 11:35:01  INFO    OGG-03036  Database character set identified as UTF-8. Locale: en_US.UTF-8.

2020-08-14 11:35:01  INFO    OGG-03037  Session character set identified as UTF-8.

Successfully logged into database.

GGSCI (szgtsp428-or as postgres@pgdsn) 3>

17.目标端配置复制进程并启动

添加checkpoint table

[pgsql@szgtsp428-or ogg]$ ggsci

Oracle GoldenGate Command Interpreter for PostgreSQL

Version 19.1.0.0.200714 OGGCORE_19.1.0.0.0OGGBP_PLATFORMS_200628.2141

Linux, x64, 64bit (optimized), PostgreSQL on Jun 29 2020 03:59:15

Operating system character set identified as UTF-8.

Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.

GGSCI (szgtsp428-or) 1> dblogin sourcedb pgdsn userid postgres, password 123456

2020-08-14 15:22:52  INFO    OGG-03036  Database character set identified as UTF-8. Locale: en_US.UTF-8.

2020-08-14 15:22:52  INFO    OGG-03037  Session character set identified as UTF-8.

Successfully logged into database.

GGSCI (szgtsp428-or as postgres@pgdsn) 2> add checkpointtable public.chkt

Successfully created checkpoint table public.chkt.

GGSCI (szgtsp428-or as postgres@pgdsn) 4> list table public.*

public.chkt

public.chkt_lox

public.student_info

Found 4 tables matching list criteria.

GGSCI (szgtsp428-or as postgres@pgdsn) 34> edit param repl

REPLICAT repl

SOURCEDEFS ./dirdef/student_info.def

SETENV (PGCLIENTENCODING = "UTF8")

SETENV (ODBCINI="/home/pgsql/odbc.ini")

SETENV (NLS_LANG="AMERICAN_AMERICA.AL32UTF8")

targetdb pgdsn userid postgres, password 123456

DISCARDFILE ./dirrpt/repl.dsc, purge

MAP ecs.student_info, TARGET public.student_info;

GGSCI (szgtsp428-or as postgres@pgdsn) 36> add replicat repl,exttrail ./dirdat/rt,checkpointtable public.chkt

REPLICAT added.

GGSCI (szgtsp428-or as postgres@pgdsn) 38> start repl

Sending START request to MANAGER ...

REPLICAT REPL starting

GGSCI (szgtsp428-or as postgres@pgdsn) 55> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           

REPLICAT    RUNNING     REPL        00:00:00      00:00:08

18.测试验证

首先在目标端创建跟源端student_info一致的表结构

ecsdb=# create table student_info (id int primary key,name varchar(100),address varchar(100));

CREATE TABLE

然后进行数据初始化:

在源库配置extinit进程

GGSCI (szgtsp431-or as goldengate@ecsdb) 17> edit param extinit

EXTRACT extinit

userid goldengate, PASSWORD 123456

REPORTCOUNT EVERY 30 MINUTES, RATE

DISCARDFILE ./dirrpt/extinit.dsc, APPEND, MEGABYTES 1024

RMTHOST 192.168.10.100,MGRPORT 7809, compress

RMTTASK replicat,GROUP replinit

TABLE ecs.student_info;

GGSCI (szgtsp431-or as goldengate@ecsdb) 18> ADD EXTRACT extinit, SOURCEISTABLE

EXTRACT added.

在目标端配置replinit进程

GGSCI (szgtsp428-or as postgres@pgdsn) 28> edit param replinit

REPLICAT replinit

targetDB pgdsn, USERID postgres, PASSWORD 123456

discardfile ./dirrpt/replinit.dsc, PURGE

SOURCEDEFS ./dirdef/student_info.def

Map ecs.student_info,target public.student_info;

GGSCI (szgtsp428-or as postgres@pgdsn) 29>add replicat repinit, SPECIALRUN

REPLICAT added.

开启oracle到pg的数据初始化:

GGSCI (szgtsp431-or as goldengate@ecsdb) 9> start extinit

Sending START request to MANAGER ...

EXTRACT EXTINIT starting

目标端:(查看初始化行数)

View report replicat

查看两边的数据:

源:

SQL> set lines 200 pages 200;

SQL> col name for a10;

SQL> col address for a10;

SQL> select * from student_info;

        ID NAME       ADDRESS

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

         1 张三       广州

         2 李四       深圳

         3 王五       上海

         4 赵六       北京

         5 孙七       武汉

         6 阿大       成都

         7 阿二       南京

         8 阿三       北京

8 rows selected.

目标:

ecsdb=# select * from student_info;

 id | name | address 

----+------+---------

  1 | 张三 | 广州

  2 | 李四 | 深圳

  3 | 王五 | 上海

  4 | 赵六 | 北京

  5 | 孙七 | 武汉

  6 | 阿大 | 成都

  7 | 阿二 | 南京

  8 | 阿三 | 北京

(8 rows)

往源端插入数据:

SQL> insert into ecs.student_info values (10,'aa','bb');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from student_info;

        ID NAME       ADDRESS

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

         1 张三       广州

         2 李四       深圳

         3 王五       上海

         4 赵六       北京

         5 孙七       武汉

         6 阿大       成都

         7 阿二       南京

         8 阿三       北京

        10 aa         bb

9 rows selected.

查看目标端:

ecsdb=# select * from student_info;

 id | name | address 

----+------+---------

  1 | 张三 | 广州

  2 | 李四 | 深圳

  3 | 王五 | 上海

  4 | 赵六 | 北京

  5 | 孙七 | 武汉

  6 | 阿大 | 成都

  7 | 阿二 | 南京

  8 | 阿三 | 北京

 10 | aa   | bb

(9 rows)

数据已经同步OK了。

本文发布于:2024-01-29 13:51:16,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170650747815727.html

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

标签:ogg   oracle
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23