veridata配置和添加比对命令实现

生成复制配置文件

spool on;
spool /home/oracle/12ctest.prm;
set echo off;
set heading off;
set linesize 32767;
set pagesize 1000;
set trimspool on;
set trimout on;
set termout off;
SELECT 'replicat 12ctest' || CHR(10) from dual;
select 'MAP ' || owner || '.' || table_name || ', TARGET ' || owner || '.' ||
       table_name || ',' || chr(10) || 'KEYCOLS (' || columns || ');'
  from (select c.owner,
               c.table_name,
               listagg(c.column_name, ',') within group(order by c.column_id) columns
          from dba_tables t, dba_tab_columns c
         where t.owner = upper('TEST01')
           and t.owner = c.owner
           and t.table_name = c.table_name
           and not exists (select s.table_name
                  from dba_constraints s
                 where s.owner = t.owner
                   and s.table_name = t.table_name
                   and s.constraint_type = 'P')
         group by c.owner, c.table_name)

编辑连接文件:注意不要有空格

[oracle@serverdb]$ vi /home/oracle/prop79.txt
source.connection.host=localhost
source.connection.name=a_source2
source.connection.port=7867
source.connection.user=test01
source.connection.password=test01
target.connection.host=localhost
target.connection.name=a_target2
target.connection.port=7867
target.connection.user=test02
target.connection.password=test02

确认文件:注意格式

[oracle@serverdb]$ vi /home/oracle/12ctest.prm
replicat test12c5
map test01.test01, target test02.test01,
keycols (owner,object_name,subobject_name);
map test01.test02, target test02.test02,
colmap (owner = owner , object_name = object_name , subobject_name = subobject_name ), keycols (owner);

生产配置xml

[oracle@serverdb]$ ./veridata_param_process.sh -noscripting -wlport 8830 -wluser veridata -p /home/oracle/prop79.txt /home/oracle/12ctest.prm -o 12.xml
2018-07-10 15:22:29.336 NOTIFICATION Oracle GoldenGate Veridata Param Processing - Version 12.2.1.0.0 OGGVDT_12.2.1.0.0_PLATFORMS_151012.2202 For Testing Purposes Only
[oracle@serverdb]$

导入或更新:

[oracle@serverdb]$ ./veridata_import.sh -wlport 8830 -wluser veridata -create 12.xml
2018-07-10 15:26:05.004 NOTIFICATION Oracle GoldenGate Veridata Scripting - Version 12.2.1.0.0 OGGVDT_12.2.1.0.0_PLATFORMS_151012.2202 For Testing Purposes Only
[OGGV-50007: Enter WebLogic user password :]
[oracle@serverdb]$ ./veridata_import.sh -wlport 8830 -wluser veridata -update 13.xml
2018-07-10 16:16:39.542 NOTIFICATION Oracle GoldenGate Veridata Scripting - Version 12.2.1.0.0 OGGVDT_12.2.1.0.0_PLATFORMS_151012.2202 For Testing Purposes Only
[OGGV-50007: Enter WebLogic user password :]
2018-07-10 16:16:49.201 NOTIFICATION OGGV-50001 XML configuration is successful
[oracle@serverdb]$

–others

This entry was posted in GoldenGate. Bookmark the permalink.